Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Every plugin exports a default entry object. The SDK provides three helpers for creating them.
For installed plugins,
package.jsonjson{ "openclaw": { "extensions": ["./src/index.ts"], "runtimeExtensions": ["./dist/index.js"], "setupEntry": "./src/setup-entry.ts", "runtimeSetupEntry": "./dist/setup-entry.js" } }
extensionssetupEntryruntimeExtensionsruntimeSetupEntrydist/*.jsAll entry paths must stay inside the plugin package directory. Runtime entries and inferred built JavaScript peers do not make an escaping
extensionssetupEntrydefinePluginEntryImport:
openclaw/plugin-sdk/plugin-entryFor provider plugins, tool plugins, hook plugins, and anything that is not a messaging channel.
typescriptimport { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry"; export default definePluginEntry({ id: "my-plugin", name: "My Plugin", description: "Short summary", register(api) { api.registerProvider({ /* ... */ }); api.registerTool({ /* ... */ }); }, });
| Field | Type | Required | Default |
|---|---|---|---|
text id | text string | Yes | — |
text name | text string | Yes | — |
text description | text string | Yes | — |
text kind | text string | No | — |
text configSchema | text OpenClawPluginConfigSchema | () => OpenClawPluginConfigSchema | No | Empty object schema |
text register | text (api: OpenClawPluginApi) => void | Yes | — |
idopenclaw.plugin.jsonkind"memory""context-engine"configSchemadefineChannelPluginEntryImport:
openclaw/plugin-sdk/channel-coreWraps
definePluginEntryapi.registerChannel({ plugin })registerFulltypescriptimport { defineChannelPluginEntry } from "openclaw/plugin-sdk/channel-core"; export default defineChannelPluginEntry({ id: "my-channel", name: "My Channel", description: "Short summary", plugin: myChannelPlugin, setRuntime: setMyRuntime, registerCliMetadata(api) { api.registerCli(/* ... */); }, registerFull(api) { api.registerGatewayMethod(/* ... */); }, });
| Field | Type | Required | Default |
|---|---|---|---|
text id | text string | Yes | — |
text name | text string | Yes | — |
text description | text string | Yes | — |
text plugin | text ChannelPlugin | Yes | — |
text configSchema | text OpenClawPluginConfigSchema | () => OpenClawPluginConfigSchema | No | Empty object schema |
text setRuntime | text (runtime: PluginRuntime) => void | No | — |
text registerCliMetadata | text (api: OpenClawPluginApi) => void | No | — |
text registerFull | text (api: OpenClawPluginApi) => void | No | — |
setRuntimecreatePluginRuntimeStoreregisterCliMetadataapi.registrationMode === "cli-metadata"api.registrationMode === "discovery"api.registrationMode === "full""full"registerFullapi.registrationMode === "full"definePluginEntryconfigSchemaapi.registerCli(..., { descriptors: [...] })registerCliMetadata(...)registerFull(...)registerFull(...)config.*exec.approvals.*wizard.*update.*operator.admindefineSetupPluginEntryImport:
openclaw/plugin-sdk/channel-coreFor the lightweight
setup-entry.ts{ plugin }typescriptimport { defineSetupPluginEntry } from "openclaw/plugin-sdk/channel-core"; export default defineSetupPluginEntry(myChannelPlugin);
OpenClaw loads this instead of the full entry when a channel is disabled, unconfigured, or when deferred loading is enabled. See Setup and Config for when this matters.
In practice, pair
defineSetupPluginEntry(...)openclaw/plugin-sdk/setup-runtimepromptResolvedAllowFromsplitSetupEntriesopenclaw/plugin-sdk/channel-setupopenclaw/plugin-sdk/setup-toolsKeep heavy SDKs, CLI registration, and long-lived runtime services in the full entry.
Bundled workspace channels that split setup and runtime surfaces can use
defineBundledChannelSetupEntry(...)openclaw/plugin-sdk/channel-entry-contracttypescriptimport { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract"; export default defineBundledChannelSetupEntry({ importMetaUrl: import.meta.url, plugin: { specifier: "./channel-plugin-api.js", exportName: "myChannelPlugin", }, runtime: { specifier: "./runtime-api.js", exportName: "setMyChannelRuntime", }, });
Use that bundled contract only when setup flows truly need a lightweight runtime setter before the full channel entry loads.
api.registrationMode| Mode | When | What to register |
|---|---|---|
text "full" | Normal gateway startup | Everything |
text "discovery" | Read-only capability discovery | Channel registration plus static CLI descriptors; entry code may load, but skip sockets, workers, clients, and services |
text "setup-only" | Disabled/unconfigured channel | Channel registration only |
text "setup-runtime" | Setup flow with runtime available | Channel registration plus only the lightweight runtime needed before the full entry loads |
text "cli-metadata" | Root help / CLI metadata capture | CLI descriptors only |
defineChannelPluginEntrydefinePluginEntrytypescriptregister(api) { if ( api.registrationMode === "cli-metadata" || api.registrationMode === "discovery" || api.registrationMode === "full" ) { api.registerCli(/* ... */); if (api.registrationMode === "cli-metadata") return; } api.registerChannel({ plugin: myPlugin }); if (api.registrationMode !== "full") return; // Heavy runtime-only registrations api.registerService(/* ... */); }
Discovery mode builds a non-activating registry snapshot. It may still evaluate the plugin entry and the channel plugin object so OpenClaw can register channel capabilities and static CLI descriptors. Treat module evaluation in discovery as trusted but lightweight: no network clients, subprocesses, listeners, database connections, background workers, credential reads, or other live runtime side effects at top level.
Treat
"setup-runtime""full"For CLI registrars specifically:
descriptorscommandsOpenClaw classifies loaded plugins by their registration behavior:
| Shape | Description |
|---|---|
| plain-capability | One capability type (e.g. provider-only) |
| hybrid-capability | Multiple capability types (e.g. provider + speech) |
| hook-only | Only hooks, no capabilities |
| non-capability | Tools/commands/services but no capabilities |
Use
openclaw plugins inspect <id>api.runtimecreatePluginRuntimeStoreChannelPlugin© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine