UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

49 lines • 1.65 kB
import type { EngineTurnHold } from "./engine-turn-hold.ts"; export type RunRef = { readonly kind: "dag" | "task" | "workpool" | "team"; readonly id: string; }; type InheritedData = { parentSessionId: string; runRef: RunRef; highWater: number; }; export type InheritResult = { readonly childSeq: number; } | { readonly refused: "wrong_parent"; }; export type ReleaseInheritedResult = { readonly released: true; readonly otherHoldLive: boolean; } | { readonly released: false; readonly reason: "stale" | "wrong_parent" | "not_held"; }; /** * Run-level holds on the shared hold ledger (senpi#3811): fences on a parent for each run its Stop paused, and the * one inherited hold a child carries while its owning parent's run is paused. Every seq compared here comes from * the session's own ledger, so a parent's release can be checked against what it observed without a shared clock. */ export declare class RunHolds { private readonly ledger; constructor(ledger: EngineTurnHold); fence(runRef: RunRef): void; releaseFences(cause: "run_resume" | "run_cancelled", runRefs?: readonly RunRef[]): void; holdsWake(details: unknown): boolean; inheritedOwner(): InheritedData | undefined; stamp(): void; releaseDirectStops(): void; inherit(owner: { parentSessionId: string; parentPauseSeq: number; runRef: RunRef; }): InheritResult; releaseInherited(request: { parentSessionId: string; parentPauseSeq: number; childSeqCutoff: number; }): ReleaseInheritedResult; } export {}; //# sourceMappingURL=run-holds.d.ts.map