import { type AgentStreamEvent } from "@mono-agent/agent-contracts"; import type { CronFiringIdentity, CronJobResult, CronRunTrigger } from "@mono-agent/cron-adapter"; import type { CronOperatorRunDetail, CronOperatorRunPage, CronOperatorRunSummary } from "@mono-agent/operator-adapter"; export interface CronControlPaths { readonly root: string; readonly marker: string; readonly database: string; readonly lease: string; } export type CronControlInspection = { readonly status: "absent"; } | { readonly status: "initializing"; } | { readonly status: "ready"; readonly overrides: ReadonlyMap; } | { readonly status: "degraded"; readonly reason: string; }; export type CronControlInitializationCheckpoint = "parent_ready" | "initializing_root_ready" | "initializing_marker_file_ready" | "initializing_marker_ready" | "database_file_ready" | "database_schema_ready" | "lease_file_ready" | "lease_schema_ready" | "permissions_ready" | "ready_marker_ready" | "published"; export interface OpenCronControlStoreOptions { readonly now?: () => Date; /** Test seam for simulating process death after one durable initialization boundary. */ readonly onInitializationCheckpoint?: (checkpoint: CronControlInitializationCheckpoint) => void | Promise; } export declare class CronControlStoreError extends Error { readonly kind: "corrupt" | "insecure" | "lease_conflict" | "idempotency_conflict" | "replay_expired"; constructor(kind: CronControlStoreError["kind"], message: string, options?: ErrorOptions); } export interface CronControlStore { readonly paths: CronControlPaths; overrides(): ReadonlyMap; syncConfiguredJobs(jobIds: readonly string[]): void; knownJobIds(): readonly string[]; allocateFiring(input: { readonly jobId: string; readonly scheduledAt: string; readonly observedAt: string; readonly trigger: CronRunTrigger; }): CronFiringIdentity; replayRunNowAction(input: { readonly jobId: string; readonly idempotencyKey: string; readonly requestHash: string; }): CronOperatorRunSummary | undefined; runNowAction(input: { readonly jobId: string; readonly idempotencyKey: string; readonly requestHash: string; readonly observedAt: string; }): { readonly firing: CronFiringIdentity; readonly run?: CronOperatorRunSummary; readonly replayed: boolean; }; replayEnabledAction(input: { readonly jobId: string; readonly idempotencyKey: string; readonly requestHash: string; }): boolean | undefined; setEnabledAction(input: { readonly jobId: string; readonly enabled: boolean; readonly idempotencyKey: string; readonly requestHash: string; }): { readonly enabled: boolean; readonly replayed: boolean; }; markStarted(firing: CronFiringIdentity, startedAt: string): void; appendEvent(firing: CronFiringIdentity, event: AgentStreamEvent): void; recordResult(result: CronJobResult): void; getRun(runId: string): CronOperatorRunDetail | undefined; getRunSummary(runId: string): CronOperatorRunSummary | undefined; lastRun(jobId: string): CronOperatorRunSummary | undefined; runs(jobId: string, limit: number, before?: string): CronOperatorRunPage; audit(input: { readonly action: string; readonly jobId?: string; readonly outcome: string; readonly idempotencyKey?: string; readonly detail?: Readonly>; }): void; close(): Promise; } export declare function resolveCronControlPaths(cwd: string): CronControlPaths; export declare function inspectCronControlStore(cwd: string): Promise; export declare function openCronControlStore(cwd: string, options?: OpenCronControlStoreOptions): Promise; export declare function cronActionRequestHash(value: unknown): string; //# sourceMappingURL=cron-control-store.d.ts.map