( d: TranscriptDraft, id: string, title: string, sections: PromptSection[], timestamp: string, ctx: TranscriptItemContext, acpSource?: string, )
| 555 | } |
| 556 | |
| 557 | function upsertMetadata( |
| 558 | d: TranscriptDraft, |
| 559 | id: string, |
| 560 | title: string, |
| 561 | sections: PromptSection[], |
| 562 | timestamp: string, |
| 563 | ctx: TranscriptItemContext, |
| 564 | acpSource?: string, |
| 565 | ) { |
| 566 | const existing = d.itemsById.get(id); |
| 567 | if (existing?.type === "metadata") { |
| 568 | replaceItem(d, id, { |
| 569 | ...existing, |
| 570 | sections, |
| 571 | channelId: ctx.channelId, |
| 572 | turnId: ctx.turnId ?? existing.turnId, |
| 573 | sessionId: ctx.sessionId ?? existing.sessionId, |
| 574 | acpSource: acpSource ?? existing.acpSource, |
| 575 | }); |
| 576 | return; |
| 577 | } |
| 578 | sealOpenMessages(d); |
| 579 | pushItem(d, { |
| 580 | id, |
| 581 | type: "metadata", |
| 582 | renderClass: "raw-rail", |
| 583 | title, |
| 584 | sections, |
| 585 | timestamp, |
| 586 | channelId: ctx.channelId, |
| 587 | turnId: ctx.turnId, |
| 588 | sessionId: ctx.sessionId, |
| 589 | acpSource, |
| 590 | }); |
| 591 | } |
| 592 | |
| 593 | function isTerminalToolStatus(status: ToolStatus) { |
| 594 | return status === "completed" || status === "failed"; |
no test coverage detected