From 0d539ee6e29215b46f9f4cf27d0bd78dedafea6d Mon Sep 17 00:00:00 2001 From: "openclaw-docs-sync[bot]" Date: Sat, 25 Apr 2026 02:09:30 +0000 Subject: [PATCH] chore(sync): mirror docs from openclaw/openclaw@a5db42862d76fce18e5d7fa57f3907a543e61137 --- .openclaw-sync/source.json | 4 ++-- docs/plugins/sdk-entrypoints.md | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index f619f12da..0e12ee410 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "5e640b93dae6a273286c66d93d20a82ae56ed533", - "syncedAt": "2026-04-25T01:55:53.943Z" + "sha": "a5db42862d76fce18e5d7fa57f3907a543e61137", + "syncedAt": "2026-04-25T02:08:07.156Z" } diff --git a/docs/plugins/sdk-entrypoints.md b/docs/plugins/sdk-entrypoints.md index 3da9fded2..510c4a4e2 100644 --- a/docs/plugins/sdk-entrypoints.md +++ b/docs/plugins/sdk-entrypoints.md @@ -121,11 +121,12 @@ export default defineChannelPluginEntry({ - `setRuntime` is called during registration so you can store the runtime reference (typically via `createPluginRuntimeStore`). It is skipped during CLI metadata capture. -- `registerCliMetadata` runs during both `api.registrationMode === "cli-metadata"` - and `api.registrationMode === "full"`. +- `registerCliMetadata` runs during `api.registrationMode === "cli-metadata"`, + `api.registrationMode === "discovery"`, and + `api.registrationMode === "full"`. Use it as the canonical place for channel-owned CLI descriptors so root help - stays non-activating while normal CLI command registration remains compatible - with full plugin loads. + stays non-activating, discovery snapshots include static command metadata, and + normal CLI command registration remains compatible with full plugin loads. - `registerFull` only runs when `api.registrationMode === "full"`. It is skipped during setup-only loading. - Like `definePluginEntry`, `configSchema` can be a lazy factory and OpenClaw @@ -197,19 +198,24 @@ setter before the full channel entry loads. `api.registrationMode` tells your plugin how it was loaded: -| Mode | When | What to register | -| ----------------- | --------------------------------- | ----------------------------------------------------------------------------------------- | -| `"full"` | Normal gateway startup | Everything | -| `"setup-only"` | Disabled/unconfigured channel | Channel registration only | -| `"setup-runtime"` | Setup flow with runtime available | Channel registration plus only the lightweight runtime needed before the full entry loads | -| `"cli-metadata"` | Root help / CLI metadata capture | CLI descriptors only | +| Mode | When | What to register | +| ----------------- | --------------------------------- | ---------------------------------------------------------------------------------------------- | +| `"full"` | Normal gateway startup | Everything | +| `"discovery"` | Read-only capability discovery | Channel registration plus static CLI descriptors; skip sockets, workers, clients, and services | +| `"setup-only"` | Disabled/unconfigured channel | Channel registration only | +| `"setup-runtime"` | Setup flow with runtime available | Channel registration plus only the lightweight runtime needed before the full entry loads | +| `"cli-metadata"` | Root help / CLI metadata capture | CLI descriptors only | `defineChannelPluginEntry` handles this split automatically. If you use `definePluginEntry` directly for a channel, check mode yourself: ```typescript register(api) { - if (api.registrationMode === "cli-metadata" || api.registrationMode === "full") { + if ( + api.registrationMode === "cli-metadata" || + api.registrationMode === "discovery" || + api.registrationMode === "full" + ) { api.registerCli(/* ... */); if (api.registrationMode === "cli-metadata") return; }