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 |
plugin-sdk/health | Doctor health-check registration, detection, repair, selection, severity, and finding types for bundled health consumers |
Deprecated subpaths stay exported for older plugins, but new code should use the
focused SDK subpaths below. The maintained list is
scripts/lib/plugin-sdk-deprecated-public-subpaths.json; CI rejects bundled
production imports from it. Broad barrels such as compat, config-types,
infra-runtime, text-runtime, and zod are compatibility only. Import zod
directly from zod.
OpenClaw's Vitest-backed test-helper subpaths are repo-local only and are no
longer package exports: agent-runtime-test-contracts,
channel-contract-testing, channel-target-testing, channel-test-helpers,
plugin-test-api, plugin-test-contracts, plugin-test-runtime,
provider-http-test-mocks, provider-test-contracts, test-env,
test-fixtures, test-node-mocks, and testing.
These subpaths are plugin-owned compatibility surfaces 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.
Deprecated channel helper families stay available only for published-plugin
compatibility. The removal plan is: keep them through the external plugin
migration window, keep repo/bundled plugins on channel-inbound and
channel-outbound, then remove the compatibility subpaths in the next major
SDK cleanup. This applies to the old channel message/runtime, channel
streaming, direct-DM access, inbound helper splinter, reply-options,
and pairing-path families.
| 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 |