2026-03-15 21:16:27 +02:00
|
|
|
import * as extensionApi from "openclaw/extension-api";
|
2026-03-04 01:19:17 -05:00
|
|
|
import * as compatSdk from "openclaw/plugin-sdk/compat";
|
2026-03-03 22:07:03 -05:00
|
|
|
import * as discordSdk from "openclaw/plugin-sdk/discord";
|
|
|
|
|
import * as imessageSdk from "openclaw/plugin-sdk/imessage";
|
|
|
|
|
import * as lineSdk from "openclaw/plugin-sdk/line";
|
2026-03-04 02:31:44 -05:00
|
|
|
import * as msteamsSdk from "openclaw/plugin-sdk/msteams";
|
2026-03-03 22:07:03 -05:00
|
|
|
import * as signalSdk from "openclaw/plugin-sdk/signal";
|
|
|
|
|
import * as slackSdk from "openclaw/plugin-sdk/slack";
|
2026-03-05 23:07:13 -06:00
|
|
|
import * as telegramSdk from "openclaw/plugin-sdk/telegram";
|
2026-03-03 22:07:03 -05:00
|
|
|
import * as whatsappSdk from "openclaw/plugin-sdk/whatsapp";
|
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
|
|
2026-03-04 02:31:44 -05:00
|
|
|
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;
|
|
|
|
|
|
2026-03-03 22:07:03 -05:00
|
|
|
describe("plugin-sdk subpath exports", () => {
|
2026-03-04 01:19:17 -05:00
|
|
|
it("exports compat helpers", () => {
|
|
|
|
|
expect(typeof compatSdk.emptyPluginConfigSchema).toBe("function");
|
|
|
|
|
expect(typeof compatSdk.resolveControlCommandGate).toBe("function");
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-03 22:07:03 -05:00
|
|
|
it("exports Discord helpers", () => {
|
|
|
|
|
expect(typeof discordSdk.resolveDiscordAccount).toBe("function");
|
2026-03-05 23:07:13 -06:00
|
|
|
expect(typeof discordSdk.inspectDiscordAccount).toBe("function");
|
2026-03-15 16:47:54 -07:00
|
|
|
expect(typeof discordSdk.discordSetupWizard).toBe("object");
|
|
|
|
|
expect(typeof discordSdk.discordSetupAdapter).toBe("object");
|
2026-03-03 22:07:03 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("exports Slack helpers", () => {
|
|
|
|
|
expect(typeof slackSdk.resolveSlackAccount).toBe("function");
|
2026-03-05 23:07:13 -06:00
|
|
|
expect(typeof slackSdk.inspectSlackAccount).toBe("function");
|
2026-03-03 22:07:03 -05:00
|
|
|
expect(typeof slackSdk.handleSlackMessageAction).toBe("function");
|
2026-03-15 16:47:54 -07:00
|
|
|
expect(typeof slackSdk.slackSetupWizard).toBe("object");
|
|
|
|
|
expect(typeof slackSdk.slackSetupAdapter).toBe("object");
|
2026-03-03 22:07:03 -05:00
|
|
|
});
|
|
|
|
|
|
2026-03-05 23:07:13 -06:00
|
|
|
it("exports Telegram helpers", () => {
|
|
|
|
|
expect(typeof telegramSdk.resolveTelegramAccount).toBe("function");
|
|
|
|
|
expect(typeof telegramSdk.inspectTelegramAccount).toBe("function");
|
2026-03-15 16:47:54 -07:00
|
|
|
expect(typeof telegramSdk.telegramSetupWizard).toBe("object");
|
|
|
|
|
expect(typeof telegramSdk.telegramSetupAdapter).toBe("object");
|
2026-03-05 23:07:13 -06:00
|
|
|
});
|
|
|
|
|
|
2026-03-03 22:07:03 -05:00
|
|
|
it("exports Signal helpers", () => {
|
|
|
|
|
expect(typeof signalSdk.resolveSignalAccount).toBe("function");
|
2026-03-15 17:06:23 -07:00
|
|
|
expect(typeof signalSdk.signalSetupWizard).toBe("object");
|
|
|
|
|
expect(typeof signalSdk.signalSetupAdapter).toBe("object");
|
2026-03-03 22:07:03 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("exports iMessage helpers", () => {
|
|
|
|
|
expect(typeof imessageSdk.resolveIMessageAccount).toBe("function");
|
2026-03-15 17:06:23 -07:00
|
|
|
expect(typeof imessageSdk.imessageSetupWizard).toBe("object");
|
|
|
|
|
expect(typeof imessageSdk.imessageSetupAdapter).toBe("object");
|
2026-03-03 22:07:03 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("exports WhatsApp helpers", () => {
|
2026-03-14 02:44:55 -07:00
|
|
|
// WhatsApp-specific functions (resolveWhatsAppAccount, whatsappOnboardingAdapter) moved to extensions/whatsapp/src/
|
|
|
|
|
expect(typeof whatsappSdk.WhatsAppConfigSchema).toBe("object");
|
|
|
|
|
expect(typeof whatsappSdk.resolveWhatsAppOutboundTarget).toBe("function");
|
2026-03-15 08:50:23 -07:00
|
|
|
expect(typeof whatsappSdk.resolveWhatsAppMentionStripRegexes).toBe("function");
|
|
|
|
|
expect("resolveWhatsAppMentionStripPatterns" in whatsappSdk).toBe(false);
|
2026-03-03 22:07:03 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("exports LINE helpers", () => {
|
|
|
|
|
expect(typeof lineSdk.processLineMessage).toBe("function");
|
|
|
|
|
expect(typeof lineSdk.createInfoCard).toBe("function");
|
|
|
|
|
});
|
2026-03-04 02:31:44 -05:00
|
|
|
|
|
|
|
|
it("exports Microsoft Teams helpers", () => {
|
|
|
|
|
expect(typeof msteamsSdk.resolveControlCommandGate).toBe("function");
|
|
|
|
|
expect(typeof msteamsSdk.loadOutboundMediaFromUrl).toBe("function");
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-10 18:50:10 -03:00
|
|
|
it("exports acpx helpers", async () => {
|
|
|
|
|
const acpxSdk = await import("openclaw/plugin-sdk/acpx");
|
|
|
|
|
expect(typeof acpxSdk.listKnownProviderAuthEnvVarNames).toBe("function");
|
|
|
|
|
expect(typeof acpxSdk.omitEnvKeysCaseInsensitive).toBe("function");
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-04 02:31:44 -05:00
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-03-09 11:32:45 +08:00
|
|
|
|
|
|
|
|
it("keeps the newly added bundled plugin-sdk contracts available", async () => {
|
|
|
|
|
const bluebubbles = await import("openclaw/plugin-sdk/bluebubbles");
|
|
|
|
|
expect(typeof bluebubbles.parseFiniteNumber).toBe("function");
|
|
|
|
|
|
|
|
|
|
const mattermost = await import("openclaw/plugin-sdk/mattermost");
|
|
|
|
|
expect(typeof mattermost.parseStrictPositiveInteger).toBe("function");
|
|
|
|
|
|
|
|
|
|
const nextcloudTalk = await import("openclaw/plugin-sdk/nextcloud-talk");
|
|
|
|
|
expect(typeof nextcloudTalk.waitForAbortSignal).toBe("function");
|
|
|
|
|
|
|
|
|
|
const twitch = await import("openclaw/plugin-sdk/twitch");
|
|
|
|
|
expect(typeof twitch.DEFAULT_ACCOUNT_ID).toBe("string");
|
|
|
|
|
expect(typeof twitch.normalizeAccountId).toBe("function");
|
2026-03-15 00:37:56 +01:00
|
|
|
|
|
|
|
|
const zalo = await import("openclaw/plugin-sdk/zalo");
|
|
|
|
|
expect(typeof zalo.resolveClientIp).toBe("function");
|
2026-03-09 11:32:45 +08:00
|
|
|
});
|
2026-03-15 21:16:27 +02:00
|
|
|
|
|
|
|
|
it("exports the extension api bridge", () => {
|
|
|
|
|
expect(typeof extensionApi.runEmbeddedPiAgent).toBe("function");
|
|
|
|
|
});
|
2026-03-03 22:07:03 -05:00
|
|
|
});
|