import { z } from "zod"; import { type ExtractionHarness } from "./harness.js"; import { modelThemeSchema, type ThemeSlotValues } from "../theme/extract-theme.js"; /** * The two prose stages that survive the judgment layer. Tool judgment itself * moved to `cli/judge/` — a judge proposes with a verbatim quote, an * independent skeptic tears it apart, and the direction rule routes what * survives. The survey / draft-per-surface / cross-check pipeline that used to * live here existed to make ONE model's unevidenced opinion less wrong by * splitting it up; evidence plus a second opinion is the better answer, so the * pipeline is gone rather than layered on top of. * * What is left is the work the judgment channel does not do, each one * `harness.run(instructions)` with its own zod-validated artifact written to * `.vendo/data/extract/.json` so a failure stays diagnosable: * * - brief — the product brief, drafted from the JUDGED catalog (the graded * names and descriptions, not the extractor's method+path strings) plus the * code itself. A failure keeps whatever brief already stands. * - theme — OPTIONAL, only when the deterministic allowlist left brand slots * unfilled. A failure degrades to a note; the exact reads and neutral * defaults still stand. * * Nothing here assumes a vendor; the model override rides VENDO_MODEL_EXTRACT, * which every harness already honors. */ export declare const BRIEF_TEMPLATE = "Describe this product, its users, and the jobs the agent should help them complete."; /** Static facts don't clutter passes that only need names — kept small. */ export declare const staticToolSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; risk: z.ZodOptional>; disabled: z.ZodOptional; method: z.ZodOptional; path: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; path?: string | undefined; description?: string | undefined; risk?: "read" | "write" | "destructive" | undefined; method?: string | undefined; disabled?: boolean | undefined; }, { name: string; path?: string | undefined; description?: string | undefined; risk?: "read" | "write" | "destructive" | undefined; method?: string | undefined; disabled?: boolean | undefined; }>; export type StaticTool = z.infer; export declare function staticFacts(tools: StaticTool[]): string; /** One tool as the brief prompt reads it: what the judgment pass settled. */ export interface JudgedSummary { name: string; description?: string; } /** * Instructions for the OPTIONAL theme stage — the SOLE copy of the theme * judgment rules (extract-theme.ts's old model pass and its prompt were * deleted when the deterministic split landed; that file now owns only the * exact pass, validators, and assembly). */ export declare function composeThemeInstructions(input: { needed: string[]; alreadyExact: Record; evidencePaths: string[]; appName: string; }): string; /** Stage lifecycle statuses reported to callers that narrate progress: the * "started" marker plus the terminal trio the try profile understands. */ export type StagedStageStatus = "started" | "done" | "failed" | "skipped"; /** What every stage here shares: the repo the harness explores, where the * artifacts land, and the model seam. `artifactRoot` defaults to `root`; * `vendo try` splits the two so the harness explores the HOST repo while * every write stays under the temp profile root (the zero-commit law). */ interface StageContext { root: string; env: Record; harness: ExtractionHarness; appName: string; artifactRoot?: string; onProgress?: (line: string) => void; } export interface BriefStageInput extends StageContext { /** The JUDGED catalog (skeleton ⊕ standing judgments), name + description. */ judged: JudgedSummary[]; } export interface BriefStageResult { brief: string; /** false = the stage failed and `brief` is the pre-existing one (or the * template when there was none). */ fromStage: boolean; notes: string[]; } /** * The brief stage. A failure is never fatal: the brief that already stands is * returned instead, and `applyBrief`'s hand-written-brief guard still decides * whether anything lands on disk. */ export declare function runBriefStage(input: BriefStageInput): Promise; /** Write the drafted brief unless a human already wrote one (only the init * template or an empty file is replaceable without --force). */ export declare function applyBrief(root: string, brief: string, force: boolean): Promise; export interface ThemeStageInput extends StageContext { needed: Array; alreadyExact: Record; evidencePaths: string[]; } export interface ThemeStageResult { /** Present only when the stage ran and succeeded. */ theme?: z.infer; notes: string[]; } /** * The theme stage — OPTIONAL, and only when the allowlist left BRAND slots * unfilled: the non-brand slots (accentText, headingFamily, baseSize, density, * motion) derive or default safely and must never trigger a model call on * their own. A failure degrades to a note and never throws. */ export declare function runThemeStage(input: ThemeStageInput): Promise; export {};