import { z } from "zod"; export declare const WorkflowStateContentChecksumSchema: z.ZodObject<{ algorithm: z.ZodLiteral<"sha256">; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>; /** Lenient receipt schema for reads (mirrors WorkflowStateReceipt). */ export declare const WorkflowStateReceiptSchema: z.ZodObject<{ version: z.ZodNumber; skill: z.ZodEnum<{ autoresearch: "autoresearch"; "deep-interview": "deep-interview"; ralplan: "ralplan"; ultragoal: "ultragoal"; }>; owner: z.ZodEnum<{ "gjc-hook": "gjc-hook"; "gjc-runtime": "gjc-runtime"; "gjc-state-cli": "gjc-state-cli"; }>; command: z.ZodString; state_path: z.ZodString; storage_path: z.ZodString; mutated_at: z.ZodString; fresh_until: z.ZodString; status: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; }>; mutation_id: z.ZodString; verb: z.ZodOptional; from_phase: z.ZodOptional; to_phase: z.ZodOptional; forced: z.ZodOptional; paths: z.ZodOptional>; content_sha256: z.ZodOptional; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>>; }, z.core.$loose>; /** Lenient envelope schema for reads. Every non-structural field optional. */ export declare const WorkflowStateEnvelopeSchema: z.ZodObject<{ skill: z.ZodOptional; active: z.ZodOptional; current_phase: z.ZodOptional; version: z.ZodOptional; updated_at: z.ZodOptional; session_id: z.ZodOptional; receipt: z.ZodOptional; owner: z.ZodEnum<{ "gjc-hook": "gjc-hook"; "gjc-runtime": "gjc-runtime"; "gjc-state-cli": "gjc-state-cli"; }>; command: z.ZodString; state_path: z.ZodString; storage_path: z.ZodString; mutated_at: z.ZodString; fresh_until: z.ZodString; status: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; }>; mutation_id: z.ZodString; verb: z.ZodOptional; from_phase: z.ZodOptional; to_phase: z.ZodOptional; forced: z.ZodOptional; paths: z.ZodOptional>; content_sha256: z.ZodOptional; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>>; }, z.core.$loose>>; state_revision: z.ZodOptional; }, z.core.$loose>; /** * Strict receipt required on WRITE (post checksum-stamping). Anchored to the * fields the sanctioned writer emits — `content_sha256` is REQUIRED here. */ export declare const RequiredWorkflowStateReceiptSchema: z.ZodObject<{ version: z.ZodNumber; skill: z.ZodEnum<{ autoresearch: "autoresearch"; "deep-interview": "deep-interview"; ralplan: "ralplan"; ultragoal: "ultragoal"; }>; owner: z.ZodEnum<{ "gjc-hook": "gjc-hook"; "gjc-runtime": "gjc-runtime"; "gjc-state-cli": "gjc-state-cli"; }>; command: z.ZodString; state_path: z.ZodString; storage_path: z.ZodString; mutated_at: z.ZodString; fresh_until: z.ZodString; status: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; }>; mutation_id: z.ZodString; content_sha256: z.ZodObject<{ algorithm: z.ZodLiteral<"sha256">; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>; }, z.core.$loose>; /** * Write-side fail-closed gate: the serialized on-disk envelope must satisfy * this after checksum stamping. Anchored to current sanctioned-writer output. */ export declare const RequiredOnWriteEnvelopeSchema: z.ZodObject<{ skill: z.ZodEnum<{ autoresearch: "autoresearch"; "deep-interview": "deep-interview"; ralplan: "ralplan"; ultragoal: "ultragoal"; }>; version: z.ZodLiteral<2>; updated_at: z.ZodString; current_phase: z.ZodString; active: z.ZodBoolean; receipt: z.ZodObject<{ version: z.ZodNumber; skill: z.ZodEnum<{ autoresearch: "autoresearch"; "deep-interview": "deep-interview"; ralplan: "ralplan"; ultragoal: "ultragoal"; }>; owner: z.ZodEnum<{ "gjc-hook": "gjc-hook"; "gjc-runtime": "gjc-runtime"; "gjc-state-cli": "gjc-state-cli"; }>; command: z.ZodString; state_path: z.ZodString; storage_path: z.ZodString; mutated_at: z.ZodString; fresh_until: z.ZodString; status: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; }>; mutation_id: z.ZodString; content_sha256: z.ZodObject<{ algorithm: z.ZodLiteral<"sha256">; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>; }, z.core.$loose>; state_revision: z.ZodOptional; }, z.core.$loose>; /** Per-skill mode state consumed by hooks / the mutation guard. */ export declare const ModeStateSchema: z.ZodObject<{ active: z.ZodOptional; current_phase: z.ZodOptional; skill: z.ZodOptional; session_id: z.ZodOptional; thread_id: z.ZodOptional; cwd: z.ZodOptional; updated_at: z.ZodOptional; handoff_from: z.ZodOptional; handoff_to: z.ZodOptional; handoff_at: z.ZodOptional; }, z.core.$loose>; export declare const SkillActiveEntrySchema: z.ZodObject<{ skill: z.ZodString; phase: z.ZodOptional; active: z.ZodOptional; activated_at: z.ZodOptional; updated_at: z.ZodOptional; session_id: z.ZodOptional; thread_id: z.ZodOptional; turn_id: z.ZodOptional; stale: z.ZodOptional; handoff_from: z.ZodOptional; handoff_to: z.ZodOptional; handoff_at: z.ZodOptional; receipt: z.ZodOptional; owner: z.ZodEnum<{ "gjc-hook": "gjc-hook"; "gjc-runtime": "gjc-runtime"; "gjc-state-cli": "gjc-state-cli"; }>; command: z.ZodString; state_path: z.ZodString; storage_path: z.ZodString; mutated_at: z.ZodString; fresh_until: z.ZodString; status: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; }>; mutation_id: z.ZodString; verb: z.ZodOptional; from_phase: z.ZodOptional; to_phase: z.ZodOptional; forced: z.ZodOptional; paths: z.ZodOptional>; content_sha256: z.ZodOptional; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>; export declare const SkillActiveStateSchema: z.ZodObject<{ version: z.ZodOptional; active: z.ZodOptional; skill: z.ZodOptional; keyword: z.ZodOptional; phase: z.ZodOptional; activated_at: z.ZodOptional; updated_at: z.ZodOptional; source: z.ZodOptional; session_id: z.ZodOptional; thread_id: z.ZodOptional; turn_id: z.ZodOptional; active_skills: z.ZodOptional; active: z.ZodOptional; activated_at: z.ZodOptional; updated_at: z.ZodOptional; session_id: z.ZodOptional; thread_id: z.ZodOptional; turn_id: z.ZodOptional; stale: z.ZodOptional; handoff_from: z.ZodOptional; handoff_to: z.ZodOptional; handoff_at: z.ZodOptional; receipt: z.ZodOptional; owner: z.ZodEnum<{ "gjc-hook": "gjc-hook"; "gjc-runtime": "gjc-runtime"; "gjc-state-cli": "gjc-state-cli"; }>; command: z.ZodString; state_path: z.ZodString; storage_path: z.ZodString; mutated_at: z.ZodString; fresh_until: z.ZodString; status: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; }>; mutation_id: z.ZodString; verb: z.ZodOptional; from_phase: z.ZodOptional; to_phase: z.ZodOptional; forced: z.ZodOptional; paths: z.ZodOptional>; content_sha256: z.ZodOptional; value: z.ZodString; covered_path: z.ZodString; computed_at: z.ZodString; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>>; }, z.core.$loose>; export type WorkflowStateEnvelope = z.infer; export type RequiredOnWriteEnvelope = z.infer; export type ModeStateParsed = z.infer; export type SkillActiveStateParsed = z.infer; /** * Validated read result. * - `null` → file absent (ENOENT); callers treat as no state. * - `{ok:true}` → parsed + schema-valid. * - `{ok:false}` → present but unparseable or schema-invalid. Callers fail * OPEN (normalize/log), never crash — preserving v2 reads. */ export type ReadGjcJsonResult = { ok: true; value: T; raw: unknown; } | { ok: false; error: string; raw: unknown; }; /** * Parse + schema-validate a `.gjc` JSON file at the read boundary. * Returns `null` when the file is absent. Fail-open: an invalid file yields * `{ ok: false }` with the raw value attached so the caller can normalize/log. */ export declare function readGjcJson(filePath: string, schema: z.ZodType): Promise | null>;