UNPKG

@code-yeongyu/senpi

Version:

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

29 lines • 2.06 kB
import type { RouterContext } from "./session-router-context.ts"; /** Disconnect semantics shared by socket loss and release_attachment. True means settlement owns the final release. */ export declare function releaseDisconnectAttachment(host: RouterContext, sessionId: string): Promise<boolean>; export declare function recordAttachment(host: RouterContext, owner: string, sessionId: string): void; /** * Releases every session a dropped connection still owned. Each handle goes through * the same refcounted close as an explicit close_session, so a session another * connection is still attached to keeps running and only the last owner tears it down. * Resolves to the sessions whose attachment is still counted: the ones that release when * their running turn settles, or every owned one while the host drains. */ export declare function releaseConnection(host: RouterContext, connectionId: string): Promise<string[]>; /** * One owned handle's refcounted close: the same sequence as an explicit * close_session, tolerant of races with other lifecycle paths (an entry * already closed or claimed elsewhere is simply skipped), except that it claims * a DETACH: a retained entry keeps running at zero attachments instead of * closing, so this path releases the client's claim without ending the session. * Disposal, pending * extension-UI cancellation and binding removal happen only when this was the * LAST attachment (the entry transitioned to "closing"): surviving * attachments keep the shared binding and their event stream. */ export declare function releaseOwnedSession(host: RouterContext, sessionId: string): Promise<void>; /** Detaches the closing connection from the session's record fanout. */ export declare function releaseOwnerAttachment(host: RouterContext, owner: string, sessionId: string): void; /** Drops per-connection records for a handle the host closed on its own. */ export declare function forgetSessionOwnership(host: RouterContext, sessionId: string): void; //# sourceMappingURL=session-router-attachments.d.ts.map