/** * Per-PROCESS subprocess run info, seeded by the bootstrap from the parent's * run/resume instruction before the compiled module is imported. * * A subprocess executes exactly one run per process, so module scope is the * correct lifetime here (the same arrangement as the bootstrap's * ipcPayloadLimit). Kept intentionally minimal so both `ipc.ts` and * `state/context.ts` / `node.ts` can read it without import cycles. Its only * runtime import is `asyncContext` (for `ipcChildDebug`'s best-effort statelog * emission); that edge is cycle-safe because asyncContext's value-chain * (bootstrapThreadStore -> threadStore -> statelogClient / messageThread) never * imports back into this module, ipc.ts, or the leaf senders. */ export type SubprocessRunInfo = { /** The parent's runId — the child adopts it instead of minting its own, * so child statelog events land in the same trace (runId persists across * pause/resume cycles, matching the in-process convention). */ runId?: string; /** Stable id for one logical child run, shared by every segment across * pause/resume cycles; distinguishes concurrent subprocesses within one * parent runId. */ subprocessSessionId?: string; /** The parent's `subprocessRun` span id — the child's statelog client * adopts it as an external root so child spans nest under the parent's * span tree. */ parentSpanId?: string; /** Nesting depth of this process: 0 = root (not a subprocess). */ depth: number; /** The tightest maxDepth cap along the ancestor chain — a child's own * run() calls can never exceed an ancestor's cap. */ maxDepth?: number; }; /** Whether this process is a forked Agency subprocess (AGENCY_IPC=1 is set * by `buildForkOptions` before every fork). The single source of truth for * the mode signal — ipc.ts and the telemetry leaf both read it from here. */ export declare function isIpcMode(): boolean; /** Emit one child-side IPC diagnostic. Shared by callbackForwarding.ts and * costTelemetry.ts (ipcLog in ipc.ts is unreachable from these leaves without * violating the layering rule). Two independent sinks: * - statelog `debug` event (best-effort) so the diagnostic is visible in the * trace when observability is on — resolved from the active ALS frame's * ctx.statelogClient; no-ops with no frame/client, never throws; * - stderr, gated on AGENCY_IPC_DEBUG=1, for local IPC debugging. */ export declare function ipcChildDebug(line: string): void; export declare function setSubprocessRunInfo(next: SubprocessRunInfo): void; export declare function getSubprocessRunInfo(): SubprocessRunInfo;