refactor(sense-generator): extract meta schemas to types.ts
小橘 🍊(NEKO Team)
This commit is contained in:
parent
fd3a8c64f2
commit
516a28533a
@ -1,7 +1,6 @@
|
||||
import { createCursorRole } from "@uncaged/nerve-workflow-utils";
|
||||
import { z } from "zod";
|
||||
import { resolveDashScopeProvider, NERVE_ROOT, SENSES_DIR } from "../shared.js";
|
||||
|
||||
import { coderMetaSchema } from "../types.js";
|
||||
import type { SenseMeta } from "../types.js";
|
||||
|
||||
export async function buildCoderRole() {
|
||||
@ -25,9 +24,7 @@ Implement the sense. Create exactly:
|
||||
Follow the patterns from existing senses. Create all files now.`,
|
||||
extract: {
|
||||
provider,
|
||||
schema: z.object({
|
||||
filesCreated: z.boolean().describe("true if the sense files were created"),
|
||||
}),
|
||||
schema: coderMetaSchema,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { createCursorRole } from "@uncaged/nerve-workflow-utils";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { z } from "zod";
|
||||
import { resolveDashScopeProvider, buildSenseExamples, getNerveYaml, NERVE_ROOT } from "../shared.js";
|
||||
import { plannerMetaSchema } from "../types.js";
|
||||
import type { SenseMeta } from "../types.js";
|
||||
|
||||
const senseExamples = buildSenseExamples();
|
||||
@ -40,9 +38,7 @@ ${nerveYaml}
|
||||
Output ONLY the plan. Be precise and implementation-ready.`,
|
||||
extract: {
|
||||
provider,
|
||||
schema: z.object({
|
||||
senseName: z.string().describe("kebab-case sense name from the plan"),
|
||||
}),
|
||||
schema: plannerMetaSchema,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,5 +1,15 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export type SenseMeta = {
|
||||
planner: { senseName: string };
|
||||
coder: { filesCreated: boolean };
|
||||
tester: { passed: boolean; attempt: number };
|
||||
};
|
||||
|
||||
export const plannerMetaSchema = z.object({
|
||||
senseName: z.string().describe("kebab-case sense name from the plan"),
|
||||
});
|
||||
|
||||
export const coderMetaSchema = z.object({
|
||||
filesCreated: z.boolean().describe("true if the sense files were created"),
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user