| 25 | // ── Types ──────────────────────────────────────────────────────────── |
| 26 | |
| 27 | export interface MetadataEvent { |
| 28 | id: string |
| 29 | timestamp: number |
| 30 | |
| 31 | // Request shape |
| 32 | endpoint: string |
| 33 | mode: 'standard' | 'ultraplinian' |
| 34 | tier?: string // fast | standard | full (ultraplinian only) |
| 35 | stream: boolean |
| 36 | |
| 37 | // Pipeline config (what was enabled, not what it produced) |
| 38 | pipeline: { |
| 39 | godmode: boolean |
| 40 | autotune: boolean |
| 41 | parseltongue: boolean |
| 42 | stm_modules: string[] |
| 43 | strategy?: string |
| 44 | } |
| 45 | |
| 46 | // AutoTune metadata (context detection only, no content) |
| 47 | autotune?: { |
| 48 | detected_context: string |
| 49 | confidence: number |
| 50 | } |
| 51 | |
| 52 | // Model metadata |
| 53 | model?: string // single-model mode |
| 54 | models_queried?: number // ultraplinian |
| 55 | models_succeeded?: number |
| 56 | |
| 57 | // Per-model results (no content, just numbers) |
| 58 | model_results?: Array<{ |
| 59 | model: string |
| 60 | score: number |
| 61 | duration_ms: number |
| 62 | success: boolean |
| 63 | content_length: number |
| 64 | error_type?: string // categorized: 'timeout' | 'rate_limit' | 'auth' | 'model_error' | 'empty' | 'unknown' |
| 65 | }> |
| 66 | |
| 67 | // Winner metadata |
| 68 | winner?: { |
| 69 | model: string |
| 70 | score: number |
| 71 | duration_ms: number |
| 72 | content_length: number |
| 73 | } |
| 74 | |
| 75 | // Response metadata |
| 76 | total_duration_ms: number |
| 77 | response_length: number |
| 78 | |
| 79 | // Liquid Response metadata (streaming upgrades) |
| 80 | liquid?: { |
| 81 | upgrades: number // how many leader changes happened |
| 82 | first_response_ms: number // time to first leader |
| 83 | } |
| 84 | } |
nothing calls this directly
no outgoing calls
no test coverage detected