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.
The plugin SDK is the typed contract between plugins and core. This page is the reference for what to import and what you can register.
Always import from a specific subpath:
typescriptimport { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry"; import { defineChannelPluginEntry } from "openclaw/plugin-sdk/channel-core";
Each subpath is a small, self-contained module. This keeps startup fast and prevents circular dependency issues. For channel-specific entry/build helpers, prefer
openclaw/plugin-sdk/channel-coreopenclaw/plugin-sdk/corebuildChannelConfigSchemaFor channel config, publish the channel-owned JSON Schema through
openclaw.plugin.json#channelConfigsplugin-sdk/channel-config-schemaplugin-sdk/bundled-channel-config-schemaplugin-sdk/channel-config-schema-legacyA small set of bundled-plugin helper seams still appear in the generated export map when they have tracked owner usage. They exist for bundled-plugin maintenance only and are not recommended import paths for new third-party plugins.
openclaw/plugin-sdk/discordopenclaw/plugin-sdk/telegram-accountThe plugin SDK is exposed as a set of narrow subpaths grouped by area (plugin entry, channel, provider, auth, runtime, capability, memory, and reserved bundled-plugin helpers). For the full catalog — grouped and linked — see Plugin SDK subpaths.
The generated list of 200+ subpaths lives in
scripts/lib/plugin-sdk-entrypoints.jsonThe
register(api)OpenClawPluginApi| Method | What it registers |
|---|---|
text api.registerProvider(...) | Text inference (LLM) |
text api.registerAgentHarness(...) | Experimental low-level agent executor |
text api.registerCliBackend(...) | Local CLI inference backend |
text api.registerChannel(...) | Messaging channel |
text api.registerSpeechProvider(...) | Text-to-speech / STT synthesis |
text api.registerRealtimeTranscriptionProvider(...) | Streaming realtime transcription |
text api.registerRealtimeVoiceProvider(...) | Duplex realtime voice sessions |
text api.registerMediaUnderstandingProvider(...) | Image/audio/video analysis |
text api.registerImageGenerationProvider(...) | Image generation |
text api.registerMusicGenerationProvider(...) | Music generation |
text api.registerVideoGenerationProvider(...) | Video generation |
text api.registerWebFetchProvider(...) | Web fetch / scrape provider |
text api.registerWebSearchProvider(...) | Web search |
| Method | What it registers |
|---|---|
text api.registerTool(tool, opts?) | Agent tool (required or text { optional: true } |
text api.registerCommand(def) | Custom command (bypasses the LLM) |
Plugin commands can set
agentPromptGuidance| Method | What it registers |
|---|---|
text api.registerHook(events, handler, opts?) | Event hook |
text api.registerHttpRoute(params) | Gateway HTTP endpoint |
text api.registerGatewayMethod(name, handler) | Gateway RPC method |
text api.registerGatewayDiscoveryService(service) | Local Gateway discovery advertiser |
text api.registerCli(registrar, opts?) | CLI subcommand |
text api.registerService(service) | Background service |
text api.registerInteractiveHandler(registration) | Interactive handler |
text api.registerAgentToolResultMiddleware(...) | Runtime tool-result middleware |
text api.registerMemoryPromptSupplement(builder) | Additive memory-adjacent prompt section |
text api.registerMemoryCorpusSupplement(adapter) | Additive memory search/read corpus |
Host hooks are the SDK seams for plugins that need to participate in the host lifecycle rather than only adding a provider, channel, or tool. They are generic contracts; Plan Mode can use them, but so can approval workflows, workspace policy gates, background monitors, setup wizards, and UI companion plugins.
| Method | Contract it owns |
|---|---|
text api.registerSessionExtension(...) | Plugin-owned, JSON-compatible session state projected through Gateway sessions |
text api.enqueueNextTurnInjection(...) | Durable exactly-once context injected into the next agent turn for one session |
text api.registerTrustedToolPolicy(...) | Bundled/trusted pre-plugin tool policy that can block or rewrite tool params |
text api.registerToolMetadata(...) | Tool catalog display metadata without changing the tool implementation |
text api.registerCommand(...) | Scoped plugin commands; command results can set text continueAgent: true |
text api.registerControlUiDescriptor(...) | Control UI contribution descriptors for session, tool, run, or settings surfaces |
text api.registerRuntimeLifecycle(...) | Cleanup callbacks for plugin-owned runtime resources on reset/delete/reload paths |
text api.registerAgentEventSubscription(...) | Sanitized event subscriptions for workflow state and monitors |
text api.setRunContext(...)text getRunContext(...)text clearRunContext(...) | Per-run plugin scratch state cleared on terminal run lifecycle |
text api.registerSessionSchedulerJob(...) | Plugin-owned session scheduler job records with deterministic cleanup |
The contracts intentionally split authority:
before_tool_callallowPromptInjection=falseagent_turn_preparebefore_prompt_buildheartbeat_prompt_contributionbefore_agent_startenqueueNextTurnInjectionExamples of non-Plan consumers:
| Plugin archetype | Hooks used |
|---|---|
| Approval workflow | Session extension, command continuation, next-turn injection, UI descriptor |
| Budget/workspace policy gate | Trusted tool policy, tool metadata, session projection |
| Background lifecycle monitor | Runtime lifecycle cleanup, agent event subscription, session scheduler ownership/cleanup, heartbeat prompt contribution, UI descriptor |
| Setup or onboarding wizard | Session extension, scoped commands, Control UI descriptor |
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine