refactor: infer Meta types from zod schema instead of hand-writing
This commit is contained in:
parent
645f0bacf2
commit
f1720eea5e
@ -3,10 +3,10 @@ import { createCursorRole } from "@uncaged/nerve-workflow-utils";
|
|||||||
import { coderPrompt } from "./prompt.js";
|
import { coderPrompt } from "./prompt.js";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
export type CoderMeta = { filesCreated: boolean };
|
|
||||||
export const coderMetaSchema = z.object({
|
export const coderMetaSchema = z.object({
|
||||||
filesCreated: z.boolean().describe("true if the sense files were created"),
|
filesCreated: z.boolean().describe("true if the sense files were created"),
|
||||||
});
|
});
|
||||||
|
export type CoderMeta = z.infer<typeof coderMetaSchema>;
|
||||||
|
|
||||||
export type BuildCoderDeps = {
|
export type BuildCoderDeps = {
|
||||||
provider: LlmProvider;
|
provider: LlmProvider;
|
||||||
|
|||||||
@ -3,10 +3,10 @@ import { createCursorRole } from "@uncaged/nerve-workflow-utils";
|
|||||||
import { plannerPrompt } from "./prompt.js";
|
import { plannerPrompt } from "./prompt.js";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
export type PlannerMeta = { senseName: string };
|
|
||||||
export const plannerMetaSchema = z.object({
|
export const plannerMetaSchema = z.object({
|
||||||
senseName: z.string().describe("kebab-case sense name from the plan"),
|
senseName: z.string().describe("kebab-case sense name from the plan"),
|
||||||
});
|
});
|
||||||
|
export type PlannerMeta = z.infer<typeof plannerMetaSchema>;
|
||||||
|
|
||||||
export type BuildPlannerDeps = {
|
export type BuildPlannerDeps = {
|
||||||
provider: LlmProvider;
|
provider: LlmProvider;
|
||||||
|
|||||||
@ -3,10 +3,10 @@ import { createHermesRole } from "@uncaged/nerve-workflow-utils";
|
|||||||
import { testerPrompt } from "./prompt.js";
|
import { testerPrompt } from "./prompt.js";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
export type TesterMeta = { passed: boolean };
|
|
||||||
export const testerMetaSchema = z.object({
|
export const testerMetaSchema = z.object({
|
||||||
passed: z.boolean().describe("true if all e2e checks passed"),
|
passed: z.boolean().describe("true if all e2e checks passed"),
|
||||||
});
|
});
|
||||||
|
export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
||||||
|
|
||||||
export type BuildTesterDeps = {
|
export type BuildTesterDeps = {
|
||||||
provider: LlmProvider;
|
provider: LlmProvider;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user