(next: FooterEvent)
| 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 | } |
no test coverage detected