@genesislcap/ai-assistant 14.488.2-GENC-1351.8 → 14.488.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 (155) hide show
  1. package/dist/ai-assistant.api.json +2024 -5141
  2. package/dist/ai-assistant.d.ts +176 -791
  3. package/dist/custom-elements.json +297 -1327
  4. package/dist/dts/components/ai-driver/ai-driver.d.ts +8 -32
  5. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  6. package/dist/dts/components/chat-driver/chat-driver.d.ts +29 -13
  7. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  8. package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts +7 -0
  9. package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts.map +1 -1
  10. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +4 -15
  11. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  12. package/dist/dts/components/popout-manager/popout-manager.d.ts +9 -37
  13. package/dist/dts/components/popout-manager/popout-manager.d.ts.map +1 -1
  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 +0 -70
  17. package/dist/dts/config/config.d.ts.map +1 -1
  18. package/dist/dts/config/define-stateful-agent.d.ts +1 -73
  19. package/dist/dts/config/define-stateful-agent.d.ts.map +1 -1
  20. package/dist/dts/index.d.ts +0 -1
  21. package/dist/dts/index.d.ts.map +1 -1
  22. package/dist/dts/main/main.d.ts +87 -249
  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 +0 -55
  27. package/dist/dts/main/main.types.d.ts.map +1 -1
  28. package/dist/dts/state/ai-assistant-slice.d.ts +0 -66
  29. package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
  30. package/dist/dts/state/debug-event-log.d.ts +1 -1
  31. package/dist/dts/state/debug-event-log.d.ts.map +1 -1
  32. package/dist/dts/state/session-store.d.ts +0 -6
  33. package/dist/dts/state/session-store.d.ts.map +1 -1
  34. package/dist/dts/utils/history-transform.d.ts +0 -38
  35. package/dist/dts/utils/history-transform.d.ts.map +1 -1
  36. package/dist/dts/utils/message-partition.d.ts +0 -27
  37. package/dist/dts/utils/message-partition.d.ts.map +1 -1
  38. package/dist/esm/components/chat-driver/chat-driver.js +64 -90
  39. package/dist/esm/components/chat-driver/chat-driver.test.js +45 -0
  40. package/dist/esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js +35 -5
  41. package/dist/esm/components/chat-interaction-wrapper/chat-interaction-wrapper.test.js +62 -0
  42. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +14 -32
  43. package/dist/esm/components/popout-manager/popout-manager.js +27 -76
  44. package/dist/esm/components/settings-modal/settings-modal.styles.js +0 -24
  45. package/dist/esm/components/settings-modal/settings-modal.template.js +1 -14
  46. package/dist/esm/config/define-stateful-agent.js +0 -81
  47. package/dist/esm/index.js +0 -1
  48. package/dist/esm/main/main.js +200 -755
  49. package/dist/esm/main/main.styles.js +0 -55
  50. package/dist/esm/main/main.template.js +10 -94
  51. package/dist/esm/main/main.types.js +0 -27
  52. package/dist/esm/state/ai-assistant-slice.js +25 -71
  53. package/dist/esm/state/debug-event-log.js +0 -9
  54. package/dist/esm/utils/history-transform.js +0 -101
  55. package/dist/esm/utils/message-partition.js +2 -30
  56. package/dist/esm/utils/message-partition.test.js +1 -20
  57. package/dist/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +17 -17
  59. package/src/components/ai-driver/ai-driver.ts +17 -36
  60. package/src/components/chat-driver/chat-driver.test.ts +71 -0
  61. package/src/components/chat-driver/chat-driver.ts +69 -92
  62. package/src/components/chat-interaction-wrapper/chat-interaction-wrapper.test.ts +81 -0
  63. package/src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts +40 -5
  64. package/src/components/orchestrating-driver/orchestrating-driver.ts +18 -36
  65. package/src/components/popout-manager/popout-manager.ts +28 -82
  66. package/src/components/settings-modal/settings-modal.styles.ts +0 -24
  67. package/src/components/settings-modal/settings-modal.template.ts +1 -27
  68. package/src/config/config.ts +0 -71
  69. package/src/config/define-stateful-agent.ts +0 -134
  70. package/src/index.ts +0 -1
  71. package/src/main/main.styles.ts +0 -55
  72. package/src/main/main.template.ts +11 -121
  73. package/src/main/main.ts +179 -738
  74. package/src/main/main.types.ts +0 -59
  75. package/src/state/ai-assistant-slice.ts +25 -120
  76. package/src/state/debug-event-log.ts +1 -20
  77. package/src/utils/history-transform.ts +0 -117
  78. package/src/utils/message-partition.test.ts +1 -27
  79. package/src/utils/message-partition.ts +2 -41
  80. package/dist/dts/components/chat-driver/chat-driver.compact.test.d.ts +0 -2
  81. package/dist/dts/components/chat-driver/chat-driver.compact.test.d.ts.map +0 -1
  82. package/dist/dts/components/orchestrating-driver/orchestrating-driver.pin.test.d.ts +0 -2
  83. package/dist/dts/components/orchestrating-driver/orchestrating-driver.pin.test.d.ts.map +0 -1
  84. package/dist/dts/state/ai-assistant-slice.test.d.ts +0 -2
  85. package/dist/dts/state/ai-assistant-slice.test.d.ts.map +0 -1
  86. package/dist/dts/state/persistence/diagnostics-cursors.d.ts +0 -40
  87. package/dist/dts/state/persistence/diagnostics-cursors.d.ts.map +0 -1
  88. package/dist/dts/state/persistence/diagnostics.d.ts +0 -58
  89. package/dist/dts/state/persistence/diagnostics.d.ts.map +0 -1
  90. package/dist/dts/state/persistence/diagnostics.test.d.ts +0 -2
  91. package/dist/dts/state/persistence/diagnostics.test.d.ts.map +0 -1
  92. package/dist/dts/state/persistence/index.d.ts +0 -7
  93. package/dist/dts/state/persistence/index.d.ts.map +0 -1
  94. package/dist/dts/state/persistence/persister-registry.d.ts +0 -17
  95. package/dist/dts/state/persistence/persister-registry.d.ts.map +0 -1
  96. package/dist/dts/state/persistence/session-persistence-provider.d.ts +0 -132
  97. package/dist/dts/state/persistence/session-persistence-provider.d.ts.map +0 -1
  98. package/dist/dts/state/persistence/session-persistence-provider.test.d.ts +0 -2
  99. package/dist/dts/state/persistence/session-persistence-provider.test.d.ts.map +0 -1
  100. package/dist/dts/state/persistence/session-persistence.integration.test.d.ts +0 -2
  101. package/dist/dts/state/persistence/session-persistence.integration.test.d.ts.map +0 -1
  102. package/dist/dts/state/persistence/session-persister.d.ts +0 -161
  103. package/dist/dts/state/persistence/session-persister.d.ts.map +0 -1
  104. package/dist/dts/state/persistence/session-persister.test.d.ts +0 -2
  105. package/dist/dts/state/persistence/session-persister.test.d.ts.map +0 -1
  106. package/dist/dts/state/persistence/session-snapshot.d.ts +0 -209
  107. package/dist/dts/state/persistence/session-snapshot.d.ts.map +0 -1
  108. package/dist/dts/state/persistence/session-snapshot.test.d.ts +0 -2
  109. package/dist/dts/state/persistence/session-snapshot.test.d.ts.map +0 -1
  110. package/dist/dts/utils/history-transform.test.d.ts +0 -2
  111. package/dist/dts/utils/history-transform.test.d.ts.map +0 -1
  112. package/dist/dts/utils/resolve-preference-baseline.d.ts +0 -43
  113. package/dist/dts/utils/resolve-preference-baseline.d.ts.map +0 -1
  114. package/dist/dts/utils/resolve-preference-baseline.test.d.ts +0 -2
  115. package/dist/dts/utils/resolve-preference-baseline.test.d.ts.map +0 -1
  116. package/dist/dts/utils/with-timeout.d.ts +0 -12
  117. package/dist/dts/utils/with-timeout.d.ts.map +0 -1
  118. package/dist/esm/components/chat-driver/chat-driver.compact.test.js +0 -93
  119. package/dist/esm/components/orchestrating-driver/orchestrating-driver.pin.test.js +0 -48
  120. package/dist/esm/state/ai-assistant-slice.test.js +0 -65
  121. package/dist/esm/state/persistence/diagnostics-cursors.js +0 -34
  122. package/dist/esm/state/persistence/diagnostics.js +0 -81
  123. package/dist/esm/state/persistence/diagnostics.test.js +0 -72
  124. package/dist/esm/state/persistence/index.js +0 -3
  125. package/dist/esm/state/persistence/persister-registry.js +0 -41
  126. package/dist/esm/state/persistence/session-persistence-provider.js +0 -95
  127. package/dist/esm/state/persistence/session-persistence-provider.test.js +0 -110
  128. package/dist/esm/state/persistence/session-persistence.integration.test.js +0 -109
  129. package/dist/esm/state/persistence/session-persister.js +0 -589
  130. package/dist/esm/state/persistence/session-persister.test.js +0 -239
  131. package/dist/esm/state/persistence/session-snapshot.js +0 -231
  132. package/dist/esm/state/persistence/session-snapshot.test.js +0 -243
  133. package/dist/esm/utils/history-transform.test.js +0 -137
  134. package/dist/esm/utils/resolve-preference-baseline.js +0 -53
  135. package/dist/esm/utils/resolve-preference-baseline.test.js +0 -69
  136. package/dist/esm/utils/with-timeout.js +0 -28
  137. package/src/components/chat-driver/chat-driver.compact.test.ts +0 -131
  138. package/src/components/orchestrating-driver/orchestrating-driver.pin.test.ts +0 -76
  139. package/src/state/ai-assistant-slice.test.ts +0 -82
  140. package/src/state/persistence/diagnostics-cursors.ts +0 -66
  141. package/src/state/persistence/diagnostics.test.ts +0 -95
  142. package/src/state/persistence/diagnostics.ts +0 -103
  143. package/src/state/persistence/index.ts +0 -10
  144. package/src/state/persistence/persister-registry.ts +0 -49
  145. package/src/state/persistence/session-persistence-provider.test.ts +0 -136
  146. package/src/state/persistence/session-persistence-provider.ts +0 -202
  147. package/src/state/persistence/session-persistence.integration.test.ts +0 -134
  148. package/src/state/persistence/session-persister.test.ts +0 -325
  149. package/src/state/persistence/session-persister.ts +0 -635
  150. package/src/state/persistence/session-snapshot.test.ts +0 -339
  151. package/src/state/persistence/session-snapshot.ts +0 -332
  152. package/src/utils/history-transform.test.ts +0 -197
  153. package/src/utils/resolve-preference-baseline.test.ts +0 -84
  154. package/src/utils/resolve-preference-baseline.ts +0 -80
  155. package/src/utils/with-timeout.ts +0 -24
@@ -119,14 +119,6 @@
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
- },
130
122
  {
131
123
  "kind": "js",
132
124
  "name": "*",
@@ -898,37 +890,6 @@
898
890
  "kind": "javascript-module",
899
891
  "path": "src/config/define-stateful-agent.ts",
900
892
  "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
- },
932
893
  {
933
894
  "kind": "function",
934
895
  "name": "defineStatefulAgent",
@@ -949,14 +910,6 @@
949
910
  }
950
911
  ],
951
912
  "exports": [
952
- {
953
- "kind": "js",
954
- "name": "restoreMachine",
955
- "declaration": {
956
- "name": "restoreMachine",
957
- "module": "src/config/define-stateful-agent.ts"
958
- }
959
- },
960
913
  {
961
914
  "kind": "js",
962
915
  "name": "defineStatefulAgent",
@@ -1153,14 +1106,6 @@
1153
1106
  },
1154
1107
  "default": "'Genesis Assistant'"
1155
1108
  },
1156
- {
1157
- "kind": "field",
1158
- "name": "sessionKey",
1159
- "type": {
1160
- "text": "string | undefined"
1161
- },
1162
- "description": "Explicit session/persistence key (GENC-1351 §5.12). When set, this is the\nsession identity — the key for the driver/store/persister/diagnostics\nregistries and the `sessionKey` passed to the persistence provider — taking\nprecedence over the DOM `id`. A host that scopes persistence per-entity\n(e.g. one chat session per project) binds this to a stable per-entity id;\nchanging it on a **connected** element re-keys the session in place — tears\ndown the current conversation and restores the new key's — via\n`switchSession`. Falls back to `id` when unset,\nso existing consumers are unaffected."
1163
- },
1164
1109
  {
1165
1110
  "kind": "field",
1166
1111
  "name": "imageSrc",
@@ -1261,15 +1206,6 @@
1261
1206
  },
1262
1207
  "default": "{}"
1263
1208
  },
1264
- {
1265
- "kind": "field",
1266
- "name": "persistence",
1267
- "type": {
1268
- "text": "SessionPersistenceConfig"
1269
- },
1270
- "default": "{}",
1271
- "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`."
1272
- },
1273
1209
  {
1274
1210
  "kind": "field",
1275
1211
  "name": "agentPicker",
@@ -1310,8 +1246,7 @@
1310
1246
  "type": {
1311
1247
  "text": "SessionStoreReturn | undefined"
1312
1248
  },
1313
- "privacy": "private",
1314
- "description": "Pointer to this session's redux store. `@observable` (GENC-1351 §5.12) so that\n**swapping** it — the in-place session switch/re-key (`switchSession`) —\nforces every store-backed getter binding to re-evaluate against the NEW store.\nWithout this, FAST's per-store slice tracking would leave the view subscribed\nto the old store after a swap and it wouldn't re-render. (A same-store reset via\nredux actions re-renders without this; a store *swap* needs it.)"
1249
+ "privacy": "private"
1315
1250
  },
1316
1251
  {
1317
1252
  "kind": "field",
@@ -1435,30 +1370,6 @@
1435
1370
  },
1436
1371
  "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."
1437
1372
  },
1438
- {
1439
- "kind": "field",
1440
- "name": "sessionMenuOpen",
1441
- "type": {
1442
- "text": "boolean"
1443
- },
1444
- "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."
1445
- },
1446
- {
1447
- "kind": "field",
1448
- "name": "compacting",
1449
- "type": {
1450
- "text": "boolean"
1451
- },
1452
- "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."
1453
- },
1454
- {
1455
- "kind": "field",
1456
- "name": "restoring",
1457
- "type": {
1458
- "text": "boolean"
1459
- },
1460
- "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."
1461
- },
1462
1373
  {
1463
1374
  "kind": "field",
1464
1375
  "name": "pinnedAgentName",
@@ -1760,15 +1671,6 @@
1760
1671
  "default": "false",
1761
1672
  "description": "Whether the settings modal is open."
1762
1673
  },
1763
- {
1764
- "kind": "field",
1765
- "name": "downloadingDebugLog",
1766
- "type": {
1767
- "text": "boolean"
1768
- },
1769
- "default": "false",
1770
- "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."
1771
- },
1772
1674
  {
1773
1675
  "kind": "field",
1774
1676
  "name": "settingsModalTab",
@@ -2031,6 +1933,13 @@
2031
1933
  "default": "true",
2032
1934
  "description": "True when the user's last interaction (pointer or keyboard focus) was inside\nthe assistant. Defaults to true so the assistant claims focus on first mount.\nAuto-focus features (chat input on idle, widget inputs on mount) gate on this\nto avoid stealing focus from elsewhere on the page."
2033
1935
  },
1936
+ {
1937
+ "kind": "field",
1938
+ "name": "hostId",
1939
+ "privacy": "private",
1940
+ "readonly": true,
1941
+ "description": "GENC-1410 (Error 3): stable id for this assistant view. Reported to the shared driver so it\ncan elect a single owner to render (and run) each interaction's widget when more than one view\n(e.g. a bubble and a docked panel) is wired to the same driver — so it fires once, not per view."
1942
+ },
2034
1943
  {
2035
1944
  "kind": "field",
2036
1945
  "name": "_handleGlobalInteraction",
@@ -2112,36 +2021,6 @@
2112
2021
  "privacy": "private",
2113
2022
  "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."
2114
2023
  },
2115
- {
2116
- "kind": "field",
2117
- "name": "_applyingPreferences",
2118
- "type": {
2119
- "text": "boolean"
2120
- },
2121
- "privacy": "private",
2122
- "default": "false",
2123
- "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)."
2124
- },
2125
- {
2126
- "kind": "field",
2127
- "name": "_freshStore",
2128
- "type": {
2129
- "text": "boolean"
2130
- },
2131
- "privacy": "private",
2132
- "default": "false",
2133
- "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."
2134
- },
2135
- {
2136
- "kind": "field",
2137
- "name": "_sessionActive",
2138
- "type": {
2139
- "text": "boolean"
2140
- },
2141
- "privacy": "private",
2142
- "default": "false",
2143
- "description": "True once `connectedCallback` has fully wired the initial session (GENC-1351\n§5.12). Guards `sessionKeyChanged` so the initial, pre-connect `session-key`\nset doesn't trigger a re-key — only a genuine change to a connected element\nswitches the session. Reset on disconnect."
2144
- },
2145
2024
  {
2146
2025
  "kind": "field",
2147
2026
  "name": "showHalo",
@@ -2268,82 +2147,6 @@
2268
2147
  },
2269
2148
  "description": "Removes event listeners attached by `wireDriver`. Does not destroy\nthe driver or remove it from the registry."
2270
2149
  },
2271
- {
2272
- "kind": "method",
2273
- "name": "activateSession",
2274
- "privacy": "private",
2275
- "return": {
2276
- "type": {
2277
- "text": "void"
2278
- }
2279
- },
2280
- "parameters": [
2281
- {
2282
- "name": "key",
2283
- "type": {
2284
- "text": "string"
2285
- }
2286
- },
2287
- {
2288
- "name": "isNewStore",
2289
- "type": {
2290
- "text": "boolean"
2291
- }
2292
- }
2293
- ],
2294
- "description": "Wire up the session identified by `key` on this element: preference baseline,\ndriver (build/reuse) + wiring, restore (fresh store only), and the per-session\nview state (splash, loading-resume, suggestions, context/provider status, cost\nhistory). Extracted from `connectedCallback` (GENC-1351 §5.12) so an in-place\nsession switch (`switchSession`) can re-run exactly this against a new\nkey without re-adding element-lifetime listeners. Session-scoped only — the\nelement-lifetime wiring (DOM/document/window listeners, provider-registry\nsubscription, app-settings, pagehide) stays in `connectedCallback`."
2295
- },
2296
- {
2297
- "kind": "method",
2298
- "name": "switchSession",
2299
- "return": {
2300
- "type": {
2301
- "text": "void"
2302
- }
2303
- },
2304
- "parameters": [
2305
- {
2306
- "name": "oldKey",
2307
- "type": {
2308
- "text": "string"
2309
- },
2310
- "description": "the state key being switched away from."
2311
- },
2312
- {
2313
- "name": "newKey",
2314
- "type": {
2315
- "text": "string"
2316
- },
2317
- "description": "the state key to activate."
2318
- }
2319
- ],
2320
- "description": "Switch this element to a different session **in place**, without a page reload\n(GENC-1351 §5.12) — the load-a-different-project flow. Tears down the current\nsession's driver + per-key registries and restores the target key's session\n(its transcript and any mid-flow stateful agent). Fired automatically by\n`sessionKeyChanged` when a host rebinds\n`session-key` on a connected element; may also be called directly.\n\nClobber-safe: the outgoing session's pending autosave is cancelled BEFORE the\nstore swaps, so its transcript can never be written to the incoming session's\nfile. Idle-only — a switch while a turn is running is refused.",
2321
- "privacy": "public"
2322
- },
2323
- {
2324
- "kind": "method",
2325
- "name": "sessionKeyChanged",
2326
- "return": {
2327
- "type": {
2328
- "text": "void"
2329
- }
2330
- },
2331
- "parameters": [
2332
- {
2333
- "name": "oldValue",
2334
- "type": {
2335
- "text": "string | undefined"
2336
- }
2337
- },
2338
- {
2339
- "name": "_newValue",
2340
- "type": {
2341
- "text": "string | undefined"
2342
- }
2343
- }
2344
- ],
2345
- "description": "FAST reflection hook for the `session-key` attr: a change on a **connected**\nelement re-keys the session in place (GENC-1351 §5.12). Guarded by\n`_sessionActive` so the initial, pre-connect set does not switch — the first\nkey is wired by `connectedCallback`."
2346
- },
2347
2150
  {
2348
2151
  "kind": "method",
2349
2152
  "name": "resolveContextLimit",
@@ -2447,13 +2250,40 @@
2447
2250
  },
2448
2251
  {
2449
2252
  "kind": "method",
2450
- "name": "handlePopout",
2253
+ "name": "claimSideEffect",
2254
+ "return": {
2255
+ "type": {
2256
+ "text": "boolean"
2257
+ }
2258
+ },
2259
+ "parameters": [
2260
+ {
2261
+ "name": "interactionId",
2262
+ "type": {
2263
+ "text": "string"
2264
+ }
2265
+ }
2266
+ ],
2267
+ "description": "GENC-1410 (Error 3): claim the right to run a side-effecting interaction's server work for\nTHIS view, via the shared driver's first-writer-wins latch. Returns `true` when this view may\nrun it (first/owning claimant, or a re-render of the same view), `false` when another view\nalready holds it. Fail-open when the driver has no latch. Called by `ai-chat-interaction-wrapper`."
2268
+ },
2269
+ {
2270
+ "kind": "method",
2271
+ "name": "claimInteractionOwnership",
2451
2272
  "return": {
2452
2273
  "type": {
2453
2274
  "text": "void"
2454
2275
  }
2455
2276
  },
2456
- "description": "Called when the user clicks the popout button."
2277
+ "description": "GENC-1410 (Error 3): mark THIS view as the interaction owner on the shared driver, so it (not a\nsibling view sharing the same driver) is elected to render side-effecting widgets. The bubble\nand docked panel normally claim this automatically on the pop-in / dock lifecycle, but that\nlifecycle only runs once `popout-mode` is active. A host that establishes a view outside that\nlifecycle — e.g. a page that restores a docked assistant from a persisted layout before the\npop-out affordance is enabled — calls this to seize ownership deterministically rather than\nleaving it to the last-interaction / first-registered fallback. Idempotent; safe to call on\nevery layout (re)establish. No-op if the driver was never wired."
2278
+ },
2279
+ {
2280
+ "kind": "method",
2281
+ "name": "handlePopout",
2282
+ "return": {
2283
+ "type": {
2284
+ "text": "void"
2285
+ }
2286
+ }
2457
2287
  },
2458
2288
  {
2459
2289
  "kind": "method",
@@ -2504,236 +2334,101 @@
2504
2334
  "name": "toggleAgentPicker"
2505
2335
  },
2506
2336
  {
2507
- "kind": "field",
2508
- "name": "confirmingClear",
2509
- "type": {
2510
- "text": "boolean"
2337
+ "kind": "method",
2338
+ "name": "setAgent",
2339
+ "return": {
2340
+ "type": {
2341
+ "text": "boolean"
2342
+ }
2511
2343
  },
2512
- "default": "false",
2513
- "description": "Two-step confirm for the destructive Clear action; reset whenever the menu toggles."
2344
+ "parameters": [
2345
+ {
2346
+ "name": "agentName",
2347
+ "type": {
2348
+ "text": "string"
2349
+ }
2350
+ },
2351
+ {
2352
+ "name": "options",
2353
+ "optional": true,
2354
+ "type": {
2355
+ "text": "{ force?: boolean }"
2356
+ }
2357
+ }
2358
+ ],
2359
+ "description": "Programmatically pin an agent by name. Returns `true` if the pin was\napplied, `false` if the agent isn't in the configured agents array or\nthe call was suppressed by `force: false`.\n\nWith `force: false`, the call is a no-op when a `picker.defaultAgent` is\nconfigured and the user has already moved away from it (either by picking\nanother agent or by switching to Auto). This lets hosts seed an opinion\nwithout overriding an explicit user choice.",
2360
+ "privacy": "public"
2514
2361
  },
2515
2362
  {
2516
2363
  "kind": "field",
2517
- "name": "confirmingCompact",
2364
+ "name": "agentPickerEnabled",
2518
2365
  "type": {
2519
2366
  "text": "boolean"
2520
2367
  },
2521
- "default": "false"
2522
- },
2523
- {
2524
- "kind": "field",
2525
- "name": "_sessionMenuToggle",
2526
- "privacy": "private",
2527
- "readonly": true,
2528
- "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 )"
2368
+ "description": "Whether the picker toggle button should appear. Mirrors the picker's own visibility rule.",
2369
+ "readonly": true
2529
2370
  },
2530
2371
  {
2531
2372
  "kind": "field",
2532
- "name": "sessionMenuEnabled",
2373
+ "name": "settingsModelSectionVisible",
2533
2374
  "type": {
2534
2375
  "text": "boolean"
2535
2376
  },
2536
- "description": "Whether the lifecycle-menu button shows. It occupies the stop-button slot,\nso it only appears when idle (mutually exclusive with Stop). Gated on\npersistence — the menu's actions (Compact, Clear, the \"remember chat\" toggle)\nonly make sense with a provider configured, so it's hidden entirely without\none. A host can additionally force it off via `chatConfig.ui.showSessionMenu:\nfalse` even when a provider is present (e.g. a guided onboarding flow where\nclearing/compacting mid-journey would be disruptive).",
2377
+ "description": "Whether the settings modal AI Model section has slotted app content or context usage.",
2537
2378
  "readonly": true
2538
2379
  },
2539
2380
  {
2540
2381
  "kind": "field",
2541
- "name": "persistenceToggleable",
2382
+ "name": "settingsContextUsageVisible",
2542
2383
  "type": {
2543
2384
  "text": "boolean"
2544
2385
  },
2545
- "description": "The persistence toggle row renders only when a provider is configured.",
2386
+ "description": "Built-in context window indicator (generic platform concern).",
2546
2387
  "readonly": true
2547
2388
  },
2548
2389
  {
2549
2390
  "kind": "field",
2550
- "name": "persistenceActive",
2391
+ "name": "settingsAppSectionVisible",
2551
2392
  "type": {
2552
2393
  "text": "boolean"
2553
2394
  },
2554
- "description": "Whether persistence is currently active (on + a provider) for this session.",
2395
+ "description": "Whether the settings modal UI Builder section should render.",
2555
2396
  "readonly": true
2556
2397
  },
2557
2398
  {
2558
2399
  "kind": "field",
2559
- "name": "compactable",
2400
+ "name": "appSettingsSectionTitle",
2560
2401
  "type": {
2561
- "text": "boolean"
2402
+ "text": "string"
2562
2403
  },
2563
- "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.",
2404
+ "description": "Section title for the app settings block.",
2564
2405
  "readonly": true
2565
2406
  },
2566
2407
  {
2567
- "kind": "method",
2568
- "name": "toggleSessionMenu"
2408
+ "kind": "field",
2409
+ "name": "visibleAppSettingsToggles",
2410
+ "type": {
2411
+ "text": "AssistantAppSettingsToggle[]"
2412
+ },
2413
+ "description": "App toggles currently visible per each entry's `visible()` predicate.",
2414
+ "readonly": true
2569
2415
  },
2570
2416
  {
2571
2417
  "kind": "method",
2572
- "name": "setPersistenceEnabled",
2418
+ "name": "getAppSettingValue",
2419
+ "return": {
2420
+ "type": {
2421
+ "text": "boolean"
2422
+ }
2423
+ },
2573
2424
  "parameters": [
2574
2425
  {
2575
- "name": "enabled",
2426
+ "name": "id",
2576
2427
  "type": {
2577
- "text": "boolean"
2428
+ "text": "string"
2578
2429
  }
2579
2430
  }
2580
- ],
2581
- "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)."
2582
- },
2583
- {
2584
- "kind": "method",
2585
- "name": "togglePersistence",
2586
- "description": "Toggle persistence (convenience / programmatic)."
2587
- },
2588
- {
2589
- "kind": "method",
2590
- "name": "gatherPreferences",
2591
- "privacy": "private",
2592
- "return": {
2593
- "type": {
2594
- "text": "SessionPreferences"
2595
- }
2596
- },
2597
- "description": "Snapshot the user-changeable settings into a persistable preferences blob."
2598
- },
2599
- {
2600
- "kind": "method",
2601
- "name": "persistPreferences",
2602
- "privacy": "private",
2603
- "return": {
2604
- "type": {
2605
- "text": "void"
2606
- }
2607
- },
2608
- "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."
2609
- },
2610
- {
2611
- "kind": "method",
2612
- "name": "applyPreferenceBaseline",
2613
- "privacy": "private",
2614
- "return": {
2615
- "type": {
2616
- "text": "void"
2617
- }
2618
- },
2619
- "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."
2620
- },
2621
- {
2622
- "kind": "method",
2623
- "name": "compactSession",
2624
- "return": {
2625
- "type": {
2626
- "text": "Promise<void>"
2627
- }
2628
- },
2629
- "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`)."
2630
- },
2631
- {
2632
- "kind": "method",
2633
- "name": "clearSession",
2634
- "return": {
2635
- "type": {
2636
- "text": "Promise<void>"
2637
- }
2638
- },
2639
- "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."
2640
- },
2641
- {
2642
- "kind": "method",
2643
- "name": "setAgent",
2644
- "return": {
2645
- "type": {
2646
- "text": "boolean"
2647
- }
2648
- },
2649
- "parameters": [
2650
- {
2651
- "name": "agentName",
2652
- "type": {
2653
- "text": "string"
2654
- }
2655
- },
2656
- {
2657
- "name": "options",
2658
- "optional": true,
2659
- "type": {
2660
- "text": "{ force?: boolean }"
2661
- }
2662
- }
2663
- ],
2664
- "description": "Programmatically pin an agent by name. Returns `true` if the pin was\napplied, `false` if the agent isn't in the configured agents array or\nthe call was suppressed by `force: false`.\n\nWith `force: false`, the call is a no-op when a `picker.defaultAgent` is\nconfigured and the user has already moved away from it (either by picking\nanother agent or by switching to Auto). This lets hosts seed an opinion\nwithout overriding an explicit user choice.",
2665
- "privacy": "public"
2666
- },
2667
- {
2668
- "kind": "field",
2669
- "name": "agentPickerEnabled",
2670
- "type": {
2671
- "text": "boolean"
2672
- },
2673
- "description": "Whether the picker toggle button should appear. Mirrors the picker's own visibility rule.",
2674
- "readonly": true
2675
- },
2676
- {
2677
- "kind": "field",
2678
- "name": "settingsModelSectionVisible",
2679
- "type": {
2680
- "text": "boolean"
2681
- },
2682
- "description": "Whether the settings modal AI Model section has slotted app content or context usage.",
2683
- "readonly": true
2684
- },
2685
- {
2686
- "kind": "field",
2687
- "name": "settingsContextUsageVisible",
2688
- "type": {
2689
- "text": "boolean"
2690
- },
2691
- "description": "Built-in context window indicator (generic platform concern).",
2692
- "readonly": true
2693
- },
2694
- {
2695
- "kind": "field",
2696
- "name": "settingsAppSectionVisible",
2697
- "type": {
2698
- "text": "boolean"
2699
- },
2700
- "description": "Whether the settings modal UI Builder section should render.",
2701
- "readonly": true
2702
- },
2703
- {
2704
- "kind": "field",
2705
- "name": "appSettingsSectionTitle",
2706
- "type": {
2707
- "text": "string"
2708
- },
2709
- "description": "Section title for the app settings block.",
2710
- "readonly": true
2711
- },
2712
- {
2713
- "kind": "field",
2714
- "name": "visibleAppSettingsToggles",
2715
- "type": {
2716
- "text": "AssistantAppSettingsToggle[]"
2717
- },
2718
- "description": "App toggles currently visible per each entry's `visible()` predicate.",
2719
- "readonly": true
2720
- },
2721
- {
2722
- "kind": "method",
2723
- "name": "getAppSettingValue",
2724
- "return": {
2725
- "type": {
2726
- "text": "boolean"
2727
- }
2728
- },
2729
- "parameters": [
2730
- {
2731
- "name": "id",
2732
- "type": {
2733
- "text": "string"
2734
- }
2735
- }
2736
- ]
2431
+ ]
2737
2432
  },
2738
2433
  {
2739
2434
  "kind": "method",
@@ -3006,74 +2701,11 @@
3006
2701
  },
3007
2702
  {
3008
2703
  "kind": "method",
3009
- "name": "getDebugLog",
3010
- "return": {
3011
- "type": {
3012
- "text": "DebugLog"
3013
- }
3014
- },
3015
- "description": "The live current-page debug log (`{ readme, timeline, meta }`). @public"
3016
- },
3017
- {
3018
- "kind": "method",
3019
- "name": "buildDiagnosticEntries",
3020
- "privacy": "private",
3021
- "return": {
3022
- "type": {
3023
- "text": "DiagnosticEntry[]"
3024
- }
3025
- },
3026
- "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."
3027
- },
3028
- {
3029
- "kind": "method",
3030
- "name": "downloadDebugLog",
3031
- "return": {
3032
- "type": {
3033
- "text": "Promise<void>"
3034
- }
3035
- }
3036
- },
3037
- {
3038
- "kind": "method",
3039
- "name": "buildDownloadLog",
3040
- "privacy": "private",
3041
- "return": {
3042
- "type": {
3043
- "text": "Promise<DebugLog>"
3044
- }
3045
- },
3046
- "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."
3047
- },
3048
- {
3049
- "kind": "method",
3050
- "name": "persister",
3051
- "privacy": "private",
3052
- "return": {
3053
- "type": {
3054
- "text": "SessionPersister | undefined"
3055
- }
3056
- },
3057
- "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."
2704
+ "name": "getDebugLog"
3058
2705
  },
3059
2706
  {
3060
2707
  "kind": "method",
3061
- "name": "initPersistenceForNewStore",
3062
- "privacy": "private",
3063
- "return": {
3064
- "type": {
3065
- "text": "Promise<void>"
3066
- }
3067
- },
3068
- "parameters": [
3069
- {
3070
- "name": "key",
3071
- "type": {
3072
- "text": "string"
3073
- }
3074
- }
3075
- ],
3076
- "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."
2708
+ "name": "downloadDebugLog"
3077
2709
  },
3078
2710
  {
3079
2711
  "kind": "method",
@@ -3355,13 +2987,11 @@
3355
2987
  ],
3356
2988
  "events": [
3357
2989
  {
2990
+ "name": "chat-header-mousedown",
3358
2991
  "type": {
3359
2992
  "text": "CustomEvent"
3360
- }
3361
- },
3362
- {
3363
- "description": "Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMousedownEventDetail`",
3364
- "name": "chat-header-mousedown"
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`"
3365
2995
  }
3366
2996
  ],
3367
2997
  "attributes": [
@@ -3373,14 +3003,6 @@
3373
3003
  "default": "'Genesis Assistant'",
3374
3004
  "fieldName": "headerTitle"
3375
3005
  },
3376
- {
3377
- "name": "session-key",
3378
- "type": {
3379
- "text": "string | undefined"
3380
- },
3381
- "description": "Explicit session/persistence key (GENC-1351 §5.12). When set, this is the\nsession identity — the key for the driver/store/persister/diagnostics\nregistries and the `sessionKey` passed to the persistence provider — taking\nprecedence over the DOM `id`. A host that scopes persistence per-entity\n(e.g. one chat session per project) binds this to a stable per-entity id;\nchanging it on a **connected** element re-keys the session in place — tears\ndown the current conversation and restores the new key's — via\n`switchSession`. Falls back to `id` when unset,\nso existing consumers are unaffected.",
3382
- "fieldName": "sessionKey"
3383
- },
3384
3006
  {
3385
3007
  "name": "image-src",
3386
3008
  "type": {
@@ -3476,15 +3098,6 @@
3476
3098
  "kind": "javascript-module",
3477
3099
  "path": "src/main/main.types.ts",
3478
3100
  "declarations": [
3479
- {
3480
- "kind": "variable",
3481
- "name": "AiAssistantEvent",
3482
- "type": {
3483
- "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}"
3484
- },
3485
- "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}",
3486
- "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."
3487
- },
3488
3101
  {
3489
3102
  "kind": "variable",
3490
3103
  "name": "ANIMATION_DEFS",
@@ -3514,14 +3127,6 @@
3514
3127
  "package": "@genesislcap/foundation-ai"
3515
3128
  }
3516
3129
  },
3517
- {
3518
- "kind": "js",
3519
- "name": "AiAssistantEvent",
3520
- "declaration": {
3521
- "name": "AiAssistantEvent",
3522
- "module": "src/main/main.types.ts"
3523
- }
3524
- },
3525
3130
  {
3526
3131
  "kind": "js",
3527
3132
  "name": "ANIMATION_DEFS",
@@ -3594,22 +3199,13 @@
3594
3199
  "kind": "javascript-module",
3595
3200
  "path": "src/state/ai-assistant-slice.ts",
3596
3201
  "declarations": [
3597
- {
3598
- "kind": "function",
3599
- "name": "createDefaultSessionState",
3600
- "return": {
3601
- "type": {
3602
- "text": "AiAssistantSessionState"
3603
- }
3604
- },
3605
- "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."
3606
- },
3607
3202
  {
3608
3203
  "kind": "variable",
3609
3204
  "name": "defaultSessionState",
3610
3205
  "type": {
3611
3206
  "text": "AiAssistantSessionState"
3612
- }
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}"
3613
3209
  },
3614
3210
  {
3615
3211
  "kind": "variable",
@@ -3617,14 +3213,6 @@
3617
3213
  }
3618
3214
  ],
3619
3215
  "exports": [
3620
- {
3621
- "kind": "js",
3622
- "name": "createDefaultSessionState",
3623
- "declaration": {
3624
- "name": "createDefaultSessionState",
3625
- "module": "src/state/ai-assistant-slice.ts"
3626
- }
3627
- },
3628
3216
  {
3629
3217
  "kind": "js",
3630
3218
  "name": "defaultSessionState",
@@ -3653,7 +3241,7 @@
3653
3241
  "type": {
3654
3242
  "text": "Record<MetaEventType, MetaEventImportance>"
3655
3243
  },
3656
- "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 'session.switched': '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}",
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}",
3657
3245
  "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."
3658
3246
  },
3659
3247
  {
@@ -4849,106 +4437,16 @@
4849
4437
  }
4850
4438
  ],
4851
4439
  "description": "Applies a history cap for sub-agent context: the last `cap` messages are passed\nverbatim; older messages have their tool payloads masked."
4852
- },
4853
- {
4854
- "kind": "variable",
4855
- "name": "COMPACT_KEEP_RECENT_MESSAGES",
4856
- "type": {
4857
- "text": "number"
4858
- },
4859
- "default": "4",
4860
- "description": "Recent messages kept verbatim when compacting; everything earlier is summarized."
4861
- },
4440
+ }
4441
+ ],
4442
+ "exports": [
4862
4443
  {
4863
- "kind": "variable",
4864
- "name": "COMPACT_MIN_MESSAGES_TO_COMPACT",
4865
- "type": {
4866
- "text": "number"
4867
- },
4868
- "default": "4",
4869
- "description": "Don't bother compacting unless at least this many messages would be summarized."
4870
- },
4871
- {
4872
- "kind": "function",
4873
- "name": "findCompactionCut",
4874
- "return": {
4875
- "type": {
4876
- "text": "number | null"
4877
- }
4878
- },
4879
- "parameters": [
4880
- {
4881
- "name": "history",
4882
- "type": {
4883
- "text": "readonly ChatMessage[]"
4884
- }
4885
- }
4886
- ],
4887
- "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."
4888
- },
4889
- {
4890
- "kind": "function",
4891
- "name": "buildCompactionSummaryPrompt",
4892
- "return": {
4893
- "type": {
4894
- "text": "{\n systemPrompt: string;\n userMessage: string;\n}"
4895
- }
4896
- },
4897
- "parameters": [
4898
- {
4899
- "name": "toCompact",
4900
- "type": {
4901
- "text": "readonly ChatMessage[]"
4902
- }
4903
- }
4904
- ],
4905
- "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."
4906
- },
4907
- {
4908
- "kind": "function",
4909
- "name": "normalizeForProvider",
4910
- "return": {
4911
- "type": {
4912
- "text": "ChatMessage[]"
4913
- }
4914
- },
4915
- "parameters": [
4916
- {
4917
- "name": "history",
4918
- "type": {
4919
- "text": "readonly ChatMessage[]"
4920
- }
4921
- }
4922
- ],
4923
- "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."
4924
- },
4925
- {
4926
- "kind": "function",
4927
- "name": "compactionDividerLabel",
4928
- "return": {
4929
- "type": {
4930
- "text": "string"
4931
- }
4932
- },
4933
- "parameters": [
4934
- {
4935
- "name": "m",
4936
- "type": {
4937
- "text": "ChatMessage"
4938
- }
4939
- }
4940
- ],
4941
- "description": "Human-facing divider label for a `compacted-summary` message."
4942
- }
4943
- ],
4944
- "exports": [
4945
- {
4946
- "kind": "js",
4947
- "name": "transformHistoryForAgent",
4948
- "declaration": {
4949
- "name": "transformHistoryForAgent",
4950
- "module": "src/utils/history-transform.ts"
4951
- }
4444
+ "kind": "js",
4445
+ "name": "transformHistoryForAgent",
4446
+ "declaration": {
4447
+ "name": "transformHistoryForAgent",
4448
+ "module": "src/utils/history-transform.ts"
4449
+ }
4952
4450
  },
4953
4451
  {
4954
4452
  "kind": "js",
@@ -4957,54 +4455,6 @@
4957
4455
  "name": "applyHistoryCap",
4958
4456
  "module": "src/utils/history-transform.ts"
4959
4457
  }
4960
- },
4961
- {
4962
- "kind": "js",
4963
- "name": "COMPACT_KEEP_RECENT_MESSAGES",
4964
- "declaration": {
4965
- "name": "COMPACT_KEEP_RECENT_MESSAGES",
4966
- "module": "src/utils/history-transform.ts"
4967
- }
4968
- },
4969
- {
4970
- "kind": "js",
4971
- "name": "COMPACT_MIN_MESSAGES_TO_COMPACT",
4972
- "declaration": {
4973
- "name": "COMPACT_MIN_MESSAGES_TO_COMPACT",
4974
- "module": "src/utils/history-transform.ts"
4975
- }
4976
- },
4977
- {
4978
- "kind": "js",
4979
- "name": "findCompactionCut",
4980
- "declaration": {
4981
- "name": "findCompactionCut",
4982
- "module": "src/utils/history-transform.ts"
4983
- }
4984
- },
4985
- {
4986
- "kind": "js",
4987
- "name": "buildCompactionSummaryPrompt",
4988
- "declaration": {
4989
- "name": "buildCompactionSummaryPrompt",
4990
- "module": "src/utils/history-transform.ts"
4991
- }
4992
- },
4993
- {
4994
- "kind": "js",
4995
- "name": "normalizeForProvider",
4996
- "declaration": {
4997
- "name": "normalizeForProvider",
4998
- "module": "src/utils/history-transform.ts"
4999
- }
5000
- },
5001
- {
5002
- "kind": "js",
5003
- "name": "compactionDividerLabel",
5004
- "declaration": {
5005
- "name": "compactionDividerLabel",
5006
- "module": "src/utils/history-transform.ts"
5007
- }
5008
4458
  }
5009
4459
  ]
5010
4460
  },
@@ -5063,24 +4513,6 @@
5063
4513
  "kind": "javascript-module",
5064
4514
  "path": "src/utils/message-partition.ts",
5065
4515
  "declarations": [
5066
- {
5067
- "kind": "function",
5068
- "name": "isSessionNoticeMarker",
5069
- "return": {
5070
- "type": {
5071
- "text": "boolean"
5072
- }
5073
- },
5074
- "parameters": [
5075
- {
5076
- "name": "m",
5077
- "type": {
5078
- "text": "ChatMessage"
5079
- }
5080
- }
5081
- ],
5082
- "description": "Either restore notice — both display-only, stripped before persist. @internal"
5083
- },
5084
4516
  {
5085
4517
  "kind": "function",
5086
4518
  "name": "trailingInteractionRow",
@@ -5125,14 +4557,6 @@
5125
4557
  }
5126
4558
  ],
5127
4559
  "exports": [
5128
- {
5129
- "kind": "js",
5130
- "name": "isSessionNoticeMarker",
5131
- "declaration": {
5132
- "name": "isSessionNoticeMarker",
5133
- "module": "src/utils/message-partition.ts"
5134
- }
5135
- },
5136
4560
  {
5137
4561
  "kind": "js",
5138
4562
  "name": "trailingInteractionRow",
@@ -5185,12 +4609,6 @@
5185
4609
  }
5186
4610
  ]
5187
4611
  },
5188
- {
5189
- "kind": "javascript-module",
5190
- "path": "src/utils/resolve-preference-baseline.ts",
5191
- "declarations": [],
5192
- "exports": []
5193
- },
5194
4612
  {
5195
4613
  "kind": "javascript-module",
5196
4614
  "path": "src/utils/strip-agent-handlers.ts",
@@ -5303,12 +4721,6 @@
5303
4721
  }
5304
4722
  ]
5305
4723
  },
5306
- {
5307
- "kind": "javascript-module",
5308
- "path": "src/utils/with-timeout.ts",
5309
- "declarations": [],
5310
- "exports": []
5311
- },
5312
4724
  {
5313
4725
  "kind": "javascript-module",
5314
4726
  "path": "src/components/activity-halo/activity-halo.ts",
@@ -6242,6 +5654,29 @@
6242
5654
  "privacy": "private",
6243
5655
  "default": "new Map<\n string,\n {\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n /** Present when the call requested a chat-input override. */\n overrideId?: string;\n /** Present when the call set `timeoutMs`; cleared on resolution. */\n timeoutHandle?: ReturnType<typeof setTimeout>;\n }\n >()"
6244
5656
  },
5657
+ {
5658
+ "kind": "field",
5659
+ "name": "hosts",
5660
+ "privacy": "private",
5661
+ "default": "new Set<string>()",
5662
+ "description": "Assistant host ids currently wired to this driver, in registration (insertion) order."
5663
+ },
5664
+ {
5665
+ "kind": "field",
5666
+ "name": "lastActiveHostId",
5667
+ "type": {
5668
+ "text": "string | undefined"
5669
+ },
5670
+ "privacy": "private",
5671
+ "description": "The host whose subtree the user most recently interacted in — the primary owner signal."
5672
+ },
5673
+ {
5674
+ "kind": "field",
5675
+ "name": "startedSideEffects",
5676
+ "privacy": "private",
5677
+ "default": "new Map<string, string>()",
5678
+ "description": "Interaction id → host id that claimed its side effect (first-writer-wins latch)."
5679
+ },
6245
5680
  {
6246
5681
  "kind": "field",
6247
5682
  "name": "systemPrompt",
@@ -7101,32 +6536,101 @@
7101
6536
  },
7102
6537
  {
7103
6538
  "kind": "method",
7104
- "name": "canCompact",
6539
+ "name": "isBusy",
7105
6540
  "return": {
7106
6541
  "type": {
7107
6542
  "text": "boolean"
7108
6543
  }
6544
+ }
6545
+ },
6546
+ {
6547
+ "kind": "method",
6548
+ "name": "registerHost",
6549
+ "return": {
6550
+ "type": {
6551
+ "text": "void"
6552
+ }
6553
+ },
6554
+ "parameters": [
6555
+ {
6556
+ "name": "hostId",
6557
+ "type": {
6558
+ "text": "string"
6559
+ }
6560
+ }
6561
+ ],
6562
+ "description": "Register an assistant view (host) wired to this shared driver. @internal"
6563
+ },
6564
+ {
6565
+ "kind": "method",
6566
+ "name": "unregisterHost",
6567
+ "return": {
6568
+ "type": {
6569
+ "text": "void"
6570
+ }
7109
6571
  },
7110
- "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)."
6572
+ "parameters": [
6573
+ {
6574
+ "name": "hostId",
6575
+ "type": {
6576
+ "text": "string"
6577
+ }
6578
+ }
6579
+ ],
6580
+ "description": "Deregister a host on unwire/disconnect. @internal"
7111
6581
  },
7112
6582
  {
7113
6583
  "kind": "method",
7114
- "name": "compact",
6584
+ "name": "setActiveHost",
7115
6585
  "return": {
7116
6586
  "type": {
7117
- "text": "Promise<ChatMessage | null>"
6587
+ "text": "void"
7118
6588
  }
7119
6589
  },
7120
- "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."
6590
+ "parameters": [
6591
+ {
6592
+ "name": "hostId",
6593
+ "type": {
6594
+ "text": "string"
6595
+ }
6596
+ }
6597
+ ],
6598
+ "description": "Record the host whose subtree the user most recently interacted in — the primary signal for\nelecting which single view renders an interaction's widget. Sticky (unlike focus): it only\nmoves when the user actually uses a different assistant view, not when they click elsewhere\nin the layout. @internal"
7121
6599
  },
7122
6600
  {
7123
6601
  "kind": "method",
7124
- "name": "isBusy",
6602
+ "name": "claimSideEffect",
7125
6603
  "return": {
7126
6604
  "type": {
7127
6605
  "text": "boolean"
7128
6606
  }
7129
- }
6607
+ },
6608
+ "parameters": [
6609
+ {
6610
+ "name": "interactionId",
6611
+ "type": {
6612
+ "text": "string"
6613
+ }
6614
+ },
6615
+ {
6616
+ "name": "hostId",
6617
+ "type": {
6618
+ "text": "string"
6619
+ }
6620
+ }
6621
+ ],
6622
+ "description": "First-writer-wins latch guarding a side effect. A host claims before rendering the live\nwidget: the first host to claim an interaction id gets `true` (run it); a *different* host\ngets `false` (render passive, do NOT re-fire). Re-claim by the SAME host returns `true`, so a\nbenign re-render of the owner keeps its widget. Single-threaded, so check-and-set is race-free\n— the backstop that makes duplicate execution impossible even if owner election ever slips. @internal"
6623
+ },
6624
+ {
6625
+ "kind": "method",
6626
+ "name": "electInteractionOwner",
6627
+ "privacy": "private",
6628
+ "return": {
6629
+ "type": {
6630
+ "text": "string | undefined"
6631
+ }
6632
+ },
6633
+ "description": "Elect the single host that owns (renders + runs) an interaction's widget: the most-recently-\nactive host if still connected, else a deterministic default (first registered host — `Set`\npreserves insertion order) so exactly one owner is always chosen. Returns `undefined` only when\nno host is registered, in which case the interaction renders everywhere (fail-open) not nowhere."
7130
6634
  },
7131
6635
  {
7132
6636
  "kind": "method",
@@ -7701,6 +7205,15 @@
7701
7205
  "default": "undefined",
7702
7206
  "description": "The resolved result once the interaction has completed. Forwarded to the rendered component. @internal"
7703
7207
  },
7208
+ {
7209
+ "kind": "field",
7210
+ "name": "ownerHostId",
7211
+ "type": {
7212
+ "text": "string"
7213
+ },
7214
+ "default": "''",
7215
+ "description": "GENC-1410 (Error 3): id of the host the driver elected to render (and thus run) this\ninteraction. When several views share one driver, only the matching host renders the live\nwidget; others show a passive placeholder so the widget fires once. Empty = no owner elected\n(single view, or none registered) → render everywhere (fail-open). @internal"
7216
+ },
7704
7217
  {
7705
7218
  "kind": "field",
7706
7219
  "name": "_resizeObserver",
@@ -8000,16 +7513,6 @@
8000
7513
  "default": "null",
8001
7514
  "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."
8002
7515
  },
8003
- {
8004
- "kind": "field",
8005
- "name": "restoredAgentStates",
8006
- "type": {
8007
- "text": "Record<string, unknown>"
8008
- },
8009
- "privacy": "private",
8010
- "default": "{}",
8011
- "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."
8012
- },
8013
7516
  {
8014
7517
  "kind": "field",
8015
7518
  "name": "activeAgent",
@@ -8051,17 +7554,24 @@
8051
7554
  },
8052
7555
  {
8053
7556
  "kind": "method",
8054
- "name": "getActiveProviderName",
7557
+ "name": "registerHost",
8055
7558
  "return": {
8056
7559
  "type": {
8057
- "text": "string"
7560
+ "text": "void"
8058
7561
  }
8059
7562
  },
8060
- "description": "Currently active provider name from the underlying ChatDriver."
7563
+ "parameters": [
7564
+ {
7565
+ "name": "hostId",
7566
+ "type": {
7567
+ "text": "string"
7568
+ }
7569
+ }
7570
+ ]
8061
7571
  },
8062
7572
  {
8063
7573
  "kind": "method",
8064
- "name": "setPinnedAgent",
7574
+ "name": "unregisterHost",
8065
7575
  "return": {
8066
7576
  "type": {
8067
7577
  "text": "void"
@@ -8069,17 +7579,16 @@
8069
7579
  },
8070
7580
  "parameters": [
8071
7581
  {
8072
- "name": "name",
7582
+ "name": "hostId",
8073
7583
  "type": {
8074
- "text": "string | null"
7584
+ "text": "string"
8075
7585
  }
8076
7586
  }
8077
- ],
8078
- "description": "Pins routing to a specific agent by name. While pinned, the classifier is\nskipped and the continuation tool is hidden from the agent's tool list, so\nthe agent cannot quietly hand back to the orchestrator. Pass `null` to\nreturn to automatic routing."
7587
+ ]
8079
7588
  },
8080
7589
  {
8081
7590
  "kind": "method",
8082
- "name": "setFlowOwner",
7591
+ "name": "setActiveHost",
8083
7592
  "return": {
8084
7593
  "type": {
8085
7594
  "text": "void"
@@ -8087,59 +7596,107 @@
8087
7596
  },
8088
7597
  "parameters": [
8089
7598
  {
8090
- "name": "name",
7599
+ "name": "hostId",
8091
7600
  "type": {
8092
- "text": "string | null"
7601
+ "text": "string"
8093
7602
  }
8094
7603
  }
8095
- ],
8096
- "description": "Set the flow-owner lock — used to restore state from Redux on driver\nreconstruction (agents-array changes, pop-in/pop-out). Not intended for\nexternal callers to manipulate routing; that's what `setPinnedAgent` is\nfor."
7604
+ ]
8097
7605
  },
8098
7606
  {
8099
7607
  "kind": "method",
8100
- "name": "loadHistory",
7608
+ "name": "claimSideEffect",
8101
7609
  "return": {
8102
7610
  "type": {
8103
- "text": "void"
7611
+ "text": "boolean"
8104
7612
  }
8105
7613
  },
8106
7614
  "parameters": [
8107
7615
  {
8108
- "name": "messages",
7616
+ "name": "interactionId",
8109
7617
  "type": {
8110
- "text": "ChatMessage[]"
7618
+ "text": "string"
7619
+ }
7620
+ },
7621
+ {
7622
+ "name": "hostId",
7623
+ "type": {
7624
+ "text": "string"
8111
7625
  }
8112
7626
  }
8113
7627
  ]
8114
7628
  },
8115
7629
  {
8116
7630
  "kind": "method",
8117
- "name": "getRawHistory",
7631
+ "name": "getActiveProviderName",
8118
7632
  "return": {
8119
7633
  "type": {
8120
- "text": "readonly ChatMessage[]"
7634
+ "text": "string"
8121
7635
  }
8122
- }
7636
+ },
7637
+ "description": "Currently active provider name from the underlying ChatDriver."
8123
7638
  },
8124
7639
  {
8125
7640
  "kind": "method",
8126
- "name": "compact",
7641
+ "name": "setPinnedAgent",
8127
7642
  "return": {
8128
7643
  "type": {
8129
- "text": "Promise<ChatMessage | null>"
7644
+ "text": "void"
8130
7645
  }
8131
7646
  },
8132
- "description": "{@inheritDoc AiDriver.compact}"
7647
+ "parameters": [
7648
+ {
7649
+ "name": "name",
7650
+ "type": {
7651
+ "text": "string | null"
7652
+ }
7653
+ }
7654
+ ],
7655
+ "description": "Pins routing to a specific agent by name. While pinned, the classifier is\nskipped and the continuation tool is hidden from the agent's tool list, so\nthe agent cannot quietly hand back to the orchestrator. Pass `null` to\nreturn to automatic routing."
8133
7656
  },
8134
7657
  {
8135
7658
  "kind": "method",
8136
- "name": "canCompact",
7659
+ "name": "setFlowOwner",
8137
7660
  "return": {
8138
7661
  "type": {
8139
- "text": "boolean"
7662
+ "text": "void"
7663
+ }
7664
+ },
7665
+ "parameters": [
7666
+ {
7667
+ "name": "name",
7668
+ "type": {
7669
+ "text": "string | null"
7670
+ }
7671
+ }
7672
+ ],
7673
+ "description": "Set the flow-owner lock — used to restore state from Redux on driver\nreconstruction (agents-array changes, pop-in/pop-out). Not intended for\nexternal callers to manipulate routing; that's what `setPinnedAgent` is\nfor."
7674
+ },
7675
+ {
7676
+ "kind": "method",
7677
+ "name": "loadHistory",
7678
+ "return": {
7679
+ "type": {
7680
+ "text": "void"
8140
7681
  }
8141
7682
  },
8142
- "description": "{@inheritDoc AiDriver.canCompact}"
7683
+ "parameters": [
7684
+ {
7685
+ "name": "messages",
7686
+ "type": {
7687
+ "text": "ChatMessage[]"
7688
+ }
7689
+ }
7690
+ ]
7691
+ },
7692
+ {
7693
+ "kind": "method",
7694
+ "name": "getRawHistory",
7695
+ "return": {
7696
+ "type": {
7697
+ "text": "readonly ChatMessage[]"
7698
+ }
7699
+ }
8143
7700
  },
8144
7701
  {
8145
7702
  "kind": "method",
@@ -8229,34 +7786,6 @@
8229
7786
  }
8230
7787
  ]
8231
7788
  },
8232
- {
8233
- "kind": "method",
8234
- "name": "primeRestoredAgentState",
8235
- "return": {
8236
- "type": {
8237
- "text": "void"
8238
- }
8239
- },
8240
- "parameters": [
8241
- {
8242
- "name": "snapshots",
8243
- "type": {
8244
- "text": "Record<string, unknown>"
8245
- }
8246
- }
8247
- ],
8248
- "description": "{@inheritDoc AiDriver.primeRestoredAgentState}"
8249
- },
8250
- {
8251
- "kind": "method",
8252
- "name": "getActiveAgent",
8253
- "return": {
8254
- "type": {
8255
- "text": "AgentConfig | undefined"
8256
- }
8257
- },
8258
- "description": "{@inheritDoc AiDriver.getActiveAgent}"
8259
- },
8260
7789
  {
8261
7790
  "kind": "method",
8262
7791
  "name": "applyAgent",
@@ -8457,13 +7986,12 @@
8457
7986
  },
8458
7987
  {
8459
7988
  "kind": "field",
8460
- "name": "assistantEl",
7989
+ "name": "collapseEl",
8461
7990
  "type": {
8462
7991
  "text": "HTMLElement | null"
8463
7992
  },
8464
7993
  "privacy": "private",
8465
- "default": "null",
8466
- "description": "The single assistant element. Captured while it's in the bubble slot and held\nacross the move (it's the same instance whether docked or in the bubble), so\npop-in can re-home it even though it's no longer a child of this manager."
7994
+ "default": "null"
8467
7995
  },
8468
7996
  {
8469
7997
  "kind": "field",
@@ -8491,52 +8019,6 @@
8491
8019
  },
8492
8020
  "privacy": "private"
8493
8021
  },
8494
- {
8495
- "kind": "method",
8496
- "name": "findAssistant",
8497
- "privacy": "private",
8498
- "return": {
8499
- "type": {
8500
- "text": "HTMLElement | null"
8501
- }
8502
- },
8503
- "description": "Locate the assistant element currently slotted into the bubble."
8504
- },
8505
- {
8506
- "kind": "method",
8507
- "name": "adoptAssistant",
8508
- "return": {
8509
- "type": {
8510
- "text": "void"
8511
- }
8512
- },
8513
- "parameters": [
8514
- {
8515
- "name": "el",
8516
- "type": {
8517
- "text": "HTMLElement"
8518
- }
8519
- },
8520
- {
8521
- "name": "docked",
8522
- "type": {
8523
- "text": "boolean"
8524
- }
8525
- }
8526
- ],
8527
- "description": "Register an externally-created assistant element and its docked state. For\nsingle-element hosts that create the assistant directly in a layout pane (rather\nthan statically in the bubble), so the manager tracks the one element, whether it's\ncurrently docked (for pop-in re-homing), reflects the right `popout-mode` on it\n(drives the header button), and hides the empty bubble."
8528
- },
8529
- {
8530
- "kind": "method",
8531
- "name": "syncBubbleVisibility",
8532
- "privacy": "private",
8533
- "return": {
8534
- "type": {
8535
- "text": "void"
8536
- }
8537
- },
8538
- "description": "Hide the floating bubble unless it currently contains the assistant."
8539
- },
8540
8022
  {
8541
8023
  "kind": "method",
8542
8024
  "name": "canDockChanged"
@@ -8593,7 +8075,7 @@
8593
8075
  "text": "boolean"
8594
8076
  }
8595
8077
  },
8596
- "description": "True when the assistant is active in the layout panel (docked) rather than the bubble."
8078
+ "description": "True when the collapse-mode assistant is active in the layout panel."
8597
8079
  },
8598
8080
  {
8599
8081
  "kind": "function",
@@ -8687,7 +8169,7 @@
8687
8169
  {
8688
8170
  "kind": "variable",
8689
8171
  "name": "settingsModalStyles",
8690
- "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`",
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`",
8691
8173
  "description": "Styles for the assistant settings modal (tabs, sections, toggles, cost summary)."
8692
8174
  }
8693
8175
  ],
@@ -8735,518 +8217,6 @@
8735
8217
  }
8736
8218
  }
8737
8219
  ]
8738
- },
8739
- {
8740
- "kind": "javascript-module",
8741
- "path": "src/state/persistence/diagnostics-cursors.ts",
8742
- "declarations": [
8743
- {
8744
- "kind": "function",
8745
- "name": "getDiagnosticsCursors",
8746
- "return": {
8747
- "type": {
8748
- "text": "DiagnosticsCursors"
8749
- }
8750
- },
8751
- "parameters": [
8752
- {
8753
- "name": "key",
8754
- "type": {
8755
- "text": "string"
8756
- }
8757
- }
8758
- ],
8759
- "description": "The shared cursors for `key`, created (empty) on first access. @internal"
8760
- },
8761
- {
8762
- "kind": "function",
8763
- "name": "clearDiagnosticsCursorRegistry",
8764
- "return": {
8765
- "type": {
8766
- "text": "void"
8767
- }
8768
- },
8769
- "description": "Drop all cursors — test isolation only. @internal"
8770
- }
8771
- ],
8772
- "exports": [
8773
- {
8774
- "kind": "js",
8775
- "name": "getDiagnosticsCursors",
8776
- "declaration": {
8777
- "name": "getDiagnosticsCursors",
8778
- "module": "src/state/persistence/diagnostics-cursors.ts"
8779
- }
8780
- },
8781
- {
8782
- "kind": "js",
8783
- "name": "clearDiagnosticsCursorRegistry",
8784
- "declaration": {
8785
- "name": "clearDiagnosticsCursorRegistry",
8786
- "module": "src/state/persistence/diagnostics-cursors.ts"
8787
- }
8788
- }
8789
- ]
8790
- },
8791
- {
8792
- "kind": "javascript-module",
8793
- "path": "src/state/persistence/diagnostics.ts",
8794
- "declarations": [
8795
- {
8796
- "kind": "function",
8797
- "name": "assembleDebugLog",
8798
- "return": {
8799
- "type": {
8800
- "text": "DebugLog"
8801
- }
8802
- },
8803
- "parameters": [
8804
- {
8805
- "name": "entries",
8806
- "type": {
8807
- "text": "DiagnosticEntry[]"
8808
- }
8809
- },
8810
- {
8811
- "name": "readme",
8812
- "type": {
8813
- "text": "readonly string[]"
8814
- }
8815
- }
8816
- ],
8817
- "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."
8818
- }
8819
- ],
8820
- "exports": [
8821
- {
8822
- "kind": "js",
8823
- "name": "assembleDebugLog",
8824
- "declaration": {
8825
- "name": "assembleDebugLog",
8826
- "module": "src/state/persistence/diagnostics.ts"
8827
- }
8828
- }
8829
- ]
8830
- },
8831
- {
8832
- "kind": "javascript-module",
8833
- "path": "src/state/persistence/index.ts",
8834
- "declarations": [],
8835
- "exports": [
8836
- {
8837
- "kind": "js",
8838
- "name": "PERSISTED_SESSION_VERSION",
8839
- "declaration": {
8840
- "name": "PERSISTED_SESSION_VERSION",
8841
- "module": "./session-snapshot"
8842
- }
8843
- },
8844
- {
8845
- "kind": "js",
8846
- "name": "PersistedSession",
8847
- "declaration": {
8848
- "name": "PersistedSession",
8849
- "module": "./session-snapshot"
8850
- }
8851
- },
8852
- {
8853
- "kind": "js",
8854
- "name": "WebStorageSessionProvider",
8855
- "declaration": {
8856
- "name": "WebStorageSessionProvider",
8857
- "module": "./session-persistence-provider"
8858
- }
8859
- },
8860
- {
8861
- "kind": "js",
8862
- "name": "SessionPersistenceProvider",
8863
- "declaration": {
8864
- "name": "SessionPersistenceProvider",
8865
- "module": "./session-persistence-provider"
8866
- }
8867
- },
8868
- {
8869
- "kind": "js",
8870
- "name": "SessionPersistenceConfig",
8871
- "declaration": {
8872
- "name": "SessionPersistenceConfig",
8873
- "module": "./session-persistence-provider"
8874
- }
8875
- },
8876
- {
8877
- "kind": "js",
8878
- "name": "SessionPreferences",
8879
- "declaration": {
8880
- "name": "SessionPreferences",
8881
- "module": "./session-persistence-provider"
8882
- }
8883
- },
8884
- {
8885
- "kind": "js",
8886
- "name": "assembleDebugLog",
8887
- "declaration": {
8888
- "name": "assembleDebugLog",
8889
- "module": "./diagnostics"
8890
- }
8891
- },
8892
- {
8893
- "kind": "js",
8894
- "name": "DiagnosticEntry",
8895
- "declaration": {
8896
- "name": "DiagnosticEntry",
8897
- "module": "./diagnostics"
8898
- }
8899
- },
8900
- {
8901
- "kind": "js",
8902
- "name": "DebugLog",
8903
- "declaration": {
8904
- "name": "DebugLog",
8905
- "module": "./diagnostics"
8906
- }
8907
- }
8908
- ]
8909
- },
8910
- {
8911
- "kind": "javascript-module",
8912
- "path": "src/state/persistence/persister-registry.ts",
8913
- "declarations": [
8914
- {
8915
- "kind": "function",
8916
- "name": "getOrCreatePersister",
8917
- "return": {
8918
- "type": {
8919
- "text": "SessionPersister"
8920
- }
8921
- },
8922
- "parameters": [
8923
- {
8924
- "name": "key",
8925
- "type": {
8926
- "text": "string"
8927
- }
8928
- },
8929
- {
8930
- "name": "factory",
8931
- "type": {
8932
- "text": "() => SessionPersister"
8933
- }
8934
- }
8935
- ],
8936
- "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."
8937
- },
8938
- {
8939
- "kind": "function",
8940
- "name": "getPersister",
8941
- "return": {
8942
- "type": {
8943
- "text": "SessionPersister | undefined"
8944
- }
8945
- },
8946
- "parameters": [
8947
- {
8948
- "name": "key",
8949
- "type": {
8950
- "text": "string"
8951
- }
8952
- }
8953
- ],
8954
- "description": "Returns the existing persister for `key`, or `undefined`."
8955
- },
8956
- {
8957
- "kind": "function",
8958
- "name": "deletePersister",
8959
- "return": {
8960
- "type": {
8961
- "text": "void"
8962
- }
8963
- },
8964
- "parameters": [
8965
- {
8966
- "name": "key",
8967
- "type": {
8968
- "text": "string"
8969
- }
8970
- }
8971
- ],
8972
- "description": "Removes the persister for `key` (explicit session teardown)."
8973
- }
8974
- ],
8975
- "exports": [
8976
- {
8977
- "kind": "js",
8978
- "name": "getOrCreatePersister",
8979
- "declaration": {
8980
- "name": "getOrCreatePersister",
8981
- "module": "src/state/persistence/persister-registry.ts"
8982
- }
8983
- },
8984
- {
8985
- "kind": "js",
8986
- "name": "getPersister",
8987
- "declaration": {
8988
- "name": "getPersister",
8989
- "module": "src/state/persistence/persister-registry.ts"
8990
- }
8991
- },
8992
- {
8993
- "kind": "js",
8994
- "name": "deletePersister",
8995
- "declaration": {
8996
- "name": "deletePersister",
8997
- "module": "src/state/persistence/persister-registry.ts"
8998
- }
8999
- }
9000
- ]
9001
- },
9002
- {
9003
- "kind": "javascript-module",
9004
- "path": "src/state/persistence/session-persistence-provider.ts",
9005
- "declarations": [
9006
- {
9007
- "kind": "class",
9008
- "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.",
9009
- "name": "WebStorageSessionProvider",
9010
- "members": [
9011
- {
9012
- "kind": "field",
9013
- "name": "storage",
9014
- "type": {
9015
- "text": "Storage"
9016
- },
9017
- "privacy": "private",
9018
- "readonly": true,
9019
- "default": "storage"
9020
- },
9021
- {
9022
- "kind": "field",
9023
- "name": "keyPrefix",
9024
- "type": {
9025
- "text": "string"
9026
- },
9027
- "privacy": "private",
9028
- "readonly": true
9029
- },
9030
- {
9031
- "kind": "field",
9032
- "name": "saveDebounceMs",
9033
- "type": {
9034
- "text": "number"
9035
- },
9036
- "readonly": true,
9037
- "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)."
9038
- },
9039
- {
9040
- "kind": "method",
9041
- "name": "storageKey",
9042
- "privacy": "private",
9043
- "return": {
9044
- "type": {
9045
- "text": "string"
9046
- }
9047
- },
9048
- "parameters": [
9049
- {
9050
- "name": "sessionKey",
9051
- "type": {
9052
- "text": "string"
9053
- }
9054
- }
9055
- ]
9056
- },
9057
- {
9058
- "kind": "method",
9059
- "name": "preferencesKey",
9060
- "privacy": "private",
9061
- "return": {
9062
- "type": {
9063
- "text": "string"
9064
- }
9065
- },
9066
- "parameters": [
9067
- {
9068
- "name": "sessionKey",
9069
- "type": {
9070
- "text": "string"
9071
- }
9072
- }
9073
- ],
9074
- "description": "Preferences key, namespaced apart from the session key so `clear` leaves it."
9075
- },
9076
- {
9077
- "kind": "method",
9078
- "name": "load",
9079
- "return": {
9080
- "type": {
9081
- "text": "Promise<PersistedSession | null>"
9082
- }
9083
- },
9084
- "parameters": [
9085
- {
9086
- "name": "sessionKey",
9087
- "type": {
9088
- "text": "string"
9089
- }
9090
- }
9091
- ]
9092
- },
9093
- {
9094
- "kind": "method",
9095
- "name": "save",
9096
- "return": {
9097
- "type": {
9098
- "text": "Promise<void>"
9099
- }
9100
- },
9101
- "parameters": [
9102
- {
9103
- "name": "sessionKey",
9104
- "type": {
9105
- "text": "string"
9106
- }
9107
- },
9108
- {
9109
- "name": "snapshot",
9110
- "type": {
9111
- "text": "PersistedSession"
9112
- }
9113
- }
9114
- ]
9115
- },
9116
- {
9117
- "kind": "method",
9118
- "name": "clear",
9119
- "return": {
9120
- "type": {
9121
- "text": "Promise<void>"
9122
- }
9123
- },
9124
- "parameters": [
9125
- {
9126
- "name": "sessionKey",
9127
- "type": {
9128
- "text": "string"
9129
- }
9130
- }
9131
- ]
9132
- },
9133
- {
9134
- "kind": "method",
9135
- "name": "loadPreferences",
9136
- "return": {
9137
- "type": {
9138
- "text": "Promise<SessionPreferences | undefined>"
9139
- }
9140
- },
9141
- "parameters": [
9142
- {
9143
- "name": "sessionKey",
9144
- "type": {
9145
- "text": "string"
9146
- }
9147
- }
9148
- ]
9149
- },
9150
- {
9151
- "kind": "method",
9152
- "name": "savePreferences",
9153
- "return": {
9154
- "type": {
9155
- "text": "Promise<void>"
9156
- }
9157
- },
9158
- "parameters": [
9159
- {
9160
- "name": "sessionKey",
9161
- "type": {
9162
- "text": "string"
9163
- }
9164
- },
9165
- {
9166
- "name": "preferences",
9167
- "type": {
9168
- "text": "SessionPreferences"
9169
- }
9170
- }
9171
- ]
9172
- }
9173
- ]
9174
- }
9175
- ],
9176
- "exports": [
9177
- {
9178
- "kind": "js",
9179
- "name": "WebStorageSessionProvider",
9180
- "declaration": {
9181
- "name": "WebStorageSessionProvider",
9182
- "module": "src/state/persistence/session-persistence-provider.ts"
9183
- }
9184
- }
9185
- ]
9186
- },
9187
- {
9188
- "kind": "javascript-module",
9189
- "path": "src/state/persistence/session-persister.ts",
9190
- "declarations": [],
9191
- "exports": []
9192
- },
9193
- {
9194
- "kind": "javascript-module",
9195
- "path": "src/state/persistence/session-snapshot.ts",
9196
- "declarations": [
9197
- {
9198
- "kind": "variable",
9199
- "name": "PERSISTED_SESSION_VERSION",
9200
- "type": {
9201
- "text": "number"
9202
- },
9203
- "default": "1",
9204
- "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.",
9205
- "privacy": "public"
9206
- },
9207
- {
9208
- "kind": "function",
9209
- "name": "unknownAgentSnapshots",
9210
- "return": {
9211
- "type": {
9212
- "text": "string[]"
9213
- }
9214
- },
9215
- "parameters": [
9216
- {
9217
- "name": "snapshot",
9218
- "type": {
9219
- "text": "PersistedSession"
9220
- }
9221
- },
9222
- {
9223
- "name": "knownAgentNames",
9224
- "type": {
9225
- "text": "Iterable<string>"
9226
- }
9227
- }
9228
- ],
9229
- "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."
9230
- }
9231
- ],
9232
- "exports": [
9233
- {
9234
- "kind": "js",
9235
- "name": "PERSISTED_SESSION_VERSION",
9236
- "declaration": {
9237
- "name": "PERSISTED_SESSION_VERSION",
9238
- "module": "src/state/persistence/session-snapshot.ts"
9239
- }
9240
- },
9241
- {
9242
- "kind": "js",
9243
- "name": "unknownAgentSnapshots",
9244
- "declaration": {
9245
- "name": "unknownAgentSnapshots",
9246
- "module": "src/state/persistence/session-snapshot.ts"
9247
- }
9248
- }
9249
- ]
9250
8220
  }
9251
8221
  ]
9252
8222
  }