import type { AgentFn, Role, StartStep } from "@uncaged/nerve-core"; import type { LlmExtractorConfig } from "@uncaged/nerve-workflow-utils"; import { createRole } from "@uncaged/nerve-workflow-utils"; import { z } from "zod"; import { testPrompt } from "./prompt.js"; export const testMetaSchema = z.object({ passed: z.boolean().describe("true if all test commands passed"), }); export type TestMeta = z.infer; export function createTestRole(adapter: AgentFn, extract: LlmExtractorConfig): Role { return createRole( adapter, async (start: StartStep) => testPrompt({ threadId: start.meta.threadId }), testMetaSchema, extract, ); }