import type { AgentFn, Role, ThreadContext } 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 (ctx: ThreadContext) => testPrompt({ threadId: ctx.start.meta.threadId }), testMetaSchema, extract, ); }