(spans: TraceSpan[])
| 40 | |
| 41 | /** Project trace spans to a compact overview tree. Never materializes refs. */ |
| 42 | export function toOverview(spans: TraceSpan[]): OverviewSpan[] { |
| 43 | return spans.map((s) => { |
| 44 | const node: OverviewSpan = { |
| 45 | id: s.id, |
| 46 | blockId: s.blockId, |
| 47 | name: s.name, |
| 48 | type: s.type, |
| 49 | status: s.status, |
| 50 | durationMs: s.duration ?? 0, |
| 51 | } |
| 52 | if (s.cost) node.cost = s.cost |
| 53 | if (s.children && s.children.length > 0) node.children = toOverview(s.children) |
| 54 | return node |
| 55 | }) |
| 56 | } |
| 57 | |
| 58 | // --------------------------------------------------------------------------- |
| 59 | // Full (Level 3): block tree WITH materialized input/output. |
no outgoing calls
no test coverage detected