/** * Chart renderer: PNG output for MCP image content blocks. * * Used by tools that produce time series or bar-shaped data to emit a real * chart (alongside the JSON envelope) so hosts that render image content * — Claude Desktop, ChatGPT Desktop — surface a visual the user can scan * in one glance. Hosts that don't render images ignore the block. * * Tech choice: chart.js + chartjs-node-canvas. Chart.js is the most-trained- * on charting library in LLM corpora; its output looks conventional to * agents and humans. The node-canvas dependency requires Cairo on Linux * (one-time install pain); on Mac it Just Works. When init fails, rendering * falls back to ASCII sparklines so a missing Cairo doesn't block tool * execution. * * All renderers return base64-encoded PNG so callers can drop the result * straight into a `{ type: 'image', data, mimeType: 'image/png' }` MCP * content block. */ export interface TimeseriesPoint { t: string | number; value: number; } export interface RenderResult { /** Base64-encoded PNG ready for an MCP image content block. */ base64: string; /** `image/png` literal so callers don't memorize it. */ mimeType: 'image/png'; } /** * Render a single-series timeseries chart. Used by `pattern_trend` and * the trend sparkline in `top_patterns` cards. */ export declare function renderTimeseries(points: TimeseriesPoint[], opts?: { title?: string; yLabel?: string; lineColor?: string; }): Promise; export interface BarRow { label: string; value: number; } /** * Render a horizontal bar chart. Used by `top_patterns` (top N patterns by * cost) and `services` (services by share). */ export declare function renderHorizontalBar(rows: BarRow[], opts?: { title?: string; xLabel?: string; barColor?: string; }): Promise;