/** * Friendly stdout parsing for the shell adapter. A shell source emits JSON on * stdout; both `JSON.parse` and the Zod schema can reject it. A raw `ZodError` * stringifies to a JSON array of issues — cryptic, unattributed, and (for a * fetch array) repeated once per task. This module collapses that into a * single user-facing `TaskSourceOutputError` that names the source, the * command, and the offending field(s), with a targeted hint for the common * "missing `agent`" mistake. */ import type { z } from "zod"; export interface ShellParseContext { /** The source's configured `name`, surfaced so the user knows which source broke. */ sourceName: string; /** The contract method that produced the output, e.g. `"listTasks"` or `"getTask"`. */ command: string; } /** * Parse `stdout` as JSON and validate it against `schema`. On any failure, * throws a `TaskSourceOutputError` with a readable, source-attributed message * instead of a raw `SyntaxError` / `ZodError`. */ export declare function parseShellJson(schema: z.ZodType, stdout: string, context: ShellParseContext): T; //# sourceMappingURL=parseOutput.d.ts.map