UNPKG

@code-yeongyu/senpi

Version:

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

31 lines • 1.91 kB
/** * What `release_session { interrupt: true }` does to a busy session before its final check: it takes the * queued input out - reported back to the caller, never run here - then aborts the work and waits, bounded, * for it to settle. Taking the input is synchronous, so what it took is known before anything can fail. */ import type { AgentSession } from "../../core/agent-session.ts"; /** How long an `interrupt` release waits for the aborted work to settle before it re-checks. */ export declare const RELEASE_SETTLE_MS = 10000; /** What an `interrupt` release took out of the queues: delivery ids to redeliver, user text to restore. */ export interface ReleaseDropped { readonly deliveries: readonly string[]; readonly user_messages: readonly string[]; } export declare const NOTHING_DROPPED: ReleaseDropped; export interface ReleaseSettlePort { otherRequestsSettled(sessionId: string): Promise<void>; /** `prompt` calls the session's binding started that have not settled, preflight included. */ pendingPrompts(sessionId: string): readonly Promise<unknown>[]; } /** * Empties both queues. Queued deliveries leave the ledger unwritten, so their sender redelivers them to * the next owner; the user's queued text is returned in enqueue order for the caller to restore. A graceful close * takes them without aborting anything afterwards (`abortWillFollow: false`). */ export declare function takeQueuedInput(session: AgentSession, abortWillFollow?: boolean): ReleaseDropped; /** * Aborts the work, waits (bounded) for it to settle, then hands back the deliveries it left unwritten: their ids, for * the caller to report. Nothing is handed back while the session is still busy. */ export declare function abortAndSettle(port: ReleaseSettlePort, sessionId: string, session: AgentSession): Promise<readonly string[]>; //# sourceMappingURL=session-release-interrupt.d.ts.map