mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:08:27 +00:00
fix: make fast-tool stub type portable
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
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,
|
||||
description: `${name} stub`,
|
||||
parameters: { type: "object", properties: {} },
|
||||
execute: vi.fn(),
|
||||
execute: vi.fn() as unknown as (...args: unknown[]) => unknown,
|
||||
});
|
||||
|
||||
vi.mock("../tools/image-tool.js", () => ({
|
||||
|
||||
Reference in New Issue
Block a user