/** * tool-command-worker-result — pure result-assembly helpers for the external * tool command dispatch WORKER (ADR-0054). These translate the worker-side * {@link ResultAccumulator} plus the handler's return value into the * serializable {@link ToolCommandResult} the supervisor replays through the * host's `dispatchOutput`. They hold no effect and never touch `process` — the * orchestration/IPC concerns stay in `tool-command-worker-entry.ts`. */ import { type CommandSpec, type ToolCliContext, type ToolSessionContribution } from '@opensip-cli/core'; import { type ResultAccumulator } from './tool-command-worker-context.js'; import type { ToolCommandResult } from './tool-command-dispatch-types.js'; /** The completion shape a run-producing handler returns (the session leg the host persists). */ export interface MaybeCompletion { readonly session?: ToolSessionContribution; readonly envelope?: unknown; } /** Drain the accumulator + the handler's return into a serializable result. */ export declare function toResult(output: ToolCommandResult['output'], acc: ResultAccumulator, session: ToolSessionContribution | undefined, returned: unknown, captureCompletionEnvelope?: boolean): ToolCommandResult; /** * Fail loud when a return-valued handler (`command-result` / `signal-envelope`) * neither returned a value nor recorded an explicit final result — a silent * `undefined` would otherwise replay as an empty output. Tagged * `tool-handler-throw` so the supervisor surfaces a structured failure. */ export declare function assertReturnValuedHandlerResult(commandSpec: CommandSpec, acc: ResultAccumulator, returned: unknown): void; //# sourceMappingURL=tool-command-worker-result.d.ts.map