From cbf9cd0acb4cfb5423d92240f6bf896479ade924 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 22 Mar 2026 18:12:49 -0700 Subject: [PATCH] fix(ci): repair main checks --- docs/.generated/plugin-sdk-api-baseline.json | 26 ++++++++--------- docs/.generated/plugin-sdk-api-baseline.jsonl | 26 ++++++++--------- .../src/firecrawl-search-provider.test.ts | 6 ++++ extensions/googlechat/src/actions.test.ts | 6 ++++ .../googlechat/src/monitor-webhook.test.ts | 29 ++++++++++++------- extensions/googlechat/src/setup-core.test.ts | 12 ++++++++ .../nextcloud-talk/src/room-info.test.ts | 4 ++- .../tavily/src/tavily-search-provider.test.ts | 6 ++++ ...te-telegram-bot.channel-post-media.test.ts | 2 +- src/auto-reply/reply/followup-runner.ts | 11 ++----- src/tts/provider-registry.test.ts | 3 ++ 11 files changed, 84 insertions(+), 47 deletions(-) diff --git a/docs/.generated/plugin-sdk-api-baseline.json b/docs/.generated/plugin-sdk-api-baseline.json index ac162d83a72..ca0c56418bf 100644 --- a/docs/.generated/plugin-sdk-api-baseline.json +++ b/docs/.generated/plugin-sdk-api-baseline.json @@ -415,7 +415,7 @@ "exportName": "OpenClawPluginApi", "kind": "type", "source": { - "line": 1311, + "line": 1313, "path": "src/plugins/types.ts" } }, @@ -3396,7 +3396,7 @@ "exportName": "OpenClawPluginApi", "kind": "type", "source": { - "line": 1311, + "line": 1313, "path": "src/plugins/types.ts" } }, @@ -3405,7 +3405,7 @@ "exportName": "OpenClawPluginCommandDefinition", "kind": "type", "source": { - "line": 1065, + "line": 1067, "path": "src/plugins/types.ts" } }, @@ -3423,7 +3423,7 @@ "exportName": "OpenClawPluginDefinition", "kind": "type", "source": { - "line": 1293, + "line": 1295, "path": "src/plugins/types.ts" } }, @@ -3432,7 +3432,7 @@ "exportName": "OpenClawPluginService", "kind": "type", "source": { - "line": 1282, + "line": 1284, "path": "src/plugins/types.ts" } }, @@ -3441,7 +3441,7 @@ "exportName": "OpenClawPluginServiceContext", "kind": "type", "source": { - "line": 1274, + "line": 1276, "path": "src/plugins/types.ts" } }, @@ -3477,7 +3477,7 @@ "exportName": "PluginInteractiveTelegramHandlerContext", "kind": "type", "source": { - "line": 1094, + "line": 1096, "path": "src/plugins/types.ts" } }, @@ -3893,7 +3893,7 @@ "exportName": "OpenClawPluginApi", "kind": "type", "source": { - "line": 1311, + "line": 1313, "path": "src/plugins/types.ts" } }, @@ -3902,7 +3902,7 @@ "exportName": "OpenClawPluginCommandDefinition", "kind": "type", "source": { - "line": 1065, + "line": 1067, "path": "src/plugins/types.ts" } }, @@ -3920,7 +3920,7 @@ "exportName": "OpenClawPluginDefinition", "kind": "type", "source": { - "line": 1293, + "line": 1295, "path": "src/plugins/types.ts" } }, @@ -3929,7 +3929,7 @@ "exportName": "OpenClawPluginService", "kind": "type", "source": { - "line": 1282, + "line": 1284, "path": "src/plugins/types.ts" } }, @@ -3938,7 +3938,7 @@ "exportName": "OpenClawPluginServiceContext", "kind": "type", "source": { - "line": 1274, + "line": 1276, "path": "src/plugins/types.ts" } }, @@ -3956,7 +3956,7 @@ "exportName": "PluginInteractiveTelegramHandlerContext", "kind": "type", "source": { - "line": 1094, + "line": 1096, "path": "src/plugins/types.ts" } }, diff --git a/docs/.generated/plugin-sdk-api-baseline.jsonl b/docs/.generated/plugin-sdk-api-baseline.jsonl index 4bfaa52375f..d637408691e 100644 --- a/docs/.generated/plugin-sdk-api-baseline.jsonl +++ b/docs/.generated/plugin-sdk-api-baseline.jsonl @@ -44,7 +44,7 @@ {"declaration":"export type ImageGenerationSourceImage = ImageGenerationSourceImage;","entrypoint":"index","exportName":"ImageGenerationSourceImage","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":14,"sourcePath":"src/image-generation/types.ts"} {"declaration":"export type MediaUnderstandingProviderPlugin = MediaUnderstandingProvider;","entrypoint":"index","exportName":"MediaUnderstandingProviderPlugin","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":950,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"index","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/config/types.openclaw.ts"} -{"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"index","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":1311,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"index","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":1313,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;","entrypoint":"index","exportName":"OpenClawPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":88,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginLogger = PluginLogger;","entrypoint":"index","exportName":"PluginLogger","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":59,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginRuntime = PluginRuntime;","entrypoint":"index","exportName":"PluginRuntime","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":54,"sourcePath":"src/plugins/runtime/types.ts"} @@ -373,16 +373,16 @@ {"declaration":"export type GatewayRequestHandlerOptions = GatewayRequestHandlerOptions;","entrypoint":"core","exportName":"GatewayRequestHandlerOptions","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":112,"sourcePath":"src/gateway/server-methods/types.ts"} {"declaration":"export type MediaUnderstandingProviderPlugin = MediaUnderstandingProvider;","entrypoint":"core","exportName":"MediaUnderstandingProviderPlugin","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":950,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"core","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/config/types.openclaw.ts"} -{"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1311,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"core","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1065,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1313,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"core","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1067,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;","entrypoint":"core","exportName":"OpenClawPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":88,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"core","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1293,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginService = OpenClawPluginService;","entrypoint":"core","exportName":"OpenClawPluginService","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1282,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginServiceContext = OpenClawPluginServiceContext;","entrypoint":"core","exportName":"OpenClawPluginServiceContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1274,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"core","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1295,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginService = OpenClawPluginService;","entrypoint":"core","exportName":"OpenClawPluginService","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1284,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginServiceContext = OpenClawPluginServiceContext;","entrypoint":"core","exportName":"OpenClawPluginServiceContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1276,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawPluginToolContext = OpenClawPluginToolContext;","entrypoint":"core","exportName":"OpenClawPluginToolContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":103,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawPluginToolFactory = OpenClawPluginToolFactory;","entrypoint":"core","exportName":"OpenClawPluginToolFactory","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":120,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginCommandContext = PluginCommandContext;","entrypoint":"core","exportName":"PluginCommandContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":965,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type PluginInteractiveTelegramHandlerContext = PluginInteractiveTelegramHandlerContext;","entrypoint":"core","exportName":"PluginInteractiveTelegramHandlerContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1094,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type PluginInteractiveTelegramHandlerContext = PluginInteractiveTelegramHandlerContext;","entrypoint":"core","exportName":"PluginInteractiveTelegramHandlerContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1096,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginLogger = PluginLogger;","entrypoint":"core","exportName":"PluginLogger","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":59,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginRuntime = PluginRuntime;","entrypoint":"core","exportName":"PluginRuntime","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":54,"sourcePath":"src/plugins/runtime/types.ts"} {"declaration":"export type ProviderAugmentModelCatalogContext = ProviderAugmentModelCatalogContext;","entrypoint":"core","exportName":"ProviderAugmentModelCatalogContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":571,"sourcePath":"src/plugins/types.ts"} @@ -428,14 +428,14 @@ {"declaration":"export type AnyAgentTool = AnyAgentTool;","entrypoint":"plugin-entry","exportName":"AnyAgentTool","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":9,"sourcePath":"src/agents/tools/common.ts"} {"declaration":"export type MediaUnderstandingProviderPlugin = MediaUnderstandingProvider;","entrypoint":"plugin-entry","exportName":"MediaUnderstandingProviderPlugin","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":950,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"plugin-entry","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/config/types.openclaw.ts"} -{"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"plugin-entry","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1311,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1065,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"plugin-entry","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1313,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginCommandDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1067,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;","entrypoint":"plugin-entry","exportName":"OpenClawPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":88,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1293,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginService = OpenClawPluginService;","entrypoint":"plugin-entry","exportName":"OpenClawPluginService","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1282,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type OpenClawPluginServiceContext = OpenClawPluginServiceContext;","entrypoint":"plugin-entry","exportName":"OpenClawPluginServiceContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1274,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginDefinition = OpenClawPluginDefinition;","entrypoint":"plugin-entry","exportName":"OpenClawPluginDefinition","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1295,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginService = OpenClawPluginService;","entrypoint":"plugin-entry","exportName":"OpenClawPluginService","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1284,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type OpenClawPluginServiceContext = OpenClawPluginServiceContext;","entrypoint":"plugin-entry","exportName":"OpenClawPluginServiceContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1276,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginCommandContext = PluginCommandContext;","entrypoint":"plugin-entry","exportName":"PluginCommandContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":965,"sourcePath":"src/plugins/types.ts"} -{"declaration":"export type PluginInteractiveTelegramHandlerContext = PluginInteractiveTelegramHandlerContext;","entrypoint":"plugin-entry","exportName":"PluginInteractiveTelegramHandlerContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1094,"sourcePath":"src/plugins/types.ts"} +{"declaration":"export type PluginInteractiveTelegramHandlerContext = PluginInteractiveTelegramHandlerContext;","entrypoint":"plugin-entry","exportName":"PluginInteractiveTelegramHandlerContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":1096,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type PluginLogger = PluginLogger;","entrypoint":"plugin-entry","exportName":"PluginLogger","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":59,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type ProviderAugmentModelCatalogContext = ProviderAugmentModelCatalogContext;","entrypoint":"plugin-entry","exportName":"ProviderAugmentModelCatalogContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":571,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type ProviderAuthContext = ProviderAuthContext;","entrypoint":"plugin-entry","exportName":"ProviderAuthContext","importSpecifier":"openclaw/plugin-sdk/plugin-entry","kind":"type","recordType":"export","sourceLine":155,"sourcePath":"src/plugins/types.ts"} diff --git a/extensions/firecrawl/src/firecrawl-search-provider.test.ts b/extensions/firecrawl/src/firecrawl-search-provider.test.ts index 20e70666f3d..a173a0ef13b 100644 --- a/extensions/firecrawl/src/firecrawl-search-provider.test.ts +++ b/extensions/firecrawl/src/firecrawl-search-provider.test.ts @@ -11,6 +11,9 @@ describe("firecrawl web search provider", () => { const { createFirecrawlWebSearchProvider } = await import("./firecrawl-search-provider.js"); const provider = createFirecrawlWebSearchProvider(); + if (!provider.applySelectionConfig) { + throw new Error("Expected applySelectionConfig to be defined"); + } const applied = provider.applySelectionConfig({}); expect(provider.id).toBe("firecrawl"); @@ -24,6 +27,9 @@ describe("firecrawl web search provider", () => { const tool = provider.createTool({ config: { test: true }, } as never); + if (!tool) { + throw new Error("Expected tool definition"); + } const result = await tool.execute({ query: "openclaw docs", diff --git a/extensions/googlechat/src/actions.test.ts b/extensions/googlechat/src/actions.test.ts index f26a2711b0d..9bff0a14ffd 100644 --- a/extensions/googlechat/src/actions.test.ts +++ b/extensions/googlechat/src/actions.test.ts @@ -77,6 +77,9 @@ describe("googlechat message actions", () => { messageName: "spaces/AAA/messages/msg-1", }); + if (!googlechatMessageActions.handleAction) { + throw new Error("Expected googlechatMessageActions.handleAction to be defined"); + } const result = await googlechatMessageActions.handleAction({ action: "send", params: { @@ -140,6 +143,9 @@ describe("googlechat message actions", () => { }, ]); + if (!googlechatMessageActions.handleAction) { + throw new Error("Expected googlechatMessageActions.handleAction to be defined"); + } const result = await googlechatMessageActions.handleAction({ action: "react", params: { diff --git a/extensions/googlechat/src/monitor-webhook.test.ts b/extensions/googlechat/src/monitor-webhook.test.ts index b59d6c026fd..6cab10382b1 100644 --- a/extensions/googlechat/src/monitor-webhook.test.ts +++ b/extensions/googlechat/src/monitor-webhook.test.ts @@ -32,23 +32,32 @@ function createResponse() { statusCode: 0, headers: {} as Record, body: "", - setHeader(name: string, value: string) { - this.headers[name] = value; + setHeader: (name: string, value: string) => { + res.headers[name] = value; }, - end(payload?: string) { - this.body = payload ?? ""; - return this; + end: (payload?: string) => { + res.body = payload ?? ""; + return res; }, - } as unknown as ServerResponse & { - headers: Record; - body: string; - }; + } as ServerResponse & { headers: Record; body: string }; return res; } function installSimplePipeline(targets: unknown[]) { withResolvedWebhookRequestPipeline.mockImplementation( - async ({ handle, req, res }: Record) => + async ({ + handle, + req, + res, + }: { + handle: (input: { + targets: unknown[]; + req: IncomingMessage; + res: ServerResponse; + }) => Promise; + req: IncomingMessage; + res: ServerResponse; + }) => await handle({ targets, req, diff --git a/extensions/googlechat/src/setup-core.test.ts b/extensions/googlechat/src/setup-core.test.ts index 9068342c10f..1fa8a00ffce 100644 --- a/extensions/googlechat/src/setup-core.test.ts +++ b/extensions/googlechat/src/setup-core.test.ts @@ -4,6 +4,9 @@ import { googlechatSetupAdapter } from "./setup-core.js"; describe("googlechat setup core", () => { it("rejects env auth for non-default accounts", () => { + if (!googlechatSetupAdapter.validateInput) { + throw new Error("Expected googlechatSetupAdapter.validateInput to be defined"); + } expect( googlechatSetupAdapter.validateInput({ accountId: "secondary", @@ -13,6 +16,9 @@ describe("googlechat setup core", () => { }); it("requires inline or file credentials when env auth is not used", () => { + if (!googlechatSetupAdapter.validateInput) { + throw new Error("Expected googlechatSetupAdapter.validateInput to be defined"); + } expect( googlechatSetupAdapter.validateInput({ accountId: DEFAULT_ACCOUNT_ID, @@ -22,6 +28,9 @@ describe("googlechat setup core", () => { }); it("builds a patch from token-file and trims optional webhook fields", () => { + if (!googlechatSetupAdapter.applyAccountConfig) { + throw new Error("Expected googlechatSetupAdapter.applyAccountConfig to be defined"); + } expect( googlechatSetupAdapter.applyAccountConfig({ cfg: { channels: { googlechat: {} } }, @@ -51,6 +60,9 @@ describe("googlechat setup core", () => { }); it("prefers inline token patch when token-file is absent", () => { + if (!googlechatSetupAdapter.applyAccountConfig) { + throw new Error("Expected googlechatSetupAdapter.applyAccountConfig to be defined"); + } expect( googlechatSetupAdapter.applyAccountConfig({ cfg: { channels: { googlechat: {} } }, diff --git a/extensions/nextcloud-talk/src/room-info.test.ts b/extensions/nextcloud-talk/src/room-info.test.ts index 4455cde28b2..1fd42d2f68c 100644 --- a/extensions/nextcloud-talk/src/room-info.test.ts +++ b/extensions/nextcloud-talk/src/room-info.test.ts @@ -59,6 +59,8 @@ describe("nextcloud talk room info", () => { it("reads the api password from a file and logs non-ok responses", async () => { const release = vi.fn(async () => {}); const log = vi.fn(); + const error = vi.fn(); + const exit = vi.fn(); readFileSync.mockReturnValue("file-secret\n"); fetchWithSsrFGuard.mockResolvedValue({ response: { @@ -80,7 +82,7 @@ describe("nextcloud talk room info", () => { }, } as never, roomToken: "room-group", - runtime: { log }, + runtime: { log, error, exit }, }); expect(kind).toBeUndefined(); diff --git a/extensions/tavily/src/tavily-search-provider.test.ts b/extensions/tavily/src/tavily-search-provider.test.ts index fa36659cf27..ee663457a15 100644 --- a/extensions/tavily/src/tavily-search-provider.test.ts +++ b/extensions/tavily/src/tavily-search-provider.test.ts @@ -11,6 +11,9 @@ describe("tavily web search provider", () => { const { createTavilyWebSearchProvider } = await import("./tavily-search-provider.js"); const provider = createTavilyWebSearchProvider(); + if (!provider.applySelectionConfig) { + throw new Error("Expected applySelectionConfig to be defined"); + } const applied = provider.applySelectionConfig({}); expect(provider.id).toBe("tavily"); @@ -24,6 +27,9 @@ describe("tavily web search provider", () => { const tool = provider.createTool({ config: { test: true }, } as never); + if (!tool) { + throw new Error("Expected tool definition"); + } const result = await tool.execute({ query: "weather sf", diff --git a/extensions/telegram/src/bot.create-telegram-bot.channel-post-media.test.ts b/extensions/telegram/src/bot.create-telegram-bot.channel-post-media.test.ts index de68e51017c..365a95f2be0 100644 --- a/extensions/telegram/src/bot.create-telegram-bot.channel-post-media.test.ts +++ b/extensions/telegram/src/bot.create-telegram-bot.channel-post-media.test.ts @@ -54,7 +54,7 @@ function getChannelPostHandler() { function resolveFlushTimer(setTimeoutSpy: ReturnType) { const flushTimerCallIndex = setTimeoutSpy.mock.calls.findLastIndex( - (call) => call[1] === TELEGRAM_TEST_TIMINGS.mediaGroupFlushMs, + (call: Parameters) => call[1] === TELEGRAM_TEST_TIMINGS.mediaGroupFlushMs, ); const flushTimer = flushTimerCallIndex >= 0 diff --git a/src/auto-reply/reply/followup-runner.ts b/src/auto-reply/reply/followup-runner.ts index 127881851ab..a8e9072ff92 100644 --- a/src/auto-reply/reply/followup-runner.ts +++ b/src/auto-reply/reply/followup-runner.ts @@ -6,6 +6,7 @@ import { import { resolveRunModelFallbacksOverride } from "../../agents/agent-scope.js"; import { resolveBootstrapWarningSignaturesSeen } from "../../agents/bootstrap-budget.js"; import { lookupCachedContextTokens } from "../../agents/context-cache.js"; +import { lookupContextTokens } from "../../agents/context.js"; import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js"; import { runWithModelFallback } from "../../agents/model-fallback.js"; import type { SessionEntry } from "../../config/sessions.js"; @@ -35,9 +36,6 @@ let piEmbeddedRuntimePromise: Promise | null = null; let replyPayloadsRuntimePromise: Promise | null = null; -let contextTokensRuntimePromise: Promise< - typeof import("../../agents/context-tokens.runtime.js") -> | null = null; function loadPiEmbeddedRuntime() { piEmbeddedRuntimePromise ??= import("../../agents/pi-embedded.runtime.js"); @@ -53,11 +51,6 @@ function loadReplyPayloadsRuntime() { replyPayloadsRuntimePromise ??= import("./reply-payloads.runtime.js"); return replyPayloadsRuntimePromise; } - -function loadContextTokensRuntime() { - contextTokensRuntimePromise ??= import("../../agents/context-tokens.runtime.js"); - return contextTokensRuntimePromise; -} export function createFollowupRunner(params: { opts?: GetReplyOptions; typing: TypingController; @@ -328,7 +321,7 @@ export function createFollowupRunner(params: { const cachedContextTokens = lookupCachedContextTokens(modelUsed); const lazyContextTokens = agentCfgContextTokens == null && cachedContextTokens == null - ? (await loadContextTokensRuntime()).lookupContextTokens(modelUsed) + ? lookupContextTokens(modelUsed) : undefined; const contextTokensUsed = agentCfgContextTokens ?? diff --git a/src/tts/provider-registry.test.ts b/src/tts/provider-registry.test.ts index d3e0c20a3ad..0d2b8bcb87e 100644 --- a/src/tts/provider-registry.test.ts +++ b/src/tts/provider-registry.test.ts @@ -19,6 +19,7 @@ vi.mock("../plugins/loader.js", () => ({ function createSpeechProvider(id: string, aliases?: string[]): SpeechProviderPlugin { return { id, + label: id, ...(aliases ? { aliases } : {}), isConfigured: () => true, synthesize: async () => ({ @@ -47,6 +48,7 @@ describe("speech provider registry", () => { speechProviders: [ { pluginId: "test-openai", + source: "test", provider: createSpeechProvider("openai"), }, ], @@ -64,6 +66,7 @@ describe("speech provider registry", () => { speechProviders: [ { pluginId: "test-microsoft", + source: "test", provider: createSpeechProvider("microsoft", ["edge"]), }, ],