25 lines
736 B
TypeScript
25 lines
736 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 type TesterMeta = { passed: boolean };
|
|
export const testerMetaSchema = z.object({
|
|
passed: z.boolean().describe("true if all e2e checks passed"),
|
|
});
|
|
|
|
export type BuildTesterDeps = {
|
|
provider: LlmProvider;
|
|
sensesDir: string;
|
|
nerveRoot: string;
|
|
};
|
|
|
|
export function buildTesterRole({ provider, sensesDir, nerveRoot }: BuildTesterDeps) {
|
|
return createHermesRole<TesterMeta>({
|
|
prompt: async (threadId) => testerPrompt({ threadId, sensesDir, nerveRoot }),
|
|
extract: { provider, schema: testerMetaSchema },
|
|
});
|
|
}
|
|
|
|
|