MCPcopy Index your code
hub / github.com/anomalyco/opencode / writeSessionOutput

Function writeSessionOutput

packages/opencode/src/cli/cmd/run/stream.ts:141–175  ·  view source on GitHub ↗
(input: OutputInput, out: StreamOutput)

Source from the content-addressed store, hash-verified

139
140// Forwards reducer output to the footer: commits go to scrollback, patches update the status bar.
141export 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}

Callers 3

stream.test.tsFile · 0.90
feedFunction · 0.90
syncFooterFunction · 0.90

Calls 5

traceSubagentStateFunction · 0.85
writeMethod · 0.80
patchFunction · 0.70
appendMethod · 0.45
eventMethod · 0.45

Tested by

no test coverage detected