UNPKG

@code-yeongyu/senpi

Version:

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

36 lines • 2.32 kB
/** While an event binding (lifetime FIFO or reopened stdin) is armed, the identity check is one long backstop. */ export declare const HOST_WATCH_BACKSTOP_INTERVAL_MS = 30000; /** Poll cadence for the recorded-supervisor poll when it is the only binding. */ export declare const HOST_WATCH_PPID_INTERVAL_MS = 250; /** * Poll cadence for the ppid check while the inherited pipe is armed (senpi#3738). EOF on the pipe is * the primary signal and arrives from kqueue/epoll at once; the ppid check then only backs it up, so * an idle host does not wake four times a second for a signal the pipe already delivers. */ export declare const HOST_WATCH_PPID_BACKUP_INTERVAL_MS = 5000; /** * How often the recorded supervisor's start is compared (senpi#3816 review). The liveness check runs every tick and * catches a dead supervisor (ESRCH); its pid can only be reused after that death, so the start comparison only has to * catch a death between ticks and runs rarely: every 5 s on Linux (`/proc` start ticks, nothing spawned), every 60 s * elsewhere (`ps`), so an idle host spawns no processes (senpi#3738). Counted in ticks, so no clock step moves it. */ export declare const HOST_WATCH_IDENTITY_INTERVAL_MS = 5000; /** * Liveness cadence when the recorded supervisor identity is the host's ONLY binding (senpi#3816 review, senpi#3738): * on Linux a supervised host has no stdin lifetime fd and no slot 3. One free `kill(pid, 0)` a second; supervisor * death is then noticed within about a second instead of 250 ms, for a quarter of the idle wakeups. */ export declare const HOST_WATCH_IDENTITY_ONLY_INTERVAL_MS = 1000; export declare const HOST_WATCH_SPAWNING_IDENTITY_INTERVAL_MS = 60000; export interface SupervisorPoll { /** (Re)arms the poll at `intervalMs`; a no-op when already at that cadence or when there is no supervisor pid. */ arm(intervalMs: number): void; /** The cadence when the poll is the host's only binding: identity-only (1 s) with a recorded start, else 250 ms. */ readonly soleInterval: number; stop(): void; } export declare function supervisorPoll(ppid: number | undefined, recorded: { readonly ticks?: string; readonly time?: string; }, fire: (reason: string) => void, stopped: () => boolean): SupervisorPoll; //# sourceMappingURL=host-supervisor-poll.d.ts.map