MCPcopy Create free account
hub / github.com/anomalyco/opencode / event

Method event

packages/opencode/src/cli/cmd/run/footer.ts:390–475  ·  view source on GitHub ↗
(next: FooterEvent)

Source from the content-addressed store, hash-verified

388 }
389
390 public event(next: FooterEvent): void {
391 if (next.type === "turn.duration") {
392 const current = this.currentModel()
393 this.flush()
394 this.flushing = this.flushing
395 .then(() =>
396 this.scrollback.writeTurnSummary({
397 agent: this.options.agentLabel,
398 model: current ? modelInfo(this.providers(), current).model : this.state().model,
399 duration: next.duration,
400 }),
401 )
402 .catch((error) => {
403 this.flushError = error
404 })
405 return
406 }
407
408 if (next.type === "catalog") {
409 if (this.isGone) {
410 return
411 }
412
413 this.setAgents(next.agents)
414 this.setResources(next.resources)
415 if (next.commands !== undefined) {
416 this.setCommands(next.commands)
417 }
418 return
419 }
420
421 if (next.type === "models") {
422 if (this.isGone) {
423 return
424 }
425
426 this.setProviders(next.providers)
427 return
428 }
429
430 if (next.type === "variants") {
431 if (this.isGone) {
432 return
433 }
434
435 this.setVariants(next.variants)
436 this.setCurrentVariant(next.current)
437 return
438 }
439
440 if (next.type === "queued.prompts") {
441 if (this.isGone) {
442 return
443 }
444
445 this.setQueuedPrompts(next.prompts)
446 return
447 }

Callers 10

clearSubagentFunction · 0.45
showSubagentFunction · 0.45
emitFunction · 0.45
writeSessionOutputFunction · 0.45
createLayerFunction · 0.45
loadCatalogFunction · 0.45
runInteractiveRuntimeFunction · 0.45
runQueueFunction · 0.45
runMethod · 0.45

Calls 12

flushMethod · 0.95
clearNoticeTimerMethod · 0.95
clearInterruptTimerMethod · 0.95
clearExitTimerMethod · 0.95
patchMethod · 0.95
applyHeightMethod · 0.95
presentMethod · 0.95
modelInfoFunction · 0.90
eventPatchFunction · 0.85
writeTurnSummaryMethod · 0.80
stateMethod · 0.80
providersMethod · 0.45

Tested by

no test coverage detected