refactor: shrink plugin sdk public surface

This commit is contained in:
Peter Steinberger
2026-03-18 23:30:25 +00:00
parent 6e044ace28
commit 46f49eb6eb
144 changed files with 254 additions and 867 deletions

View File

@@ -923,10 +923,8 @@ Notes:
Use SDK subpaths instead of the monolithic `openclaw/plugin-sdk` import when
authoring plugins:
- `openclaw/plugin-sdk/core` for the smallest generic plugin-facing contract.
It also carries small assembly helpers such as
`definePluginEntry`, `defineChannelPluginEntry`, `defineSetupPluginEntry`,
and `createChannelPluginBase` for bundled or third-party plugin entry wiring.
- `openclaw/plugin-sdk/plugin-entry` for plugin registration primitives.
- `openclaw/plugin-sdk/core` for the generic shared plugin-facing contract.
- Domain subpaths such as `openclaw/plugin-sdk/channel-config-helpers`,
`openclaw/plugin-sdk/channel-config-schema`,
`openclaw/plugin-sdk/channel-policy`,
@@ -939,12 +937,9 @@ authoring plugins:
`openclaw/plugin-sdk/runtime-store`, and
`openclaw/plugin-sdk/directory-runtime` for shared runtime/config helpers.
- Narrow channel-core subpaths such as `openclaw/plugin-sdk/discord-core`,
`openclaw/plugin-sdk/telegram-core`, `openclaw/plugin-sdk/whatsapp-core`,
and `openclaw/plugin-sdk/line-core` for channel-specific primitives that
should stay smaller than the full channel helper barrels.
- `openclaw/plugin-sdk/compat` remains as a legacy migration surface for older
external plugins. Bundled plugins should not use it, and non-test imports emit
a one-time deprecation warning outside test environments.
`openclaw/plugin-sdk/telegram-core`, and `openclaw/plugin-sdk/whatsapp-core`
for channel-specific primitives that should stay smaller than the full
channel helper barrels.
- Bundled extension internals remain private. External plugins should use only
`openclaw/plugin-sdk/*` subpaths. OpenClaw core/test code may use the repo
public entry points under `extensions/<id>/index.js`, `api.js`, `runtime-api.js`,
@@ -958,31 +953,18 @@ authoring plugins:
- `openclaw/plugin-sdk/telegram` for Telegram channel plugin types and shared channel-facing helpers. Built-in Telegram implementation internals stay private to the bundled extension.
- `openclaw/plugin-sdk/discord` for Discord channel plugin types and shared channel-facing helpers. Built-in Discord implementation internals stay private to the bundled extension.
- `openclaw/plugin-sdk/slack` for Slack channel plugin types and shared channel-facing helpers. Built-in Slack implementation internals stay private to the bundled extension.
- `openclaw/plugin-sdk/signal` for Signal channel plugin types and shared channel-facing helpers. Built-in Signal implementation internals stay private to the bundled extension.
- `openclaw/plugin-sdk/imessage` for iMessage channel plugin types and shared channel-facing helpers. Built-in iMessage implementation internals stay private to the bundled extension.
- `openclaw/plugin-sdk/whatsapp` for WhatsApp channel plugin types and shared channel-facing helpers. Built-in WhatsApp implementation internals stay private to the bundled extension.
- `openclaw/plugin-sdk/line` for LINE channel plugins.
- `openclaw/plugin-sdk/msteams` for the bundled Microsoft Teams plugin surface.
- Additional bundled extension-specific subpaths remain available where OpenClaw
intentionally exposes extension-facing helpers:
`openclaw/plugin-sdk/acpx`, `openclaw/plugin-sdk/bluebubbles`,
`openclaw/plugin-sdk/feishu`, `openclaw/plugin-sdk/googlechat`,
`openclaw/plugin-sdk/irc`, `openclaw/plugin-sdk/lobster`,
`openclaw/plugin-sdk/matrix`,
`openclaw/plugin-sdk/mattermost`, `openclaw/plugin-sdk/memory-core`,
`openclaw/plugin-sdk/minimax-portal-auth`,
`openclaw/plugin-sdk/nextcloud-talk`, `openclaw/plugin-sdk/nostr`,
`openclaw/plugin-sdk/synology-chat`, `openclaw/plugin-sdk/test-utils`,
`openclaw/plugin-sdk/tlon`, `openclaw/plugin-sdk/twitch`,
`openclaw/plugin-sdk/voice-call`,
`openclaw/plugin-sdk/zalo`, and `openclaw/plugin-sdk/zalouser`.
- `openclaw/plugin-sdk/bluebubbles` remains public because it carries a small
focused helper surface that is shared intentionally.
Compatibility note:
- `openclaw/plugin-sdk` remains supported for existing external plugins.
- New and migrated bundled plugins should use channel or extension-specific
subpaths; use `core` plus explicit domain subpaths for generic surfaces, and
treat `compat` as migration-only.
- Avoid the root `openclaw/plugin-sdk` barrel for new code.
- Bundled extension-specific helper barrels are not stable by default. If a
helper is only needed by a bundled extension, keep it behind the extension's
local `api.js` or `runtime-api.js` seam instead of promoting it into
`openclaw/plugin-sdk/<extension>`.
- Capability-specific subpaths such as `image-generation`,
`media-understanding`, and `speech` exist because bundled/native plugins use
them today. Their presence does not by itself mean every exported helper is a

View File

@@ -89,7 +89,7 @@ For provider plugins, use `definePluginEntry` instead.
## Step 3: Import from focused subpaths
The plugin SDK exposes 70+ focused subpaths. Always import from specific
The plugin SDK exposes many focused subpaths. Always import from specific
subpaths rather than the monolithic root:
```typescript

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/acpx";
export * from "../../src/plugin-sdk/acpx.js";

View File

@@ -1,4 +1,3 @@
import type { AcpRuntime, OpenClawPluginServiceContext } from "openclaw/plugin-sdk/acpx";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { AcpRuntimeError } from "../../../src/acp/runtime/errors.js";
import {
@@ -6,6 +5,7 @@ import {
getAcpRuntimeBackend,
requireAcpRuntimeBackend,
} from "../../../src/acp/runtime/registry.js";
import type { AcpRuntime, OpenClawPluginServiceContext } from "../runtime-api.js";
import { ACPX_BUNDLED_BIN, ACPX_PINNED_VERSION } from "./config.js";
import { createAcpxRuntimeService } from "./service.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/copilot-proxy";
export * from "../../src/plugin-sdk/copilot-proxy.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/device-pair";
export * from "../../src/plugin-sdk/device-pair.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/diagnostics-otel";
export * from "../../src/plugin-sdk/diagnostics-otel.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/diffs";
export * from "../../src/plugin-sdk/diffs.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/feishu";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawPluginApi } from "./runtime-api.js";
const registerFeishuDocToolsMock = vi.hoisted(() => vi.fn());
const registerFeishuChatToolsMock = vi.hoisted(() => vi.fn());

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/feishu";
export * from "../../src/plugin-sdk/feishu.js";

View File

@@ -1,6 +1,6 @@
import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createPluginRuntimeMock } from "../../../test/helpers/extensions/plugin-runtime-mock.js";
import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "../runtime-api.js";
import type { FeishuMessageEvent } from "./bot.js";
import {
buildBroadcastSessionKey,

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
const probeFeishuMock = vi.hoisted(() => vi.fn());
const createFeishuClientMock = vi.hoisted(() => vi.fn());

View File

@@ -1,5 +1,5 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import { describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../runtime-api.js";
const resolveFeishuAccountMock = vi.hoisted(() => vi.fn());
const createFeishuClientMock = vi.hoisted(() => vi.fn());

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/feishu";
import { describe, expect, test, vi } from "vitest";
import type { OpenClawPluginApi } from "../runtime-api.js";
import { registerFeishuDocTools } from "./docx.js";
import { createToolFactoryHarness } from "./tool-factory-test-harness.js";

View File

@@ -1,4 +1,3 @@
import type { ClawdbotConfig, RuntimeEnv } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { hasControlCommand } from "../../../src/auto-reply/command-detection.js";
import {
@@ -6,6 +5,7 @@ import {
resolveInboundDebounceMs,
} from "../../../src/auto-reply/inbound-debounce.js";
import { createPluginRuntimeMock } from "../../../test/helpers/extensions/plugin-runtime-mock.js";
import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
import { monitorSingleAccount } from "./monitor.account.js";
import { setFeishuRuntime } from "./runtime.js";
import type { ResolvedFeishuAccount } from "./types.js";

View File

@@ -1,5 +1,5 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import { describe, expect, it } from "vitest";
import type { ClawdbotConfig } from "../runtime-api.js";
import {
resolveReactionSyntheticEvent,
type FeishuReactionCreatedEvent,

View File

@@ -1,4 +1,3 @@
import type { ClawdbotConfig, RuntimeEnv } from "openclaw/plugin-sdk/feishu";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { hasControlCommand } from "../../../src/auto-reply/command-detection.js";
import {
@@ -6,6 +5,7 @@ import {
resolveInboundDebounceMs,
} from "../../../src/auto-reply/inbound-debounce.js";
import { createPluginRuntimeMock } from "../../../test/helpers/extensions/plugin-runtime-mock.js";
import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
import { parseFeishuMessageEvent, type FeishuMessageEvent } from "./bot.js";
import * as dedup from "./dedup.js";
import { monitorSingleAccount } from "./monitor.account.js";

View File

@@ -1,5 +1,5 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import { afterEach, describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../runtime-api.js";
import { monitorFeishuProvider, stopFeishuMonitor } from "./monitor.js";
const probeFeishuMock = vi.hoisted(() => vi.fn());

View File

@@ -1,5 +1,5 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../runtime-api.js";
import { resolveFeishuSendTarget } from "./send-target.js";
const resolveFeishuAccountMock = vi.hoisted(() => vi.fn());

View File

@@ -1,5 +1,5 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../runtime-api.js";
import {
buildStructuredCard,
editMessageFeishu,

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/feishu";
import { describe, expect, it } from "vitest";
import { buildChannelSetupWizardAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
import type { OpenClawConfig } from "../runtime-api.js";
import { feishuPlugin } from "./channel.js";
const feishuConfigureAdapter = buildChannelSetupWizardAdapterFromSetupWizard({

View File

@@ -1,9 +1,9 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, it, vi } from "vitest";
import {
getRequiredHookHandler,
registerHookHandlersForTest,
} from "../../../test/helpers/extensions/subagent-hooks.js";
import type { OpenClawPluginApi } from "../runtime-api.js";
import { registerFeishuSubagentHooks } from "./subagent-hooks.js";
import {
__testing as threadBindingTesting,

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/feishu";
import { beforeEach, describe, expect, test, vi } from "vitest";
import type { OpenClawPluginApi } from "../runtime-api.js";
import { registerFeishuBitableTools } from "./bitable.js";
import { registerFeishuDriveTools } from "./drive.js";
import { registerFeishuPermTools } from "./perm.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/google";
export * from "../../src/plugin-sdk/google.js";

View File

@@ -1,4 +1,4 @@
// Private runtime barrel for the bundled Google Chat extension.
// Keep this barrel thin and aligned with the curated plugin-sdk/googlechat surface.
export * from "openclaw/plugin-sdk/googlechat";
export * from "../../src/plugin-sdk/googlechat.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { resolveGoogleChatAccount } from "./accounts.js";
describe("resolveGoogleChatAccount", () => {

View File

@@ -1,9 +1,9 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import { describe, expect, it } from "vitest";
import {
createDirectoryTestRuntime,
expectDirectorySurface,
} from "../../../test/helpers/extensions/directory.ts";
import type { OpenClawConfig } from "../runtime-api.js";
import { googlechatPlugin } from "./channel.js";
describe("googlechat directory", () => {

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/googlechat";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig, PluginRuntime } from "../runtime-api.js";
const uploadGoogleChatAttachmentMock = vi.hoisted(() => vi.fn());
const sendGoogleChatMessageMock = vi.hoisted(() => vi.fn());

View File

@@ -1,10 +1,10 @@
import type { ChannelAccountSnapshot } from "openclaw/plugin-sdk/googlechat";
import { afterEach, describe, expect, it, vi } from "vitest";
import {
abortStartedAccount,
expectPendingUntilAbort,
startAccountAndTrackLifecycle,
} from "../../../test/helpers/extensions/start-account-lifecycle.js";
import type { ChannelAccountSnapshot } from "../runtime-api.js";
import type { ResolvedGoogleChatAccount } from "./accounts.js";
const hoisted = vi.hoisted(() => ({

View File

@@ -1,10 +1,10 @@
import { EventEmitter } from "node:events";
import type { IncomingMessage } from "node:http";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/googlechat";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createEmptyPluginRegistry } from "../../../src/plugins/registry.js";
import { setActivePluginRegistry } from "../../../src/plugins/runtime.js";
import { createMockServerResponse } from "../../../test/helpers/extensions/mock-http-response.js";
import type { OpenClawConfig, PluginRuntime } from "../runtime-api.js";
import type { ResolvedGoogleChatAccount } from "./accounts.js";
import { verifyGoogleChatRequest } from "./auth.js";
import { handleGoogleChatWebhookRequest, registerGoogleChatWebhookTarget } from "./monitor.js";

View File

@@ -6,7 +6,7 @@ const runtimeMocks = vi.hoisted(() => ({
fetchRemoteMedia: vi.fn(),
}));
vi.mock("openclaw/plugin-sdk/googlechat", () => ({
vi.mock("../runtime-api.js", () => ({
getChatChannelMeta: () => ({ id: "googlechat", label: "Google Chat" }),
missingTargetError: (provider: string, hint: string) =>
new Error(`Delivering to ${provider} requires target ${hint}`),
@@ -76,7 +76,7 @@ vi.mock("./targets.js", () => ({
resolveGoogleChatOutboundSpace: vi.fn(),
}));
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/googlechat";
import { resolveChannelMediaMaxBytes } from "../runtime-api.js";
import { resolveGoogleChatAccount } from "./accounts.js";
import { sendGoogleChatMessage, uploadGoogleChatAttachment } from "./api.js";
import { googlechatPlugin } from "./channel.js";

View File

@@ -1,4 +1,3 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import { describe, expect, it, vi } from "vitest";
import { buildChannelSetupWizardAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
@@ -6,6 +5,7 @@ import {
createTestWizardPrompter,
type WizardPrompter,
} from "../../../test/helpers/extensions/setup-wizard.js";
import type { OpenClawConfig } from "../runtime-api.js";
import { googlechatPlugin } from "./channel.js";
const googlechatConfigureAdapter = buildChannelSetupWizardAdapterFromSetupWizard({

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/irc";
export * from "../../../src/plugin-sdk/irc.js";

View File

@@ -1,4 +1,3 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk/irc";
import { describe, expect, it, vi } from "vitest";
import { buildChannelSetupWizardAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
@@ -7,6 +6,7 @@ import {
type WizardPrompter,
} from "../../../test/helpers/extensions/setup-wizard.js";
import { ircPlugin } from "./channel.js";
import type { RuntimeEnv } from "./runtime-api.js";
import type { CoreConfig } from "./types.js";
const ircConfigureAdapter = buildChannelSetupWizardAdapterFromSetupWizard({

View File

@@ -1,2 +1,2 @@
export * from "openclaw/plugin-sdk/line";
export * from "../../src/plugin-sdk/line.js";
export * from "./setup-api.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/line-core";
export * from "../../src/plugin-sdk/line-core.js";

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig, PluginRuntime, ResolvedLineAccount } from "openclaw/plugin-sdk/line";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
import type { OpenClawConfig, PluginRuntime, ResolvedLineAccount } from "../api.js";
import { linePlugin } from "./channel.js";
import { setLineRuntime } from "./runtime.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/line";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig, PluginRuntime } from "../api.js";
import { linePlugin } from "./channel.js";
import { setLineRuntime } from "./runtime.js";

View File

@@ -1,12 +1,12 @@
import { describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
import type {
ChannelGatewayContext,
ChannelAccountSnapshot,
OpenClawConfig,
PluginRuntime,
ResolvedLineAccount,
} from "openclaw/plugin-sdk/line";
import { describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
} from "../api.js";
import { linePlugin } from "./channel.js";
import { setLineRuntime } from "./runtime.js";

View File

@@ -1,4 +1,3 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/line";
import { describe, expect, it, vi } from "vitest";
import { buildChannelSetupWizardAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
import {
@@ -11,6 +10,7 @@ import {
createTestWizardPrompter,
type WizardPrompter,
} from "../../../test/helpers/extensions/setup-wizard.js";
import type { OpenClawConfig } from "../api.js";
import { lineSetupAdapter, lineSetupWizard } from "./setup-surface.js";
const lineConfigureAdapter = buildChannelSetupWizardAdapterFromSetupWizard({

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/llm-task";
export * from "../../src/plugin-sdk/llm-task.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/lobster";
export * from "../../src/plugin-sdk/lobster.js";

View File

@@ -1,74 +1 @@
export {
GROUP_POLICY_BLOCKED_LABEL,
MarkdownConfigSchema,
PAIRING_APPROVED_MESSAGE,
ToolPolicySchema,
buildChannelConfigSchema,
buildChannelKeyCandidates,
buildProbeChannelStatusSummary,
buildSecretInputSchema,
collectStatusIssuesFromLastError,
compileAllowlist,
createActionGate,
createReplyPrefixOptions,
createScopedPairingAccess,
createTypingCallbacks,
dispatchReplyFromConfigWithSettledDispatcher,
evaluateGroupRouteAccessForPolicy,
fetchWithSsrFGuard,
formatAllowlistMatchMeta,
formatLocationText,
hasConfiguredSecretInput,
issuePairingChallenge,
jsonResult,
logInboundDrop,
logTypingFailure,
mergeAllowlist,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
normalizeStringEntries,
readNumberParam,
readReactionParams,
readStoreAllowFromForDmPolicy,
readStringParam,
resolveAllowlistProviderRuntimeGroupPolicy,
resolveChannelEntryMatch,
resolveCompiledAllowlistMatch,
resolveControlCommandGate,
resolveDefaultGroupPolicy,
resolveDmGroupAccessWithLists,
resolveInboundSessionEnvelopeContext,
resolveRuntimeEnv,
resolveSenderScopedGroupPolicy,
runPluginCommandWithTimeout,
summarizeMapping,
toLocationContext,
warnMissingProviderGroupPolicyFallbackOnce,
DEFAULT_ACCOUNT_ID,
} from "openclaw/plugin-sdk/matrix";
export { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
export type {
AllowlistMatch,
BaseProbeResult,
ChannelDirectoryEntry,
ChannelGroupContext,
ChannelMessageActionAdapter,
ChannelMessageActionContext,
ChannelMessageActionName,
ChannelOutboundAdapter,
ChannelPlugin,
ChannelResolveKind,
ChannelResolveResult,
ChannelToolSend,
DmPolicy,
GroupPolicy,
GroupToolPolicyConfig,
MarkdownTableMode,
NormalizedLocation,
PluginRuntime,
PollInput,
ReplyPayload,
RuntimeEnv,
RuntimeLogger,
SecretInput,
} from "openclaw/plugin-sdk/matrix";
export * from "../../src/plugin-sdk/matrix.js";

View File

@@ -1,6 +1,6 @@
import type { PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/matrix";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
import type { PluginRuntime, RuntimeEnv } from "../runtime-api.js";
import { matrixPlugin } from "./channel.js";
import { setMatrixRuntime } from "./runtime.js";
import { createMatrixBotSdkMock } from "./test-mocks.js";

View File

@@ -1,6 +1,6 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { PluginRuntime, RuntimeLogger } from "openclaw/plugin-sdk/matrix";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime, RuntimeLogger } from "../../../runtime-api.js";
import type { MatrixAuth } from "../client.js";
import { registerMatrixMonitorEvents } from "./events.js";
import type { MatrixRawEvent } from "./types.js";

View File

@@ -1,6 +1,6 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { PluginRuntime, RuntimeEnv, RuntimeLogger } from "openclaw/plugin-sdk/matrix";
import { describe, expect, it, vi } from "vitest";
import type { PluginRuntime, RuntimeEnv, RuntimeLogger } from "../../../runtime-api.js";
import {
createMatrixRoomMessageHandler,
resolveMatrixBaseRouteSession,

View File

@@ -1,5 +1,5 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/matrix";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime } from "../../../runtime-api.js";
import { setMatrixRuntime } from "../../runtime.js";
import { downloadMatrixMedia } from "./media.js";

View File

@@ -1,6 +1,6 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/matrix";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime, RuntimeEnv } from "../../../runtime-api.js";
const sendMessageMatrixMock = vi.hoisted(() => vi.fn().mockResolvedValue({ messageId: "mx-1" }));

View File

@@ -1,5 +1,5 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/matrix";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { PluginRuntime } from "../../runtime-api.js";
import { setMatrixRuntime } from "../runtime.js";
import { createMatrixBotSdkMock } from "../test-mocks.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/matrix";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
const mocks = vi.hoisted(() => ({
sendMessageMatrix: vi.fn(),

View File

@@ -1,5 +1,5 @@
import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk/matrix";
import { describe, expect, it, vi, beforeEach } from "vitest";
import type { ChannelDirectoryEntry } from "../runtime-api.js";
import { listMatrixDirectoryGroupsLive, listMatrixDirectoryPeersLive } from "./directory-live.js";
import { resolveMatrixTargets } from "./resolve-targets.js";

View File

@@ -1,7 +1,7 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it, vi } from "vitest";
import { createTestPluginApi } from "../../test/helpers/extensions/plugin-api.js";
import plugin from "./index.js";
import type { OpenClawPluginApi } from "./runtime-api.js";
function createApi(
registrationMode: OpenClawPluginApi["registrationMode"],

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/mattermost";
export * from "../../src/plugin-sdk/mattermost.js";

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { createReplyPrefixOptions } from "openclaw/plugin-sdk/mattermost";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { createReplyPrefixOptions } from "../runtime-api.js";
const { sendMessageMattermostMock } = vi.hoisted(() => ({
sendMessageMattermostMock: vi.fn(),
}));

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { resolveMattermostGroupRequireMention } from "./group-mentions.js";
describe("resolveMattermostGroupRequireMention", () => {

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../runtime-api.js";
import {
resolveDefaultMattermostAccountId,
resolveMattermostAccount,

View File

@@ -1,9 +1,9 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { buildModelsProviderData } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../runtime-api.js";
import { buildModelsProviderData } from "../../runtime-api.js";
import {
buildMattermostAllowedModelRefs,
parseMattermostModelPickerContext,

View File

@@ -1,5 +1,5 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it, vi } from "vitest";
import type { RuntimeEnv } from "../../runtime-api.js";
import {
createMattermostConnectOnce,
type MattermostWebSocketLike,

View File

@@ -1,5 +1,5 @@
import { resolveControlCommandGate } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it } from "vitest";
import { resolveControlCommandGate } from "../../runtime-api.js";
import type { ResolvedMattermostAccount } from "./accounts.js";
import {
authorizeMattermostCommandInvocation,

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../runtime-api.js";
import { resolveMattermostAccount } from "./accounts.js";
import {
evaluateMattermostMentionGate,

View File

@@ -1,8 +1,8 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../../runtime-api.js";
import { deliverMattermostReplyPayload } from "./reply-delivery.js";
describe("deliverMattermostReplyPayload", () => {

View File

@@ -28,7 +28,7 @@ const mockState = vi.hoisted(() => ({
uploadMattermostFile: vi.fn(),
}));
vi.mock("openclaw/plugin-sdk/mattermost", () => ({
vi.mock("../../runtime-api.js", () => ({
loadOutboundMediaFromUrl: mockState.loadOutboundMediaFromUrl,
}));

View File

@@ -1,7 +1,7 @@
import type { IncomingMessage, ServerResponse } from "node:http";
import { PassThrough } from "node:stream";
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig, RuntimeEnv } from "../../runtime-api.js";
import type { ResolvedMattermostAccount } from "./accounts.js";
import { createSlashCommandHttpHandler } from "./slash-http.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { mattermostSetupWizard } from "./setup-surface.js";
describe("mattermost setup status", () => {

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/memory-lancedb";
export * from "../../src/plugin-sdk/memory-lancedb.js";

View File

@@ -1,10 +1,3 @@
import {
buildOauthProviderAuthResult,
definePluginEntry,
type ProviderAuthContext,
type ProviderAuthResult,
type ProviderCatalogContext,
} from "openclaw/plugin-sdk/minimax-portal-auth";
import {
MINIMAX_OAUTH_MARKER,
createProviderApiKeyAuthMethod,
@@ -12,6 +5,13 @@ import {
listProfilesForProvider,
} from "openclaw/plugin-sdk/provider-auth";
import { fetchMinimaxUsage } from "openclaw/plugin-sdk/provider-usage";
import {
buildOauthProviderAuthResult,
definePluginEntry,
type ProviderAuthContext,
type ProviderAuthResult,
type ProviderCatalogContext,
} from "../../src/plugin-sdk/minimax-portal-auth.js";
import {
minimaxMediaUnderstandingProvider,
minimaxPortalMediaUnderstandingProvider,

View File

@@ -2,7 +2,7 @@ import { randomBytes, randomUUID } from "node:crypto";
import {
generatePkceVerifierChallenge,
toFormUrlEncoded,
} from "openclaw/plugin-sdk/minimax-portal-auth";
} from "../../src/plugin-sdk/minimax-portal-auth.js";
export type MiniMaxRegion = "cn" | "global";

View File

@@ -1,14 +1,14 @@
import {
buildMinimaxApiModelDefinition,
MINIMAX_API_BASE_URL,
MINIMAX_CN_API_BASE_URL,
} from "openclaw/plugin-sdk/provider-models";
import {
applyAgentDefaultModelPrimary,
applyOnboardAuthAgentModelsAndProviders,
type ModelProviderConfig,
type OpenClawConfig,
} from "openclaw/plugin-sdk/provider-onboard";
import {
buildMinimaxApiModelDefinition,
MINIMAX_API_BASE_URL,
MINIMAX_CN_API_BASE_URL,
} from "./model-definitions.js";
type MinimaxApiProviderConfigParams = {
providerId: string;

View File

@@ -1,13 +1,13 @@
import {
buildMistralModelDefinition,
MISTRAL_BASE_URL,
MISTRAL_DEFAULT_MODEL_ID,
} from "openclaw/plugin-sdk/provider-models";
import {
applyAgentDefaultModelPrimary,
applyProviderConfigWithDefaultModel,
type OpenClawConfig,
} from "openclaw/plugin-sdk/provider-onboard";
import {
buildMistralModelDefinition,
MISTRAL_BASE_URL,
MISTRAL_DEFAULT_MODEL_ID,
} from "./model-definitions.js";
export const MISTRAL_DEFAULT_MODEL_REF = `mistral/${MISTRAL_DEFAULT_MODEL_ID}`;

View File

@@ -1,13 +1,13 @@
import {
MODELSTUDIO_CN_BASE_URL,
MODELSTUDIO_DEFAULT_MODEL_REF,
MODELSTUDIO_GLOBAL_BASE_URL,
} from "openclaw/plugin-sdk/provider-models";
import {
applyAgentDefaultModelPrimary,
applyProviderConfigWithModelCatalog,
type OpenClawConfig,
} from "openclaw/plugin-sdk/provider-onboard";
import {
MODELSTUDIO_CN_BASE_URL,
MODELSTUDIO_DEFAULT_MODEL_REF,
MODELSTUDIO_GLOBAL_BASE_URL,
} from "./model-definitions.js";
import { buildModelStudioProvider } from "./provider-catalog.js";
export { MODELSTUDIO_CN_BASE_URL, MODELSTUDIO_DEFAULT_MODEL_REF, MODELSTUDIO_GLOBAL_BASE_URL };

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/msteams";
export * from "../../src/plugin-sdk/msteams.js";

View File

@@ -1,6 +1,6 @@
import type { PluginRuntime, SsrFPolicy } from "openclaw/plugin-sdk/msteams";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createPluginRuntimeMock } from "../../../test/helpers/extensions/plugin-runtime-mock.js";
import type { PluginRuntime, SsrFPolicy } from "../runtime-api.js";
import {
buildMSTeamsAttachmentPlaceholder,
buildMSTeamsGraphMessageUrls,

View File

@@ -1,9 +1,9 @@
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/msteams";
import { describe, expect, it } from "vitest";
import {
createDirectoryTestRuntime,
expectDirectorySurface,
} from "../../../test/helpers/extensions/directory.js";
import type { OpenClawConfig, RuntimeEnv } from "../runtime-api.js";
import { msteamsPlugin } from "./channel.js";
describe("msteams directory", () => {

View File

@@ -1,9 +1,9 @@
import { mkdtemp, rm, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { SILENT_REPLY_TOKEN, type PluginRuntime } from "openclaw/plugin-sdk/msteams";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createPluginRuntimeMock } from "../../../test/helpers/extensions/plugin-runtime-mock.js";
import { SILENT_REPLY_TOKEN, type PluginRuntime } from "../runtime-api.js";
import type { StoredConversationReference } from "./conversation-store.js";
const graphUploadMockState = vi.hoisted(() => ({
uploadAndShareOneDrive: vi.fn(),

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/msteams";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "../runtime-api.js";
import type { MSTeamsConversationStore } from "./conversation-store.js";
import type { MSTeamsAdapter } from "./messenger.js";
import {

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/msteams";
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "../../runtime-api.js";
import type { MSTeamsMessageHandlerDeps } from "../monitor-handler.js";
import { setMSTeamsRuntime } from "../runtime.js";
import { createMSTeamsMessageHandler } from "./message-handler.js";

View File

@@ -1,6 +1,6 @@
import { EventEmitter } from "node:events";
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/msteams";
import { afterEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig, RuntimeEnv } from "../runtime-api.js";
import type { MSTeamsConversationStore } from "./conversation-store.js";
import type { MSTeamsPollStore } from "./polls.js";
@@ -15,7 +15,7 @@ const expressControl = vi.hoisted(() => ({
mode: { value: "listening" as "listening" | "error" },
}));
vi.mock("openclaw/plugin-sdk/msteams", () => ({
vi.mock("../runtime-api.js", () => ({
DEFAULT_WEBHOOK_MAX_BODY_BYTES: 1024 * 1024,
normalizeSecretInputString: (value: unknown) =>
typeof value === "string" && value.trim() ? value.trim() : undefined,

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/msteams";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
const mocks = vi.hoisted(() => ({
sendMessageMSTeams: vi.fn(),

View File

@@ -1,5 +1,5 @@
import type { MSTeamsConfig } from "openclaw/plugin-sdk/msteams";
import { describe, expect, it } from "vitest";
import type { MSTeamsConfig } from "../runtime-api.js";
import {
isMSTeamsGroupAllowed,
resolveMSTeamsReplyPolicy,

View File

@@ -1,5 +1,5 @@
import type { MSTeamsConfig } from "openclaw/plugin-sdk/msteams";
import { describe, expect, it, vi } from "vitest";
import type { MSTeamsConfig } from "../runtime-api.js";
const hostMockState = vi.hoisted(() => ({
tokenError: null as Error | null,

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/msteams";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
import { sendMessageMSTeams } from "./send.js";
const mockState = vi.hoisted(() => ({
@@ -11,7 +11,7 @@ const mockState = vi.hoisted(() => ({
sendMSTeamsMessages: vi.fn(),
}));
vi.mock("openclaw/plugin-sdk/msteams", () => ({
vi.mock("../runtime-api.js", () => ({
loadOutboundMediaFromUrl: mockState.loadOutboundMediaFromUrl,
}));

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/nextcloud-talk";
export * from "../../src/plugin-sdk/nextcloud-talk.js";

View File

@@ -1,5 +1,5 @@
import type { PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/nextcloud-talk";
import { describe, expect, it, vi } from "vitest";
import type { PluginRuntime, RuntimeEnv } from "../runtime-api.js";
import type { ResolvedNextcloudTalkAccount } from "./accounts.js";
import { handleNextcloudTalkInbound } from "./inbound.js";
import { setNextcloudTalkRuntime } from "./runtime.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/nostr";
export * from "../../src/plugin-sdk/nostr.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/nostr";
export * from "../../src/plugin-sdk/nostr.js";

View File

@@ -1,6 +1,6 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/nostr";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createStartAccountContext } from "../../../test/helpers/extensions/start-account-context.js";
import type { PluginRuntime } from "../runtime-api.js";
import { nostrPlugin } from "./channel.js";
import { setNostrRuntime } from "./runtime.js";

View File

@@ -1,8 +1,8 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import type { PluginRuntime } from "openclaw/plugin-sdk/nostr";
import { describe, expect, it } from "vitest";
import type { PluginRuntime } from "../runtime-api.js";
import {
readNostrBusState,
writeNostrBusState,

View File

@@ -1,4 +1,3 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/nostr";
import { describe, expect, it, vi } from "vitest";
import { buildChannelSetupWizardAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
@@ -6,6 +5,7 @@ import {
createTestWizardPrompter,
type WizardPrompter,
} from "../../../test/helpers/extensions/setup-wizard.js";
import type { OpenClawConfig } from "../runtime-api.js";
import { nostrPlugin } from "./channel.js";
const nostrConfigureAdapter = buildChannelSetupWizardAdapterFromSetupWizard({

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/open-prose";
export * from "../../src/plugin-sdk/open-prose.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/phone-control";
export * from "../../src/plugin-sdk/phone-control.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/qwen-portal-auth";
export * from "../../src/plugin-sdk/qwen-portal-auth.js";

View File

@@ -4,7 +4,7 @@ import {
resolveAccountEntry,
type OpenClawConfig,
} from "openclaw/plugin-sdk/account-resolution";
import type { SignalAccountConfig } from "openclaw/plugin-sdk/signal-core";
import type { SignalAccountConfig } from "../../../src/plugin-sdk/signal-core.js";
export type ResolvedSignalAccount = {
accountId: string;

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/signal";
export * from "../../../src/plugin-sdk/signal.js";

View File

@@ -1,2 +1,2 @@
export * from "openclaw/plugin-sdk/synology-chat";
export * from "../../src/plugin-sdk/synology-chat.js";
export * from "./setup-api.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/talk-voice";
export * from "../../src/plugin-sdk/talk-voice.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/thread-ownership";
export * from "../../src/plugin-sdk/thread-ownership.js";

View File

@@ -1 +1 @@
export * from "openclaw/plugin-sdk/tlon";
export * from "../../src/plugin-sdk/tlon.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/tlon";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../api.js";
import { tlonPlugin } from "./channel.js";
describe("tlonPlugin config", () => {

View File

@@ -1,4 +1,3 @@
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/tlon";
import { describe, expect, it, vi } from "vitest";
import { buildChannelSetupWizardAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
@@ -6,6 +5,7 @@ import {
createTestWizardPrompter,
type WizardPrompter,
} from "../../../test/helpers/extensions/setup-wizard.js";
import type { OpenClawConfig, RuntimeEnv } from "../api.js";
import { tlonPlugin } from "./channel.js";
const tlonConfigureAdapter = buildChannelSetupWizardAdapterFromSetupWizard({

View File

@@ -1,6 +1,6 @@
import type { LookupFn } from "openclaw/plugin-sdk/tlon";
import { SsrFBlockedError } from "openclaw/plugin-sdk/tlon";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { LookupFn } from "../../api.js";
import { SsrFBlockedError } from "../../api.js";
import { authenticate } from "./auth.js";
describe("tlon urbit auth ssrf", () => {

Some files were not shown because too many files have changed in this diff Show More