/** * Interprets `agy`'s *output channels* (as opposed to agyTranscript.ts, which * reads its on-disk files). Two Phase 3 paths live here, both aimed at getting a * real answer off stdout so the transcript scrape can retire: * 1. parseAgyJsonResponse — read `agy --output-format json` cleanly. * 2. runAgyUnderPty — coax a TTY-only build into actually printing, via a * pseudo-terminal, without touching any private files (S1b). */ /** * Best-effort extraction of the model reply from `agy --output-format json` * stdout. agy's JSON schema isn't documented yet, so we accept the shapes it is * likely to emit and return undefined otherwise (the caller then tries plain * stdout, then the transcript). Accepts a single object, JSONL, or a stream of * transcript entries. */ export declare function parseAgyJsonResponse(stdout: string): string | undefined; /** POSIX single-quote a token so it is inert inside an `sh -c` command string. */ export declare function shSingleQuote(token: string): string; /** Remove the `script(1)` banner lines and CRs so we keep only the child output. */ export declare function stripScriptNoise(raw: string): string; /** Whether the opt-in PTY recovery path is enabled (AGY_MCP_PTY=1). */ export declare function ptyEnabled(env?: NodeJS.ProcessEnv): boolean; /** * Run `agy ` under a pseudo-terminal via the `script(1)` utility, so a build * that only streams output to a TTY still gives us real stdout — recovering the * answer without reading any of agy's private transcript files (Phase 3, S1b). * * Opt-in (AGY_MCP_PTY=1), POSIX-only, and best-effort: resolves to "" if `script` * is missing or yields nothing, so the caller falls through to transcript * recovery. The agy path and every arg are POSIX-quoted, preserving the * shell-injection safety of the non-PTY path. */ export declare function runAgyUnderPty(args: string[], onProgress?: (newOutput: string) => void): Promise; //# sourceMappingURL=agyOutput.d.ts.map