@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
34 lines • 1.75 kB
TypeScript
import type { PersistedBaseError } from "../../core/session-transcript-journal.ts";
export declare class CompactReadError extends Error {
/**
* `integrity`: stored bytes no longer match their recorded digest (S09); refused before any decode. A
* `PersistedBaseError`: the loaded base's file no longer is, or holds, what the cut captured (S11c).
*/
readonly reason: PersistedBaseError | "released" | "retired" | "range" | "size_limit" | "count_limit" | "ownership" | "unavailable" | "integrity"
/** `aborted`: the request that asked for this read gave up (its budget ran out) before the read finished. */
| "aborted";
constructor(reason: CompactReadError["reason"]);
}
/** Invalidates immediately, but holds the owner's references until its last operation unwinds. */
export declare class CompactReadLease {
private released;
private operations;
private readonly dispose;
private readonly valid;
constructor(dispose: () => void, valid?: () => void);
assert(): void;
run<T>(read: () => Promise<T>): Promise<T>;
/**
* Runs `read` as an operation in flight without the validity check: a reader of the frozen snapshot itself (a
* legacy view) keeps the references until it unwinds even if the lease is released meanwhile.
*/
hold<T>(read: () => Promise<T>): Promise<T>;
/**
* One operation in flight from now until the returned `end` (idempotent): a consumer that was handed the snapshot
* keeps the references across a release meanwhile.
*/
retain(): () => void;
/** True only for the call that released it: a later release, or one after another owner's, is a no-op. */
release(): boolean;
}
//# sourceMappingURL=compact-read-lease.d.ts.map