diff --git a/src/cli/outbound-send-deps.ts b/src/cli/outbound-send-deps.ts new file mode 100644 index 000000000..877f17fc1 --- /dev/null +++ b/src/cli/outbound-send-deps.ts @@ -0,0 +1,23 @@ +import type { OutboundSendDeps } from "../infra/outbound/deliver.js"; + +export type CliDeps = { + sendMessageWhatsApp: NonNullable; + sendMessageTelegram: NonNullable; + sendMessageDiscord: NonNullable; + sendMessageSlack: NonNullable; + sendMessageSignal: NonNullable; + sendMessageIMessage: NonNullable; +}; + +// Provider docking: extend this mapping when adding new outbound send deps. +export function createOutboundSendDeps(deps: CliDeps): OutboundSendDeps { + return { + sendWhatsApp: deps.sendMessageWhatsApp, + sendTelegram: deps.sendMessageTelegram, + sendDiscord: deps.sendMessageDiscord, + sendSlack: deps.sendMessageSlack, + sendSignal: deps.sendMessageSignal, + sendIMessage: deps.sendMessageIMessage, + }; +} + diff --git a/src/commands/agent/delivery.ts b/src/commands/agent/delivery.ts index 672777f93..375392776 100644 --- a/src/commands/agent/delivery.ts +++ b/src/commands/agent/delivery.ts @@ -1,8 +1,7 @@ import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.js"; import { DEFAULT_CHAT_CHANNEL } from "../../channels/registry.js"; -import type { CliDeps } from "../../cli/deps.js"; -import { createOutboundSendDeps } from "../../cli/deps.js"; +import { createOutboundSendDeps, type CliDeps } from "../../cli/outbound-send-deps.js"; import type { ClawdbotConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; import { deliverOutboundPayloads } from "../../infra/outbound/deliver.js"; diff --git a/src/commands/doctor.warns-state-directory-is-missing.test.ts b/src/commands/doctor.warns-state-directory-is-missing.test.ts index dfaa40181..78b600f74 100644 --- a/src/commands/doctor.warns-state-directory-is-missing.test.ts +++ b/src/commands/doctor.warns-state-directory-is-missing.test.ts @@ -316,6 +316,10 @@ vi.mock("./doctor-state-migrations.js", () => ({ }), })); +vi.mock("./doctor-update.js", () => ({ + maybeOfferUpdateBeforeDoctor: vi.fn().mockResolvedValue({ handled: false }), +})); + describe("doctor command", () => { it("warns when the state directory is missing", async () => { readConfigFileSnapshot.mockResolvedValue({ diff --git a/src/commands/message.ts b/src/commands/message.ts index 22b56b1f9..eaff66e4a 100644 --- a/src/commands/message.ts +++ b/src/commands/message.ts @@ -2,7 +2,7 @@ import { CHANNEL_MESSAGE_ACTION_NAMES, type ChannelMessageActionName, } from "../channels/plugins/types.js"; -import { createOutboundSendDeps, type CliDeps } from "../cli/deps.js"; +import { createOutboundSendDeps, type CliDeps } from "../cli/outbound-send-deps.js"; import { withProgress } from "../cli/progress.js"; import { loadConfig } from "../config/config.js"; import type { OutboundSendDeps } from "../infra/outbound/deliver.js"; diff --git a/src/cron/isolated-agent/run.ts b/src/cron/isolated-agent/run.ts index 88e8b2369..f3ca6be11 100644 --- a/src/cron/isolated-agent/run.ts +++ b/src/cron/isolated-agent/run.ts @@ -29,7 +29,7 @@ import { normalizeThinkLevel, supportsXHighThinking, } from "../../auto-reply/thinking.js"; -import { createOutboundSendDeps, type CliDeps } from "../../cli/deps.js"; +import { createOutboundSendDeps, type CliDeps } from "../../cli/outbound-send-deps.js"; import type { ClawdbotConfig } from "../../config/config.js"; import { resolveSessionTranscriptPath, updateSessionStore } from "../../config/sessions.js"; import type { AgentDefaultsConfig } from "../../config/types.js";