mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-21 05:32:53 +00:00
refactor: shrink public channel plugin sdk surfaces
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/whatsapp.js", () => {
|
||||
vi.mock("../plugin-sdk-internal/whatsapp.js", () => {
|
||||
moduleLoads.whatsapp();
|
||||
return { sendMessageWhatsApp: sendFns.whatsapp };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk/telegram.js", () => {
|
||||
vi.mock("../plugin-sdk-internal/telegram.js", () => {
|
||||
moduleLoads.telegram();
|
||||
return { sendMessageTelegram: sendFns.telegram };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk/discord.js", () => {
|
||||
vi.mock("../plugin-sdk-internal/discord.js", () => {
|
||||
moduleLoads.discord();
|
||||
return { sendMessageDiscord: sendFns.discord };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk/slack.js", () => {
|
||||
vi.mock("../plugin-sdk-internal/slack.js", () => {
|
||||
moduleLoads.slack();
|
||||
return { sendMessageSlack: sendFns.slack };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk/signal.js", () => {
|
||||
vi.mock("../plugin-sdk-internal/signal.js", () => {
|
||||
moduleLoads.signal();
|
||||
return { sendMessageSignal: sendFns.signal };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk/imessage.js", () => {
|
||||
vi.mock("../plugin-sdk-internal/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("../plugin-sdk-internal/whatsapp.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageWhatsApp",
|
||||
),
|
||||
telegram: createLazySender(
|
||||
"telegram",
|
||||
() => import("../plugin-sdk/telegram.js") as Promise<Record<string, unknown>>,
|
||||
() => import("../plugin-sdk-internal/telegram.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageTelegram",
|
||||
),
|
||||
discord: createLazySender(
|
||||
"discord",
|
||||
() => import("../plugin-sdk/discord.js") as Promise<Record<string, unknown>>,
|
||||
() => import("../plugin-sdk-internal/discord.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageDiscord",
|
||||
),
|
||||
slack: createLazySender(
|
||||
"slack",
|
||||
() => import("../plugin-sdk/slack.js") as Promise<Record<string, unknown>>,
|
||||
() => import("../plugin-sdk-internal/slack.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageSlack",
|
||||
),
|
||||
signal: createLazySender(
|
||||
"signal",
|
||||
() => import("../plugin-sdk/signal.js") as Promise<Record<string, unknown>>,
|
||||
() => import("../plugin-sdk-internal/signal.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageSignal",
|
||||
),
|
||||
imessage: createLazySender(
|
||||
"imessage",
|
||||
() => import("../plugin-sdk/imessage.js") as Promise<Record<string, unknown>>,
|
||||
() => import("../plugin-sdk-internal/imessage.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageIMessage",
|
||||
),
|
||||
};
|
||||
@@ -70,4 +70,4 @@ export function createOutboundSendDeps(deps: CliDeps): OutboundSendDeps {
|
||||
return createOutboundSendDepsFromCliSource(deps);
|
||||
}
|
||||
|
||||
export { logWebSelfId } from "../plugin-sdk/whatsapp.js";
|
||||
export { logWebSelfId } from "../plugin-sdk-internal/whatsapp.js";
|
||||
|
||||
Reference in New Issue
Block a user