UNPKG

@code-yeongyu/senpi

Version:

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

34 lines • 1.88 kB
import { type HandoverParkedEntry } from "./host-handover-parked.ts"; /** * Opens one parked session on this host, throwing an RpcSessionRegistryError on a refusal. The host * supplies one that runs the same open as an `open_session` (senpi#3368), so a reopened session is * set up exactly like any other. */ export type ParkedSessionOpener = (entry: HandoverParkedEntry) => Promise<void>; /** * The host the watch reopens into. `shouldReopen` returns false once that host is draining for a * handoff: a predecessor's own watch must never consume a park it wrote for its successor. */ export interface ReopenHolder { readonly hostInstance: string; readonly hostSocket?: string; readonly shouldReopen?: () => boolean; /** * senpi#7020: what this host is still taking over after each pass (the parks not yet reopened, a predecessor still * draining), and `undefined` once nothing is, so `list_sessions` can say its answer is not the whole set yet. */ readonly onProgress?: (state: InheritedHandover | undefined) => void; } /** A takeover in progress: inherited parks not yet reopened, and whether a predecessor generation still runs. */ export interface InheritedHandover { readonly pending: number; readonly predecessorDraining: boolean; } /** * senpi#3282: a successor host reopens exactly the set its predecessor held resident and parked * with `handoff_parked`, restoring it with the same durable id and `retain_on_disconnect`. An * entry is removed from the record only after a successful reopen (crash-safe, at most once); an * entry whose session file is gone is logged and dropped. Runs once at host startup. */ export declare function reopenHandoverParkedSessions(open: ParkedSessionOpener, agentDir: string, socket: string, holder?: ReopenHolder): Promise<void>; //# sourceMappingURL=host-handover-reopen.d.ts.map