mirror of
https://github.com/vercel/eve.git
synced 2026-09-20 05:35:39 +08:00
7e48f0e926
Signed-off-by: owenkephart <owen.kephart@vercel.com>
19 lines
624 B
TypeScript
19 lines
624 B
TypeScript
import { execFile } from "node:child_process";
|
|
import { promisify } from "node:util";
|
|
|
|
import { defineTool } from "eve/tools";
|
|
import { z } from "zod";
|
|
|
|
const runFile = promisify(execFile);
|
|
|
|
export default defineTool({
|
|
description: "Test-only foreground child-process hold.",
|
|
inputSchema: z.object({ durationSeconds: z.literal(45) }),
|
|
async execute({ durationSeconds }) {
|
|
console.error(`[tui-hang-lab] command started; sleeping ${durationSeconds}s`);
|
|
await runFile("sleep", [String(durationSeconds)]);
|
|
console.error("[tui-hang-lab] command completed");
|
|
return { held: `${durationSeconds}s` };
|
|
},
|
|
});
|