refactor: migrate messaging plugins to sdk
This commit is contained in:
@@ -19,7 +19,10 @@ import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import * as configModule from "../config/config.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { createTestRegistry } from "../test-utils/channel-plugins.js";
|
||||
import { agentCommand } from "./agent.js";
|
||||
import { telegramPlugin } from "../../extensions/telegram/src/channel.js";
|
||||
|
||||
const runtime: RuntimeEnv = {
|
||||
log: vi.fn(),
|
||||
@@ -251,6 +254,9 @@ describe("agentCommand", () => {
|
||||
await withTempHome(async (home) => {
|
||||
const store = path.join(home, "sessions.json");
|
||||
mockConfig(home, store, undefined, { botToken: "t-1" });
|
||||
setActivePluginRegistry(
|
||||
createTestRegistry([{ pluginId: "telegram", plugin: telegramPlugin, source: "test" }]),
|
||||
);
|
||||
const deps = {
|
||||
sendMessageWhatsApp: vi.fn(),
|
||||
sendMessageTelegram: vi.fn().mockResolvedValue({ messageId: "t1", chatId: "123" }),
|
||||
|
||||
Reference in New Issue
Block a user