fix(config): resolve native commands schemas

This commit is contained in:
Peter Steinberger
2026-01-12 22:43:09 +00:00
parent 73d9469bf8
commit 2785009c6f

View File

@@ -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<string, unknown> }>
| {
details: Record<string, unknown>;
};
const tool = tools[0] as {
execute: (id: string, params: unknown) => Promise<unknown>;
};
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<string, unknown> }>
| {
details: Record<string, unknown>;
};
const tool = tools[0] as {
execute: (id: string, params: unknown) => Promise<unknown>;
};
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 () => {