fix: make fast-tool stub type portable

This commit is contained in:
Peter Steinberger
2026-02-16 03:23:30 +01:00
parent ba84b12535
commit b88f377623

View File

@@ -1,10 +1,18 @@
import { vi } from "vitest"; import { vi } from "vitest";
export const stubTool = (name: string) => ({ export type StubTool = {
name: string;
description: string;
parameters: { type: "object"; properties: Record<string, unknown> };
// Keep the exported type portable: don't leak Vitest's mock types into .d.ts.
execute: (...args: unknown[]) => unknown;
};
export const stubTool = (name: string): StubTool => ({
name, name,
description: `${name} stub`, description: `${name} stub`,
parameters: { type: "object", properties: {} }, parameters: { type: "object", properties: {} },
execute: vi.fn(), execute: vi.fn() as unknown as (...args: unknown[]) => unknown,
}); });
vi.mock("../tools/image-tool.js", () => ({ vi.mock("../tools/image-tool.js", () => ({