export type DesignMode = "guided" | "direct"; export type DesignStatus = "draft" | "stopped" | "frozen"; export interface DesignGate { id: string; label: string; } export interface DesignApproval { gateId: string; approvedAt: string; specHash: string; payload: unknown; } export interface DesignFreeze { specHash: string; invalidated: boolean; approvalHashes?: Record; } export type HistoryWindow = "7d" | "30d" | "90d" | "all"; export type HistoryProjectScope = "current" | "all"; export type DesignStorageScope = "project" | "global"; export type DesignExecutionProfile = "restricted" | "normal-project" | "custom"; export interface DesignModelSelection { candidateModelIds: string[]; selectedModelIds: string[]; judgeModelIds: string[]; } export type DesignHardBudgetCeilings = Record; export interface DesignHistoryFilter { window: HistoryWindow; project: HistoryProjectScope; } export interface DesignSpecDraft { schemaVersion: 1; mode: DesignMode; skillName: string; directPath?: string; generatedReferences: boolean; historyWindow?: DesignHistoryFilter; models: DesignModelSelection; executionProfile: DesignExecutionProfile; hardBudgetCeilings: DesignHardBudgetCeilings; } export interface DesignSession { schemaVersion: 1; id: string; status: DesignStatus; mode: DesignMode; skillName: string; directPath?: string; historyWindow?: DesignHistoryFilter; models: DesignModelSelection; executionProfile: DesignExecutionProfile; hardBudgetCeilings: DesignHardBudgetCeilings; usedHistoryRanking: boolean; generatedReferences: boolean; noninteractive: boolean; json: boolean; gates: DesignGate[]; approvals: DesignApproval[]; spec: DesignSpecDraft; statePath: string; rootDir: string; homeDir?: string; storageScope: DesignStorageScope; storageRoot: string; freeze?: DesignFreeze; stopReason?: string; } export interface StartDesignSessionOptions { rootDir: string; mode: DesignMode; skillName: string; directPath?: string; generatedReferences?: boolean; noninteractive?: boolean; json?: boolean; historyWindow?: DesignHistoryFilter; models?: Partial; executionProfile?: DesignExecutionProfile; hardBudgetCeilings?: DesignHardBudgetCeilings; storageScope?: DesignStorageScope; homeDir?: string; } export declare const DESIGN_GATES: DesignGate[]; export declare function designGateIds(): string[]; export declare function freezeReviewedManifestV1(manifest: Record): Record; export declare function validateDesignApprovalLedgerV1(text: string, expectedSpecHash: string, options: { requireFreeze: boolean; }): { ok: true; } | { ok: false; reason: string; missingGateIds?: string[]; }; export declare function startDesignSession(options: StartDesignSessionOptions): DesignSession; export declare function loadDesignSession(statePath: string): DesignSession; export declare function nextDesignGate(session: DesignSession): DesignGate | null; export declare function approveDesignGate(session: DesignSession, gateId: string, payload: unknown): DesignSession; export declare function freezeDesignSession(session: DesignSession, options?: { saveAndStopIfMissingApprovals?: boolean; }): DesignSession; export declare function canRunDesignSession(session: DesignSession): boolean; export declare function editFrozenDesignSpec(session: DesignSession, edit: (spec: DesignSpecDraft) => DesignSpecDraft): DesignSession;