(input: OutputInput, out: StreamOutput)
| 139 | |
| 140 | // Forwards reducer output to the footer: commits go to scrollback, patches update the status bar. |
| 141 | export function writeSessionOutput(input: OutputInput, out: StreamOutput): void { |
| 142 | for (const commit of out.commits) { |
| 143 | input.trace?.write("ui.commit", commit) |
| 144 | input.footer.append(commit) |
| 145 | } |
| 146 | |
| 147 | if (out.footer?.patch) { |
| 148 | const next = patch(out.footer.patch) |
| 149 | input.trace?.write("ui.patch", next) |
| 150 | input.footer.event({ |
| 151 | type: "stream.patch", |
| 152 | patch: next, |
| 153 | }) |
| 154 | } |
| 155 | |
| 156 | if (out.footer?.subagent) { |
| 157 | input.trace?.write("ui.subagent", traceSubagentState(out.footer.subagent)) |
| 158 | input.footer.event({ |
| 159 | type: "stream.subagent", |
| 160 | state: out.footer.subagent, |
| 161 | }) |
| 162 | } |
| 163 | |
| 164 | if (!out.footer?.view) { |
| 165 | return |
| 166 | } |
| 167 | |
| 168 | input.trace?.write("ui.patch", { |
| 169 | view: out.footer.view, |
| 170 | }) |
| 171 | input.footer.event({ |
| 172 | type: "stream.view", |
| 173 | view: out.footer.view, |
| 174 | }) |
| 175 | } |
no test coverage detected