From 48e41c604aa74d01b98da3da7a67715a49372ff4 Mon Sep 17 00:00:00 2001 From: "openclaw-docs-sync[bot]" Date: Mon, 27 Apr 2026 23:57:58 +0000 Subject: [PATCH] chore(sync): mirror docs from openclaw/openclaw@7f77ecff77aace88ff8687800316f20c0fd5e831 --- .openclaw-sync/source.json | 4 +-- .../.generated/plugin-sdk-api-baseline.sha256 | 4 +-- docs/plugins/sdk-subpaths.md | 26 ++++++++++------- docs/plugins/sdk-testing.md | 29 ++++++++++++++----- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 92b6febdf..0ba5a4569 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "b90f29d3133336bb896d7ccdb096f998da4ef635", - "syncedAt": "2026-04-27T23:50:11.421Z" + "sha": "7f77ecff77aace88ff8687800316f20c0fd5e831", + "syncedAt": "2026-04-27T23:56:29.172Z" } diff --git a/docs/.generated/plugin-sdk-api-baseline.sha256 b/docs/.generated/plugin-sdk-api-baseline.sha256 index 2c3002c6c..b56e15449 100644 --- a/docs/.generated/plugin-sdk-api-baseline.sha256 +++ b/docs/.generated/plugin-sdk-api-baseline.sha256 @@ -1,2 +1,2 @@ -0736a1666860383e3e5f8ada181c016455d8304a2852ac6966355765f799add4 plugin-sdk-api-baseline.json -761cdb609547f5912513e5714d8b0ec8fff2b29905690af376cc5bdd74f2c279 plugin-sdk-api-baseline.jsonl +d4aecd00eeb38998b1bf840f9448ebd3520f0c7e4a612465440ac906c6d28848 plugin-sdk-api-baseline.json +fa888992910838df4e0037461199b6a6b83f8d99de99ac9fb7021c86c41ef06f plugin-sdk-api-baseline.jsonl diff --git a/docs/plugins/sdk-subpaths.md b/docs/plugins/sdk-subpaths.md index 714beea85..4f1a64f3b 100644 --- a/docs/plugins/sdk-subpaths.md +++ b/docs/plugins/sdk-subpaths.md @@ -16,16 +16,19 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview) ## Plugin entry -| Subpath | Key exports | -| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `plugin-sdk/plugin-entry` | `definePluginEntry` | -| `plugin-sdk/core` | `defineChannelPluginEntry`, `createChatChannelPlugin`, `createChannelPluginBase`, `defineSetupPluginEntry`, `buildChannelConfigSchema` | -| `plugin-sdk/config-schema` | `OpenClawSchema` | -| `plugin-sdk/provider-entry` | `defineSingleProviderPluginEntry` | -| `plugin-sdk/testing` | Public plugin test fixtures, provider registration/catalog helpers, wizard contract hooks, and bundled-plugin contract maintenance helpers | -| `plugin-sdk/plugin-test-api` | Minimal `OpenClawPluginApi` mock builder for direct plugin registration unit tests | -| `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` and `writeMigrationReport` | +| Subpath | Key exports | +| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `plugin-sdk/plugin-entry` | `definePluginEntry` | +| `plugin-sdk/core` | `defineChannelPluginEntry`, `createChatChannelPlugin`, `createChannelPluginBase`, `defineSetupPluginEntry`, `buildChannelConfigSchema` | +| `plugin-sdk/config-schema` | `OpenClawSchema` | +| `plugin-sdk/provider-entry` | `defineSingleProviderPluginEntry` | +| `plugin-sdk/testing` | Public plugin test fixtures, provider registration/catalog helpers, wizard contract hooks, and bundled-plugin contract maintenance helpers | +| `plugin-sdk/plugin-test-api` | Minimal `OpenClawPluginApi` mock builder for direct plugin registration unit tests | +| `plugin-sdk/channel-test-helpers` | Channel account lifecycle, directory, send-config, runtime mock, and hook test helpers | +| `plugin-sdk/plugin-test-contracts` | Plugin registration, package manifest, public artifact, runtime API, import side-effect, and direct import contract helpers | +| `plugin-sdk/provider-test-contracts` | Provider runtime, auth, discovery, onboard, catalog, web-search/fetch, and wizard contract helpers | +| `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` and `writeMigrationReport` | @@ -262,6 +265,9 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview) | `plugin-sdk/zod` | Re-exported `zod` for plugin SDK consumers | | `plugin-sdk/testing` | Public extension test helpers including plugin registry/runtime mocks, provider registration capture, setup-wizard helpers, fetch/env/temp/time fixtures, schema/media/live-test helpers, `installCommonResolveTargetErrorCases`, `writeSkill`, `createTestRegistry`, and live generation env loading. Extension `*.test-support.ts` helpers stay on this or focused SDK subpaths, not core internals | | `plugin-sdk/plugin-test-api` | Minimal `createTestPluginApi` helper for direct plugin registration unit tests without importing repo test helper bridges | + | `plugin-sdk/channel-test-helpers` | Channel-oriented test helpers for account startup lifecycle, directory assertions, send-config threading, runtime mocks, status issues, outbound delivery, and hook registration | + | `plugin-sdk/plugin-test-contracts` | Plugin package, registration, public artifact, direct import, runtime API, and import side-effect contract helpers | + | `plugin-sdk/provider-test-contracts` | Provider runtime, auth, discovery, onboard, catalog, wizard, web-search/fetch, and stream contract helpers | diff --git a/docs/plugins/sdk-testing.md b/docs/plugins/sdk-testing.md index 95b410a90..8fe15d1b6 100644 --- a/docs/plugins/sdk-testing.md +++ b/docs/plugins/sdk-testing.md @@ -25,6 +25,12 @@ plugins. **Channel contract import:** `openclaw/plugin-sdk/channel-contract-testing` +**Channel test helper import:** `openclaw/plugin-sdk/channel-test-helpers` + +**Plugin contract import:** `openclaw/plugin-sdk/plugin-test-contracts` + +**Provider contract import:** `openclaw/plugin-sdk/provider-test-contracts` + The testing subpath exports a narrow set of helpers for plugin authors: ```typescript @@ -35,6 +41,9 @@ import { } from "openclaw/plugin-sdk/testing"; import { createTestPluginApi } from "openclaw/plugin-sdk/plugin-test-api"; import { expectChannelInboundContextContract } from "openclaw/plugin-sdk/channel-contract-testing"; +import { createStartAccountContext } from "openclaw/plugin-sdk/channel-test-helpers"; +import { describePluginRegistrationContract } from "openclaw/plugin-sdk/plugin-test-contracts"; +import { describeOpenAIProviderRuntimeContract } from "openclaw/plugin-sdk/provider-test-contracts"; ``` ### Available exports @@ -44,6 +53,9 @@ import { expectChannelInboundContextContract } from "openclaw/plugin-sdk/channel | `createTestPluginApi` | Build a minimal plugin API mock for direct registration unit tests. Import from `plugin-sdk/plugin-test-api` | | `expectChannelInboundContextContract` | Assert channel inbound context shape. Import from `plugin-sdk/channel-contract-testing` | | `installChannelOutboundPayloadContractSuite` | Install channel outbound payload contract cases. Import from `plugin-sdk/channel-contract-testing` | +| `createStartAccountContext` | Build channel account lifecycle contexts. Import from `plugin-sdk/channel-test-helpers` | +| `describePluginRegistrationContract` | Install plugin registration contract checks. Import from `plugin-sdk/plugin-test-contracts` | +| `describeOpenAIProviderRuntimeContract` | Install provider-family runtime contract checks. Import from `plugin-sdk/provider-test-contracts` | | `installCommonResolveTargetErrorCases` | Shared test cases for target resolution error handling | | `shouldAckReaction` | Check whether a channel should add an ack reaction | | `removeAckReactionAfterReply` | Remove ack reaction after reply delivery | @@ -73,11 +85,14 @@ import { expectChannelInboundContextContract } from "openclaw/plugin-sdk/channel | `typedCases` | Preserve literal types for table-driven tests | Bundled-plugin contract suites also use SDK testing subpaths for test-only -registry, manifest, public-artifact, and runtime fixture helpers. Keep new -extension tests on `openclaw/plugin-sdk/testing` or a narrower documented SDK -subpath such as `plugin-sdk/plugin-test-api` or -`plugin-sdk/channel-contract-testing` rather than importing repo `src/**` files -directly. +registry, manifest, public-artifact, and runtime fixture helpers. Core-only +suites that depend on bundled OpenClaw inventory stay under `src/plugins/contracts`. +Keep new extension tests on `openclaw/plugin-sdk/testing` or a narrower +documented SDK subpath such as `plugin-sdk/plugin-test-api` or +`plugin-sdk/channel-contract-testing`, `plugin-sdk/channel-test-helpers`, +`plugin-sdk/plugin-test-contracts`, or `plugin-sdk/provider-test-contracts` +rather than importing repo `src/**` files or repo `test/helpers/plugins/*` +bridges directly. ### Types @@ -136,8 +151,8 @@ entry to declare `kind: "memory"`. ### Testing runtime config access -Prefer the shared plugin runtime mock from the repo test helpers when testing -bundled plugins. Its deprecated `runtime.config.loadConfig()` and +Prefer the shared plugin runtime mock from `openclaw/plugin-sdk/channel-test-helpers` +when testing bundled channel plugins. Its deprecated `runtime.config.loadConfig()` and `runtime.config.writeConfigFile(...)` mocks throw by default so tests catch new usage of compatibility APIs. Override those mocks only when the test is explicitly covering legacy compatibility behavior.