- Rename build* → create* workflow factories - Workflow factories accept adapters: Record<string, AgentFn> - Each role file exports createXxxRole(adapter, ...) factory - _shared/workspace-committer accepts adapter as first param - All adapter imports moved to index.ts (injection point) - solve-issue roles also updated Closes #15
21 lines
689 B
TypeScript
21 lines
689 B
TypeScript
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<typeof testMetaSchema>;
|
|
|
|
export function createTestRole(adapter: AgentFn, extract: LlmExtractorConfig): Role<TestMeta> {
|
|
return createRole(
|
|
adapter,
|
|
async (start: StartStep) => testPrompt({ threadId: start.meta.threadId }),
|
|
testMetaSchema,
|
|
extract,
|
|
);
|
|
}
|