/** * Format a skill (or pipeline stage) invocation `output` for terminal display. * * The server typed `output` as `string`, but at runtime a structured skill * returns an object/array/null. `${result.invocation.output}` then coerced * that to `"[object Object]"` — "request paid, result unreadable" is the * worst possible failure mode, because it looks like success. This helper * prints each runtime case in a human-readable form and bounds the size so * a fat response doesn't lock up the user's terminal. * * Cases: * - string → verbatim (the dominant case; no transform) * - object / array → JSON.stringify(_, null, 2) * - null → "" (sentinel: empty block * would look like a * missing field) * - undefined → "" * - number / boolean / bigint → String(_) (so 42 prints "42", * not "[object Object]") * * Truncation: when the rendered string exceeds `maxBytes` (default 16 KB), * append `\n… [+N chars truncated]` — the same convention `commands/run.ts` * uses for debug previews. The marker tells the reader the output is not the * whole thing, and the count lets them react. */ /** * Default ceiling for the printed output, in characters (after rendering). * * 16 KB is well above the 2 KB / 4 KB limits `commands/run.ts` already uses * for LLM-response previews: skill output IS the product, not a debug aid, * so it warrants a larger budget. 16 KB is still small enough to keep the * terminal responsive on a fat JSON dump. */ export declare const MAX_OUTPUT_BYTES: number; export interface FormatOutputOptions { /** Override the truncation limit (in rendered characters). Test-only. */ maxBytes?: number; } /** Render an invocation output for human reading, with a bounded budget. */ export declare function formatSkillOutput(value: unknown, opts?: FormatOutputOptions): string;