mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 12:41:42 +00:00
fix: make fast-tool stub type portable
This commit is contained in:
@@ -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", () => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user