import { type AgentRootCoordinator, type AgentRootProtectionGeneration } from "./agent-root-coordinator.js"; export declare const PROCESS_JOBS_ROOT_REGISTRY_SCHEMA = "mono-agent.process-jobs-roots.v1"; export declare const PROCESS_JOBS_ROOT_REGISTRY_DIRECTORY = "process-jobs-roots-v1"; export declare const PROCESS_JOBS_ROOT_REGISTRY_FILE = "registry.json"; export declare const PROCESS_JOBS_ROOT_REGISTRY_RECOVERY_DIRECTORY = "process-jobs-roots-v1.recovery"; export declare const PROCESS_JOBS_ROOT_REGISTRY_STAGING_FILE = "registry.staging.json"; export declare const PROCESS_JOBS_ROOT_REGISTRY_PREVIOUS_FILE = "registry.previous.json"; export declare const PROCESS_JOBS_ROOT_REGISTRY_FAILED_FILE = "registry.failed.json"; export declare const PROCESS_JOBS_ROOT_REGISTRY_MAX_RECOVERY_ENTRIES = 3; export declare const PROCESS_JOBS_ROOT_REGISTRY_MAX_ROOTS = 64; export declare const PROCESS_JOBS_ROOT_REGISTRY_MAX_SEGMENTS = 64; export declare const PROCESS_JOBS_ROOT_REGISTRY_MAX_SEGMENT_BYTES = 255; export declare const PROCESS_JOBS_ROOT_REGISTRY_MAX_ROOT_BYTES: number; export declare const PROCESS_JOBS_ROOT_REGISTRY_MAX_BYTES: number; export declare const PROCESS_JOBS_REGISTRY_UNAVAILABLE_ERROR = "Process-job private-state protection is unavailable."; declare const REGISTRATION_PROOF: unique symbol; interface FileIdentity { readonly dev: bigint; readonly ino: bigint; } export interface RegisteredProcessJobsRoot { readonly segments: readonly string[]; readonly key: string; readonly lexicalPath: string; readonly canonicalPath: string; readonly protectedPaths: readonly string[]; } export interface EmptyProcessJobsRootRegistrySnapshot { readonly kind: "empty"; readonly agentRoot: string; readonly registryDir: string; readonly recoveryDir: string; readonly manifestPath: string; readonly mutationLockPath: string; readonly generation: AgentRootProtectionGeneration; readonly roots: readonly []; readonly protectedRoots: readonly []; } export interface ReadyProcessJobsRootRegistrySnapshot { readonly kind: "ready"; readonly agentRoot: string; readonly registryDir: string; readonly recoveryDir: string; readonly manifestPath: string; readonly mutationLockPath: string; readonly generation: AgentRootProtectionGeneration; readonly roots: readonly RegisteredProcessJobsRoot[]; readonly protectedRoots: readonly string[]; readonly manifestIdentity: FileIdentity; readonly manifestContents: Buffer; } export interface FailedProcessJobsRootRegistrySnapshot { readonly kind: "failed"; readonly agentRoot: string; readonly registryDir: string; readonly recoveryDir: string; readonly manifestPath: string; readonly mutationLockPath: string; readonly generation: AgentRootProtectionGeneration; readonly roots: readonly []; readonly protectedRoots: readonly string[]; readonly error: string; } export type ProcessJobsRootRegistrySnapshot = EmptyProcessJobsRootRegistrySnapshot | ReadyProcessJobsRootRegistrySnapshot | FailedProcessJobsRootRegistrySnapshot; export interface ProcessJobsRootRegistrationProof { readonly snapshot: ReadyProcessJobsRootRegistrySnapshot; readonly rootKey: string; readonly [REGISTRATION_PROOF]: true; } interface ProcessJobsRootRegistrationHooks { /** @internal Deterministic failure seam after first-directory creation and before manifest staging. */ readonly afterRegistryDirectoryCreated?: () => void | Promise; /** @internal Deterministic publication and recovery seams for crash-matrix tests. */ readonly afterManifestPublish?: () => void | Promise; readonly beforeManifestRestore?: () => void | Promise; readonly beforeRegistryRecovery?: () => void | Promise; } export interface ProcessJobsRootRegistryFreeze { readonly snapshot: EmptyProcessJobsRootRegistrySnapshot | ReadyProcessJobsRootRegistrySnapshot; reattest(workspace: string): Promise; release(): Promise; } export declare function processJobsRootRegistryPaths(agentRoot: string): { readonly registryDir: string; readonly recoveryDir: string; readonly manifestPath: string; readonly stagingPath: string; readonly previousPath: string; readonly failedPath: string; readonly mutationLockPath: string; }; /** Load a strict snapshot; malformed or unsafe durable state becomes a provider-zero state. */ export declare function loadProcessJobsRootRegistryProtection(agentRoot: string, workspace: string): Promise; export declare function failedProcessJobsRootRegistryProtection(canonicalAgentRoot: string): FailedProcessJobsRootRegistrySnapshot; /** Re-read and identity-prove the captured manifest at a request/destructive boundary. */ export declare function attestProcessJobsRootRegistrySnapshot(snapshot: ProcessJobsRootRegistrySnapshot, workspace: string): Promise; /** Fsync a monotonic registration before any ProcessJobs root creation/open. */ export declare function registerProcessJobsRoot(options: { readonly agentRoot: string; readonly workspace: string; readonly stateDir: string; readonly coordinator: AgentRootCoordinator; readonly hooks?: ProcessJobsRootRegistrationHooks; }): Promise; /** Hold the registry mutation lock across clear-sessions preflight and first rename. */ export declare function freezeProcessJobsRootRegistry(agentRoot: string, workspace: string): Promise; /** Prove a supplied state directory remains in the exact registered generation. */ export declare function attestProcessJobsRootRegistration(proofValue: ProcessJobsRootRegistrationProof, workspace: string, stateDir: string): Promise; /** All state roots must remain disjoint from every destructive/control path. */ export declare function assertProcessJobsRegistryDisjointFromPaths(snapshot: EmptyProcessJobsRootRegistrySnapshot | ReadyProcessJobsRootRegistrySnapshot, paths: readonly string[]): void; export declare function processJobsProtectionPolicyRoots(snapshot: ProcessJobsRootRegistrySnapshot): readonly string[]; export declare function processJobsRootForKey(snapshot: ProcessJobsRootRegistrySnapshot, key: string): RegisteredProcessJobsRoot | undefined; export declare function processJobsRegistryGeneration(snapshot: ProcessJobsRootRegistrySnapshot): AgentRootProtectionGeneration; export {}; //# sourceMappingURL=process-jobs-root-registry.d.ts.map