mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 05:01:15 +00:00
refactor: finalize plugin sdk legacy boundary cleanup
This commit is contained in:
@@ -19,32 +19,32 @@ const sendFns = vi.hoisted(() => ({
|
||||
imessage: vi.fn(async () => ({ messageId: "i1", chatId: "imessage:1" })),
|
||||
}));
|
||||
|
||||
vi.mock("../plugin-sdk-internal/whatsapp.js", () => {
|
||||
vi.mock("./send-runtime/whatsapp.js", () => {
|
||||
moduleLoads.whatsapp();
|
||||
return { sendMessageWhatsApp: sendFns.whatsapp };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/telegram.js", () => {
|
||||
vi.mock("./send-runtime/telegram.js", () => {
|
||||
moduleLoads.telegram();
|
||||
return { sendMessageTelegram: sendFns.telegram };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/discord.js", () => {
|
||||
vi.mock("./send-runtime/discord.js", () => {
|
||||
moduleLoads.discord();
|
||||
return { sendMessageDiscord: sendFns.discord };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/slack.js", () => {
|
||||
vi.mock("./send-runtime/slack.js", () => {
|
||||
moduleLoads.slack();
|
||||
return { sendMessageSlack: sendFns.slack };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/signal.js", () => {
|
||||
vi.mock("./send-runtime/signal.js", () => {
|
||||
moduleLoads.signal();
|
||||
return { sendMessageSignal: sendFns.signal };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/imessage.js", () => {
|
||||
vi.mock("./send-runtime/imessage.js", () => {
|
||||
moduleLoads.imessage();
|
||||
return { sendMessageIMessage: sendFns.imessage };
|
||||
});
|
||||
|
||||
@@ -35,32 +35,32 @@ export function createDefaultDeps(): CliDeps {
|
||||
return {
|
||||
whatsapp: createLazySender(
|
||||
"whatsapp",
|
||||
() => import("../plugin-sdk/whatsapp.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/whatsapp.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageWhatsApp",
|
||||
),
|
||||
telegram: createLazySender(
|
||||
"telegram",
|
||||
() => import("../plugin-sdk/telegram.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/telegram.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageTelegram",
|
||||
),
|
||||
discord: createLazySender(
|
||||
"discord",
|
||||
() => import("../plugin-sdk/discord.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/discord.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageDiscord",
|
||||
),
|
||||
slack: createLazySender(
|
||||
"slack",
|
||||
() => import("../plugin-sdk/slack.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/slack.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageSlack",
|
||||
),
|
||||
signal: createLazySender(
|
||||
"signal",
|
||||
() => import("../plugin-sdk/signal.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/signal.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageSignal",
|
||||
),
|
||||
imessage: createLazySender(
|
||||
"imessage",
|
||||
() => import("../plugin-sdk/imessage.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/imessage.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageIMessage",
|
||||
),
|
||||
};
|
||||
|
||||
1
src/cli/send-runtime/discord.ts
Normal file
1
src/cli/send-runtime/discord.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageDiscord } from "../../plugin-sdk/discord.js";
|
||||
1
src/cli/send-runtime/imessage.ts
Normal file
1
src/cli/send-runtime/imessage.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageIMessage } from "../../plugin-sdk/imessage.js";
|
||||
1
src/cli/send-runtime/signal.ts
Normal file
1
src/cli/send-runtime/signal.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageSignal } from "../../plugin-sdk/signal.js";
|
||||
1
src/cli/send-runtime/slack.ts
Normal file
1
src/cli/send-runtime/slack.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageSlack } from "../../plugin-sdk/slack.js";
|
||||
1
src/cli/send-runtime/telegram.ts
Normal file
1
src/cli/send-runtime/telegram.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageTelegram } from "../../plugin-sdk/telegram.js";
|
||||
1
src/cli/send-runtime/whatsapp.ts
Normal file
1
src/cli/send-runtime/whatsapp.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageWhatsApp } from "../../plugin-sdk/whatsapp.js";
|
||||
Reference in New Issue
Block a user