From 1e3ce10e2782a4d2876a31132fbf8b56798b8c0f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 05:00:47 +0100 Subject: [PATCH] refactor(plugin-sdk): remove unused reserved helper exports --- .../.generated/plugin-sdk-api-baseline.sha256 | 4 +- docs/plugins/architecture.md | 2 +- docs/plugins/building-plugins.md | 5 +- docs/plugins/sdk-migration.md | 42 +- docs/plugins/sdk-overview.md | 8 +- docs/plugins/sdk-subpaths.md | 17 +- extensions/line/src/setup-surface.test.ts | 6 +- extensions/matrix/src/runtime-api.ts | 2 +- package.json | 172 --------- scripts/lib/plugin-sdk-doc-metadata.ts | 3 - scripts/lib/plugin-sdk-entrypoints.json | 43 --- scripts/plugin-boundary-report.ts | 146 +------ .../plugins/bundled.shape-guard.test.ts | 6 - .../channel-import-guardrails.test.ts | 2 +- src/plugin-sdk/browser-support.ts | 4 - src/plugin-sdk/diagnostics-otel.ts | 23 -- src/plugin-sdk/diagnostics-prometheus.ts | 15 - src/plugin-sdk/diffs.ts | 13 - src/plugin-sdk/entrypoints.ts | 365 ------------------ src/plugin-sdk/feishu-conversation.ts | 109 ------ src/plugin-sdk/feishu-setup.ts | 25 -- src/plugin-sdk/feishu.ts | 104 ----- src/plugin-sdk/googlechat-runtime-shared.ts | 4 - src/plugin-sdk/googlechat.ts | 120 ------ src/plugin-sdk/irc-surface.ts | 71 ---- src/plugin-sdk/irc.ts | 80 ---- src/plugin-sdk/line-core.ts | 30 -- src/plugin-sdk/line-runtime.ts | 240 ------------ src/plugin-sdk/line-surface.ts | 168 -------- src/plugin-sdk/line.ts | 52 --- src/plugin-sdk/llm-task.ts | 14 - src/plugin-sdk/matrix-helper.ts | 101 ----- src/plugin-sdk/matrix-runtime-heavy.ts | 128 ------ src/plugin-sdk/matrix-runtime-surface.ts | 41 -- src/plugin-sdk/matrix-surface.ts | 127 ------ src/plugin-sdk/matrix-thread-bindings.ts | 33 -- src/plugin-sdk/matrix.ts | 220 ----------- src/plugin-sdk/mattermost-policy.ts | 22 -- src/plugin-sdk/mattermost.ts | 98 ----- src/plugin-sdk/memory-lancedb.ts | 6 - src/plugin-sdk/msteams.ts | 141 ------- src/plugin-sdk/nextcloud-talk.ts | 120 ------ src/plugin-sdk/nostr.ts | 46 --- src/plugin-sdk/thread-ownership.ts | 9 - src/plugin-sdk/tlon.ts | 42 -- src/plugin-sdk/twitch.ts | 46 --- src/plugin-sdk/voice-call.ts | 20 - src/plugin-sdk/zalo-setup.ts | 65 ---- src/plugin-sdk/zalo.ts | 109 ------ src/plugin-sdk/zalouser.ts | 124 ------ .../bundled-capability-runtime.test.ts | 3 - src/plugins/bundled-capability-runtime.ts | 4 - .../llm-task.ts | 1 - ...ed-extension-config-api-guardrails.test.ts | 2 +- .../contracts/plugin-sdk-index.bundle.test.ts | 2 +- ...in-sdk-package-contract-guardrails.test.ts | 63 +-- .../contracts/plugin-sdk-subpaths.test.ts | 48 +-- test/scripts/plugin-boundary-report.test.ts | 20 +- 58 files changed, 53 insertions(+), 3483 deletions(-) delete mode 100644 src/plugin-sdk/browser-support.ts delete mode 100644 src/plugin-sdk/diagnostics-otel.ts delete mode 100644 src/plugin-sdk/diagnostics-prometheus.ts delete mode 100644 src/plugin-sdk/diffs.ts delete mode 100644 src/plugin-sdk/feishu-conversation.ts delete mode 100644 src/plugin-sdk/feishu-setup.ts delete mode 100644 src/plugin-sdk/feishu.ts delete mode 100644 src/plugin-sdk/googlechat-runtime-shared.ts delete mode 100644 src/plugin-sdk/googlechat.ts delete mode 100644 src/plugin-sdk/irc-surface.ts delete mode 100644 src/plugin-sdk/irc.ts delete mode 100644 src/plugin-sdk/line-core.ts delete mode 100644 src/plugin-sdk/line-runtime.ts delete mode 100644 src/plugin-sdk/line-surface.ts delete mode 100644 src/plugin-sdk/line.ts delete mode 100644 src/plugin-sdk/llm-task.ts delete mode 100644 src/plugin-sdk/matrix-helper.ts delete mode 100644 src/plugin-sdk/matrix-runtime-heavy.ts delete mode 100644 src/plugin-sdk/matrix-runtime-surface.ts delete mode 100644 src/plugin-sdk/matrix-surface.ts delete mode 100644 src/plugin-sdk/matrix-thread-bindings.ts delete mode 100644 src/plugin-sdk/matrix.ts delete mode 100644 src/plugin-sdk/mattermost-policy.ts delete mode 100644 src/plugin-sdk/mattermost.ts delete mode 100644 src/plugin-sdk/memory-lancedb.ts delete mode 100644 src/plugin-sdk/msteams.ts delete mode 100644 src/plugin-sdk/nextcloud-talk.ts delete mode 100644 src/plugin-sdk/nostr.ts delete mode 100644 src/plugin-sdk/thread-ownership.ts delete mode 100644 src/plugin-sdk/tlon.ts delete mode 100644 src/plugin-sdk/twitch.ts delete mode 100644 src/plugin-sdk/voice-call.ts delete mode 100644 src/plugin-sdk/zalo-setup.ts delete mode 100644 src/plugin-sdk/zalo.ts delete mode 100644 src/plugin-sdk/zalouser.ts delete mode 100644 src/plugins/capability-runtime-vitest-shims/llm-task.ts diff --git a/docs/.generated/plugin-sdk-api-baseline.sha256 b/docs/.generated/plugin-sdk-api-baseline.sha256 index 77c81248ed9..5d0f3abc34d 100644 --- a/docs/.generated/plugin-sdk-api-baseline.sha256 +++ b/docs/.generated/plugin-sdk-api-baseline.sha256 @@ -1,2 +1,2 @@ -5a77a53e9d48f4b683838a3993e583db8037edf836e8e13a209cc0ad1c89d809 plugin-sdk-api-baseline.json -d31c5887a379c48a714e91d00a7d7fde7dff353319aee38a98babfdb753f49fb plugin-sdk-api-baseline.jsonl +cde228fda2602bd5e9aa07bc855d12859ded5c56f64f0075caaa02ccb2a2bc3c plugin-sdk-api-baseline.json +3adcd10f99a2b055271bbac9a8066cf8f680ec550dbe4f8ea4fd98474d12e2ad plugin-sdk-api-baseline.jsonl diff --git a/docs/plugins/architecture.md b/docs/plugins/architecture.md index b37738ad775..5e771b0b796 100644 --- a/docs/plugins/architecture.md +++ b/docs/plugins/architecture.md @@ -473,7 +473,7 @@ Keep capability registration public. Trim non-contract helper exports: - vendor-specific convenience helpers - setup/onboarding helpers that are implementation details -Some bundled-plugin helper subpaths still remain in the generated SDK export map for compatibility and bundled-plugin maintenance. Current examples include `plugin-sdk/feishu`, `plugin-sdk/feishu-setup`, `plugin-sdk/zalo`, `plugin-sdk/zalo-setup`, `plugin-sdk/bundled-channel-config-schema`, `plugin-sdk/channel-config-schema-legacy`, and several `plugin-sdk/matrix*` seams. Treat those as deprecated or reserved exports, not as the recommended SDK pattern for new third-party plugins. +Some bundled-plugin helper subpaths still remain in the generated SDK export map for bundled-plugin maintenance when they have tracked owner usage. Current examples include `plugin-sdk/browser-config-runtime`, `plugin-sdk/browser-config-support`, `plugin-sdk/browser-node-runtime`, `plugin-sdk/browser-security-runtime`, `plugin-sdk/browser-setup-tools`, `plugin-sdk/matrix-runtime-shared`, `plugin-sdk/github-copilot-token`, `plugin-sdk/memory-core`, `plugin-sdk/bundled-channel-config-schema`, and `plugin-sdk/channel-config-schema-legacy`. Treat those as reserved exports, not as the recommended SDK pattern for new third-party plugins. ## Internals and reference diff --git a/docs/plugins/building-plugins.md b/docs/plugins/building-plugins.md index 4018ad3b82d..70695eda068 100644 --- a/docs/plugins/building-plugins.md +++ b/docs/plugins/building-plugins.md @@ -280,9 +280,8 @@ If a helper is only useful inside one bundled provider package, keep it on that package-root seam instead of promoting it into `openclaw/plugin-sdk/*`. Some generated `openclaw/plugin-sdk/` helper seams still exist for -bundled-plugin maintenance and compatibility, for example -`plugin-sdk/feishu-setup` or `plugin-sdk/zalo-setup`. Treat those as reserved -surfaces, not as the default pattern for new third-party plugins. +bundled-plugin maintenance when they have tracked owner usage. Treat those as +reserved surfaces, not as the default pattern for new third-party plugins. ## Pre-submission checklist diff --git a/docs/plugins/sdk-migration.md b/docs/plugins/sdk-migration.md index 1fa28aaa668..91551a1a7af 100644 --- a/docs/plugins/sdk-migration.md +++ b/docs/plugins/sdk-migration.md @@ -90,18 +90,15 @@ For external plugins, compatibility work follows this order: Maintainers can audit the current migration queue with `pnpm plugins:boundary-report`. Use `pnpm plugins:boundary-report:summary` for -compact counts, `--owner ` for one plugin or compatibility owner, -`--retirement-plan` for an issue/PR-ready dormant SDK checklist, and +compact counts, `--owner ` for one plugin or compatibility owner, and `pnpm plugins:boundary-report:ci` when a CI gate should fail on due compatibility records, cross-owner reserved SDK imports, or unused reserved SDK -subpaths without a dormant classification. The report groups deprecated +subpaths. The report groups deprecated compatibility records by removal date, counts local code/docs references, -surfaces cross-owner reserved SDK imports, classifies dormant reserved SDK -subpaths with owner/replacement/remove-after metadata, and summarizes the -private memory-host SDK bridge so compatibility cleanup stays explicit instead -of relying on ad hoc searches. Dormant reserved SDK subpaths are package exports -with no tracked repo imports; keep them until their recorded removal date unless -a separate compatibility review proves the external import never shipped. +surfaces cross-owner reserved SDK imports, and summarizes the private +memory-host SDK bridge so compatibility cleanup stays explicit instead of +relying on ad hoc searches. Reserved SDK subpaths must have tracked owner usage; +unused reserved helper exports should be removed from the public SDK. If a manifest field is still accepted, plugin authors can keep using it until the docs and diagnostics say otherwise. New code should prefer the documented @@ -540,7 +537,6 @@ releases. | `plugin-sdk/memory-host-markdown` | Managed markdown helpers | Shared managed-markdown helpers for memory-adjacent plugins | | `plugin-sdk/memory-host-search` | Active memory search facade | Lazy active-memory search-manager runtime facade | | `plugin-sdk/memory-host-status` | Memory host status alias | Vendor-neutral alias for memory host status helpers | - | `plugin-sdk/memory-lancedb` | Bundled memory-lancedb helpers | Memory-lancedb helper surface | | `plugin-sdk/testing` | Test utilities | Legacy broad compatibility barrel; prefer focused test subpaths such as `plugin-sdk/plugin-test-runtime`, `plugin-sdk/channel-test-helpers`, `plugin-sdk/channel-target-testing`, `plugin-sdk/test-env`, and `plugin-sdk/test-fixtures` | @@ -548,28 +544,16 @@ This table is intentionally the common migration subset, not the full SDK surface. The full list of 200+ entrypoints lives in `scripts/lib/plugin-sdk-entrypoints.json`. -That list still includes some bundled-plugin helper seams such as -`plugin-sdk/feishu`, `plugin-sdk/feishu-setup`, `plugin-sdk/zalo`, -`plugin-sdk/zalo-setup`, and `plugin-sdk/matrix*`. Those remain exported for -bundled-plugin maintenance and compatibility, but they are intentionally -omitted from the common migration table and are not the recommended target for -new plugin code. +That list still includes a few bundled-plugin helper seams that have tracked +owner usage. They remain exported for bundled-plugin maintenance, but they are +intentionally omitted from the common migration table and are not the +recommended target for new plugin code. The same rule applies to other bundled-helper families such as: -- browser support helpers: `plugin-sdk/browser-cdp`, `plugin-sdk/browser-config-runtime`, `plugin-sdk/browser-config-support`, `plugin-sdk/browser-control-auth`, `plugin-sdk/browser-node-runtime`, `plugin-sdk/browser-profiles`, `plugin-sdk/browser-security-runtime`, `plugin-sdk/browser-setup-tools`, `plugin-sdk/browser-support` -- Matrix: `plugin-sdk/matrix*` -- LINE: `plugin-sdk/line*` -- IRC: `plugin-sdk/irc*` -- bundled helper/plugin surfaces like `plugin-sdk/googlechat`, - `plugin-sdk/zalouser`, `plugin-sdk/bluebubbles*`, - `plugin-sdk/mattermost*`, `plugin-sdk/msteams`, - `plugin-sdk/nextcloud-talk`, `plugin-sdk/nostr`, `plugin-sdk/tlon`, - `plugin-sdk/twitch`, - `plugin-sdk/github-copilot-login`, `plugin-sdk/github-copilot-token`, - `plugin-sdk/diagnostics-otel`, `plugin-sdk/diagnostics-prometheus`, - `plugin-sdk/diffs`, `plugin-sdk/llm-task`, `plugin-sdk/thread-ownership`, - and `plugin-sdk/voice-call` +- browser support helpers: `plugin-sdk/browser-config-runtime`, `plugin-sdk/browser-config-support`, `plugin-sdk/browser-node-runtime`, `plugin-sdk/browser-security-runtime`, `plugin-sdk/browser-setup-tools` +- Matrix: `plugin-sdk/matrix-runtime-shared` +- bundled helper/plugin surfaces like `plugin-sdk/github-copilot-token` and `plugin-sdk/memory-core` `plugin-sdk/github-copilot-token` currently exposes the narrow token-helper surface `DEFAULT_COPILOT_API_BASE_URL`, diff --git a/docs/plugins/sdk-overview.md b/docs/plugins/sdk-overview.md index 44b71ce8092..80802a74303 100644 --- a/docs/plugins/sdk-overview.md +++ b/docs/plugins/sdk-overview.md @@ -51,10 +51,10 @@ pattern for new plugins. barrels or add a narrow generic SDK contract when a need is truly cross-channel. -A small set of bundled-plugin helper seams (`plugin-sdk/feishu`, -`plugin-sdk/zalo`, `plugin-sdk/matrix*`, and similar) still appear in the -generated export map. They exist for bundled-plugin maintenance only and are -not recommended import paths for new third-party plugins. +A 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. ## Subpath reference diff --git a/docs/plugins/sdk-subpaths.md b/docs/plugins/sdk-subpaths.md index 0ddf83809e4..3bcf51c28d7 100644 --- a/docs/plugins/sdk-subpaths.md +++ b/docs/plugins/sdk-subpaths.md @@ -11,10 +11,9 @@ This page catalogs the commonly used subpaths grouped by purpose. The generated full list of 200+ subpaths lives in `scripts/lib/plugin-sdk-entrypoints.json`; reserved bundled-plugin helper subpaths appear there but are implementation detail unless a doc page explicitly promotes them. Maintainers can audit active -and dormant reserved helper subpaths with `pnpm plugins:boundary-report:summary`; -`pnpm plugins:boundary-report --retirement-plan` emits an issue/PR-ready -checklist grouped by owner, and the full JSON report includes dormant helper -owner, replacement, and remove-after metadata. +reserved helper subpaths with `pnpm plugins:boundary-report:summary`; unused +reserved helper exports fail the CI report instead of staying in the public SDK +as dormant compatibility debt. For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview). @@ -311,18 +310,14 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview) | `plugin-sdk/memory-host-markdown` | Shared managed-markdown helpers for memory-adjacent plugins | | `plugin-sdk/memory-host-search` | Active memory runtime facade for search-manager access | | `plugin-sdk/memory-host-status` | Vendor-neutral alias for memory host status helpers | - | `plugin-sdk/memory-lancedb` | Bundled memory-lancedb helper surface | | Family | Current subpaths | Intended use | | --- | --- | --- | - | Browser | `plugin-sdk/browser-cdp`, `plugin-sdk/browser-config-runtime`, `plugin-sdk/browser-config-support`, `plugin-sdk/browser-control-auth`, `plugin-sdk/browser-node-runtime`, `plugin-sdk/browser-profiles`, `plugin-sdk/browser-security-runtime`, `plugin-sdk/browser-setup-tools`, `plugin-sdk/browser-support` | Bundled browser plugin support helpers. `browser-profiles` exports `resolveBrowserConfig`, `resolveProfile`, `ResolvedBrowserConfig`, `ResolvedBrowserProfile`, and `ResolvedBrowserTabCleanupConfig` for the normalized `browser.tabCleanup` shape. `browser-support` remains the compatibility barrel. | - | Matrix | `plugin-sdk/matrix`, `plugin-sdk/matrix-helper`, `plugin-sdk/matrix-runtime-heavy`, `plugin-sdk/matrix-runtime-shared`, `plugin-sdk/matrix-runtime-surface`, `plugin-sdk/matrix-surface`, `plugin-sdk/matrix-thread-bindings` | Bundled Matrix helper/runtime surface | - | Line | `plugin-sdk/line`, `plugin-sdk/line-core`, `plugin-sdk/line-runtime`, `plugin-sdk/line-surface` | Bundled LINE helper/runtime surface | - | IRC | `plugin-sdk/irc`, `plugin-sdk/irc-surface` | Bundled IRC helper surface | - | Channel-specific helpers | `plugin-sdk/googlechat`, `plugin-sdk/googlechat-runtime-shared`, `plugin-sdk/zalouser`, `plugin-sdk/bluebubbles`, `plugin-sdk/bluebubbles-policy`, `plugin-sdk/mattermost`, `plugin-sdk/mattermost-policy`, `plugin-sdk/feishu`, `plugin-sdk/feishu-conversation`, `plugin-sdk/feishu-setup`, `plugin-sdk/msteams`, `plugin-sdk/nextcloud-talk`, `plugin-sdk/nostr`, `plugin-sdk/telegram-command-ui`, `plugin-sdk/tlon`, `plugin-sdk/twitch`, `plugin-sdk/zalo`, `plugin-sdk/zalo-setup` | Deprecated bundled channel compatibility/helper seams. New plugins should import generic SDK subpaths or plugin-local barrels. | - | Auth/plugin-specific helpers | `plugin-sdk/github-copilot-login`, `plugin-sdk/github-copilot-token`, `plugin-sdk/diagnostics-otel`, `plugin-sdk/diagnostics-prometheus`, `plugin-sdk/diffs`, `plugin-sdk/llm-task`, `plugin-sdk/memory-core`, `plugin-sdk/memory-lancedb`, `plugin-sdk/opencode`, `plugin-sdk/thread-ownership`, `plugin-sdk/voice-call` | Bundled feature/plugin helper seams; `plugin-sdk/github-copilot-token` currently exports `DEFAULT_COPILOT_API_BASE_URL`, `deriveCopilotApiBaseUrlFromToken`, and `resolveCopilotApiToken` | + | Browser | `plugin-sdk/browser-config-runtime`, `plugin-sdk/browser-config-support`, `plugin-sdk/browser-node-runtime`, `plugin-sdk/browser-security-runtime`, `plugin-sdk/browser-setup-tools` | Bundled browser plugin support helpers still consumed by the owner package. | + | Matrix | `plugin-sdk/matrix-runtime-shared` | Bundled Matrix runtime surface still consumed by the owner package. | + | Auth/plugin-specific helpers | `plugin-sdk/github-copilot-token`, `plugin-sdk/memory-core` | Bundled feature/plugin helper seams still consumed by their owners; `plugin-sdk/github-copilot-token` currently exports `DEFAULT_COPILOT_API_BASE_URL`, `deriveCopilotApiBaseUrlFromToken`, and `resolveCopilotApiToken`. | diff --git a/extensions/line/src/setup-surface.test.ts b/extensions/line/src/setup-surface.test.ts index c7ec4184cff..953f6f8813b 100644 --- a/extensions/line/src/setup-surface.test.ts +++ b/extensions/line/src/setup-surface.test.ts @@ -102,6 +102,7 @@ function collectRuntimeApiPreExports(runtimeApiPath: string): string[] { ); const preExports = new Set(); let pluginSdkLineRuntimeSeen = false; + const removedLineRuntimeSpecifier = ["openclaw", "plugin-sdk", "line-runtime"].join("/"); for (const statement of runtimeApiFile.statements) { if (!ts.isExportDeclaration(statement)) { @@ -114,7 +115,7 @@ function collectRuntimeApiPreExports(runtimeApiPath: string): string[] { if (!moduleSpecifier) { continue; } - if (moduleSpecifier === "openclaw/plugin-sdk/line-runtime") { + if (moduleSpecifier === removedLineRuntimeSpecifier) { pluginSdkLineRuntimeSeen = true; break; } @@ -377,9 +378,6 @@ describe("line runtime api", () => { it("keeps the LINE runtime barrel self-contained", () => { const runtimeApiPath = path.join(process.cwd(), "extensions", "line", "runtime-api.ts"); expect(collectRuntimeApiPreExports(runtimeApiPath)).toEqual([]); - const runtimeApiSource = readFileSync(runtimeApiPath, "utf8"); - - expect(runtimeApiSource).not.toContain("openclaw/plugin-sdk/line-runtime"); expect(collectRuntimeApiPreExports(runtimeApiPath)).toEqual([]); }); }); diff --git a/extensions/matrix/src/runtime-api.ts b/extensions/matrix/src/runtime-api.ts index affada0b17d..7b534880674 100644 --- a/extensions/matrix/src/runtime-api.ts +++ b/extensions/matrix/src/runtime-api.ts @@ -109,5 +109,5 @@ export { type RuntimeLogger, } from "openclaw/plugin-sdk/matrix-runtime-shared"; export type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; -// resolveMatrixAccountStringValues already comes from plugin-sdk/matrix. +// resolveMatrixAccountStringValues already comes from the Matrix API barrel. // Re-exporting auth-precedence here makes Jiti try to define the same export twice. diff --git a/package.json b/package.json index e37b4f675f4..e1e8e9e6ce4 100644 --- a/package.json +++ b/package.json @@ -370,10 +370,6 @@ "types": "./dist/plugin-sdk/conversation-runtime.d.ts", "default": "./dist/plugin-sdk/conversation-runtime.js" }, - "./plugin-sdk/matrix-runtime-heavy": { - "types": "./dist/plugin-sdk/matrix-runtime-heavy.d.ts", - "default": "./dist/plugin-sdk/matrix-runtime-heavy.js" - }, "./plugin-sdk/matrix-runtime-shared": { "types": "./dist/plugin-sdk/matrix-runtime-shared.d.ts", "default": "./dist/plugin-sdk/matrix-runtime-shared.js" @@ -446,10 +442,6 @@ "types": "./dist/plugin-sdk/gateway-runtime.d.ts", "default": "./dist/plugin-sdk/gateway-runtime.js" }, - "./plugin-sdk/github-copilot-login": { - "types": "./dist/plugin-sdk/github-copilot-login.d.ts", - "default": "./dist/plugin-sdk/github-copilot-login.js" - }, "./plugin-sdk/github-copilot-token": { "types": "./dist/plugin-sdk/github-copilot-token.d.ts", "default": "./dist/plugin-sdk/github-copilot-token.js" @@ -602,18 +594,6 @@ "types": "./dist/plugin-sdk/allowlist-config-edit.d.ts", "default": "./dist/plugin-sdk/allowlist-config-edit.js" }, - "./plugin-sdk/bluebubbles": { - "types": "./dist/plugin-sdk/bluebubbles.d.ts", - "default": "./dist/plugin-sdk/bluebubbles.js" - }, - "./plugin-sdk/bluebubbles-policy": { - "types": "./dist/plugin-sdk/bluebubbles-policy.d.ts", - "default": "./dist/plugin-sdk/bluebubbles-policy.js" - }, - "./plugin-sdk/browser-cdp": { - "types": "./dist/plugin-sdk/browser-cdp.d.ts", - "default": "./dist/plugin-sdk/browser-cdp.js" - }, "./plugin-sdk/browser-config": { "types": "./dist/plugin-sdk/browser-config.d.ts", "default": "./dist/plugin-sdk/browser-config.js" @@ -626,18 +606,10 @@ "types": "./dist/plugin-sdk/browser-config-support.d.ts", "default": "./dist/plugin-sdk/browser-config-support.js" }, - "./plugin-sdk/browser-control-auth": { - "types": "./dist/plugin-sdk/browser-control-auth.d.ts", - "default": "./dist/plugin-sdk/browser-control-auth.js" - }, "./plugin-sdk/browser-node-runtime": { "types": "./dist/plugin-sdk/browser-node-runtime.d.ts", "default": "./dist/plugin-sdk/browser-node-runtime.js" }, - "./plugin-sdk/browser-profiles": { - "types": "./dist/plugin-sdk/browser-profiles.d.ts", - "default": "./dist/plugin-sdk/browser-profiles.js" - }, "./plugin-sdk/browser-security-runtime": { "types": "./dist/plugin-sdk/browser-security-runtime.d.ts", "default": "./dist/plugin-sdk/browser-security-runtime.js" @@ -646,10 +618,6 @@ "types": "./dist/plugin-sdk/browser-setup-tools.d.ts", "default": "./dist/plugin-sdk/browser-setup-tools.js" }, - "./plugin-sdk/browser-support": { - "types": "./dist/plugin-sdk/browser-support.d.ts", - "default": "./dist/plugin-sdk/browser-support.js" - }, "./plugin-sdk/boolean-param": { "types": "./dist/plugin-sdk/boolean-param.d.ts", "default": "./dist/plugin-sdk/boolean-param.js" @@ -722,18 +690,6 @@ "types": "./dist/plugin-sdk/diagnostic-runtime.d.ts", "default": "./dist/plugin-sdk/diagnostic-runtime.js" }, - "./plugin-sdk/diagnostics-otel": { - "types": "./dist/plugin-sdk/diagnostics-otel.d.ts", - "default": "./dist/plugin-sdk/diagnostics-otel.js" - }, - "./plugin-sdk/diagnostics-prometheus": { - "types": "./dist/plugin-sdk/diagnostics-prometheus.d.ts", - "default": "./dist/plugin-sdk/diagnostics-prometheus.js" - }, - "./plugin-sdk/diffs": { - "types": "./dist/plugin-sdk/diffs.d.ts", - "default": "./dist/plugin-sdk/diffs.js" - }, "./plugin-sdk/error-runtime": { "types": "./dist/plugin-sdk/error-runtime.d.ts", "default": "./dist/plugin-sdk/error-runtime.js" @@ -850,18 +806,6 @@ "types": "./dist/plugin-sdk/context-visibility-runtime.d.ts", "default": "./dist/plugin-sdk/context-visibility-runtime.js" }, - "./plugin-sdk/feishu": { - "types": "./dist/plugin-sdk/feishu.d.ts", - "default": "./dist/plugin-sdk/feishu.js" - }, - "./plugin-sdk/feishu-conversation": { - "types": "./dist/plugin-sdk/feishu-conversation.d.ts", - "default": "./dist/plugin-sdk/feishu-conversation.js" - }, - "./plugin-sdk/feishu-setup": { - "types": "./dist/plugin-sdk/feishu-setup.d.ts", - "default": "./dist/plugin-sdk/feishu-setup.js" - }, "./plugin-sdk/file-lock": { "types": "./dist/plugin-sdk/file-lock.d.ts", "default": "./dist/plugin-sdk/file-lock.js" @@ -926,14 +870,6 @@ "types": "./dist/plugin-sdk/directory-runtime.d.ts", "default": "./dist/plugin-sdk/directory-runtime.js" }, - "./plugin-sdk/googlechat": { - "types": "./dist/plugin-sdk/googlechat.d.ts", - "default": "./dist/plugin-sdk/googlechat.js" - }, - "./plugin-sdk/googlechat-runtime-shared": { - "types": "./dist/plugin-sdk/googlechat-runtime-shared.d.ts", - "default": "./dist/plugin-sdk/googlechat-runtime-shared.js" - }, "./plugin-sdk/media-generation-runtime-shared": { "types": "./dist/plugin-sdk/media-generation-runtime-shared.d.ts", "default": "./dist/plugin-sdk/media-generation-runtime-shared.js" @@ -970,14 +906,6 @@ "types": "./dist/plugin-sdk/video-generation-core.d.ts", "default": "./dist/plugin-sdk/video-generation-core.js" }, - "./plugin-sdk/irc": { - "types": "./dist/plugin-sdk/irc.d.ts", - "default": "./dist/plugin-sdk/irc.js" - }, - "./plugin-sdk/irc-surface": { - "types": "./dist/plugin-sdk/irc-surface.d.ts", - "default": "./dist/plugin-sdk/irc-surface.js" - }, "./plugin-sdk/reply-history": { "types": "./dist/plugin-sdk/reply-history.d.ts", "default": "./dist/plugin-sdk/reply-history.js" @@ -1022,58 +950,10 @@ "types": "./dist/plugin-sdk/keyed-async-queue.d.ts", "default": "./dist/plugin-sdk/keyed-async-queue.js" }, - "./plugin-sdk/line": { - "types": "./dist/plugin-sdk/line.d.ts", - "default": "./dist/plugin-sdk/line.js" - }, - "./plugin-sdk/line-core": { - "types": "./dist/plugin-sdk/line-core.d.ts", - "default": "./dist/plugin-sdk/line-core.js" - }, - "./plugin-sdk/line-runtime": { - "types": "./dist/plugin-sdk/line-runtime.d.ts", - "default": "./dist/plugin-sdk/line-runtime.js" - }, - "./plugin-sdk/line-surface": { - "types": "./dist/plugin-sdk/line-surface.d.ts", - "default": "./dist/plugin-sdk/line-surface.js" - }, - "./plugin-sdk/llm-task": { - "types": "./dist/plugin-sdk/llm-task.d.ts", - "default": "./dist/plugin-sdk/llm-task.js" - }, - "./plugin-sdk/matrix": { - "types": "./dist/plugin-sdk/matrix.d.ts", - "default": "./dist/plugin-sdk/matrix.js" - }, - "./plugin-sdk/matrix-helper": { - "types": "./dist/plugin-sdk/matrix-helper.d.ts", - "default": "./dist/plugin-sdk/matrix-helper.js" - }, - "./plugin-sdk/matrix-runtime-surface": { - "types": "./dist/plugin-sdk/matrix-runtime-surface.d.ts", - "default": "./dist/plugin-sdk/matrix-runtime-surface.js" - }, - "./plugin-sdk/matrix-surface": { - "types": "./dist/plugin-sdk/matrix-surface.d.ts", - "default": "./dist/plugin-sdk/matrix-surface.js" - }, - "./plugin-sdk/matrix-thread-bindings": { - "types": "./dist/plugin-sdk/matrix-thread-bindings.d.ts", - "default": "./dist/plugin-sdk/matrix-thread-bindings.js" - }, "./plugin-sdk/qa-runner-runtime": { "types": "./dist/plugin-sdk/qa-runner-runtime.d.ts", "default": "./dist/plugin-sdk/qa-runner-runtime.js" }, - "./plugin-sdk/mattermost": { - "types": "./dist/plugin-sdk/mattermost.d.ts", - "default": "./dist/plugin-sdk/mattermost.js" - }, - "./plugin-sdk/mattermost-policy": { - "types": "./dist/plugin-sdk/mattermost-policy.d.ts", - "default": "./dist/plugin-sdk/mattermost-policy.js" - }, "./plugin-sdk/memory-core": { "types": "./dist/plugin-sdk/memory-core.d.ts", "default": "./dist/plugin-sdk/memory-core.js" @@ -1154,14 +1034,6 @@ "types": "./dist/plugin-sdk/memory-host-status.d.ts", "default": "./dist/plugin-sdk/memory-host-status.js" }, - "./plugin-sdk/memory-lancedb": { - "types": "./dist/plugin-sdk/memory-lancedb.d.ts", - "default": "./dist/plugin-sdk/memory-lancedb.js" - }, - "./plugin-sdk/msteams": { - "types": "./dist/plugin-sdk/msteams.d.ts", - "default": "./dist/plugin-sdk/msteams.js" - }, "./plugin-sdk/models-provider-runtime": { "types": "./dist/plugin-sdk/models-provider-runtime.d.ts", "default": "./dist/plugin-sdk/models-provider-runtime.js" @@ -1178,14 +1050,6 @@ "types": "./dist/plugin-sdk/native-command-registry.d.ts", "default": "./dist/plugin-sdk/native-command-registry.js" }, - "./plugin-sdk/nextcloud-talk": { - "types": "./dist/plugin-sdk/nextcloud-talk.d.ts", - "default": "./dist/plugin-sdk/nextcloud-talk.js" - }, - "./plugin-sdk/nostr": { - "types": "./dist/plugin-sdk/nostr.d.ts", - "default": "./dist/plugin-sdk/nostr.js" - }, "./plugin-sdk/provider-auth": { "types": "./dist/plugin-sdk/provider-auth.d.ts", "default": "./dist/plugin-sdk/provider-auth.js" @@ -1242,10 +1106,6 @@ "types": "./dist/plugin-sdk/provider-model-shared.d.ts", "default": "./dist/plugin-sdk/provider-model-shared.js" }, - "./plugin-sdk/opencode": { - "types": "./dist/plugin-sdk/opencode.d.ts", - "default": "./dist/plugin-sdk/opencode.js" - }, "./plugin-sdk/volc-model-catalog-shared": { "types": "./dist/plugin-sdk/volc-model-catalog-shared.d.ts", "default": "./dist/plugin-sdk/volc-model-catalog-shared.js" @@ -1358,22 +1218,10 @@ "types": "./dist/plugin-sdk/telegram-command-config.d.ts", "default": "./dist/plugin-sdk/telegram-command-config.js" }, - "./plugin-sdk/telegram-command-ui": { - "types": "./dist/plugin-sdk/telegram-command-ui.d.ts", - "default": "./dist/plugin-sdk/telegram-command-ui.js" - }, "./plugin-sdk/text-autolink-runtime": { "types": "./dist/plugin-sdk/text-autolink-runtime.d.ts", "default": "./dist/plugin-sdk/text-autolink-runtime.js" }, - "./plugin-sdk/thread-ownership": { - "types": "./dist/plugin-sdk/thread-ownership.d.ts", - "default": "./dist/plugin-sdk/thread-ownership.js" - }, - "./plugin-sdk/tlon": { - "types": "./dist/plugin-sdk/tlon.d.ts", - "default": "./dist/plugin-sdk/tlon.js" - }, "./plugin-sdk/tool-payload": { "types": "./dist/plugin-sdk/tool-payload.d.ts", "default": "./dist/plugin-sdk/tool-payload.js" @@ -1382,10 +1230,6 @@ "types": "./dist/plugin-sdk/tool-send.d.ts", "default": "./dist/plugin-sdk/tool-send.js" }, - "./plugin-sdk/twitch": { - "types": "./dist/plugin-sdk/twitch.d.ts", - "default": "./dist/plugin-sdk/twitch.js" - }, "./plugin-sdk/webhook-ingress": { "types": "./dist/plugin-sdk/webhook-ingress.d.ts", "default": "./dist/plugin-sdk/webhook-ingress.js" @@ -1406,22 +1250,6 @@ "types": "./dist/plugin-sdk/web-media.d.ts", "default": "./dist/plugin-sdk/web-media.js" }, - "./plugin-sdk/voice-call": { - "types": "./dist/plugin-sdk/voice-call.d.ts", - "default": "./dist/plugin-sdk/voice-call.js" - }, - "./plugin-sdk/zalo": { - "types": "./dist/plugin-sdk/zalo.d.ts", - "default": "./dist/plugin-sdk/zalo.js" - }, - "./plugin-sdk/zalo-setup": { - "types": "./dist/plugin-sdk/zalo-setup.d.ts", - "default": "./dist/plugin-sdk/zalo-setup.js" - }, - "./plugin-sdk/zalouser": { - "types": "./dist/plugin-sdk/zalouser.d.ts", - "default": "./dist/plugin-sdk/zalouser.js" - }, "./plugin-sdk/zod": { "types": "./dist/plugin-sdk/zod.d.ts", "default": "./dist/plugin-sdk/zod.js" diff --git a/scripts/lib/plugin-sdk-doc-metadata.ts b/scripts/lib/plugin-sdk-doc-metadata.ts index 8d50a8a7383..c7d94b2a7b5 100644 --- a/scripts/lib/plugin-sdk-doc-metadata.ts +++ b/scripts/lib/plugin-sdk-doc-metadata.ts @@ -95,9 +95,6 @@ export const pluginSdkDocMetadata = { "provider-selection-runtime": { category: "provider", }, - opencode: { - category: "provider", - }, "runtime-store": { category: "runtime", }, diff --git a/scripts/lib/plugin-sdk-entrypoints.json b/scripts/lib/plugin-sdk-entrypoints.json index 5548c393212..a0b66c8ed30 100644 --- a/scripts/lib/plugin-sdk-entrypoints.json +++ b/scripts/lib/plugin-sdk-entrypoints.json @@ -76,7 +76,6 @@ "media-generation-runtime", "conversation-binding-runtime", "conversation-runtime", - "matrix-runtime-heavy", "matrix-runtime-shared", "thread-bindings-runtime", "thread-bindings-session-runtime", @@ -95,7 +94,6 @@ "secret-file-runtime", "security-runtime", "gateway-runtime", - "github-copilot-login", "github-copilot-token", "cli-runtime", "cli-backend", @@ -134,18 +132,12 @@ "agent-config-primitives", "allow-from", "allowlist-config-edit", - "bluebubbles", - "bluebubbles-policy", - "browser-cdp", "browser-config", "browser-config-runtime", "browser-config-support", - "browser-control-auth", "browser-node-runtime", - "browser-profiles", "browser-security-runtime", "browser-setup-tools", - "browser-support", "boolean-param", "channel-contract-testing", "dangerous-name-runtime", @@ -164,9 +156,6 @@ "direct-dm-guard-policy", "device-bootstrap", "diagnostic-runtime", - "diagnostics-otel", - "diagnostics-prometheus", - "diffs", "error-runtime", "extension-shared", "channel-config-helpers", @@ -196,9 +185,6 @@ "channel-route", "channel-targets", "context-visibility-runtime", - "feishu", - "feishu-conversation", - "feishu-setup", "file-lock", "fetch-runtime", "runtime-fetch", @@ -215,8 +201,6 @@ "global-singleton", "directory-config-runtime", "directory-runtime", - "googlechat", - "googlechat-runtime-shared", "media-generation-runtime-shared", "image-generation", "image-generation-runtime", @@ -226,8 +210,6 @@ "video-generation", "video-generation-runtime", "video-generation-core", - "irc", - "irc-surface", "reply-history", "realtime-transcription", "realtime-voice", @@ -239,19 +221,7 @@ "json-store", "persistent-dedupe", "keyed-async-queue", - "line", - "line-core", - "line-runtime", - "line-surface", - "llm-task", - "matrix", - "matrix-helper", - "matrix-runtime-surface", - "matrix-surface", - "matrix-thread-bindings", "qa-runner-runtime", - "mattermost", - "mattermost-policy", "memory-core", "memory-core-engine-runtime", "memory-core-host-engine-embeddings", @@ -272,14 +242,10 @@ "memory-host-markdown", "memory-host-search", "memory-host-status", - "memory-lancedb", - "msteams", "models-provider-runtime", "skill-commands-runtime", "native-command-config-runtime", "native-command-registry", - "nextcloud-talk", - "nostr", "provider-auth", "provider-auth-runtime", "provider-auth-api-key", @@ -294,7 +260,6 @@ "provider-http", "provider-model-types", "provider-model-shared", - "opencode", "volc-model-catalog-shared", "provider-onboard", "provider-stream-family", @@ -323,21 +288,13 @@ "state-paths", "target-resolver-runtime", "telegram-command-config", - "telegram-command-ui", "text-autolink-runtime", - "thread-ownership", - "tlon", "tool-payload", "tool-send", - "twitch", "webhook-ingress", "webhook-targets", "webhook-request-guards", "webhook-path", "web-media", - "voice-call", - "zalo", - "zalo-setup", - "zalouser", "zod" ] diff --git a/scripts/plugin-boundary-report.ts b/scripts/plugin-boundary-report.ts index 801294c8046..f7c421aa754 100644 --- a/scripts/plugin-boundary-report.ts +++ b/scripts/plugin-boundary-report.ts @@ -2,14 +2,11 @@ import { existsSync, readdirSync, readFileSync } from "node:fs"; import { join, relative, resolve } from "node:path"; import { - dormantReservedBundledPluginSdkEntrypoints, - dormantReservedBundledPluginSdkEntrypointRecords, pluginSdkEntrypoints, publicPluginOwnedSdkEntrypoints, reservedBundledPluginSdkEntrypoints, supportedBundledFacadeSdkEntrypoints, } from "../src/plugin-sdk/entrypoints.ts"; -import type { DormantReservedBundledPluginSdkEntrypointRecord } from "../src/plugin-sdk/entrypoints.ts"; import { PLUGIN_COMPAT_RECORDS } from "../src/plugins/compat/registry.ts"; import type { PluginCompatRecord } from "../src/plugins/compat/types.ts"; @@ -30,7 +27,6 @@ const PLUGIN_SDK_SPECIFIER_PATTERN = type CliOptions = { json: boolean; summary: boolean; - retirementPlan: boolean; owner?: string; failOnCrossOwner: boolean; failOnEligibleCompat: boolean; @@ -71,16 +67,11 @@ type BoundaryReport = { pluginSdk: { entrypointCount: number; reservedCount: number; - dormantReservedCount: number; supportedBundledFacadeCount: number; publicPluginOwnedCount: number; reservedImports: ReservedSdkImport[]; crossOwnerReservedImports: ReservedSdkImport[]; unusedReservedSubpaths: string[]; - dormantReservedSubpaths: string[]; - dormantReservedRecords: DormantReservedBundledPluginSdkEntrypointRecord[]; - unclassifiedUnusedReservedSubpaths: string[]; - dormantReservedEligibleForRemovalSubpaths: string[]; }; memoryHostSdk: { privatePackage: boolean; @@ -102,17 +93,12 @@ type BoundaryReportSummary = { pluginSdk: { entrypointCount: number; reservedCount: number; - dormantReservedCount: number; supportedBundledFacadeCount: number; publicPluginOwnedCount: number; reservedImportCount: number; crossOwnerReservedImportCount: number; unusedReservedCount: number; - dormantReservedCountInUnused: number; - unclassifiedUnusedReservedCount: number; - unclassifiedUnusedReservedSubpaths: string[]; - dormantReservedEligibleForRemovalCount: number; - dormantReservedEligibleForRemovalSubpaths: string[]; + unusedReservedSubpaths: string[]; crossOwnerReservedImports: ReservedSdkImport[]; }; memoryHostSdk: { @@ -163,7 +149,6 @@ function parseArgs(args: readonly string[]): CliOptions { const options: CliOptions = { json: false, summary: false, - retirementPlan: false, failOnCrossOwner: false, failOnEligibleCompat: false, failOnUnclassifiedUnusedReserved: false, @@ -175,8 +160,6 @@ function parseArgs(args: readonly string[]): CliOptions { options.json = true; } else if (arg === "--summary") { options.summary = true; - } else if (arg === "--retirement-plan") { - options.retirementPlan = true; } else if (arg === "--owner") { const owner = args[index + 1]; if (!owner || owner.startsWith("--")) { @@ -196,9 +179,6 @@ function parseArgs(args: readonly string[]): CliOptions { throw new Error(`Unknown argument: ${arg}`); } } - if (options.retirementPlan && (options.json || options.summary)) { - throw new Error("--retirement-plan cannot be combined with --summary or --json"); - } return options; } @@ -209,11 +189,10 @@ function renderHelp(): string { "Options:", " --summary Print compact counts only.", " --json Emit JSON instead of text.", - " --retirement-plan Emit an issue/PR-ready dormant SDK subpath retirement checklist.", " --owner Filter compat/imports/reserved shims by owner id.", " --fail-on-cross-owner Exit non-zero on cross-owner reserved SDK imports.", " --fail-on-eligible-compat Exit non-zero when deprecated compat is due for removal.", - " --fail-on-unclassified-unused-reserved Exit non-zero on unused reserved SDK shims without a dormant classification.", + " --fail-on-unclassified-unused-reserved Exit non-zero on unused reserved SDK shims.", ].join("\n"); } @@ -395,10 +374,6 @@ function resolveMemoryHostImplementation( return "mixed"; } -function isDateDue(removeAfter: string, today = new Date()): boolean { - return new Date(`${removeAfter}T00:00:00Z`) <= today; -} - function buildSummary(report: BoundaryReport, owner?: string): BoundaryReportSummary { const eligibleForRemoval = report.compat.records .filter((record) => record.eligibleForRemoval) @@ -419,19 +394,12 @@ function buildSummary(report: BoundaryReport, owner?: string): BoundaryReportSum pluginSdk: { entrypointCount: report.pluginSdk.entrypointCount, reservedCount: report.pluginSdk.reservedCount, - dormantReservedCount: report.pluginSdk.dormantReservedCount, supportedBundledFacadeCount: report.pluginSdk.supportedBundledFacadeCount, publicPluginOwnedCount: report.pluginSdk.publicPluginOwnedCount, reservedImportCount: report.pluginSdk.reservedImports.length, crossOwnerReservedImportCount: report.pluginSdk.crossOwnerReservedImports.length, unusedReservedCount: report.pluginSdk.unusedReservedSubpaths.length, - dormantReservedCountInUnused: report.pluginSdk.dormantReservedSubpaths.length, - unclassifiedUnusedReservedCount: report.pluginSdk.unclassifiedUnusedReservedSubpaths.length, - unclassifiedUnusedReservedSubpaths: report.pluginSdk.unclassifiedUnusedReservedSubpaths, - dormantReservedEligibleForRemovalCount: - report.pluginSdk.dormantReservedEligibleForRemovalSubpaths.length, - dormantReservedEligibleForRemovalSubpaths: - report.pluginSdk.dormantReservedEligibleForRemovalSubpaths, + unusedReservedSubpaths: report.pluginSdk.unusedReservedSubpaths, crossOwnerReservedImports: report.pluginSdk.crossOwnerReservedImports, }, memoryHostSdk: { @@ -455,10 +423,6 @@ function buildReport(options: Pick = {}): BoundaryReport { matchesOwner(options.owner, entry.owner) || matchesOwner(options.owner, entry.consumerOwner), ); const usedReserved = new Set(reservedImports.map((entry) => entry.subpath)); - const dormantReserved = new Set(dormantReservedBundledPluginSdkEntrypoints); - const dormantReservedRecords = dormantReservedBundledPluginSdkEntrypointRecords.filter((record) => - matchesOwner(options.owner, record.owner), - ); const unusedReservedSubpaths = reservedBundledPluginSdkEntrypoints .filter( (subpath) => @@ -466,14 +430,6 @@ function buildReport(options: Pick = {}): BoundaryReport { matchesOwner(options.owner, resolvePluginOwner(subpath, pluginIds)), ) .toSorted(); - const dormantReservedSubpaths = unusedReservedSubpaths - .filter((subpath) => dormantReserved.has(subpath)) - .toSorted(); - const dormantReservedEligibleForRemovalSubpaths = dormantReservedRecords - .filter((record) => unusedReservedSubpaths.includes(record.subpath)) - .filter((record) => isDateDue(record.removeAfter)) - .map((record) => record.subpath) - .toSorted(); return { generatedAt: new Date().toISOString(), compat: { @@ -484,7 +440,6 @@ function buildReport(options: Pick = {}): BoundaryReport { pluginSdk: { entrypointCount: pluginSdkEntrypoints.length, reservedCount: reservedBundledPluginSdkEntrypoints.length, - dormantReservedCount: dormantReservedBundledPluginSdkEntrypoints.length, supportedBundledFacadeCount: supportedBundledFacadeSdkEntrypoints.length, publicPluginOwnedCount: publicPluginOwnedSdkEntrypoints.length, reservedImports, @@ -492,12 +447,6 @@ function buildReport(options: Pick = {}): BoundaryReport { (entry) => entry.relation === "cross-owner", ), unusedReservedSubpaths, - dormantReservedSubpaths, - dormantReservedRecords, - unclassifiedUnusedReservedSubpaths: unusedReservedSubpaths - .filter((subpath) => !dormantReserved.has(subpath)) - .toSorted(), - dormantReservedEligibleForRemovalSubpaths, }, memoryHostSdk: collectMemoryHostBoundary(files), }; @@ -511,22 +460,13 @@ function renderSummaryText(summary: BoundaryReportSummary): string { `compat deprecated=${summary.compat.deprecatedCount} eligibleForRemoval=${summary.compat.eligibleForRemovalCount}`, ); lines.push( - `plugin-sdk entrypoints=${summary.pluginSdk.entrypointCount} reserved=${summary.pluginSdk.reservedCount} dormantReserved=${summary.pluginSdk.dormantReservedCount}`, + `plugin-sdk entrypoints=${summary.pluginSdk.entrypointCount} reserved=${summary.pluginSdk.reservedCount}`, ); lines.push( ` reservedImports=${summary.pluginSdk.reservedImportCount} crossOwnerReservedImports=${summary.pluginSdk.crossOwnerReservedImportCount} unusedReserved=${summary.pluginSdk.unusedReservedCount}`, ); - lines.push( - ` dormantUnused=${summary.pluginSdk.dormantReservedCountInUnused} unclassifiedUnused=${summary.pluginSdk.unclassifiedUnusedReservedCount}`, - ); - lines.push( - ` dormantEligibleForRemoval=${summary.pluginSdk.dormantReservedEligibleForRemovalCount}`, - ); - for (const subpath of summary.pluginSdk.unclassifiedUnusedReservedSubpaths) { - lines.push(` unclassified-unused ${subpath}`); - } - for (const subpath of summary.pluginSdk.dormantReservedEligibleForRemovalSubpaths) { - lines.push(` dormant-due ${subpath}`); + for (const subpath of summary.pluginSdk.unusedReservedSubpaths) { + lines.push(` unused-reserved ${subpath}`); } for (const entry of summary.pluginSdk.crossOwnerReservedImports) { lines.push(` cross-owner ${entry.file}: ${entry.specifier} owner=${entry.owner ?? "unknown"}`); @@ -551,22 +491,13 @@ function renderText(report: BoundaryReport, owner?: string): string { } lines.push(""); lines.push( - `plugin-sdk entrypoints=${report.pluginSdk.entrypointCount} reserved=${report.pluginSdk.reservedCount} dormantReserved=${report.pluginSdk.dormantReservedCount} supportedBundledFacade=${report.pluginSdk.supportedBundledFacadeCount} publicPluginOwned=${report.pluginSdk.publicPluginOwnedCount}`, + `plugin-sdk entrypoints=${report.pluginSdk.entrypointCount} reserved=${report.pluginSdk.reservedCount} supportedBundledFacade=${report.pluginSdk.supportedBundledFacadeCount} publicPluginOwned=${report.pluginSdk.publicPluginOwnedCount}`, ); lines.push( ` reservedImports=${report.pluginSdk.reservedImports.length} crossOwnerReservedImports=${report.pluginSdk.crossOwnerReservedImports.length} unusedReserved=${report.pluginSdk.unusedReservedSubpaths.length}`, ); - lines.push( - ` dormantUnused=${report.pluginSdk.dormantReservedSubpaths.length} unclassifiedUnused=${report.pluginSdk.unclassifiedUnusedReservedSubpaths.length}`, - ); - lines.push( - ` dormantEligibleForRemoval=${report.pluginSdk.dormantReservedEligibleForRemovalSubpaths.length}`, - ); - for (const subpath of report.pluginSdk.unclassifiedUnusedReservedSubpaths) { - lines.push(` unclassified-unused ${subpath}`); - } - for (const subpath of report.pluginSdk.dormantReservedEligibleForRemovalSubpaths) { - lines.push(` dormant-due ${subpath}`); + for (const subpath of report.pluginSdk.unusedReservedSubpaths) { + lines.push(` unused-reserved ${subpath}`); } for (const entry of report.pluginSdk.crossOwnerReservedImports) { lines.push(` cross-owner ${entry.file}: ${entry.specifier} owner=${entry.owner ?? "unknown"}`); @@ -578,49 +509,6 @@ function renderText(report: BoundaryReport, owner?: string): string { return lines.join("\n"); } -function renderRetirementPlan(report: BoundaryReport, owner?: string): string { - const records = report.pluginSdk.dormantReservedRecords.toSorted( - (left, right) => - left.owner.localeCompare(right.owner) || - left.removeAfter.localeCompare(right.removeAfter) || - left.subpath.localeCompare(right.subpath), - ); - const dueSubpaths = new Set(report.pluginSdk.dormantReservedEligibleForRemovalSubpaths); - const owners = [...new Set(records.map((record) => record.owner))]; - const removeAfterDates = [...new Set(records.map((record) => record.removeAfter))]; - const lines: string[] = []; - lines.push(`# Plugin SDK Dormant Reserved Subpath Retirement Plan`); - lines.push(""); - lines.push(`Generated: ${report.generatedAt}`); - if (owner) { - lines.push(`Owner filter: \`${owner}\``); - } - lines.push(""); - lines.push("## Summary"); - lines.push(""); - lines.push(`- Dormant reserved subpaths: ${records.length}`); - lines.push(`- Owners: ${owners.length}`); - lines.push(`- Removal dates: ${removeAfterDates.join(", ") || "none"}`); - lines.push(`- Eligible for removal now: ${dueSubpaths.size}`); - lines.push(`- CI gate: \`pnpm plugins:boundary-report:ci\``); - if (records.length === 0) { - lines.push(""); - lines.push("No dormant reserved SDK subpaths match this filter."); - return lines.join("\n"); - } - for (const ownerId of owners) { - lines.push(""); - lines.push(`## ${ownerId}`); - for (const record of records.filter((candidate) => candidate.owner === ownerId)) { - const status = dueSubpaths.has(record.subpath) ? "due" : "waiting"; - lines.push( - `- [ ] \`openclaw/plugin-sdk/${record.subpath}\` remove after \`${record.removeAfter}\` (${status}); reason=\`${record.reason}\`; replacement: ${record.replacement}`, - ); - } - } - return lines.join("\n"); -} - function collectFailures(report: BoundaryReport, options: CliOptions): string[] { const failures: string[] = []; if (options.failOnCrossOwner && report.pluginSdk.crossOwnerReservedImports.length > 0) { @@ -630,10 +518,10 @@ function collectFailures(report: BoundaryReport, options: CliOptions): string[] } if ( options.failOnUnclassifiedUnusedReserved && - report.pluginSdk.unclassifiedUnusedReservedSubpaths.length > 0 + report.pluginSdk.unusedReservedSubpaths.length > 0 ) { failures.push( - `${report.pluginSdk.unclassifiedUnusedReservedSubpaths.length} unused reserved SDK subpath(s) lack dormant classification`, + `${report.pluginSdk.unusedReservedSubpaths.length} unused reserved SDK subpath(s) found`, ); } if (options.failOnEligibleCompat && report.compat.eligibleForRemovalCount > 0) { @@ -641,14 +529,6 @@ function collectFailures(report: BoundaryReport, options: CliOptions): string[] `${report.compat.eligibleForRemovalCount} compatibility record(s) are due for removal`, ); } - if ( - options.failOnEligibleCompat && - report.pluginSdk.dormantReservedEligibleForRemovalSubpaths.length > 0 - ) { - failures.push( - `${report.pluginSdk.dormantReservedEligibleForRemovalSubpaths.length} dormant reserved SDK subpath(s) are due for removal`, - ); - } return failures; } @@ -669,9 +549,7 @@ if (options.help) { const report = buildReport(options); const summary = buildSummary(report, options.owner); -if (options.retirementPlan) { - process.stdout.write(`${renderRetirementPlan(report, options.owner)}\n`); -} else if (options.json) { +if (options.json) { process.stdout.write(`${JSON.stringify(options.summary ? summary : report, null, 2)}\n`); } else if (options.summary) { process.stdout.write(`${renderSummaryText(summary)}\n`); diff --git a/src/channels/plugins/bundled.shape-guard.test.ts b/src/channels/plugins/bundled.shape-guard.test.ts index 146f8a228e7..8633ddc03e0 100644 --- a/src/channels/plugins/bundled.shape-guard.test.ts +++ b/src/channels/plugins/bundled.shape-guard.test.ts @@ -913,12 +913,6 @@ describe("bundled channel entry shape guards", () => { expect(source.includes('from "./runtime.js"')).toBe(false); }); - it("keeps nextcloud-talk's private SDK surface off the broad runtime barrel", () => { - const source = fs.readFileSync(path.resolve("src/plugin-sdk/nextcloud-talk.ts"), "utf8"); - - expect(source.includes('from "./runtime.js"')).toBe(false); - }); - it("keeps bundled doctor surfaces off the broad runtime barrel", () => { const offenders = [ "extensions/discord/src/doctor.ts", diff --git a/src/channels/plugins/contracts/channel-import-guardrails.test.ts b/src/channels/plugins/contracts/channel-import-guardrails.test.ts index a96407b7746..7c48c22028f 100644 --- a/src/channels/plugins/contracts/channel-import-guardrails.test.ts +++ b/src/channels/plugins/contracts/channel-import-guardrails.test.ts @@ -232,7 +232,7 @@ const LOCAL_EXTENSION_API_BARREL_GUARDS = [ const LOCAL_EXTENSION_API_BARREL_EXCEPTIONS = [ // Direct import avoids a circular init path: - // accounts.ts -> runtime-api.ts -> src/plugin-sdk/matrix -> plugin api barrel -> accounts.ts + // accounts.ts -> runtime-api.ts -> plugin api barrel -> accounts.ts bundledPluginFile("matrix", "src/matrix/accounts.ts"), // Config schema stays on the public SDK seam and is covered by dedicated config guardrails. bundledPluginFile("msteams", "src/config-schema.ts"), diff --git a/src/plugin-sdk/browser-support.ts b/src/plugin-sdk/browser-support.ts deleted file mode 100644 index 5c1e2605163..00000000000 --- a/src/plugin-sdk/browser-support.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./browser-config-runtime.js"; -export * from "./browser-node-runtime.js"; -export * from "./browser-security-runtime.js"; -export * from "./browser-setup-tools.js"; diff --git a/src/plugin-sdk/diagnostics-otel.ts b/src/plugin-sdk/diagnostics-otel.ts deleted file mode 100644 index 8f320c1c818..00000000000 --- a/src/plugin-sdk/diagnostics-otel.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Narrow plugin-sdk surface for the bundled diagnostics-otel plugin. -// Keep this list additive and scoped to the bundled diagnostics-otel surface. - -export type { DiagnosticEventPayload } from "../infra/diagnostic-events.js"; -export type { DiagnosticEventMetadata } from "../infra/diagnostic-events.js"; -export type { DiagnosticTraceContext } from "../infra/diagnostic-trace-context.js"; -export { emitDiagnosticEvent, onDiagnosticEvent } from "../infra/diagnostic-events.js"; -export { - createChildDiagnosticTraceContext, - createDiagnosticTraceContext, - formatDiagnosticTraceparent, - isValidDiagnosticSpanId, - isValidDiagnosticTraceFlags, - isValidDiagnosticTraceId, - parseDiagnosticTraceparent, -} from "../infra/diagnostic-trace-context.js"; -export { redactSensitiveText } from "../logging/redact.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { - OpenClawPluginApi, - OpenClawPluginService, - OpenClawPluginServiceContext, -} from "../plugins/types.js"; diff --git a/src/plugin-sdk/diagnostics-prometheus.ts b/src/plugin-sdk/diagnostics-prometheus.ts deleted file mode 100644 index 505a3fe3483..00000000000 --- a/src/plugin-sdk/diagnostics-prometheus.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Narrow plugin-sdk surface for the bundled diagnostics-prometheus plugin. -// Keep this list additive and scoped to the bundled diagnostics-prometheus surface. - -export type { - DiagnosticEventMetadata, - DiagnosticEventPayload, -} from "../infra/diagnostic-events.js"; -export { redactSensitiveText } from "../logging/redact.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { - OpenClawPluginApi, - OpenClawPluginHttpRouteHandler, - OpenClawPluginService, - OpenClawPluginServiceContext, -} from "../plugins/types.js"; diff --git a/src/plugin-sdk/diffs.ts b/src/plugin-sdk/diffs.ts deleted file mode 100644 index 24ef1e0b3cb..00000000000 --- a/src/plugin-sdk/diffs.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Narrow plugin-sdk surface for the bundled diffs plugin. -// Keep this list additive and scoped to the bundled diffs surface. - -export { definePluginEntry } from "./plugin-entry.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; -export type { - AnyAgentTool, - OpenClawPluginApi, - OpenClawPluginConfigSchema, - OpenClawPluginToolContext, - PluginLogger, -} from "../plugins/types.js"; diff --git a/src/plugin-sdk/entrypoints.ts b/src/plugin-sdk/entrypoints.ts index eed4ee0a01d..37be5a34446 100644 --- a/src/plugin-sdk/entrypoints.ts +++ b/src/plugin-sdk/entrypoints.ts @@ -7,381 +7,16 @@ export const pluginSdkSubpaths = pluginSdkEntrypoints.filter((entry) => entry != // Transitional compatibility/helper surfaces owned by their matching bundled plugin. // Cross-owner extension imports are blocked by the package contract guardrails. export const reservedBundledPluginSdkEntrypoints = [ - "bluebubbles", - "bluebubbles-policy", - "browser-cdp", "browser-config-runtime", "browser-config-support", - "browser-control-auth", "browser-node-runtime", - "browser-profiles", "browser-security-runtime", "browser-setup-tools", - "browser-support", - "diagnostics-otel", - "diagnostics-prometheus", - "diffs", - "feishu", - "feishu-conversation", - "feishu-setup", - "github-copilot-login", "github-copilot-token", - "googlechat", - "googlechat-runtime-shared", - "irc", - "irc-surface", - "line", - "line-core", - "line-runtime", - "line-surface", - "llm-task", - "matrix", - "matrix-helper", - "matrix-runtime-heavy", "matrix-runtime-shared", - "matrix-runtime-surface", - "matrix-surface", - "matrix-thread-bindings", - "mattermost", - "mattermost-policy", "memory-core", - "memory-lancedb", - "msteams", - "nextcloud-talk", - "nostr", - "opencode", - "telegram-command-ui", - "thread-ownership", - "tlon", - "twitch", - "voice-call", - "zalo", - "zalo-setup", - "zalouser", ] as const; -export type DormantReservedBundledPluginSdkEntrypointReason = - | "bundled-plugin-compat" - | "external-compat" - | "owner-facade-compat"; - -export type DormantReservedBundledPluginSdkEntrypointRecord = { - subpath: string; - owner: string; - reason: DormantReservedBundledPluginSdkEntrypointReason; - removeAfter: "2026-07-24"; - replacement: string; -}; - -// Reserved compatibility/helper subpaths with no current tracked imports. -// Keeping them classified avoids treating dormant compatibility as unknown debt. -export const dormantReservedBundledPluginSdkEntrypointRecords = [ - { - subpath: "bluebubbles", - owner: "bluebubbles", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "BlueBubbles local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "bluebubbles-policy", - owner: "bluebubbles", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "BlueBubbles local api/runtime-api plus plugin-sdk/channel-policy", - }, - { - subpath: "browser-cdp", - owner: "browser", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "plugin-sdk/browser-config plus browser local config helpers", - }, - { - subpath: "browser-control-auth", - owner: "browser", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "plugin-sdk/browser-config plus browser local control-auth helpers", - }, - { - subpath: "browser-profiles", - owner: "browser", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "plugin-sdk/browser-config plus browser local profile helpers", - }, - { - subpath: "browser-support", - owner: "browser", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "focused browser SDK subpaths", - }, - { - subpath: "diagnostics-otel", - owner: "diagnostics-otel", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "diagnostics-otel local api plus plugin-sdk/diagnostic-runtime", - }, - { - subpath: "diagnostics-prometheus", - owner: "diagnostics-prometheus", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "diagnostics-prometheus local api plus plugin-sdk/diagnostic-runtime", - }, - { - subpath: "diffs", - owner: "diffs", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "diffs local api/runtime-api plus generic plugin SDK subpaths", - }, - { - subpath: "feishu", - owner: "feishu", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Feishu local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "feishu-conversation", - owner: "feishu", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Feishu local contract-api plus plugin-sdk/conversation-runtime", - }, - { - subpath: "feishu-setup", - owner: "feishu", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Feishu local setup-api plus plugin-sdk/channel-setup", - }, - { - subpath: "github-copilot-login", - owner: "github-copilot", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "GitHub Copilot local api plus plugin-sdk/provider-auth-login", - }, - { - subpath: "googlechat", - owner: "googlechat", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Google Chat local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "googlechat-runtime-shared", - owner: "googlechat", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Google Chat local runtime-api plus plugin-sdk/config-types", - }, - { - subpath: "irc", - owner: "irc", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "IRC local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "irc-surface", - owner: "irc", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "IRC local api plus plugin-sdk/channel-setup", - }, - { - subpath: "line", - owner: "line", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "LINE local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "line-core", - owner: "line", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "LINE local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "line-runtime", - owner: "line", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "LINE local runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "line-surface", - owner: "line", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "LINE local runtime-api plus plugin-sdk/channel-setup", - }, - { - subpath: "llm-task", - owner: "llm-task", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "llm-task local api plus plugin-sdk/plugin-entry", - }, - { - subpath: "matrix", - owner: "matrix", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Matrix local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "matrix-helper", - owner: "matrix", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Matrix local api plus plugin-sdk/config-types", - }, - { - subpath: "matrix-runtime-heavy", - owner: "matrix", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Matrix local runtime-api plus doctor/fix migration paths", - }, - { - subpath: "matrix-runtime-surface", - owner: "matrix", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Matrix local runtime-api plus plugin-sdk/config-types", - }, - { - subpath: "matrix-surface", - owner: "matrix", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Matrix local contract/runtime API plus generic channel SDK subpaths", - }, - { - subpath: "matrix-thread-bindings", - owner: "matrix", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Matrix local api plus plugin-sdk/thread-bindings-runtime", - }, - { - subpath: "mattermost", - owner: "mattermost", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Mattermost local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "mattermost-policy", - owner: "mattermost", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Mattermost local policy-api plus plugin-sdk/channel-policy", - }, - { - subpath: "memory-lancedb", - owner: "memory-lancedb", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "memory-lancedb local api plus plugin-sdk/plugin-entry", - }, - { - subpath: "msteams", - owner: "msteams", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Microsoft Teams local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "nextcloud-talk", - owner: "nextcloud-talk", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Nextcloud Talk local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "nostr", - owner: "nostr", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Nostr local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "opencode", - owner: "opencode", - reason: "external-compat", - removeAfter: "2026-07-24", - replacement: "plugin-sdk/provider-auth-api-key plus OpenCode local provider helpers", - }, - { - subpath: "telegram-command-ui", - owner: "telegram", - reason: "external-compat", - removeAfter: "2026-07-24", - replacement: "plugin-sdk/telegram-command-config plus Telegram local command UI helpers", - }, - { - subpath: "thread-ownership", - owner: "thread-ownership", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "thread-ownership local api plus plugin-sdk/plugin-entry", - }, - { - subpath: "tlon", - owner: "tlon", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Tlon local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "twitch", - owner: "twitch", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Twitch local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "voice-call", - owner: "voice-call", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Voice Call local api plus plugin-sdk/plugin-entry", - }, - { - subpath: "zalo", - owner: "zalo", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Zalo local api/runtime-api plus generic channel SDK subpaths", - }, - { - subpath: "zalo-setup", - owner: "zalo", - reason: "owner-facade-compat", - removeAfter: "2026-07-24", - replacement: "Zalo local setup/contract APIs plus plugin-sdk/channel-setup", - }, - { - subpath: "zalouser", - owner: "zalouser", - reason: "bundled-plugin-compat", - removeAfter: "2026-07-24", - replacement: "Zalo user local api/runtime-api plus generic channel SDK subpaths", - }, -] as const satisfies readonly DormantReservedBundledPluginSdkEntrypointRecord[]; - -export const dormantReservedBundledPluginSdkEntrypoints = - dormantReservedBundledPluginSdkEntrypointRecords.map((record) => record.subpath); - // Supported SDK facades backed by bundled plugins. These are intentionally public // until they move to generic, plugin-neutral contracts. export const supportedBundledFacadeSdkEntrypoints = [ diff --git a/src/plugin-sdk/feishu-conversation.ts b/src/plugin-sdk/feishu-conversation.ts deleted file mode 100644 index 5472dff00c7..00000000000 --- a/src/plugin-sdk/feishu-conversation.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { OpenClawConfig } from "../config/types.js"; -import type { BindingTargetKind } from "../infra/outbound/session-binding-service.js"; -import { - createLazyFacadeArrayValue, - createLazyFacadeObjectValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; - -type FeishuGroupSessionScope = "group" | "group_sender" | "group_topic" | "group_topic_sender"; - -type FeishuThreadBindingRecord = { - accountId: string; - conversationId: string; - parentConversationId?: string; - deliveryTo?: string; - deliveryThreadId?: string; - targetKind: "subagent" | "acp"; - targetSessionKey: string; - agentId?: string; - label?: string; - boundBy?: string; - boundAt: number; - lastActivityAt: number; -}; - -type FeishuThreadBindingManager = { - accountId: string; - getByConversationId: (conversationId: string) => FeishuThreadBindingRecord | undefined; - listBySessionKey: (targetSessionKey: string) => FeishuThreadBindingRecord[]; - bindConversation: (params: { - conversationId: string; - parentConversationId?: string; - targetKind: BindingTargetKind; - targetSessionKey: string; - metadata?: Record; - }) => FeishuThreadBindingRecord | null; - touchConversation: (conversationId: string, at?: number) => FeishuThreadBindingRecord | null; - unbindConversation: (conversationId: string) => FeishuThreadBindingRecord | null; - unbindBySessionKey: (targetSessionKey: string) => FeishuThreadBindingRecord[]; - stop: () => void; -}; - -type FacadeModule = { - buildFeishuConversationId: (params: { - chatId: string; - scope: FeishuGroupSessionScope; - senderOpenId?: string; - topicId?: string; - }) => string; - createFeishuThreadBindingManager: (params: { - accountId?: string; - cfg: OpenClawConfig; - }) => FeishuThreadBindingManager; - feishuSessionBindingAdapterChannels: readonly ["feishu"]; - feishuThreadBindingTesting: { - resetFeishuThreadBindingsForTests: () => void; - }; - parseFeishuDirectConversationId: (raw: unknown) => string | undefined; - parseFeishuConversationId: (params: { - conversationId: string; - parentConversationId?: string; - }) => { - canonicalConversationId: string; - chatId: string; - topicId?: string; - senderOpenId?: string; - scope: FeishuGroupSessionScope; - } | null; - parseFeishuTargetId: (raw: unknown) => string | undefined; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "feishu", - artifactBasename: "contract-api.js", - }); -} -export const buildFeishuConversationId: FacadeModule["buildFeishuConversationId"] = ((...args) => - loadFacadeModule()["buildFeishuConversationId"]( - ...args, - )) as FacadeModule["buildFeishuConversationId"]; -export const createFeishuThreadBindingManager: FacadeModule["createFeishuThreadBindingManager"] = (( - ...args -) => - loadFacadeModule()["createFeishuThreadBindingManager"]( - ...args, - )) as FacadeModule["createFeishuThreadBindingManager"]; -export const feishuSessionBindingAdapterChannels: FacadeModule["feishuSessionBindingAdapterChannels"] = - createLazyFacadeArrayValue( - () => - loadFacadeModule()["feishuSessionBindingAdapterChannels"] as unknown as readonly unknown[], - ) as FacadeModule["feishuSessionBindingAdapterChannels"]; -export const feishuThreadBindingTesting: FacadeModule["feishuThreadBindingTesting"] = - createLazyFacadeObjectValue( - () => loadFacadeModule()["feishuThreadBindingTesting"] as object, - ) as FacadeModule["feishuThreadBindingTesting"]; -export const parseFeishuDirectConversationId: FacadeModule["parseFeishuDirectConversationId"] = (( - ...args -) => - loadFacadeModule()["parseFeishuDirectConversationId"]( - ...args, - )) as FacadeModule["parseFeishuDirectConversationId"]; -export const parseFeishuConversationId: FacadeModule["parseFeishuConversationId"] = ((...args) => - loadFacadeModule()["parseFeishuConversationId"]( - ...args, - )) as FacadeModule["parseFeishuConversationId"]; -export const parseFeishuTargetId: FacadeModule["parseFeishuTargetId"] = ((...args) => - loadFacadeModule()["parseFeishuTargetId"](...args)) as FacadeModule["parseFeishuTargetId"]; diff --git a/src/plugin-sdk/feishu-setup.ts b/src/plugin-sdk/feishu-setup.ts deleted file mode 100644 index ed088127cb1..00000000000 --- a/src/plugin-sdk/feishu-setup.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { ChannelSetupWizard } from "../channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js"; -import { - createLazyFacadeObjectValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; - -type FacadeModule = { - feishuSetupAdapter: ChannelSetupAdapter; - feishuSetupWizard: ChannelSetupWizard; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "feishu", - artifactBasename: "setup-api.js", - }); -} -export const feishuSetupAdapter: FacadeModule["feishuSetupAdapter"] = createLazyFacadeObjectValue( - () => loadFacadeModule()["feishuSetupAdapter"] as object, -) as FacadeModule["feishuSetupAdapter"]; -export const feishuSetupWizard: FacadeModule["feishuSetupWizard"] = createLazyFacadeObjectValue( - () => loadFacadeModule()["feishuSetupWizard"] as object, -) as FacadeModule["feishuSetupWizard"]; diff --git a/src/plugin-sdk/feishu.ts b/src/plugin-sdk/feishu.ts deleted file mode 100644 index 36fa311f169..00000000000 --- a/src/plugin-sdk/feishu.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Private helper surface for the bundled feishu plugin. -// Keep this list additive and scoped to the bundled Feishu surface. - -export type { HistoryEntry } from "../auto-reply/reply/history.js"; -export { - buildPendingHistoryContextFromMap, - clearHistoryEntriesIfEnabled, - DEFAULT_GROUP_HISTORY_LIMIT, - recordPendingHistoryEntryIfEnabled, -} from "../auto-reply/reply/history.js"; -export type { ReplyPayload } from "./reply-payload.js"; -export { logTypingFailure } from "../channels/logging.js"; -export type { AllowlistMatch } from "../channels/plugins/allowlist-match.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { createActionGate } from "../agents/tools/common.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export { - buildSingleChannelSecretPromptState, - addWildcardAllowFrom, - mergeAllowFromEntries, - promptSingleChannelSecretInput, - setTopLevelChannelAllowFrom, - setTopLevelChannelDmPolicyWithAllowFrom, - setTopLevelChannelGroupPolicy, - splitSetupEntries, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -export type { - BaseProbeResult, - ChannelGroupContext, - ChannelMessageActionName, - ChannelMeta, - ChannelOutboundAdapter, -} from "../channels/plugins/types.public.js"; -export type { - ChannelConfiguredBindingProvider, - ChannelConfiguredBindingConversationRef, - ChannelConfiguredBindingMatch, -} from "../channels/plugins/types.adapters.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createReplyPrefixContext } from "../channels/reply-prefix.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig as ClawdbotConfig, OpenClawConfig } from "../config/config.js"; -export { resolveChannelContextVisibilityMode } from "../config/context-visibility.js"; -export { - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - resolveOpenProviderRuntimeGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export { - evaluateSupplementalContextVisibility, - filterSupplementalContextItems, - shouldIncludeSupplementalContext, - type ContextVisibilityKind, -} from "../security/context-visibility.js"; -export type { DmPolicy, GroupToolPolicyConfig } from "../config/types.js"; -export type { SecretInput } from "./secret-input.js"; -export { - buildSecretInputSchema, - hasConfiguredSecretInput, - normalizeResolvedSecretInputString, - normalizeSecretInputString, -} from "./secret-input.js"; -export { createDedupeCache } from "../infra/dedupe.js"; -export { installRequestBodyLimitGuard, readJsonBodyWithLimit } from "../infra/http-body.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export { resolveAgentOutboundIdentity } from "../infra/outbound/identity.js"; -export type { OutboundIdentity } from "../infra/outbound/identity.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { AnyAgentTool, OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAgentId } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { formatDocsLink } from "../terminal/links.js"; -export { evaluateSenderGroupAccessForPolicy } from "./group-access.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { createClackPrompter } from "../wizard/clack-prompter.js"; -export { feishuSetupWizard, feishuSetupAdapter } from "./feishu-setup.js"; -export { buildAgentMediaPayload } from "./agent-media-payload.js"; -export { readJsonFileWithFallback } from "./json-store.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { createPersistentDedupe } from "./persistent-dedupe.js"; -export { - buildBaseChannelStatusSummary, - buildProbeChannelStatusSummary, - buildRuntimeAccountStatusSnapshot, - createDefaultChannelRuntimeState, -} from "./status-helpers.js"; -export { withTempDownloadPath } from "./temp-path.js"; -export { - buildFeishuConversationId, - createFeishuThreadBindingManager, - parseFeishuDirectConversationId, - parseFeishuConversationId, - parseFeishuTargetId, -} from "./feishu-conversation.js"; -export { - createWebhookAnomalyTracker, - createFixedWindowRateLimiter, - WEBHOOK_ANOMALY_COUNTER_DEFAULTS, - WEBHOOK_RATE_LIMIT_DEFAULTS, -} from "./webhook-ingress.js"; -export { applyBasicWebhookRequestGuards } from "./webhook-ingress.js"; diff --git a/src/plugin-sdk/googlechat-runtime-shared.ts b/src/plugin-sdk/googlechat-runtime-shared.ts deleted file mode 100644 index 93cea9e2f29..00000000000 --- a/src/plugin-sdk/googlechat-runtime-shared.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Narrow Google Chat runtime exports used by the bundled Google Chat plugin. - -export type { GoogleChatAccountConfig, GoogleChatConfig } from "../config/types.js"; -export { GoogleChatConfigSchema } from "../config/zod-schema.providers-core.js"; diff --git a/src/plugin-sdk/googlechat.ts b/src/plugin-sdk/googlechat.ts deleted file mode 100644 index 26a33aa9130..00000000000 --- a/src/plugin-sdk/googlechat.ts +++ /dev/null @@ -1,120 +0,0 @@ -// Private helper surface for the bundled googlechat plugin. -// Keep this list additive and scoped to the bundled Google Chat surface. - -import { resolveChannelGroupRequireMention } from "./channel-policy.js"; -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; - -export { - createActionGate, - jsonResult, - readNumberParam, - readReactionParams, - readStringParam, -} from "../agents/tools/common.js"; -export { - resolveMentionGating, - resolveMentionGatingWithBypass, - resolveInboundMentionDecision, -} from "../channels/mention-gating.js"; -export { getChatChannelMeta } from "../channels/chat-meta.js"; -export { - deleteAccountFromConfigSection, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { - listDirectoryGroupEntriesFromMapKeys, - listDirectoryUserEntriesFromAllowFrom, -} from "../channels/plugins/directory-config-helpers.js"; -export { buildComputedAccountStatusSnapshot } from "./status-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { createAccountStatusSink, runPassiveAccountLifecycle } from "./channel-lifecycle.core.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export { fetchRemoteMedia } from "../media/fetch.js"; -export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js"; -export { loadOutboundMediaFromUrl } from "./outbound-media.js"; -export { loadWebMedia } from "./web-media.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export { - addWildcardAllowFrom, - mergeAllowFromEntries, - splitSetupEntries, - setTopLevelChannelDmPolicyWithAllowFrom, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -export { - applyAccountNameToChannelSection, - applySetupAccountConfigPatch, - migrateBaseNameToDefaultAccount, -} from "../channels/plugins/setup-helpers.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export type { - ChannelAccountSnapshot, - ChannelMessageActionAdapter, - ChannelMessageActionName, - ChannelStatusIssue, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js"; -export { - GROUP_POLICY_BLOCKED_LABEL, - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { DmPolicy, GoogleChatAccountConfig, GoogleChatConfig } from "../config/types.js"; -export { isSecretRef } from "../config/types.secrets.js"; -export { GoogleChatConfigSchema } from "../config/zod-schema.providers-core.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export { missingTargetError } from "../infra/outbound/target-errors.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js"; -export { resolveDmGroupAccessWithLists } from "../security/dm-policy-shared.js"; -export { formatDocsLink } from "../terminal/links.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { resolveInboundRouteEnvelopeBuilderWithRuntime } from "./inbound-envelope.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { - evaluateGroupRouteAccessForPolicy, - resolveSenderScopedGroupPolicy, -} from "./group-access.js"; -export { extractToolSend } from "./tool-send.js"; -export { - beginWebhookRequestPipelineOrReject, - createWebhookInFlightLimiter, - readJsonWebhookBodyOrReject, - registerWebhookTargetWithPluginRoute, - resolveWebhookPath, - resolveWebhookTargetWithAuthOrReject, - resolveWebhookTargets, - type WebhookInFlightLimiter, - withResolvedWebhookRequestPipeline, -} from "./webhook-ingress.js"; - -type GoogleChatGroupContext = { - cfg: import("../config/config.js").OpenClawConfig; - accountId?: string | null; - groupId?: string | null; -}; - -export function resolveGoogleChatGroupRequireMention(params: GoogleChatGroupContext): boolean { - return resolveChannelGroupRequireMention({ - cfg: params.cfg, - channel: "googlechat", - groupId: params.groupId, - accountId: params.accountId, - }); -} - -const googlechatSetup = createOptionalChannelSetupSurface({ - channel: "googlechat", - label: "Google Chat", - npmSpec: "@openclaw/googlechat", - docsPath: "/channels/googlechat", -}); - -export const googlechatSetupAdapter = googlechatSetup.setupAdapter; -export const googlechatSetupWizard = googlechatSetup.setupWizard; diff --git a/src/plugin-sdk/irc-surface.ts b/src/plugin-sdk/irc-surface.ts deleted file mode 100644 index 05878b5b445..00000000000 --- a/src/plugin-sdk/irc-surface.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { ChannelSetupWizard } from "../channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js"; -import type { OpenClawConfig } from "../config/types.js"; -import { - createLazyFacadeObjectValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; - -type IrcAccountConfig = { - name?: string; - enabled?: boolean; - host?: string; - port?: number; - tls?: boolean; - nick?: string; - username?: string; - realname?: string; - password?: string; - passwordFile?: string; - channels?: string[]; - groups?: Record; -}; - -type ResolvedIrcAccount = { - accountId: string; - enabled: boolean; - name?: string; - configured: boolean; - host: string; - port: number; - tls: boolean; - nick: string; - username: string; - realname: string; - password: string; - passwordSource: "env" | "passwordFile" | "config" | "none"; - config: IrcAccountConfig; -}; - -type FacadeModule = { - ircSetupAdapter: ChannelSetupAdapter; - ircSetupWizard: ChannelSetupWizard; - listIrcAccountIds: (cfg: OpenClawConfig) => string[]; - resolveDefaultIrcAccountId: (cfg: OpenClawConfig) => string; - resolveIrcAccount: (params: { - cfg: OpenClawConfig; - accountId?: string | null; - }) => ResolvedIrcAccount; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "irc", - artifactBasename: "api.js", - }); -} -export const ircSetupAdapter: FacadeModule["ircSetupAdapter"] = createLazyFacadeObjectValue( - () => loadFacadeModule()["ircSetupAdapter"] as object, -) as FacadeModule["ircSetupAdapter"]; -export const ircSetupWizard: FacadeModule["ircSetupWizard"] = createLazyFacadeObjectValue( - () => loadFacadeModule()["ircSetupWizard"] as object, -) as FacadeModule["ircSetupWizard"]; -export const listIrcAccountIds: FacadeModule["listIrcAccountIds"] = ((...args) => - loadFacadeModule()["listIrcAccountIds"](...args)) as FacadeModule["listIrcAccountIds"]; -export const resolveDefaultIrcAccountId: FacadeModule["resolveDefaultIrcAccountId"] = ((...args) => - loadFacadeModule()["resolveDefaultIrcAccountId"]( - ...args, - )) as FacadeModule["resolveDefaultIrcAccountId"]; -export const resolveIrcAccount: FacadeModule["resolveIrcAccount"] = ((...args) => - loadFacadeModule()["resolveIrcAccount"](...args)) as FacadeModule["resolveIrcAccount"]; diff --git a/src/plugin-sdk/irc.ts b/src/plugin-sdk/irc.ts deleted file mode 100644 index 9cb2b92328d..00000000000 --- a/src/plugin-sdk/irc.ts +++ /dev/null @@ -1,80 +0,0 @@ -// Private helper surface for the bundled irc plugin. -// Keep this list additive and scoped to the bundled IRC surface. - -export { resolveControlCommandGate } from "../channels/command-gating.js"; -export { logInboundDrop } from "../channels/logging.js"; -export { - deleteAccountFromConfigSection, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { - formatPairingApproveHint, - parseOptionalDelimitedEntries, -} from "../channels/plugins/helpers.js"; -export { - addWildcardAllowFrom, - setTopLevelChannelAllowFrom, - setTopLevelChannelDmPolicyWithAllowFrom, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -export { patchScopedAccountConfig } from "../channels/plugins/setup-helpers.js"; -export type { BaseProbeResult } from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { getChatChannelMeta } from "./channel-plugin-common.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js"; -export { - GROUP_POLICY_BLOCKED_LABEL, - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { - BlockStreamingCoalesceConfig, - DmConfig, - DmPolicy, - GroupPolicy, - GroupToolPolicyBySenderConfig, - GroupToolPolicyConfig, - MarkdownConfig, -} from "../config/types.js"; -export { normalizeResolvedSecretInputString } from "../config/types.secrets.js"; -export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js"; -export { - BlockStreamingCoalesceSchema, - DmConfigSchema, - DmPolicySchema, - GroupPolicySchema, - MarkdownConfigSchema, - ReplyRuntimeConfigSchemaShape, - requireOpenAllowFrom, -} from "../config/zod-schema.core.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { createAccountStatusSink, runPassiveAccountLifecycle } from "./channel-lifecycle.core.js"; -export { listIrcAccountIds, resolveDefaultIrcAccountId, resolveIrcAccount } from "./irc-surface.js"; -export { - readStoreAllowFromForDmPolicy, - resolveEffectiveAllowFromLists, -} from "../security/dm-policy-shared.js"; -export { formatDocsLink } from "../terminal/links.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { dispatchInboundReplyWithBase } from "./inbound-reply-dispatch.js"; -export { ircSetupAdapter, ircSetupWizard } from "./irc-surface.js"; -export type { OutboundReplyPayload } from "./reply-payload.js"; -export { - createNormalizedOutboundDeliverer, - deliverFormattedTextWithAttachments, - formatTextWithAttachmentLinks, - resolveOutboundMediaUrls, -} from "./reply-payload.js"; -export { createLoggerBackedRuntime } from "./runtime.js"; -export { buildBaseAccountStatusSnapshot, buildBaseChannelStatusSummary } from "./status-helpers.js"; diff --git a/src/plugin-sdk/line-core.ts b/src/plugin-sdk/line-core.ts deleted file mode 100644 index c88a122a06d..00000000000 --- a/src/plugin-sdk/line-core.ts +++ /dev/null @@ -1,30 +0,0 @@ -export type { OpenClawConfig } from "../config/config.js"; -export type { LineChannelData, LineConfig } from "./line-surface.js"; -export { - createTopLevelChannelDmPolicy, - DEFAULT_ACCOUNT_ID, - setSetupChannelEnabled, - setTopLevelChannelDmPolicyWithAllowFrom, - splitSetupEntries, -} from "./setup.js"; -export { formatDocsLink } from "../terminal/links.js"; -export type { ChannelSetupAdapter, ChannelSetupDmPolicy, ChannelSetupWizard } from "./setup.js"; -export { - listLineAccountIds, - normalizeAccountId, - resolveDefaultLineAccountId, - resolveLineAccount, -} from "./line-surface.js"; -export { resolveExactLineGroupConfigKey } from "./line-surface.js"; -export type { ResolvedLineAccount } from "./line-surface.js"; -export { LineConfigSchema } from "./line-surface.js"; -export { - createActionCard, - createImageCard, - createInfoCard, - createListCard, - createReceiptCard, - type CardAction, - type ListItem, -} from "./line-surface.js"; -export { processLineMessage } from "./line-surface.js"; diff --git a/src/plugin-sdk/line-runtime.ts b/src/plugin-sdk/line-runtime.ts deleted file mode 100644 index 6768d7a0a02..00000000000 --- a/src/plugin-sdk/line-runtime.ts +++ /dev/null @@ -1,240 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import { loadActivatedBundledPluginPublicSurfaceModuleSync } from "./facade-runtime.js"; -import type { Action } from "./line-surface.js"; -export type { - Action, - CardAction, - LineChannelData, - LineConfig, - LineGroupConfig, - LineProbeResult, - LineThreadBindingsConfig, - ListItem, - ResolvedLineAccount, -} from "./line-surface.js"; - -export type FlexBox = Record; -export type FlexBubble = Record; -export type FlexButton = Record; -export type FlexCarousel = Record; -export type FlexComponent = Record; -export type FlexContainer = Record; -export type FlexImage = Record; -export type FlexText = Record; - -type FacadeFunction = (...args: unknown[]) => unknown; -type FacadeModule = Record< - | "buildTemplateMessageFromPayload" - | "cancelDefaultRichMenu" - | "createActionCard" - | "createAgendaCard" - | "createAppleTvRemoteCard" - | "createCarousel" - | "createDefaultMenuConfig" - | "createDeviceControlCard" - | "createEventCard" - | "createGridLayout" - | "createImageCard" - | "createInfoCard" - | "createListCard" - | "createMediaPlayerCard" - | "createNotificationBubble" - | "createQuickReplyItems" - | "createReceiptCard" - | "createRichMenu" - | "createRichMenuAlias" - | "datetimePickerAction" - | "deleteRichMenu" - | "deleteRichMenuAlias" - | "downloadLineMedia" - | "firstDefined" - | "getDefaultRichMenuId" - | "getRichMenu" - | "getRichMenuIdOfUser" - | "getRichMenuList" - | "hasLineDirectives" - | "isSenderAllowed" - | "linkRichMenuToUser" - | "linkRichMenuToUsers" - | "messageAction" - | "monitorLineProvider" - | "normalizeAllowFrom" - | "normalizeDmAllowFromWithStore" - | "parseLineDirectives" - | "postbackAction" - | "probeLineBot" - | "pushFlexMessage" - | "pushLocationMessage" - | "pushMessageLine" - | "pushMessagesLine" - | "pushTemplateMessage" - | "pushTextMessageWithQuickReplies" - | "sendMessageLine" - | "setDefaultRichMenu" - | "toFlexMessage" - | "unlinkRichMenuFromUser" - | "unlinkRichMenuFromUsers" - | "uploadRichMenuImage" - | "uriAction", - FacadeFunction ->; - -function loadFacadeModule(): FacadeModule { - return loadActivatedBundledPluginPublicSurfaceModuleSync({ - dirName: "line", - artifactBasename: "runtime-api.js", - }); -} -export const buildTemplateMessageFromPayload: FacadeModule["buildTemplateMessageFromPayload"] = (( - ...args -) => - loadFacadeModule()["buildTemplateMessageFromPayload"]( - ...args, - )) as FacadeModule["buildTemplateMessageFromPayload"]; -export const cancelDefaultRichMenu: FacadeModule["cancelDefaultRichMenu"] = ((...args) => - loadFacadeModule()["cancelDefaultRichMenu"](...args)) as FacadeModule["cancelDefaultRichMenu"]; -export const createActionCard: FacadeModule["createActionCard"] = ((...args) => - loadFacadeModule()["createActionCard"](...args)) as FacadeModule["createActionCard"]; -export const createAgendaCard: FacadeModule["createAgendaCard"] = ((...args) => - loadFacadeModule()["createAgendaCard"](...args)) as FacadeModule["createAgendaCard"]; -export const createAppleTvRemoteCard: FacadeModule["createAppleTvRemoteCard"] = ((...args) => - loadFacadeModule()["createAppleTvRemoteCard"]( - ...args, - )) as FacadeModule["createAppleTvRemoteCard"]; -export const createCarousel: FacadeModule["createCarousel"] = ((...args) => - loadFacadeModule()["createCarousel"](...args)) as FacadeModule["createCarousel"]; -export const createDefaultMenuConfig: FacadeModule["createDefaultMenuConfig"] = ((...args) => - loadFacadeModule()["createDefaultMenuConfig"]( - ...args, - )) as FacadeModule["createDefaultMenuConfig"]; -export const createDeviceControlCard: FacadeModule["createDeviceControlCard"] = ((...args) => - loadFacadeModule()["createDeviceControlCard"]( - ...args, - )) as FacadeModule["createDeviceControlCard"]; -export const createEventCard: FacadeModule["createEventCard"] = ((...args) => - loadFacadeModule()["createEventCard"](...args)) as FacadeModule["createEventCard"]; -export const createGridLayout: FacadeModule["createGridLayout"] = ((...args) => - loadFacadeModule()["createGridLayout"](...args)) as FacadeModule["createGridLayout"]; -export const createImageCard: FacadeModule["createImageCard"] = ((...args) => - loadFacadeModule()["createImageCard"](...args)) as FacadeModule["createImageCard"]; -export const createInfoCard: FacadeModule["createInfoCard"] = ((...args) => - loadFacadeModule()["createInfoCard"](...args)) as FacadeModule["createInfoCard"]; -export const createListCard: FacadeModule["createListCard"] = ((...args) => - loadFacadeModule()["createListCard"](...args)) as FacadeModule["createListCard"]; -export const createMediaPlayerCard: FacadeModule["createMediaPlayerCard"] = ((...args) => - loadFacadeModule()["createMediaPlayerCard"](...args)) as FacadeModule["createMediaPlayerCard"]; -export const createNotificationBubble: FacadeModule["createNotificationBubble"] = ((...args) => - loadFacadeModule()["createNotificationBubble"]( - ...args, - )) as FacadeModule["createNotificationBubble"]; -export const createQuickReplyItems: FacadeModule["createQuickReplyItems"] = ((...args) => - loadFacadeModule()["createQuickReplyItems"](...args)) as FacadeModule["createQuickReplyItems"]; -export const createReceiptCard: FacadeModule["createReceiptCard"] = ((...args) => - loadFacadeModule()["createReceiptCard"](...args)) as FacadeModule["createReceiptCard"]; -export const createRichMenu: FacadeModule["createRichMenu"] = ((...args) => - loadFacadeModule()["createRichMenu"](...args)) as FacadeModule["createRichMenu"]; -export const createRichMenuAlias: FacadeModule["createRichMenuAlias"] = ((...args) => - loadFacadeModule()["createRichMenuAlias"](...args)) as FacadeModule["createRichMenuAlias"]; -export const datetimePickerAction: FacadeModule["datetimePickerAction"] = ((...args) => - loadFacadeModule()["datetimePickerAction"](...args)) as FacadeModule["datetimePickerAction"]; -export const deleteRichMenu: FacadeModule["deleteRichMenu"] = ((...args) => - loadFacadeModule()["deleteRichMenu"](...args)) as FacadeModule["deleteRichMenu"]; -export const deleteRichMenuAlias: FacadeModule["deleteRichMenuAlias"] = ((...args) => - loadFacadeModule()["deleteRichMenuAlias"](...args)) as FacadeModule["deleteRichMenuAlias"]; -export const downloadLineMedia: FacadeModule["downloadLineMedia"] = ((...args) => - loadFacadeModule()["downloadLineMedia"](...args)) as FacadeModule["downloadLineMedia"]; -export const firstDefined: FacadeModule["firstDefined"] = ((...args) => - loadFacadeModule()["firstDefined"](...args)) as FacadeModule["firstDefined"]; -export const getDefaultRichMenuId: FacadeModule["getDefaultRichMenuId"] = ((...args) => - loadFacadeModule()["getDefaultRichMenuId"](...args)) as FacadeModule["getDefaultRichMenuId"]; -export const getRichMenu: FacadeModule["getRichMenu"] = ((...args) => - loadFacadeModule()["getRichMenu"](...args)) as FacadeModule["getRichMenu"]; -export const getRichMenuIdOfUser: FacadeModule["getRichMenuIdOfUser"] = ((...args) => - loadFacadeModule()["getRichMenuIdOfUser"](...args)) as FacadeModule["getRichMenuIdOfUser"]; -export const getRichMenuList: FacadeModule["getRichMenuList"] = ((...args) => - loadFacadeModule()["getRichMenuList"](...args)) as FacadeModule["getRichMenuList"]; -export const hasLineDirectives: FacadeModule["hasLineDirectives"] = ((...args) => - loadFacadeModule()["hasLineDirectives"](...args)) as FacadeModule["hasLineDirectives"]; -export const isSenderAllowed: FacadeModule["isSenderAllowed"] = ((...args) => - loadFacadeModule()["isSenderAllowed"](...args)) as FacadeModule["isSenderAllowed"]; -export const linkRichMenuToUser: FacadeModule["linkRichMenuToUser"] = ((...args) => - loadFacadeModule()["linkRichMenuToUser"](...args)) as FacadeModule["linkRichMenuToUser"]; -export const linkRichMenuToUsers: FacadeModule["linkRichMenuToUsers"] = ((...args) => - loadFacadeModule()["linkRichMenuToUsers"](...args)) as FacadeModule["linkRichMenuToUsers"]; -export const messageAction: FacadeModule["messageAction"] = ((...args) => - loadFacadeModule()["messageAction"](...args)) as FacadeModule["messageAction"]; -export const monitorLineProvider: FacadeModule["monitorLineProvider"] = ((...args) => - loadFacadeModule()["monitorLineProvider"](...args)) as FacadeModule["monitorLineProvider"]; -export const normalizeAllowFrom: FacadeModule["normalizeAllowFrom"] = ((...args) => - loadFacadeModule()["normalizeAllowFrom"](...args)) as FacadeModule["normalizeAllowFrom"]; -export const normalizeDmAllowFromWithStore: FacadeModule["normalizeDmAllowFromWithStore"] = (( - ...args -) => - loadFacadeModule()["normalizeDmAllowFromWithStore"]( - ...args, - )) as FacadeModule["normalizeDmAllowFromWithStore"]; -export const parseLineDirectives: FacadeModule["parseLineDirectives"] = ((...args) => - loadFacadeModule()["parseLineDirectives"](...args)) as FacadeModule["parseLineDirectives"]; -export const postbackAction: FacadeModule["postbackAction"] = ((...args) => - loadFacadeModule()["postbackAction"](...args)) as FacadeModule["postbackAction"]; -export const probeLineBot: FacadeModule["probeLineBot"] = ((...args) => - loadFacadeModule()["probeLineBot"](...args)) as FacadeModule["probeLineBot"]; -export const pushFlexMessage: FacadeModule["pushFlexMessage"] = ((...args) => - loadFacadeModule()["pushFlexMessage"](...args)) as FacadeModule["pushFlexMessage"]; -export const pushLocationMessage: FacadeModule["pushLocationMessage"] = ((...args) => - loadFacadeModule()["pushLocationMessage"](...args)) as FacadeModule["pushLocationMessage"]; -export const pushMessageLine: FacadeModule["pushMessageLine"] = ((...args) => - loadFacadeModule()["pushMessageLine"](...args)) as FacadeModule["pushMessageLine"]; -export const pushMessagesLine: FacadeModule["pushMessagesLine"] = ((...args) => - loadFacadeModule()["pushMessagesLine"](...args)) as FacadeModule["pushMessagesLine"]; -export const pushTemplateMessage: FacadeModule["pushTemplateMessage"] = ((...args) => - loadFacadeModule()["pushTemplateMessage"](...args)) as FacadeModule["pushTemplateMessage"]; -export const pushTextMessageWithQuickReplies: FacadeModule["pushTextMessageWithQuickReplies"] = (( - ...args -) => - loadFacadeModule()["pushTextMessageWithQuickReplies"]( - ...args, - )) as FacadeModule["pushTextMessageWithQuickReplies"]; -export const sendMessageLine: FacadeModule["sendMessageLine"] = ((...args) => - loadFacadeModule()["sendMessageLine"](...args)) as FacadeModule["sendMessageLine"]; -export const setDefaultRichMenu: FacadeModule["setDefaultRichMenu"] = ((...args) => - loadFacadeModule()["setDefaultRichMenu"](...args)) as FacadeModule["setDefaultRichMenu"]; -export const toFlexMessage: FacadeModule["toFlexMessage"] = ((...args) => - loadFacadeModule()["toFlexMessage"](...args)) as FacadeModule["toFlexMessage"]; -export const unlinkRichMenuFromUser: FacadeModule["unlinkRichMenuFromUser"] = ((...args) => - loadFacadeModule()["unlinkRichMenuFromUser"](...args)) as FacadeModule["unlinkRichMenuFromUser"]; -export const unlinkRichMenuFromUsers: FacadeModule["unlinkRichMenuFromUsers"] = ((...args) => - loadFacadeModule()["unlinkRichMenuFromUsers"]( - ...args, - )) as FacadeModule["unlinkRichMenuFromUsers"]; -export const uploadRichMenuImage: FacadeModule["uploadRichMenuImage"] = ((...args) => - loadFacadeModule()["uploadRichMenuImage"](...args)) as FacadeModule["uploadRichMenuImage"]; -export const uriAction: FacadeModule["uriAction"] = ((...args) => - loadFacadeModule()["uriAction"](...args)) as FacadeModule["uriAction"]; - -export interface RichMenuSize { - width: 2500; - height: 1686 | 843; -} - -export interface RichMenuAreaRequest { - bounds: { - x: number; - y: number; - width: number; - height: number; - }; - action: Action; -} - -export interface CreateRichMenuParams { - size: RichMenuSize; - selected?: boolean; - name: string; - chatBarText: string; - areas: RichMenuAreaRequest[]; -} - -export type RichMenuArea = RichMenuAreaRequest; -export type RichMenuRequest = Record; -export type RichMenuResponse = Record; diff --git a/src/plugin-sdk/line-surface.ts b/src/plugin-sdk/line-surface.ts deleted file mode 100644 index 8c2bf19347b..00000000000 --- a/src/plugin-sdk/line-surface.ts +++ /dev/null @@ -1,168 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { BaseProbeResult } from "../channels/plugins/types.public.js"; -import { - createLazyFacadeObjectValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; - -type FacadeFunction = (...args: unknown[]) => unknown; -type FacadeModule = Record< - | "createActionCard" - | "createAgendaCard" - | "createAppleTvRemoteCard" - | "createDeviceControlCard" - | "createEventCard" - | "createImageCard" - | "createInfoCard" - | "createListCard" - | "createMediaPlayerCard" - | "createReceiptCard" - | "listLineAccountIds" - | "normalizeAccountId" - | "processLineMessage" - | "resolveDefaultLineAccountId" - | "resolveExactLineGroupConfigKey" - | "resolveLineAccount", - FacadeFunction -> & { - LineConfigSchema: object; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "line", - artifactBasename: "runtime-api.js", - }); -} -export const createActionCard: FacadeModule["createActionCard"] = ((...args) => - loadFacadeModule()["createActionCard"](...args)) as FacadeModule["createActionCard"]; -export const createAgendaCard: FacadeModule["createAgendaCard"] = ((...args) => - loadFacadeModule()["createAgendaCard"](...args)) as FacadeModule["createAgendaCard"]; -export const createAppleTvRemoteCard: FacadeModule["createAppleTvRemoteCard"] = ((...args) => - loadFacadeModule()["createAppleTvRemoteCard"]( - ...args, - )) as FacadeModule["createAppleTvRemoteCard"]; -export const createDeviceControlCard: FacadeModule["createDeviceControlCard"] = ((...args) => - loadFacadeModule()["createDeviceControlCard"]( - ...args, - )) as FacadeModule["createDeviceControlCard"]; -export const createEventCard: FacadeModule["createEventCard"] = ((...args) => - loadFacadeModule()["createEventCard"](...args)) as FacadeModule["createEventCard"]; -export const createImageCard: FacadeModule["createImageCard"] = ((...args) => - loadFacadeModule()["createImageCard"](...args)) as FacadeModule["createImageCard"]; -export const createInfoCard: FacadeModule["createInfoCard"] = ((...args) => - loadFacadeModule()["createInfoCard"](...args)) as FacadeModule["createInfoCard"]; -export const createListCard: FacadeModule["createListCard"] = ((...args) => - loadFacadeModule()["createListCard"](...args)) as FacadeModule["createListCard"]; -export const createMediaPlayerCard: FacadeModule["createMediaPlayerCard"] = ((...args) => - loadFacadeModule()["createMediaPlayerCard"](...args)) as FacadeModule["createMediaPlayerCard"]; -export const createReceiptCard: FacadeModule["createReceiptCard"] = ((...args) => - loadFacadeModule()["createReceiptCard"](...args)) as FacadeModule["createReceiptCard"]; -export const LineConfigSchema: FacadeModule["LineConfigSchema"] = createLazyFacadeObjectValue( - () => loadFacadeModule()["LineConfigSchema"], -); -export const listLineAccountIds: FacadeModule["listLineAccountIds"] = ((...args) => - loadFacadeModule()["listLineAccountIds"](...args)) as FacadeModule["listLineAccountIds"]; -export const normalizeAccountId: FacadeModule["normalizeAccountId"] = ((...args) => - loadFacadeModule()["normalizeAccountId"](...args)) as FacadeModule["normalizeAccountId"]; -export const processLineMessage: FacadeModule["processLineMessage"] = ((...args) => - loadFacadeModule()["processLineMessage"](...args)) as FacadeModule["processLineMessage"]; -export const resolveDefaultLineAccountId: FacadeModule["resolveDefaultLineAccountId"] = (( - ...args -) => - loadFacadeModule()["resolveDefaultLineAccountId"]( - ...args, - )) as FacadeModule["resolveDefaultLineAccountId"]; -export const resolveExactLineGroupConfigKey: FacadeModule["resolveExactLineGroupConfigKey"] = (( - ...args -) => - loadFacadeModule()["resolveExactLineGroupConfigKey"]( - ...args, - )) as FacadeModule["resolveExactLineGroupConfigKey"]; -export const resolveLineAccount: FacadeModule["resolveLineAccount"] = ((...args) => - loadFacadeModule()["resolveLineAccount"](...args)) as FacadeModule["resolveLineAccount"]; -export type Action = Record; - -export interface ListItem { - title: string; - subtitle?: string; - action?: Action; -} - -export interface CardAction { - label: string; - action: Action; -} - -export interface LineThreadBindingsConfig { - enabled?: boolean; - idleHours?: number; - maxAgeHours?: number; - spawnSubagentSessions?: boolean; - spawnAcpSessions?: boolean; -} - -interface LineAccountBaseConfig { - enabled?: boolean; - channelAccessToken?: string; - channelSecret?: string; - tokenFile?: string; - secretFile?: string; - name?: string; - allowFrom?: Array; - groupAllowFrom?: Array; - dmPolicy?: "open" | "allowlist" | "pairing" | "disabled"; - groupPolicy?: "open" | "allowlist" | "disabled"; - responsePrefix?: string; - mediaMaxMb?: number; - webhookPath?: string; - threadBindings?: LineThreadBindingsConfig; - groups?: Record; -} - -export interface LineConfig extends LineAccountBaseConfig { - accounts?: Record; - defaultAccount?: string; -} - -export interface LineGroupConfig { - enabled?: boolean; - allowFrom?: Array; - requireMention?: boolean; - systemPrompt?: string; - skills?: string[]; -} - -export interface ResolvedLineAccount { - accountId: string; - name?: string; - enabled: boolean; - channelAccessToken: string; - channelSecret: string; - tokenSource: "config" | "env" | "file" | "none"; - config: LineConfig & LineAccountBaseConfig; -} - -export type LineProbeResult = BaseProbeResult & { - bot?: { - displayName?: string; - userId?: string; - basicId?: string; - pictureUrl?: string; - }; -}; - -export type LineChannelData = { - quickReplies?: string[]; - location?: { - title: string; - address: string; - latitude: number; - longitude: number; - }; - flexMessage?: { - altText: string; - contents: unknown; - }; - templateMessage?: unknown; -}; diff --git a/src/plugin-sdk/line.ts b/src/plugin-sdk/line.ts deleted file mode 100644 index 092ab17677a..00000000000 --- a/src/plugin-sdk/line.ts +++ /dev/null @@ -1,52 +0,0 @@ -export type { - ChannelAccountSnapshot, - ChannelGatewayContext, - ChannelStatusIssue, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export type { OpenClawConfig } from "../config/config.js"; -export type { ReplyPayload } from "./reply-payload.js"; -export type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js"; -export type { OpenClawPluginApi, PluginRuntime } from "./channel-plugin-common.js"; - -export { - DEFAULT_ACCOUNT_ID, - buildChannelConfigSchema, - emptyPluginConfigSchema, -} from "./channel-plugin-common.js"; -export { clearAccountEntryFields } from "../channels/plugins/config-helpers.js"; - -export { - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, -} from "../config/runtime-group-policy.js"; - -export { - buildComputedAccountStatusSnapshot, - buildTokenChannelStatusSummary, -} from "./status-helpers.js"; - -export { - listLineAccountIds, - normalizeAccountId, - resolveDefaultLineAccountId, - resolveLineAccount, -} from "./line-surface.js"; -export { LineConfigSchema } from "./line-surface.js"; -export type { LineChannelData, LineConfig, ResolvedLineAccount } from "./line-surface.js"; -export type { LineProbeResult } from "./line-surface.js"; -export { - createActionCard, - createAgendaCard, - createAppleTvRemoteCard, - createDeviceControlCard, - createEventCard, - createImageCard, - createInfoCard, - createListCard, - createMediaPlayerCard, - createReceiptCard, - type CardAction, - type ListItem, -} from "./line-surface.js"; -export { processLineMessage } from "./line-surface.js"; diff --git a/src/plugin-sdk/llm-task.ts b/src/plugin-sdk/llm-task.ts deleted file mode 100644 index fc1e9676948..00000000000 --- a/src/plugin-sdk/llm-task.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Narrow plugin-sdk surface for the bundled llm-task plugin. -// Keep this list additive and scoped to the bundled LLM task surface. - -export { definePluginEntry } from "./plugin-entry.js"; -export { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; -export { - formatThinkingLevels, - formatXHighModelHint, - isThinkingLevelSupported, - normalizeThinkLevel, - resolveSupportedThinkingLevel, - supportsXHighThinking, -} from "../auto-reply/thinking.js"; -export type { AnyAgentTool, OpenClawPluginApi } from "../plugins/types.js"; diff --git a/src/plugin-sdk/matrix-helper.ts b/src/plugin-sdk/matrix-helper.ts deleted file mode 100644 index 9c2d8419e1a..00000000000 --- a/src/plugin-sdk/matrix-helper.ts +++ /dev/null @@ -1,101 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { OpenClawConfig } from "../config/config.js"; -import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js"; - -export type MatrixScopedEnvVarNames = { - homeserver: string; - userId: string; - accessToken: string; - password: string; - deviceId: string; - deviceName: string; -}; - -export type MatrixAccountStorageRoot = { - rootDir: string; - accountKey: string; - tokenHash: string; -}; - -export type MatrixLegacyFlatStoragePaths = { - rootDir: string; - storagePath: string; - cryptoPath: string; -}; - -type FacadeModule = { - findMatrixAccountEntry: ( - cfg: OpenClawConfig, - accountId: string, - ) => Record | null; - getMatrixScopedEnvVarNames: (accountId: string) => MatrixScopedEnvVarNames; - requiresExplicitMatrixDefaultAccount: (cfg: OpenClawConfig, env?: NodeJS.ProcessEnv) => boolean; - resolveConfiguredMatrixAccountIds: (cfg: OpenClawConfig, env?: NodeJS.ProcessEnv) => string[]; - resolveMatrixAccountStorageRoot: (params: { - stateDir: string; - homeserver: string; - userId: string; - accessToken: string; - accountId?: string | null; - }) => MatrixAccountStorageRoot; - resolveMatrixChannelConfig: (cfg: OpenClawConfig) => Record | null; - resolveMatrixCredentialsDir: (stateDir: string) => string; - resolveMatrixCredentialsPath: (params: { stateDir: string; accountId?: string | null }) => string; - resolveMatrixDefaultOrOnlyAccountId: (cfg: OpenClawConfig, env?: NodeJS.ProcessEnv) => string; - resolveMatrixLegacyFlatStoragePaths: (stateDir: string) => MatrixLegacyFlatStoragePaths; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "matrix", - artifactBasename: "api.js", - }); -} -export const findMatrixAccountEntry: FacadeModule["findMatrixAccountEntry"] = ((...args) => - loadFacadeModule()["findMatrixAccountEntry"](...args)) as FacadeModule["findMatrixAccountEntry"]; -export const getMatrixScopedEnvVarNames: FacadeModule["getMatrixScopedEnvVarNames"] = ((...args) => - loadFacadeModule()["getMatrixScopedEnvVarNames"]( - ...args, - )) as FacadeModule["getMatrixScopedEnvVarNames"]; -export const requiresExplicitMatrixDefaultAccount: FacadeModule["requiresExplicitMatrixDefaultAccount"] = - ((...args) => - loadFacadeModule()["requiresExplicitMatrixDefaultAccount"]( - ...args, - )) as FacadeModule["requiresExplicitMatrixDefaultAccount"]; -export const resolveConfiguredMatrixAccountIds: FacadeModule["resolveConfiguredMatrixAccountIds"] = - ((...args) => - loadFacadeModule()["resolveConfiguredMatrixAccountIds"]( - ...args, - )) as FacadeModule["resolveConfiguredMatrixAccountIds"]; -export const resolveMatrixAccountStorageRoot: FacadeModule["resolveMatrixAccountStorageRoot"] = (( - ...args -) => - loadFacadeModule()["resolveMatrixAccountStorageRoot"]( - ...args, - )) as FacadeModule["resolveMatrixAccountStorageRoot"]; -export const resolveMatrixChannelConfig: FacadeModule["resolveMatrixChannelConfig"] = ((...args) => - loadFacadeModule()["resolveMatrixChannelConfig"]( - ...args, - )) as FacadeModule["resolveMatrixChannelConfig"]; -export const resolveMatrixCredentialsDir: FacadeModule["resolveMatrixCredentialsDir"] = (( - ...args -) => - loadFacadeModule()["resolveMatrixCredentialsDir"]( - ...args, - )) as FacadeModule["resolveMatrixCredentialsDir"]; -export const resolveMatrixCredentialsPath: FacadeModule["resolveMatrixCredentialsPath"] = (( - ...args -) => - loadFacadeModule()["resolveMatrixCredentialsPath"]( - ...args, - )) as FacadeModule["resolveMatrixCredentialsPath"]; -export const resolveMatrixDefaultOrOnlyAccountId: FacadeModule["resolveMatrixDefaultOrOnlyAccountId"] = - ((...args) => - loadFacadeModule()["resolveMatrixDefaultOrOnlyAccountId"]( - ...args, - )) as FacadeModule["resolveMatrixDefaultOrOnlyAccountId"]; -export const resolveMatrixLegacyFlatStoragePaths: FacadeModule["resolveMatrixLegacyFlatStoragePaths"] = - ((...args) => - loadFacadeModule()["resolveMatrixLegacyFlatStoragePaths"]( - ...args, - )) as FacadeModule["resolveMatrixLegacyFlatStoragePaths"]; diff --git a/src/plugin-sdk/matrix-runtime-heavy.ts b/src/plugin-sdk/matrix-runtime-heavy.ts deleted file mode 100644 index e353cbe9af4..00000000000 --- a/src/plugin-sdk/matrix-runtime-heavy.ts +++ /dev/null @@ -1,128 +0,0 @@ -import type { OpenClawConfig } from "./config-runtime.js"; -import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js"; - -type MatrixLegacyLog = { - info?: (message: string) => void; - warn?: (message: string) => void; -}; - -type MatrixLegacyCryptoPlan = { - accountId: string; - rootDir: string; - recoveryKeyPath: string; - statePath: string; - legacyCryptoPath: string; - homeserver: string; - userId: string; - accessToken: string; - deviceId: string | null; -}; - -type MatrixLegacyCryptoDetection = { - inspectorAvailable: boolean; - plans: MatrixLegacyCryptoPlan[]; - warnings: string[]; -}; - -type MatrixLegacyMigrationResult = { - migrated: boolean; - changes: string[]; - warnings: string[]; -}; - -type MatrixLegacyStatePlan = { - accountId: string; - legacyStoragePath: string; - legacyCryptoPath: string; - targetRootDir: string; - targetStoragePath: string; - targetCryptoPath: string; - selectionNote?: string; -}; - -type MatrixLegacyStateDetection = MatrixLegacyStatePlan | { warning: string } | null; - -type MatrixMigrationSnapshotResult = { - created: boolean; - archivePath: string; - markerPath: string; -}; - -type MatrixRuntimeHeavyModule = { - autoPrepareLegacyMatrixCrypto: (params: { - cfg: OpenClawConfig; - env?: NodeJS.ProcessEnv; - log?: MatrixLegacyLog; - deps?: Partial>; - }) => Promise; - detectLegacyMatrixCrypto: (params: { - cfg: OpenClawConfig; - env?: NodeJS.ProcessEnv; - }) => MatrixLegacyCryptoDetection; - autoMigrateLegacyMatrixState: (params: { - cfg: OpenClawConfig; - env?: NodeJS.ProcessEnv; - log?: MatrixLegacyLog; - }) => Promise; - detectLegacyMatrixState: (params: { - cfg: OpenClawConfig; - env?: NodeJS.ProcessEnv; - }) => MatrixLegacyStateDetection; - hasActionableMatrixMigration: (params: { - cfg: OpenClawConfig; - env?: NodeJS.ProcessEnv; - }) => boolean; - hasPendingMatrixMigration: (params: { cfg: OpenClawConfig; env?: NodeJS.ProcessEnv }) => boolean; - maybeCreateMatrixMigrationSnapshot: (params: { - trigger: string; - env?: NodeJS.ProcessEnv; - outputDir?: string; - log?: MatrixLegacyLog; - }) => Promise; -}; - -function loadFacadeModule(): MatrixRuntimeHeavyModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "matrix", - artifactBasename: "runtime-heavy-api.js", - }); -} - -export const autoPrepareLegacyMatrixCrypto: MatrixRuntimeHeavyModule["autoPrepareLegacyMatrixCrypto"] = - ((...args) => - loadFacadeModule().autoPrepareLegacyMatrixCrypto( - ...args, - )) as MatrixRuntimeHeavyModule["autoPrepareLegacyMatrixCrypto"]; -export const detectLegacyMatrixCrypto: MatrixRuntimeHeavyModule["detectLegacyMatrixCrypto"] = (( - ...args -) => - loadFacadeModule().detectLegacyMatrixCrypto( - ...args, - )) as MatrixRuntimeHeavyModule["detectLegacyMatrixCrypto"]; -export const autoMigrateLegacyMatrixState: MatrixRuntimeHeavyModule["autoMigrateLegacyMatrixState"] = - ((...args) => - loadFacadeModule().autoMigrateLegacyMatrixState( - ...args, - )) as MatrixRuntimeHeavyModule["autoMigrateLegacyMatrixState"]; -export const detectLegacyMatrixState: MatrixRuntimeHeavyModule["detectLegacyMatrixState"] = (( - ...args -) => - loadFacadeModule().detectLegacyMatrixState( - ...args, - )) as MatrixRuntimeHeavyModule["detectLegacyMatrixState"]; -export const hasActionableMatrixMigration: MatrixRuntimeHeavyModule["hasActionableMatrixMigration"] = - ((...args) => - loadFacadeModule().hasActionableMatrixMigration( - ...args, - )) as MatrixRuntimeHeavyModule["hasActionableMatrixMigration"]; -export const hasPendingMatrixMigration: MatrixRuntimeHeavyModule["hasPendingMatrixMigration"] = (( - ...args -) => - loadFacadeModule().hasPendingMatrixMigration( - ...args, - )) as MatrixRuntimeHeavyModule["hasPendingMatrixMigration"]; -export const maybeCreateMatrixMigrationSnapshot: MatrixRuntimeHeavyModule["maybeCreateMatrixMigrationSnapshot"] = - ((...args) => - loadFacadeModule().maybeCreateMatrixMigrationSnapshot( - ...args, - )) as MatrixRuntimeHeavyModule["maybeCreateMatrixMigrationSnapshot"]; diff --git a/src/plugin-sdk/matrix-runtime-surface.ts b/src/plugin-sdk/matrix-runtime-surface.ts deleted file mode 100644 index be75a2956a8..00000000000 --- a/src/plugin-sdk/matrix-runtime-surface.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { PluginRuntime } from "../plugins/runtime/types.js"; -import { loadActivatedBundledPluginPublicSurfaceModuleSync } from "./facade-runtime.js"; - -export type MatrixResolvedStringField = - | "homeserver" - | "userId" - | "accessToken" - | "password" - | "deviceId" - | "deviceName"; - -export type MatrixResolvedStringValues = Record; - -type MatrixStringSourceMap = Partial>; - -type FacadeModule = { - resolveMatrixAccountStringValues: (params: { - accountId: string; - account?: MatrixStringSourceMap; - scopedEnv?: MatrixStringSourceMap; - channel?: MatrixStringSourceMap; - globalEnv?: MatrixStringSourceMap; - }) => MatrixResolvedStringValues; - setMatrixRuntime: (runtime: PluginRuntime) => void; -}; - -function loadFacadeModule(): FacadeModule { - return loadActivatedBundledPluginPublicSurfaceModuleSync({ - dirName: "matrix", - artifactBasename: "runtime-api.js", - }); -} -export const resolveMatrixAccountStringValues: FacadeModule["resolveMatrixAccountStringValues"] = (( - ...args -) => - loadFacadeModule()["resolveMatrixAccountStringValues"]( - ...args, - )) as FacadeModule["resolveMatrixAccountStringValues"]; -export const setMatrixRuntime: FacadeModule["setMatrixRuntime"] = ((...args) => - loadFacadeModule()["setMatrixRuntime"](...args)) as FacadeModule["setMatrixRuntime"]; diff --git a/src/plugin-sdk/matrix-surface.ts b/src/plugin-sdk/matrix-surface.ts deleted file mode 100644 index aac8a6266ab..00000000000 --- a/src/plugin-sdk/matrix-surface.ts +++ /dev/null @@ -1,127 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { - BindingTargetKind, - SessionBindingRecord, -} from "../infra/outbound/session-binding-service.js"; -import { - createLazyFacadeArrayValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; - -export type MatrixFacadeAuth = { - accountId: string; - homeserver: string; - userId: string; - accessToken: string; - password?: string; - deviceId?: string; - deviceName?: string; - initialSyncLimit?: number; - encryption?: boolean; - allowPrivateNetwork?: boolean; - ssrfPolicy?: unknown; - dispatcherPolicy?: unknown; -}; - -export type MatrixThreadBindingTargetKind = "subagent" | "acp"; - -export type MatrixThreadBindingRecord = { - accountId: string; - conversationId: string; - parentConversationId?: string; - targetKind: MatrixThreadBindingTargetKind; - targetSessionKey: string; - agentId?: string; - label?: string; - boundBy?: string; - boundAt: number; - lastActivityAt: number; - idleTimeoutMs?: number; - maxAgeMs?: number; -}; - -export type MatrixThreadBindingManager = { - accountId: string; - getIdleTimeoutMs: () => number; - getMaxAgeMs: () => number; - getByConversation: (params: { - conversationId: string; - parentConversationId?: string; - }) => MatrixThreadBindingRecord | undefined; - listBySessionKey: (targetSessionKey: string) => MatrixThreadBindingRecord[]; - listBindings: () => MatrixThreadBindingRecord[]; - touchBinding: (bindingId: string, at?: number) => MatrixThreadBindingRecord | null; - setIdleTimeoutBySessionKey: (params: { - targetSessionKey: string; - idleTimeoutMs: number; - }) => MatrixThreadBindingRecord[]; - setMaxAgeBySessionKey: (params: { - targetSessionKey: string; - maxAgeMs: number; - }) => MatrixThreadBindingRecord[]; - persist: () => Promise; - stop: () => void; -}; - -type MatrixThreadBindingManagerFactory = (params: { - accountId: string; - auth: MatrixFacadeAuth; - client: unknown; - env?: NodeJS.ProcessEnv; - stateDir?: string; - idleTimeoutMs: number; - maxAgeMs: number; - enableSweeper?: boolean; - logVerboseMessage?: (message: string) => void; -}) => Promise; - -type FacadeModule = { - createMatrixThreadBindingManager: MatrixThreadBindingManagerFactory; - matrixSessionBindingAdapterChannels: readonly ["matrix"]; - resetMatrixThreadBindingsForTests: () => void; -}; - -export type MatrixSessionBindingTimeoutParams = { - accountId: string; - targetSessionKey: string; - idleTimeoutMs: number; -}; - -export type MatrixSessionBindingMaxAgeParams = { - accountId: string; - targetSessionKey: string; - maxAgeMs: number; -}; - -export type MatrixSessionBindingTimeoutSetter = ( - params: MatrixSessionBindingTimeoutParams, -) => SessionBindingRecord[]; - -export type MatrixSessionBindingMaxAgeSetter = ( - params: MatrixSessionBindingMaxAgeParams, -) => SessionBindingRecord[]; - -export type MatrixSessionBindingTargetKind = BindingTargetKind; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "matrix", - artifactBasename: "api.js", - }); -} -export const createMatrixThreadBindingManager: FacadeModule["createMatrixThreadBindingManager"] = (( - ...args -) => - loadFacadeModule()["createMatrixThreadBindingManager"]( - ...args, - )) as FacadeModule["createMatrixThreadBindingManager"]; -export const matrixSessionBindingAdapterChannels: FacadeModule["matrixSessionBindingAdapterChannels"] = - createLazyFacadeArrayValue( - () => - loadFacadeModule()["matrixSessionBindingAdapterChannels"] as unknown as readonly unknown[], - ) as FacadeModule["matrixSessionBindingAdapterChannels"]; -export const resetMatrixThreadBindingsForTests: FacadeModule["resetMatrixThreadBindingsForTests"] = - ((...args) => - loadFacadeModule()["resetMatrixThreadBindingsForTests"]( - ...args, - )) as FacadeModule["resetMatrixThreadBindingsForTests"]; diff --git a/src/plugin-sdk/matrix-thread-bindings.ts b/src/plugin-sdk/matrix-thread-bindings.ts deleted file mode 100644 index 1c0ec479bca..00000000000 --- a/src/plugin-sdk/matrix-thread-bindings.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -import type { SessionBindingRecord } from "../infra/outbound/session-binding-service.js"; -import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js"; - -type FacadeModule = { - setMatrixThreadBindingIdleTimeoutBySessionKey: (params: { - accountId: string; - targetSessionKey: string; - idleTimeoutMs: number; - }) => SessionBindingRecord[]; - setMatrixThreadBindingMaxAgeBySessionKey: (params: { - accountId: string; - targetSessionKey: string; - maxAgeMs: number; - }) => SessionBindingRecord[]; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "matrix", - artifactBasename: "api.js", - }); -} -export const setMatrixThreadBindingIdleTimeoutBySessionKey: FacadeModule["setMatrixThreadBindingIdleTimeoutBySessionKey"] = - ((...args) => - loadFacadeModule()["setMatrixThreadBindingIdleTimeoutBySessionKey"]( - ...args, - )) as FacadeModule["setMatrixThreadBindingIdleTimeoutBySessionKey"]; -export const setMatrixThreadBindingMaxAgeBySessionKey: FacadeModule["setMatrixThreadBindingMaxAgeBySessionKey"] = - ((...args) => - loadFacadeModule()["setMatrixThreadBindingMaxAgeBySessionKey"]( - ...args, - )) as FacadeModule["setMatrixThreadBindingMaxAgeBySessionKey"]; diff --git a/src/plugin-sdk/matrix.ts b/src/plugin-sdk/matrix.ts deleted file mode 100644 index 8677d811253..00000000000 --- a/src/plugin-sdk/matrix.ts +++ /dev/null @@ -1,220 +0,0 @@ -// Private helper surface for the bundled matrix plugin. -// Keep this list additive and scoped to the bundled Matrix surface. - -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; -import { - createLazyFacadeArrayValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; - -type MatrixFacadeModule = { - singleAccountKeysToMove: readonly string[]; - namedAccountPromotionKeys: readonly string[]; - resolveSingleAccountPromotionTarget: (params: { channel: Record }) => string; -}; - -function loadMatrixFacadeModule(): MatrixFacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "matrix", - artifactBasename: "contract-api.js", - }); -} - -export { - createActionGate, - jsonResult, - readNumberParam, - readReactionParams, - readStringArrayParam, - readStringParam, -} from "../agents/tools/common.js"; -export type { BlockReplyContext } from "../auto-reply/get-reply-options.types.js"; -export type { ReplyPayload } from "./reply-payload.js"; -export { resolveAckReaction } from "../agents/identity.js"; -export { - compileAllowlist, - resolveCompiledAllowlistMatch, - resolveAllowlistCandidates, - resolveAllowlistMatchByCandidates, -} from "../channels/allowlist-match.js"; -export { - addAllowlistUserEntriesFromConfigEntry, - buildAllowlistResolutionSummary, - canonicalizeAllowlistWithResolvedIds, - mergeAllowlist, - patchAllowlistUsersInConfigEntries, - summarizeMapping, -} from "../channels/allowlists/resolve-utils.js"; -export { resolveControlCommandGate } from "../channels/command-gating.js"; -export type { NormalizedLocation } from "../channels/location.js"; -export { formatLocationText, toLocationContext } from "../channels/location.js"; -export { logInboundDrop, logTypingFailure } from "../channels/logging.js"; -export type { AllowlistMatch } from "../channels/plugins/allowlist-match.js"; -export { formatAllowlistMatchMeta } from "../channels/plugins/allowlist-match.js"; -export { - buildChannelKeyCandidates, - resolveChannelEntryMatch, -} from "../channels/plugins/channel-config.js"; -export { getChatChannelMeta } from "./channel-plugin-common.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export { - deleteAccountFromConfigSection, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export { - buildSingleChannelSecretPromptState, - addWildcardAllowFrom, - mergeAllowFromEntries, - promptAccountId, - promptSingleChannelSecretInput, - setTopLevelChannelGroupPolicy, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { promptChannelAccessConfig } from "../channels/plugins/setup-group-access.js"; -export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -export { - applyAccountNameToChannelSection, - moveSingleAccountChannelSectionToDefaultAccount, -} from "../channels/plugins/setup-helpers.js"; -export type { - BaseProbeResult, - ChannelDirectoryEntry, - ChannelGroupContext, - ChannelMessageActionAdapter, - ChannelMessageActionContext, - ChannelMessageActionName, - ChannelMessageToolDiscovery, - ChannelMessageToolSchemaContribution, - ChannelOutboundAdapter, - ChannelResolveKind, - ChannelResolveResult, - ChannelSetupInput, - ChannelToolSend, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createReplyPrefixOptions } from "../channels/reply-prefix.js"; -export { resolveThreadBindingFarewellText } from "../channels/thread-bindings-messages.js"; -export { - resolveThreadBindingIdleTimeoutMsForChannel, - resolveThreadBindingMaxAgeMsForChannel, -} from "../channels/thread-bindings-policy.js"; -export { - setMatrixThreadBindingIdleTimeoutBySessionKey, - setMatrixThreadBindingMaxAgeBySessionKey, -} from "./matrix-thread-bindings.js"; -export { createTypingCallbacks } from "../channels/typing.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export { loadOutboundMediaFromUrl } from "./outbound-media.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { - GROUP_POLICY_BLOCKED_LABEL, - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { - ContextVisibilityMode, - DmPolicy, - GroupPolicy, - GroupToolPolicyConfig, - MarkdownTableMode, -} from "../config/types.js"; -export type { SecretInput } from "./secret-input.js"; -export { - buildSecretInputSchema, - hasConfiguredSecretInput, - normalizeResolvedSecretInputString, - normalizeSecretInputString, -} from "./secret-input.js"; -export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js"; -export { MarkdownConfigSchema } from "../config/zod-schema.core.js"; -export { formatZonedTimestamp } from "../infra/format-time/format-datetime.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export { - getSessionBindingService, - registerSessionBindingAdapter, - unregisterSessionBindingAdapter, -} from "../infra/outbound/session-binding-service.js"; -export { resolveOutboundSendDep } from "../infra/outbound/send-deps.js"; -export type { - BindingTargetKind, - SessionBindingRecord, -} from "../infra/outbound/session-binding-service.js"; -export { isPrivateOrLoopbackHost } from "../gateway/net.js"; -export { getAgentScopedMediaLocalRoots } from "../media/local-roots.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime, RuntimeLogger } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export type { PollInput } from "../polls.js"; -export { normalizePollInput } from "../polls.js"; -export { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, - resolveAgentIdFromSessionKey, -} from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { normalizeStringEntries } from "../shared/string-normalization.js"; -export { formatDocsLink } from "../terminal/links.js"; -export { redactSensitiveText } from "../logging/redact.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { - evaluateGroupRouteAccessForPolicy, - resolveSenderScopedGroupPolicy, -} from "./group-access.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { readJsonFileWithFallback, writeJsonFileAtomically } from "./json-store.js"; -export { formatResolvedUnresolvedNote } from "./resolution-notes.js"; -export { runPluginCommandWithTimeout } from "./run-command.js"; -export { createLoggerBackedRuntime, resolveRuntimeEnv } from "./runtime.js"; -export { - buildComputedAccountStatusSnapshot, - buildProbeChannelStatusSummary, - collectStatusIssuesFromLastError, -} from "./status-helpers.js"; -export { - findMatrixAccountEntry, - resolveConfiguredMatrixAccountIds, - resolveMatrixChannelConfig, -} from "./matrix-helper.js"; -export { - resolveMatrixAccountStorageRoot, - resolveMatrixCredentialsDir, - resolveMatrixCredentialsPath, - resolveMatrixLegacyFlatStoragePaths, -} from "./matrix-helper.js"; -export { resolveMatrixAccountStringValues } from "./matrix-runtime-surface.js"; -export { getMatrixScopedEnvVarNames } from "./matrix-helper.js"; -export { - requiresExplicitMatrixDefaultAccount, - resolveMatrixDefaultOrOnlyAccountId, -} from "./matrix-helper.js"; -export { - createMatrixThreadBindingManager, - resetMatrixThreadBindingsForTests, -} from "./matrix-surface.js"; -export { setMatrixRuntime } from "./matrix-runtime-surface.js"; - -export const singleAccountKeysToMove: MatrixFacadeModule["singleAccountKeysToMove"] = - createLazyFacadeArrayValue(() => loadMatrixFacadeModule().singleAccountKeysToMove); - -export const namedAccountPromotionKeys: MatrixFacadeModule["namedAccountPromotionKeys"] = - createLazyFacadeArrayValue(() => loadMatrixFacadeModule().namedAccountPromotionKeys); - -export const resolveSingleAccountPromotionTarget: MatrixFacadeModule["resolveSingleAccountPromotionTarget"] = - ((...args) => - loadMatrixFacadeModule().resolveSingleAccountPromotionTarget( - ...args, - )) as MatrixFacadeModule["resolveSingleAccountPromotionTarget"]; - -const matrixSetup = createOptionalChannelSetupSurface({ - channel: "matrix", - label: "Matrix", - npmSpec: "@openclaw/matrix", - docsPath: "/channels/matrix", -}); - -export const matrixSetupWizard = matrixSetup.setupWizard; -export const matrixSetupAdapter = matrixSetup.setupAdapter; diff --git a/src/plugin-sdk/mattermost-policy.ts b/src/plugin-sdk/mattermost-policy.ts deleted file mode 100644 index 89e5eb9d46c..00000000000 --- a/src/plugin-sdk/mattermost-policy.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Manual facade. Keep loader boundary explicit. -type MattermostSenderAllowed = (params: { - senderId: string; - senderName?: string; - allowFrom: string[]; - allowNameMatching?: boolean; -}) => boolean; -type FacadeModule = { - isMattermostSenderAllowed: MattermostSenderAllowed; -}; -import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js"; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "mattermost", - artifactBasename: "policy-api.js", - }); -} -export const isMattermostSenderAllowed: FacadeModule["isMattermostSenderAllowed"] = ((...args) => - loadFacadeModule()["isMattermostSenderAllowed"]( - ...args, - )) as FacadeModule["isMattermostSenderAllowed"]; diff --git a/src/plugin-sdk/mattermost.ts b/src/plugin-sdk/mattermost.ts deleted file mode 100644 index 8b0f35c4e84..00000000000 --- a/src/plugin-sdk/mattermost.ts +++ /dev/null @@ -1,98 +0,0 @@ -// Private helper surface for the bundled mattermost plugin. -// Keep this list additive and scoped to the bundled Mattermost surface. - -export { formatInboundFromLabel } from "../auto-reply/envelope.js"; -export type { HistoryEntry } from "../auto-reply/reply/history.js"; -export { - buildPendingHistoryContextFromMap, - clearHistoryEntriesIfEnabled, - DEFAULT_GROUP_HISTORY_LIMIT, - recordPendingHistoryEntryIfEnabled, -} from "../auto-reply/reply/history.js"; -export { listSkillCommandsForAgents } from "../auto-reply/skill-commands.js"; -export type { ReplyPayload } from "./reply-payload.js"; -export type { ChatType } from "../channels/chat-type.js"; -export { resolveControlCommandGate } from "../channels/command-gating.js"; -export { logInboundDrop, logTypingFailure } from "../channels/logging.js"; -export { resolveAllowlistMatchSimple } from "../channels/plugins/allowlist-match.js"; -export { normalizeProviderId } from "../agents/model-selection.js"; -export { - buildModelsProviderData, - type ModelsProviderData, -} from "../auto-reply/reply/commands-models.js"; -export { resolveStoredModelOverride } from "../auto-reply/reply/stored-model-override.js"; -export { - deleteAccountFromConfigSection, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js"; -export { - buildSingleChannelSecretPromptState, - promptSingleChannelSecretInput, - runSingleChannelSecretStep, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { - applyAccountNameToChannelSection, - applySetupAccountConfigPatch, - createSetupInputPresenceValidator, - migrateBaseNameToDefaultAccount, -} from "../channels/plugins/setup-helpers.js"; -export { createAccountStatusSink } from "./channel-lifecycle.core.js"; -export { buildComputedAccountStatusSnapshot } from "./status-helpers.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export type { - BaseProbeResult, - ChannelAccountSnapshot, - ChannelGroupContext, - ChannelMessageActionAdapter, - ChannelMessageActionName, -} from "../channels/plugins/types.public.js"; -export type { ChannelDirectoryEntry } from "../channels/plugins/types.core.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js"; -export { loadSessionStore, resolveStorePath } from "../config/sessions.js"; -export { - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { BlockStreamingCoalesceConfig, DmPolicy, GroupPolicy } from "../config/types.js"; -export { - BlockStreamingCoalesceSchema, - DmPolicySchema, - GroupPolicySchema, - MarkdownConfigSchema, - requireOpenAllowFrom, -} from "../config/zod-schema.core.js"; -export { createDedupeCache } from "../infra/dedupe.js"; -export { parseStrictPositiveInteger } from "../infra/parse-finite-number.js"; -export { rawDataToString } from "../infra/ws.js"; -export { isLoopbackHost, isTrustedProxyAddress, resolveClientIp } from "../gateway/net.js"; -export { registerPluginHttpRoute } from "../plugins/http-registry.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - resolveThreadSessionKeys, -} from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { - DM_GROUP_ACCESS_REASON, - readStoreAllowFromForDmPolicy, - resolveDmGroupAccessWithLists, - resolveEffectiveAllowFromLists, -} from "../security/dm-policy-shared.js"; -export { evaluateSenderGroupAccessForPolicy } from "./group-access.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { buildAgentMediaPayload } from "./agent-media-payload.js"; -export { getAgentScopedMediaLocalRoots } from "../media/local-roots.js"; -export { loadOutboundMediaFromUrl } from "./outbound-media.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { isRequestBodyLimitError, readRequestBodyWithLimit } from "../infra/http-body.js"; diff --git a/src/plugin-sdk/memory-lancedb.ts b/src/plugin-sdk/memory-lancedb.ts deleted file mode 100644 index c2617b42da5..00000000000 --- a/src/plugin-sdk/memory-lancedb.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Narrow plugin-sdk surface for the bundled memory-lancedb plugin. -// Keep this list additive and scoped to the bundled memory-lancedb surface. - -export { definePluginEntry } from "./plugin-entry.js"; -export { resolveStateDir } from "./state-paths.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; diff --git a/src/plugin-sdk/msteams.ts b/src/plugin-sdk/msteams.ts deleted file mode 100644 index 835e53571c8..00000000000 --- a/src/plugin-sdk/msteams.ts +++ /dev/null @@ -1,141 +0,0 @@ -// Private helper surface for the bundled msteams plugin. -// Keep this list additive and scoped to the bundled Teams surface. - -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; - -export type { ChunkMode } from "../auto-reply/chunk.js"; -export type { HistoryEntry } from "../auto-reply/reply/history.js"; -export { - buildPendingHistoryContextFromMap, - clearHistoryEntriesIfEnabled, - DEFAULT_GROUP_HISTORY_LIMIT, - recordPendingHistoryEntryIfEnabled, -} from "../auto-reply/reply/history.js"; -export { isSilentReplyText, SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js"; -export type { ReplyPayload } from "./reply-payload.js"; -export { mergeAllowlist, summarizeMapping } from "../channels/allowlists/resolve-utils.js"; -export { - resolveControlCommandGate, - resolveDualTextControlCommandGate, -} from "../channels/command-gating.js"; -export { logInboundDrop, logTypingFailure } from "../channels/logging.js"; -export { - resolveInboundMentionDecision, - resolveMentionGating, - resolveMentionGatingWithBypass, -} from "../channels/mention-gating.js"; -export type { AllowlistMatch } from "../channels/plugins/allowlist-match.js"; -export { - formatAllowlistMatchMeta, - resolveAllowlistMatchSimple, -} from "../channels/plugins/allowlist-match.js"; -export { - buildChannelKeyCandidates, - normalizeChannelSlug, - resolveChannelEntryMatchWithFallback, - resolveNestedAllowlistDecision, -} from "../channels/plugins/channel-config.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js"; -export { buildMediaPayload } from "../channels/plugins/media-payload.js"; -export { - addWildcardAllowFrom, - mergeAllowFromEntries, - setTopLevelChannelAllowFrom, - setTopLevelChannelDmPolicyWithAllowFrom, - setTopLevelChannelGroupPolicy, - splitSetupEntries, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -export { resolveOutboundMediaUrls, resolveSendableOutboundReplyParts } from "./reply-payload.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export type { - BaseProbeResult, - ChannelDirectoryEntry, - ChannelGroupContext, - ChannelMessageActionName, - ChannelOutboundAdapter, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js"; -export { resolveChannelContextVisibilityMode } from "../config/context-visibility.js"; -export { resolveToolsBySender } from "../config/group-policy.js"; -export { - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, -} from "../config/runtime-group-policy.js"; -export type { - DmPolicy, - GroupPolicy, - GroupToolPolicyConfig, - MarkdownTableMode, - MSTeamsChannelConfig, - MSTeamsConfig, - MSTeamsReplyStyle, - MSTeamsTeamConfig, -} from "../config/types.js"; -export { - hasConfiguredSecretInput, - normalizeResolvedSecretInputString, - normalizeSecretInputString, -} from "../config/types.secrets.js"; -export { MSTeamsConfigSchema } from "../config/zod-schema.providers-core.js"; -export { DEFAULT_WEBHOOK_MAX_BODY_BYTES } from "../infra/http-body.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export type { SsrFPolicy } from "../infra/net/ssrf.js"; -export { isPrivateIpAddress } from "../infra/net/ssrf.js"; -export { detectMime, extensionForMime, getFileExtension } from "../media/mime.js"; -export { extractOriginalFilename } from "../media/store.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { - readStoreAllowFromForDmPolicy, - resolveDmGroupAccessWithLists, - resolveEffectiveAllowFromLists, -} from "../security/dm-policy-shared.js"; -export { - evaluateSenderGroupAccessForPolicy, - resolveSenderScopedGroupPolicy, -} from "./group-access.js"; -export { - filterSupplementalContextItems, - shouldIncludeSupplementalContext, -} from "../security/context-visibility.js"; -export { formatDocsLink } from "../terminal/links.js"; -export { sleep } from "../utils.js"; -export { loadWebMedia } from "./web-media.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { keepHttpServerTaskAlive } from "./channel-lifecycle.core.js"; -export { withFileLock } from "./file-lock.js"; -export { dispatchReplyFromConfigWithSettledDispatcher } from "./inbound-reply-dispatch.js"; -export { readJsonFileWithFallback, writeJsonFileAtomically } from "./json-store.js"; -export { loadOutboundMediaFromUrl } from "./outbound-media.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { resolveInboundSessionEnvelopeContext } from "../channels/session-envelope.js"; -export { - buildHostnameAllowlistPolicyFromSuffixAllowlist, - isHttpsUrlAllowedByHostnameSuffixAllowlist, - normalizeHostnameSuffixAllowlist, -} from "./ssrf-policy.js"; -export { - buildBaseChannelStatusSummary, - buildProbeChannelStatusSummary, - buildRuntimeAccountStatusSnapshot, - createDefaultChannelRuntimeState, -} from "./status-helpers.js"; -export { normalizeStringEntries } from "../shared/string-normalization.js"; - -const msteamsSetup = createOptionalChannelSetupSurface({ - channel: "msteams", - label: "Microsoft Teams", - npmSpec: "@openclaw/msteams", - docsPath: "/channels/msteams", -}); - -export const msteamsSetupWizard = msteamsSetup.setupWizard; -export const msteamsSetupAdapter = msteamsSetup.setupAdapter; diff --git a/src/plugin-sdk/nextcloud-talk.ts b/src/plugin-sdk/nextcloud-talk.ts deleted file mode 100644 index 3d3e53cc84e..00000000000 --- a/src/plugin-sdk/nextcloud-talk.ts +++ /dev/null @@ -1,120 +0,0 @@ -// Private helper surface for the bundled nextcloud-talk plugin. -// Keep this list additive and scoped to the bundled Nextcloud Talk surface. - -export { logInboundDrop } from "../channels/logging.js"; -export { createAuthRateLimiter } from "../gateway/auth-rate-limit.js"; -export { - resolveMentionGating, - resolveMentionGatingWithBypass, - resolveInboundMentionDecision, -} from "../channels/mention-gating.js"; -export type { AllowlistMatch } from "../channels/plugins/allowlist-match.js"; -export { - buildChannelKeyCandidates, - normalizeChannelSlug, - resolveChannelEntryMatchWithFallback, - resolveNestedAllowlistDecision, -} from "../channels/plugins/channel-config.js"; -export { - deleteAccountFromConfigSection, - clearAccountEntryFields, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export { - buildSingleChannelSecretPromptState, - addWildcardAllowFrom, - mergeAllowFromEntries, - promptSingleChannelSecretInput, - runSingleChannelSecretStep, - setTopLevelChannelDmPolicyWithAllowFrom, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { - applyAccountNameToChannelSection, - createSetupInputPresenceValidator, - patchScopedAccountConfig, -} from "../channels/plugins/setup-helpers.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export type { ChannelGroupContext, ChannelSetupInput } from "../channels/plugins/types.public.js"; -export type { ChannelSetupDmPolicy } from "../channels/plugins/setup-wizard-types.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export type { ChannelSetupWizard } from "../channels/plugins/setup-wizard.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { mapAllowFromEntries } from "./channel-config-helpers.js"; -export { evaluateMatchedGroupAccessForPolicy } from "./group-access.js"; -export { - GROUP_POLICY_BLOCKED_LABEL, - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { - BlockStreamingCoalesceConfig, - DmConfig, - DmPolicy, - GroupPolicy, - GroupToolPolicyConfig, -} from "../config/types.js"; -export type { SecretInput } from "./secret-input.js"; -export { - buildSecretInputSchema, - hasConfiguredSecretInput, - normalizeResolvedSecretInputString, - normalizeSecretInputString, -} from "./secret-input.js"; -export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js"; -export { - BlockStreamingCoalesceSchema, - DmConfigSchema, - DmPolicySchema, - GroupPolicySchema, - MarkdownConfigSchema, - ReplyRuntimeConfigSchemaShape, - requireOpenAllowFrom, -} from "../config/zod-schema.core.js"; -export { - WEBHOOK_RATE_LIMIT_DEFAULTS, - isRequestBodyLimitError, - readRequestBodyWithLimit, - requestBodyErrorToText, -} from "./webhook-ingress.js"; -export { waitForAbortSignal } from "../infra/abort-signal.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { - readStoreAllowFromForDmPolicy, - resolveDmGroupAccessWithCommandGate, -} from "../security/dm-policy-shared.js"; -export { formatDocsLink } from "../terminal/links.js"; -export { - listConfiguredAccountIds, - resolveAccountWithDefaultFallback, -} from "./account-resolution.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { createPersistentDedupe } from "./persistent-dedupe.js"; -export type { OutboundReplyPayload } from "./reply-payload.js"; -export { - createNormalizedOutboundDeliverer, - deliverFormattedTextWithAttachments, - formatTextWithAttachmentLinks, - resolveOutboundMediaUrls, -} from "./reply-payload.js"; -export { dispatchInboundReplyWithBase } from "./inbound-reply-dispatch.js"; -export { createLoggerBackedRuntime } from "./runtime-logger.js"; -export { - buildBaseChannelStatusSummary, - buildRuntimeAccountStatusSnapshot, -} from "./status-helpers.js"; -export { - createTopLevelChannelDmPolicy, - promptParsedAllowFromForAccount, - resolveSetupAccountId, - setSetupChannelEnabled, -} from "../channels/plugins/setup-wizard-helpers.js"; diff --git a/src/plugin-sdk/nostr.ts b/src/plugin-sdk/nostr.ts deleted file mode 100644 index 259d8ba16b0..00000000000 --- a/src/plugin-sdk/nostr.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Private helper surface for the bundled nostr plugin. -// Keep this list additive and scoped to the bundled Nostr surface. - -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; - -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { getPluginRuntimeGatewayRequestScope } from "../plugins/runtime/gateway-request-scope.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export { - createDirectDmPreCryptoGuardPolicy, - dispatchInboundDirectDmWithRuntime, - type DirectDmPreCryptoGuardPolicy, - type DirectDmPreCryptoGuardPolicyOverrides, -} from "./direct-dm.js"; -export { - createPreCryptoDirectDmAuthorizer, - resolveInboundDirectDmAccessWithRuntime, -} from "./direct-dm.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { MarkdownConfigSchema } from "../config/zod-schema.core.js"; -export { readJsonBodyWithLimit, requestBodyErrorToText } from "../infra/http-body.js"; -export { isBlockedHostnameOrIp } from "../infra/net/ssrf.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js"; -export { - buildComputedAccountStatusSnapshot, - collectStatusIssuesFromLastError, - createDefaultChannelRuntimeState, -} from "./status-helpers.js"; -export { createFixedWindowRateLimiter } from "./webhook-memory-guards.js"; -export { mapAllowFromEntries } from "./channel-config-helpers.js"; - -const nostrSetup = createOptionalChannelSetupSurface({ - channel: "nostr", - label: "Nostr", - npmSpec: "@openclaw/nostr", - docsPath: "/channels/nostr", -}); - -export const nostrSetupAdapter = nostrSetup.setupAdapter; -export const nostrSetupWizard = nostrSetup.setupWizard; diff --git a/src/plugin-sdk/thread-ownership.ts b/src/plugin-sdk/thread-ownership.ts deleted file mode 100644 index 5f54520d319..00000000000 --- a/src/plugin-sdk/thread-ownership.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Narrow plugin-sdk surface for the bundled thread-ownership plugin. -// Keep this list additive and scoped to the bundled thread-ownership surface. - -export { definePluginEntry } from "./plugin-entry.js"; -export type { OpenClawConfig } from "../config/config.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "./ssrf-policy.js"; -export { ssrfPolicyFromAllowPrivateNetwork } from "./ssrf-policy.js"; diff --git a/src/plugin-sdk/tlon.ts b/src/plugin-sdk/tlon.ts deleted file mode 100644 index 36389fe64aa..00000000000 --- a/src/plugin-sdk/tlon.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Private helper surface for the bundled tlon plugin. -// Keep this list additive and scoped to the bundled Tlon surface. - -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; - -export type { ReplyPayload } from "./reply-payload.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { - applyAccountNameToChannelSection, - patchScopedAccountConfig, -} from "../channels/plugins/setup-helpers.js"; -export type { - ChannelAccountSnapshot, - ChannelOutboundAdapter, - ChannelSetupInput, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { createDedupeCache } from "../infra/dedupe.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export type { LookupFn, SsrFPolicy } from "../infra/net/ssrf.js"; -export { isBlockedHostnameOrIp, SsrFBlockedError } from "../infra/net/ssrf.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { buildComputedAccountStatusSnapshot } from "./status-helpers.js"; -export { formatDocsLink } from "../terminal/links.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { createLoggerBackedRuntime } from "./runtime.js"; - -const tlonSetup = createOptionalChannelSetupSurface({ - channel: "tlon", - label: "Tlon", - npmSpec: "@openclaw/tlon", - docsPath: "/channels/tlon", -}); - -export const tlonSetupAdapter = tlonSetup.setupAdapter; -export const tlonSetupWizard = tlonSetup.setupWizard; diff --git a/src/plugin-sdk/twitch.ts b/src/plugin-sdk/twitch.ts deleted file mode 100644 index 0ddc98853e7..00000000000 --- a/src/plugin-sdk/twitch.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Private helper surface for the bundled twitch plugin. -// Keep this list additive and scoped to the bundled Twitch surface. - -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; - -export type { ReplyPayload } from "./reply-payload.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export type { - ChannelGatewayContext, - ChannelOutboundAdapter, - ChannelOutboundContext, - ChannelResolveKind, - ChannelResolveResult, - ChannelStatusAdapter, -} from "../channels/plugins/types.adapters.js"; -export type { - BaseProbeResult, - ChannelAccountSnapshot, - ChannelCapabilities, - ChannelLogSink, - ChannelMessageActionAdapter, - ChannelMessageActionContext, - ChannelMeta, - ChannelStatusIssue, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { MarkdownConfigSchema } from "../config/zod-schema.core.js"; -export type { OutboundDeliveryResult } from "../infra/outbound/deliver.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "./account-id.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export type { RuntimeEnv } from "../runtime.js"; -export { formatDocsLink } from "../terminal/links.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; - -const twitchSetup = createOptionalChannelSetupSurface({ - channel: "twitch", - label: "Twitch", - npmSpec: "@openclaw/twitch", -}); - -export const twitchSetupAdapter = twitchSetup.setupAdapter; -export const twitchSetupWizard = twitchSetup.setupWizard; diff --git a/src/plugin-sdk/voice-call.ts b/src/plugin-sdk/voice-call.ts deleted file mode 100644 index 2d8c3a6e493..00000000000 --- a/src/plugin-sdk/voice-call.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Private helper surface for the bundled voice-call plugin. -// Keep this surface narrow and limited to the voice-call feature contract. - -export { definePluginEntry } from "./plugin-entry.js"; -export { - TtsAutoSchema, - TtsConfigSchema, - TtsModeSchema, - TtsProviderSchema, -} from "../config/zod-schema.core.js"; -export type { GatewayRequestHandlerOptions } from "../gateway/server-methods/types.js"; -export { - isRequestBodyLimitError, - readRequestBodyWithLimit, - requestBodyErrorToText, -} from "../infra/http-body.js"; -export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js"; -export type { SessionEntry } from "../config/sessions/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { sleep } from "../utils.js"; diff --git a/src/plugin-sdk/zalo-setup.ts b/src/plugin-sdk/zalo-setup.ts deleted file mode 100644 index 165e6052027..00000000000 --- a/src/plugin-sdk/zalo-setup.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Manual facade. Keep loader boundaries explicit and narrow. -import type { ChannelSetupWizard } from "../channels/plugins/setup-wizard-types.js"; -import type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js"; -import type { GroupPolicy } from "../config/types.base.js"; -import { - createLazyFacadeObjectValue, - loadBundledPluginPublicSurfaceModuleSync, -} from "./facade-loader.js"; -import type { SenderGroupAccessDecision } from "./group-access.js"; - -type ZaloRuntimeGroupPolicyResult = { - groupPolicy: GroupPolicy; - providerMissingFallbackApplied: boolean; -}; - -type SetupFacadeModule = { - zaloSetupAdapter: ChannelSetupAdapter; - zaloSetupWizard: ChannelSetupWizard; -}; - -type GroupAccessFacadeModule = { - evaluateZaloGroupAccess: (params: { - providerConfigPresent: boolean; - configuredGroupPolicy?: GroupPolicy; - defaultGroupPolicy?: GroupPolicy; - groupAllowFrom: string[]; - senderId: string; - }) => SenderGroupAccessDecision; - resolveZaloRuntimeGroupPolicy: (params: { - providerConfigPresent: boolean; - groupPolicy?: GroupPolicy; - defaultGroupPolicy?: GroupPolicy; - }) => ZaloRuntimeGroupPolicyResult; -}; - -function loadSetupFacadeModule(): SetupFacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "zalo", - artifactBasename: "setup-api.js", - }); -} -function loadGroupAccessFacadeModule(): GroupAccessFacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "zalo", - artifactBasename: "contract-api.js", - }); -} - -export const evaluateZaloGroupAccess: GroupAccessFacadeModule["evaluateZaloGroupAccess"] = (( - ...args -) => - loadGroupAccessFacadeModule()["evaluateZaloGroupAccess"]( - ...args, - )) as GroupAccessFacadeModule["evaluateZaloGroupAccess"]; -export const resolveZaloRuntimeGroupPolicy: GroupAccessFacadeModule["resolveZaloRuntimeGroupPolicy"] = - ((...args) => - loadGroupAccessFacadeModule()["resolveZaloRuntimeGroupPolicy"]( - ...args, - )) as GroupAccessFacadeModule["resolveZaloRuntimeGroupPolicy"]; -export const zaloSetupAdapter: SetupFacadeModule["zaloSetupAdapter"] = createLazyFacadeObjectValue( - () => loadSetupFacadeModule()["zaloSetupAdapter"] as object, -) as SetupFacadeModule["zaloSetupAdapter"]; -export const zaloSetupWizard: SetupFacadeModule["zaloSetupWizard"] = createLazyFacadeObjectValue( - () => loadSetupFacadeModule()["zaloSetupWizard"] as object, -) as SetupFacadeModule["zaloSetupWizard"]; diff --git a/src/plugin-sdk/zalo.ts b/src/plugin-sdk/zalo.ts deleted file mode 100644 index 1d8f7d7ff4c..00000000000 --- a/src/plugin-sdk/zalo.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Private helper surface for the bundled zalo plugin. -// Keep this list additive and scoped to the bundled Zalo surface. - -export { jsonResult, readStringParam } from "../agents/tools/common.js"; -export type { ReplyPayload } from "./reply-payload.js"; -export { - deleteAccountFromConfigSection, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { listDirectoryUserEntriesFromAllowFrom } from "../channels/plugins/directory-config-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export { - buildSingleChannelSecretPromptState, - addWildcardAllowFrom, - mergeAllowFromEntries, - promptSingleChannelSecretInput, - runSingleChannelSecretStep, - setTopLevelChannelDmPolicyWithAllowFrom, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; -export { - applyAccountNameToChannelSection, - applySetupAccountConfigPatch, - migrateBaseNameToDefaultAccount, -} from "../channels/plugins/setup-helpers.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export type { - BaseProbeResult, - BaseTokenResolution, - ChannelAccountSnapshot, - ChannelMessageActionAdapter, - ChannelMessageActionName, - ChannelStatusIssue, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { logTypingFailure } from "../channels/logging.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { - resolveDefaultGroupPolicy, - resolveOpenProviderRuntimeGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { GroupPolicy, MarkdownTableMode } from "../config/types.js"; -export type { SecretInput } from "./secret-input.js"; -export { - buildSecretInputSchema, - hasConfiguredSecretInput, - normalizeResolvedSecretInputString, - normalizeSecretInputString, -} from "./secret-input.js"; -export { MarkdownConfigSchema } from "../config/zod-schema.core.js"; -export { waitForAbortSignal } from "../infra/abort-signal.js"; -export { createDedupeCache } from "../infra/dedupe.js"; -export { resolveClientIp } from "../gateway/net.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { OpenClawPluginApi } from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { formatAllowFromLowercase, isNormalizedSenderAllowed } from "./allow-from.js"; -export { zaloSetupAdapter } from "./zalo-setup.js"; -export { zaloSetupWizard } from "./zalo-setup.js"; -export { evaluateZaloGroupAccess, resolveZaloRuntimeGroupPolicy } from "./zalo-setup.js"; -export { - resolveDirectDmAuthorizationOutcome, - resolveSenderCommandAuthorizationWithRuntime, -} from "./command-auth.js"; -export { resolveChannelAccountConfigBasePath } from "./config-paths.js"; -export { evaluateSenderGroupAccess } from "./group-access.js"; -export type { SenderGroupAccessDecision } from "./group-access.js"; -export { resolveInboundRouteEnvelopeBuilderWithRuntime } from "./inbound-envelope.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { buildChannelSendResult } from "./channel-send-result.js"; -export type { OutboundReplyPayload } from "./reply-payload.js"; -export { - deliverTextOrMediaReply, - isNumericTargetId, - resolveOutboundMediaUrls, - sendMediaWithLeadingCaption, - sendPayloadWithChunkedTextAndMedia, -} from "./reply-payload.js"; -export { - buildBaseAccountStatusSnapshot, - buildTokenChannelStatusSummary, -} from "./status-helpers.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; -export { extractToolSend } from "./tool-send.js"; -export { - applyBasicWebhookRequestGuards, - createFixedWindowRateLimiter, - createWebhookAnomalyTracker, - readJsonWebhookBodyOrReject, - registerWebhookTarget, - registerWebhookTargetWithPluginRoute, - resolveSingleWebhookTarget, - resolveWebhookPath, - resolveWebhookTargetWithAuthOrRejectSync, - resolveWebhookTargets, - WEBHOOK_ANOMALY_COUNTER_DEFAULTS, - WEBHOOK_RATE_LIMIT_DEFAULTS, - withResolvedWebhookRequestPipeline, -} from "./webhook-ingress.js"; -export type { - RegisterWebhookPluginRouteOptions, - RegisterWebhookTargetOptions, -} from "./webhook-ingress.js"; diff --git a/src/plugin-sdk/zalouser.ts b/src/plugin-sdk/zalouser.ts deleted file mode 100644 index f920c8a2fb3..00000000000 --- a/src/plugin-sdk/zalouser.ts +++ /dev/null @@ -1,124 +0,0 @@ -// Private helper surface for the bundled zalouser plugin. -// Keep this list additive and scoped to the bundled Zalo user surface. - -import { createOptionalChannelSetupSurface } from "./channel-setup.js"; - -export type { ReplyPayload } from "./reply-payload.js"; -export { mergeAllowlist, summarizeMapping } from "../channels/allowlists/resolve-utils.js"; -export { - resolveMentionGating, - resolveMentionGatingWithBypass, - resolveInboundMentionDecision, -} from "../channels/mention-gating.js"; -export { - deleteAccountFromConfigSection, - setAccountEnabledInConfigSection, -} from "../channels/plugins/config-helpers.js"; -export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; -export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; -export { - addWildcardAllowFrom, - mergeAllowFromEntries, - setTopLevelChannelDmPolicyWithAllowFrom, -} from "../channels/plugins/setup-wizard-helpers.js"; -export { - applyAccountNameToChannelSection, - applySetupAccountConfigPatch, - migrateBaseNameToDefaultAccount, - patchScopedAccountConfig, -} from "../channels/plugins/setup-helpers.js"; -export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; -export type { - BaseProbeResult, - ChannelAccountSnapshot, - ChannelDirectoryEntry, - ChannelGroupContext, - ChannelMessageActionAdapter, - ChannelStatusIssue, -} from "../channels/plugins/types.public.js"; -export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; -export { createChannelReplyPipeline } from "./channel-reply-pipeline.js"; -export type { OpenClawConfig } from "../config/config.js"; -export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js"; -export { - resolveDefaultGroupPolicy, - resolveOpenProviderRuntimeGroupPolicy, - warnMissingProviderGroupPolicyFallbackOnce, -} from "../config/runtime-group-policy.js"; -export type { GroupToolPolicyConfig, MarkdownTableMode } from "../config/types.js"; -export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js"; -export { MarkdownConfigSchema } from "../config/zod-schema.core.js"; -export { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; -export { emptyPluginConfigSchema } from "../plugins/config-schema.js"; -export type { PluginRuntime } from "../plugins/runtime/types.js"; -export type { - AnyAgentTool, - OpenClawPluginApi, - OpenClawPluginToolContext, -} from "../plugins/types.js"; -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js"; -export type { RuntimeEnv } from "../runtime.js"; -export type { WizardPrompter } from "../wizard/prompts.js"; -export { formatAllowFromLowercase } from "./allow-from.js"; -export { resolveSenderCommandAuthorization } from "./command-auth.js"; -export { resolveChannelAccountConfigBasePath } from "./config-paths.js"; -export { - evaluateGroupRouteAccessForPolicy, - resolveSenderScopedGroupPolicy, -} from "./group-access.js"; -export { loadOutboundMediaFromUrl } from "./outbound-media.js"; -export { createChannelPairingController } from "./channel-pairing.js"; -export { buildChannelSendResult } from "./channel-send-result.js"; -export type { OutboundReplyPayload } from "./reply-payload.js"; -export { - deliverTextOrMediaReply, - isNumericTargetId, - resolveOutboundMediaUrls, - resolveSendableOutboundReplyParts, - sendMediaWithLeadingCaption, - sendPayloadWithChunkedTextAndMedia, -} from "./reply-payload.js"; -export { formatResolvedUnresolvedNote } from "./resolution-notes.js"; -export { buildBaseAccountStatusSnapshot } from "./status-helpers.js"; -export { chunkTextForOutbound } from "./text-chunking.js"; - -import type { SecurityAuditFinding } from "../security/audit.types.js"; -import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js"; - -type FacadeModule = { - collectZalouserSecurityAuditFindings: (params: { - accountId?: string | null; - account: { - accountId?: string; - config?: { - groups?: Record; - dangerouslyAllowNameMatching?: boolean; - }; - }; - orderedAccountIds: string[]; - hasExplicitAccountPath: boolean; - }) => SecurityAuditFinding[]; -}; - -function loadFacadeModule(): FacadeModule { - return loadBundledPluginPublicSurfaceModuleSync({ - dirName: "zalouser", - artifactBasename: "contract-api.js", - }); -} - -export const collectZalouserSecurityAuditFindings: FacadeModule["collectZalouserSecurityAuditFindings"] = - ((...args) => - loadFacadeModule().collectZalouserSecurityAuditFindings( - ...args, - )) as FacadeModule["collectZalouserSecurityAuditFindings"]; - -const zalouserSetup = createOptionalChannelSetupSurface({ - channel: "zalouser", - label: "Zalo Personal", - npmSpec: "@openclaw/zalouser", - docsPath: "/channels/zalouser", -}); - -export const zalouserSetupAdapter = zalouserSetup.setupAdapter; -export const zalouserSetupWizard = zalouserSetup.setupWizard; diff --git a/src/plugins/bundled-capability-runtime.test.ts b/src/plugins/bundled-capability-runtime.test.ts index 67ee7b334b5..48d714e7199 100644 --- a/src/plugins/bundled-capability-runtime.test.ts +++ b/src/plugins/bundled-capability-runtime.test.ts @@ -5,9 +5,6 @@ describe("buildVitestCapabilityShimAliasMap", () => { it("keeps scoped and unscoped capability shim aliases aligned", () => { const aliasMap = buildVitestCapabilityShimAliasMap(); - expect(aliasMap["openclaw/plugin-sdk/llm-task"]).toBe( - aliasMap["@openclaw/plugin-sdk/llm-task"], - ); expect(aliasMap["openclaw/plugin-sdk/config-runtime"]).toBe( aliasMap["@openclaw/plugin-sdk/config-runtime"], ); diff --git a/src/plugins/bundled-capability-runtime.ts b/src/plugins/bundled-capability-runtime.ts index 90c918f23ed..45e1d8b7e4d 100644 --- a/src/plugins/bundled-capability-runtime.ts +++ b/src/plugins/bundled-capability-runtime.ts @@ -25,10 +25,6 @@ import type { OpenClawPluginDefinition, OpenClawPluginModule } from "./types.js" const log = createSubsystemLogger("plugins"); const CAPABILITY_VITEST_SHIM_ALIASES = [ - { - subpath: "llm-task", - target: new URL("./capability-runtime-vitest-shims/llm-task.ts", import.meta.url), - }, { subpath: "config-runtime", target: new URL("./capability-runtime-vitest-shims/config-runtime.ts", import.meta.url), diff --git a/src/plugins/capability-runtime-vitest-shims/llm-task.ts b/src/plugins/capability-runtime-vitest-shims/llm-task.ts deleted file mode 100644 index 8bd954517a0..00000000000 --- a/src/plugins/capability-runtime-vitest-shims/llm-task.ts +++ /dev/null @@ -1 +0,0 @@ -export { resolvePreferredOpenClawTmpDir } from "../../infra/tmp-openclaw-dir.js"; diff --git a/src/plugins/contracts/bundled-extension-config-api-guardrails.test.ts b/src/plugins/contracts/bundled-extension-config-api-guardrails.test.ts index fc56c5feaea..a24b456907c 100644 --- a/src/plugins/contracts/bundled-extension-config-api-guardrails.test.ts +++ b/src/plugins/contracts/bundled-extension-config-api-guardrails.test.ts @@ -36,7 +36,7 @@ const BUNDLED_EXTENSION_CONFIG_IMPORT_GUARDS = [ allowedSpecifier: "../runtime-api.js", }, // Teams keeps a package-local config barrel so production code does not - // self-import via openclaw/plugin-sdk/msteams from inside the same extension. + // reach through a public plugin-sdk helper seam from inside the same extension. { path: "extensions/msteams/src/config-schema.ts", allowedSpecifier: "../config-api.js", diff --git a/src/plugins/contracts/plugin-sdk-index.bundle.test.ts b/src/plugins/contracts/plugin-sdk-index.bundle.test.ts index 2135beb53ae..785cb185b5c 100644 --- a/src/plugins/contracts/plugin-sdk-index.bundle.test.ts +++ b/src/plugins/contracts/plugin-sdk-index.bundle.test.ts @@ -9,7 +9,7 @@ import { resolveBundledPluginFile } from "./test-helpers/bundled-plugin-roots.js const require = createRequire(import.meta.url); const tsdownModuleUrl = pathToFileURL(require.resolve("tsdown")).href; -const bundledRepresentativeEntrypoints = ["matrix-runtime-heavy"] as const; +const bundledRepresentativeEntrypoints = ["matrix-runtime-shared"] as const; const bundleTempRootTracker = createSuiteTempRootTracker( "openclaw-plugin-sdk-build", path.join(process.cwd(), "node_modules", ".cache"), diff --git a/src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts b/src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts index 13052c4cc59..f7d4834d157 100644 --- a/src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts +++ b/src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts @@ -3,8 +3,6 @@ import { dirname, join, relative, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; import { - dormantReservedBundledPluginSdkEntrypoints, - dormantReservedBundledPluginSdkEntrypointRecords, pluginSdkEntrypoints, publicPluginOwnedSdkEntrypoints, reservedBundledPluginSdkEntrypoints, @@ -515,42 +513,6 @@ function collectReservedSdkSubpathImports(): string[] { return [...imports].toSorted(); } -function collectDormantReservedMetadataDrift(): string[] { - const failures: string[] = []; - const recordsBySubpath = new Map< - string, - (typeof dormantReservedBundledPluginSdkEntrypointRecords)[number] - >(); - for (const record of dormantReservedBundledPluginSdkEntrypointRecords) { - if (recordsBySubpath.has(record.subpath)) { - failures.push(`${record.subpath}: duplicate dormant metadata record`); - continue; - } - recordsBySubpath.set(record.subpath, record); - if (record.replacement.trim().length === 0) { - failures.push(`${record.subpath}: missing replacement`); - } - if (!/^\d{4}-\d{2}-\d{2}$/.test(record.removeAfter)) { - failures.push(`${record.subpath}: invalid removeAfter ${record.removeAfter}`); - } - if (record.owner.trim().length === 0) { - failures.push(`${record.subpath}: missing owner`); - } - const resolvedOwner = resolvePluginOwnerFromEntrypoint(record.subpath); - if (resolvedOwner && resolvedOwner !== record.owner) { - failures.push(`${record.subpath}: owner ${record.owner} should be ${resolvedOwner}`); - } - } - - const recordSubpaths = [...recordsBySubpath.keys()].toSorted(); - const derivedSubpaths = [...dormantReservedBundledPluginSdkEntrypoints].toSorted(); - if (JSON.stringify(recordSubpaths) !== JSON.stringify(derivedSubpaths)) { - failures.push("dormant subpath list must be derived from dormant metadata records"); - } - - return failures.toSorted(); -} - describe("plugin-sdk package contract guardrails", () => { it("keeps plugin-sdk entrypoint metadata unique", () => { const counts = new Map(); @@ -572,12 +534,8 @@ describe("plugin-sdk package contract guardrails", () => { it("keeps bundled plugin SDK compatibility subpaths explicitly classified", () => { const entrypoints = new Set(pluginSdkEntrypoints); const reserved = new Set(reservedBundledPluginSdkEntrypoints); - const dormantReserved = new Set(dormantReservedBundledPluginSdkEntrypoints); const supported = new Set(supportedBundledFacadeSdkEntrypoints); const unknownReserved = [...reserved].filter((entrypoint) => !entrypoints.has(entrypoint)); - const unknownDormantReserved = [...dormantReserved].filter( - (entrypoint) => !reserved.has(entrypoint), - ); const unknownSupported = [...supported].filter((entrypoint) => !entrypoints.has(entrypoint)); const unclassifiedBundledFacades = collectBundledFacadeSdkEntrypoints().filter( (entrypoint) => !reserved.has(entrypoint) && !supported.has(entrypoint), @@ -588,23 +546,17 @@ describe("plugin-sdk package contract guardrails", () => { expect({ unknownReserved, - unknownDormantReserved, unknownSupported, unclassifiedBundledFacades, unreservedPrivateSurfaces, }).toEqual({ unknownReserved: [], - unknownDormantReserved: [], unknownSupported: [], unclassifiedBundledFacades: [], unreservedPrivateSurfaces: [], }); }); - it("keeps dormant reserved SDK compatibility subpaths annotated for retirement", () => { - expect(collectDormantReservedMetadataDrift()).toEqual([]); - }); - it("keeps plugin-owned SDK subpaths explicitly classified and documented", () => { const entrypoints = new Set(pluginSdkEntrypoints); const reserved = new Set(reservedBundledPluginSdkEntrypoints); @@ -711,20 +663,13 @@ describe("plugin-sdk package contract guardrails", () => { expect(collectCrossOwnerReservedSdkImports()).toEqual([]); }); - it("keeps unused reserved SDK compatibility subpaths classified as dormant", () => { + it("keeps reserved SDK compatibility subpaths actively used", () => { const usedReserved = new Set(collectReservedSdkSubpathImports()); - const dormantReserved = new Set(dormantReservedBundledPluginSdkEntrypoints); - const usedButDormant = [...usedReserved].filter((entrypoint) => - dormantReserved.has(entrypoint), - ); - const unusedUnclassified = reservedBundledPluginSdkEntrypoints.filter( - (entrypoint) => !usedReserved.has(entrypoint) && !dormantReserved.has(entrypoint), + const unusedReserved = reservedBundledPluginSdkEntrypoints.filter( + (entrypoint) => !usedReserved.has(entrypoint), ); - expect({ usedButDormant, unusedUnclassified }).toEqual({ - usedButDormant: [], - unusedUnclassified: [], - }); + expect(unusedReserved).toEqual([]); }); it("keeps generic core poll helpers free of plugin owner names", () => { diff --git a/src/plugins/contracts/plugin-sdk-subpaths.test.ts b/src/plugins/contracts/plugin-sdk-subpaths.test.ts index 164658047bf..4437a6f573b 100644 --- a/src/plugins/contracts/plugin-sdk-subpaths.test.ts +++ b/src/plugins/contracts/plugin-sdk-subpaths.test.ts @@ -531,52 +531,6 @@ describe("plugin-sdk subpath exports", () => { "createDirectTextMediaOutbound", "createScopedChannelMediaMaxBytesResolver", ]); - expectSourceMentions("bluebubbles", [ - "normalizeBlueBubblesAcpConversationId", - "matchBlueBubblesAcpConversation", - "resolveBlueBubblesConversationIdFromTarget", - "resolveAckReaction", - "resolveChannelMediaMaxBytes", - "collectBlueBubblesStatusIssues", - "createChannelPairingController", - "createChannelReplyPipeline", - "resolveRequestUrl", - "buildProbeChannelStatusSummary", - "extractToolSend", - "createFixedWindowRateLimiter", - "withResolvedWebhookRequestPipeline", - ]); - expectSourceMentions("irc", [ - "createChannelReplyPipeline", - "chunkTextForOutbound", - "createChannelPairingController", - "createLoggerBackedRuntime", - "ircSetupAdapter", - "ircSetupWizard", - ]); - expectSourceMentions("bluebubbles-policy", [ - "isAllowedBlueBubblesSender", - "resolveBlueBubblesGroupRequireMention", - "resolveBlueBubblesGroupToolPolicy", - ]); - for (const subpath of [ - "feishu", - "googlechat", - "matrix", - "mattermost", - "msteams", - "zalo", - "zalouser", - ]) { - expectSourceMentions(subpath, ["chunkTextForOutbound"]); - } - for (const subpath of ["googlechat", "msteams", "nextcloud-talk", "zalouser"]) { - expectSourceMentions(subpath, [ - "resolveInboundMentionDecision", - "resolveMentionGating", - "resolveMentionGatingWithBypass", - ]); - } expectSourceMentions("approval-auth-runtime", [ "createResolvedApproverActionAuthAdapter", "resolveApprovalApprovers", @@ -1115,7 +1069,7 @@ describe("plugin-sdk subpath exports", () => { ]); expectSourceOmitsImportPattern("command-auth", "../auto-reply/status.js"); expectSourceOmitsSnippet("command-auth", "../../extensions/"); - expectSourceOmitsSnippet("matrix-runtime-heavy", "../../extensions/"); + expectSourceOmitsSnippet("matrix-runtime-shared", "../../extensions/"); expectSourceMentions("channel-send-result", [ "attachChannelToResult", "buildChannelSendResult", diff --git a/test/scripts/plugin-boundary-report.test.ts b/test/scripts/plugin-boundary-report.test.ts index d6b8f1a386a..4e3f8d495fb 100644 --- a/test/scripts/plugin-boundary-report.test.ts +++ b/test/scripts/plugin-boundary-report.test.ts @@ -27,8 +27,7 @@ describe("plugin-boundary-report", () => { const summary = JSON.parse(output) as { pluginSdk?: { crossOwnerReservedImportCount?: unknown; - dormantReservedEligibleForRemovalCount?: unknown; - unclassifiedUnusedReservedCount?: unknown; + unusedReservedCount?: unknown; }; memoryHostSdk?: { implementation?: unknown; @@ -36,22 +35,7 @@ describe("plugin-boundary-report", () => { }; expect(summary.pluginSdk?.crossOwnerReservedImportCount).toBe(0); - expect(summary.pluginSdk?.dormantReservedEligibleForRemovalCount).toBe(0); - expect(summary.pluginSdk?.unclassifiedUnusedReservedCount).toBe(0); + expect(summary.pluginSdk?.unusedReservedCount).toBe(0); expect(summary.memoryHostSdk?.implementation).toBe("private-core-bridge"); }); - - it("emits an owner-scoped dormant SDK retirement plan", () => { - const output = runBoundaryReport("--retirement-plan", "--owner", "matrix"); - - expect(output).toContain("# Plugin SDK Dormant Reserved Subpath Retirement Plan"); - expect(output).toContain("Owner filter: `matrix`"); - expect(output).toContain("Dormant reserved subpaths: 6"); - expect(output).toContain( - "`openclaw/plugin-sdk/matrix-runtime-heavy` remove after `2026-07-24`", - ); - expect(output).toContain( - "replacement: Matrix local runtime-api plus doctor/fix migration paths", - ); - }); });