21 lines
644 B
TypeScript
21 lines
644 B
TypeScript
import type { LlmProvider } from "@uncaged/nerve-workflow-utils";
|
|
import { createHermesRole } 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 type BuildTestDeps = {
|
|
provider: LlmProvider;
|
|
};
|
|
|
|
export function buildTestRole({ provider }: BuildTestDeps) {
|
|
return createHermesRole<TestMeta>({
|
|
prompt: async (threadId) => testPrompt({ threadId }),
|
|
extract: { provider, schema: testMetaSchema },
|
|
});
|
|
}
|