import type { SessionEntry, SessionManager } from "@caupulican/pi-agent-core/node"; import type { WorkerClaim, WorkerRequest } from "../autonomy/contracts.ts"; import { type SessionBranchEntrySource, type SessionSnapshotPayload } from "../session-snapshot.ts"; export declare const WORKER_CLAIM_CUSTOM_TYPE = "worker_claim"; export type WorkerClaimSnapshotPayload = SessionSnapshotPayload<"claim", WorkerClaim> & { /** The originating request, when the host has one, makes a claim auditable against the * instructions, route, and capability envelope that bounded it. */ request?: WorkerRequest; }; export declare function appendWorkerClaimSnapshot(sessionManager: Pick, claim: WorkerClaim, request?: WorkerRequest, /** Baseline for relative changedFiles when re-deriving the review marker; forwarded to * `isParentReviewRequired`/`validateWorkerClaim`. Defaults to `process.cwd()`, matching the * validator's own documented default for single-cwd-per-process callers. */ options?: { cwd?: string; }): string; /** Requests persisted alongside worker claims. */ export declare function getWorkerRequestSnapshots(entries: readonly SessionEntry[]): WorkerRequest[]; export declare function getWorkerClaimSnapshots(entries: readonly SessionEntry[]): WorkerClaim[]; /** * Latest persisted snapshot (claim + originating request, when available) for one worker * requestId — "latest wins" over the append-only entries, the same collapse `delegate status` * performs when it maps results by requestId. Used to read, and durably update, the * parent-review marker. */ export declare function getLatestWorkerClaimSnapshot(entries: readonly SessionEntry[], requestId: string): WorkerClaimSnapshotPayload | undefined; export type AcknowledgeWorkerReviewReason = "unknown_worker_claim" | "not_flagged" | "already_reviewed"; export type AcknowledgeWorkerReviewResult = { ok: true; requestId: string; reviewedAt: string; } | { ok: false; reason: AcknowledgeWorkerReviewReason; }; /** * Durably acknowledge an unreviewed worker mutation. Re-appends the latest snapshot for * `requestId` with `parentReviewedAt` set, so the ack is a first-class entry in the same * append-only audit trail as the original claim — it survives reload and any future re-read of * `getWorkerClaimSnapshots`/`getLatestWorkerClaimSnapshot` (both are "latest wins"). Never * write-blocking: this only marks the mutation reviewed, it does not touch the worker's files. */ export declare function acknowledgeWorkerClaimReview(sessionManager: Pick & SessionBranchEntrySource, requestId: string, now?: () => string): AcknowledgeWorkerReviewResult; //# sourceMappingURL=session-worker-claim.d.ts.map