* Build AgentDeps from InitDeps. `stdout` is suppressed for the same reason — * runInit owns output. The result is parsed from the captured JSON in the * caller, not forwarded to user stdout.
(deps: InitDeps, captureStdout?: (line: string) => void)
| 137 | * caller, not forwarded to user stdout. |
| 138 | */ |
| 139 | function toAgentDeps(deps: InitDeps, captureStdout?: (line: string) => void): AgentDeps { |
| 140 | return { |
| 141 | cwd: deps.cwd, |
| 142 | fs: deps.fs, |
| 143 | stdout: captureStdout ?? _suppressedStdout, |
| 144 | stderr: deps.stderr, |
| 145 | isTTY: deps.isTTY, |
| 146 | prompt: deps.agentPrompt, |
| 147 | }; |
| 148 | } |
| 149 | |
| 150 | // Discards stdout lines from sub-commands so runInit owns the output surface. |
| 151 | function _suppressedStdout(_line: string): void { |