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

Function composeFooter

packages/opencode/src/cli/cmd/run/stream.transport.ts:311–362  ·  view source on GitHub ↗
(input: {
  patch?: FooterPatch
  subagent?: FooterSubagentState
  current: FooterView
  previous: FooterView
})

Source from the content-addressed store, hash-verified

309}
310
311function composeFooter(input: {
312 patch?: FooterPatch
313 subagent?: FooterSubagentState
314 current: FooterView
315 previous: FooterView
316}) {
317 let footer: FooterOutput | undefined
318
319 if (input.subagent) {
320 footer = {
321 ...footer,
322 subagent: input.subagent,
323 }
324 }
325
326 if (!sameView(input.previous, input.current)) {
327 footer = {
328 ...footer,
329 view: input.current,
330 }
331 }
332
333 if (input.current.type !== "prompt") {
334 footer = {
335 ...footer,
336 patch: {
337 ...input.patch,
338 status: blockerStatus(input.current),
339 },
340 }
341 return footer
342 }
343
344 if (input.patch) {
345 footer = {
346 ...footer,
347 patch: input.patch,
348 }
349 return footer
350 }
351
352 if (input.previous.type !== "prompt") {
353 footer = {
354 ...footer,
355 patch: {
356 status: "",
357 },
358 }
359 }
360
361 return footer
362}
363
364function traceTabs(trace: Trace | undefined, prev: FooterSubagentTab[], next: FooterSubagentTab[]) {
365 const before = new Map(prev.map((item) => [item.sessionID, item]))

Callers 1

syncFooterFunction · 0.85

Calls 2

blockerStatusFunction · 0.90
sameViewFunction · 0.85

Tested by

no test coverage detected