import { Buffer } from "node:buffer"; import type { ProtocolOutputLimit } from "../../shared/types.ts"; export type { ProtocolOutputLimit } from "../../shared/types.ts"; export declare const MAX_CHILD_PENDING_LINE_BYTES: number; export declare const MAX_CHILD_STDERR_BYTES: number; export interface OversizedLineProjection { push(chunk: Buffer): boolean; finish(): string | undefined; } export interface OversizedLineProjector { accepts(prefix: string): boolean; create(): OversizedLineProjection; } /** * Pi JSON mode emits granular message/tool events followed by aggregate * `turn_end` and `agent_end` events that duplicate those payloads. Parallel * image reads can make one aggregate record exceed the child line limit even * though every granular event was valid. Replace only syntactically valid, * redundant records with the lifecycle fields the runners consume. */ export declare const PI_AGGREGATE_EVENT_PROJECTOR: OversizedLineProjector; export declare function formatProtocolOutputLimit(limit: ProtocolOutputLimit): string; export declare function createBoundedLineReader(options: { stream?: "stdout" | "stderr"; maxPendingLineBytes?: number; oversizedLineProjector?: OversizedLineProjector; onLine: (line: string) => void; onLimit: (limit: ProtocolOutputLimit) => void; }): { push(chunk: Buffer | string): void; end(): void; exceeded(): boolean; }; export declare function createBoundedByteTail(maxBytes?: number): { push(chunk: Buffer | string): void; text(): string; byteLength(): number; }; export type ChildLifecycleAction = "start-drain" | "cancel-drain" | "none"; export declare function projectChildLifecycle(event: { type?: string; willRetry?: unknown; }, terminalAssistantStop?: boolean): ChildLifecycleAction; //# sourceMappingURL=child-protocol.d.ts.map