import { type WorkRecord } from "../work/read.js"; import type { WorkflowSpecialistProfile } from "../workflow/types.js"; import { type CreateGovernorReplanningInput, type GovernorPlanRecord, type GovernorReplanningPolicy } from "./plan-types.js"; export declare const GOVERNOR_INTENT_SCHEMA_VERSION: 1; export interface GovernorLimits { max_cycles: number; max_runtime_ms: number; max_parallel_work: number; max_total_attempts: number; max_agents_per_work: number; agent_concurrency: number; } export interface GovernorAutomationPolicy { accept_passing_proof: boolean; resume_approved: boolean; retry_blocked: boolean; } export interface GovernorMission { objective: string; acceptance: string[]; max_milestones: number; } export interface CreateGovernorMissionInput { objective: string; acceptance: readonly string[]; maxMilestones?: number; } export interface GovernorIntent { schema_version: typeof GOVERNOR_INTENT_SCHEMA_VERSION; id: string; title: string; root_work_id: string; specialists: Record; limits: GovernorLimits; automation: GovernorAutomationPolicy; mission?: GovernorMission; replanning?: GovernorReplanningPolicy; created_at: string; } export type GovernorState = "ready" | "running" | "awaiting_attention" | "blocked" | "budget_exhausted" | "succeeded"; export type GovernorNextAction = "run" | "wait_for_run" | "resolve_approval" | "review" | "retry" | "replan" | "plan_initial" | "plan_milestone" | "review_plan" | "retry_plan" | "none"; export interface GovernorProjection { id: string; title: string; root_work_id: string; root_materialized: boolean; state: GovernorState; reason: string; next_action: GovernorNextAction; work_ids: string[]; ready_work: string[]; resumable_work: string[]; retryable_work: string[]; attention_work: string[]; /** Work stopped because a human must rule, with the docket id when the script * named one. Empty in the ordinary case. A reader that wants to tell an * operator what is actually waiting on them should start here. */ decision_blocked_work: Array<{ work_id: string; decision_id?: string; }>; attempts_used: number; attempts_remaining: number; specialists: string[]; plan_generation: number; replans_used: number; replans_remaining: number; milestones_completed: number; milestones_remaining: number; pending_plan_id?: string; attention_plan_id?: string; latest_plan_status?: GovernorPlanRecord["status"]; /** * How consumed (charged) replans that did not advance the graph broke down, * present only when at least one replan was spent by a planner run that * produced no proposal. `reviewer_rejection` counts replans where a proposal * was produced and independent review rejected it (review-round exhaustion, * reviewer attention, or review failure); `planner_no_proposal` counts replans * where the planner run produced no reviewable proposal at all. Absent when a * goal has no planner no-proposal history, so goals that only ever reached * review project exactly as before this field existed. */ replan_consumption?: { reviewer_rejection: number; planner_no_proposal: number; }; governed_work_ids: string[]; } export interface GovernorRecord { intent: GovernorIntent; projection: GovernorProjection; work: WorkRecord[]; plans: GovernorPlanRecord[]; } export interface GovernorListWarning { goal_id: string; reason: string; } export interface GovernorListResult { records: GovernorRecord[]; warnings: GovernorListWarning[]; } export interface CreateGovernorInput { coordRoot: string; rootWorkId?: string; specialists: Readonly>; title?: string; id?: string; limits?: Partial; automation?: Partial; mission?: CreateGovernorMissionInput; replanning?: CreateGovernorReplanningInput; } export declare function createGovernor(input: CreateGovernorInput): GovernorRecord; export declare function readGovernor(coordRoot: string, goalId: string): GovernorRecord; /** @internal Runner seam; ignores the lease held by this governor process. */ export declare function readGovernorIgnoringLease(coordRoot: string, goalId: string): GovernorRecord; export declare function listGovernors(coordRoot: string): GovernorRecord[]; export declare function listGovernorsWithWarnings(coordRoot: string): GovernorListResult; export declare function collectGovernorWork(coordRoot: string, rootWorkId: string): WorkRecord[]; export declare function assertGovernorId(goalId: string): void; export declare function newGovernorId(): string; /** @internal Runner seam; one exclusive crash-recoverable governor lease. */ export declare function acquireGovernorLease(coordRoot: string, goalId: string): () => void; //# sourceMappingURL=state.d.ts.map