docs/plugins/sdk-subpaths.md
The plugin SDK is exposed as a set of narrow public subpaths under
openclaw/plugin-sdk/. This page catalogs the commonly used subpaths grouped by
purpose. The generated compiler entrypoint inventory lives in
scripts/lib/plugin-sdk-entrypoints.json; package exports are the public subset
after subtracting repo-local test/internal subpaths listed in
scripts/lib/plugin-sdk-private-local-only-subpaths.json. Maintainers can audit
the public export count with pnpm plugin-sdk:surface and active reserved
helper subpaths with pnpm plugins:boundary-report:summary; unused reserved
helper exports fail the CI report instead of staying in the public SDK as
dormant compatibility debt.
For the plugin authoring guide, see Plugin SDK overview.
| Subpath | Key exports |
|---|---|
plugin-sdk/plugin-entry | definePluginEntry |
plugin-sdk/core | defineChannelPluginEntry, createChatChannelPlugin, createChannelPluginBase, defineSetupPluginEntry, buildChannelConfigSchema, buildJsonChannelConfigSchema |
plugin-sdk/config-schema | OpenClawSchema |
plugin-sdk/provider-entry | defineSingleProviderPluginEntry |
plugin-sdk/migration | Migration provider item helpers such as createMigrationItem, reason constants, item status markers, redaction helpers, and summarizeMigrationItems |
plugin-sdk/migration-runtime | Runtime migration helpers such as copyMigrationFileItem, withCachedMigrationConfigRuntime, and writeMigrationReport |
These subpaths remain package exports for older plugins and OpenClaw test suites,
but new code should not add imports from them: agent-runtime-test-contracts,
channel-contract-testing, channel-target-testing, channel-test-helpers,
plugin-test-api, plugin-test-contracts, provider-http-test-mocks,
provider-test-contracts, test-env, test-fixtures, test-node-mocks,
testing, channel-runtime, compat, config-types, infra-runtime,
text-runtime, and zod. Import zod directly from zod in new plugin code.
plugin-test-runtime is still an active focused test helper subpath.
These subpaths are plugin-owned compatibility surfaces reserved for their owning
bundled plugin, not general SDK APIs: plugin-sdk/codex-mcp-projection and
plugin-sdk/codex-native-task-runtime. Cross-owner extension imports are blocked
by package contract guardrails.
These public subpaths existed for at least one month and currently have no
bundled extension production imports. They remain importable for compatibility,
but new plugin code should use focused, actively consumed SDK subpaths instead:
agent-config-primitives, channel-config-schema-legacy,
channel-reply-pipeline, channel-runtime, channel-secret-runtime,
command-auth, compat, config-runtime, config-schema, discord,
group-access, infra-runtime, matrix, mattermost,
media-generation-runtime-shared, memory-core-engine-runtime,
memory-core-host-multimodal, memory-core-host-query,
music-generation-core, self-hosted-provider-setup, telegram-account,
telegram-command-config, and zalouser.
Public subpaths currently used by only one or two bundled plugin owners are also
deprecated for new plugin code. They remain package exports for compatibility,
but new code should prefer actively shared SDK seams or plugin-owned package
APIs. Maintainers track the exact set in
scripts/lib/plugin-sdk-deprecated-public-subpaths.json and the current budget
with pnpm plugin-sdk:surface.
These broad re-export barrels remain buildable for OpenClaw source and
compatibility checks, but new code should prefer focused SDK subpaths:
agent-runtime, channel-lifecycle, channel-runtime, cli-runtime,
compat, config-types, conversation-runtime, hook-runtime,
infra-runtime, media-runtime, plugin-runtime, security-runtime, and
text-runtime. channel-runtime, compat, config-types, infra-runtime,
and text-runtime remain package exports only for backwards compatibility; use
focused channel/runtime subpaths, config-contracts, string-coerce-runtime,
text-chunking, text-utility-runtime, and logging-core instead.
| Subpath | Owner and purpose |
| --- | --- |
| `plugin-sdk/codex-mcp-projection` | Bundled Codex plugin helper for projecting user MCP server config into Codex app-server thread config |
| `plugin-sdk/codex-native-task-runtime` | Bundled Codex plugin helper for mirroring Codex app-server native subagents into OpenClaw task state |