UNPKG

@code-yeongyu/senpi

Version:

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

22 lines • 1.56 kB
import { LegacyRecordDepthError } from "./jsonl.ts"; import type { SessionEventWriter } from "./session-event-writer.ts"; /** * True when the JSON `text` nests arrays and objects deeper than `limit` (the record itself is level 1), scanned without * recursion. A text of at most `2 * limit` characters cannot, so short records cost one length compare. */ export declare function jsonTextDeeperThan(text: string, limit: number): boolean; /** The legacy records this writer refused or answered for, each reported once on stderr like other refusals. */ export declare class LegacyRecordRefusals { count: number; report(sessionId: string, refusal: LegacyRecordDepthError): void; reportReply(sessionId: string, command: string, cause: unknown): void; } /** * Queues one session record on the legacy wire. A REPLY that cannot be written, for any reason, is answered with the * typed `response_unwritable` error for its id and reported (senpi#5702, LEAD ruling superseding RULING-68's "refused, * never delivered" for replies). Any other record whose path overflows the stack is refused and reported, never thrown: * the session (and the worker carrying it) keeps running and the next record is delivered. Returns `enqueue`'s answer, * or true for a refused record, which is consumed (the session is neither closed nor over its output limit). */ export declare function enqueueLegacyRecord(writer: Pick<SessionEventWriter, "enqueue" | "legacyRefusals">, sessionId: string, record: object): boolean; //# sourceMappingURL=legacy-record-depth.d.ts.map