Skip to content
TypeScript
2.1 KB
Raw Blame

Visualization

One data model (ComboMetrics from metrics.ts, FlowGraph from flow.ts) drives every renderer: the HTML report, the terminal renderer, and the TUI. Pick the delivery with --view.

Delivery modes (--view)

mode module behavior
inline (default) report.ts / flow.ts writes self-contained report.html + graph.html; prints paths
open viz/open.ts inline + opens report.html in the browser (xdg-open/open/start)
serve viz/serve.ts node:http server (no deps) at localhost:<--port> (default 7777) with a live run index; path-traversal guarded; served pages are the same self-contained files
term viz/terminal.ts ANSI bar charts (accuracy / total tok / cost / subagents), perspective picks, and an indented flow tree — no browser

Report (report.html) — self-contained, sections

0 best-by-perspective · 0.5 composite score (opt-in) · 1 accuracy · 2 efficiency (with best highlights) · 3 cost-performance scatter with Pareto frontier (frontier points ringed in rope-gold, dashed connector; <title> hovers) · 4 task pass/fail matrix · 5 flow graphs (+ node toggles) · 6 failure causes · 7 uncollected metrics. Themed hero (SVG wordmark) + philosophy footer. No external JS/CDN.

Flow graph (graph.html)

buildFlow() → FlowGraph (root + subagent nodes, depth via parentIdx, deterministic highest-cost highlight). renderGraphSvg() draws a card tree (gradient header, MAIN LOOP / SUB· tags, ⏱/tokens/cost, token bar, curved parent→child arrows with order badges). nodeDetailsBlock() adds native <details> toggles (skills / tools / steps / input / log) — zero JS. The terminal renderFlowTree() renders the same graph as a box-drawing tree.

TUI (tui/inkApp.ts)

Interactive ink app: runs list → combo table → combo detail (metrics + perspective picks + flow tree loaded from flow.json). Arrow keys / enter / ← back / q quit. JSX-free (React.createElement) and loaded via lazy dynamic import, so ink/react stay external to the bundle. Non-TTY, --rich, or missing ink → cli-table3 fallback (tui.ts).