diff --git a/extensions/imessage/src/probe.test.ts b/extensions/imessage/src/probe.test.ts index 5eb406cace8..ef69337984b 100644 --- a/extensions/imessage/src/probe.test.ts +++ b/extensions/imessage/src/probe.test.ts @@ -13,6 +13,7 @@ beforeEach(() => { code: 1, signal: null, killed: false, + termination: "exit", }); }); diff --git a/extensions/telegram/src/accounts.test.ts b/extensions/telegram/src/accounts.test.ts index 839e2f64008..fb83b9071a5 100644 --- a/extensions/telegram/src/accounts.test.ts +++ b/extensions/telegram/src/accounts.test.ts @@ -37,7 +37,7 @@ beforeEach(() => { warn: warnMock, child: () => logger, }; - return logger as ReturnType; + return logger as unknown as ReturnType; }); }); diff --git a/extensions/telegram/src/channel.setup.ts b/extensions/telegram/src/channel.setup.ts index f28a96afff7..525f6fbf45b 100644 --- a/extensions/telegram/src/channel.setup.ts +++ b/extensions/telegram/src/channel.setup.ts @@ -8,9 +8,9 @@ import { getChatChannelMeta, normalizeAccountId, TelegramConfigSchema, - type ChannelPlugin, type OpenClawConfig, } from "openclaw/plugin-sdk/telegram"; +import type { ChannelPlugin } from "../../../src/channels/plugins/types.js"; import { inspectTelegramAccount } from "./account-inspect.js"; import { listTelegramAccountIds, diff --git a/extensions/telegram/src/channel.ts b/extensions/telegram/src/channel.ts index 5b3ce7279c6..11ce850daf5 100644 --- a/extensions/telegram/src/channel.ts +++ b/extensions/telegram/src/channel.ts @@ -28,10 +28,10 @@ import { resolveTelegramGroupToolPolicy, TelegramConfigSchema, type ChannelMessageActionAdapter, - type ChannelPlugin, type OpenClawConfig, } from "openclaw/plugin-sdk/telegram"; import { parseTelegramTopicConversation } from "../../../src/acp/conversation-id.js"; +import type { ChannelPlugin } from "../../../src/channels/plugins/types.js"; import { resolveExecApprovalCommandDisplay } from "../../../src/infra/exec-approval-command-display.js"; import { buildExecApprovalPendingReplyPayload } from "../../../src/infra/exec-approval-reply.js"; import { diff --git a/extensions/whatsapp/src/setup-surface.ts b/extensions/whatsapp/src/setup-surface.ts index 21e1803263c..af40cdfdf1e 100644 --- a/extensions/whatsapp/src/setup-surface.ts +++ b/extensions/whatsapp/src/setup-surface.ts @@ -1,7 +1,7 @@ import path from "node:path"; import { DEFAULT_ACCOUNT_ID, - type DmPolicy, + type ChannelSetupDmPolicy, formatCliCommand, formatDocsLink, normalizeAccountId, @@ -18,10 +18,14 @@ import { loginWeb } from "./login.js"; import { whatsappSetupAdapter } from "./setup-core.js"; const channel = "whatsapp" as const; +type WhatsAppConfig = NonNullable["whatsapp"]>; +type WhatsAppDmPolicy = ChannelSetupDmPolicy["getCurrent"] extends (...args: never[]) => infer T + ? T + : never; function mergeWhatsAppConfig( cfg: OpenClawConfig, - patch: Partial["whatsapp"]>, + patch: Partial, options?: { unsetOnUndefined?: string[] }, ): OpenClawConfig { const base = { ...(cfg.channels?.whatsapp ?? {}) } as Record; @@ -43,7 +47,7 @@ function mergeWhatsAppConfig( }; } -function setWhatsAppDmPolicy(cfg: OpenClawConfig, dmPolicy: DmPolicy): OpenClawConfig { +function setWhatsAppDmPolicy(cfg: OpenClawConfig, dmPolicy: WhatsAppDmPolicy): OpenClawConfig { return mergeWhatsAppConfig(cfg, { dmPolicy }); } @@ -202,7 +206,7 @@ async function promptWhatsAppDmAccess(params: { { value: "open", label: "Open (public inbound DMs)" }, { value: "disabled", label: "Disabled (ignore WhatsApp DMs)" }, ], - })) as DmPolicy; + })) as WhatsAppDmPolicy; let next = setWhatsAppSelfChatMode(params.cfg, false); next = setWhatsAppDmPolicy(next, policy); diff --git a/src/plugins/stage-bundled-plugin-runtime.test.ts b/src/plugins/stage-bundled-plugin-runtime.test.ts index 419192b06fd..fe246e8fcfe 100644 --- a/src/plugins/stage-bundled-plugin-runtime.test.ts +++ b/src/plugins/stage-bundled-plugin-runtime.test.ts @@ -153,9 +153,7 @@ describe("stageBundledPluginRuntime", () => { description: string; acceptsArgs: boolean; }>; - matchPluginCommand: ( - commandBody: string, - ) => { + matchPluginCommand: (commandBody: string) => { command: { handler: ({ args }: { args?: string }) => Promise<{ text: string }> }; args?: string; } | null;