@genesislcap/ai-assistant 15.46.2-FUI-2628.3 → 15.46.3-FUI-0-form-export.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +499 -499
- package/package.json +17 -17
|
@@ -6410,340 +6410,318 @@
|
|
|
6410
6410
|
},
|
|
6411
6411
|
{
|
|
6412
6412
|
"kind": "javascript-module",
|
|
6413
|
-
"path": "src/
|
|
6413
|
+
"path": "src/state/ai-assistant-slice.ts",
|
|
6414
6414
|
"declarations": [
|
|
6415
|
+
{
|
|
6416
|
+
"kind": "function",
|
|
6417
|
+
"name": "createDefaultSessionState",
|
|
6418
|
+
"return": {
|
|
6419
|
+
"type": {
|
|
6420
|
+
"text": "AiAssistantSessionState"
|
|
6421
|
+
}
|
|
6422
|
+
},
|
|
6423
|
+
"description": "Build a fresh default session state. A factory (not just a shared const) so\neach call returns independent collections — `resetSession` can hand back a\nclean slate without aliasing the initial state's arrays."
|
|
6424
|
+
},
|
|
6415
6425
|
{
|
|
6416
6426
|
"kind": "variable",
|
|
6417
|
-
"name": "
|
|
6418
|
-
"
|
|
6427
|
+
"name": "defaultSessionState",
|
|
6428
|
+
"type": {
|
|
6429
|
+
"text": "AiAssistantSessionState"
|
|
6430
|
+
}
|
|
6431
|
+
},
|
|
6432
|
+
{
|
|
6433
|
+
"kind": "variable",
|
|
6434
|
+
"name": "aiAssistantSlice"
|
|
6419
6435
|
}
|
|
6420
6436
|
],
|
|
6421
6437
|
"exports": [
|
|
6422
6438
|
{
|
|
6423
6439
|
"kind": "js",
|
|
6424
|
-
"name": "
|
|
6440
|
+
"name": "createDefaultSessionState",
|
|
6425
6441
|
"declaration": {
|
|
6426
|
-
"name": "
|
|
6427
|
-
"module": "src/
|
|
6442
|
+
"name": "createDefaultSessionState",
|
|
6443
|
+
"module": "src/state/ai-assistant-slice.ts"
|
|
6428
6444
|
}
|
|
6429
|
-
}
|
|
6430
|
-
]
|
|
6431
|
-
},
|
|
6432
|
-
{
|
|
6433
|
-
"kind": "javascript-module",
|
|
6434
|
-
"path": "src/provider/assistant-app-settings.ts",
|
|
6435
|
-
"declarations": [
|
|
6445
|
+
},
|
|
6436
6446
|
{
|
|
6437
|
-
"kind": "
|
|
6438
|
-
"name": "
|
|
6439
|
-
"
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6447
|
+
"kind": "js",
|
|
6448
|
+
"name": "defaultSessionState",
|
|
6449
|
+
"declaration": {
|
|
6450
|
+
"name": "defaultSessionState",
|
|
6451
|
+
"module": "src/state/ai-assistant-slice.ts"
|
|
6452
|
+
}
|
|
6453
|
+
},
|
|
6443
6454
|
{
|
|
6444
6455
|
"kind": "js",
|
|
6445
|
-
"name": "
|
|
6456
|
+
"name": "aiAssistantSlice",
|
|
6446
6457
|
"declaration": {
|
|
6447
|
-
"name": "
|
|
6448
|
-
"module": "src/
|
|
6458
|
+
"name": "aiAssistantSlice",
|
|
6459
|
+
"module": "src/state/ai-assistant-slice.ts"
|
|
6449
6460
|
}
|
|
6450
6461
|
}
|
|
6451
6462
|
]
|
|
6452
6463
|
},
|
|
6453
6464
|
{
|
|
6454
6465
|
"kind": "javascript-module",
|
|
6455
|
-
"path": "src/
|
|
6466
|
+
"path": "src/state/debug-event-log.ts",
|
|
6456
6467
|
"declarations": [
|
|
6457
6468
|
{
|
|
6458
|
-
"kind": "
|
|
6459
|
-
"
|
|
6460
|
-
"
|
|
6461
|
-
|
|
6469
|
+
"kind": "variable",
|
|
6470
|
+
"name": "META_EVENT_IMPORTANCE",
|
|
6471
|
+
"type": {
|
|
6472
|
+
"text": "Record<MetaEventType, MetaEventImportance>"
|
|
6473
|
+
},
|
|
6474
|
+
"default": "{\n 'turn.error': 'high',\n 'tool.failed': 'high',\n 'subagent.failed': 'high',\n 'file.read-failed': 'high',\n 'suggestions.failed': 'high',\n 'context.threshold-crossed': 'high',\n 'context.compacted': 'high',\n 'persistence.restore-orphan': 'high',\n // A save that did not land is silent data loss in progress: the transcript on screen\n // is no longer backed by the store, and every later turn widens the gap. GENC-1511.\n 'persistence.save-failed': 'high',\n\n 'assistant.connected': 'normal',\n 'assistant.disconnected': 'normal',\n 'assistant.popout': 'normal',\n 'assistant.popin': 'normal',\n 'driver.created': 'normal',\n 'state.changed': 'normal',\n 'turn.start': 'normal',\n 'turn.end': 'normal',\n 'turn.retry': 'normal',\n 'tool.unresolved': 'normal',\n 'subagent.started': 'normal',\n 'subagent.completed': 'normal',\n // One per routing decision, with what the classifier answered and what the call cost. Same\n // level as the handoff it produces: you read them together to follow how a turn was routed.\n 'routing.decided': 'normal',\n 'agent.handoff': 'normal',\n 'agent.pinned': 'normal',\n 'agent.unpinned': 'normal',\n 'provider.selected': 'normal',\n 'interaction.requested': 'normal',\n 'interaction.resolved': 'normal',\n // Bookkeeping about an already-finished turn; interesting when reconciling a session total.\n 'interaction.external-cost': 'normal',\n // Spend that was billed but could NOT be recorded (the message was trimmed/condensed away, or\n // the value was not real spend). 'high': it is the one way the session total goes quietly\n // wrong, so it must stand out when reconciling.\n 'interaction.external-cost-dropped': 'high',\n // What came of an answer, recorded by the tool that asked (see recordInteractionOutcome).\n 'interaction.outcome': 'normal',\n // An outcome that could not be recorded: the widget goes on showing only the answer.\n 'interaction.outcome-dropped': 'high',\n 'external-diagnostics.folded': 'normal',\n 'session.cleared': 'normal',\n 'session.switched': 'low',\n 'session.switch-deferred': 'low',\n 'persistence.restored': 'normal',\n 'persistence.suppressed': 'normal',\n 'persistence.not-resumable': 'normal',\n\n 'driver.wired': 'low',\n 'driver.unwired': 'low',\n 'context.updated': 'low',\n 'context.condensed': 'low',\n 'panel.toggled': 'low',\n 'persistence.toggled': 'low',\n 'persistence.saved': 'low',\n 'attachment.added': 'low',\n}",
|
|
6475
|
+
"description": "Importance is intrinsic to the event *type*, not the instance, so it's\ndefined once here and stamped automatically by recordMetaEvent — call\nsites never pass it. The `Record` is exhaustive: adding a `MetaEventType`\nwithout a level here is a compile error.\n\n- `high` — failures and hard limits you almost always want to see.\n- `normal` — meaningful session flow you read to follow what happened.\n- `low` — frequent UI / bookkeeping noise, usually safe to skip."
|
|
6476
|
+
},
|
|
6477
|
+
{
|
|
6478
|
+
"kind": "function",
|
|
6479
|
+
"name": "recordMetaEvent",
|
|
6480
|
+
"return": {
|
|
6481
|
+
"type": {
|
|
6482
|
+
"text": "void"
|
|
6483
|
+
}
|
|
6484
|
+
},
|
|
6485
|
+
"parameters": [
|
|
6462
6486
|
{
|
|
6463
|
-
"
|
|
6464
|
-
"name": "vendors",
|
|
6487
|
+
"name": "key",
|
|
6465
6488
|
"type": {
|
|
6466
|
-
"text": "
|
|
6467
|
-
}
|
|
6468
|
-
"readonly": true
|
|
6489
|
+
"text": "string"
|
|
6490
|
+
}
|
|
6469
6491
|
},
|
|
6470
6492
|
{
|
|
6471
|
-
"
|
|
6472
|
-
"name": "options",
|
|
6493
|
+
"name": "type",
|
|
6473
6494
|
"type": {
|
|
6474
|
-
"text": "
|
|
6475
|
-
}
|
|
6476
|
-
"privacy": "private",
|
|
6477
|
-
"readonly": true,
|
|
6478
|
-
"default": "options"
|
|
6495
|
+
"text": "MetaEventType"
|
|
6496
|
+
}
|
|
6479
6497
|
},
|
|
6480
6498
|
{
|
|
6481
|
-
"
|
|
6482
|
-
"
|
|
6499
|
+
"name": "detail",
|
|
6500
|
+
"optional": true,
|
|
6483
6501
|
"type": {
|
|
6484
|
-
"text": "
|
|
6485
|
-
}
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6502
|
+
"text": "Record<string, unknown>"
|
|
6503
|
+
}
|
|
6504
|
+
}
|
|
6505
|
+
],
|
|
6506
|
+
"description": "Append a meta event to the timeline for `key`. Once the buffer exceeds\nDEFAULT_MAX_META_EVENTS, evicts the oldest *non-`high`* event;\n`high`-importance events are never evicted. An empty `key` is bucketed under\n`''`, matching how drivers/stores handle an absent session identity, so\ncallers never need to guard."
|
|
6507
|
+
},
|
|
6508
|
+
{
|
|
6509
|
+
"kind": "function",
|
|
6510
|
+
"name": "recordTurnError",
|
|
6511
|
+
"return": {
|
|
6512
|
+
"type": {
|
|
6513
|
+
"text": "void"
|
|
6514
|
+
}
|
|
6515
|
+
},
|
|
6516
|
+
"parameters": [
|
|
6489
6517
|
{
|
|
6490
|
-
"
|
|
6491
|
-
"name": "registry",
|
|
6518
|
+
"name": "key",
|
|
6492
6519
|
"type": {
|
|
6493
|
-
"text": "
|
|
6494
|
-
}
|
|
6495
|
-
"privacy": "private",
|
|
6496
|
-
"readonly": true
|
|
6520
|
+
"text": "string"
|
|
6521
|
+
}
|
|
6497
6522
|
},
|
|
6498
6523
|
{
|
|
6499
|
-
"
|
|
6500
|
-
"
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
"default": "new Set<(vendor: AITierVendor) => void>()"
|
|
6524
|
+
"name": "reason",
|
|
6525
|
+
"type": {
|
|
6526
|
+
"text": "TurnFailureReason"
|
|
6527
|
+
}
|
|
6504
6528
|
},
|
|
6505
6529
|
{
|
|
6506
|
-
"
|
|
6507
|
-
"
|
|
6530
|
+
"name": "detail",
|
|
6531
|
+
"optional": true,
|
|
6508
6532
|
"type": {
|
|
6509
|
-
"text": "
|
|
6510
|
-
}
|
|
6511
|
-
|
|
6512
|
-
|
|
6533
|
+
"text": "Record<string, unknown>"
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
],
|
|
6537
|
+
"description": "Record a turn-ending failure (`turn.error`, importance `high`). The `reason`\nis typed so the high-importance triage surface stays consistent; pass any\ndiagnostic specifics (attempt counts, offending tool names, etc.) in `detail`."
|
|
6538
|
+
},
|
|
6539
|
+
{
|
|
6540
|
+
"kind": "function",
|
|
6541
|
+
"name": "recordTurnRetry",
|
|
6542
|
+
"return": {
|
|
6543
|
+
"type": {
|
|
6544
|
+
"text": "void"
|
|
6545
|
+
}
|
|
6546
|
+
},
|
|
6547
|
+
"parameters": [
|
|
6513
6548
|
{
|
|
6514
|
-
"
|
|
6515
|
-
"name": "vendor",
|
|
6549
|
+
"name": "key",
|
|
6516
6550
|
"type": {
|
|
6517
|
-
"text": "
|
|
6518
|
-
}
|
|
6519
|
-
"readonly": true
|
|
6551
|
+
"text": "string"
|
|
6552
|
+
}
|
|
6520
6553
|
},
|
|
6521
6554
|
{
|
|
6522
|
-
"
|
|
6523
|
-
"
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
"text": "void"
|
|
6527
|
-
}
|
|
6528
|
-
},
|
|
6529
|
-
"parameters": [
|
|
6530
|
-
{
|
|
6531
|
-
"name": "vendor",
|
|
6532
|
-
"type": {
|
|
6533
|
-
"text": "string"
|
|
6534
|
-
}
|
|
6535
|
-
}
|
|
6536
|
-
],
|
|
6537
|
-
"description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
|
|
6555
|
+
"name": "reason",
|
|
6556
|
+
"type": {
|
|
6557
|
+
"text": "TurnFailureReason"
|
|
6558
|
+
}
|
|
6538
6559
|
},
|
|
6539
6560
|
{
|
|
6540
|
-
"
|
|
6541
|
-
"
|
|
6542
|
-
"
|
|
6543
|
-
"
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6561
|
+
"name": "detail",
|
|
6562
|
+
"optional": true,
|
|
6563
|
+
"type": {
|
|
6564
|
+
"text": "Record<string, unknown>"
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6567
|
+
],
|
|
6568
|
+
"description": "Record a recoverable retry *within* a turn (`turn.retry`, importance `normal`)\n— e.g. one malformed/empty attempt that will be retried, as distinct from the\nfinal attempt that bails out as a `turn.error`. Include `attempt`/`maxAttempts`\nin `detail` so the timeline shows which try this was."
|
|
6569
|
+
},
|
|
6570
|
+
{
|
|
6571
|
+
"kind": "function",
|
|
6572
|
+
"name": "getMetaEvents",
|
|
6573
|
+
"return": {
|
|
6574
|
+
"type": {
|
|
6575
|
+
"text": "ReadonlyArray<MetaEvent>"
|
|
6576
|
+
}
|
|
6577
|
+
},
|
|
6578
|
+
"parameters": [
|
|
6579
|
+
{
|
|
6580
|
+
"name": "key",
|
|
6581
|
+
"type": {
|
|
6582
|
+
"text": "string"
|
|
6583
|
+
}
|
|
6584
|
+
}
|
|
6585
|
+
],
|
|
6586
|
+
"description": "Returns the meta-event timeline for `key`, or an empty array if none recorded."
|
|
6587
|
+
},
|
|
6588
|
+
{
|
|
6589
|
+
"kind": "function",
|
|
6590
|
+
"name": "mergeMetaEvents",
|
|
6591
|
+
"return": {
|
|
6592
|
+
"type": {
|
|
6593
|
+
"text": "void"
|
|
6594
|
+
}
|
|
6595
|
+
},
|
|
6596
|
+
"parameters": [
|
|
6597
|
+
{
|
|
6598
|
+
"name": "targetKey",
|
|
6599
|
+
"type": {
|
|
6600
|
+
"text": "string"
|
|
6601
|
+
}
|
|
6556
6602
|
},
|
|
6557
6603
|
{
|
|
6558
|
-
"
|
|
6559
|
-
"
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
"text": "() => void"
|
|
6563
|
-
}
|
|
6564
|
-
},
|
|
6565
|
-
"parameters": [
|
|
6566
|
-
{
|
|
6567
|
-
"name": "listener",
|
|
6568
|
-
"type": {
|
|
6569
|
-
"text": "(vendor: string) => void"
|
|
6570
|
-
}
|
|
6571
|
-
}
|
|
6572
|
-
]
|
|
6573
|
-
},
|
|
6574
|
-
{
|
|
6575
|
-
"kind": "method",
|
|
6576
|
-
"name": "apply",
|
|
6577
|
-
"privacy": "private",
|
|
6578
|
-
"return": {
|
|
6579
|
-
"type": {
|
|
6580
|
-
"text": "void"
|
|
6581
|
-
}
|
|
6582
|
-
},
|
|
6583
|
-
"parameters": [
|
|
6584
|
-
{
|
|
6585
|
-
"name": "vendor",
|
|
6586
|
-
"type": {
|
|
6587
|
-
"text": "AITierVendor"
|
|
6588
|
-
}
|
|
6589
|
-
}
|
|
6590
|
-
],
|
|
6591
|
-
"description": "The registry move both entry points share, and nothing else."
|
|
6592
|
-
},
|
|
6593
|
-
{
|
|
6594
|
-
"kind": "method",
|
|
6595
|
-
"name": "build",
|
|
6596
|
-
"privacy": "private",
|
|
6597
|
-
"return": {
|
|
6598
|
-
"type": {
|
|
6599
|
-
"text": "Record<string, AIProvider>"
|
|
6600
|
-
}
|
|
6601
|
-
},
|
|
6602
|
-
"parameters": [
|
|
6603
|
-
{
|
|
6604
|
-
"name": "vendor",
|
|
6605
|
-
"type": {
|
|
6606
|
-
"text": "AITierVendor"
|
|
6607
|
-
}
|
|
6608
|
-
}
|
|
6609
|
-
]
|
|
6610
|
-
},
|
|
6611
|
-
{
|
|
6612
|
-
"kind": "method",
|
|
6613
|
-
"name": "isKnownVendor",
|
|
6614
|
-
"privacy": "private",
|
|
6615
|
-
"return": {
|
|
6616
|
-
"type": {
|
|
6617
|
-
"text": "vendor is AITierVendor"
|
|
6618
|
-
}
|
|
6619
|
-
},
|
|
6620
|
-
"parameters": [
|
|
6621
|
-
{
|
|
6622
|
-
"name": "vendor",
|
|
6623
|
-
"type": {
|
|
6624
|
-
"text": "string"
|
|
6625
|
-
}
|
|
6626
|
-
}
|
|
6627
|
-
]
|
|
6604
|
+
"name": "events",
|
|
6605
|
+
"type": {
|
|
6606
|
+
"text": "readonly MetaEvent[]"
|
|
6607
|
+
}
|
|
6628
6608
|
}
|
|
6629
|
-
]
|
|
6609
|
+
],
|
|
6610
|
+
"description": "Merge pre-built meta events into the timeline for `targetKey`, **preserving each\nevent's original `timestamp`** (so it interleaves chronologically on export)\nwhile re-indexing onto the target buffer's monotonic counter. Used to fold a\nsub-agent's harvested events into the parent session — see\n`ChatDriver.invokeSubAgent`. Unlike recordMetaEvent it does not stamp a\nfresh timestamp; the same non-`high` eviction policy is applied once after the\nbatch so the buffer stays bounded."
|
|
6630
6611
|
},
|
|
6631
6612
|
{
|
|
6632
6613
|
"kind": "function",
|
|
6633
|
-
"name": "
|
|
6614
|
+
"name": "clearSession",
|
|
6634
6615
|
"return": {
|
|
6635
6616
|
"type": {
|
|
6636
|
-
"text": "
|
|
6617
|
+
"text": "void"
|
|
6637
6618
|
}
|
|
6638
6619
|
},
|
|
6639
6620
|
"parameters": [
|
|
6640
6621
|
{
|
|
6641
|
-
"name": "
|
|
6642
|
-
"type": {
|
|
6643
|
-
"text": "Container"
|
|
6644
|
-
}
|
|
6645
|
-
},
|
|
6646
|
-
{
|
|
6647
|
-
"name": "options",
|
|
6622
|
+
"name": "key",
|
|
6648
6623
|
"type": {
|
|
6649
|
-
"text": "
|
|
6624
|
+
"text": "string"
|
|
6650
6625
|
}
|
|
6651
6626
|
}
|
|
6652
6627
|
],
|
|
6653
|
-
"description": "
|
|
6628
|
+
"description": "Drop the entire timeline for `key`. Used to discard a sub-agent's transient\nper-invocation session once its events have been harvested into the parent, so\nthe module registry doesn't accumulate one orphaned bucket per sub-agent run."
|
|
6629
|
+
},
|
|
6630
|
+
{
|
|
6631
|
+
"kind": "variable",
|
|
6632
|
+
"name": "DEBUG_LOG_README",
|
|
6633
|
+
"type": {
|
|
6634
|
+
"text": "readonly string[]"
|
|
6635
|
+
},
|
|
6636
|
+
"default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n \"kind:'event' type 'routing.decided' — how ONE turn was routed, emitted by the orchestrating driver before the agent runs (and again after every handoff). `decision` is why that agent was chosen: 'classified' (the classifier ran and picked one), 'no-match' (it ran and answered -1 — nothing listed covers the request), 'ballot-exhausted' (every eligible specialist had already handed off this turn, so the ballot was empty and NO call was made — distinct from 'no-match', where one ran and declined), 'pinned' (a user pin or an active stateful flow owned the turn, so no call was made), 'single-candidate'/'no-specialists' (configuration left nothing to decide), 'provider-unavailable' (the registry default exposes no chat()), 'classifier-failed' (every attempt threw — `error` carries the last one). `to` names the agent and `fallback` says whether that agent is the fallback. `candidates` is what was actually ON THE BALLOT, in ballot order, so `index` — the classifier's own answer — indexes it directly; `excluded` names the specialists left off because they already handed off this turn, so the full eligible set is `candidates` ∪ `excluded`. `candidates` is absent on the four decisions that put nothing to a vote — 'pinned', 'single-candidate', 'no-specialists', 'ballot-exhausted'. It IS present on 'provider-unavailable', which is not an exception worth removing: the ballot was built there, it simply never got sent. `attempts` covers the retry ladder. `durationMs` is on EVERY routing.decided, and is the field to read when a decision looks wrong: the four decisions that can reach the fallback are told apart by the clock as much as by their name, because a fallback routing that resolved in tens of milliseconds made no network call at all whatever its `decision` says.\",\n \"kind:'event' type 'routing.decided'.`usage` — what that classifier call cost, in the same four-bucket + costUsd shape as `sessionUsage`, plus `model`. Absent on the decisions that make no call (see 'pinned' and the configuration ones). THIS SPEND IS NOT IN `sessionUsage`: a classifier call never enters the transcript and `sessionUsage` is derived from the transcript, so classifier cost is missing from the session total by construction, not by accident. Sum these events to close that gap — it is the one component of a session's real spend that the totals cannot see.\",\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it. For a turn that went to the wrong agent, read its routing.decided first — `decision` says whether anything was actually asked.',\n]",
|
|
6637
|
+
"description": "Human/agent-facing guide emitted as the first key of the exported debug log,\nso whoever opens the JSON (often an AI agent) knows how to read it without\nreverse-engineering the shape. Kept here next to the event catalogue it\ndescribes — but proximity alone demonstrably did NOT keep the two in sync\n(`refusal` was missing from both reason lists for a whole release), so\n`debug-event-log.test.ts` now asserts that every `TurnFailureReason` and every\n`SubAgentFailureReason` is named here, and fails the build when one is added\nwithout a matching sentence. Enumerations below read as exhaustive and WILL be\ntrusted by an agent reading the JSON — keep them so."
|
|
6654
6638
|
}
|
|
6655
6639
|
],
|
|
6656
6640
|
"exports": [
|
|
6657
6641
|
{
|
|
6658
6642
|
"kind": "js",
|
|
6659
|
-
"name": "
|
|
6643
|
+
"name": "META_EVENT_IMPORTANCE",
|
|
6660
6644
|
"declaration": {
|
|
6661
|
-
"name": "
|
|
6662
|
-
"module": "src/
|
|
6645
|
+
"name": "META_EVENT_IMPORTANCE",
|
|
6646
|
+
"module": "src/state/debug-event-log.ts"
|
|
6663
6647
|
}
|
|
6664
6648
|
},
|
|
6665
6649
|
{
|
|
6666
6650
|
"kind": "js",
|
|
6667
|
-
"name": "
|
|
6651
|
+
"name": "recordMetaEvent",
|
|
6668
6652
|
"declaration": {
|
|
6669
|
-
"name": "
|
|
6670
|
-
"module": "src/
|
|
6653
|
+
"name": "recordMetaEvent",
|
|
6654
|
+
"module": "src/state/debug-event-log.ts"
|
|
6671
6655
|
}
|
|
6672
|
-
}
|
|
6673
|
-
]
|
|
6674
|
-
},
|
|
6675
|
-
{
|
|
6676
|
-
"kind": "javascript-module",
|
|
6677
|
-
"path": "src/state/ai-assistant-slice.ts",
|
|
6678
|
-
"declarations": [
|
|
6656
|
+
},
|
|
6679
6657
|
{
|
|
6680
|
-
"kind": "
|
|
6681
|
-
"name": "
|
|
6682
|
-
"
|
|
6683
|
-
"
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
},
|
|
6687
|
-
"description": "Build a fresh default session state. A factory (not just a shared const) so\neach call returns independent collections — `resetSession` can hand back a\nclean slate without aliasing the initial state's arrays."
|
|
6658
|
+
"kind": "js",
|
|
6659
|
+
"name": "TurnFailureReason",
|
|
6660
|
+
"declaration": {
|
|
6661
|
+
"name": "TurnFailureReason",
|
|
6662
|
+
"module": "src/state/debug-event-log.ts"
|
|
6663
|
+
}
|
|
6688
6664
|
},
|
|
6689
6665
|
{
|
|
6690
|
-
"kind": "
|
|
6691
|
-
"name": "
|
|
6692
|
-
"
|
|
6693
|
-
"
|
|
6666
|
+
"kind": "js",
|
|
6667
|
+
"name": "recordTurnError",
|
|
6668
|
+
"declaration": {
|
|
6669
|
+
"name": "recordTurnError",
|
|
6670
|
+
"module": "src/state/debug-event-log.ts"
|
|
6694
6671
|
}
|
|
6695
6672
|
},
|
|
6696
6673
|
{
|
|
6697
|
-
"kind": "
|
|
6698
|
-
"name": "
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6674
|
+
"kind": "js",
|
|
6675
|
+
"name": "recordTurnRetry",
|
|
6676
|
+
"declaration": {
|
|
6677
|
+
"name": "recordTurnRetry",
|
|
6678
|
+
"module": "src/state/debug-event-log.ts"
|
|
6679
|
+
}
|
|
6680
|
+
},
|
|
6702
6681
|
{
|
|
6703
6682
|
"kind": "js",
|
|
6704
|
-
"name": "
|
|
6683
|
+
"name": "getMetaEvents",
|
|
6705
6684
|
"declaration": {
|
|
6706
|
-
"name": "
|
|
6707
|
-
"module": "src/state/
|
|
6685
|
+
"name": "getMetaEvents",
|
|
6686
|
+
"module": "src/state/debug-event-log.ts"
|
|
6708
6687
|
}
|
|
6709
6688
|
},
|
|
6710
6689
|
{
|
|
6711
6690
|
"kind": "js",
|
|
6712
|
-
"name": "
|
|
6691
|
+
"name": "mergeMetaEvents",
|
|
6713
6692
|
"declaration": {
|
|
6714
|
-
"name": "
|
|
6715
|
-
"module": "src/state/
|
|
6693
|
+
"name": "mergeMetaEvents",
|
|
6694
|
+
"module": "src/state/debug-event-log.ts"
|
|
6716
6695
|
}
|
|
6717
6696
|
},
|
|
6718
6697
|
{
|
|
6719
6698
|
"kind": "js",
|
|
6720
|
-
"name": "
|
|
6699
|
+
"name": "clearSession",
|
|
6721
6700
|
"declaration": {
|
|
6722
|
-
"name": "
|
|
6723
|
-
"module": "src/state/
|
|
6701
|
+
"name": "clearSession",
|
|
6702
|
+
"module": "src/state/debug-event-log.ts"
|
|
6703
|
+
}
|
|
6704
|
+
},
|
|
6705
|
+
{
|
|
6706
|
+
"kind": "js",
|
|
6707
|
+
"name": "DEBUG_LOG_README",
|
|
6708
|
+
"declaration": {
|
|
6709
|
+
"name": "DEBUG_LOG_README",
|
|
6710
|
+
"module": "src/state/debug-event-log.ts"
|
|
6724
6711
|
}
|
|
6725
6712
|
}
|
|
6726
6713
|
]
|
|
6727
6714
|
},
|
|
6728
6715
|
{
|
|
6729
6716
|
"kind": "javascript-module",
|
|
6730
|
-
"path": "src/state/
|
|
6717
|
+
"path": "src/state/driver-registry.ts",
|
|
6731
6718
|
"declarations": [
|
|
6732
|
-
{
|
|
6733
|
-
"kind": "variable",
|
|
6734
|
-
"name": "META_EVENT_IMPORTANCE",
|
|
6735
|
-
"type": {
|
|
6736
|
-
"text": "Record<MetaEventType, MetaEventImportance>"
|
|
6737
|
-
},
|
|
6738
|
-
"default": "{\n 'turn.error': 'high',\n 'tool.failed': 'high',\n 'subagent.failed': 'high',\n 'file.read-failed': 'high',\n 'suggestions.failed': 'high',\n 'context.threshold-crossed': 'high',\n 'context.compacted': 'high',\n 'persistence.restore-orphan': 'high',\n // A save that did not land is silent data loss in progress: the transcript on screen\n // is no longer backed by the store, and every later turn widens the gap. GENC-1511.\n 'persistence.save-failed': 'high',\n\n 'assistant.connected': 'normal',\n 'assistant.disconnected': 'normal',\n 'assistant.popout': 'normal',\n 'assistant.popin': 'normal',\n 'driver.created': 'normal',\n 'state.changed': 'normal',\n 'turn.start': 'normal',\n 'turn.end': 'normal',\n 'turn.retry': 'normal',\n 'tool.unresolved': 'normal',\n 'subagent.started': 'normal',\n 'subagent.completed': 'normal',\n // One per routing decision, with what the classifier answered and what the call cost. Same\n // level as the handoff it produces: you read them together to follow how a turn was routed.\n 'routing.decided': 'normal',\n 'agent.handoff': 'normal',\n 'agent.pinned': 'normal',\n 'agent.unpinned': 'normal',\n 'provider.selected': 'normal',\n 'interaction.requested': 'normal',\n 'interaction.resolved': 'normal',\n // Bookkeeping about an already-finished turn; interesting when reconciling a session total.\n 'interaction.external-cost': 'normal',\n // Spend that was billed but could NOT be recorded (the message was trimmed/condensed away, or\n // the value was not real spend). 'high': it is the one way the session total goes quietly\n // wrong, so it must stand out when reconciling.\n 'interaction.external-cost-dropped': 'high',\n // What came of an answer, recorded by the tool that asked (see recordInteractionOutcome).\n 'interaction.outcome': 'normal',\n // An outcome that could not be recorded: the widget goes on showing only the answer.\n 'interaction.outcome-dropped': 'high',\n 'external-diagnostics.folded': 'normal',\n 'session.cleared': 'normal',\n 'session.switched': 'low',\n 'session.switch-deferred': 'low',\n 'persistence.restored': 'normal',\n 'persistence.suppressed': 'normal',\n 'persistence.not-resumable': 'normal',\n\n 'driver.wired': 'low',\n 'driver.unwired': 'low',\n 'context.updated': 'low',\n 'context.condensed': 'low',\n 'panel.toggled': 'low',\n 'persistence.toggled': 'low',\n 'persistence.saved': 'low',\n 'attachment.added': 'low',\n}",
|
|
6739
|
-
"description": "Importance is intrinsic to the event *type*, not the instance, so it's\ndefined once here and stamped automatically by recordMetaEvent — call\nsites never pass it. The `Record` is exhaustive: adding a `MetaEventType`\nwithout a level here is a compile error.\n\n- `high` — failures and hard limits you almost always want to see.\n- `normal` — meaningful session flow you read to follow what happened.\n- `low` — frequent UI / bookkeeping noise, usually safe to skip."
|
|
6740
|
-
},
|
|
6741
6719
|
{
|
|
6742
6720
|
"kind": "function",
|
|
6743
|
-
"name": "
|
|
6721
|
+
"name": "getOrCreateDriver",
|
|
6744
6722
|
"return": {
|
|
6745
6723
|
"type": {
|
|
6746
|
-
"text": "
|
|
6724
|
+
"text": "AiDriver"
|
|
6747
6725
|
}
|
|
6748
6726
|
},
|
|
6749
6727
|
"parameters": [
|
|
@@ -6754,27 +6732,26 @@
|
|
|
6754
6732
|
}
|
|
6755
6733
|
},
|
|
6756
6734
|
{
|
|
6757
|
-
"name": "
|
|
6735
|
+
"name": "agentsKey",
|
|
6758
6736
|
"type": {
|
|
6759
|
-
"text": "
|
|
6737
|
+
"text": "string"
|
|
6760
6738
|
}
|
|
6761
6739
|
},
|
|
6762
6740
|
{
|
|
6763
|
-
"name": "
|
|
6764
|
-
"optional": true,
|
|
6741
|
+
"name": "factory",
|
|
6765
6742
|
"type": {
|
|
6766
|
-
"text": "
|
|
6743
|
+
"text": "() => AiDriver"
|
|
6767
6744
|
}
|
|
6768
6745
|
}
|
|
6769
6746
|
],
|
|
6770
|
-
"description": "
|
|
6747
|
+
"description": "Returns the existing driver for the given key, or calls the factory to create\nand register a new one. `agentsKey` is the fingerprint of the agents the\ndriver is being built for; it is recorded only when a driver is created (a\nreused driver keeps the fingerprint it was originally built with)."
|
|
6771
6748
|
},
|
|
6772
6749
|
{
|
|
6773
6750
|
"kind": "function",
|
|
6774
|
-
"name": "
|
|
6751
|
+
"name": "getDriver",
|
|
6775
6752
|
"return": {
|
|
6776
6753
|
"type": {
|
|
6777
|
-
"text": "
|
|
6754
|
+
"text": "AiDriver | undefined"
|
|
6778
6755
|
}
|
|
6779
6756
|
},
|
|
6780
6757
|
"parameters": [
|
|
@@ -6783,29 +6760,16 @@
|
|
|
6783
6760
|
"type": {
|
|
6784
6761
|
"text": "string"
|
|
6785
6762
|
}
|
|
6786
|
-
},
|
|
6787
|
-
{
|
|
6788
|
-
"name": "reason",
|
|
6789
|
-
"type": {
|
|
6790
|
-
"text": "TurnFailureReason"
|
|
6791
|
-
}
|
|
6792
|
-
},
|
|
6793
|
-
{
|
|
6794
|
-
"name": "detail",
|
|
6795
|
-
"optional": true,
|
|
6796
|
-
"type": {
|
|
6797
|
-
"text": "Record<string, unknown>"
|
|
6798
|
-
}
|
|
6799
6763
|
}
|
|
6800
6764
|
],
|
|
6801
|
-
"description": "
|
|
6765
|
+
"description": "Returns the existing driver for the given key, or `undefined`."
|
|
6802
6766
|
},
|
|
6803
6767
|
{
|
|
6804
6768
|
"kind": "function",
|
|
6805
|
-
"name": "
|
|
6769
|
+
"name": "getDriverAgentsKey",
|
|
6806
6770
|
"return": {
|
|
6807
6771
|
"type": {
|
|
6808
|
-
"text": "
|
|
6772
|
+
"text": "string | undefined"
|
|
6809
6773
|
}
|
|
6810
6774
|
},
|
|
6811
6775
|
"parameters": [
|
|
@@ -6814,29 +6778,16 @@
|
|
|
6814
6778
|
"type": {
|
|
6815
6779
|
"text": "string"
|
|
6816
6780
|
}
|
|
6817
|
-
},
|
|
6818
|
-
{
|
|
6819
|
-
"name": "reason",
|
|
6820
|
-
"type": {
|
|
6821
|
-
"text": "TurnFailureReason"
|
|
6822
|
-
}
|
|
6823
|
-
},
|
|
6824
|
-
{
|
|
6825
|
-
"name": "detail",
|
|
6826
|
-
"optional": true,
|
|
6827
|
-
"type": {
|
|
6828
|
-
"text": "Record<string, unknown>"
|
|
6829
|
-
}
|
|
6830
6781
|
}
|
|
6831
6782
|
],
|
|
6832
|
-
"description": "
|
|
6783
|
+
"description": "The agents fingerprint the registry driver for `key` was built with, or\n`undefined` if no driver is registered. Used by `agentsChanged` to decide\nwhether a sibling has already rebuilt the shared driver to the desired agents."
|
|
6833
6784
|
},
|
|
6834
6785
|
{
|
|
6835
6786
|
"kind": "function",
|
|
6836
|
-
"name": "
|
|
6787
|
+
"name": "deleteDriver",
|
|
6837
6788
|
"return": {
|
|
6838
6789
|
"type": {
|
|
6839
|
-
"text": "
|
|
6790
|
+
"text": "AiDriver | undefined"
|
|
6840
6791
|
}
|
|
6841
6792
|
},
|
|
6842
6793
|
"parameters": [
|
|
@@ -6847,232 +6798,17 @@
|
|
|
6847
6798
|
}
|
|
6848
6799
|
}
|
|
6849
6800
|
],
|
|
6850
|
-
"description": "
|
|
6851
|
-
}
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
"
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
{
|
|
6862
|
-
"name": "targetKey",
|
|
6863
|
-
"type": {
|
|
6864
|
-
"text": "string"
|
|
6865
|
-
}
|
|
6866
|
-
},
|
|
6867
|
-
{
|
|
6868
|
-
"name": "events",
|
|
6869
|
-
"type": {
|
|
6870
|
-
"text": "readonly MetaEvent[]"
|
|
6871
|
-
}
|
|
6872
|
-
}
|
|
6873
|
-
],
|
|
6874
|
-
"description": "Merge pre-built meta events into the timeline for `targetKey`, **preserving each\nevent's original `timestamp`** (so it interleaves chronologically on export)\nwhile re-indexing onto the target buffer's monotonic counter. Used to fold a\nsub-agent's harvested events into the parent session — see\n`ChatDriver.invokeSubAgent`. Unlike recordMetaEvent it does not stamp a\nfresh timestamp; the same non-`high` eviction policy is applied once after the\nbatch so the buffer stays bounded."
|
|
6875
|
-
},
|
|
6876
|
-
{
|
|
6877
|
-
"kind": "function",
|
|
6878
|
-
"name": "clearSession",
|
|
6879
|
-
"return": {
|
|
6880
|
-
"type": {
|
|
6881
|
-
"text": "void"
|
|
6882
|
-
}
|
|
6883
|
-
},
|
|
6884
|
-
"parameters": [
|
|
6885
|
-
{
|
|
6886
|
-
"name": "key",
|
|
6887
|
-
"type": {
|
|
6888
|
-
"text": "string"
|
|
6889
|
-
}
|
|
6890
|
-
}
|
|
6891
|
-
],
|
|
6892
|
-
"description": "Drop the entire timeline for `key`. Used to discard a sub-agent's transient\nper-invocation session once its events have been harvested into the parent, so\nthe module registry doesn't accumulate one orphaned bucket per sub-agent run."
|
|
6893
|
-
},
|
|
6894
|
-
{
|
|
6895
|
-
"kind": "variable",
|
|
6896
|
-
"name": "DEBUG_LOG_README",
|
|
6897
|
-
"type": {
|
|
6898
|
-
"text": "readonly string[]"
|
|
6899
|
-
},
|
|
6900
|
-
"default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n \"kind:'event' type 'routing.decided' — how ONE turn was routed, emitted by the orchestrating driver before the agent runs (and again after every handoff). `decision` is why that agent was chosen: 'classified' (the classifier ran and picked one), 'no-match' (it ran and answered -1 — nothing listed covers the request), 'ballot-exhausted' (every eligible specialist had already handed off this turn, so the ballot was empty and NO call was made — distinct from 'no-match', where one ran and declined), 'pinned' (a user pin or an active stateful flow owned the turn, so no call was made), 'single-candidate'/'no-specialists' (configuration left nothing to decide), 'provider-unavailable' (the registry default exposes no chat()), 'classifier-failed' (every attempt threw — `error` carries the last one). `to` names the agent and `fallback` says whether that agent is the fallback. `candidates` is what was actually ON THE BALLOT, in ballot order, so `index` — the classifier's own answer — indexes it directly; `excluded` names the specialists left off because they already handed off this turn, so the full eligible set is `candidates` ∪ `excluded`. `candidates` is absent on the four decisions that put nothing to a vote — 'pinned', 'single-candidate', 'no-specialists', 'ballot-exhausted'. It IS present on 'provider-unavailable', which is not an exception worth removing: the ballot was built there, it simply never got sent. `attempts` covers the retry ladder. `durationMs` is on EVERY routing.decided, and is the field to read when a decision looks wrong: the four decisions that can reach the fallback are told apart by the clock as much as by their name, because a fallback routing that resolved in tens of milliseconds made no network call at all whatever its `decision` says.\",\n \"kind:'event' type 'routing.decided'.`usage` — what that classifier call cost, in the same four-bucket + costUsd shape as `sessionUsage`, plus `model`. Absent on the decisions that make no call (see 'pinned' and the configuration ones). THIS SPEND IS NOT IN `sessionUsage`: a classifier call never enters the transcript and `sessionUsage` is derived from the transcript, so classifier cost is missing from the session total by construction, not by accident. Sum these events to close that gap — it is the one component of a session's real spend that the totals cannot see.\",\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it. For a turn that went to the wrong agent, read its routing.decided first — `decision` says whether anything was actually asked.',\n]",
|
|
6901
|
-
"description": "Human/agent-facing guide emitted as the first key of the exported debug log,\nso whoever opens the JSON (often an AI agent) knows how to read it without\nreverse-engineering the shape. Kept here next to the event catalogue it\ndescribes — but proximity alone demonstrably did NOT keep the two in sync\n(`refusal` was missing from both reason lists for a whole release), so\n`debug-event-log.test.ts` now asserts that every `TurnFailureReason` and every\n`SubAgentFailureReason` is named here, and fails the build when one is added\nwithout a matching sentence. Enumerations below read as exhaustive and WILL be\ntrusted by an agent reading the JSON — keep them so."
|
|
6902
|
-
}
|
|
6903
|
-
],
|
|
6904
|
-
"exports": [
|
|
6905
|
-
{
|
|
6906
|
-
"kind": "js",
|
|
6907
|
-
"name": "META_EVENT_IMPORTANCE",
|
|
6908
|
-
"declaration": {
|
|
6909
|
-
"name": "META_EVENT_IMPORTANCE",
|
|
6910
|
-
"module": "src/state/debug-event-log.ts"
|
|
6911
|
-
}
|
|
6912
|
-
},
|
|
6913
|
-
{
|
|
6914
|
-
"kind": "js",
|
|
6915
|
-
"name": "recordMetaEvent",
|
|
6916
|
-
"declaration": {
|
|
6917
|
-
"name": "recordMetaEvent",
|
|
6918
|
-
"module": "src/state/debug-event-log.ts"
|
|
6919
|
-
}
|
|
6920
|
-
},
|
|
6921
|
-
{
|
|
6922
|
-
"kind": "js",
|
|
6923
|
-
"name": "TurnFailureReason",
|
|
6924
|
-
"declaration": {
|
|
6925
|
-
"name": "TurnFailureReason",
|
|
6926
|
-
"module": "src/state/debug-event-log.ts"
|
|
6927
|
-
}
|
|
6928
|
-
},
|
|
6929
|
-
{
|
|
6930
|
-
"kind": "js",
|
|
6931
|
-
"name": "recordTurnError",
|
|
6932
|
-
"declaration": {
|
|
6933
|
-
"name": "recordTurnError",
|
|
6934
|
-
"module": "src/state/debug-event-log.ts"
|
|
6935
|
-
}
|
|
6936
|
-
},
|
|
6937
|
-
{
|
|
6938
|
-
"kind": "js",
|
|
6939
|
-
"name": "recordTurnRetry",
|
|
6940
|
-
"declaration": {
|
|
6941
|
-
"name": "recordTurnRetry",
|
|
6942
|
-
"module": "src/state/debug-event-log.ts"
|
|
6943
|
-
}
|
|
6944
|
-
},
|
|
6945
|
-
{
|
|
6946
|
-
"kind": "js",
|
|
6947
|
-
"name": "getMetaEvents",
|
|
6948
|
-
"declaration": {
|
|
6949
|
-
"name": "getMetaEvents",
|
|
6950
|
-
"module": "src/state/debug-event-log.ts"
|
|
6951
|
-
}
|
|
6952
|
-
},
|
|
6953
|
-
{
|
|
6954
|
-
"kind": "js",
|
|
6955
|
-
"name": "mergeMetaEvents",
|
|
6956
|
-
"declaration": {
|
|
6957
|
-
"name": "mergeMetaEvents",
|
|
6958
|
-
"module": "src/state/debug-event-log.ts"
|
|
6959
|
-
}
|
|
6960
|
-
},
|
|
6961
|
-
{
|
|
6962
|
-
"kind": "js",
|
|
6963
|
-
"name": "clearSession",
|
|
6964
|
-
"declaration": {
|
|
6965
|
-
"name": "clearSession",
|
|
6966
|
-
"module": "src/state/debug-event-log.ts"
|
|
6967
|
-
}
|
|
6968
|
-
},
|
|
6969
|
-
{
|
|
6970
|
-
"kind": "js",
|
|
6971
|
-
"name": "DEBUG_LOG_README",
|
|
6972
|
-
"declaration": {
|
|
6973
|
-
"name": "DEBUG_LOG_README",
|
|
6974
|
-
"module": "src/state/debug-event-log.ts"
|
|
6975
|
-
}
|
|
6976
|
-
}
|
|
6977
|
-
]
|
|
6978
|
-
},
|
|
6979
|
-
{
|
|
6980
|
-
"kind": "javascript-module",
|
|
6981
|
-
"path": "src/state/driver-registry.ts",
|
|
6982
|
-
"declarations": [
|
|
6983
|
-
{
|
|
6984
|
-
"kind": "function",
|
|
6985
|
-
"name": "getOrCreateDriver",
|
|
6986
|
-
"return": {
|
|
6987
|
-
"type": {
|
|
6988
|
-
"text": "AiDriver"
|
|
6989
|
-
}
|
|
6990
|
-
},
|
|
6991
|
-
"parameters": [
|
|
6992
|
-
{
|
|
6993
|
-
"name": "key",
|
|
6994
|
-
"type": {
|
|
6995
|
-
"text": "string"
|
|
6996
|
-
}
|
|
6997
|
-
},
|
|
6998
|
-
{
|
|
6999
|
-
"name": "agentsKey",
|
|
7000
|
-
"type": {
|
|
7001
|
-
"text": "string"
|
|
7002
|
-
}
|
|
7003
|
-
},
|
|
7004
|
-
{
|
|
7005
|
-
"name": "factory",
|
|
7006
|
-
"type": {
|
|
7007
|
-
"text": "() => AiDriver"
|
|
7008
|
-
}
|
|
7009
|
-
}
|
|
7010
|
-
],
|
|
7011
|
-
"description": "Returns the existing driver for the given key, or calls the factory to create\nand register a new one. `agentsKey` is the fingerprint of the agents the\ndriver is being built for; it is recorded only when a driver is created (a\nreused driver keeps the fingerprint it was originally built with)."
|
|
7012
|
-
},
|
|
7013
|
-
{
|
|
7014
|
-
"kind": "function",
|
|
7015
|
-
"name": "getDriver",
|
|
7016
|
-
"return": {
|
|
7017
|
-
"type": {
|
|
7018
|
-
"text": "AiDriver | undefined"
|
|
7019
|
-
}
|
|
7020
|
-
},
|
|
7021
|
-
"parameters": [
|
|
7022
|
-
{
|
|
7023
|
-
"name": "key",
|
|
7024
|
-
"type": {
|
|
7025
|
-
"text": "string"
|
|
7026
|
-
}
|
|
7027
|
-
}
|
|
7028
|
-
],
|
|
7029
|
-
"description": "Returns the existing driver for the given key, or `undefined`."
|
|
7030
|
-
},
|
|
7031
|
-
{
|
|
7032
|
-
"kind": "function",
|
|
7033
|
-
"name": "getDriverAgentsKey",
|
|
7034
|
-
"return": {
|
|
7035
|
-
"type": {
|
|
7036
|
-
"text": "string | undefined"
|
|
7037
|
-
}
|
|
7038
|
-
},
|
|
7039
|
-
"parameters": [
|
|
7040
|
-
{
|
|
7041
|
-
"name": "key",
|
|
7042
|
-
"type": {
|
|
7043
|
-
"text": "string"
|
|
7044
|
-
}
|
|
7045
|
-
}
|
|
7046
|
-
],
|
|
7047
|
-
"description": "The agents fingerprint the registry driver for `key` was built with, or\n`undefined` if no driver is registered. Used by `agentsChanged` to decide\nwhether a sibling has already rebuilt the shared driver to the desired agents."
|
|
7048
|
-
},
|
|
7049
|
-
{
|
|
7050
|
-
"kind": "function",
|
|
7051
|
-
"name": "deleteDriver",
|
|
7052
|
-
"return": {
|
|
7053
|
-
"type": {
|
|
7054
|
-
"text": "AiDriver | undefined"
|
|
7055
|
-
}
|
|
7056
|
-
},
|
|
7057
|
-
"parameters": [
|
|
7058
|
-
{
|
|
7059
|
-
"name": "key",
|
|
7060
|
-
"type": {
|
|
7061
|
-
"text": "string"
|
|
7062
|
-
}
|
|
7063
|
-
}
|
|
7064
|
-
],
|
|
7065
|
-
"description": "Removes and returns the driver for the given key.\nUsed when agents change (driver must be rebuilt) or on explicit session teardown."
|
|
7066
|
-
}
|
|
7067
|
-
],
|
|
7068
|
-
"exports": [
|
|
7069
|
-
{
|
|
7070
|
-
"kind": "js",
|
|
7071
|
-
"name": "getOrCreateDriver",
|
|
7072
|
-
"declaration": {
|
|
7073
|
-
"name": "getOrCreateDriver",
|
|
7074
|
-
"module": "src/state/driver-registry.ts"
|
|
7075
|
-
}
|
|
6801
|
+
"description": "Removes and returns the driver for the given key.\nUsed when agents change (driver must be rebuilt) or on explicit session teardown."
|
|
6802
|
+
}
|
|
6803
|
+
],
|
|
6804
|
+
"exports": [
|
|
6805
|
+
{
|
|
6806
|
+
"kind": "js",
|
|
6807
|
+
"name": "getOrCreateDriver",
|
|
6808
|
+
"declaration": {
|
|
6809
|
+
"name": "getOrCreateDriver",
|
|
6810
|
+
"module": "src/state/driver-registry.ts"
|
|
6811
|
+
}
|
|
7076
6812
|
},
|
|
7077
6813
|
{
|
|
7078
6814
|
"kind": "js",
|
|
@@ -7215,6 +6951,270 @@
|
|
|
7215
6951
|
}
|
|
7216
6952
|
]
|
|
7217
6953
|
},
|
|
6954
|
+
{
|
|
6955
|
+
"kind": "javascript-module",
|
|
6956
|
+
"path": "src/provider/ai-provider-switcher.ts",
|
|
6957
|
+
"declarations": [
|
|
6958
|
+
{
|
|
6959
|
+
"kind": "variable",
|
|
6960
|
+
"name": "AIProviderSwitcher",
|
|
6961
|
+
"description": "The DI token for the (AIProviderSwitcher:interface). Resolves a noop until the app\nregisters one."
|
|
6962
|
+
}
|
|
6963
|
+
],
|
|
6964
|
+
"exports": [
|
|
6965
|
+
{
|
|
6966
|
+
"kind": "js",
|
|
6967
|
+
"name": "AIProviderSwitcher",
|
|
6968
|
+
"declaration": {
|
|
6969
|
+
"name": "AIProviderSwitcher",
|
|
6970
|
+
"module": "src/provider/ai-provider-switcher.ts"
|
|
6971
|
+
}
|
|
6972
|
+
}
|
|
6973
|
+
]
|
|
6974
|
+
},
|
|
6975
|
+
{
|
|
6976
|
+
"kind": "javascript-module",
|
|
6977
|
+
"path": "src/provider/assistant-app-settings.ts",
|
|
6978
|
+
"declarations": [
|
|
6979
|
+
{
|
|
6980
|
+
"kind": "variable",
|
|
6981
|
+
"name": "AssistantAppSettingsProvider",
|
|
6982
|
+
"description": "The DI token for the (AssistantAppSettingsProvider:interface). Resolves a noop\nuntil the host registers one."
|
|
6983
|
+
}
|
|
6984
|
+
],
|
|
6985
|
+
"exports": [
|
|
6986
|
+
{
|
|
6987
|
+
"kind": "js",
|
|
6988
|
+
"name": "AssistantAppSettingsProvider",
|
|
6989
|
+
"declaration": {
|
|
6990
|
+
"name": "AssistantAppSettingsProvider",
|
|
6991
|
+
"module": "src/provider/assistant-app-settings.ts"
|
|
6992
|
+
}
|
|
6993
|
+
}
|
|
6994
|
+
]
|
|
6995
|
+
},
|
|
6996
|
+
{
|
|
6997
|
+
"kind": "javascript-module",
|
|
6998
|
+
"path": "src/provider/tiered-provider-switcher.ts",
|
|
6999
|
+
"declarations": [
|
|
7000
|
+
{
|
|
7001
|
+
"kind": "class",
|
|
7002
|
+
"description": "Which cloud vendor backs the tier-shaped provider registry, plus the means to move it at\nruntime (GENC-1610).",
|
|
7003
|
+
"name": "TieredAIProviderSwitcher",
|
|
7004
|
+
"members": [
|
|
7005
|
+
{
|
|
7006
|
+
"kind": "field",
|
|
7007
|
+
"name": "vendors",
|
|
7008
|
+
"type": {
|
|
7009
|
+
"text": "readonly AITierVendor[]"
|
|
7010
|
+
},
|
|
7011
|
+
"readonly": true
|
|
7012
|
+
},
|
|
7013
|
+
{
|
|
7014
|
+
"kind": "field",
|
|
7015
|
+
"name": "options",
|
|
7016
|
+
"type": {
|
|
7017
|
+
"text": "TieredAIProviderSwitcherOptions"
|
|
7018
|
+
},
|
|
7019
|
+
"privacy": "private",
|
|
7020
|
+
"readonly": true,
|
|
7021
|
+
"default": "options"
|
|
7022
|
+
},
|
|
7023
|
+
{
|
|
7024
|
+
"kind": "field",
|
|
7025
|
+
"name": "defaultTier",
|
|
7026
|
+
"type": {
|
|
7027
|
+
"text": "AITierId"
|
|
7028
|
+
},
|
|
7029
|
+
"privacy": "private",
|
|
7030
|
+
"readonly": true
|
|
7031
|
+
},
|
|
7032
|
+
{
|
|
7033
|
+
"kind": "field",
|
|
7034
|
+
"name": "registry",
|
|
7035
|
+
"type": {
|
|
7036
|
+
"text": "MutableAIProviderRegistry"
|
|
7037
|
+
},
|
|
7038
|
+
"privacy": "private",
|
|
7039
|
+
"readonly": true
|
|
7040
|
+
},
|
|
7041
|
+
{
|
|
7042
|
+
"kind": "field",
|
|
7043
|
+
"name": "listeners",
|
|
7044
|
+
"privacy": "private",
|
|
7045
|
+
"readonly": true,
|
|
7046
|
+
"default": "new Set<(vendor: AITierVendor) => void>()"
|
|
7047
|
+
},
|
|
7048
|
+
{
|
|
7049
|
+
"kind": "field",
|
|
7050
|
+
"name": "_vendor",
|
|
7051
|
+
"type": {
|
|
7052
|
+
"text": "AITierVendor"
|
|
7053
|
+
},
|
|
7054
|
+
"privacy": "private"
|
|
7055
|
+
},
|
|
7056
|
+
{
|
|
7057
|
+
"kind": "field",
|
|
7058
|
+
"name": "vendor",
|
|
7059
|
+
"type": {
|
|
7060
|
+
"text": "AITierVendor"
|
|
7061
|
+
},
|
|
7062
|
+
"readonly": true
|
|
7063
|
+
},
|
|
7064
|
+
{
|
|
7065
|
+
"kind": "method",
|
|
7066
|
+
"name": "switchTo",
|
|
7067
|
+
"return": {
|
|
7068
|
+
"type": {
|
|
7069
|
+
"text": "void"
|
|
7070
|
+
}
|
|
7071
|
+
},
|
|
7072
|
+
"parameters": [
|
|
7073
|
+
{
|
|
7074
|
+
"name": "vendor",
|
|
7075
|
+
"type": {
|
|
7076
|
+
"text": "string"
|
|
7077
|
+
}
|
|
7078
|
+
}
|
|
7079
|
+
],
|
|
7080
|
+
"description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
|
|
7081
|
+
},
|
|
7082
|
+
{
|
|
7083
|
+
"kind": "method",
|
|
7084
|
+
"name": "adoptPersistedVendor",
|
|
7085
|
+
"return": {
|
|
7086
|
+
"type": {
|
|
7087
|
+
"text": "void"
|
|
7088
|
+
}
|
|
7089
|
+
},
|
|
7090
|
+
"parameters": [
|
|
7091
|
+
{
|
|
7092
|
+
"name": "vendor",
|
|
7093
|
+
"type": {
|
|
7094
|
+
"text": "string"
|
|
7095
|
+
}
|
|
7096
|
+
}
|
|
7097
|
+
],
|
|
7098
|
+
"description": "Adopt a vendor the app read back from its own store — the same registry move as\nTieredAIProviderSwitcher.switchTo, without the `onSwitch` callback, because this\nvalue came FROM the store and writing it back would be a pointless round-trip on load.\n\nExists because registration has to stay synchronous: an element that connects before the\ntoken is registered caches the platform's no-op fallback, so an app cannot await its\nstored preference before constructing this. It boots on `initialVendor` and adopts the\nstored one a moment later, through a registry that is mutable and held by reference."
|
|
7099
|
+
},
|
|
7100
|
+
{
|
|
7101
|
+
"kind": "method",
|
|
7102
|
+
"name": "subscribe",
|
|
7103
|
+
"return": {
|
|
7104
|
+
"type": {
|
|
7105
|
+
"text": "() => void"
|
|
7106
|
+
}
|
|
7107
|
+
},
|
|
7108
|
+
"parameters": [
|
|
7109
|
+
{
|
|
7110
|
+
"name": "listener",
|
|
7111
|
+
"type": {
|
|
7112
|
+
"text": "(vendor: string) => void"
|
|
7113
|
+
}
|
|
7114
|
+
}
|
|
7115
|
+
]
|
|
7116
|
+
},
|
|
7117
|
+
{
|
|
7118
|
+
"kind": "method",
|
|
7119
|
+
"name": "apply",
|
|
7120
|
+
"privacy": "private",
|
|
7121
|
+
"return": {
|
|
7122
|
+
"type": {
|
|
7123
|
+
"text": "void"
|
|
7124
|
+
}
|
|
7125
|
+
},
|
|
7126
|
+
"parameters": [
|
|
7127
|
+
{
|
|
7128
|
+
"name": "vendor",
|
|
7129
|
+
"type": {
|
|
7130
|
+
"text": "AITierVendor"
|
|
7131
|
+
}
|
|
7132
|
+
}
|
|
7133
|
+
],
|
|
7134
|
+
"description": "The registry move both entry points share, and nothing else."
|
|
7135
|
+
},
|
|
7136
|
+
{
|
|
7137
|
+
"kind": "method",
|
|
7138
|
+
"name": "build",
|
|
7139
|
+
"privacy": "private",
|
|
7140
|
+
"return": {
|
|
7141
|
+
"type": {
|
|
7142
|
+
"text": "Record<string, AIProvider>"
|
|
7143
|
+
}
|
|
7144
|
+
},
|
|
7145
|
+
"parameters": [
|
|
7146
|
+
{
|
|
7147
|
+
"name": "vendor",
|
|
7148
|
+
"type": {
|
|
7149
|
+
"text": "AITierVendor"
|
|
7150
|
+
}
|
|
7151
|
+
}
|
|
7152
|
+
]
|
|
7153
|
+
},
|
|
7154
|
+
{
|
|
7155
|
+
"kind": "method",
|
|
7156
|
+
"name": "isKnownVendor",
|
|
7157
|
+
"privacy": "private",
|
|
7158
|
+
"return": {
|
|
7159
|
+
"type": {
|
|
7160
|
+
"text": "vendor is AITierVendor"
|
|
7161
|
+
}
|
|
7162
|
+
},
|
|
7163
|
+
"parameters": [
|
|
7164
|
+
{
|
|
7165
|
+
"name": "vendor",
|
|
7166
|
+
"type": {
|
|
7167
|
+
"text": "string"
|
|
7168
|
+
}
|
|
7169
|
+
}
|
|
7170
|
+
]
|
|
7171
|
+
}
|
|
7172
|
+
]
|
|
7173
|
+
},
|
|
7174
|
+
{
|
|
7175
|
+
"kind": "function",
|
|
7176
|
+
"name": "registerTieredAIProviders",
|
|
7177
|
+
"return": {
|
|
7178
|
+
"type": {
|
|
7179
|
+
"text": "TieredAIProviderSwitcher"
|
|
7180
|
+
}
|
|
7181
|
+
},
|
|
7182
|
+
"parameters": [
|
|
7183
|
+
{
|
|
7184
|
+
"name": "container",
|
|
7185
|
+
"type": {
|
|
7186
|
+
"text": "Container"
|
|
7187
|
+
}
|
|
7188
|
+
},
|
|
7189
|
+
{
|
|
7190
|
+
"name": "options",
|
|
7191
|
+
"type": {
|
|
7192
|
+
"text": "Omit<TieredAIProviderSwitcherOptions, 'container'>"
|
|
7193
|
+
}
|
|
7194
|
+
}
|
|
7195
|
+
],
|
|
7196
|
+
"description": "Build a TieredAIProviderSwitcher — which registers the tier-shaped provider\nregistry — and put it on the (AIProviderSwitcher:variable) token. Call once at app\nbootstrap."
|
|
7197
|
+
}
|
|
7198
|
+
],
|
|
7199
|
+
"exports": [
|
|
7200
|
+
{
|
|
7201
|
+
"kind": "js",
|
|
7202
|
+
"name": "TieredAIProviderSwitcher",
|
|
7203
|
+
"declaration": {
|
|
7204
|
+
"name": "TieredAIProviderSwitcher",
|
|
7205
|
+
"module": "src/provider/tiered-provider-switcher.ts"
|
|
7206
|
+
}
|
|
7207
|
+
},
|
|
7208
|
+
{
|
|
7209
|
+
"kind": "js",
|
|
7210
|
+
"name": "registerTieredAIProviders",
|
|
7211
|
+
"declaration": {
|
|
7212
|
+
"name": "registerTieredAIProviders",
|
|
7213
|
+
"module": "src/provider/tiered-provider-switcher.ts"
|
|
7214
|
+
}
|
|
7215
|
+
}
|
|
7216
|
+
]
|
|
7217
|
+
},
|
|
7218
7218
|
{
|
|
7219
7219
|
"kind": "javascript-module",
|
|
7220
7220
|
"path": "src/styles/ai-colours.ts",
|