Plugin SDK: add full bundled subpath wiring

This commit is contained in:
Gustavo Madeira Santana
2026-03-04 02:31:44 -05:00
parent 9d941949c9
commit 7a2f5a0098
44 changed files with 1704 additions and 190 deletions

View File

@@ -120,12 +120,32 @@ authoring plugins:
- `openclaw/plugin-sdk/imessage` for iMessage channel plugins. - `openclaw/plugin-sdk/imessage` for iMessage channel plugins.
- `openclaw/plugin-sdk/whatsapp` for WhatsApp channel plugins. - `openclaw/plugin-sdk/whatsapp` for WhatsApp channel plugins.
- `openclaw/plugin-sdk/line` for LINE channel plugins. - `openclaw/plugin-sdk/line` for LINE channel plugins.
- `openclaw/plugin-sdk/msteams` for the bundled Microsoft Teams plugin surface.
- Bundled extension-specific subpaths are also available:
`openclaw/plugin-sdk/acpx`, `openclaw/plugin-sdk/bluebubbles`,
`openclaw/plugin-sdk/copilot-proxy`, `openclaw/plugin-sdk/device-pair`,
`openclaw/plugin-sdk/diagnostics-otel`, `openclaw/plugin-sdk/diffs`,
`openclaw/plugin-sdk/feishu`,
`openclaw/plugin-sdk/google-gemini-cli-auth`, `openclaw/plugin-sdk/googlechat`,
`openclaw/plugin-sdk/irc`, `openclaw/plugin-sdk/llm-task`,
`openclaw/plugin-sdk/lobster`, `openclaw/plugin-sdk/matrix`,
`openclaw/plugin-sdk/mattermost`, `openclaw/plugin-sdk/memory-core`,
`openclaw/plugin-sdk/memory-lancedb`,
`openclaw/plugin-sdk/minimax-portal-auth`,
`openclaw/plugin-sdk/nextcloud-talk`, `openclaw/plugin-sdk/nostr`,
`openclaw/plugin-sdk/open-prose`, `openclaw/plugin-sdk/phone-control`,
`openclaw/plugin-sdk/qwen-portal-auth`, `openclaw/plugin-sdk/synology-chat`,
`openclaw/plugin-sdk/talk-voice`, `openclaw/plugin-sdk/test-utils`,
`openclaw/plugin-sdk/thread-ownership`, `openclaw/plugin-sdk/tlon`,
`openclaw/plugin-sdk/twitch`, `openclaw/plugin-sdk/voice-call`,
`openclaw/plugin-sdk/zalo`, and `openclaw/plugin-sdk/zalouser`.
Compatibility note: Compatibility note:
- `openclaw/plugin-sdk` remains supported for existing external plugins. - `openclaw/plugin-sdk` remains supported for existing external plugins.
- New and migrated bundled plugins should use channel subpaths and `core`; use - New and migrated bundled plugins should use channel or extension-specific
`compat` only when broader shared helpers are required. subpaths; use `core` for generic surfaces and `compat` only when broader
shared helpers are required.
Performance note: Performance note:
@@ -154,13 +174,21 @@ OpenClaw scans, in order:
- `~/.openclaw/extensions/*.ts` - `~/.openclaw/extensions/*.ts`
- `~/.openclaw/extensions/*/index.ts` - `~/.openclaw/extensions/*/index.ts`
4. Bundled extensions (shipped with OpenClaw, **disabled by default**) 4. Bundled extensions (shipped with OpenClaw, mostly disabled by default)
- `<openclaw>/extensions/*` - `<openclaw>/extensions/*`
Bundled plugins must be enabled explicitly via `plugins.entries.<id>.enabled` Most bundled plugins must be enabled explicitly via
or `openclaw plugins enable <id>`. Installed plugins are enabled by default, `plugins.entries.<id>.enabled` or `openclaw plugins enable <id>`.
but can be disabled the same way.
Default-on bundled plugin exceptions:
- `device-pair`
- `phone-control`
- `talk-voice`
- active memory slot plugin (default slot: `memory-core`)
Installed plugins are enabled by default, but can be disabled the same way.
Hardening notes: Hardening notes:

View File

@@ -76,6 +76,134 @@
"types": "./dist/plugin-sdk/line.d.ts", "types": "./dist/plugin-sdk/line.d.ts",
"default": "./dist/plugin-sdk/line.js" "default": "./dist/plugin-sdk/line.js"
}, },
"./plugin-sdk/msteams": {
"types": "./dist/plugin-sdk/msteams.d.ts",
"default": "./dist/plugin-sdk/msteams.js"
},
"./plugin-sdk/acpx": {
"types": "./dist/plugin-sdk/acpx.d.ts",
"default": "./dist/plugin-sdk/acpx.js"
},
"./plugin-sdk/bluebubbles": {
"types": "./dist/plugin-sdk/bluebubbles.d.ts",
"default": "./dist/plugin-sdk/bluebubbles.js"
},
"./plugin-sdk/copilot-proxy": {
"types": "./dist/plugin-sdk/copilot-proxy.d.ts",
"default": "./dist/plugin-sdk/copilot-proxy.js"
},
"./plugin-sdk/device-pair": {
"types": "./dist/plugin-sdk/device-pair.d.ts",
"default": "./dist/plugin-sdk/device-pair.js"
},
"./plugin-sdk/diagnostics-otel": {
"types": "./dist/plugin-sdk/diagnostics-otel.d.ts",
"default": "./dist/plugin-sdk/diagnostics-otel.js"
},
"./plugin-sdk/diffs": {
"types": "./dist/plugin-sdk/diffs.d.ts",
"default": "./dist/plugin-sdk/diffs.js"
},
"./plugin-sdk/feishu": {
"types": "./dist/plugin-sdk/feishu.d.ts",
"default": "./dist/plugin-sdk/feishu.js"
},
"./plugin-sdk/google-gemini-cli-auth": {
"types": "./dist/plugin-sdk/google-gemini-cli-auth.d.ts",
"default": "./dist/plugin-sdk/google-gemini-cli-auth.js"
},
"./plugin-sdk/googlechat": {
"types": "./dist/plugin-sdk/googlechat.d.ts",
"default": "./dist/plugin-sdk/googlechat.js"
},
"./plugin-sdk/irc": {
"types": "./dist/plugin-sdk/irc.d.ts",
"default": "./dist/plugin-sdk/irc.js"
},
"./plugin-sdk/llm-task": {
"types": "./dist/plugin-sdk/llm-task.d.ts",
"default": "./dist/plugin-sdk/llm-task.js"
},
"./plugin-sdk/lobster": {
"types": "./dist/plugin-sdk/lobster.d.ts",
"default": "./dist/plugin-sdk/lobster.js"
},
"./plugin-sdk/matrix": {
"types": "./dist/plugin-sdk/matrix.d.ts",
"default": "./dist/plugin-sdk/matrix.js"
},
"./plugin-sdk/mattermost": {
"types": "./dist/plugin-sdk/mattermost.d.ts",
"default": "./dist/plugin-sdk/mattermost.js"
},
"./plugin-sdk/memory-core": {
"types": "./dist/plugin-sdk/memory-core.d.ts",
"default": "./dist/plugin-sdk/memory-core.js"
},
"./plugin-sdk/memory-lancedb": {
"types": "./dist/plugin-sdk/memory-lancedb.d.ts",
"default": "./dist/plugin-sdk/memory-lancedb.js"
},
"./plugin-sdk/minimax-portal-auth": {
"types": "./dist/plugin-sdk/minimax-portal-auth.d.ts",
"default": "./dist/plugin-sdk/minimax-portal-auth.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/open-prose": {
"types": "./dist/plugin-sdk/open-prose.d.ts",
"default": "./dist/plugin-sdk/open-prose.js"
},
"./plugin-sdk/phone-control": {
"types": "./dist/plugin-sdk/phone-control.d.ts",
"default": "./dist/plugin-sdk/phone-control.js"
},
"./plugin-sdk/qwen-portal-auth": {
"types": "./dist/plugin-sdk/qwen-portal-auth.d.ts",
"default": "./dist/plugin-sdk/qwen-portal-auth.js"
},
"./plugin-sdk/synology-chat": {
"types": "./dist/plugin-sdk/synology-chat.d.ts",
"default": "./dist/plugin-sdk/synology-chat.js"
},
"./plugin-sdk/talk-voice": {
"types": "./dist/plugin-sdk/talk-voice.d.ts",
"default": "./dist/plugin-sdk/talk-voice.js"
},
"./plugin-sdk/test-utils": {
"types": "./dist/plugin-sdk/test-utils.d.ts",
"default": "./dist/plugin-sdk/test-utils.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/twitch": {
"types": "./dist/plugin-sdk/twitch.d.ts",
"default": "./dist/plugin-sdk/twitch.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/zalouser": {
"types": "./dist/plugin-sdk/zalouser.d.ts",
"default": "./dist/plugin-sdk/zalouser.js"
},
"./plugin-sdk/account-id": { "./plugin-sdk/account-id": {
"types": "./dist/plugin-sdk/account-id.d.ts", "types": "./dist/plugin-sdk/account-id.d.ts",
"default": "./dist/plugin-sdk/account-id.js" "default": "./dist/plugin-sdk/account-id.js"

View File

@@ -2,15 +2,12 @@ import fs from "node:fs";
import path from "node:path"; import path from "node:path";
import { discoverOpenClawPlugins } from "../src/plugins/discovery.js"; import { discoverOpenClawPlugins } from "../src/plugins/discovery.js";
const ROOT_IMPORT_PATTERNS = [ // Match exact monolithic-root specifier in any code path:
/\b(?:import|export)\b[\s\S]*?\bfrom\s+["']openclaw\/plugin-sdk["']/, // imports/exports, require/dynamic import, and test mocks (vi.mock/jest.mock).
/\bimport\s+["']openclaw\/plugin-sdk["']/, const ROOT_IMPORT_PATTERN = /["']openclaw\/plugin-sdk["']/;
/\bimport\s*\(\s*["']openclaw\/plugin-sdk["']\s*\)/,
/\brequire\s*\(\s*["']openclaw\/plugin-sdk["']\s*\)/,
];
function hasMonolithicRootImport(content: string): boolean { function hasMonolithicRootImport(content: string): boolean {
return ROOT_IMPORT_PATTERNS.some((pattern) => pattern.test(content)); return ROOT_IMPORT_PATTERN.test(content);
} }
function isSourceFile(filePath: string): boolean { function isSourceFile(filePath: string): boolean {

View File

@@ -51,7 +51,40 @@ const requiredSubpathEntries = [
"imessage", "imessage",
"whatsapp", "whatsapp",
"line", "line",
"msteams",
"acpx",
"bluebubbles",
"copilot-proxy",
"device-pair",
"diagnostics-otel",
"diffs",
"feishu",
"google-gemini-cli-auth",
"googlechat",
"irc",
"llm-task",
"lobster",
"matrix",
"mattermost",
"memory-core",
"memory-lancedb",
"minimax-portal-auth",
"nextcloud-talk",
"nostr",
"open-prose",
"phone-control",
"qwen-portal-auth",
"synology-chat",
"talk-voice",
"test-utils",
"thread-ownership",
"tlon",
"twitch",
"voice-call",
"zalo",
"zalouser",
"account-id", "account-id",
"keyed-async-queue",
]; ];
const requiredRuntimeShimEntries = ["root-alias.cjs"]; const requiredRuntimeShimEntries = ["root-alias.cjs"];

View File

@@ -33,6 +33,74 @@ const requiredPathGroups = [
"dist/plugin-sdk/whatsapp.d.ts", "dist/plugin-sdk/whatsapp.d.ts",
"dist/plugin-sdk/line.js", "dist/plugin-sdk/line.js",
"dist/plugin-sdk/line.d.ts", "dist/plugin-sdk/line.d.ts",
"dist/plugin-sdk/msteams.js",
"dist/plugin-sdk/msteams.d.ts",
"dist/plugin-sdk/acpx.js",
"dist/plugin-sdk/acpx.d.ts",
"dist/plugin-sdk/bluebubbles.js",
"dist/plugin-sdk/bluebubbles.d.ts",
"dist/plugin-sdk/copilot-proxy.js",
"dist/plugin-sdk/copilot-proxy.d.ts",
"dist/plugin-sdk/device-pair.js",
"dist/plugin-sdk/device-pair.d.ts",
"dist/plugin-sdk/diagnostics-otel.js",
"dist/plugin-sdk/diagnostics-otel.d.ts",
"dist/plugin-sdk/diffs.js",
"dist/plugin-sdk/diffs.d.ts",
"dist/plugin-sdk/feishu.js",
"dist/plugin-sdk/feishu.d.ts",
"dist/plugin-sdk/google-gemini-cli-auth.js",
"dist/plugin-sdk/google-gemini-cli-auth.d.ts",
"dist/plugin-sdk/googlechat.js",
"dist/plugin-sdk/googlechat.d.ts",
"dist/plugin-sdk/irc.js",
"dist/plugin-sdk/irc.d.ts",
"dist/plugin-sdk/llm-task.js",
"dist/plugin-sdk/llm-task.d.ts",
"dist/plugin-sdk/lobster.js",
"dist/plugin-sdk/lobster.d.ts",
"dist/plugin-sdk/matrix.js",
"dist/plugin-sdk/matrix.d.ts",
"dist/plugin-sdk/mattermost.js",
"dist/plugin-sdk/mattermost.d.ts",
"dist/plugin-sdk/memory-core.js",
"dist/plugin-sdk/memory-core.d.ts",
"dist/plugin-sdk/memory-lancedb.js",
"dist/plugin-sdk/memory-lancedb.d.ts",
"dist/plugin-sdk/minimax-portal-auth.js",
"dist/plugin-sdk/minimax-portal-auth.d.ts",
"dist/plugin-sdk/nextcloud-talk.js",
"dist/plugin-sdk/nextcloud-talk.d.ts",
"dist/plugin-sdk/nostr.js",
"dist/plugin-sdk/nostr.d.ts",
"dist/plugin-sdk/open-prose.js",
"dist/plugin-sdk/open-prose.d.ts",
"dist/plugin-sdk/phone-control.js",
"dist/plugin-sdk/phone-control.d.ts",
"dist/plugin-sdk/qwen-portal-auth.js",
"dist/plugin-sdk/qwen-portal-auth.d.ts",
"dist/plugin-sdk/synology-chat.js",
"dist/plugin-sdk/synology-chat.d.ts",
"dist/plugin-sdk/talk-voice.js",
"dist/plugin-sdk/talk-voice.d.ts",
"dist/plugin-sdk/test-utils.js",
"dist/plugin-sdk/test-utils.d.ts",
"dist/plugin-sdk/thread-ownership.js",
"dist/plugin-sdk/thread-ownership.d.ts",
"dist/plugin-sdk/tlon.js",
"dist/plugin-sdk/tlon.d.ts",
"dist/plugin-sdk/twitch.js",
"dist/plugin-sdk/twitch.d.ts",
"dist/plugin-sdk/voice-call.js",
"dist/plugin-sdk/voice-call.d.ts",
"dist/plugin-sdk/zalo.js",
"dist/plugin-sdk/zalo.d.ts",
"dist/plugin-sdk/zalouser.js",
"dist/plugin-sdk/zalouser.d.ts",
"dist/plugin-sdk/account-id.js",
"dist/plugin-sdk/account-id.d.ts",
"dist/plugin-sdk/keyed-async-queue.js",
"dist/plugin-sdk/keyed-async-queue.d.ts",
"dist/build-info.json", "dist/build-info.json",
]; ];
const forbiddenPrefixes = ["dist/OpenClaw.app/"]; const forbiddenPrefixes = ["dist/OpenClaw.app/"];

View File

@@ -17,7 +17,40 @@ const entrypoints = [
"imessage", "imessage",
"whatsapp", "whatsapp",
"line", "line",
"msteams",
"acpx",
"bluebubbles",
"copilot-proxy",
"device-pair",
"diagnostics-otel",
"diffs",
"feishu",
"google-gemini-cli-auth",
"googlechat",
"irc",
"llm-task",
"lobster",
"matrix",
"mattermost",
"memory-core",
"memory-lancedb",
"minimax-portal-auth",
"nextcloud-talk",
"nostr",
"open-prose",
"phone-control",
"qwen-portal-auth",
"synology-chat",
"talk-voice",
"test-utils",
"thread-ownership",
"tlon",
"twitch",
"voice-call",
"zalo",
"zalouser",
"account-id", "account-id",
"keyed-async-queue",
] as const; ] as const;
for (const entry of entrypoints) { for (const entry of entrypoints) {
const out = path.join(process.cwd(), `dist/plugin-sdk/${entry}.d.ts`); const out = path.join(process.cwd(), `dist/plugin-sdk/${entry}.d.ts`);

34
src/plugin-sdk/acpx.ts Normal file
View File

@@ -0,0 +1,34 @@
// Narrow plugin-sdk surface for the bundled acpx plugin.
// Keep this list additive and scoped to symbols used under extensions/acpx.
export type { AcpRuntimeErrorCode } from "../acp/runtime/errors.js";
export { AcpRuntimeError } from "../acp/runtime/errors.js";
export { registerAcpRuntimeBackend, unregisterAcpRuntimeBackend } from "../acp/runtime/registry.js";
export type {
AcpRuntime,
AcpRuntimeCapabilities,
AcpRuntimeDoctorReport,
AcpRuntimeEnsureInput,
AcpRuntimeEvent,
AcpRuntimeHandle,
AcpRuntimeStatus,
AcpRuntimeTurnInput,
AcpSessionUpdateTag,
} from "../acp/runtime/types.js";
export type {
OpenClawPluginApi,
OpenClawPluginConfigSchema,
OpenClawPluginService,
OpenClawPluginServiceContext,
PluginLogger,
} from "../plugins/types.js";
export type {
WindowsSpawnProgram,
WindowsSpawnProgramCandidate,
WindowsSpawnResolution,
} from "./windows-spawn.js";
export {
applyWindowsSpawnProgramPolicy,
materializeWindowsSpawnProgram,
resolveWindowsSpawnProgramCandidate,
} from "./windows-spawn.js";

View File

@@ -0,0 +1,100 @@
// Narrow plugin-sdk surface for the bundled bluebubbles plugin.
// Keep this list additive and scoped to symbols used under extensions/bluebubbles.
export { resolveAckReaction } from "../agents/identity.js";
export {
createActionGate,
jsonResult,
readNumberParam,
readReactionParams,
readStringParam,
} from "../agents/tools/common.js";
export type { HistoryEntry } from "../auto-reply/reply/history.js";
export {
evictOldHistoryKeys,
recordPendingHistoryEntryIfEnabled,
} from "../auto-reply/reply/history.js";
export { resolveControlCommandGate } from "../channels/command-gating.js";
export { logAckFailure, logInboundDrop, logTypingFailure } from "../channels/logging.js";
export {
BLUEBUBBLES_ACTION_NAMES,
BLUEBUBBLES_ACTIONS,
} from "../channels/plugins/bluebubbles-actions.js";
export {
deleteAccountFromConfigSection,
setAccountEnabledInConfigSection,
} from "../channels/plugins/config-helpers.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export {
resolveBlueBubblesGroupRequireMention,
resolveBlueBubblesGroupToolPolicy,
} from "../channels/plugins/group-mentions.js";
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
export type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
promptAccountId,
} from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export {
applyAccountNameToChannelSection,
migrateBaseNameToDefaultAccount,
} from "../channels/plugins/setup-helpers.js";
export { collectBlueBubblesStatusIssues } from "../channels/plugins/status-issues/bluebubbles.js";
export type {
BaseProbeResult,
ChannelAccountSnapshot,
ChannelMessageActionAdapter,
ChannelMessageActionName,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export type { OpenClawConfig } from "../config/config.js";
export type { DmPolicy, GroupPolicy } from "../config/types.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "../config/types.secrets.js";
export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js";
export { MarkdownConfigSchema } from "../config/zod-schema.core.js";
export type { ParsedChatTarget } from "../imessage/target-parsing-helpers.js";
export {
parseChatAllowTargetPrefixes,
parseChatTargetPrefixesOrThrow,
resolveServicePrefixedAllowTarget,
resolveServicePrefixedTarget,
} from "../imessage/target-parsing-helpers.js";
export { stripMarkdown } from "../line/markdown-to-line.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 {
DM_GROUP_ACCESS_REASON,
readStoreAllowFromForDmPolicy,
resolveDmGroupAccessWithLists,
} from "../security/dm-policy-shared.js";
export { formatDocsLink } from "../terminal/links.js";
export type { WizardPrompter } from "../wizard/prompts.js";
export { isAllowedParsedChatSender } from "./allow-from.js";
export { readBooleanParam } from "./boolean-param.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export { buildProbeChannelStatusSummary } from "./status-helpers.js";
export { extractToolSend } from "./tool-send.js";
export { normalizeWebhookPath } from "./webhook-path.js";
export {
beginWebhookRequestPipelineOrReject,
createWebhookInFlightLimiter,
readWebhookBodyOrReject,
} from "./webhook-request-guards.js";
export {
registerWebhookTargetWithPluginRoute,
resolveWebhookTargets,
resolveWebhookTargetWithAuthOrRejectSync,
} from "./webhook-targets.js";

View File

@@ -0,0 +1,9 @@
// Narrow plugin-sdk surface for the bundled copilot-proxy plugin.
// Keep this list additive and scoped to symbols used under extensions/copilot-proxy.
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export type {
OpenClawPluginApi,
ProviderAuthContext,
ProviderAuthResult,
} from "../plugins/types.js";

View File

@@ -0,0 +1,8 @@
// Narrow plugin-sdk surface for the bundled device-pair plugin.
// Keep this list additive and scoped to symbols used under extensions/device-pair.
export { approveDevicePairing, listDevicePairing } from "../infra/device-pairing.js";
export type { OpenClawPluginApi } from "../plugins/types.js";
export { resolveGatewayBindUrl } from "../shared/gateway-bind-url.js";
export { resolveTailnetHostWithRunner } from "../shared/tailscale-status.js";
export { runPluginCommandWithTimeout } from "./run-command.js";

View File

@@ -0,0 +1,13 @@
// Narrow plugin-sdk surface for the bundled diagnostics-otel plugin.
// Keep this list additive and scoped to symbols used under extensions/diagnostics-otel.
export type { DiagnosticEventPayload } from "../infra/diagnostic-events.js";
export { emitDiagnosticEvent, onDiagnosticEvent } from "../infra/diagnostic-events.js";
export { registerLogTransport } from "../logging/logger.js";
export { redactSensitiveText } from "../logging/redact.js";
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export type {
OpenClawPluginApi,
OpenClawPluginService,
OpenClawPluginServiceContext,
} from "../plugins/types.js";

11
src/plugin-sdk/diffs.ts Normal file
View File

@@ -0,0 +1,11 @@
// Narrow plugin-sdk surface for the bundled diffs plugin.
// Keep this list additive and scoped to symbols used under extensions/diffs.
export type { OpenClawConfig } from "../config/config.js";
export { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
export type {
AnyAgentTool,
OpenClawPluginApi,
OpenClawPluginConfigSchema,
PluginLogger,
} from "../plugins/types.js";

71
src/plugin-sdk/feishu.ts Normal file
View File

@@ -0,0 +1,71 @@
// Narrow plugin-sdk surface for the bundled feishu plugin.
// Keep this list additive and scoped to symbols used under extensions/feishu.
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 "../auto-reply/types.js";
export { logTypingFailure } from "../channels/logging.js";
export type { AllowlistMatch } from "../channels/plugins/allowlist-match.js";
export type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export {
addWildcardAllowFrom,
promptSingleChannelSecretInput,
} from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export type {
BaseProbeResult,
ChannelGroupContext,
ChannelMeta,
ChannelOutboundAdapter,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixContext } from "../channels/reply-prefix.js";
export { createTypingCallbacks } from "../channels/typing.js";
export type { OpenClawConfig as ClawdbotConfig, OpenClawConfig } from "../config/config.js";
export {
resolveAllowlistProviderRuntimeGroupPolicy,
resolveDefaultGroupPolicy,
resolveOpenProviderRuntimeGroupPolicy,
warnMissingProviderGroupPolicyFallbackOnce,
} from "../config/runtime-group-policy.js";
export type { DmPolicy, GroupToolPolicyConfig } from "../config/types.js";
export type { SecretInput } from "../config/types.secrets.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "../config/types.secrets.js";
export { createDedupeCache } from "../infra/dedupe.js";
export { installRequestBodyLimitGuard } from "../infra/http-body.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 { 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 type { WizardPrompter } from "../wizard/prompts.js";
export { buildAgentMediaPayload } from "./agent-media-payload.js";
export { readJsonFileWithFallback } from "./json-store.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export { createPersistentDedupe } from "./persistent-dedupe.js";
export {
buildBaseChannelStatusSummary,
createDefaultChannelRuntimeState,
} from "./status-helpers.js";
export { withTempDownloadPath } from "./temp-path.js";
export {
createFixedWindowRateLimiter,
createWebhookAnomalyTracker,
WEBHOOK_ANOMALY_COUNTER_DEFAULTS,
WEBHOOK_RATE_LIMIT_DEFAULTS,
} from "./webhook-memory-guards.js";
export { applyBasicWebhookRequestGuards } from "./webhook-request-guards.js";

View File

@@ -0,0 +1,8 @@
// Narrow plugin-sdk surface for the bundled google-gemini-cli-auth plugin.
// Keep this list additive and scoped to symbols used under extensions/google-gemini-cli-auth.
export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js";
export { isWSL2Sync } from "../infra/wsl.js";
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export type { OpenClawPluginApi, ProviderAuthContext } from "../plugins/types.js";
export { buildOauthProviderAuthResult } from "./provider-auth-result.js";

View File

@@ -0,0 +1,78 @@
// Narrow plugin-sdk surface for the bundled googlechat plugin.
// Keep this list additive and scoped to symbols used under extensions/googlechat.
export {
createActionGate,
jsonResult,
readNumberParam,
readReactionParams,
readStringParam,
} from "../agents/tools/common.js";
export type { ChannelDock } from "../channels/dock.js";
export { resolveMentionGatingWithBypass } from "../channels/mention-gating.js";
export {
deleteAccountFromConfigSection,
setAccountEnabledInConfigSection,
} from "../channels/plugins/config-helpers.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export { resolveGoogleChatGroupRequireMention } from "../channels/plugins/group-mentions.js";
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
export type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
promptAccountId,
} from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export {
applyAccountNameToChannelSection,
migrateBaseNameToDefaultAccount,
} from "../channels/plugins/setup-helpers.js";
export type {
ChannelAccountSnapshot,
ChannelMessageActionAdapter,
ChannelMessageActionName,
ChannelStatusIssue,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { getChatChannelMeta } from "../channels/registry.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.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 { createScopedPairingAccess } from "./pairing-access.js";
export { extractToolSend } from "./tool-send.js";
export { resolveWebhookPath } from "./webhook-path.js";
export type { WebhookInFlightLimiter } from "./webhook-request-guards.js";
export {
beginWebhookRequestPipelineOrReject,
createWebhookInFlightLimiter,
readJsonWebhookBodyOrReject,
} from "./webhook-request-guards.js";
export {
registerWebhookTargetWithPluginRoute,
resolveWebhookTargets,
resolveWebhookTargetWithAuthOrReject,
} from "./webhook-targets.js";

70
src/plugin-sdk/irc.ts Normal file
View File

@@ -0,0 +1,70 @@
// Narrow plugin-sdk surface for the bundled irc plugin.
// Keep this list additive and scoped to symbols used under extensions/irc.
export { resolveControlCommandGate } from "../channels/command-gating.js";
export { logInboundDrop } from "../channels/logging.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 type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
export { addWildcardAllowFrom, promptAccountId } from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export type { BaseProbeResult } from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { getChatChannelMeta } from "../channels/registry.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.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 {
readStoreAllowFromForDmPolicy,
resolveEffectiveAllowFromLists,
} from "../security/dm-policy-shared.js";
export { formatDocsLink } from "../terminal/links.js";
export type { WizardPrompter } from "../wizard/prompts.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export type { OutboundReplyPayload } from "./reply-payload.js";
export {
createNormalizedOutboundDeliverer,
formatTextWithAttachmentLinks,
resolveOutboundMediaUrls,
} from "./reply-payload.js";
export { createLoggerBackedRuntime } from "./runtime.js";
export { buildBaseAccountStatusSnapshot, buildBaseChannelStatusSummary } from "./status-helpers.js";

View File

@@ -0,0 +1,5 @@
// Narrow plugin-sdk surface for the bundled llm-task plugin.
// Keep this list additive and scoped to symbols used under extensions/llm-task.
export { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
export type { AnyAgentTool, OpenClawPluginApi } from "../plugins/types.js";

14
src/plugin-sdk/lobster.ts Normal file
View File

@@ -0,0 +1,14 @@
// Narrow plugin-sdk surface for the bundled lobster plugin.
// Keep this list additive and scoped to symbols used under extensions/lobster.
export {
applyWindowsSpawnProgramPolicy,
materializeWindowsSpawnProgram,
resolveWindowsSpawnProgramCandidate,
} from "./windows-spawn.js";
export type {
AnyAgentTool,
OpenClawPluginApi,
OpenClawPluginToolContext,
OpenClawPluginToolFactory,
} from "../plugins/types.js";

96
src/plugin-sdk/matrix.ts Normal file
View File

@@ -0,0 +1,96 @@
// Narrow plugin-sdk surface for the bundled matrix plugin.
// Keep this list additive and scoped to symbols used under extensions/matrix.
export {
createActionGate,
jsonResult,
readNumberParam,
readReactionParams,
readStringParam,
} from "../agents/tools/common.js";
export type { ReplyPayload } from "../auto-reply/types.js";
export { resolveAllowlistMatchByCandidates } from "../channels/allowlist-match.js";
export { mergeAllowlist, 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 {
deleteAccountFromConfigSection,
setAccountEnabledInConfigSection,
} from "../channels/plugins/config-helpers.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
export type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
promptSingleChannelSecretInput,
} from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export { applyAccountNameToChannelSection } from "../channels/plugins/setup-helpers.js";
export type {
BaseProbeResult,
ChannelDirectoryEntry,
ChannelGroupContext,
ChannelMessageActionAdapter,
ChannelMessageActionContext,
ChannelMessageActionName,
ChannelOutboundAdapter,
ChannelResolveKind,
ChannelResolveResult,
ChannelToolSend,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export { createTypingCallbacks } from "../channels/typing.js";
export type { OpenClawConfig } from "../config/config.js";
export {
GROUP_POLICY_BLOCKED_LABEL,
resolveAllowlistProviderRuntimeGroupPolicy,
resolveDefaultGroupPolicy,
warnMissingProviderGroupPolicyFallbackOnce,
} from "../config/runtime-group-policy.js";
export type {
DmPolicy,
GroupPolicy,
GroupToolPolicyConfig,
MarkdownTableMode,
} from "../config/types.js";
export type { SecretInput } from "../config/types.secrets.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "../config/types.secrets.js";
export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js";
export { MarkdownConfigSchema } from "../config/zod-schema.core.js";
export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js";
export { issuePairingChallenge } from "../pairing/pairing-challenge.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 { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
export type { RuntimeEnv } from "../runtime.js";
export {
readStoreAllowFromForDmPolicy,
resolveDmGroupAccessWithLists,
} from "../security/dm-policy-shared.js";
export { formatDocsLink } from "../terminal/links.js";
export type { WizardPrompter } from "../wizard/prompts.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export { formatResolvedUnresolvedNote } from "./resolution-notes.js";
export { runPluginCommandWithTimeout } from "./run-command.js";
export { createLoggerBackedRuntime } from "./runtime.js";
export { buildProbeChannelStatusSummary } from "./status-helpers.js";

View File

@@ -0,0 +1,85 @@
// Narrow plugin-sdk surface for the bundled mattermost plugin.
// Keep this list additive and scoped to symbols used under extensions/mattermost.
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 "../auto-reply/types.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 {
deleteAccountFromConfigSection,
setAccountEnabledInConfigSection,
} from "../channels/plugins/config-helpers.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
export type { ChannelOnboardingAdapter } from "../channels/plugins/onboarding-types.js";
export {
promptAccountId,
promptSingleChannelSecretInput,
} from "../channels/plugins/onboarding/helpers.js";
export {
applyAccountNameToChannelSection,
migrateBaseNameToDefaultAccount,
} from "../channels/plugins/setup-helpers.js";
export type {
BaseProbeResult,
ChannelAccountSnapshot,
ChannelGroupContext,
ChannelMessageActionAdapter,
ChannelMessageActionName,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export { createTypingCallbacks } from "../channels/typing.js";
export type { OpenClawConfig } from "../config/config.js";
export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js";
export {
resolveAllowlistProviderRuntimeGroupPolicy,
resolveDefaultGroupPolicy,
warnMissingProviderGroupPolicyFallbackOnce,
} from "../config/runtime-group-policy.js";
export type { BlockStreamingCoalesceConfig, DmPolicy, GroupPolicy } from "../config/types.js";
export type { SecretInput } from "../config/types.secrets.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "../config/types.secrets.js";
export {
BlockStreamingCoalesceSchema,
DmPolicySchema,
GroupPolicySchema,
MarkdownConfigSchema,
requireOpenAllowFrom,
} from "../config/zod-schema.core.js";
export { createDedupeCache } from "../infra/dedupe.js";
export { rawDataToString } from "../infra/ws.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 type { WizardPrompter } from "../wizard/prompts.js";
export { buildAgentMediaPayload } from "./agent-media-payload.js";
export { loadOutboundMediaFromUrl } from "./outbound-media.js";
export { createScopedPairingAccess } from "./pairing-access.js";

View File

@@ -0,0 +1,5 @@
// Narrow plugin-sdk surface for the bundled memory-core plugin.
// Keep this list additive and scoped to symbols used under extensions/memory-core.
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export type { OpenClawPluginApi } from "../plugins/types.js";

View File

@@ -0,0 +1,4 @@
// Narrow plugin-sdk surface for the bundled memory-lancedb plugin.
// Keep this list additive and scoped to symbols used under extensions/memory-lancedb.
export type { OpenClawPluginApi } from "../plugins/types.js";

View File

@@ -0,0 +1,10 @@
// Narrow plugin-sdk surface for the bundled minimax-portal-auth plugin.
// Keep this list additive and scoped to symbols used under extensions/minimax-portal-auth.
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export type {
OpenClawPluginApi,
ProviderAuthContext,
ProviderAuthResult,
} from "../plugins/types.js";
export { generatePkceVerifierChallenge, toFormUrlEncoded } from "./oauth-utils.js";

108
src/plugin-sdk/msteams.ts Normal file
View File

@@ -0,0 +1,108 @@
// Narrow plugin-sdk surface for the bundled msteams plugin.
// Keep this list additive and scoped to symbols used under extensions/msteams.
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 "../auto-reply/types.js";
export { mergeAllowlist, summarizeMapping } from "../channels/allowlists/resolve-utils.js";
export { resolveControlCommandGate } from "../channels/command-gating.js";
export { logInboundDrop, logTypingFailure } from "../channels/logging.js";
export { resolveMentionGating } 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 type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
} from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export type {
BaseProbeResult,
ChannelDirectoryEntry,
ChannelGroupContext,
ChannelMessageActionName,
ChannelOutboundAdapter,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export { createTypingCallbacks } from "../channels/typing.js";
export type { OpenClawConfig } from "../config/config.js";
export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.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 { 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.js";
export { withFileLock } from "./file-lock.js";
export { readJsonFileWithFallback, writeJsonFileAtomically } from "./json-store.js";
export { loadOutboundMediaFromUrl } from "./outbound-media.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export {
buildHostnameAllowlistPolicyFromSuffixAllowlist,
isHttpsUrlAllowedByHostnameSuffixAllowlist,
normalizeHostnameSuffixAllowlist,
} from "./ssrf-policy.js";
export {
buildBaseChannelStatusSummary,
createDefaultChannelRuntimeState,
} from "./status-helpers.js";

View File

@@ -0,0 +1,92 @@
// Narrow plugin-sdk surface for the bundled nextcloud-talk plugin.
// Keep this list additive and scoped to symbols used under extensions/nextcloud-talk.
export { logInboundDrop } from "../channels/logging.js";
export { resolveMentionGatingWithBypass } 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,
setAccountEnabledInConfigSection,
} from "../channels/plugins/config-helpers.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
export type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
promptAccountId,
promptSingleChannelSecretInput,
} from "../channels/plugins/onboarding/helpers.js";
export { applyAccountNameToChannelSection } from "../channels/plugins/setup-helpers.js";
export type { ChannelGroupContext, ChannelSetupInput } from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export type { OpenClawConfig } from "../config/config.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 "../config/types.secrets.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} 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 {
isRequestBodyLimitError,
readRequestBodyWithLimit,
requestBodyErrorToText,
} from "../infra/http-body.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 {
readStoreAllowFromForDmPolicy,
resolveDmGroupAccessWithCommandGate,
} from "../security/dm-policy-shared.js";
export { formatDocsLink } from "../terminal/links.js";
export type { WizardPrompter } from "../wizard/prompts.js";
export {
listConfiguredAccountIds,
resolveAccountWithDefaultFallback,
} from "./account-resolution.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export { createPersistentDedupe } from "./persistent-dedupe.js";
export type { OutboundReplyPayload } from "./reply-payload.js";
export {
createNormalizedOutboundDeliverer,
formatTextWithAttachmentLinks,
resolveOutboundMediaUrls,
} from "./reply-payload.js";
export { createLoggerBackedRuntime } from "./runtime.js";

19
src/plugin-sdk/nostr.ts Normal file
View File

@@ -0,0 +1,19 @@
// Narrow plugin-sdk surface for the bundled nostr plugin.
// Keep this list additive and scoped to symbols used under extensions/nostr.
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.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 {
collectStatusIssuesFromLastError,
createDefaultChannelRuntimeState,
} from "./status-helpers.js";
export { createFixedWindowRateLimiter } from "./webhook-memory-guards.js";

View File

@@ -0,0 +1,4 @@
// Narrow plugin-sdk surface for the bundled open-prose plugin.
// Keep this list additive and scoped to symbols used under extensions/open-prose.
export type { OpenClawPluginApi } from "../plugins/types.js";

View File

@@ -0,0 +1,9 @@
// Narrow plugin-sdk surface for the bundled phone-control plugin.
// Keep this list additive and scoped to symbols used under extensions/phone-control.
export type {
OpenClawPluginApi,
OpenClawPluginCommandDefinition,
OpenClawPluginService,
PluginCommandContext,
} from "../plugins/types.js";

View File

@@ -0,0 +1,6 @@
// Narrow plugin-sdk surface for the bundled qwen-portal-auth plugin.
// Keep this list additive and scoped to symbols used under extensions/qwen-portal-auth.
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export type { OpenClawPluginApi, ProviderAuthContext } from "../plugins/types.js";
export { generatePkceVerifierChallenge, toFormUrlEncoded } from "./oauth-utils.js";

View File

@@ -2,11 +2,52 @@ import * as compatSdk from "openclaw/plugin-sdk/compat";
import * as discordSdk from "openclaw/plugin-sdk/discord"; import * as discordSdk from "openclaw/plugin-sdk/discord";
import * as imessageSdk from "openclaw/plugin-sdk/imessage"; import * as imessageSdk from "openclaw/plugin-sdk/imessage";
import * as lineSdk from "openclaw/plugin-sdk/line"; import * as lineSdk from "openclaw/plugin-sdk/line";
import * as msteamsSdk from "openclaw/plugin-sdk/msteams";
import * as signalSdk from "openclaw/plugin-sdk/signal"; import * as signalSdk from "openclaw/plugin-sdk/signal";
import * as slackSdk from "openclaw/plugin-sdk/slack"; import * as slackSdk from "openclaw/plugin-sdk/slack";
import * as whatsappSdk from "openclaw/plugin-sdk/whatsapp"; import * as whatsappSdk from "openclaw/plugin-sdk/whatsapp";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
const bundledExtensionSubpathLoaders = [
{ id: "acpx", load: () => import("openclaw/plugin-sdk/acpx") },
{ id: "bluebubbles", load: () => import("openclaw/plugin-sdk/bluebubbles") },
{ id: "copilot-proxy", load: () => import("openclaw/plugin-sdk/copilot-proxy") },
{ id: "device-pair", load: () => import("openclaw/plugin-sdk/device-pair") },
{ id: "diagnostics-otel", load: () => import("openclaw/plugin-sdk/diagnostics-otel") },
{ id: "diffs", load: () => import("openclaw/plugin-sdk/diffs") },
{ id: "feishu", load: () => import("openclaw/plugin-sdk/feishu") },
{
id: "google-gemini-cli-auth",
load: () => import("openclaw/plugin-sdk/google-gemini-cli-auth"),
},
{ id: "googlechat", load: () => import("openclaw/plugin-sdk/googlechat") },
{ id: "irc", load: () => import("openclaw/plugin-sdk/irc") },
{ id: "llm-task", load: () => import("openclaw/plugin-sdk/llm-task") },
{ id: "lobster", load: () => import("openclaw/plugin-sdk/lobster") },
{ id: "matrix", load: () => import("openclaw/plugin-sdk/matrix") },
{ id: "mattermost", load: () => import("openclaw/plugin-sdk/mattermost") },
{ id: "memory-core", load: () => import("openclaw/plugin-sdk/memory-core") },
{ id: "memory-lancedb", load: () => import("openclaw/plugin-sdk/memory-lancedb") },
{
id: "minimax-portal-auth",
load: () => import("openclaw/plugin-sdk/minimax-portal-auth"),
},
{ id: "nextcloud-talk", load: () => import("openclaw/plugin-sdk/nextcloud-talk") },
{ id: "nostr", load: () => import("openclaw/plugin-sdk/nostr") },
{ id: "open-prose", load: () => import("openclaw/plugin-sdk/open-prose") },
{ id: "phone-control", load: () => import("openclaw/plugin-sdk/phone-control") },
{ id: "qwen-portal-auth", load: () => import("openclaw/plugin-sdk/qwen-portal-auth") },
{ id: "synology-chat", load: () => import("openclaw/plugin-sdk/synology-chat") },
{ id: "talk-voice", load: () => import("openclaw/plugin-sdk/talk-voice") },
{ id: "test-utils", load: () => import("openclaw/plugin-sdk/test-utils") },
{ id: "thread-ownership", load: () => import("openclaw/plugin-sdk/thread-ownership") },
{ id: "tlon", load: () => import("openclaw/plugin-sdk/tlon") },
{ id: "twitch", load: () => import("openclaw/plugin-sdk/twitch") },
{ id: "voice-call", load: () => import("openclaw/plugin-sdk/voice-call") },
{ id: "zalo", load: () => import("openclaw/plugin-sdk/zalo") },
{ id: "zalouser", load: () => import("openclaw/plugin-sdk/zalouser") },
] as const;
describe("plugin-sdk subpath exports", () => { describe("plugin-sdk subpath exports", () => {
it("exports compat helpers", () => { it("exports compat helpers", () => {
expect(typeof compatSdk.emptyPluginConfigSchema).toBe("function"); expect(typeof compatSdk.emptyPluginConfigSchema).toBe("function");
@@ -42,4 +83,17 @@ describe("plugin-sdk subpath exports", () => {
expect(typeof lineSdk.processLineMessage).toBe("function"); expect(typeof lineSdk.processLineMessage).toBe("function");
expect(typeof lineSdk.createInfoCard).toBe("function"); expect(typeof lineSdk.createInfoCard).toBe("function");
}); });
it("exports Microsoft Teams helpers", () => {
expect(typeof msteamsSdk.resolveControlCommandGate).toBe("function");
expect(typeof msteamsSdk.loadOutboundMediaFromUrl).toBe("function");
});
it("resolves bundled extension subpaths", async () => {
for (const { id, load } of bundledExtensionSubpathLoaders) {
const mod = await load();
expect(typeof mod).toBe("object");
expect(mod, `subpath ${id} should resolve`).toBeTruthy();
}
});
}); });

View File

@@ -0,0 +1,17 @@
// Narrow plugin-sdk surface for the bundled synology-chat plugin.
// Keep this list additive and scoped to symbols used under extensions/synology-chat.
export { setAccountEnabledInConfigSection } from "../channels/plugins/config-helpers.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export {
isRequestBodyLimitError,
readRequestBodyWithLimit,
requestBodyErrorToText,
} from "../infra/http-body.js";
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export { registerPluginHttpRoute } from "../plugins/http-registry.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 { FixedWindowRateLimiter } from "./webhook-memory-guards.js";
export { createFixedWindowRateLimiter } from "./webhook-memory-guards.js";

View File

@@ -0,0 +1,4 @@
// Narrow plugin-sdk surface for the bundled talk-voice plugin.
// Keep this list additive and scoped to symbols used under extensions/talk-voice.
export type { OpenClawPluginApi } from "../plugins/types.js";

View File

@@ -0,0 +1,8 @@
// Narrow plugin-sdk surface for the bundled test-utils plugin.
// Keep this list additive and scoped to symbols used under extensions/test-utils.
export { removeAckReactionAfterReply, shouldAckReaction } from "../channels/ack-reactions.js";
export type { ChannelAccountSnapshot, ChannelGatewayContext } from "../channels/plugins/types.js";
export type { OpenClawConfig } from "../config/config.js";
export type { PluginRuntime } from "../plugins/runtime/types.js";
export type { RuntimeEnv } from "../runtime.js";

View File

@@ -0,0 +1,5 @@
// Narrow plugin-sdk surface for the bundled thread-ownership plugin.
// Keep this list additive and scoped to symbols used under extensions/thread-ownership.
export type { OpenClawConfig } from "../config/config.js";
export type { OpenClawPluginApi } from "../plugins/types.js";

28
src/plugin-sdk/tlon.ts Normal file
View File

@@ -0,0 +1,28 @@
// Narrow plugin-sdk surface for the bundled tlon plugin.
// Keep this list additive and scoped to symbols used under extensions/tlon.
export type { ReplyPayload } from "../auto-reply/types.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export type { ChannelOnboardingAdapter } from "../channels/plugins/onboarding-types.js";
export { promptAccountId } from "../channels/plugins/onboarding/helpers.js";
export { applyAccountNameToChannelSection } from "../channels/plugins/setup-helpers.js";
export type {
ChannelAccountSnapshot,
ChannelOutboundAdapter,
ChannelSetupInput,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.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 { formatDocsLink } from "../terminal/links.js";
export type { WizardPrompter } from "../wizard/prompts.js";
export { createLoggerBackedRuntime } from "./runtime.js";

19
src/plugin-sdk/twitch.ts Normal file
View File

@@ -0,0 +1,19 @@
// Narrow plugin-sdk surface for the bundled twitch plugin.
// Keep this list additive and scoped to symbols used under extensions/twitch.
export type { ReplyPayload } from "../auto-reply/types.js";
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
export type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
export type { BaseProbeResult, ChannelStatusIssue } from "../channels/plugins/types.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export type { OpenClawConfig } from "../config/config.js";
export { MarkdownConfigSchema } 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 { formatDocsLink } from "../terminal/links.js";
export type { WizardPrompter } from "../wizard/prompts.js";

View File

@@ -0,0 +1,18 @@
// Narrow plugin-sdk surface for the bundled voice-call plugin.
// Keep this list additive and scoped to symbols used under extensions/voice-call.
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 { OpenClawPluginApi } from "../plugins/types.js";
export { sleep } from "../utils.js";

View File

@@ -1,5 +1,6 @@
export type { ChannelMessageActionName } from "../channels/plugins/types.js"; export type { ChannelMessageActionName } from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export type { OpenClawConfig } from "../config/config.js";
export type { ResolvedWhatsAppAccount } from "../web/accounts.js"; export type { ResolvedWhatsAppAccount } from "../web/accounts.js";
export type { PluginRuntime } from "../plugins/runtime/types.js"; export type { PluginRuntime } from "../plugins/runtime/types.js";
export type { OpenClawPluginApi } from "../plugins/types.js"; export type { OpenClawPluginApi } from "../plugins/types.js";

94
src/plugin-sdk/zalo.ts Normal file
View File

@@ -0,0 +1,94 @@
// Narrow plugin-sdk surface for the bundled zalo plugin.
// Keep this list additive and scoped to symbols used under extensions/zalo.
export { jsonResult, readStringParam } from "../agents/tools/common.js";
export type { ReplyPayload } from "../auto-reply/types.js";
export type { ChannelDock } from "../channels/dock.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 type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
promptAccountId,
promptSingleChannelSecretInput,
} from "../channels/plugins/onboarding/helpers.js";
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
export {
applyAccountNameToChannelSection,
migrateBaseNameToDefaultAccount,
} from "../channels/plugins/setup-helpers.js";
export type {
BaseProbeResult,
BaseTokenResolution,
ChannelAccountSnapshot,
ChannelMessageActionAdapter,
ChannelMessageActionName,
ChannelStatusIssue,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.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 "../config/types.secrets.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "../config/types.secrets.js";
export { MarkdownConfigSchema } from "../config/zod-schema.core.js";
export { createDedupeCache } from "../infra/dedupe.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 {
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 { createScopedPairingAccess } from "./pairing-access.js";
export type { OutboundReplyPayload } from "./reply-payload.js";
export { resolveOutboundMediaUrls, sendMediaWithLeadingCaption } from "./reply-payload.js";
export { buildTokenChannelStatusSummary } from "./status-helpers.js";
export { chunkTextForOutbound } from "./text-chunking.js";
export { extractToolSend } from "./tool-send.js";
export {
createFixedWindowRateLimiter,
createWebhookAnomalyTracker,
WEBHOOK_ANOMALY_COUNTER_DEFAULTS,
WEBHOOK_RATE_LIMIT_DEFAULTS,
} from "./webhook-memory-guards.js";
export { resolveWebhookPath } from "./webhook-path.js";
export {
applyBasicWebhookRequestGuards,
readJsonWebhookBodyOrReject,
} from "./webhook-request-guards.js";
export type {
RegisterWebhookPluginRouteOptions,
RegisterWebhookTargetOptions,
} from "./webhook-targets.js";
export {
registerWebhookTarget,
registerWebhookTargetWithPluginRoute,
resolveSingleWebhookTarget,
resolveWebhookTargets,
} from "./webhook-targets.js";

View File

@@ -0,0 +1,63 @@
// Narrow plugin-sdk surface for the bundled zalouser plugin.
// Keep this list additive and scoped to symbols used under extensions/zalouser.
export type { ReplyPayload } from "../auto-reply/types.js";
export { mergeAllowlist, summarizeMapping } from "../channels/allowlists/resolve-utils.js";
export type { ChannelDock } from "../channels/dock.js";
export { resolveMentionGatingWithBypass } 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 type {
ChannelOnboardingAdapter,
ChannelOnboardingDmPolicy,
} from "../channels/plugins/onboarding-types.js";
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
export {
addWildcardAllowFrom,
mergeAllowFromEntries,
promptAccountId,
} from "../channels/plugins/onboarding/helpers.js";
export {
applyAccountNameToChannelSection,
migrateBaseNameToDefaultAccount,
} from "../channels/plugins/setup-helpers.js";
export type {
BaseProbeResult,
ChannelAccountSnapshot,
ChannelDirectoryEntry,
ChannelGroupContext,
ChannelMessageActionAdapter,
ChannelStatusIssue,
} from "../channels/plugins/types.js";
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
export { createTypingCallbacks } from "../channels/typing.js";
export type { OpenClawConfig } from "../config/config.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 } 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 { loadOutboundMediaFromUrl } from "./outbound-media.js";
export { createScopedPairingAccess } from "./pairing-access.js";
export type { OutboundReplyPayload } from "./reply-payload.js";
export { resolveOutboundMediaUrls, sendMediaWithLeadingCaption } from "./reply-payload.js";
export { formatResolvedUnresolvedNote } from "./resolution-notes.js";
export { chunkTextForOutbound } from "./text-chunking.js";

View File

@@ -88,44 +88,108 @@ const resolvePluginSdkAliasFile = (params: {
const resolvePluginSdkAlias = (): string | null => const resolvePluginSdkAlias = (): string | null =>
resolvePluginSdkAliasFile({ srcFile: "root-alias.cjs", distFile: "root-alias.cjs" }); resolvePluginSdkAliasFile({ srcFile: "root-alias.cjs", distFile: "root-alias.cjs" });
const resolvePluginSdkAccountIdAlias = (): string | null => { const pluginSdkScopedAliasEntries = [
return resolvePluginSdkAliasFile({ srcFile: "account-id.ts", distFile: "account-id.js" }); { subpath: "core", srcFile: "core.ts", distFile: "core.js" },
}; { subpath: "compat", srcFile: "compat.ts", distFile: "compat.js" },
{ subpath: "telegram", srcFile: "telegram.ts", distFile: "telegram.js" },
{ subpath: "discord", srcFile: "discord.ts", distFile: "discord.js" },
{ subpath: "slack", srcFile: "slack.ts", distFile: "slack.js" },
{ subpath: "signal", srcFile: "signal.ts", distFile: "signal.js" },
{ subpath: "imessage", srcFile: "imessage.ts", distFile: "imessage.js" },
{ subpath: "whatsapp", srcFile: "whatsapp.ts", distFile: "whatsapp.js" },
{ subpath: "line", srcFile: "line.ts", distFile: "line.js" },
{ subpath: "msteams", srcFile: "msteams.ts", distFile: "msteams.js" },
{ subpath: "acpx", srcFile: "acpx.ts", distFile: "acpx.js" },
{ subpath: "bluebubbles", srcFile: "bluebubbles.ts", distFile: "bluebubbles.js" },
{
subpath: "copilot-proxy",
srcFile: "copilot-proxy.ts",
distFile: "copilot-proxy.js",
},
{ subpath: "device-pair", srcFile: "device-pair.ts", distFile: "device-pair.js" },
{
subpath: "diagnostics-otel",
srcFile: "diagnostics-otel.ts",
distFile: "diagnostics-otel.js",
},
{ subpath: "diffs", srcFile: "diffs.ts", distFile: "diffs.js" },
{ subpath: "feishu", srcFile: "feishu.ts", distFile: "feishu.js" },
{
subpath: "google-gemini-cli-auth",
srcFile: "google-gemini-cli-auth.ts",
distFile: "google-gemini-cli-auth.js",
},
{ subpath: "googlechat", srcFile: "googlechat.ts", distFile: "googlechat.js" },
{ subpath: "irc", srcFile: "irc.ts", distFile: "irc.js" },
{ subpath: "llm-task", srcFile: "llm-task.ts", distFile: "llm-task.js" },
{ subpath: "lobster", srcFile: "lobster.ts", distFile: "lobster.js" },
{ subpath: "matrix", srcFile: "matrix.ts", distFile: "matrix.js" },
{ subpath: "mattermost", srcFile: "mattermost.ts", distFile: "mattermost.js" },
{ subpath: "memory-core", srcFile: "memory-core.ts", distFile: "memory-core.js" },
{
subpath: "memory-lancedb",
srcFile: "memory-lancedb.ts",
distFile: "memory-lancedb.js",
},
{
subpath: "minimax-portal-auth",
srcFile: "minimax-portal-auth.ts",
distFile: "minimax-portal-auth.js",
},
{
subpath: "nextcloud-talk",
srcFile: "nextcloud-talk.ts",
distFile: "nextcloud-talk.js",
},
{ subpath: "nostr", srcFile: "nostr.ts", distFile: "nostr.js" },
{ subpath: "open-prose", srcFile: "open-prose.ts", distFile: "open-prose.js" },
{
subpath: "phone-control",
srcFile: "phone-control.ts",
distFile: "phone-control.js",
},
{
subpath: "qwen-portal-auth",
srcFile: "qwen-portal-auth.ts",
distFile: "qwen-portal-auth.js",
},
{
subpath: "synology-chat",
srcFile: "synology-chat.ts",
distFile: "synology-chat.js",
},
{ subpath: "talk-voice", srcFile: "talk-voice.ts", distFile: "talk-voice.js" },
{ subpath: "test-utils", srcFile: "test-utils.ts", distFile: "test-utils.js" },
{
subpath: "thread-ownership",
srcFile: "thread-ownership.ts",
distFile: "thread-ownership.js",
},
{ subpath: "tlon", srcFile: "tlon.ts", distFile: "tlon.js" },
{ subpath: "twitch", srcFile: "twitch.ts", distFile: "twitch.js" },
{ subpath: "voice-call", srcFile: "voice-call.ts", distFile: "voice-call.js" },
{ subpath: "zalo", srcFile: "zalo.ts", distFile: "zalo.js" },
{ subpath: "zalouser", srcFile: "zalouser.ts", distFile: "zalouser.js" },
{ subpath: "account-id", srcFile: "account-id.ts", distFile: "account-id.js" },
{
subpath: "keyed-async-queue",
srcFile: "keyed-async-queue.ts",
distFile: "keyed-async-queue.js",
},
] as const;
const resolvePluginSdkCoreAlias = (): string | null => { const resolvePluginSdkScopedAliasMap = (): Record<string, string> => {
return resolvePluginSdkAliasFile({ srcFile: "core.ts", distFile: "core.js" }); const aliasMap: Record<string, string> = {};
}; for (const entry of pluginSdkScopedAliasEntries) {
const resolved = resolvePluginSdkAliasFile({
const resolvePluginSdkCompatAlias = (): string | null => { srcFile: entry.srcFile,
return resolvePluginSdkAliasFile({ srcFile: "compat.ts", distFile: "compat.js" }); distFile: entry.distFile,
}; });
if (resolved) {
const resolvePluginSdkTelegramAlias = (): string | null => { aliasMap[`openclaw/plugin-sdk/${entry.subpath}`] = resolved;
return resolvePluginSdkAliasFile({ srcFile: "telegram.ts", distFile: "telegram.js" }); }
}; }
return aliasMap;
const resolvePluginSdkDiscordAlias = (): string | null => {
return resolvePluginSdkAliasFile({ srcFile: "discord.ts", distFile: "discord.js" });
};
const resolvePluginSdkSlackAlias = (): string | null => {
return resolvePluginSdkAliasFile({ srcFile: "slack.ts", distFile: "slack.js" });
};
const resolvePluginSdkSignalAlias = (): string | null => {
return resolvePluginSdkAliasFile({ srcFile: "signal.ts", distFile: "signal.js" });
};
const resolvePluginSdkIMessageAlias = (): string | null => {
return resolvePluginSdkAliasFile({ srcFile: "imessage.ts", distFile: "imessage.js" });
};
const resolvePluginSdkWhatsAppAlias = (): string | null => {
return resolvePluginSdkAliasFile({ srcFile: "whatsapp.ts", distFile: "whatsapp.js" });
};
const resolvePluginSdkLineAlias = (): string | null => {
return resolvePluginSdkAliasFile({ srcFile: "line.ts", distFile: "line.js" });
}; };
export const __testing = { export const __testing = {
@@ -504,30 +568,9 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
return jitiLoader; return jitiLoader;
} }
const pluginSdkAlias = resolvePluginSdkAlias(); const pluginSdkAlias = resolvePluginSdkAlias();
const pluginSdkAccountIdAlias = resolvePluginSdkAccountIdAlias();
const pluginSdkCoreAlias = resolvePluginSdkCoreAlias();
const pluginSdkCompatAlias = resolvePluginSdkCompatAlias();
const pluginSdkTelegramAlias = resolvePluginSdkTelegramAlias();
const pluginSdkDiscordAlias = resolvePluginSdkDiscordAlias();
const pluginSdkSlackAlias = resolvePluginSdkSlackAlias();
const pluginSdkSignalAlias = resolvePluginSdkSignalAlias();
const pluginSdkIMessageAlias = resolvePluginSdkIMessageAlias();
const pluginSdkWhatsAppAlias = resolvePluginSdkWhatsAppAlias();
const pluginSdkLineAlias = resolvePluginSdkLineAlias();
const aliasMap = { const aliasMap = {
...(pluginSdkAlias ? { "openclaw/plugin-sdk": pluginSdkAlias } : {}), ...(pluginSdkAlias ? { "openclaw/plugin-sdk": pluginSdkAlias } : {}),
...(pluginSdkCoreAlias ? { "openclaw/plugin-sdk/core": pluginSdkCoreAlias } : {}), ...resolvePluginSdkScopedAliasMap(),
...(pluginSdkCompatAlias ? { "openclaw/plugin-sdk/compat": pluginSdkCompatAlias } : {}),
...(pluginSdkTelegramAlias ? { "openclaw/plugin-sdk/telegram": pluginSdkTelegramAlias } : {}),
...(pluginSdkDiscordAlias ? { "openclaw/plugin-sdk/discord": pluginSdkDiscordAlias } : {}),
...(pluginSdkSlackAlias ? { "openclaw/plugin-sdk/slack": pluginSdkSlackAlias } : {}),
...(pluginSdkSignalAlias ? { "openclaw/plugin-sdk/signal": pluginSdkSignalAlias } : {}),
...(pluginSdkIMessageAlias ? { "openclaw/plugin-sdk/imessage": pluginSdkIMessageAlias } : {}),
...(pluginSdkWhatsAppAlias ? { "openclaw/plugin-sdk/whatsapp": pluginSdkWhatsAppAlias } : {}),
...(pluginSdkLineAlias ? { "openclaw/plugin-sdk/line": pluginSdkLineAlias } : {}),
...(pluginSdkAccountIdAlias
? { "openclaw/plugin-sdk/account-id": pluginSdkAccountIdAlias }
: {}),
}; };
jitiLoader = createJiti(import.meta.url, { jitiLoader = createJiti(import.meta.url, {
interopDefault: true, interopDefault: true,

View File

@@ -21,8 +21,40 @@
"src/plugin-sdk/imessage.ts", "src/plugin-sdk/imessage.ts",
"src/plugin-sdk/whatsapp.ts", "src/plugin-sdk/whatsapp.ts",
"src/plugin-sdk/line.ts", "src/plugin-sdk/line.ts",
"src/plugin-sdk/msteams.ts",
"src/plugin-sdk/account-id.ts", "src/plugin-sdk/account-id.ts",
"src/plugin-sdk/keyed-async-queue.ts", "src/plugin-sdk/keyed-async-queue.ts",
"src/plugin-sdk/acpx.ts",
"src/plugin-sdk/bluebubbles.ts",
"src/plugin-sdk/copilot-proxy.ts",
"src/plugin-sdk/device-pair.ts",
"src/plugin-sdk/diagnostics-otel.ts",
"src/plugin-sdk/diffs.ts",
"src/plugin-sdk/feishu.ts",
"src/plugin-sdk/google-gemini-cli-auth.ts",
"src/plugin-sdk/googlechat.ts",
"src/plugin-sdk/irc.ts",
"src/plugin-sdk/llm-task.ts",
"src/plugin-sdk/lobster.ts",
"src/plugin-sdk/matrix.ts",
"src/plugin-sdk/mattermost.ts",
"src/plugin-sdk/memory-core.ts",
"src/plugin-sdk/memory-lancedb.ts",
"src/plugin-sdk/minimax-portal-auth.ts",
"src/plugin-sdk/nextcloud-talk.ts",
"src/plugin-sdk/nostr.ts",
"src/plugin-sdk/open-prose.ts",
"src/plugin-sdk/phone-control.ts",
"src/plugin-sdk/qwen-portal-auth.ts",
"src/plugin-sdk/synology-chat.ts",
"src/plugin-sdk/talk-voice.ts",
"src/plugin-sdk/test-utils.ts",
"src/plugin-sdk/thread-ownership.ts",
"src/plugin-sdk/tlon.ts",
"src/plugin-sdk/twitch.ts",
"src/plugin-sdk/voice-call.ts",
"src/plugin-sdk/zalo.ts",
"src/plugin-sdk/zalouser.ts",
"src/types/**/*.d.ts" "src/types/**/*.d.ts"
], ],
"exclude": ["node_modules", "dist", "src/**/*.test.ts"] "exclude": ["node_modules", "dist", "src/**/*.test.ts"]

View File

@@ -4,6 +4,53 @@ const env = {
NODE_ENV: "production", NODE_ENV: "production",
}; };
const pluginSdkEntrypoints = [
"index",
"core",
"compat",
"telegram",
"discord",
"slack",
"signal",
"imessage",
"whatsapp",
"line",
"msteams",
"acpx",
"bluebubbles",
"copilot-proxy",
"device-pair",
"diagnostics-otel",
"diffs",
"feishu",
"google-gemini-cli-auth",
"googlechat",
"irc",
"llm-task",
"lobster",
"matrix",
"mattermost",
"memory-core",
"memory-lancedb",
"minimax-portal-auth",
"nextcloud-talk",
"nostr",
"open-prose",
"phone-control",
"qwen-portal-auth",
"synology-chat",
"talk-voice",
"test-utils",
"thread-ownership",
"tlon",
"twitch",
"voice-call",
"zalo",
"zalouser",
"account-id",
"keyed-async-queue",
] as const;
export default defineConfig([ export default defineConfig([
{ {
entry: "src/index.ts", entry: "src/index.ts",
@@ -48,83 +95,13 @@ export default defineConfig([
fixedExtension: false, fixedExtension: false,
platform: "node", platform: "node",
}, },
{ ...pluginSdkEntrypoints.map((entry) => ({
entry: "src/plugin-sdk/index.ts", entry: `src/plugin-sdk/${entry}.ts`,
outDir: "dist/plugin-sdk", outDir: "dist/plugin-sdk",
env, env,
fixedExtension: false, fixedExtension: false,
platform: "node", platform: "node" as const,
}, })),
{
entry: "src/plugin-sdk/core.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/compat.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/telegram.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/discord.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/slack.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/signal.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/imessage.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/whatsapp.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/line.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{
entry: "src/plugin-sdk/account-id.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},
{ {
entry: "src/extensionAPI.ts", entry: "src/extensionAPI.ts",
env, env,

View File

@@ -8,55 +8,60 @@ const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
const isWindows = process.platform === "win32"; const isWindows = process.platform === "win32";
const localWorkers = Math.max(4, Math.min(16, os.cpus().length)); const localWorkers = Math.max(4, Math.min(16, os.cpus().length));
const ciWorkers = isWindows ? 2 : 3; const ciWorkers = isWindows ? 2 : 3;
const pluginSdkSubpaths = [
"account-id",
"core",
"compat",
"telegram",
"discord",
"slack",
"signal",
"imessage",
"whatsapp",
"line",
"msteams",
"acpx",
"bluebubbles",
"copilot-proxy",
"device-pair",
"diagnostics-otel",
"diffs",
"feishu",
"google-gemini-cli-auth",
"googlechat",
"irc",
"llm-task",
"lobster",
"matrix",
"mattermost",
"memory-core",
"memory-lancedb",
"minimax-portal-auth",
"nextcloud-talk",
"nostr",
"open-prose",
"phone-control",
"qwen-portal-auth",
"synology-chat",
"talk-voice",
"test-utils",
"thread-ownership",
"tlon",
"twitch",
"voice-call",
"zalo",
"zalouser",
"keyed-async-queue",
] as const;
export default defineConfig({ export default defineConfig({
resolve: { resolve: {
// Keep this ordered: the base `openclaw/plugin-sdk` alias is a prefix match. // Keep this ordered: the base `openclaw/plugin-sdk` alias is a prefix match.
alias: [ alias: [
{ ...pluginSdkSubpaths.map((subpath) => ({
find: "openclaw/plugin-sdk/account-id", find: `openclaw/plugin-sdk/${subpath}`,
replacement: path.join(repoRoot, "src", "plugin-sdk", "account-id.ts"), replacement: path.join(repoRoot, "src", "plugin-sdk", `${subpath}.ts`),
}, })),
{
find: "openclaw/plugin-sdk/core",
replacement: path.join(repoRoot, "src", "plugin-sdk", "core.ts"),
},
{
find: "openclaw/plugin-sdk/compat",
replacement: path.join(repoRoot, "src", "plugin-sdk", "compat.ts"),
},
{
find: "openclaw/plugin-sdk/telegram",
replacement: path.join(repoRoot, "src", "plugin-sdk", "telegram.ts"),
},
{
find: "openclaw/plugin-sdk/discord",
replacement: path.join(repoRoot, "src", "plugin-sdk", "discord.ts"),
},
{
find: "openclaw/plugin-sdk/slack",
replacement: path.join(repoRoot, "src", "plugin-sdk", "slack.ts"),
},
{
find: "openclaw/plugin-sdk/signal",
replacement: path.join(repoRoot, "src", "plugin-sdk", "signal.ts"),
},
{
find: "openclaw/plugin-sdk/imessage",
replacement: path.join(repoRoot, "src", "plugin-sdk", "imessage.ts"),
},
{
find: "openclaw/plugin-sdk/whatsapp",
replacement: path.join(repoRoot, "src", "plugin-sdk", "whatsapp.ts"),
},
{
find: "openclaw/plugin-sdk/line",
replacement: path.join(repoRoot, "src", "plugin-sdk", "line.ts"),
},
{
find: "openclaw/plugin-sdk/keyed-async-queue",
replacement: path.join(repoRoot, "src", "plugin-sdk", "keyed-async-queue.ts"),
},
{ {
find: "openclaw/plugin-sdk", find: "openclaw/plugin-sdk",
replacement: path.join(repoRoot, "src", "plugin-sdk", "index.ts"), replacement: path.join(repoRoot, "src", "plugin-sdk", "index.ts"),