import { z } from "zod"; import { type Spec, type SpecIndex, type SpecIndexEntry, type ForgeAdapter } from "@slowcook-ai/core"; /** Where specs live, relative to repo root. */ export declare const SPECS_DIR = "specs"; export declare const INDEX_FILE: string; export declare const SpecProposalsSchema: z.ZodObject<{ schema: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; sql: z.ZodString; }, z.core.$strip>>; ui_layout: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; viewport_coverage: z.ZodOptional>; components_to_reuse: z.ZodOptional>; tokens_to_reuse: z.ZodOptional>; tokens_to_add: z.ZodOptional>; }, z.core.$strip>>; routes: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; paths: z.ZodArray>; }, z.core.$strip>>; auth: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; requirements: z.ZodOptional>; }, z.core.$strip>>; perf_budget: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; budgets: z.ZodOptional>; }, z.core.$strip>>; observability: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; log_events: z.ZodOptional>; metrics: z.ZodOptional>>; }, z.core.$strip>>; infra: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; runtime: z.ZodOptional; deploy_target: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>>; api_shape: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; endpoints: z.ZodOptional; responses: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>>; fixtures: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; by_domain: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>; export declare function readIndex(repoRoot: string): SpecIndex; export declare function writeIndex(repoRoot: string, index: SpecIndex): void; export declare function readSpec(repoRoot: string, storyId: string): Spec; export declare function writeSpec(repoRoot: string, spec: Spec): string; /** * Coerce "helpfully structured" array entries back to strings, matching the * Spec schema (acceptance_scenarios et al. are `string[]`). Agents — menu AND * refine — emit a {given,when,then} BDD object for an entry even when told to * emit strings; normalise at ingestion. Shared so both producers agree. * Non-breaking: well-formed string entries pass through unchanged. */ export declare function normalizeScenarioArrays>(doc: T): T; export declare function listActiveSpecs(repoRoot: string): Spec[]; /** * Allocate the next unused story ID (zero-padded 3 digits). * * Considers BOTH the local index (specs/_index.yaml on the checked-out branch) * AND remote branches matching `slowcook/spec/story-*`. This prevents story-ID * collisions when a spec PR is in flight (branch exists on remote but index on * main doesn't reflect it yet) or when two refinement runs overlap. * * `forge` is optional so callers without a forge (e.g., local tooling) can still * use the function — they just get a weaker guarantee (index-only). */ export declare function nextStoryId(repoRoot: string, forge?: ForgeAdapter): Promise; /** Public accessors for tests. */ export declare const schemas: { SpecIndex: z.ZodObject<{ $schema: z.ZodOptional; schema_version: z.ZodLiteral<1>; stories: z.ZodRecord; source_issue: z.ZodOptional; tags: z.ZodOptional>; summary: z.ZodOptional; supersedes: z.ZodOptional>; superseded_by: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; Spec: z.ZodObject<{ $schema: z.ZodOptional; story_id: z.ZodString; title: z.ZodString; status: z.ZodEnum<{ draft: "draft"; active: "active"; superseded: "superseded"; }>; created_at: z.ZodString; supersedes: z.ZodArray; superseded_by: z.ZodUnion; token_budget_usd: z.ZodOptional; estimate: z.ZodOptional>; source_issue: z.ZodOptional; refined_by: z.ZodOptional; actors: z.ZodArray; }, z.core.$strip>>; preconditions: z.ZodArray; invariants: z.ZodArray; api_contract: z.ZodOptional>; ui_behavior: z.ZodOptional>; fidelity: z.ZodOptional; }, z.core.$strip>>; epic: z.ZodOptional; persona: z.ZodOptional; chrome: z.ZodOptional>; }, z.core.$strip>>; surfaces: z.ZodOptional; persona: z.ZodOptional; home: z.ZodOptional; states: z.ZodOptional>; }, z.core.$strip>>>; prd_ref: z.ZodOptional; }, z.core.$strip>>; data_contract: z.ZodOptional>>; relations: z.ZodOptional>; }, z.core.$strip>>>; api: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; open_questions: z.ZodOptional; deferred: z.ZodArray; }, z.core.$strip>>; acceptance_scenarios: z.ZodArray; non_goals: z.ZodArray; related_specs: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>>; proposals: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; sql: z.ZodString; }, z.core.$strip>>; ui_layout: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; viewport_coverage: z.ZodOptional>; components_to_reuse: z.ZodOptional>; tokens_to_reuse: z.ZodOptional>; tokens_to_add: z.ZodOptional>; }, z.core.$strip>>; routes: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; paths: z.ZodArray>; }, z.core.$strip>>; auth: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; requirements: z.ZodOptional>; }, z.core.$strip>>; perf_budget: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; budgets: z.ZodOptional>; }, z.core.$strip>>; observability: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; log_events: z.ZodOptional>; metrics: z.ZodOptional>>; }, z.core.$strip>>; infra: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; runtime: z.ZodOptional; deploy_target: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>>; api_shape: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; endpoints: z.ZodOptional; responses: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>>; fixtures: z.ZodOptional; proposed_by: z.ZodString; approved_by: z.ZodOptional; approved_at: z.ZodOptional; rationale: z.ZodOptional; by_domain: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>>; cost: z.ZodOptional>; }, z.core.$loose>; SpecIndexEntry: z.ZodObject<{ title: z.ZodString; status: z.ZodEnum<{ draft: "draft"; active: "active"; superseded: "superseded"; }>; source_issue: z.ZodOptional; tags: z.ZodOptional>; summary: z.ZodOptional; supersedes: z.ZodOptional>; superseded_by: z.ZodOptional>; }, z.core.$strip>; }; /** Minimal helper for the agent to build a SpecIndexEntry from a Spec. */ export declare function entryFromSpec(spec: Spec): SpecIndexEntry; //# sourceMappingURL=spec-yaml.d.ts.map