(s: TraceSpan, ctx: LogViewContext)
| 108 | } |
| 109 | |
| 110 | async function fullSpan(s: TraceSpan, ctx: LogViewContext): Promise<FullSpan> { |
| 111 | const node: FullSpan = { |
| 112 | id: s.id, |
| 113 | blockId: s.blockId, |
| 114 | name: s.name, |
| 115 | type: s.type, |
| 116 | status: s.status, |
| 117 | durationMs: s.duration ?? 0, |
| 118 | startTime: s.startTime, |
| 119 | endTime: s.endTime, |
| 120 | } |
| 121 | if (s.cost) node.cost = s.cost |
| 122 | if (s.errorMessage) node.error = s.errorMessage |
| 123 | if (s.input !== undefined) node.input = await materializeField(s.input, ctx) |
| 124 | if (s.output !== undefined) node.output = await materializeField(s.output, ctx) |
| 125 | if (s.children && s.children.length > 0) { |
| 126 | node.children = await Promise.all(s.children.map((c) => fullSpan(c, ctx))) |
| 127 | } |
| 128 | return node |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Resolve a span field that may be inline OR a large-value ref/manifest. Falls |
no test coverage detected