/** * Workflow schedules (DES-RUNS-REVIEW-001 §2): a durable record per scheduled workflow saying how often the daemon * runs it. Generic: any workflow by id. The default entries are `review-recent-work` and `run-evals`, every 48 h. * * Same posture as the learn schedules (`src/learn/schedule-store.ts`): one JSON map in the state home * (`daemon-schedules.json`, the `daemon-` prefix the state-home fence already classifies; * `WICKED_CREW_SCHEDULES` overrides), written atomically (tmp + rename), read tolerantly per row. */ export declare const SCHEDULES_FILENAME = "daemon-schedules.json"; export declare const MIN_EVERY_HOURS = 24; export declare const MAX_EVERY_HOURS = 2160; export declare const HOUR_MS = 3600000; export declare const SCHEDULE_ID: RegExp; export declare const DEFAULT_REVIEW_SCHEDULE_ID = "review-recent-work"; /** The default evals' schedule (DES-DEFAULT-EVALS-001 §7). */ export declare const DEFAULT_EVALS_SCHEDULE_ID = "run-evals"; export declare const DEFAULT_REVIEW_EVERY_HOURS = 48; /** `launching` = the run id is reserved and the engine is being asked (it survives a restart in that window). */ export type ScheduleOutcome = 'launching' | 'launched' | 'refused' | 'completed' | 'failed' | 'cancelled' | 'skipped'; export interface WorkflowSchedule { id: string; workflow: string; everyHours: number; enabled: boolean; /** Projects the run covers (a review reads only their runs); empty = all. */ projectIds: string[]; repoRef: string | null; /** The intent the launch carries; `null` = the workflow's own default. */ problem: string | null; nextDueAt: string; lastRunId: string | null; lastRunAt: string | null; lastOutcome: ScheduleOutcome | null; /** Why the last attempt was skipped or refused, in plain words. */ lastNote: string | null; failures: number; createdAt: string; updatedAt: string; } export interface ScheduleInput { workflow: string; everyHours: number; enabled?: boolean | undefined; projectIds?: string[] | undefined; repoRef?: string | null | undefined; problem?: string | null | undefined; } export declare function defaultSchedulesPath(env?: NodeJS.ProcessEnv): string; export declare class ScheduleStore { private readonly path; private readonly rows; /** Whether the file existed and parsed: the default entry is seeded once, onto a fresh store only. */ readonly loaded: boolean; constructor(path?: string); /** Seed the defaults ("review recent work" and "run the default evals", every 2 days) once, on a store that has never been written. A person * who deletes it later keeps it deleted. */ seedDefault(now: Date): void; list(): WorkflowSchedule[]; get(id: string): WorkflowSchedule | undefined; /** Create or update. A new row is first due one interval from now; an update keeps its history and moves * `nextDueAt` only when the interval changed (then: one new interval from the last run, or from now). */ put(id: string, input: ScheduleInput, now: Date): WorkflowSchedule; update(id: string, patch: Partial>, now: Date): WorkflowSchedule | undefined; delete(id: string): boolean; private persist; } //# sourceMappingURL=store.d.ts.map