小橘 e8765abac6 fix: pass nerveRoot to tester prompts for correct path resolution
Hermes agent cwd is not necessarily the nerve workspace root.
Inject nerveRoot into tester prompts so all file paths and commands
use absolute paths to the workspace directory.
2026-04-28 13:03:31 +00:00

22 lines
711 B
TypeScript

import type { LlmProvider } from "@uncaged/nerve-workflow-utils";
import { createHermesRole } from "@uncaged/nerve-workflow-utils";
import { testerPrompt } from "./prompt.js";
import { z } from "zod";
export const testerMetaSchema = z.object({
passed: z.boolean().describe("true if all validation checks passed"),
});
export type TesterMeta = z.infer<typeof testerMetaSchema>;
export type BuildTesterDeps = {
provider: LlmProvider;
nerveRoot: string;
};
export function buildTesterRole({ provider, nerveRoot }: BuildTesterDeps) {
return createHermesRole<TesterMeta>({
prompt: async (threadId) => testerPrompt({ threadId, nerveRoot }),
extract: { provider, schema: testerMetaSchema },
});
}