UNPKG

@code-yeongyu/senpi

Version:

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

41 lines • 2.35 kB
import type { SessionControlDrainResult, SessionControlWakeEvent, SessionControlWakeReason } from "../../core/extensions/session-control-types.ts"; type WakePass = (event: SessionControlWakeEvent) => Promise<SessionControlDrainResult>; export declare class WakeScheduler { private running; private disposed; private next; private readonly pass; private readonly onError; constructor(pass: WakePass, onError: (error: unknown) => void); /** Resolves with the result of the pass that covers this edge. */ request(reason: SessionControlWakeReason, deliveryIds?: readonly string[]): Promise<SessionControlDrainResult>; dispose(): void; private run; } /** Prefix of the engine's own entries in an inbox; a registrant never treats them as deliveries. */ export declare const INBOX_ENGINE_ENTRY_PREFIX = ".senpi-"; /** A live inbox watch. `armed` settles once arming did: the watch confirmed, the bounded retry ran out, or it was stopped. */ export interface InboxWatch { readonly armed: Promise<void>; stop(): void; } /** * One watch on the inbox directory. Creation and teardown run on the shared watch worker (FSEvents * and inotify setup/teardown block the calling thread), so neither ever stalls the terminal. * * The worker arms the watch asynchronously, and an entry written before it is armed produces no * event. Arming is confirmed by a sentinel entry's own event coming back - the sentinel is re-touched * until then, bounded, which is the only timer here and runs only while arming (an unconfirmed arm is * reported through `onError`). Nothing waits on that confirmation: the watch is returned at once and * `armed` settles when arming did, so the caller can request the pass that picks up anything created * before the watch could see it. */ export declare function watchInbox(inboxDir: string, onChange: () => void, onError: (error: unknown) => void): Promise<InboxWatch>; /** * A continue after any stop (`^Z` or an external SIGSTOP) wakes the drain once the terminal has been * restored: the listener is persistent, so every stop/continue cycle is covered, and it defers past * the handlers that restore the terminal on the same signal. */ export declare function onProcessContinue(listener: () => void): () => void; export {}; //# sourceMappingURL=session-control-wake.d.ts.map