21 lines
718 B
TypeScript
21 lines
718 B
TypeScript
import type { LlmProvider } from "@uncaged/nerve-workflow-utils";
|
|
import { createHermesRole } from "@uncaged/nerve-workflow-utils";
|
|
import { z } from "zod";
|
|
import { readIssuePrompt } from "./prompt.js";
|
|
|
|
export const readIssueMetaSchema = z.object({
|
|
ready: z.boolean().describe("true if issue content was fetched and markers are present"),
|
|
});
|
|
export type ReadIssueMeta = z.infer<typeof readIssueMetaSchema>;
|
|
|
|
export type BuildReadIssueDeps = {
|
|
provider: LlmProvider;
|
|
};
|
|
|
|
export function buildReadIssueRole({ provider }: BuildReadIssueDeps) {
|
|
return createHermesRole<ReadIssueMeta>({
|
|
prompt: async (threadId) => readIssuePrompt({ threadId }),
|
|
extract: { provider, schema: readIssueMetaSchema },
|
|
});
|
|
}
|