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.
22 lines
704 B
TypeScript
22 lines
704 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 e2e 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 },
|
|
});
|
|
}
|