@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
22 lines • 1.2 kB
TypeScript
import type { Duplex } from "node:stream";
import type { RpcConnectionSink } from "./connection-handler.ts";
/**
* How long a CUT peer may still take to read the notice explaining its cut.
*
* A cut is always announced with one `overflow` record, but that record is written to a
* transport the peer has stopped reading, so it usually sits in this socket's userspace
* buffer. Destroying the socket there discards it and the client sees an unexplained EOF
* (#1774). Half-close instead: the pending bytes - notice included - are flushed as soon
* as the peer reads again, and only a peer that is still silent after this grace is
* destroyed, which keeps the teardown bounded for a peer that never returns.
*/
export declare const SOCKET_CUT_GRACE_MS = 5000;
/**
* The output side of one accepted socket connection.
*
* `writeRaw` receives already-serialized JSONL text; `waitForBackpressure` reports the
* transport's own `drain` signal, and `close` tears the connection down once its event
* queue can no longer deliver (byte overflow, dead-peer stall, write failure).
*/
export declare function socketSink(socket: Duplex): RpcConnectionSink;
//# sourceMappingURL=socket-sink.d.ts.map