From 2785009c6f3a2c7ff2c5b6c58bb6b4dc23f59701 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 22:43:09 +0000 Subject: [PATCH] fix(config): resolve native commands schemas --- src/plugins/voice-call.plugin.test.ts | 38 ++++++++------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/plugins/voice-call.plugin.test.ts b/src/plugins/voice-call.plugin.test.ts index 14ab710b1..54e7cd566 100644 --- a/src/plugins/voice-call.plugin.test.ts +++ b/src/plugins/voice-call.plugin.test.ts @@ -109,41 +109,25 @@ describe("voice-call plugin", () => { it("tool get_status returns json payload", async () => { const { tools } = setup({ provider: "mock" }); - type VoiceTool = { - execute: ( - id: string, - params: unknown, - ) => - | Promise<{ details: Record }> - | { - details: Record; - }; + const tool = tools[0] as { + execute: (id: string, params: unknown) => Promise; }; - const tool = tools[0] as VoiceTool; - const result = await tool.execute("id", { + const result = (await tool.execute("id", { action: "get_status", callId: "call-1", - }); - expect((result.details as { found?: boolean }).found).toBe(true); + })) as { details: { found?: boolean } }; + expect(result.details.found).toBe(true); }); it("legacy tool status without sid returns error payload", async () => { const { tools } = setup({ provider: "mock" }); - type VoiceTool = { - execute: ( - id: string, - params: unknown, - ) => - | Promise<{ details: Record }> - | { - details: Record; - }; + const tool = tools[0] as { + execute: (id: string, params: unknown) => Promise; }; - const tool = tools[0] as VoiceTool; - const result = await tool.execute("id", { mode: "status" }); - expect(String((result.details as { error?: unknown }).error)).toContain( - "sid required", - ); + const result = (await tool.execute("id", { mode: "status" })) as { + details: { error?: unknown }; + }; + expect(String(result.details.error)).toContain("sid required"); }); it("CLI start prints JSON", async () => {