@genesislcap/ai-assistant 14.488.1 → 14.488.2-GENC-1351.2

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.
Files changed (143) hide show
  1. package/dist/ai-assistant.api.json +5104 -1727
  2. package/dist/ai-assistant.d.ts +691 -102
  3. package/dist/custom-elements.json +1118 -9
  4. package/dist/dts/components/ai-driver/ai-driver.d.ts +32 -0
  5. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  6. package/dist/dts/components/chat-driver/chat-driver.compact.test.d.ts +2 -0
  7. package/dist/dts/components/chat-driver/chat-driver.compact.test.d.ts.map +1 -0
  8. package/dist/dts/components/chat-driver/chat-driver.d.ts +16 -0
  9. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  10. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +15 -0
  11. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  12. package/dist/dts/components/orchestrating-driver/orchestrating-driver.pin.test.d.ts +2 -0
  13. package/dist/dts/components/orchestrating-driver/orchestrating-driver.pin.test.d.ts.map +1 -0
  14. package/dist/dts/components/settings-modal/settings-modal.styles.d.ts.map +1 -1
  15. package/dist/dts/components/settings-modal/settings-modal.template.d.ts.map +1 -1
  16. package/dist/dts/config/config.d.ts +70 -0
  17. package/dist/dts/config/config.d.ts.map +1 -1
  18. package/dist/dts/config/define-stateful-agent.d.ts +73 -1
  19. package/dist/dts/config/define-stateful-agent.d.ts.map +1 -1
  20. package/dist/dts/index.d.ts +1 -0
  21. package/dist/dts/index.d.ts.map +1 -1
  22. package/dist/dts/main/main.d.ts +183 -63
  23. package/dist/dts/main/main.d.ts.map +1 -1
  24. package/dist/dts/main/main.styles.d.ts.map +1 -1
  25. package/dist/dts/main/main.template.d.ts.map +1 -1
  26. package/dist/dts/main/main.types.d.ts +55 -0
  27. package/dist/dts/main/main.types.d.ts.map +1 -1
  28. package/dist/dts/state/ai-assistant-slice.d.ts +66 -0
  29. package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
  30. package/dist/dts/state/ai-assistant-slice.test.d.ts +2 -0
  31. package/dist/dts/state/ai-assistant-slice.test.d.ts.map +1 -0
  32. package/dist/dts/state/debug-event-log.d.ts +1 -1
  33. package/dist/dts/state/debug-event-log.d.ts.map +1 -1
  34. package/dist/dts/state/persistence/diagnostics-cursors.d.ts +40 -0
  35. package/dist/dts/state/persistence/diagnostics-cursors.d.ts.map +1 -0
  36. package/dist/dts/state/persistence/diagnostics.d.ts +58 -0
  37. package/dist/dts/state/persistence/diagnostics.d.ts.map +1 -0
  38. package/dist/dts/state/persistence/diagnostics.test.d.ts +2 -0
  39. package/dist/dts/state/persistence/diagnostics.test.d.ts.map +1 -0
  40. package/dist/dts/state/persistence/index.d.ts +7 -0
  41. package/dist/dts/state/persistence/index.d.ts.map +1 -0
  42. package/dist/dts/state/persistence/persister-registry.d.ts +17 -0
  43. package/dist/dts/state/persistence/persister-registry.d.ts.map +1 -0
  44. package/dist/dts/state/persistence/session-persistence-provider.d.ts +132 -0
  45. package/dist/dts/state/persistence/session-persistence-provider.d.ts.map +1 -0
  46. package/dist/dts/state/persistence/session-persistence-provider.test.d.ts +2 -0
  47. package/dist/dts/state/persistence/session-persistence-provider.test.d.ts.map +1 -0
  48. package/dist/dts/state/persistence/session-persistence.integration.test.d.ts +2 -0
  49. package/dist/dts/state/persistence/session-persistence.integration.test.d.ts.map +1 -0
  50. package/dist/dts/state/persistence/session-persister.d.ts +154 -0
  51. package/dist/dts/state/persistence/session-persister.d.ts.map +1 -0
  52. package/dist/dts/state/persistence/session-persister.test.d.ts +2 -0
  53. package/dist/dts/state/persistence/session-persister.test.d.ts.map +1 -0
  54. package/dist/dts/state/persistence/session-snapshot.d.ts +209 -0
  55. package/dist/dts/state/persistence/session-snapshot.d.ts.map +1 -0
  56. package/dist/dts/state/persistence/session-snapshot.test.d.ts +2 -0
  57. package/dist/dts/state/persistence/session-snapshot.test.d.ts.map +1 -0
  58. package/dist/dts/state/session-store.d.ts +6 -0
  59. package/dist/dts/state/session-store.d.ts.map +1 -1
  60. package/dist/dts/utils/history-transform.d.ts +38 -0
  61. package/dist/dts/utils/history-transform.d.ts.map +1 -1
  62. package/dist/dts/utils/history-transform.test.d.ts +2 -0
  63. package/dist/dts/utils/history-transform.test.d.ts.map +1 -0
  64. package/dist/dts/utils/message-partition.d.ts +27 -0
  65. package/dist/dts/utils/message-partition.d.ts.map +1 -1
  66. package/dist/dts/utils/resolve-preference-baseline.d.ts +43 -0
  67. package/dist/dts/utils/resolve-preference-baseline.d.ts.map +1 -0
  68. package/dist/dts/utils/resolve-preference-baseline.test.d.ts +2 -0
  69. package/dist/dts/utils/resolve-preference-baseline.test.d.ts.map +1 -0
  70. package/dist/dts/utils/with-timeout.d.ts +12 -0
  71. package/dist/dts/utils/with-timeout.d.ts.map +1 -0
  72. package/dist/esm/components/chat-driver/chat-driver.compact.test.js +93 -0
  73. package/dist/esm/components/chat-driver/chat-driver.js +92 -6
  74. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +32 -0
  75. package/dist/esm/components/orchestrating-driver/orchestrating-driver.pin.test.js +48 -0
  76. package/dist/esm/components/settings-modal/settings-modal.styles.js +24 -0
  77. package/dist/esm/components/settings-modal/settings-modal.template.js +14 -1
  78. package/dist/esm/config/define-stateful-agent.js +81 -0
  79. package/dist/esm/index.js +1 -0
  80. package/dist/esm/main/main.js +610 -84
  81. package/dist/esm/main/main.styles.js +55 -0
  82. package/dist/esm/main/main.template.js +94 -5
  83. package/dist/esm/main/main.types.js +27 -0
  84. package/dist/esm/state/ai-assistant-slice.js +71 -25
  85. package/dist/esm/state/ai-assistant-slice.test.js +65 -0
  86. package/dist/esm/state/debug-event-log.js +8 -0
  87. package/dist/esm/state/persistence/diagnostics-cursors.js +34 -0
  88. package/dist/esm/state/persistence/diagnostics.js +81 -0
  89. package/dist/esm/state/persistence/diagnostics.test.js +72 -0
  90. package/dist/esm/state/persistence/index.js +3 -0
  91. package/dist/esm/state/persistence/persister-registry.js +41 -0
  92. package/dist/esm/state/persistence/session-persistence-provider.js +95 -0
  93. package/dist/esm/state/persistence/session-persistence-provider.test.js +110 -0
  94. package/dist/esm/state/persistence/session-persistence.integration.test.js +109 -0
  95. package/dist/esm/state/persistence/session-persister.js +577 -0
  96. package/dist/esm/state/persistence/session-persister.test.js +239 -0
  97. package/dist/esm/state/persistence/session-snapshot.js +231 -0
  98. package/dist/esm/state/persistence/session-snapshot.test.js +243 -0
  99. package/dist/esm/utils/history-transform.js +101 -0
  100. package/dist/esm/utils/history-transform.test.js +137 -0
  101. package/dist/esm/utils/message-partition.js +30 -2
  102. package/dist/esm/utils/message-partition.test.js +20 -1
  103. package/dist/esm/utils/resolve-preference-baseline.js +53 -0
  104. package/dist/esm/utils/resolve-preference-baseline.test.js +69 -0
  105. package/dist/esm/utils/with-timeout.js +28 -0
  106. package/dist/tsconfig.tsbuildinfo +1 -1
  107. package/package.json +17 -17
  108. package/src/components/ai-driver/ai-driver.ts +36 -0
  109. package/src/components/chat-driver/chat-driver.compact.test.ts +131 -0
  110. package/src/components/chat-driver/chat-driver.ts +99 -6
  111. package/src/components/orchestrating-driver/orchestrating-driver.pin.test.ts +76 -0
  112. package/src/components/orchestrating-driver/orchestrating-driver.ts +36 -0
  113. package/src/components/settings-modal/settings-modal.styles.ts +24 -0
  114. package/src/components/settings-modal/settings-modal.template.ts +27 -1
  115. package/src/config/config.ts +71 -0
  116. package/src/config/define-stateful-agent.ts +134 -0
  117. package/src/index.ts +1 -0
  118. package/src/main/main.styles.ts +55 -0
  119. package/src/main/main.template.ts +121 -5
  120. package/src/main/main.ts +569 -64
  121. package/src/main/main.types.ts +59 -0
  122. package/src/state/ai-assistant-slice.test.ts +82 -0
  123. package/src/state/ai-assistant-slice.ts +120 -25
  124. package/src/state/debug-event-log.ts +18 -1
  125. package/src/state/persistence/diagnostics-cursors.ts +66 -0
  126. package/src/state/persistence/diagnostics.test.ts +95 -0
  127. package/src/state/persistence/diagnostics.ts +103 -0
  128. package/src/state/persistence/index.ts +10 -0
  129. package/src/state/persistence/persister-registry.ts +49 -0
  130. package/src/state/persistence/session-persistence-provider.test.ts +136 -0
  131. package/src/state/persistence/session-persistence-provider.ts +202 -0
  132. package/src/state/persistence/session-persistence.integration.test.ts +134 -0
  133. package/src/state/persistence/session-persister.test.ts +325 -0
  134. package/src/state/persistence/session-persister.ts +622 -0
  135. package/src/state/persistence/session-snapshot.test.ts +339 -0
  136. package/src/state/persistence/session-snapshot.ts +332 -0
  137. package/src/utils/history-transform.test.ts +197 -0
  138. package/src/utils/history-transform.ts +117 -0
  139. package/src/utils/message-partition.test.ts +27 -1
  140. package/src/utils/message-partition.ts +41 -2
  141. package/src/utils/resolve-preference-baseline.test.ts +84 -0
  142. package/src/utils/resolve-preference-baseline.ts +80 -0
  143. package/src/utils/with-timeout.ts +24 -0
@@ -119,6 +119,14 @@
119
119
  "package": "./config/fallback-agents"
120
120
  }
121
121
  },
122
+ {
123
+ "kind": "js",
124
+ "name": "*",
125
+ "declaration": {
126
+ "name": "*",
127
+ "package": "./state/persistence"
128
+ }
129
+ },
122
130
  {
123
131
  "kind": "js",
124
132
  "name": "*",
@@ -890,6 +898,37 @@
890
898
  "kind": "javascript-module",
891
899
  "path": "src/config/define-stateful-agent.ts",
892
900
  "declarations": [
901
+ {
902
+ "kind": "function",
903
+ "name": "restoreMachine",
904
+ "return": {
905
+ "type": {
906
+ "text": "void"
907
+ }
908
+ },
909
+ "parameters": [
910
+ {
911
+ "name": "machine",
912
+ "type": {
913
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
914
+ },
915
+ "description": "the machine to restore (already constructed/started)."
916
+ },
917
+ {
918
+ "name": "restored",
919
+ "type": {
920
+ "text": "unknown"
921
+ },
922
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
923
+ },
924
+ {
925
+ "name": "key",
926
+ "default": "'machine'",
927
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
928
+ }
929
+ ],
930
+ "description": "Restore a foundation-state-machine instance from a snapshot produced by the\ndefault serializer (or `machine.getPersistedSnapshot()`). Call inside a\nstateful agent's `init` to resume the machine in its exact prior place:\n\n```ts\ninit: ({ restored }) => {\n const machine = new MyMachine();\n restoreMachine(machine, restored); // resume, or no-op on a fresh start\n return { machine };\n}\n```\n\nNo-ops when there is nothing to restore (a fresh session), leaving the\nfreshly-constructed machine in its initial state."
931
+ },
893
932
  {
894
933
  "kind": "function",
895
934
  "name": "defineStatefulAgent",
@@ -910,6 +949,14 @@
910
949
  }
911
950
  ],
912
951
  "exports": [
952
+ {
953
+ "kind": "js",
954
+ "name": "restoreMachine",
955
+ "declaration": {
956
+ "name": "restoreMachine",
957
+ "module": "src/config/define-stateful-agent.ts"
958
+ }
959
+ },
913
960
  {
914
961
  "kind": "js",
915
962
  "name": "defineStatefulAgent",
@@ -1206,6 +1253,15 @@
1206
1253
  },
1207
1254
  "default": "{}"
1208
1255
  },
1256
+ {
1257
+ "kind": "field",
1258
+ "name": "persistence",
1259
+ "type": {
1260
+ "text": "SessionPersistenceConfig"
1261
+ },
1262
+ "default": "{}",
1263
+ "description": "Optional session persistence (GENC-1351). Off by default — set `enabled`\nand a `provider` (e.g. a `WebStorageSessionProvider`) to have the assistant\nautosave on idle and auto-restore the conversation on page reload. Exposed\nas a top-level property (like `agents`/`providerRegistry`) rather than via\n`chatConfig`, since the provider type lives in this package while\n`ChatConfig` lives in `foundation-ai`."
1264
+ },
1209
1265
  {
1210
1266
  "kind": "field",
1211
1267
  "name": "agentPicker",
@@ -1370,6 +1426,30 @@
1370
1426
  },
1371
1427
  "description": "Whether the agent picker slide-out panel is open. Lives on the session\nstore so the bubble-dialog and popout-panel instances stay in sync."
1372
1428
  },
1429
+ {
1430
+ "kind": "field",
1431
+ "name": "sessionMenuOpen",
1432
+ "type": {
1433
+ "text": "boolean"
1434
+ },
1435
+ "description": "Whether the lifecycle (session) menu slide-out panel is open. Like the\nagent picker, lives on the session store so bubble/popout stay in sync."
1436
+ },
1437
+ {
1438
+ "kind": "field",
1439
+ "name": "compacting",
1440
+ "type": {
1441
+ "text": "boolean"
1442
+ },
1443
+ "description": "Whether a manual compaction is in flight (GENC-1351 §5.7). On the session\nstore (not element-local) so the \"Compacting…\" view + input-disable stay in\nsync across pop-in/out, like the panel flags."
1444
+ },
1445
+ {
1446
+ "kind": "field",
1447
+ "name": "restoring",
1448
+ "type": {
1449
+ "text": "boolean"
1450
+ },
1451
+ "description": "Whether a page-reload restore is in flight (GENC-1351 §6). On the session\nstore (like `compacting`) so the \"Restoring…\" view + input-disable stay in\nsync across pop-in/out. Gating input while true prevents a mid-load send from\nbeing clobbered when the restored history loads."
1452
+ },
1373
1453
  {
1374
1454
  "kind": "field",
1375
1455
  "name": "pinnedAgentName",
@@ -1671,6 +1751,15 @@
1671
1751
  "default": "false",
1672
1752
  "description": "Whether the settings modal is open."
1673
1753
  },
1754
+ {
1755
+ "kind": "field",
1756
+ "name": "downloadingDebugLog",
1757
+ "type": {
1758
+ "text": "boolean"
1759
+ },
1760
+ "default": "false",
1761
+ "description": "True while `downloadDebugLog` is building the log (GENC-1351 §5.8). Drives the\ndownload button's disabled + spinner state — the lifetime-stitch path is async\n(a provider `loadDiagnostics` round-trip), so without feedback a click looks\nlike nothing happened. Per-instance and transient (not shared/persisted): each\nelement has its own settings modal."
1762
+ },
1674
1763
  {
1675
1764
  "kind": "field",
1676
1765
  "name": "settingsModalTab",
@@ -2021,6 +2110,26 @@
2021
2110
  "privacy": "private",
2022
2111
  "description": "Unsubscribes a one-shot state subscription created when this element connects\nmid-execution. The subscription watches for `state` becoming 'idle' so that\nthis element can stop its loading timer and sync the halo even when the\noriginating `send()` ran on a different element instance."
2023
2112
  },
2113
+ {
2114
+ "kind": "field",
2115
+ "name": "_applyingPreferences",
2116
+ "type": {
2117
+ "text": "boolean"
2118
+ },
2119
+ "privacy": "private",
2120
+ "default": "false",
2121
+ "description": "True while UI preferences are being applied programmatically (config defaults\non connect, or a loaded-preferences restore) — suppresses the save hook so we\ndon't persist config defaults or re-persist what we just loaded. Cleared once\nthe apply completes; a genuine *user* toggle (menu switch) runs with it false\nand saves (GENC-1351)."
2122
+ },
2123
+ {
2124
+ "kind": "field",
2125
+ "name": "_freshStore",
2126
+ "type": {
2127
+ "text": "boolean"
2128
+ },
2129
+ "privacy": "private",
2130
+ "default": "false",
2131
+ "description": "Fresh-store flag (`= isNewStore`) captured in `connectedCallback`. Only a\nfreshly created store takes the config/stored-prefs baseline; an existing\nstore — a reload with a live in-realm store, or the popped-out second instance\n— already holds the correct state, so `applyPreferenceBaseline` no-ops for it."
2132
+ },
2024
2133
  {
2025
2134
  "kind": "field",
2026
2135
  "name": "showHalo",
@@ -2333,6 +2442,141 @@
2333
2442
  "kind": "method",
2334
2443
  "name": "toggleAgentPicker"
2335
2444
  },
2445
+ {
2446
+ "kind": "field",
2447
+ "name": "confirmingClear",
2448
+ "type": {
2449
+ "text": "boolean"
2450
+ },
2451
+ "default": "false",
2452
+ "description": "Two-step confirm for the destructive Clear action; reset whenever the menu toggles."
2453
+ },
2454
+ {
2455
+ "kind": "field",
2456
+ "name": "confirmingCompact",
2457
+ "type": {
2458
+ "text": "boolean"
2459
+ },
2460
+ "default": "false"
2461
+ },
2462
+ {
2463
+ "kind": "field",
2464
+ "name": "_sessionMenuToggle",
2465
+ "privacy": "private",
2466
+ "readonly": true,
2467
+ "default": "new AnimatedPanelToggle(\n this,\n '.session-menu-panel',\n SESSION_MENU_CLOSE_MS,\n () => this.sessionMenuOpen,\n (v) => {\n this.sessionMenuOpen = v;\n },\n )"
2468
+ },
2469
+ {
2470
+ "kind": "field",
2471
+ "name": "sessionMenuEnabled",
2472
+ "type": {
2473
+ "text": "boolean"
2474
+ },
2475
+ "description": "Whether the lifecycle-menu button shows. It occupies the stop-button slot,\nso it only appears when idle (mutually exclusive with Stop). Needs\nsomething to act on: a chat to clear/compact, or a provider to toggle.",
2476
+ "readonly": true
2477
+ },
2478
+ {
2479
+ "kind": "field",
2480
+ "name": "persistenceToggleable",
2481
+ "type": {
2482
+ "text": "boolean"
2483
+ },
2484
+ "description": "The persistence toggle row renders only when a provider is configured.",
2485
+ "readonly": true
2486
+ },
2487
+ {
2488
+ "kind": "field",
2489
+ "name": "persistenceActive",
2490
+ "type": {
2491
+ "text": "boolean"
2492
+ },
2493
+ "description": "Whether persistence is currently active (on + a provider) for this session.",
2494
+ "readonly": true
2495
+ },
2496
+ {
2497
+ "kind": "field",
2498
+ "name": "compactable",
2499
+ "type": {
2500
+ "text": "boolean"
2501
+ },
2502
+ "description": "Whether the menu's \"Compact\" action would do anything (GENC-1351 §5.7).\nDelegates to `driver.canCompact()` so the gate uses the exact same history\n`compact()` acts on — one source of truth. Also reads `messages`, purely to\nstay reactive as the conversation grows: the driver's history isn't a tracked\nobservable, so the button keys its re-evaluation off the Redux mirror.",
2503
+ "readonly": true
2504
+ },
2505
+ {
2506
+ "kind": "method",
2507
+ "name": "toggleSessionMenu"
2508
+ },
2509
+ {
2510
+ "kind": "method",
2511
+ "name": "setPersistenceEnabled",
2512
+ "parameters": [
2513
+ {
2514
+ "name": "enabled",
2515
+ "type": {
2516
+ "text": "boolean"
2517
+ }
2518
+ }
2519
+ ],
2520
+ "description": "Set persistence on/off for this session (the menu switch). Reassigns the\n`persistence` object so the `@observable` fires. Turning it **off** drops the\nstored snapshot; **on** captures the current chat immediately. Either way the\n*choice* is remembered in the preferences blob (`persistPreferences`) — stored\nindependently of the snapshot, so it survives the clear and re-applies on the\nnext load (GENC-1351)."
2521
+ },
2522
+ {
2523
+ "kind": "method",
2524
+ "name": "togglePersistence",
2525
+ "description": "Toggle persistence (convenience / programmatic)."
2526
+ },
2527
+ {
2528
+ "kind": "method",
2529
+ "name": "gatherPreferences",
2530
+ "privacy": "private",
2531
+ "return": {
2532
+ "type": {
2533
+ "text": "SessionPreferences"
2534
+ }
2535
+ },
2536
+ "description": "Snapshot the user-changeable settings into a persistable preferences blob."
2537
+ },
2538
+ {
2539
+ "kind": "method",
2540
+ "name": "persistPreferences",
2541
+ "privacy": "private",
2542
+ "return": {
2543
+ "type": {
2544
+ "text": "void"
2545
+ }
2546
+ },
2547
+ "description": "Persist the current UI preferences whenever the user changes a setting\n(GENC-1351). Fires **regardless of \"remember chat\"** — display choices are the\nuser's, not tied to whether the chat is remembered — needing only a provider\nthat implements `savePreferences`. No-op while preferences are being applied\nprogrammatically (`_applyingPreferences`), so config defaults and loaded prefs\naren't re-saved."
2548
+ },
2549
+ {
2550
+ "kind": "method",
2551
+ "name": "applyPreferenceBaseline",
2552
+ "privacy": "private",
2553
+ "return": {
2554
+ "type": {
2555
+ "text": "void"
2556
+ }
2557
+ },
2558
+ "description": "Apply the effective UI-preference baseline onto the live toggles for a fresh\nstore (GENC-1351 #2). Precedence, lowest → highest:\n\n slice defaults < `chatConfig.ui` defaults < stored user preferences\n\nRecomputed from scratch (not layered) on every call, because its two inputs\narrive at unpredictable times: `chatConfig` is a parent-supplied `@observable`\nthat may bind *after* `connectedCallback`, and stored prefs load asynchronously.\nSo it re-runs from `connectedCallback`, `chatConfigChanged`, and once\n`loadPreferences` resolves — whichever order they happen in, the final state is\nthe same. No-op once the store isn't fresh (an existing/popped-out store owns\nits state) or the user has toggled something (their choice then wins, and\n`chatConfig` doesn't change post-startup in practice). Save hook suppressed so\napplying the baseline never persists as if it were a user choice.\n\nThis is the fix for \"nuking server prefs drops to all-disabled instead of the\n`chatConfig` defaults\": stored prefs are simply absent, so the baseline falls\nthrough to the config layer — which the old apply-once-on-connect path missed\nwhenever `chatConfig` hadn't bound yet."
2559
+ },
2560
+ {
2561
+ "kind": "method",
2562
+ "name": "compactSession",
2563
+ "return": {
2564
+ "type": {
2565
+ "text": "Promise<void>"
2566
+ }
2567
+ },
2568
+ "description": "Compact the conversation (GENC-1351 §5.7) — the menu's \"Compact\" action.\nDelegates to the driver, which summarizes older turns into a single\n`compacted-summary` message (destructive, atomic). On success records a\nhigh-importance `context.compacted` meta-event capturing the summary; the\nnormal `history-updated` → autosave path then persists the smaller\ntranscript. No-op when there is nothing to compact or the provider cannot\nsummarize (the driver returns `null`)."
2569
+ },
2570
+ {
2571
+ "kind": "method",
2572
+ "name": "clearSession",
2573
+ "return": {
2574
+ "type": {
2575
+ "text": "Promise<void>"
2576
+ }
2577
+ },
2578
+ "description": "Clear the session — the \"New chat\" action (GENC-1351 §5.6). Tears down the\nactive driver (firing the stateful agent's `onDeactivate` → `machine.stop()`),\nresets the store, rebuilds a fresh driver with no history, and wipes durable\nstorage. Mirrors `agentsChanged`'s teardown, minus the history reseed."
2579
+ },
2336
2580
  {
2337
2581
  "kind": "method",
2338
2582
  "name": "setAgent",
@@ -2701,11 +2945,74 @@
2701
2945
  },
2702
2946
  {
2703
2947
  "kind": "method",
2704
- "name": "getDebugLog"
2948
+ "name": "getDebugLog",
2949
+ "return": {
2950
+ "type": {
2951
+ "text": "DebugLog"
2952
+ }
2953
+ },
2954
+ "description": "The live current-page debug log (`{ readme, timeline, meta }`). @public"
2955
+ },
2956
+ {
2957
+ "kind": "method",
2958
+ "name": "buildDiagnosticEntries",
2959
+ "privacy": "private",
2960
+ "return": {
2961
+ "type": {
2962
+ "text": "DiagnosticEntry[]"
2963
+ }
2964
+ },
2965
+ "description": "Build the current page's diagnostic entries (GENC-1351 §5.8) — the debug-log\ntimeline entries (`message`/`turn`/`event`) plus one `meta-snapshot` carrying\nthe export-time `meta` block. `getDebugLog()` reassembles these into the live\nlog; the persister's forward-capture path (`SessionPersister.flushDiagnostics`,\nfed these via the `getDiagnosticEntries` dep) diffs them against what's already\nbeen appended to the persisted stream."
2966
+ },
2967
+ {
2968
+ "kind": "method",
2969
+ "name": "downloadDebugLog",
2970
+ "return": {
2971
+ "type": {
2972
+ "text": "Promise<void>"
2973
+ }
2974
+ }
2975
+ },
2976
+ {
2977
+ "kind": "method",
2978
+ "name": "buildDownloadLog",
2979
+ "privacy": "private",
2980
+ "return": {
2981
+ "type": {
2982
+ "text": "Promise<DebugLog>"
2983
+ }
2984
+ },
2985
+ "description": "The log to download (GENC-1351 §5.8). When the provider persists diagnostics,\nstitch the **whole lifetime** stream (every page load) rather than just the\ncurrent page's in-memory view: flush the current delta first so it's included,\nthen reassemble everything `loadDiagnostics` returns. Independent of \"remember\nchat\" — diagnostics are a forensic stream keyed on provider capability, not on\nwhether the *chat* is remembered (like preferences). Falls back to the live\ncurrent-page log when diagnostics isn't available or the fetch fails."
2986
+ },
2987
+ {
2988
+ "kind": "method",
2989
+ "name": "persister",
2990
+ "privacy": "private",
2991
+ "return": {
2992
+ "type": {
2993
+ "text": "SessionPersister | undefined"
2994
+ }
2995
+ },
2996
+ "description": "The shared per-session `SessionPersister` that owns restore-core\nsave/restore/freeze (GENC-1351 §5.10). Created once per `stateKey` and shared by\nevery element view (bubble + panel) via the registry, so there is a single save\ntimer + carry-forward cache — no per-view double-writes. The deps are getters so\nthe persister always reads the current driver/store/config and never holds a\nstale reference. `undefined` before the session key is available."
2705
2997
  },
2706
2998
  {
2707
2999
  "kind": "method",
2708
- "name": "downloadDebugLog"
3000
+ "name": "initPersistenceForNewStore",
3001
+ "privacy": "private",
3002
+ "return": {
3003
+ "type": {
3004
+ "text": "Promise<void>"
3005
+ }
3006
+ },
3007
+ "parameters": [
3008
+ {
3009
+ "name": "key",
3010
+ "type": {
3011
+ "text": "string"
3012
+ }
3013
+ }
3014
+ ],
3015
+ "description": "First-load persistence init for a freshly created store (GENC-1351). Restores\nthe user's remembered persistence-toggle choice — kept independently of the\nsession snapshot so it survives a clear; the host-configured `enabled` is only\nthe default for a first-ever load — then auto-restores the session when\npersistence is (now) on."
2709
3016
  },
2710
3017
  {
2711
3018
  "kind": "method",
@@ -2987,11 +3294,13 @@
2987
3294
  ],
2988
3295
  "events": [
2989
3296
  {
2990
- "name": "chat-header-mousedown",
2991
3297
  "type": {
2992
3298
  "text": "CustomEvent"
2993
- },
2994
- "description": "Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMousedownEventDetail`"
3299
+ }
3300
+ },
3301
+ {
3302
+ "description": "Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMousedownEventDetail`",
3303
+ "name": "chat-header-mousedown"
2995
3304
  }
2996
3305
  ],
2997
3306
  "attributes": [
@@ -3098,6 +3407,15 @@
3098
3407
  "kind": "javascript-module",
3099
3408
  "path": "src/main/main.types.ts",
3100
3409
  "declarations": [
3410
+ {
3411
+ "kind": "variable",
3412
+ "name": "AiAssistantEvent",
3413
+ "type": {
3414
+ "text": "{\n /** Session wiped via the lifecycle menu's Clear. `detail`: `SessionClearedDetail`. */\n SessionCleared: 'session-cleared',\n /** Header pressed in `popout-mode=\"expand\"` (drag-to-popout hosts). `detail`: `ChatHeaderMouseDownDetail`. */\n ChatHeaderMouseDown: 'chat-header-mousedown',\n}"
3415
+ },
3416
+ "default": "{\n /** Session wiped via the lifecycle menu's Clear. `detail`: `SessionClearedDetail`. */\n SessionCleared: 'session-cleared',\n /** Header pressed in `popout-mode=\"expand\"` (drag-to-popout hosts). `detail`: `ChatHeaderMouseDownDetail`. */\n ChatHeaderMouseDown: 'chat-header-mousedown',\n}",
3417
+ "description": "DOM events the `<foundation-ai-assistant>` element dispatches to its host.\nAll bubble and are `composed` (they cross the shadow boundary), so a host can\nlisten on the element — or any ancestor — to react. Use these constants to\nwire listeners instead of hand-typing event-name strings.\n\nAn `as const` map (not a TS `enum` — this package ships none), so it serves as\nboth the listener-name value and, via the same-named type below, a union."
3418
+ },
3101
3419
  {
3102
3420
  "kind": "variable",
3103
3421
  "name": "ANIMATION_DEFS",
@@ -3127,6 +3445,14 @@
3127
3445
  "package": "@genesislcap/foundation-ai"
3128
3446
  }
3129
3447
  },
3448
+ {
3449
+ "kind": "js",
3450
+ "name": "AiAssistantEvent",
3451
+ "declaration": {
3452
+ "name": "AiAssistantEvent",
3453
+ "module": "src/main/main.types.ts"
3454
+ }
3455
+ },
3130
3456
  {
3131
3457
  "kind": "js",
3132
3458
  "name": "ANIMATION_DEFS",
@@ -3199,13 +3525,22 @@
3199
3525
  "kind": "javascript-module",
3200
3526
  "path": "src/state/ai-assistant-slice.ts",
3201
3527
  "declarations": [
3528
+ {
3529
+ "kind": "function",
3530
+ "name": "createDefaultSessionState",
3531
+ "return": {
3532
+ "type": {
3533
+ "text": "AiAssistantSessionState"
3534
+ }
3535
+ },
3536
+ "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."
3537
+ },
3202
3538
  {
3203
3539
  "kind": "variable",
3204
3540
  "name": "defaultSessionState",
3205
3541
  "type": {
3206
3542
  "text": "AiAssistantSessionState"
3207
- },
3208
- "default": "{\n messages: [],\n state: 'idle',\n showToolCalls: false,\n showThinkingSteps: false,\n showNarration: false,\n showAgentSwitchIndicator: false,\n enabledAnimations: [],\n suggestionsState: { status: 'idle' },\n contextTokens: undefined,\n contextLimit: undefined,\n sessionCostUsd: 0,\n sessionTokensConsumed: 0,\n activeModel: undefined,\n activeProviderName: undefined,\n providerStatuses: [],\n activeAgent: undefined,\n pinnedAgentName: null,\n flowOwnerAgentName: null,\n agentPickerOpen: false,\n inputValue: '',\n liveSubAgentTrace: [],\n liveSubAgentName: null,\n inputOverrides: [],\n}"
3543
+ }
3209
3544
  },
3210
3545
  {
3211
3546
  "kind": "variable",
@@ -3213,6 +3548,14 @@
3213
3548
  }
3214
3549
  ],
3215
3550
  "exports": [
3551
+ {
3552
+ "kind": "js",
3553
+ "name": "createDefaultSessionState",
3554
+ "declaration": {
3555
+ "name": "createDefaultSessionState",
3556
+ "module": "src/state/ai-assistant-slice.ts"
3557
+ }
3558
+ },
3216
3559
  {
3217
3560
  "kind": "js",
3218
3561
  "name": "defaultSessionState",
@@ -3241,7 +3584,7 @@
3241
3584
  "type": {
3242
3585
  "text": "Record<MetaEventType, MetaEventImportance>"
3243
3586
  },
3244
- "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\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 'agent.handoff': 'normal',\n 'agent.pinned': 'normal',\n 'agent.unpinned': 'normal',\n 'provider.selected': 'normal',\n 'interaction.requested': 'normal',\n 'interaction.resolved': 'normal',\n\n 'driver.wired': 'low',\n 'driver.unwired': 'low',\n 'context.updated': 'low',\n 'context.condensed': 'low',\n 'panel.toggled': 'low',\n 'attachment.added': 'low',\n}",
3587
+ "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\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 'agent.handoff': 'normal',\n 'agent.pinned': 'normal',\n 'agent.unpinned': 'normal',\n 'provider.selected': 'normal',\n 'interaction.requested': 'normal',\n 'interaction.resolved': 'normal',\n 'session.cleared': 'normal',\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}",
3245
3588
  "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."
3246
3589
  },
3247
3590
  {
@@ -4437,6 +4780,96 @@
4437
4780
  }
4438
4781
  ],
4439
4782
  "description": "Applies a history cap for sub-agent context: the last `cap` messages are passed\nverbatim; older messages have their tool payloads masked."
4783
+ },
4784
+ {
4785
+ "kind": "variable",
4786
+ "name": "COMPACT_KEEP_RECENT_MESSAGES",
4787
+ "type": {
4788
+ "text": "number"
4789
+ },
4790
+ "default": "4",
4791
+ "description": "Recent messages kept verbatim when compacting; everything earlier is summarized."
4792
+ },
4793
+ {
4794
+ "kind": "variable",
4795
+ "name": "COMPACT_MIN_MESSAGES_TO_COMPACT",
4796
+ "type": {
4797
+ "text": "number"
4798
+ },
4799
+ "default": "4",
4800
+ "description": "Don't bother compacting unless at least this many messages would be summarized."
4801
+ },
4802
+ {
4803
+ "kind": "function",
4804
+ "name": "findCompactionCut",
4805
+ "return": {
4806
+ "type": {
4807
+ "text": "number | null"
4808
+ }
4809
+ },
4810
+ "parameters": [
4811
+ {
4812
+ "name": "history",
4813
+ "type": {
4814
+ "text": "readonly ChatMessage[]"
4815
+ }
4816
+ }
4817
+ ],
4818
+ "description": "Index at which the verbatim tail begins — everything before it gets summarized.\nThe tail starts on a clean turn boundary (a `user` message): a user message\nnever appears between a `tool_use` and its `tool_result`, so cutting there\nguarantees the summarized region is tool-pair-balanced (compaction only runs\nwhen idle, so history is turn-complete). Returns `null` when there is nothing\nworth compacting (too short, or no earlier user boundary) — e.g. a freshly\nrestored session whose only user turn is the current one."
4819
+ },
4820
+ {
4821
+ "kind": "function",
4822
+ "name": "buildCompactionSummaryPrompt",
4823
+ "return": {
4824
+ "type": {
4825
+ "text": "{\n systemPrompt: string;\n userMessage: string;\n}"
4826
+ }
4827
+ },
4828
+ "parameters": [
4829
+ {
4830
+ "name": "toCompact",
4831
+ "type": {
4832
+ "text": "readonly ChatMessage[]"
4833
+ }
4834
+ }
4835
+ ],
4836
+ "description": "Build the one-shot summarizer prompt for a run of older messages (used with\n`AIProvider.prompt`). Mirrors the `<conversation_history>` block convention\nthat suggestions use. Any existing `compacted-summary` at the head is folded\nin (rendered as prior-summary context), so rolling re-compaction produces one\ncombined summary."
4837
+ },
4838
+ {
4839
+ "kind": "function",
4840
+ "name": "normalizeForProvider",
4841
+ "return": {
4842
+ "type": {
4843
+ "text": "ChatMessage[]"
4844
+ }
4845
+ },
4846
+ "parameters": [
4847
+ {
4848
+ "name": "history",
4849
+ "type": {
4850
+ "text": "readonly ChatMessage[]"
4851
+ }
4852
+ }
4853
+ ],
4854
+ "description": "Normalize history for a provider request (GENC-1351 §5.7): translate each\n`compacted-summary` message into a `user` message that wraps its summary in a\n`<conversation_summary>` block, so the raw display-only role never reaches a\ntransport. Other roles pass through untouched. Pure — returns a new array.\n\nApplied at the request-build chokepoint *before* per-agent masking, so the\nguarantee holds for every provider/transport regardless of any optional\nper-agent history transform."
4855
+ },
4856
+ {
4857
+ "kind": "function",
4858
+ "name": "compactionDividerLabel",
4859
+ "return": {
4860
+ "type": {
4861
+ "text": "string"
4862
+ }
4863
+ },
4864
+ "parameters": [
4865
+ {
4866
+ "name": "m",
4867
+ "type": {
4868
+ "text": "ChatMessage"
4869
+ }
4870
+ }
4871
+ ],
4872
+ "description": "Human-facing divider label for a `compacted-summary` message."
4440
4873
  }
4441
4874
  ],
4442
4875
  "exports": [
@@ -4455,6 +4888,54 @@
4455
4888
  "name": "applyHistoryCap",
4456
4889
  "module": "src/utils/history-transform.ts"
4457
4890
  }
4891
+ },
4892
+ {
4893
+ "kind": "js",
4894
+ "name": "COMPACT_KEEP_RECENT_MESSAGES",
4895
+ "declaration": {
4896
+ "name": "COMPACT_KEEP_RECENT_MESSAGES",
4897
+ "module": "src/utils/history-transform.ts"
4898
+ }
4899
+ },
4900
+ {
4901
+ "kind": "js",
4902
+ "name": "COMPACT_MIN_MESSAGES_TO_COMPACT",
4903
+ "declaration": {
4904
+ "name": "COMPACT_MIN_MESSAGES_TO_COMPACT",
4905
+ "module": "src/utils/history-transform.ts"
4906
+ }
4907
+ },
4908
+ {
4909
+ "kind": "js",
4910
+ "name": "findCompactionCut",
4911
+ "declaration": {
4912
+ "name": "findCompactionCut",
4913
+ "module": "src/utils/history-transform.ts"
4914
+ }
4915
+ },
4916
+ {
4917
+ "kind": "js",
4918
+ "name": "buildCompactionSummaryPrompt",
4919
+ "declaration": {
4920
+ "name": "buildCompactionSummaryPrompt",
4921
+ "module": "src/utils/history-transform.ts"
4922
+ }
4923
+ },
4924
+ {
4925
+ "kind": "js",
4926
+ "name": "normalizeForProvider",
4927
+ "declaration": {
4928
+ "name": "normalizeForProvider",
4929
+ "module": "src/utils/history-transform.ts"
4930
+ }
4931
+ },
4932
+ {
4933
+ "kind": "js",
4934
+ "name": "compactionDividerLabel",
4935
+ "declaration": {
4936
+ "name": "compactionDividerLabel",
4937
+ "module": "src/utils/history-transform.ts"
4938
+ }
4458
4939
  }
4459
4940
  ]
4460
4941
  },
@@ -4513,6 +4994,24 @@
4513
4994
  "kind": "javascript-module",
4514
4995
  "path": "src/utils/message-partition.ts",
4515
4996
  "declarations": [
4997
+ {
4998
+ "kind": "function",
4999
+ "name": "isSessionNoticeMarker",
5000
+ "return": {
5001
+ "type": {
5002
+ "text": "boolean"
5003
+ }
5004
+ },
5005
+ "parameters": [
5006
+ {
5007
+ "name": "m",
5008
+ "type": {
5009
+ "text": "ChatMessage"
5010
+ }
5011
+ }
5012
+ ],
5013
+ "description": "Either restore notice — both display-only, stripped before persist. @internal"
5014
+ },
4516
5015
  {
4517
5016
  "kind": "function",
4518
5017
  "name": "trailingInteractionRow",
@@ -4557,6 +5056,14 @@
4557
5056
  }
4558
5057
  ],
4559
5058
  "exports": [
5059
+ {
5060
+ "kind": "js",
5061
+ "name": "isSessionNoticeMarker",
5062
+ "declaration": {
5063
+ "name": "isSessionNoticeMarker",
5064
+ "module": "src/utils/message-partition.ts"
5065
+ }
5066
+ },
4560
5067
  {
4561
5068
  "kind": "js",
4562
5069
  "name": "trailingInteractionRow",
@@ -4609,6 +5116,12 @@
4609
5116
  }
4610
5117
  ]
4611
5118
  },
5119
+ {
5120
+ "kind": "javascript-module",
5121
+ "path": "src/utils/resolve-preference-baseline.ts",
5122
+ "declarations": [],
5123
+ "exports": []
5124
+ },
4612
5125
  {
4613
5126
  "kind": "javascript-module",
4614
5127
  "path": "src/utils/strip-agent-handlers.ts",
@@ -4721,6 +5234,12 @@
4721
5234
  }
4722
5235
  ]
4723
5236
  },
5237
+ {
5238
+ "kind": "javascript-module",
5239
+ "path": "src/utils/with-timeout.ts",
5240
+ "declarations": [],
5241
+ "exports": []
5242
+ },
4724
5243
  {
4725
5244
  "kind": "javascript-module",
4726
5245
  "path": "src/components/activity-halo/activity-halo.ts",
@@ -6534,6 +7053,26 @@
6534
7053
  }
6535
7054
  ]
6536
7055
  },
7056
+ {
7057
+ "kind": "method",
7058
+ "name": "canCompact",
7059
+ "return": {
7060
+ "type": {
7061
+ "text": "boolean"
7062
+ }
7063
+ },
7064
+ "description": "Whether `compact()` would do anything right now — a summarizable run of older\nturns exists behind a clean boundary. Uses the same `history` `compact()`\nacts on, so the UI's gate can't disagree with the action (GENC-1351 follow-up)."
7065
+ },
7066
+ {
7067
+ "kind": "method",
7068
+ "name": "compact",
7069
+ "return": {
7070
+ "type": {
7071
+ "text": "Promise<ChatMessage | null>"
7072
+ }
7073
+ },
7074
+ "description": "Destructively compact older turns into a single `compacted-summary` message\n(GENC-1351 §5.7). Summarizes everything before a clean recent-tail boundary\nvia the registry-default provider's one-shot `prompt()`, then **atomically**\nreplaces the covered turns with one summary message at the head — history is\nmutated only on success. Rolling: any existing head summary is folded into\nthe new one. Returns the created summary message, or `null` when there is\nnothing worth compacting or the default provider cannot summarize."
7075
+ },
6537
7076
  {
6538
7077
  "kind": "method",
6539
7078
  "name": "isBusy",
@@ -7513,6 +8052,16 @@
7513
8052
  "default": "null",
7514
8053
  "description": "Transient flow lock — set when a stateful agent's `onActivate` fires,\ncleared by `releaseActiveAgent`. While non-null, routing precedence goes\nto this agent and the picker is locked. Independent of\n`pinnedAgentName` so completing a flow doesn't wipe the user's sticky\nchoice."
7515
8054
  },
8055
+ {
8056
+ "kind": "field",
8057
+ "name": "restoredAgentStates",
8058
+ "type": {
8059
+ "text": "Record<string, unknown>"
8060
+ },
8061
+ "privacy": "private",
8062
+ "default": "{}",
8063
+ "description": "Per-agent restored state for a rehydrated session, keyed by agent name.\nPrimed by the host on restore; each entry is passed to that agent's\n`onActivate` as `ctx.restored` on its next activation, then deleted so a\nlater re-activation starts fresh."
8064
+ },
7516
8065
  {
7517
8066
  "kind": "field",
7518
8067
  "name": "activeAgent",
@@ -7698,6 +8247,26 @@
7698
8247
  }
7699
8248
  }
7700
8249
  },
8250
+ {
8251
+ "kind": "method",
8252
+ "name": "compact",
8253
+ "return": {
8254
+ "type": {
8255
+ "text": "Promise<ChatMessage | null>"
8256
+ }
8257
+ },
8258
+ "description": "{@inheritDoc AiDriver.compact}"
8259
+ },
8260
+ {
8261
+ "kind": "method",
8262
+ "name": "canCompact",
8263
+ "return": {
8264
+ "type": {
8265
+ "text": "boolean"
8266
+ }
8267
+ },
8268
+ "description": "{@inheritDoc AiDriver.canCompact}"
8269
+ },
7701
8270
  {
7702
8271
  "kind": "method",
7703
8272
  "name": "getTurnSnapshots",
@@ -7786,6 +8355,34 @@
7786
8355
  }
7787
8356
  ]
7788
8357
  },
8358
+ {
8359
+ "kind": "method",
8360
+ "name": "primeRestoredAgentState",
8361
+ "return": {
8362
+ "type": {
8363
+ "text": "void"
8364
+ }
8365
+ },
8366
+ "parameters": [
8367
+ {
8368
+ "name": "snapshots",
8369
+ "type": {
8370
+ "text": "Record<string, unknown>"
8371
+ }
8372
+ }
8373
+ ],
8374
+ "description": "{@inheritDoc AiDriver.primeRestoredAgentState}"
8375
+ },
8376
+ {
8377
+ "kind": "method",
8378
+ "name": "getActiveAgent",
8379
+ "return": {
8380
+ "type": {
8381
+ "text": "AgentConfig | undefined"
8382
+ }
8383
+ },
8384
+ "description": "{@inheritDoc AiDriver.getActiveAgent}"
8385
+ },
7789
8386
  {
7790
8387
  "kind": "method",
7791
8388
  "name": "applyAgent",
@@ -8169,7 +8766,7 @@
8169
8766
  {
8170
8767
  "kind": "variable",
8171
8768
  "name": "settingsModalStyles",
8172
- "default": "css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n .settings-modal {\n --ai-tier-badge-bg-mix: 14%;\n --ai-tier-badge-text-lighten: 18%;\n }\n\n .settings-modal::part(dialog) {\n max-width: 620px;\n width: calc(100vw - 48px);\n max-height: calc(100vh - 48px);\n padding: 0;\n }\n\n .settings-modal::part(content) {\n display: flex;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n width: 100%;\n }\n\n .settings-modal::part(top) {\n padding: calc(var(--design-unit) * 4px) calc(var(--design-unit) * 5px);\n border-bottom: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-modal::part(bottom) {\n padding: calc(var(--design-unit) * 4px) calc(var(--design-unit) * 5px);\n border-top: 1px solid var(--neutral-stroke-rest);\n border-bottom-left-radius: var(--card-border-radius, calc(var(--control-corner-radius) * 1px));\n border-bottom-right-radius: var(--card-border-radius, calc(var(--control-corner-radius) * 1px));\n background-color: var(--neutral-layer-2);\n }\n\n .settings-modal-header {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .settings-modal-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n color: var(--neutral-foreground-rest);\n }\n\n .settings-modal-content {\n display: flex;\n flex-direction: column;\n min-height: 0;\n flex: 1 1 auto;\n }\n\n .settings-modal-tabs::part(tablist) {\n border-bottom: 0;\n padding: 0 calc(var(--design-unit) * 5px);\n column-gap: calc(var(--design-unit) * 5px);\n }\n\n .settings-modal-tabs::part(activeIndicator) {\n height: 2px;\n }\n\n .settings-modal-tab {\n padding: 0;\n font-weight: 600;\n gap: 6px;\n }\n\n .settings-modal-tab[aria-selected='true'] {\n color: var(--neutral-foreground-rest);\n }\n\n .settings-modal-tabs::part(tabpanel) {\n border-top: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-modal-tab-panel {\n display: flex;\n flex-direction: column;\n min-height: 0;\n flex: 1 1 auto;\n padding: 0;\n border-radius: 0;\n }\n\n .settings-modal-tab-panel[hidden] {\n display: none !important;\n }\n\n .settings-modal-body {\n overflow-y: auto;\n padding: 0 calc(var(--design-unit) * 5px) calc(var(--design-unit) * 2px);\n max-height: min(60vh, 520px);\n }\n\n .settings-modal-section {\n padding: calc(var(--design-unit) * 5px) 0;\n border-bottom: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-modal-section:last-child {\n border-bottom: none;\n }\n\n .settings-modal-section-title {\n margin: 0 0 calc(var(--design-unit) * 3px);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--neutral-foreground-hint);\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-modal-section-note {\n margin: calc(var(--design-unit) * -2px) 0 calc(var(--design-unit) * 3px);\n font-size: 12px;\n line-height: 1.5;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-modal-section-body {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 4px);\n }\n\n .settings-toggle-row {\n display: flex;\n align-items: flex-start;\n gap: calc(var(--design-unit) * 3px);\n padding: 0 0 calc(var(--design-unit) * 4px) 0;\n border-bottom: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-toggle-row:last-child {\n border-bottom: none;\n padding-bottom: calc(var(--design-unit) * 1px);\n }\n\n .settings-toggle-row.is-stacked {\n flex-direction: column;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-animation-list {\n display: flex;\n flex-direction: column;\n width: 100%;\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.2px);\n padding: calc(var(--design-unit) * 2px);\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-animation-list .settings-toggle-row {\n border: 0;\n }\n\n .settings-animation-category {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 4px);\n }\n\n .settings-animation-category-label {\n font-weight: 600;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-toggle-row + .settings-animation-category-label {\n border-top: 1px solid var(--neutral-stroke-rest);\n padding-top: calc(var(--design-unit) * 2px);\n }\n\n .settings-animation-option {\n padding: 0;\n margin: 0;\n }\n\n .settings-animation-option:last-child {\n border-bottom: none;\n padding-bottom: calc(var(--design-unit) * 2px);\n }\n\n .settings-toggle-text {\n flex: 1;\n min-width: 0;\n }\n\n .settings-toggle-title {\n font-size: 14px;\n font-weight: 500;\n color: var(--neutral-foreground-rest);\n }\n\n .settings-toggle-desc {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n line-height: 1.5;\n max-width: 92%;\n }\n\n .settings-toggle-control {\n flex: 0 0 auto;\n min-width: 0;\n }\n\n .settings-toggle-control-wide {\n width: 100%;\n max-width: 280px;\n }\n\n .settings-toggle-row.is-stacked .settings-toggle-desc {\n max-width: none;\n }\n\n .settings-toggle-row.is-stacked .settings-toggle-control-wide {\n width: 100%;\n max-width: none;\n }\n\n .settings-app-toggle-block {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 1px);\n }\n\n .settings-toggle-hint {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n line-height: 1.4;\n padding-left: calc(var(--design-unit) * 1px);\n font-style: italic;\n }\n\n .settings-context-header {\n display: flex;\n justify-content: space-between;\n gap: calc(var(--design-unit) * 2px);\n margin-bottom: calc(var(--design-unit) * 2px);\n font-size: 12px;\n }\n\n .settings-context-label {\n color: var(--neutral-foreground-hint);\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n }\n\n .settings-context-tokens {\n color: var(--neutral-foreground-rest);\n }\n\n .settings-current-build {\n background: var(--neutral-layer-2);\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n padding: calc(var(--design-unit) * 4px);\n margin: calc(var(--design-unit) * 3px) 0;\n }\n\n .settings-current-build-top {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: calc(var(--design-unit) * 2px);\n margin-bottom: calc(var(--design-unit) * 3px);\n }\n\n .settings-live-badge {\n display: inline-flex;\n align-items: center;\n gap: calc(var(--design-unit) * 1px);\n font-size: 10px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--accent-fill-rest);\n }\n\n .settings-live-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--accent-fill-rest);\n animation: settings-live-pulse 1.6s ease-out infinite;\n }\n\n @keyframes settings-live-pulse {\n 0% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-fill-rest) 55%, transparent);\n }\n\n 70% {\n box-shadow: 0 0 0 7px transparent;\n }\n\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n .settings-current-build-name {\n font-size: 14px;\n font-weight: 600;\n }\n\n .settings-current-build-stats {\n display: flex;\n flex-wrap: wrap;\n gap: calc(var(--design-unit) * 3px);\n margin-bottom: calc(var(--design-unit) * 3px);\n }\n\n .settings-build-stat {\n flex: 1;\n min-width: 0;\n background: var(--neutral-layer-1);\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1px);\n padding: calc(var(--design-unit) * 3px);\n }\n\n .settings-build-stat-label {\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-build-stat-value {\n font-size: 22px;\n font-weight: 700;\n margin-top: calc(var(--design-unit) * 1px);\n color: var(--neutral-foreground-rest);\n }\n\n .settings-build-stat-value .prefix,\n .settings-build-stat-value .suffix {\n color: var(--accent-fill-rest);\n }\n\n .settings-model-tags {\n display: flex;\n flex-wrap: wrap;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-model-tag {\n font-size: 11px;\n font-weight: 600;\n padding: 3px 9px;\n border-radius: 20px;\n font-family: ui-monospace, monospace;\n border: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-model-tag,\n .settings-cost-history-icon {\n --model-tag-color: var(--neutral-foreground-rest);\n\n background: color-mix(\n in srgb,\n var(--model-tag-color) var(--ai-tier-badge-bg-mix),\n var(--neutral-layer-1)\n );\n border-color: color-mix(in srgb, var(--model-tag-color) 20%, var(--neutral-layer-1));\n color: color-mix(in srgb, var(--model-tag-color), white var(--ai-tier-badge-text-lighten));\n }\n\n .settings-cost-history-title {\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--neutral-foreground-hint);\n font-weight: 600;\n margin: calc(var(--design-unit) * 4px) 0 calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 2px);\n padding-bottom: calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history-icon {\n flex: 0 0 auto;\n width: 36px;\n height: 36px;\n border-radius: calc(var(--control-corner-radius) * 1px);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 700;\n border: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-cost-history-row {\n display: flex;\n flex-direction: column;\n background: var(--neutral-layer-1);\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n padding: calc(var(--design-unit) * 4px);\n }\n\n .settings-cost-history-row-content {\n display: flex;\n align-items: flex-start;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history-row-content + .settings-cost-history-row-content {\n border-top: 1px solid var(--neutral-stroke-rest);\n margin-top: calc(var(--design-unit) * 2px);\n padding-top: calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history-row-body {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n gap: calc(var(--design-unit) * 2px);\n justify-content: space-between;\n }\n\n .settings-cost-history-row-right {\n align-items: flex-end;\n }\n\n .settings-cost-history-row-cost,\n .settings-cost-history-row-title {\n font-size: 14px;\n font-weight: 600;\n color: var(--neutral-foreground-rest);\n min-width: 0;\n }\n\n .settings-cost-history-row-metrics {\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n font-size: 13px;\n font-family: ui-monospace, monospace;\n color: var(--neutral-foreground-rest);\n white-space: nowrap;\n }\n\n .settings-cost-history-row-tokens,\n .settings-cost-history-row-date {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-cost-history-delete {\n flex: 0 0 auto;\n margin-top: -2px;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-cost-history-delete:hover {\n color: var(--error-color);\n }\n\n .settings-cost-history ::slotted(*) {\n display: block;\n }\n\n .settings-modal-footer {\n width: 100%;\n }\n\n .settings-done-button {\n margin-left: auto;\n }\n\n .settings-modal-footer-actions {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: calc(var(--design-unit) * 2px);\n width: 100%;\n }\n\n .settings-disclaimer {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n max-width: 60%;\n line-height: 1.4;\n }\n`",
8769
+ "default": "css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n .settings-modal {\n --ai-tier-badge-bg-mix: 14%;\n --ai-tier-badge-text-lighten: 18%;\n }\n\n .settings-modal::part(dialog) {\n max-width: 620px;\n width: calc(100vw - 48px);\n max-height: calc(100vh - 48px);\n padding: 0;\n }\n\n .settings-modal::part(content) {\n display: flex;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n width: 100%;\n }\n\n .settings-modal::part(top) {\n padding: calc(var(--design-unit) * 4px) calc(var(--design-unit) * 5px);\n border-bottom: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-modal::part(bottom) {\n padding: calc(var(--design-unit) * 4px) calc(var(--design-unit) * 5px);\n border-top: 1px solid var(--neutral-stroke-rest);\n border-bottom-left-radius: var(--card-border-radius, calc(var(--control-corner-radius) * 1px));\n border-bottom-right-radius: var(--card-border-radius, calc(var(--control-corner-radius) * 1px));\n background-color: var(--neutral-layer-2);\n }\n\n .settings-modal-header {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .settings-modal-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n color: var(--neutral-foreground-rest);\n }\n\n .settings-modal-content {\n display: flex;\n flex-direction: column;\n min-height: 0;\n flex: 1 1 auto;\n }\n\n .settings-modal-tabs::part(tablist) {\n border-bottom: 0;\n padding: 0 calc(var(--design-unit) * 5px);\n column-gap: calc(var(--design-unit) * 5px);\n }\n\n .settings-modal-tabs::part(activeIndicator) {\n height: 2px;\n }\n\n .settings-modal-tab {\n padding: 0;\n font-weight: 600;\n gap: 6px;\n }\n\n .settings-modal-tab[aria-selected='true'] {\n color: var(--neutral-foreground-rest);\n }\n\n .settings-modal-tabs::part(tabpanel) {\n border-top: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-modal-tab-panel {\n display: flex;\n flex-direction: column;\n min-height: 0;\n flex: 1 1 auto;\n padding: 0;\n border-radius: 0;\n }\n\n .settings-modal-tab-panel[hidden] {\n display: none !important;\n }\n\n .settings-modal-body {\n overflow-y: auto;\n padding: 0 calc(var(--design-unit) * 5px) calc(var(--design-unit) * 2px);\n max-height: min(60vh, 520px);\n }\n\n .settings-modal-section {\n padding: calc(var(--design-unit) * 5px) 0;\n border-bottom: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-modal-section:last-child {\n border-bottom: none;\n }\n\n .settings-modal-section-title {\n margin: 0 0 calc(var(--design-unit) * 3px);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--neutral-foreground-hint);\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-modal-section-note {\n margin: calc(var(--design-unit) * -2px) 0 calc(var(--design-unit) * 3px);\n font-size: 12px;\n line-height: 1.5;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-modal-section-body {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 4px);\n }\n\n .settings-toggle-row {\n display: flex;\n align-items: flex-start;\n gap: calc(var(--design-unit) * 3px);\n padding: 0 0 calc(var(--design-unit) * 4px) 0;\n border-bottom: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-toggle-row:last-child {\n border-bottom: none;\n padding-bottom: calc(var(--design-unit) * 1px);\n }\n\n .settings-toggle-row.is-stacked {\n flex-direction: column;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-animation-list {\n display: flex;\n flex-direction: column;\n width: 100%;\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.2px);\n padding: calc(var(--design-unit) * 2px);\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-animation-list .settings-toggle-row {\n border: 0;\n }\n\n .settings-animation-category {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 4px);\n }\n\n .settings-animation-category-label {\n font-weight: 600;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-toggle-row + .settings-animation-category-label {\n border-top: 1px solid var(--neutral-stroke-rest);\n padding-top: calc(var(--design-unit) * 2px);\n }\n\n .settings-animation-option {\n padding: 0;\n margin: 0;\n }\n\n .settings-animation-option:last-child {\n border-bottom: none;\n padding-bottom: calc(var(--design-unit) * 2px);\n }\n\n .settings-toggle-text {\n flex: 1;\n min-width: 0;\n }\n\n .settings-toggle-title {\n font-size: 14px;\n font-weight: 500;\n color: var(--neutral-foreground-rest);\n }\n\n .settings-toggle-desc {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n line-height: 1.5;\n max-width: 92%;\n }\n\n .settings-toggle-control {\n flex: 0 0 auto;\n min-width: 0;\n }\n\n .settings-toggle-control-wide {\n width: 100%;\n max-width: 280px;\n }\n\n .settings-toggle-row.is-stacked .settings-toggle-desc {\n max-width: none;\n }\n\n .settings-toggle-row.is-stacked .settings-toggle-control-wide {\n width: 100%;\n max-width: none;\n }\n\n .settings-app-toggle-block {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 1px);\n }\n\n .settings-toggle-hint {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n line-height: 1.4;\n padding-left: calc(var(--design-unit) * 1px);\n font-style: italic;\n }\n\n .settings-context-header {\n display: flex;\n justify-content: space-between;\n gap: calc(var(--design-unit) * 2px);\n margin-bottom: calc(var(--design-unit) * 2px);\n font-size: 12px;\n }\n\n .settings-context-label {\n color: var(--neutral-foreground-hint);\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n }\n\n .settings-context-tokens {\n color: var(--neutral-foreground-rest);\n }\n\n .settings-current-build {\n background: var(--neutral-layer-2);\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n padding: calc(var(--design-unit) * 4px);\n margin: calc(var(--design-unit) * 3px) 0;\n }\n\n .settings-current-build-top {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: calc(var(--design-unit) * 2px);\n margin-bottom: calc(var(--design-unit) * 3px);\n }\n\n .settings-live-badge {\n display: inline-flex;\n align-items: center;\n gap: calc(var(--design-unit) * 1px);\n font-size: 10px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--accent-fill-rest);\n }\n\n .settings-live-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--accent-fill-rest);\n animation: settings-live-pulse 1.6s ease-out infinite;\n }\n\n @keyframes settings-live-pulse {\n 0% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-fill-rest) 55%, transparent);\n }\n\n 70% {\n box-shadow: 0 0 0 7px transparent;\n }\n\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n .settings-current-build-name {\n font-size: 14px;\n font-weight: 600;\n }\n\n .settings-current-build-stats {\n display: flex;\n flex-wrap: wrap;\n gap: calc(var(--design-unit) * 3px);\n margin-bottom: calc(var(--design-unit) * 3px);\n }\n\n .settings-build-stat {\n flex: 1;\n min-width: 0;\n background: var(--neutral-layer-1);\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1px);\n padding: calc(var(--design-unit) * 3px);\n }\n\n .settings-build-stat-label {\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-build-stat-value {\n font-size: 22px;\n font-weight: 700;\n margin-top: calc(var(--design-unit) * 1px);\n color: var(--neutral-foreground-rest);\n }\n\n .settings-build-stat-value .prefix,\n .settings-build-stat-value .suffix {\n color: var(--accent-fill-rest);\n }\n\n .settings-model-tags {\n display: flex;\n flex-wrap: wrap;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-model-tag {\n font-size: 11px;\n font-weight: 600;\n padding: 3px 9px;\n border-radius: 20px;\n font-family: ui-monospace, monospace;\n border: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-model-tag,\n .settings-cost-history-icon {\n --model-tag-color: var(--neutral-foreground-rest);\n\n background: color-mix(\n in srgb,\n var(--model-tag-color) var(--ai-tier-badge-bg-mix),\n var(--neutral-layer-1)\n );\n border-color: color-mix(in srgb, var(--model-tag-color) 20%, var(--neutral-layer-1));\n color: color-mix(in srgb, var(--model-tag-color), white var(--ai-tier-badge-text-lighten));\n }\n\n .settings-cost-history-title {\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--neutral-foreground-hint);\n font-weight: 600;\n margin: calc(var(--design-unit) * 4px) 0 calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history {\n display: flex;\n flex-direction: column;\n gap: calc(var(--design-unit) * 2px);\n padding-bottom: calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history-icon {\n flex: 0 0 auto;\n width: 36px;\n height: 36px;\n border-radius: calc(var(--control-corner-radius) * 1px);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 700;\n border: 1px solid var(--neutral-stroke-rest);\n }\n\n .settings-cost-history-row {\n display: flex;\n flex-direction: column;\n background: var(--neutral-layer-1);\n border: 1px solid var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n padding: calc(var(--design-unit) * 4px);\n }\n\n .settings-cost-history-row-content {\n display: flex;\n align-items: flex-start;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history-row-content + .settings-cost-history-row-content {\n border-top: 1px solid var(--neutral-stroke-rest);\n margin-top: calc(var(--design-unit) * 2px);\n padding-top: calc(var(--design-unit) * 2px);\n }\n\n .settings-cost-history-row-body {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n gap: calc(var(--design-unit) * 2px);\n justify-content: space-between;\n }\n\n .settings-cost-history-row-right {\n align-items: flex-end;\n }\n\n .settings-cost-history-row-cost,\n .settings-cost-history-row-title {\n font-size: 14px;\n font-weight: 600;\n color: var(--neutral-foreground-rest);\n min-width: 0;\n }\n\n .settings-cost-history-row-metrics {\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n font-size: 13px;\n font-family: ui-monospace, monospace;\n color: var(--neutral-foreground-rest);\n white-space: nowrap;\n }\n\n .settings-cost-history-row-tokens,\n .settings-cost-history-row-date {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-cost-history-delete {\n flex: 0 0 auto;\n margin-top: -2px;\n color: var(--neutral-foreground-hint);\n }\n\n .settings-cost-history-delete:hover {\n color: var(--error-color);\n }\n\n .settings-cost-history ::slotted(*) {\n display: block;\n }\n\n .settings-modal-footer {\n width: 100%;\n }\n\n .settings-done-button {\n margin-left: auto;\n }\n\n .settings-modal-footer-actions {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: calc(var(--design-unit) * 2px);\n width: 100%;\n }\n\n .settings-disclaimer {\n font-size: 12px;\n color: var(--neutral-foreground-hint);\n max-width: 60%;\n line-height: 1.4;\n }\n\n /*\n * Inline spinner shown in the \"Download agent log\" button while the log builds\n * (GENC-1351 §5.8) — the lifetime-stitch path is an async provider round-trip.\n * Sized to the button label and tinted with currentColor so it tracks the\n * button's text colour in every appearance / theme.\n */\n [part='download-button'] .download-spinner {\n display: inline-block;\n width: 12px;\n height: 12px;\n margin-right: calc(var(--design-unit) * 1px);\n vertical-align: -1px;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: download-spin 0.6s linear infinite;\n }\n\n @keyframes download-spin {\n to {\n transform: rotate(360deg);\n }\n }\n`",
8173
8770
  "description": "Styles for the assistant settings modal (tabs, sections, toggles, cost summary)."
8174
8771
  }
8175
8772
  ],
@@ -8217,6 +8814,518 @@
8217
8814
  }
8218
8815
  }
8219
8816
  ]
8817
+ },
8818
+ {
8819
+ "kind": "javascript-module",
8820
+ "path": "src/state/persistence/diagnostics-cursors.ts",
8821
+ "declarations": [
8822
+ {
8823
+ "kind": "function",
8824
+ "name": "getDiagnosticsCursors",
8825
+ "return": {
8826
+ "type": {
8827
+ "text": "DiagnosticsCursors"
8828
+ }
8829
+ },
8830
+ "parameters": [
8831
+ {
8832
+ "name": "key",
8833
+ "type": {
8834
+ "text": "string"
8835
+ }
8836
+ }
8837
+ ],
8838
+ "description": "The shared cursors for `key`, created (empty) on first access. @internal"
8839
+ },
8840
+ {
8841
+ "kind": "function",
8842
+ "name": "clearDiagnosticsCursorRegistry",
8843
+ "return": {
8844
+ "type": {
8845
+ "text": "void"
8846
+ }
8847
+ },
8848
+ "description": "Drop all cursors — test isolation only. @internal"
8849
+ }
8850
+ ],
8851
+ "exports": [
8852
+ {
8853
+ "kind": "js",
8854
+ "name": "getDiagnosticsCursors",
8855
+ "declaration": {
8856
+ "name": "getDiagnosticsCursors",
8857
+ "module": "src/state/persistence/diagnostics-cursors.ts"
8858
+ }
8859
+ },
8860
+ {
8861
+ "kind": "js",
8862
+ "name": "clearDiagnosticsCursorRegistry",
8863
+ "declaration": {
8864
+ "name": "clearDiagnosticsCursorRegistry",
8865
+ "module": "src/state/persistence/diagnostics-cursors.ts"
8866
+ }
8867
+ }
8868
+ ]
8869
+ },
8870
+ {
8871
+ "kind": "javascript-module",
8872
+ "path": "src/state/persistence/diagnostics.ts",
8873
+ "declarations": [
8874
+ {
8875
+ "kind": "function",
8876
+ "name": "assembleDebugLog",
8877
+ "return": {
8878
+ "type": {
8879
+ "text": "DebugLog"
8880
+ }
8881
+ },
8882
+ "parameters": [
8883
+ {
8884
+ "name": "entries",
8885
+ "type": {
8886
+ "text": "DiagnosticEntry[]"
8887
+ }
8888
+ },
8889
+ {
8890
+ "name": "readme",
8891
+ "type": {
8892
+ "text": "readonly string[]"
8893
+ }
8894
+ }
8895
+ ],
8896
+ "description": "Reassemble diagnostic entries into the `{ readme, timeline, meta }` debug-log\nshape (GENC-1351 §5.8). `timeline` = the `message`/`turn`/`event` entries sorted\nby ISO `timestamp` (kind-rank tie-break). `meta` = the **newest** `meta-snapshot`'s\nblock only — a \"state at export\" photo, matching the single-page log. The older\nsnapshots are intentionally dropped: the per-turn evolution they would show is\nalready in the timeline (`turn.agentSnapshot` + `context.updated` events), so\nkeeping them would just repeat the bulky, near-static `agentSummary`. `readme` =\nthe passed (current) constant. Pure — reused for both the live current-page log\nand the reassembled lifetime log stitched from the persisted stream, so both\ncome out shape-identical."
8897
+ }
8898
+ ],
8899
+ "exports": [
8900
+ {
8901
+ "kind": "js",
8902
+ "name": "assembleDebugLog",
8903
+ "declaration": {
8904
+ "name": "assembleDebugLog",
8905
+ "module": "src/state/persistence/diagnostics.ts"
8906
+ }
8907
+ }
8908
+ ]
8909
+ },
8910
+ {
8911
+ "kind": "javascript-module",
8912
+ "path": "src/state/persistence/index.ts",
8913
+ "declarations": [],
8914
+ "exports": [
8915
+ {
8916
+ "kind": "js",
8917
+ "name": "PERSISTED_SESSION_VERSION",
8918
+ "declaration": {
8919
+ "name": "PERSISTED_SESSION_VERSION",
8920
+ "module": "./session-snapshot"
8921
+ }
8922
+ },
8923
+ {
8924
+ "kind": "js",
8925
+ "name": "PersistedSession",
8926
+ "declaration": {
8927
+ "name": "PersistedSession",
8928
+ "module": "./session-snapshot"
8929
+ }
8930
+ },
8931
+ {
8932
+ "kind": "js",
8933
+ "name": "WebStorageSessionProvider",
8934
+ "declaration": {
8935
+ "name": "WebStorageSessionProvider",
8936
+ "module": "./session-persistence-provider"
8937
+ }
8938
+ },
8939
+ {
8940
+ "kind": "js",
8941
+ "name": "SessionPersistenceProvider",
8942
+ "declaration": {
8943
+ "name": "SessionPersistenceProvider",
8944
+ "module": "./session-persistence-provider"
8945
+ }
8946
+ },
8947
+ {
8948
+ "kind": "js",
8949
+ "name": "SessionPersistenceConfig",
8950
+ "declaration": {
8951
+ "name": "SessionPersistenceConfig",
8952
+ "module": "./session-persistence-provider"
8953
+ }
8954
+ },
8955
+ {
8956
+ "kind": "js",
8957
+ "name": "SessionPreferences",
8958
+ "declaration": {
8959
+ "name": "SessionPreferences",
8960
+ "module": "./session-persistence-provider"
8961
+ }
8962
+ },
8963
+ {
8964
+ "kind": "js",
8965
+ "name": "assembleDebugLog",
8966
+ "declaration": {
8967
+ "name": "assembleDebugLog",
8968
+ "module": "./diagnostics"
8969
+ }
8970
+ },
8971
+ {
8972
+ "kind": "js",
8973
+ "name": "DiagnosticEntry",
8974
+ "declaration": {
8975
+ "name": "DiagnosticEntry",
8976
+ "module": "./diagnostics"
8977
+ }
8978
+ },
8979
+ {
8980
+ "kind": "js",
8981
+ "name": "DebugLog",
8982
+ "declaration": {
8983
+ "name": "DebugLog",
8984
+ "module": "./diagnostics"
8985
+ }
8986
+ }
8987
+ ]
8988
+ },
8989
+ {
8990
+ "kind": "javascript-module",
8991
+ "path": "src/state/persistence/persister-registry.ts",
8992
+ "declarations": [
8993
+ {
8994
+ "kind": "function",
8995
+ "name": "getOrCreatePersister",
8996
+ "return": {
8997
+ "type": {
8998
+ "text": "SessionPersister"
8999
+ }
9000
+ },
9001
+ "parameters": [
9002
+ {
9003
+ "name": "key",
9004
+ "type": {
9005
+ "text": "string"
9006
+ }
9007
+ },
9008
+ {
9009
+ "name": "factory",
9010
+ "type": {
9011
+ "text": "() => SessionPersister"
9012
+ }
9013
+ }
9014
+ ],
9015
+ "description": "Returns the existing persister for `key`, or calls `factory` to create and\nregister a new one. First view to connect creates it; later views share it."
9016
+ },
9017
+ {
9018
+ "kind": "function",
9019
+ "name": "getPersister",
9020
+ "return": {
9021
+ "type": {
9022
+ "text": "SessionPersister | undefined"
9023
+ }
9024
+ },
9025
+ "parameters": [
9026
+ {
9027
+ "name": "key",
9028
+ "type": {
9029
+ "text": "string"
9030
+ }
9031
+ }
9032
+ ],
9033
+ "description": "Returns the existing persister for `key`, or `undefined`."
9034
+ },
9035
+ {
9036
+ "kind": "function",
9037
+ "name": "deletePersister",
9038
+ "return": {
9039
+ "type": {
9040
+ "text": "void"
9041
+ }
9042
+ },
9043
+ "parameters": [
9044
+ {
9045
+ "name": "key",
9046
+ "type": {
9047
+ "text": "string"
9048
+ }
9049
+ }
9050
+ ],
9051
+ "description": "Removes the persister for `key` (explicit session teardown)."
9052
+ }
9053
+ ],
9054
+ "exports": [
9055
+ {
9056
+ "kind": "js",
9057
+ "name": "getOrCreatePersister",
9058
+ "declaration": {
9059
+ "name": "getOrCreatePersister",
9060
+ "module": "src/state/persistence/persister-registry.ts"
9061
+ }
9062
+ },
9063
+ {
9064
+ "kind": "js",
9065
+ "name": "getPersister",
9066
+ "declaration": {
9067
+ "name": "getPersister",
9068
+ "module": "src/state/persistence/persister-registry.ts"
9069
+ }
9070
+ },
9071
+ {
9072
+ "kind": "js",
9073
+ "name": "deletePersister",
9074
+ "declaration": {
9075
+ "name": "deletePersister",
9076
+ "module": "src/state/persistence/persister-registry.ts"
9077
+ }
9078
+ }
9079
+ ]
9080
+ },
9081
+ {
9082
+ "kind": "javascript-module",
9083
+ "path": "src/state/persistence/session-persistence-provider.ts",
9084
+ "declarations": [
9085
+ {
9086
+ "kind": "class",
9087
+ "description": "A SessionPersistenceProvider backed by a Web Storage area. Both\n`window.sessionStorage` and `window.localStorage` implement the `Storage`\nAPI, so one class serves both: point it at `sessionStorage` for\nrefresh-survival that clears on tab close (the showcase default, O6), or at\n`localStorage` for durable local persistence.\n\nOpt-in: a host constructs it and passes it through `chatConfig`; the library\nnever instantiates it on its own.",
9088
+ "name": "WebStorageSessionProvider",
9089
+ "members": [
9090
+ {
9091
+ "kind": "field",
9092
+ "name": "storage",
9093
+ "type": {
9094
+ "text": "Storage"
9095
+ },
9096
+ "privacy": "private",
9097
+ "readonly": true,
9098
+ "default": "storage"
9099
+ },
9100
+ {
9101
+ "kind": "field",
9102
+ "name": "keyPrefix",
9103
+ "type": {
9104
+ "text": "string"
9105
+ },
9106
+ "privacy": "private",
9107
+ "readonly": true
9108
+ },
9109
+ {
9110
+ "kind": "field",
9111
+ "name": "saveDebounceMs",
9112
+ "type": {
9113
+ "text": "number"
9114
+ },
9115
+ "readonly": true,
9116
+ "description": "Web storage is synchronous and cheap, so the default is `0` — save as\nsoon as the tick settles, no throttle. Override via `options.saveDebounceMs`\n(e.g. if pointing at `localStorage` and you'd rather coalesce large writes)."
9117
+ },
9118
+ {
9119
+ "kind": "method",
9120
+ "name": "storageKey",
9121
+ "privacy": "private",
9122
+ "return": {
9123
+ "type": {
9124
+ "text": "string"
9125
+ }
9126
+ },
9127
+ "parameters": [
9128
+ {
9129
+ "name": "sessionKey",
9130
+ "type": {
9131
+ "text": "string"
9132
+ }
9133
+ }
9134
+ ]
9135
+ },
9136
+ {
9137
+ "kind": "method",
9138
+ "name": "preferencesKey",
9139
+ "privacy": "private",
9140
+ "return": {
9141
+ "type": {
9142
+ "text": "string"
9143
+ }
9144
+ },
9145
+ "parameters": [
9146
+ {
9147
+ "name": "sessionKey",
9148
+ "type": {
9149
+ "text": "string"
9150
+ }
9151
+ }
9152
+ ],
9153
+ "description": "Preferences key, namespaced apart from the session key so `clear` leaves it."
9154
+ },
9155
+ {
9156
+ "kind": "method",
9157
+ "name": "load",
9158
+ "return": {
9159
+ "type": {
9160
+ "text": "Promise<PersistedSession | null>"
9161
+ }
9162
+ },
9163
+ "parameters": [
9164
+ {
9165
+ "name": "sessionKey",
9166
+ "type": {
9167
+ "text": "string"
9168
+ }
9169
+ }
9170
+ ]
9171
+ },
9172
+ {
9173
+ "kind": "method",
9174
+ "name": "save",
9175
+ "return": {
9176
+ "type": {
9177
+ "text": "Promise<void>"
9178
+ }
9179
+ },
9180
+ "parameters": [
9181
+ {
9182
+ "name": "sessionKey",
9183
+ "type": {
9184
+ "text": "string"
9185
+ }
9186
+ },
9187
+ {
9188
+ "name": "snapshot",
9189
+ "type": {
9190
+ "text": "PersistedSession"
9191
+ }
9192
+ }
9193
+ ]
9194
+ },
9195
+ {
9196
+ "kind": "method",
9197
+ "name": "clear",
9198
+ "return": {
9199
+ "type": {
9200
+ "text": "Promise<void>"
9201
+ }
9202
+ },
9203
+ "parameters": [
9204
+ {
9205
+ "name": "sessionKey",
9206
+ "type": {
9207
+ "text": "string"
9208
+ }
9209
+ }
9210
+ ]
9211
+ },
9212
+ {
9213
+ "kind": "method",
9214
+ "name": "loadPreferences",
9215
+ "return": {
9216
+ "type": {
9217
+ "text": "Promise<SessionPreferences | undefined>"
9218
+ }
9219
+ },
9220
+ "parameters": [
9221
+ {
9222
+ "name": "sessionKey",
9223
+ "type": {
9224
+ "text": "string"
9225
+ }
9226
+ }
9227
+ ]
9228
+ },
9229
+ {
9230
+ "kind": "method",
9231
+ "name": "savePreferences",
9232
+ "return": {
9233
+ "type": {
9234
+ "text": "Promise<void>"
9235
+ }
9236
+ },
9237
+ "parameters": [
9238
+ {
9239
+ "name": "sessionKey",
9240
+ "type": {
9241
+ "text": "string"
9242
+ }
9243
+ },
9244
+ {
9245
+ "name": "preferences",
9246
+ "type": {
9247
+ "text": "SessionPreferences"
9248
+ }
9249
+ }
9250
+ ]
9251
+ }
9252
+ ]
9253
+ }
9254
+ ],
9255
+ "exports": [
9256
+ {
9257
+ "kind": "js",
9258
+ "name": "WebStorageSessionProvider",
9259
+ "declaration": {
9260
+ "name": "WebStorageSessionProvider",
9261
+ "module": "src/state/persistence/session-persistence-provider.ts"
9262
+ }
9263
+ }
9264
+ ]
9265
+ },
9266
+ {
9267
+ "kind": "javascript-module",
9268
+ "path": "src/state/persistence/session-persister.ts",
9269
+ "declarations": [],
9270
+ "exports": []
9271
+ },
9272
+ {
9273
+ "kind": "javascript-module",
9274
+ "path": "src/state/persistence/session-snapshot.ts",
9275
+ "declarations": [
9276
+ {
9277
+ "kind": "variable",
9278
+ "name": "PERSISTED_SESSION_VERSION",
9279
+ "type": {
9280
+ "text": "number"
9281
+ },
9282
+ "default": "1",
9283
+ "description": "Schema version of the persisted session shape. Bump on an incompatible\nchange; a snapshot whose `version` doesn't match is discarded on load rather\nthan risk feeding a stale shape into restore.",
9284
+ "privacy": "public"
9285
+ },
9286
+ {
9287
+ "kind": "function",
9288
+ "name": "unknownAgentSnapshots",
9289
+ "return": {
9290
+ "type": {
9291
+ "text": "string[]"
9292
+ }
9293
+ },
9294
+ "parameters": [
9295
+ {
9296
+ "name": "snapshot",
9297
+ "type": {
9298
+ "text": "PersistedSession"
9299
+ }
9300
+ },
9301
+ {
9302
+ "name": "knownAgentNames",
9303
+ "type": {
9304
+ "text": "Iterable<string>"
9305
+ }
9306
+ }
9307
+ ],
9308
+ "description": "Names of agents the restored session holds machine/state snapshots for but\nwhich are **not** in the currently-configured agent set — their flow cannot\nresume. Common when the host's agent array is dynamic (agents gated by feature\nflags, project state, or permissions; e.g. genesis-create). Callers should\nsurface these; the restore is otherwise non-fatal (the transcript and any\nknown agents still restore). Returns `[]` when `knownAgentNames` is empty —\nthe agent set isn't known yet, so we can't classify without false positives."
9309
+ }
9310
+ ],
9311
+ "exports": [
9312
+ {
9313
+ "kind": "js",
9314
+ "name": "PERSISTED_SESSION_VERSION",
9315
+ "declaration": {
9316
+ "name": "PERSISTED_SESSION_VERSION",
9317
+ "module": "src/state/persistence/session-snapshot.ts"
9318
+ }
9319
+ },
9320
+ {
9321
+ "kind": "js",
9322
+ "name": "unknownAgentSnapshots",
9323
+ "declaration": {
9324
+ "name": "unknownAgentSnapshots",
9325
+ "module": "src/state/persistence/session-snapshot.ts"
9326
+ }
9327
+ }
9328
+ ]
8220
9329
  }
8221
9330
  ]
8222
9331
  }