/** * Node Command Invocation Adapter (DESIGN.md §2). * * This is the ONLY Module that reads process streams (`process.stdin`, * `process.stdout`, `process.stderr`), detects TTY state, or sets * `process.exitCode`. The executable imports `main` and this factory, * invokes `main`, and calls `adapter.setExitCode(status)`. * * `runQuietly` is reentrant and invocation-scoped: it owns * dependency-noise suppression (library console output) for the * complete command call and restores logging before returning so * notices and output are written with logging restored. * * Requirements: NFR-002, NFR-003, NFR-007. */ import type { CommandInvocationAdapter } from "./command-invocation.js"; /** * Reentrant, process-global console suppression: `console.*` are * replaced with no-ops for the duration of `operation` and restored on * exit (including on throw). Overlapping runs coordinate through * `quietDepth`, so only the outermost run captures and restores the * originals — inner runs (a per-op adapter inside an outer quiet run, * or several concurrent batch ops) neither double-capture nor * prematurely restore. * * Shared by the Node adapter's `runQuietly` and the batch runner's * per-op capture adapters, so a handler or provider library that logs * through `console.*` during a batch operation is quieted exactly like * a direct command invocation — it can never escape to the process * streams and corrupt the batch's single summary write. */ export declare function runQuietlyWithSuppressedConsole(operation: () => Promise): Promise; /** * Format a fatal load-failure message for the executable entrypoint. * * `bin/scoutline.js` calls this from its dynamic-import `.catch` handler * to produce the structured `LOAD_ERROR` envelope that reaches stderr. * P4-01 ensures the embedded message is run through the shared * `redactCredentialString` so any credential material in the import * error text is replaced before the value is emitted. */ export declare function formatLoadFailure(error: unknown): string; export declare function createNodeCommandInvocationAdapter(): CommandInvocationAdapter; /** * Collects an async byte stream into one buffer, stopping as soon as the * running total exceeds `maxBytes` (when given): the crossing chunk is * kept — its over-cap length is the caller's rejection evidence — and * breaking the for-await destroys the stream so an oversized pipe is cut * off at the producer instead of drained into memory. Exported for * bounded-read tests. */ export declare function readBytesBounded(input: AsyncIterable, maxBytes?: number): Promise; //# sourceMappingURL=node-command-invocation-adapter.d.ts.map