From 0950e9a6fcdbad4f8a607cb802a6fe1731174eb0 Mon Sep 17 00:00:00 2001 From: "openclaw-docs-sync[bot]" Date: Wed, 15 Apr 2026 16:35:59 +0000 Subject: [PATCH] chore(sync): mirror docs from openclaw/openclaw@78ac1184274ee9f2c501446d893a1000d6c54860 --- .openclaw-sync/source.json | 4 ++-- docs/plugins/sdk-channel-plugins.md | 5 +++++ docs/plugins/sdk-entrypoints.md | 25 +++++++++++++++++++++++++ docs/plugins/sdk-runtime.md | 9 ++++++++- docs/plugins/sdk-setup.md | 6 ++++++ docs/plugins/sdk-testing.md | 5 ++++- 6 files changed, 50 insertions(+), 4 deletions(-) diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 1c949f738..d1b416236 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "b2753fd0dede9cf3918eec769cf3ab40558ffe5f", - "syncedAt": "2026-04-15T15:49:11.190Z" + "sha": "78ac1184274ee9f2c501446d893a1000d6c54860", + "syncedAt": "2026-04-15T16:35:59.427Z" } diff --git a/docs/plugins/sdk-channel-plugins.md b/docs/plugins/sdk-channel-plugins.md index 5e51b8b6e..803f38f17 100644 --- a/docs/plugins/sdk-channel-plugins.md +++ b/docs/plugins/sdk-channel-plugins.md @@ -493,6 +493,11 @@ should use `resolveInboundMentionDecision({ facts, policy })`. or unconfigured. It avoids pulling in heavy runtime code during setup flows. See [Setup and Config](/plugins/sdk-setup#setup-entry) for details. + Bundled workspace channels that split setup-safe exports into sidecar + modules can use `defineBundledChannelSetupEntry(...)` from + `openclaw/plugin-sdk/channel-entry-contract` when they also need an + explicit setup-time runtime setter. + diff --git a/docs/plugins/sdk-entrypoints.md b/docs/plugins/sdk-entrypoints.md index 79a6e441f..3cd11df08 100644 --- a/docs/plugins/sdk-entrypoints.md +++ b/docs/plugins/sdk-entrypoints.md @@ -145,6 +145,31 @@ families: Keep 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(...)` from +`openclaw/plugin-sdk/channel-entry-contract` instead. That contract lets the +setup entry keep setup-safe plugin/secrets exports while still exposing a +runtime setter: + +```typescript +import { 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. + ## Registration mode `api.registrationMode` tells your plugin how it was loaded: diff --git a/docs/plugins/sdk-runtime.md b/docs/plugins/sdk-runtime.md index 94105634a..7d3faf9bb 100644 --- a/docs/plugins/sdk-runtime.md +++ b/docs/plugins/sdk-runtime.md @@ -385,7 +385,10 @@ the `register` callback: import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store"; import type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store"; -const store = createPluginRuntimeStore("my-plugin runtime not initialized"); +const store = createPluginRuntimeStore({ + pluginId: "my-plugin", + errorMessage: "my-plugin runtime not initialized", +}); // In your entry point export default defineChannelPluginEntry({ @@ -406,6 +409,10 @@ export function tryGetRuntime() { } ``` +Prefer `pluginId` for the runtime-store identity. The lower-level `key` form is +for uncommon cases where one plugin intentionally needs more than one runtime +slot. + ## Other top-level `api` fields Beyond `api.runtime`, the API object also provides: diff --git a/docs/plugins/sdk-setup.md b/docs/plugins/sdk-setup.md index 33cfbf6f5..81ba55de3 100644 --- a/docs/plugins/sdk-setup.md +++ b/docs/plugins/sdk-setup.md @@ -279,6 +279,12 @@ export default defineSetupPluginEntry(myChannelPlugin); This avoids loading heavy runtime code (crypto libraries, CLI registrations, background services) during setup flows. +Bundled workspace channels that keep setup-safe exports in sidecar modules can +use `defineBundledChannelSetupEntry(...)` from +`openclaw/plugin-sdk/channel-entry-contract` instead of +`defineSetupPluginEntry(...)`. That bundled contract also supports an optional +`runtime` export so setup-time runtime wiring can stay lightweight and explicit. + **When OpenClaw uses `setupEntry` instead of the full entry:** - The channel is disabled but needs setup/onboarding surfaces diff --git a/docs/plugins/sdk-testing.md b/docs/plugins/sdk-testing.md index 82ddec9d4..dbb1dbdfe 100644 --- a/docs/plugins/sdk-testing.md +++ b/docs/plugins/sdk-testing.md @@ -155,7 +155,10 @@ For code that uses `createPluginRuntimeStore`, mock the runtime in tests: import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store"; import type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store"; -const store = createPluginRuntimeStore("test runtime not set"); +const store = createPluginRuntimeStore({ + pluginId: "test-plugin", + errorMessage: "test runtime not set", +}); // In test setup const mockRuntime = {