import type { WorkFile, WorkPromotionJournal, WorkPromotionPreview } from '../types'; export declare const WORK_ROOT = ".agents/kyro/work"; export declare function workDirectory(id: string): string; export declare function workJsonPath(id: string): string; export declare function workBriefPath(id: string): string; export declare function workPendingAmendmentPath(id: string): string; export declare function assertWorkId(id: string): void; export declare function readWork(id: string): WorkFile; export declare function assertBriefIntegrity(work: WorkFile): void; export declare function createWork(work: WorkFile, brief: string | Buffer, dryRun?: boolean): void; export declare function updateWork(id: string, expectedRevision: number, build: (current: WorkFile) => WorkFile, dryRun?: boolean): WorkFile; export declare function workClosureHistoryPath(id: string, revision: number): string; /** Preserve exact closure provenance before publishing a reopened Work. */ export declare function reopenWork(id: string, expectedRevision: number, reason: string, by: string, dryRun?: boolean): { work: WorkFile; historyPath: string; }; export declare function workIsTrackedPath(path: string): boolean; /** Read the durable pending promotion intent, or null when none exists. */ export declare function readPromotionJournal(id: string): WorkPromotionJournal | null; /** * Verify a promoted Work against its reciprocal target link instead of * trusting work.json activity alone. Missing, corrupt, or mismatched link * material (or a dangling pending intent) fails closed with a concrete * remedy; a healthy report requires both directions to agree. */ export declare function assertPromotionReciprocal(work: WorkFile): void; /** Other mutations fail closed while a promotion intent exists; only a matching retry proceeds. */ export declare function assertNoPendingPromotion(id: string): void; export interface PromoteWorkInput { toScope: string; actor: string; } export interface PromoteWorkResult { work: WorkFile; preview: WorkPromotionPreview; targetDigest: string; requestDigest: string; recovered: boolean; } /** * Commit a Work-to-Forge promotion as one recoverable cross-artifact * transaction: durably record intent, stage target files, publish the final * Work revision, publish the complete destination, verify reciprocal digests, * then durably clear intent. The Work never appears promoted until the target * is published and linked; every injected boundary is resumable by an exact * retry, and any mismatch fails closed without a false promoted state. */ export declare function promoteWork(id: string, expectedRevision: number, input: PromoteWorkInput, dryRun?: boolean): PromoteWorkResult; export interface AmendWorkBriefInput { briefBytes: Buffer; title: string; objective: string; reason: string; by: string; } export interface AmendWorkBriefResult { work: WorkFile; previousDigest: string; briefDigest: string; invalidatedTaskIds: string[]; recoveredBrief: boolean; } /** * Publish a brief amendment as one recoverable transaction: the new brief * bytes and the work.json update (new digest, invalidated approvals) are * applied under the writer lock with a durable intent record. A crash at any * boundary leaves either a blocked read or a completed publication whose * matching retry can remove the record. External edits never imply recovery. */ export declare function amendWorkBrief(id: string, expectedRevision: number, input: AmendWorkBriefInput, dryRun?: boolean): AmendWorkBriefResult; //# sourceMappingURL=store.d.ts.map