@genesislcap/ai-assistant 15.35.3 → 15.35.4-FUI-0.9

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 (43) hide show
  1. package/dist/ai-assistant.api.json +483 -0
  2. package/dist/ai-assistant.d.ts +213 -0
  3. package/dist/chat-driver.cjs +221 -4
  4. package/dist/chat-driver.cjs.map +2 -2
  5. package/dist/chat-driver.mjs +221 -4
  6. package/dist/chat-driver.mjs.map +2 -2
  7. package/dist/custom-elements.json +1189 -827
  8. package/dist/dts/components/ai-driver/ai-driver.d.ts +31 -0
  9. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  10. package/dist/dts/components/chat-bubble/chat-bubble.d.ts.map +1 -1
  11. package/dist/dts/components/chat-bubble/chat-bubble.template.d.ts.map +1 -1
  12. package/dist/dts/components/chat-driver/chat-driver.d.ts +93 -0
  13. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  14. package/dist/dts/components/chat-markdown/chat-markdown.d.ts +29 -0
  15. package/dist/dts/components/chat-markdown/chat-markdown.d.ts.map +1 -1
  16. package/dist/dts/components/halo-overlay.d.ts +30 -0
  17. package/dist/dts/components/halo-overlay.d.ts.map +1 -1
  18. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +17 -0
  19. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  20. package/dist/dts/main/main.template.d.ts.map +1 -1
  21. package/dist/dts/state/persistence/index.d.ts +1 -0
  22. package/dist/dts/state/persistence/index.d.ts.map +1 -1
  23. package/dist/dts/state/persistence/session-persister.d.ts +12 -0
  24. package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
  25. package/dist/dts/state/persistence/session-snapshot.d.ts +14 -0
  26. package/dist/dts/state/persistence/session-snapshot.d.ts.map +1 -1
  27. package/dist/dts/suggestions/chat-suggestions.d.ts +7 -0
  28. package/dist/dts/suggestions/chat-suggestions.d.ts.map +1 -1
  29. package/dist/dts/utils/condense-history.d.ts +114 -0
  30. package/dist/dts/utils/condense-history.d.ts.map +1 -1
  31. package/dist/esm/components/chat-bubble/chat-bubble.js +8 -0
  32. package/dist/esm/components/chat-bubble/chat-bubble.template.js +5 -3
  33. package/dist/esm/components/chat-driver/chat-driver.js +140 -17
  34. package/dist/esm/components/chat-markdown/chat-markdown.js +132 -1
  35. package/dist/esm/components/halo-overlay.js +96 -8
  36. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +17 -0
  37. package/dist/esm/main/main.template.js +95 -45
  38. package/dist/esm/state/persistence/session-persister.js +63 -15
  39. package/dist/esm/state/persistence/session-snapshot.js +2 -17
  40. package/dist/esm/suggestions/chat-suggestions.js +11 -3
  41. package/dist/esm/utils/condense-history.js +123 -0
  42. package/docs/styling.md +120 -0
  43. package/package.json +18 -18
@@ -1321,6 +1321,50 @@
1321
1321
  },
1322
1322
  "privacy": "private"
1323
1323
  },
1324
+ {
1325
+ "kind": "field",
1326
+ "name": "stopTimer",
1327
+ "type": {
1328
+ "text": "number | undefined"
1329
+ },
1330
+ "privacy": "private"
1331
+ },
1332
+ {
1333
+ "kind": "field",
1334
+ "name": "running",
1335
+ "type": {
1336
+ "text": "boolean"
1337
+ },
1338
+ "privacy": "private",
1339
+ "default": "false",
1340
+ "description": "Whether the loop should keep rescheduling itself — see AiHaloOverlay.tick."
1341
+ },
1342
+ {
1343
+ "kind": "method",
1344
+ "name": "activeChanged",
1345
+ "description": "Start/stop with `active`, so an idle overlay costs nothing.\n\nGuarded on `isConnected` because FAST invokes attribute-changed callbacks during\ninitialisation, before the element is in the document — `connectedCallback` is what decides\nfor an element that mounts already-active."
1346
+ },
1347
+ {
1348
+ "kind": "method",
1349
+ "name": "startAnimation",
1350
+ "privacy": "private"
1351
+ },
1352
+ {
1353
+ "kind": "method",
1354
+ "name": "scheduleStop",
1355
+ "privacy": "private",
1356
+ "description": "Keep spinning until the host has finished fading out.\n\nDeactivating only drops the host's opacity — the overlay is still on screen for the length of\nthe transition, so stopping the instant `active` flips would freeze the rotation mid-fade.\n\nTimed rather than driven by `transitionend`, which never fires if the host is hidden or an app\noverrides the transition away, and a stop that never arrives is exactly the idle-tick bug this\ngating exists to prevent.\n\nThe timer re-reads `active` rather than trusting that it was cancelled. FAST reflects the\nproperty to the attribute on a queued update, so `activeChanged` can run again, out of order,\nafter a rapid toggle — and a stale stop landing on a re-activated overlay would leave it\nfrozen for good, which is worse than the idle ticking this gate removes."
1357
+ },
1358
+ {
1359
+ "kind": "method",
1360
+ "name": "cancelPendingStop",
1361
+ "privacy": "private"
1362
+ },
1363
+ {
1364
+ "kind": "method",
1365
+ "name": "stopAnimation",
1366
+ "privacy": "private"
1367
+ },
1324
1368
  {
1325
1369
  "kind": "method",
1326
1370
  "name": "tick",
@@ -1590,211 +1634,6 @@
1590
1634
  }
1591
1635
  ]
1592
1636
  },
1593
- {
1594
- "kind": "javascript-module",
1595
- "path": "src/config/config.ts",
1596
- "declarations": [
1597
- {
1598
- "kind": "function",
1599
- "name": "defineAgent",
1600
- "description": "Identity helper that infers the narrowest possible type for an agent config,\npreserving string literal types (including `name`) without requiring `as const`.\n\nUse this when you need `typeof myAgent` to carry the literal `name` type —\nfor example, when wiring `ChatToolHandlers<typeof myAgent>`.\n\n```ts\nconst myAgent = defineAgent({ name: 'my_agent', ... });\ntype Handlers = ChatToolHandlers<typeof myAgent>;\n// requestSubAgent name param is now typed as 'my_agent'\n```"
1601
- }
1602
- ],
1603
- "exports": [
1604
- {
1605
- "kind": "js",
1606
- "name": "CachePolicy",
1607
- "declaration": {
1608
- "name": "CachePolicy",
1609
- "module": "src/config/config.ts"
1610
- }
1611
- },
1612
- {
1613
- "kind": "js",
1614
- "name": "ChatFallback",
1615
- "declaration": {
1616
- "name": "ChatFallback",
1617
- "module": "src/config/config.ts"
1618
- }
1619
- },
1620
- {
1621
- "kind": "js",
1622
- "name": "ChatInputDuringExecutionMode",
1623
- "declaration": {
1624
- "name": "ChatInputDuringExecutionMode",
1625
- "module": "src/config/config.ts"
1626
- }
1627
- },
1628
- {
1629
- "kind": "js",
1630
- "name": "ChatThinkingPolicy",
1631
- "declaration": {
1632
- "name": "ChatThinkingPolicy",
1633
- "module": "src/config/config.ts"
1634
- }
1635
- },
1636
- {
1637
- "kind": "js",
1638
- "name": "ChatToolChoice",
1639
- "declaration": {
1640
- "name": "ChatToolChoice",
1641
- "module": "src/config/config.ts"
1642
- }
1643
- },
1644
- {
1645
- "kind": "js",
1646
- "name": "defineAgent",
1647
- "declaration": {
1648
- "name": "defineAgent",
1649
- "module": "src/config/config.ts"
1650
- }
1651
- }
1652
- ]
1653
- },
1654
- {
1655
- "kind": "javascript-module",
1656
- "path": "src/config/define-stateful-agent.ts",
1657
- "declarations": [
1658
- {
1659
- "kind": "function",
1660
- "name": "restoreMachine",
1661
- "return": {
1662
- "type": {
1663
- "text": "void"
1664
- }
1665
- },
1666
- "parameters": [
1667
- {
1668
- "name": "machine",
1669
- "type": {
1670
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
1671
- },
1672
- "description": "the machine to restore (already constructed/started)."
1673
- },
1674
- {
1675
- "name": "restored",
1676
- "type": {
1677
- "text": "unknown"
1678
- },
1679
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
1680
- },
1681
- {
1682
- "name": "key",
1683
- "default": "'machine'",
1684
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
1685
- }
1686
- ],
1687
- "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."
1688
- },
1689
- {
1690
- "kind": "function",
1691
- "name": "defineStatefulAgent",
1692
- "return": {
1693
- "type": {
1694
- "text": "AgentConfig"
1695
- }
1696
- },
1697
- "parameters": [
1698
- {
1699
- "name": "opts",
1700
- "type": {
1701
- "text": "StatefulAgentInit<S>"
1702
- }
1703
- }
1704
- ],
1705
- "description": "Build an `AgentConfig` whose `systemPrompt`, `toolDefinitions`, and tool\nhandlers all close over a long-lived state object created on activation.\n\nThe framework wires the lifecycle: `init` on `onActivate`, `dispose` on\n`onDeactivate`. State is held inside the helper's closure — never exposed on\nthe resulting `AgentConfig` — so the redux serializer doesn't see it."
1706
- }
1707
- ],
1708
- "exports": [
1709
- {
1710
- "kind": "js",
1711
- "name": "restoreMachine",
1712
- "declaration": {
1713
- "name": "restoreMachine",
1714
- "module": "src/config/define-stateful-agent.ts"
1715
- }
1716
- },
1717
- {
1718
- "kind": "js",
1719
- "name": "defineStatefulAgent",
1720
- "declaration": {
1721
- "name": "defineStatefulAgent",
1722
- "module": "src/config/define-stateful-agent.ts"
1723
- }
1724
- }
1725
- ]
1726
- },
1727
- {
1728
- "kind": "javascript-module",
1729
- "path": "src/config/fallback-agents.ts",
1730
- "declarations": [
1731
- {
1732
- "kind": "variable",
1733
- "name": "friendlyFallbackAgent",
1734
- "type": {
1735
- "text": "FallbackAgentConfig"
1736
- },
1737
- "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a warm, friendly assistant. For general conversation like \"Hi\" or \"How are you\", you can have a friendly chat. For anything more complex, you cannot directly help, but you can explain what specialists are available. The available specialists are:\\n\\n{{agents}}\\n\\nPolitely let the user know what you can help with and invite them to rephrase their request if it is outside your scope.`,\n}",
1738
- "description": "A warm, conversational fallback agent. Acknowledges it can't help directly,\nexplains what the available specialists can do, and invites the user to retry.\n\nThe system prompt is generated at runtime by `OrchestratingDriver` from the\nspecialist list — no manual authoring required."
1739
- },
1740
- {
1741
- "kind": "variable",
1742
- "name": "strictFallbackAgent",
1743
- "type": {
1744
- "text": "FallbackAgentConfig"
1745
- },
1746
- "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a concise assistant. The user's request is outside your scope. The available specialists are: {{agents}}.\n\n{{unroutable}}\n\nAnswer in a single short sentence. Do not elaborate.`,\n}",
1747
- "description": "A brief, professional fallback agent. States what is available without\nelaboration. The `{{agents}}` placeholder is replaced at runtime by\n`OrchestratingDriver` with the generated specialist list.\n\nThe `{{unroutable}}` placeholder positions `UNROUTABLE_INSTRUCTION` — the framework's\ninstruction for a substantive request no specialist covers, which is otherwise APPENDED to a\nstring-form prompt. Positioned rather than appended for one reason: this preset's whole point is\nbrevity, and appended text would be the last thing the model reads. Putting the block above the\nbrevity rule leaves \"a single short sentence\" with the recency, so the two compose instead of\ncompeting. A prompt whose tone rules matter should do the same."
1748
- }
1749
- ],
1750
- "exports": [
1751
- {
1752
- "kind": "js",
1753
- "name": "friendlyFallbackAgent",
1754
- "declaration": {
1755
- "name": "friendlyFallbackAgent",
1756
- "module": "src/config/fallback-agents.ts"
1757
- }
1758
- },
1759
- {
1760
- "kind": "js",
1761
- "name": "strictFallbackAgent",
1762
- "declaration": {
1763
- "name": "strictFallbackAgent",
1764
- "module": "src/config/fallback-agents.ts"
1765
- }
1766
- }
1767
- ]
1768
- },
1769
- {
1770
- "kind": "javascript-module",
1771
- "path": "src/config/index.ts",
1772
- "declarations": [],
1773
- "exports": [
1774
- {
1775
- "kind": "js",
1776
- "name": "*",
1777
- "declaration": {
1778
- "name": "*",
1779
- "package": "./config"
1780
- }
1781
- },
1782
- {
1783
- "kind": "js",
1784
- "name": "*",
1785
- "declaration": {
1786
- "name": "*",
1787
- "package": "./fallback-agents"
1788
- }
1789
- }
1790
- ]
1791
- },
1792
- {
1793
- "kind": "javascript-module",
1794
- "path": "src/config/validate-providers.ts",
1795
- "declarations": [],
1796
- "exports": []
1797
- },
1798
1637
  {
1799
1638
  "kind": "javascript-module",
1800
1639
  "path": "src/genesis/config.ts",
@@ -2246,268 +2085,209 @@
2246
2085
  },
2247
2086
  {
2248
2087
  "kind": "javascript-module",
2249
- "path": "src/provider/ai-provider-switcher.ts",
2088
+ "path": "src/config/config.ts",
2250
2089
  "declarations": [
2251
2090
  {
2252
- "kind": "variable",
2253
- "name": "AIProviderSwitcher",
2254
- "description": "The DI token for the (AIProviderSwitcher:interface). Resolves a noop until the app\nregisters one."
2091
+ "kind": "function",
2092
+ "name": "defineAgent",
2093
+ "description": "Identity helper that infers the narrowest possible type for an agent config,\npreserving string literal types (including `name`) without requiring `as const`.\n\nUse this when you need `typeof myAgent` to carry the literal `name` type —\nfor example, when wiring `ChatToolHandlers<typeof myAgent>`.\n\n```ts\nconst myAgent = defineAgent({ name: 'my_agent', ... });\ntype Handlers = ChatToolHandlers<typeof myAgent>;\n// requestSubAgent name param is now typed as 'my_agent'\n```"
2255
2094
  }
2256
2095
  ],
2257
2096
  "exports": [
2258
2097
  {
2259
2098
  "kind": "js",
2260
- "name": "AIProviderSwitcher",
2099
+ "name": "CachePolicy",
2261
2100
  "declaration": {
2262
- "name": "AIProviderSwitcher",
2263
- "module": "src/provider/ai-provider-switcher.ts"
2101
+ "name": "CachePolicy",
2102
+ "module": "src/config/config.ts"
2264
2103
  }
2265
- }
2266
- ]
2267
- },
2268
- {
2269
- "kind": "javascript-module",
2270
- "path": "src/provider/assistant-app-settings.ts",
2271
- "declarations": [
2104
+ },
2272
2105
  {
2273
- "kind": "variable",
2274
- "name": "AssistantAppSettingsProvider",
2275
- "description": "The DI token for the (AssistantAppSettingsProvider:interface). Resolves a noop\nuntil the host registers one."
2276
- }
2277
- ],
2278
- "exports": [
2106
+ "kind": "js",
2107
+ "name": "ChatFallback",
2108
+ "declaration": {
2109
+ "name": "ChatFallback",
2110
+ "module": "src/config/config.ts"
2111
+ }
2112
+ },
2279
2113
  {
2280
2114
  "kind": "js",
2281
- "name": "AssistantAppSettingsProvider",
2115
+ "name": "ChatInputDuringExecutionMode",
2282
2116
  "declaration": {
2283
- "name": "AssistantAppSettingsProvider",
2284
- "module": "src/provider/assistant-app-settings.ts"
2117
+ "name": "ChatInputDuringExecutionMode",
2118
+ "module": "src/config/config.ts"
2119
+ }
2120
+ },
2121
+ {
2122
+ "kind": "js",
2123
+ "name": "ChatThinkingPolicy",
2124
+ "declaration": {
2125
+ "name": "ChatThinkingPolicy",
2126
+ "module": "src/config/config.ts"
2127
+ }
2128
+ },
2129
+ {
2130
+ "kind": "js",
2131
+ "name": "ChatToolChoice",
2132
+ "declaration": {
2133
+ "name": "ChatToolChoice",
2134
+ "module": "src/config/config.ts"
2135
+ }
2136
+ },
2137
+ {
2138
+ "kind": "js",
2139
+ "name": "defineAgent",
2140
+ "declaration": {
2141
+ "name": "defineAgent",
2142
+ "module": "src/config/config.ts"
2285
2143
  }
2286
2144
  }
2287
2145
  ]
2288
2146
  },
2289
2147
  {
2290
2148
  "kind": "javascript-module",
2291
- "path": "src/provider/tiered-provider-switcher.ts",
2149
+ "path": "src/config/define-stateful-agent.ts",
2292
2150
  "declarations": [
2293
2151
  {
2294
- "kind": "class",
2295
- "description": "Which cloud vendor backs the tier-shaped provider registry, plus the means to move it at\nruntime (GENC-1610).",
2296
- "name": "TieredAIProviderSwitcher",
2297
- "members": [
2298
- {
2299
- "kind": "field",
2300
- "name": "vendors",
2301
- "type": {
2302
- "text": "readonly AITierVendor[]"
2303
- },
2304
- "readonly": true
2305
- },
2306
- {
2307
- "kind": "field",
2308
- "name": "options",
2309
- "type": {
2310
- "text": "TieredAIProviderSwitcherOptions"
2311
- },
2312
- "privacy": "private",
2313
- "readonly": true,
2314
- "default": "options"
2315
- },
2316
- {
2317
- "kind": "field",
2318
- "name": "defaultTier",
2319
- "type": {
2320
- "text": "AITierId"
2321
- },
2322
- "privacy": "private",
2323
- "readonly": true
2324
- },
2325
- {
2326
- "kind": "field",
2327
- "name": "registry",
2328
- "type": {
2329
- "text": "MutableAIProviderRegistry"
2330
- },
2331
- "privacy": "private",
2332
- "readonly": true
2333
- },
2334
- {
2335
- "kind": "field",
2336
- "name": "listeners",
2337
- "privacy": "private",
2338
- "readonly": true,
2339
- "default": "new Set<(vendor: AITierVendor) => void>()"
2340
- },
2152
+ "kind": "function",
2153
+ "name": "restoreMachine",
2154
+ "return": {
2155
+ "type": {
2156
+ "text": "void"
2157
+ }
2158
+ },
2159
+ "parameters": [
2341
2160
  {
2342
- "kind": "field",
2343
- "name": "_vendor",
2161
+ "name": "machine",
2344
2162
  "type": {
2345
- "text": "AITierVendor"
2163
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
2346
2164
  },
2347
- "privacy": "private"
2165
+ "description": "the machine to restore (already constructed/started)."
2348
2166
  },
2349
2167
  {
2350
- "kind": "field",
2351
- "name": "vendor",
2168
+ "name": "restored",
2352
2169
  "type": {
2353
- "text": "AITierVendor"
2354
- },
2355
- "readonly": true
2356
- },
2357
- {
2358
- "kind": "method",
2359
- "name": "switchTo",
2360
- "return": {
2361
- "type": {
2362
- "text": "void"
2363
- }
2364
- },
2365
- "parameters": [
2366
- {
2367
- "name": "vendor",
2368
- "type": {
2369
- "text": "string"
2370
- }
2371
- }
2372
- ],
2373
- "description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
2374
- },
2375
- {
2376
- "kind": "method",
2377
- "name": "adoptPersistedVendor",
2378
- "return": {
2379
- "type": {
2380
- "text": "void"
2381
- }
2382
- },
2383
- "parameters": [
2384
- {
2385
- "name": "vendor",
2386
- "type": {
2387
- "text": "string"
2388
- }
2389
- }
2390
- ],
2391
- "description": "Adopt a vendor the app read back from its own store — the same registry move as\nTieredAIProviderSwitcher.switchTo, without the `onSwitch` callback, because this\nvalue came FROM the store and writing it back would be a pointless round-trip on load.\n\nExists because registration has to stay synchronous: an element that connects before the\ntoken is registered caches the platform's no-op fallback, so an app cannot await its\nstored preference before constructing this. It boots on `initialVendor` and adopts the\nstored one a moment later, through a registry that is mutable and held by reference."
2392
- },
2393
- {
2394
- "kind": "method",
2395
- "name": "subscribe",
2396
- "return": {
2397
- "type": {
2398
- "text": "() => void"
2399
- }
2400
- },
2401
- "parameters": [
2402
- {
2403
- "name": "listener",
2404
- "type": {
2405
- "text": "(vendor: string) => void"
2406
- }
2407
- }
2408
- ]
2409
- },
2410
- {
2411
- "kind": "method",
2412
- "name": "apply",
2413
- "privacy": "private",
2414
- "return": {
2415
- "type": {
2416
- "text": "void"
2417
- }
2418
- },
2419
- "parameters": [
2420
- {
2421
- "name": "vendor",
2422
- "type": {
2423
- "text": "AITierVendor"
2424
- }
2425
- }
2426
- ],
2427
- "description": "The registry move both entry points share, and nothing else."
2428
- },
2429
- {
2430
- "kind": "method",
2431
- "name": "build",
2432
- "privacy": "private",
2433
- "return": {
2434
- "type": {
2435
- "text": "Record<string, AIProvider>"
2436
- }
2170
+ "text": "unknown"
2437
2171
  },
2438
- "parameters": [
2439
- {
2440
- "name": "vendor",
2441
- "type": {
2442
- "text": "AITierVendor"
2443
- }
2444
- }
2445
- ]
2172
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
2446
2173
  },
2447
2174
  {
2448
- "kind": "method",
2449
- "name": "isKnownVendor",
2450
- "privacy": "private",
2451
- "return": {
2452
- "type": {
2453
- "text": "vendor is AITierVendor"
2454
- }
2455
- },
2456
- "parameters": [
2457
- {
2458
- "name": "vendor",
2459
- "type": {
2460
- "text": "string"
2461
- }
2462
- }
2463
- ]
2175
+ "name": "key",
2176
+ "default": "'machine'",
2177
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
2464
2178
  }
2465
- ]
2179
+ ],
2180
+ "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."
2466
2181
  },
2467
2182
  {
2468
2183
  "kind": "function",
2469
- "name": "registerTieredAIProviders",
2184
+ "name": "defineStatefulAgent",
2470
2185
  "return": {
2471
2186
  "type": {
2472
- "text": "TieredAIProviderSwitcher"
2187
+ "text": "AgentConfig"
2473
2188
  }
2474
2189
  },
2475
2190
  "parameters": [
2476
2191
  {
2477
- "name": "container",
2478
- "type": {
2479
- "text": "Container"
2480
- }
2481
- },
2482
- {
2483
- "name": "options",
2192
+ "name": "opts",
2484
2193
  "type": {
2485
- "text": "Omit<TieredAIProviderSwitcherOptions, 'container'>"
2194
+ "text": "StatefulAgentInit<S>"
2486
2195
  }
2487
2196
  }
2488
2197
  ],
2489
- "description": "Build a TieredAIProviderSwitcher — which registers the tier-shaped provider\nregistry — and put it on the (AIProviderSwitcher:variable) token. Call once at app\nbootstrap."
2198
+ "description": "Build an `AgentConfig` whose `systemPrompt`, `toolDefinitions`, and tool\nhandlers all close over a long-lived state object created on activation.\n\nThe framework wires the lifecycle: `init` on `onActivate`, `dispose` on\n`onDeactivate`. State is held inside the helper's closure — never exposed on\nthe resulting `AgentConfig` — so the redux serializer doesn't see it."
2490
2199
  }
2491
2200
  ],
2492
2201
  "exports": [
2493
2202
  {
2494
2203
  "kind": "js",
2495
- "name": "TieredAIProviderSwitcher",
2204
+ "name": "restoreMachine",
2496
2205
  "declaration": {
2497
- "name": "TieredAIProviderSwitcher",
2498
- "module": "src/provider/tiered-provider-switcher.ts"
2206
+ "name": "restoreMachine",
2207
+ "module": "src/config/define-stateful-agent.ts"
2499
2208
  }
2500
2209
  },
2501
2210
  {
2502
2211
  "kind": "js",
2503
- "name": "registerTieredAIProviders",
2212
+ "name": "defineStatefulAgent",
2504
2213
  "declaration": {
2505
- "name": "registerTieredAIProviders",
2506
- "module": "src/provider/tiered-provider-switcher.ts"
2214
+ "name": "defineStatefulAgent",
2215
+ "module": "src/config/define-stateful-agent.ts"
2216
+ }
2217
+ }
2218
+ ]
2219
+ },
2220
+ {
2221
+ "kind": "javascript-module",
2222
+ "path": "src/config/fallback-agents.ts",
2223
+ "declarations": [
2224
+ {
2225
+ "kind": "variable",
2226
+ "name": "friendlyFallbackAgent",
2227
+ "type": {
2228
+ "text": "FallbackAgentConfig"
2229
+ },
2230
+ "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a warm, friendly assistant. For general conversation like \"Hi\" or \"How are you\", you can have a friendly chat. For anything more complex, you cannot directly help, but you can explain what specialists are available. The available specialists are:\\n\\n{{agents}}\\n\\nPolitely let the user know what you can help with and invite them to rephrase their request if it is outside your scope.`,\n}",
2231
+ "description": "A warm, conversational fallback agent. Acknowledges it can't help directly,\nexplains what the available specialists can do, and invites the user to retry.\n\nThe system prompt is generated at runtime by `OrchestratingDriver` from the\nspecialist list — no manual authoring required."
2232
+ },
2233
+ {
2234
+ "kind": "variable",
2235
+ "name": "strictFallbackAgent",
2236
+ "type": {
2237
+ "text": "FallbackAgentConfig"
2238
+ },
2239
+ "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a concise assistant. The user's request is outside your scope. The available specialists are: {{agents}}.\n\n{{unroutable}}\n\nAnswer in a single short sentence. Do not elaborate.`,\n}",
2240
+ "description": "A brief, professional fallback agent. States what is available without\nelaboration. The `{{agents}}` placeholder is replaced at runtime by\n`OrchestratingDriver` with the generated specialist list.\n\nThe `{{unroutable}}` placeholder positions `UNROUTABLE_INSTRUCTION` — the framework's\ninstruction for a substantive request no specialist covers, which is otherwise APPENDED to a\nstring-form prompt. Positioned rather than appended for one reason: this preset's whole point is\nbrevity, and appended text would be the last thing the model reads. Putting the block above the\nbrevity rule leaves \"a single short sentence\" with the recency, so the two compose instead of\ncompeting. A prompt whose tone rules matter should do the same."
2241
+ }
2242
+ ],
2243
+ "exports": [
2244
+ {
2245
+ "kind": "js",
2246
+ "name": "friendlyFallbackAgent",
2247
+ "declaration": {
2248
+ "name": "friendlyFallbackAgent",
2249
+ "module": "src/config/fallback-agents.ts"
2250
+ }
2251
+ },
2252
+ {
2253
+ "kind": "js",
2254
+ "name": "strictFallbackAgent",
2255
+ "declaration": {
2256
+ "name": "strictFallbackAgent",
2257
+ "module": "src/config/fallback-agents.ts"
2258
+ }
2259
+ }
2260
+ ]
2261
+ },
2262
+ {
2263
+ "kind": "javascript-module",
2264
+ "path": "src/config/index.ts",
2265
+ "declarations": [],
2266
+ "exports": [
2267
+ {
2268
+ "kind": "js",
2269
+ "name": "*",
2270
+ "declaration": {
2271
+ "name": "*",
2272
+ "package": "./config"
2273
+ }
2274
+ },
2275
+ {
2276
+ "kind": "js",
2277
+ "name": "*",
2278
+ "declaration": {
2279
+ "name": "*",
2280
+ "package": "./fallback-agents"
2507
2281
  }
2508
2282
  }
2509
2283
  ]
2510
2284
  },
2285
+ {
2286
+ "kind": "javascript-module",
2287
+ "path": "src/config/validate-providers.ts",
2288
+ "declarations": [],
2289
+ "exports": []
2290
+ },
2511
2291
  {
2512
2292
  "kind": "javascript-module",
2513
2293
  "path": "src/main/attachment-controller.ts",
@@ -5500,96 +5280,650 @@
5500
5280
  "text": "void"
5501
5281
  }
5502
5282
  },
5503
- "description": "Recompute the derived flag and the displayed copy from `brokenSources`.\n\nCopy order is last-in-wins, which is both deterministic (`Map` iterates in insertion order)\nand the behaviour a reader expects — the most recent failure is the one described. Setting\n`persistenceBroken` last means the modal is only ever shown or closed once the copy backing\nit is already correct."
5283
+ "description": "Recompute the derived flag and the displayed copy from `brokenSources`.\n\nCopy order is last-in-wins, which is both deterministic (`Map` iterates in insertion order)\nand the behaviour a reader expects — the most recent failure is the one described. Setting\n`persistenceBroken` last means the modal is only ever shown or closed once the copy backing\nit is already correct."
5284
+ },
5285
+ {
5286
+ "kind": "method",
5287
+ "name": "onPersistenceBroken",
5288
+ "privacy": "private",
5289
+ "return": {
5290
+ "type": {
5291
+ "text": "void"
5292
+ }
5293
+ },
5294
+ "parameters": [
5295
+ {
5296
+ "name": "d",
5297
+ "type": {
5298
+ "text": "{\n unsavedMessages: number;\n lastSavedAt?: string;\n reason: string;\n }"
5299
+ }
5300
+ }
5301
+ ],
5302
+ "description": "This element's own persister said the session snapshot is not landing (GENC-1511)."
5303
+ },
5304
+ {
5305
+ "kind": "method",
5306
+ "name": "onPersistenceRecovered",
5307
+ "privacy": "private",
5308
+ "return": {
5309
+ "type": {
5310
+ "text": "void"
5311
+ }
5312
+ },
5313
+ "description": "A session save landed after a broken episode — withdraw OUR warning only (GENC-1511).\n\nThe explicit source is the whole point: a host's project store may still be failing, and\nbefore this was per-source a session recovery closed that modal too."
5314
+ },
5315
+ {
5316
+ "kind": "method",
5317
+ "name": "reloadForPersistence",
5318
+ "return": {
5319
+ "type": {
5320
+ "text": "void"
5321
+ }
5322
+ },
5323
+ "description": "The modal's only action. A reload re-reads the stored snapshot, which is plain data parsed\nfrom the server, so it also clears the serialisation fault that is the most likely cause."
5324
+ },
5325
+ {
5326
+ "kind": "method",
5327
+ "name": "initPersistenceForNewStore",
5328
+ "privacy": "private",
5329
+ "return": {
5330
+ "type": {
5331
+ "text": "Promise<void>"
5332
+ }
5333
+ },
5334
+ "parameters": [
5335
+ {
5336
+ "name": "key",
5337
+ "type": {
5338
+ "text": "string"
5339
+ }
5340
+ }
5341
+ ],
5342
+ "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."
5343
+ },
5344
+ {
5345
+ "kind": "method",
5346
+ "name": "triggerFileInput",
5347
+ "return": {
5348
+ "type": {
5349
+ "text": "void"
5350
+ }
5351
+ }
5352
+ },
5353
+ {
5354
+ "kind": "method",
5355
+ "name": "handleFileSelect",
5356
+ "return": {
5357
+ "type": {
5358
+ "text": "void"
5359
+ }
5360
+ },
5361
+ "parameters": [
5362
+ {
5363
+ "name": "e",
5364
+ "type": {
5365
+ "text": "Event"
5366
+ }
5367
+ }
5368
+ ]
5369
+ },
5370
+ {
5371
+ "kind": "method",
5372
+ "name": "removeAttachment",
5373
+ "return": {
5374
+ "type": {
5375
+ "text": "void"
5376
+ }
5377
+ },
5378
+ "parameters": [
5379
+ {
5380
+ "name": "attachment",
5381
+ "type": {
5382
+ "text": "ChatAttachment"
5383
+ }
5384
+ }
5385
+ ]
5386
+ },
5387
+ {
5388
+ "kind": "method",
5389
+ "name": "removeAttachmentError",
5390
+ "return": {
5391
+ "type": {
5392
+ "text": "void"
5393
+ }
5394
+ },
5395
+ "parameters": [
5396
+ {
5397
+ "name": "message",
5398
+ "type": {
5399
+ "text": "string"
5400
+ }
5401
+ }
5402
+ ]
5403
+ },
5404
+ {
5405
+ "kind": "method",
5406
+ "name": "handleSendClick"
5407
+ },
5408
+ {
5409
+ "kind": "method",
5410
+ "name": "handleStopClick",
5411
+ "description": "User clicked Stop. Cancels the current turn via the driver and flips the\nbutton to \"Stopping…\" until the turn winds down (a tool mid-execution\nfinishes first). Guarded so a second click is a no-op."
5412
+ },
5413
+ {
5414
+ "kind": "method",
5415
+ "name": "handleSuggestionClick",
5416
+ "parameters": [
5417
+ {
5418
+ "name": "suggestion",
5419
+ "type": {
5420
+ "text": "string"
5421
+ }
5422
+ }
5423
+ ]
5424
+ },
5425
+ {
5426
+ "kind": "method",
5427
+ "name": "submitMessage",
5428
+ "return": {
5429
+ "type": {
5430
+ "text": "Promise<SubmitMessageResult>"
5431
+ }
5432
+ },
5433
+ "parameters": [
5434
+ {
5435
+ "name": "input",
5436
+ "type": {
5437
+ "text": "{ text?: string; files?: File[] }"
5438
+ }
5439
+ }
5440
+ ],
5441
+ "description": "Programmatically submit a message. Equivalent to the user typing into the\nbuilt-in composer and pressing send, but callable from external code — most\ncommonly a custom input rendered inside `slot=\"splash\"` when paired with\n`chatConfig.ui.hideComposer`.\n\nThe input fully describes the turn: `text` and `files` REPLACE any current\ncomposer state (they are not appended to it). Files are validated against\n`chatConfig.ui.acceptedFiles` using the same pipeline as the composer's\nattach button.\n\nAtomic on validation: if any file fails validation, no attachments are\ncommitted and no send is dispatched. Failure messages are returned in\n`errors` AND appended to the `attachmentErrors` observable so the built-in\nchip UI still surfaces them when visible.\n\nResolves once the underlying send has been kicked off — it does NOT await\nthe assistant's response."
5442
+ },
5443
+ {
5444
+ "kind": "method",
5445
+ "name": "fetchSuggestions",
5446
+ "privacy": "private"
5447
+ },
5448
+ {
5449
+ "kind": "field",
5450
+ "name": "_pendingSendPrompt",
5451
+ "type": {
5452
+ "text": "string | undefined"
5453
+ },
5454
+ "privacy": "private",
5455
+ "description": "User text of the message currently being sent, stashed for the lifetime of `send()`.\n`flow-owner-changed` fires while the driver routes this turn — before the message is\nappended to raw history — so the flow-activation-prompt capture reads this rather than\na stale raw-history lookup. Cleared once the send settles. (GENC-1351 §5.9)"
5456
+ },
5457
+ {
5458
+ "kind": "method",
5459
+ "name": "send",
5460
+ "privacy": "private"
5461
+ },
5462
+ {
5463
+ "kind": "method",
5464
+ "name": "onChatHeaderMouseDown",
5465
+ "parameters": [
5466
+ {
5467
+ "name": "e",
5468
+ "type": {
5469
+ "text": "MouseEvent"
5470
+ }
5471
+ }
5472
+ ]
5473
+ },
5474
+ {
5475
+ "kind": "method",
5476
+ "name": "handleInteractionCompleted",
5477
+ "parameters": [
5478
+ {
5479
+ "name": "e",
5480
+ "type": {
5481
+ "text": "Event"
5482
+ }
5483
+ }
5484
+ ]
5485
+ },
5486
+ {
5487
+ "kind": "method",
5488
+ "name": "handleInteractionCost",
5489
+ "parameters": [
5490
+ {
5491
+ "name": "e",
5492
+ "type": {
5493
+ "text": "Event"
5494
+ }
5495
+ }
5496
+ ],
5497
+ "description": "A widget reporting spend it incurred AFTER resolving.\n\nNote what this deliberately does NOT do: no `startLoadingTimer()`. This is bookkeeping about a\nturn that already finished, so it must be invisible — showing a spinner would tell the user the\nassistant is working when nothing is pending."
5498
+ },
5499
+ {
5500
+ "kind": "field",
5501
+ "name": "stopButtonVisible",
5502
+ "type": {
5503
+ "text": "boolean"
5504
+ },
5505
+ "description": "Whether the Stop control is showing.\n\nWhile a turn runs Stop REPLACES Send rather than sitting beside it: the two\nare mutually exclusive actions, and a disabled Send next to a live Stop just\ngives the eye a dead control to skip past. Reads `busy`, so `cancelling`\nkeeps it up (in its \"Stopping…\" state) until the turn actually winds down.",
5506
+ "readonly": true
5507
+ },
5508
+ {
5509
+ "kind": "field",
5510
+ "name": "sendButtonVisible",
5511
+ "type": {
5512
+ "text": "boolean"
5513
+ },
5514
+ "description": "Whether Send is rendered at all. Hidden exactly when Stop has taken its\nplace — so a host that suppressed Stop via `hideStopButton` keeps Send\nthroughout, disabled for the duration, and the slot is never left empty\nmid-turn.",
5515
+ "readonly": true
5516
+ },
5517
+ {
5518
+ "kind": "field",
5519
+ "name": "isComposerResizable",
5520
+ "type": {
5521
+ "text": "boolean"
5522
+ },
5523
+ "description": "Whether the message input shows a drag handle to resize its height.",
5524
+ "readonly": true
5525
+ },
5526
+ {
5527
+ "kind": "field",
5528
+ "name": "composerHeightStyle",
5529
+ "type": {
5530
+ "text": "string"
5531
+ },
5532
+ "description": "Inline style carrying the dragged height into `--composer-height`.",
5533
+ "readonly": true
5534
+ },
5535
+ {
5536
+ "kind": "method",
5537
+ "name": "onComposerResizeStart",
5538
+ "return": {
5539
+ "type": {
5540
+ "text": "void"
5541
+ }
5542
+ },
5543
+ "parameters": [
5544
+ {
5545
+ "name": "e",
5546
+ "type": {
5547
+ "text": "PointerEvent"
5548
+ }
5549
+ }
5550
+ ]
5551
+ },
5552
+ {
5553
+ "kind": "method",
5554
+ "name": "onComposerResizeMove",
5555
+ "return": {
5556
+ "type": {
5557
+ "text": "void"
5558
+ }
5559
+ },
5560
+ "parameters": [
5561
+ {
5562
+ "name": "e",
5563
+ "type": {
5564
+ "text": "PointerEvent"
5565
+ }
5566
+ }
5567
+ ]
5568
+ },
5569
+ {
5570
+ "kind": "method",
5571
+ "name": "onComposerResizeEnd",
5572
+ "return": {
5573
+ "type": {
5574
+ "text": "void"
5575
+ }
5576
+ },
5577
+ "parameters": [
5578
+ {
5579
+ "name": "e",
5580
+ "type": {
5581
+ "text": "PointerEvent"
5582
+ }
5583
+ }
5584
+ ]
5585
+ }
5586
+ ],
5587
+ "events": [
5588
+ {
5589
+ "name": "budget-refresh-requested",
5590
+ "type": {
5591
+ "text": "CustomEvent"
5592
+ }
5593
+ },
5594
+ {
5595
+ "type": {
5596
+ "text": "CustomEvent"
5597
+ }
5598
+ },
5599
+ {
5600
+ "description": "Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMouseDownDetail`",
5601
+ "name": "chat-header-mousedown"
5602
+ },
5603
+ {
5604
+ "description": "Fired after the session is wiped (the lifecycle menu's Clear). The payload is captured before teardown so the host can clean up any external state the active agent was working on. Bubbles and composed. detail: `SessionClearedDetail`",
5605
+ "name": "session-cleared"
5606
+ }
5607
+ ],
5608
+ "attributes": [
5609
+ {
5610
+ "name": "header-title",
5611
+ "type": {
5612
+ "text": "string"
5613
+ },
5614
+ "default": "'Genesis Assistant'",
5615
+ "fieldName": "headerTitle"
5616
+ },
5617
+ {
5618
+ "name": "session-key",
5619
+ "type": {
5620
+ "text": "string | undefined"
5621
+ },
5622
+ "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.",
5623
+ "fieldName": "sessionKey"
5624
+ },
5625
+ {
5626
+ "name": "image-src",
5627
+ "type": {
5628
+ "text": "string | undefined"
5629
+ },
5630
+ "fieldName": "imageSrc"
5631
+ },
5632
+ {
5633
+ "name": "user-image-src",
5634
+ "type": {
5635
+ "text": "string | undefined"
5636
+ },
5637
+ "fieldName": "userImageSrc"
5638
+ },
5639
+ {
5640
+ "name": "placeholder",
5641
+ "type": {
5642
+ "text": "string"
5643
+ },
5644
+ "default": "'Message assistant...'",
5645
+ "fieldName": "placeholder"
5646
+ },
5647
+ {
5648
+ "name": "popout-mode",
5649
+ "type": {
5650
+ "text": "PopoutMode | undefined"
5651
+ },
5652
+ "description": "Controls the pop-out button shown next to the settings cog.\n\"expand\" — in bubble, expands to layout panel (fires chat-popout).\n\"collapse\" — in layout panel, collapses back to bubble (fires chat-popin).\nAbsent — no button (default standalone behaviour, no breaking change).",
5653
+ "fieldName": "popoutMode"
5654
+ },
5655
+ {
5656
+ "name": "debug-redux",
5657
+ "type": {
5658
+ "text": "boolean"
5659
+ },
5660
+ "default": "false",
5661
+ "description": "When set, enables Redux DevTools for this instance's session store.",
5662
+ "fieldName": "debugRedux"
5663
+ }
5664
+ ],
5665
+ "superclass": {
5666
+ "name": "GenesisElement",
5667
+ "package": "@genesislcap/web-core"
5668
+ },
5669
+ "tagName": "foundation-ai-assistant",
5670
+ "customElement": true
5671
+ }
5672
+ ],
5673
+ "exports": [
5674
+ {
5675
+ "kind": "js",
5676
+ "name": "sparkleIconSvg",
5677
+ "declaration": {
5678
+ "name": "sparkleIconSvg",
5679
+ "module": "src/main/main.ts"
5680
+ }
5681
+ },
5682
+ {
5683
+ "kind": "js",
5684
+ "name": "userIconSvg",
5685
+ "declaration": {
5686
+ "name": "userIconSvg",
5687
+ "module": "src/main/main.ts"
5688
+ }
5689
+ },
5690
+ {
5691
+ "kind": "js",
5692
+ "name": "genesisIconSvg",
5693
+ "declaration": {
5694
+ "name": "genesisIconSvg",
5695
+ "module": "src/main/main.ts"
5696
+ }
5697
+ },
5698
+ {
5699
+ "kind": "js",
5700
+ "name": "budgetPercentOf",
5701
+ "declaration": {
5702
+ "name": "budgetPercentOf",
5703
+ "module": "./budget-controller"
5704
+ }
5705
+ },
5706
+ {
5707
+ "kind": "js",
5708
+ "name": "formatBlockedReason",
5709
+ "declaration": {
5710
+ "name": "formatBlockedReason",
5711
+ "module": "./budget-controller"
5712
+ }
5713
+ },
5714
+ {
5715
+ "kind": "js",
5716
+ "name": "FoundationAiAssistant",
5717
+ "declaration": {
5718
+ "name": "FoundationAiAssistant",
5719
+ "module": "src/main/main.ts"
5720
+ }
5721
+ },
5722
+ {
5723
+ "kind": "custom-element-definition",
5724
+ "name": "foundation-ai-assistant",
5725
+ "declaration": {
5726
+ "name": "FoundationAiAssistant",
5727
+ "module": "src/main/main.ts"
5728
+ }
5729
+ }
5730
+ ]
5731
+ },
5732
+ {
5733
+ "kind": "javascript-module",
5734
+ "path": "src/main/main.types.ts",
5735
+ "declarations": [
5736
+ {
5737
+ "kind": "variable",
5738
+ "name": "AiAssistantEvent",
5739
+ "type": {
5740
+ "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}"
5741
+ },
5742
+ "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}",
5743
+ "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."
5744
+ },
5745
+ {
5746
+ "kind": "variable",
5747
+ "name": "ANIMATION_DEFS",
5748
+ "type": {
5749
+ "text": "object"
5750
+ },
5751
+ "default": "{\n loading: {\n label: 'Dots',\n description: 'Shows pulsing dots while the assistant is generating a response.',\n category: 'Loading style',\n },\n waves: {\n label: 'Waves',\n description:\n 'Shows glowing sine waves inside a circle while the assistant is generating a response.',\n category: 'Loading style',\n },\n flowingWaves: {\n label: 'Flowing waves',\n description:\n 'Shows coloured waves rising and settling from a line while the assistant is generating a response.',\n category: 'Loading style',\n },\n plasma: {\n label: 'Plasma orb',\n description:\n 'Shows a glowing plasma sphere with drifting energy while the assistant is generating a response.',\n category: 'Loading style',\n },\n halo: {\n label: 'Halo',\n description:\n 'Displays a glowing halo around the assistant avatar while a response is streaming.',\n category: 'Effects',\n },\n}",
5752
+ "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5753
+ },
5754
+ {
5755
+ "kind": "variable",
5756
+ "name": "satisfies",
5757
+ "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5758
+ },
5759
+ {
5760
+ "kind": "variable",
5761
+ "name": "Record",
5762
+ "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5763
+ }
5764
+ ],
5765
+ "exports": [
5766
+ {
5767
+ "kind": "js",
5768
+ "name": "AgentPickerMode",
5769
+ "declaration": {
5770
+ "name": "AgentPickerMode",
5771
+ "package": "@genesislcap/foundation-ai"
5772
+ }
5773
+ },
5774
+ {
5775
+ "kind": "js",
5776
+ "name": "AiAssistantEvent",
5777
+ "declaration": {
5778
+ "name": "AiAssistantEvent",
5779
+ "module": "src/main/main.types.ts"
5780
+ }
5781
+ },
5782
+ {
5783
+ "kind": "js",
5784
+ "name": "ANIMATION_DEFS",
5785
+ "declaration": {
5786
+ "name": "ANIMATION_DEFS",
5787
+ "module": "src/main/main.types.ts"
5788
+ }
5789
+ },
5790
+ {
5791
+ "kind": "js",
5792
+ "name": "satisfies",
5793
+ "declaration": {
5794
+ "name": "satisfies",
5795
+ "module": "src/main/main.types.ts"
5796
+ }
5797
+ },
5798
+ {
5799
+ "kind": "js",
5800
+ "name": "Record",
5801
+ "declaration": {
5802
+ "name": "Record",
5803
+ "module": "src/main/main.types.ts"
5804
+ }
5805
+ }
5806
+ ]
5807
+ },
5808
+ {
5809
+ "kind": "javascript-module",
5810
+ "path": "src/main/meta-snapshot.ts",
5811
+ "declarations": [],
5812
+ "exports": []
5813
+ },
5814
+ {
5815
+ "kind": "javascript-module",
5816
+ "path": "src/provider/ai-provider-switcher.ts",
5817
+ "declarations": [
5818
+ {
5819
+ "kind": "variable",
5820
+ "name": "AIProviderSwitcher",
5821
+ "description": "The DI token for the (AIProviderSwitcher:interface). Resolves a noop until the app\nregisters one."
5822
+ }
5823
+ ],
5824
+ "exports": [
5825
+ {
5826
+ "kind": "js",
5827
+ "name": "AIProviderSwitcher",
5828
+ "declaration": {
5829
+ "name": "AIProviderSwitcher",
5830
+ "module": "src/provider/ai-provider-switcher.ts"
5831
+ }
5832
+ }
5833
+ ]
5834
+ },
5835
+ {
5836
+ "kind": "javascript-module",
5837
+ "path": "src/provider/assistant-app-settings.ts",
5838
+ "declarations": [
5839
+ {
5840
+ "kind": "variable",
5841
+ "name": "AssistantAppSettingsProvider",
5842
+ "description": "The DI token for the (AssistantAppSettingsProvider:interface). Resolves a noop\nuntil the host registers one."
5843
+ }
5844
+ ],
5845
+ "exports": [
5846
+ {
5847
+ "kind": "js",
5848
+ "name": "AssistantAppSettingsProvider",
5849
+ "declaration": {
5850
+ "name": "AssistantAppSettingsProvider",
5851
+ "module": "src/provider/assistant-app-settings.ts"
5852
+ }
5853
+ }
5854
+ ]
5855
+ },
5856
+ {
5857
+ "kind": "javascript-module",
5858
+ "path": "src/provider/tiered-provider-switcher.ts",
5859
+ "declarations": [
5860
+ {
5861
+ "kind": "class",
5862
+ "description": "Which cloud vendor backs the tier-shaped provider registry, plus the means to move it at\nruntime (GENC-1610).",
5863
+ "name": "TieredAIProviderSwitcher",
5864
+ "members": [
5865
+ {
5866
+ "kind": "field",
5867
+ "name": "vendors",
5868
+ "type": {
5869
+ "text": "readonly AITierVendor[]"
5870
+ },
5871
+ "readonly": true
5504
5872
  },
5505
5873
  {
5506
- "kind": "method",
5507
- "name": "onPersistenceBroken",
5508
- "privacy": "private",
5509
- "return": {
5510
- "type": {
5511
- "text": "void"
5512
- }
5874
+ "kind": "field",
5875
+ "name": "options",
5876
+ "type": {
5877
+ "text": "TieredAIProviderSwitcherOptions"
5513
5878
  },
5514
- "parameters": [
5515
- {
5516
- "name": "d",
5517
- "type": {
5518
- "text": "{\n unsavedMessages: number;\n lastSavedAt?: string;\n reason: string;\n }"
5519
- }
5520
- }
5521
- ],
5522
- "description": "This element's own persister said the session snapshot is not landing (GENC-1511)."
5879
+ "privacy": "private",
5880
+ "readonly": true,
5881
+ "default": "options"
5523
5882
  },
5524
5883
  {
5525
- "kind": "method",
5526
- "name": "onPersistenceRecovered",
5527
- "privacy": "private",
5528
- "return": {
5529
- "type": {
5530
- "text": "void"
5531
- }
5884
+ "kind": "field",
5885
+ "name": "defaultTier",
5886
+ "type": {
5887
+ "text": "AITierId"
5532
5888
  },
5533
- "description": "A session save landed after a broken episode — withdraw OUR warning only (GENC-1511).\n\nThe explicit source is the whole point: a host's project store may still be failing, and\nbefore this was per-source a session recovery closed that modal too."
5889
+ "privacy": "private",
5890
+ "readonly": true
5534
5891
  },
5535
5892
  {
5536
- "kind": "method",
5537
- "name": "reloadForPersistence",
5538
- "return": {
5539
- "type": {
5540
- "text": "void"
5541
- }
5893
+ "kind": "field",
5894
+ "name": "registry",
5895
+ "type": {
5896
+ "text": "MutableAIProviderRegistry"
5542
5897
  },
5543
- "description": "The modal's only action. A reload re-reads the stored snapshot, which is plain data parsed\nfrom the server, so it also clears the serialisation fault that is the most likely cause."
5898
+ "privacy": "private",
5899
+ "readonly": true
5544
5900
  },
5545
5901
  {
5546
- "kind": "method",
5547
- "name": "initPersistenceForNewStore",
5902
+ "kind": "field",
5903
+ "name": "listeners",
5548
5904
  "privacy": "private",
5549
- "return": {
5550
- "type": {
5551
- "text": "Promise<void>"
5552
- }
5553
- },
5554
- "parameters": [
5555
- {
5556
- "name": "key",
5557
- "type": {
5558
- "text": "string"
5559
- }
5560
- }
5561
- ],
5562
- "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."
5905
+ "readonly": true,
5906
+ "default": "new Set<(vendor: AITierVendor) => void>()"
5563
5907
  },
5564
5908
  {
5565
- "kind": "method",
5566
- "name": "triggerFileInput",
5567
- "return": {
5568
- "type": {
5569
- "text": "void"
5570
- }
5571
- }
5909
+ "kind": "field",
5910
+ "name": "_vendor",
5911
+ "type": {
5912
+ "text": "AITierVendor"
5913
+ },
5914
+ "privacy": "private"
5572
5915
  },
5573
5916
  {
5574
- "kind": "method",
5575
- "name": "handleFileSelect",
5576
- "return": {
5577
- "type": {
5578
- "text": "void"
5579
- }
5917
+ "kind": "field",
5918
+ "name": "vendor",
5919
+ "type": {
5920
+ "text": "AITierVendor"
5580
5921
  },
5581
- "parameters": [
5582
- {
5583
- "name": "e",
5584
- "type": {
5585
- "text": "Event"
5586
- }
5587
- }
5588
- ]
5922
+ "readonly": true
5589
5923
  },
5590
5924
  {
5591
5925
  "kind": "method",
5592
- "name": "removeAttachment",
5926
+ "name": "switchTo",
5593
5927
  "return": {
5594
5928
  "type": {
5595
5929
  "text": "void"
@@ -5597,16 +5931,17 @@
5597
5931
  },
5598
5932
  "parameters": [
5599
5933
  {
5600
- "name": "attachment",
5934
+ "name": "vendor",
5601
5935
  "type": {
5602
- "text": "ChatAttachment"
5936
+ "text": "string"
5603
5937
  }
5604
5938
  }
5605
- ]
5939
+ ],
5940
+ "description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
5606
5941
  },
5607
5942
  {
5608
5943
  "kind": "method",
5609
- "name": "removeAttachmentError",
5944
+ "name": "adoptPersistedVendor",
5610
5945
  "return": {
5611
5946
  "type": {
5612
5947
  "text": "void"
@@ -5614,147 +5949,35 @@
5614
5949
  },
5615
5950
  "parameters": [
5616
5951
  {
5617
- "name": "message",
5618
- "type": {
5619
- "text": "string"
5620
- }
5621
- }
5622
- ]
5623
- },
5624
- {
5625
- "kind": "method",
5626
- "name": "handleSendClick"
5627
- },
5628
- {
5629
- "kind": "method",
5630
- "name": "handleStopClick",
5631
- "description": "User clicked Stop. Cancels the current turn via the driver and flips the\nbutton to \"Stopping…\" until the turn winds down (a tool mid-execution\nfinishes first). Guarded so a second click is a no-op."
5632
- },
5633
- {
5634
- "kind": "method",
5635
- "name": "handleSuggestionClick",
5636
- "parameters": [
5637
- {
5638
- "name": "suggestion",
5952
+ "name": "vendor",
5639
5953
  "type": {
5640
5954
  "text": "string"
5641
5955
  }
5642
5956
  }
5643
- ]
5957
+ ],
5958
+ "description": "Adopt a vendor the app read back from its own store — the same registry move as\nTieredAIProviderSwitcher.switchTo, without the `onSwitch` callback, because this\nvalue came FROM the store and writing it back would be a pointless round-trip on load.\n\nExists because registration has to stay synchronous: an element that connects before the\ntoken is registered caches the platform's no-op fallback, so an app cannot await its\nstored preference before constructing this. It boots on `initialVendor` and adopts the\nstored one a moment later, through a registry that is mutable and held by reference."
5644
5959
  },
5645
5960
  {
5646
5961
  "kind": "method",
5647
- "name": "submitMessage",
5962
+ "name": "subscribe",
5648
5963
  "return": {
5649
5964
  "type": {
5650
- "text": "Promise<SubmitMessageResult>"
5651
- }
5652
- },
5653
- "parameters": [
5654
- {
5655
- "name": "input",
5656
- "type": {
5657
- "text": "{ text?: string; files?: File[] }"
5658
- }
5659
- }
5660
- ],
5661
- "description": "Programmatically submit a message. Equivalent to the user typing into the\nbuilt-in composer and pressing send, but callable from external code — most\ncommonly a custom input rendered inside `slot=\"splash\"` when paired with\n`chatConfig.ui.hideComposer`.\n\nThe input fully describes the turn: `text` and `files` REPLACE any current\ncomposer state (they are not appended to it). Files are validated against\n`chatConfig.ui.acceptedFiles` using the same pipeline as the composer's\nattach button.\n\nAtomic on validation: if any file fails validation, no attachments are\ncommitted and no send is dispatched. Failure messages are returned in\n`errors` AND appended to the `attachmentErrors` observable so the built-in\nchip UI still surfaces them when visible.\n\nResolves once the underlying send has been kicked off — it does NOT await\nthe assistant's response."
5662
- },
5663
- {
5664
- "kind": "method",
5665
- "name": "fetchSuggestions",
5666
- "privacy": "private"
5667
- },
5668
- {
5669
- "kind": "field",
5670
- "name": "_pendingSendPrompt",
5671
- "type": {
5672
- "text": "string | undefined"
5673
- },
5674
- "privacy": "private",
5675
- "description": "User text of the message currently being sent, stashed for the lifetime of `send()`.\n`flow-owner-changed` fires while the driver routes this turn — before the message is\nappended to raw history — so the flow-activation-prompt capture reads this rather than\na stale raw-history lookup. Cleared once the send settles. (GENC-1351 §5.9)"
5676
- },
5677
- {
5678
- "kind": "method",
5679
- "name": "send",
5680
- "privacy": "private"
5681
- },
5682
- {
5683
- "kind": "method",
5684
- "name": "onChatHeaderMouseDown",
5685
- "parameters": [
5686
- {
5687
- "name": "e",
5688
- "type": {
5689
- "text": "MouseEvent"
5690
- }
5691
- }
5692
- ]
5693
- },
5694
- {
5695
- "kind": "method",
5696
- "name": "handleInteractionCompleted",
5697
- "parameters": [
5698
- {
5699
- "name": "e",
5700
- "type": {
5701
- "text": "Event"
5702
- }
5703
- }
5704
- ]
5705
- },
5706
- {
5707
- "kind": "method",
5708
- "name": "handleInteractionCost",
5709
- "parameters": [
5710
- {
5711
- "name": "e",
5712
- "type": {
5713
- "text": "Event"
5714
- }
5965
+ "text": "() => void"
5715
5966
  }
5716
- ],
5717
- "description": "A widget reporting spend it incurred AFTER resolving.\n\nNote what this deliberately does NOT do: no `startLoadingTimer()`. This is bookkeeping about a\nturn that already finished, so it must be invisible — showing a spinner would tell the user the\nassistant is working when nothing is pending."
5718
- },
5719
- {
5720
- "kind": "field",
5721
- "name": "stopButtonVisible",
5722
- "type": {
5723
- "text": "boolean"
5724
- },
5725
- "description": "Whether the Stop control is showing.\n\nWhile a turn runs Stop REPLACES Send rather than sitting beside it: the two\nare mutually exclusive actions, and a disabled Send next to a live Stop just\ngives the eye a dead control to skip past. Reads `busy`, so `cancelling`\nkeeps it up (in its \"Stopping…\" state) until the turn actually winds down.",
5726
- "readonly": true
5727
- },
5728
- {
5729
- "kind": "field",
5730
- "name": "sendButtonVisible",
5731
- "type": {
5732
- "text": "boolean"
5733
- },
5734
- "description": "Whether Send is rendered at all. Hidden exactly when Stop has taken its\nplace — so a host that suppressed Stop via `hideStopButton` keeps Send\nthroughout, disabled for the duration, and the slot is never left empty\nmid-turn.",
5735
- "readonly": true
5736
- },
5737
- {
5738
- "kind": "field",
5739
- "name": "isComposerResizable",
5740
- "type": {
5741
- "text": "boolean"
5742
- },
5743
- "description": "Whether the message input shows a drag handle to resize its height.",
5744
- "readonly": true
5745
- },
5746
- {
5747
- "kind": "field",
5748
- "name": "composerHeightStyle",
5749
- "type": {
5750
- "text": "string"
5751
- },
5752
- "description": "Inline style carrying the dragged height into `--composer-height`.",
5753
- "readonly": true
5967
+ },
5968
+ "parameters": [
5969
+ {
5970
+ "name": "listener",
5971
+ "type": {
5972
+ "text": "(vendor: string) => void"
5973
+ }
5974
+ }
5975
+ ]
5754
5976
  },
5755
5977
  {
5756
5978
  "kind": "method",
5757
- "name": "onComposerResizeStart",
5979
+ "name": "apply",
5980
+ "privacy": "private",
5758
5981
  "return": {
5759
5982
  "type": {
5760
5983
  "text": "void"
@@ -5762,275 +5985,96 @@
5762
5985
  },
5763
5986
  "parameters": [
5764
5987
  {
5765
- "name": "e",
5988
+ "name": "vendor",
5766
5989
  "type": {
5767
- "text": "PointerEvent"
5990
+ "text": "AITierVendor"
5768
5991
  }
5769
5992
  }
5770
- ]
5993
+ ],
5994
+ "description": "The registry move both entry points share, and nothing else."
5771
5995
  },
5772
5996
  {
5773
5997
  "kind": "method",
5774
- "name": "onComposerResizeMove",
5998
+ "name": "build",
5999
+ "privacy": "private",
5775
6000
  "return": {
5776
6001
  "type": {
5777
- "text": "void"
6002
+ "text": "Record<string, AIProvider>"
5778
6003
  }
5779
6004
  },
5780
6005
  "parameters": [
5781
6006
  {
5782
- "name": "e",
6007
+ "name": "vendor",
5783
6008
  "type": {
5784
- "text": "PointerEvent"
6009
+ "text": "AITierVendor"
5785
6010
  }
5786
6011
  }
5787
6012
  ]
5788
6013
  },
5789
6014
  {
5790
6015
  "kind": "method",
5791
- "name": "onComposerResizeEnd",
6016
+ "name": "isKnownVendor",
6017
+ "privacy": "private",
5792
6018
  "return": {
5793
6019
  "type": {
5794
- "text": "void"
6020
+ "text": "vendor is AITierVendor"
5795
6021
  }
5796
6022
  },
5797
6023
  "parameters": [
5798
6024
  {
5799
- "name": "e",
6025
+ "name": "vendor",
5800
6026
  "type": {
5801
- "text": "PointerEvent"
6027
+ "text": "string"
5802
6028
  }
5803
6029
  }
5804
6030
  ]
5805
6031
  }
5806
- ],
5807
- "events": [
6032
+ ]
6033
+ },
6034
+ {
6035
+ "kind": "function",
6036
+ "name": "registerTieredAIProviders",
6037
+ "return": {
6038
+ "type": {
6039
+ "text": "TieredAIProviderSwitcher"
6040
+ }
6041
+ },
6042
+ "parameters": [
5808
6043
  {
5809
- "name": "budget-refresh-requested",
6044
+ "name": "container",
5810
6045
  "type": {
5811
- "text": "CustomEvent"
6046
+ "text": "Container"
5812
6047
  }
5813
6048
  },
5814
6049
  {
6050
+ "name": "options",
5815
6051
  "type": {
5816
- "text": "CustomEvent"
6052
+ "text": "Omit<TieredAIProviderSwitcherOptions, 'container'>"
5817
6053
  }
5818
- },
5819
- {
5820
- "description": "Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMouseDownDetail`",
5821
- "name": "chat-header-mousedown"
5822
- },
5823
- {
5824
- "description": "Fired after the session is wiped (the lifecycle menu's Clear). The payload is captured before teardown so the host can clean up any external state the active agent was working on. Bubbles and composed. detail: `SessionClearedDetail`",
5825
- "name": "session-cleared"
5826
- }
5827
- ],
5828
- "attributes": [
5829
- {
5830
- "name": "header-title",
5831
- "type": {
5832
- "text": "string"
5833
- },
5834
- "default": "'Genesis Assistant'",
5835
- "fieldName": "headerTitle"
5836
- },
5837
- {
5838
- "name": "session-key",
5839
- "type": {
5840
- "text": "string | undefined"
5841
- },
5842
- "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.",
5843
- "fieldName": "sessionKey"
5844
- },
5845
- {
5846
- "name": "image-src",
5847
- "type": {
5848
- "text": "string | undefined"
5849
- },
5850
- "fieldName": "imageSrc"
5851
- },
5852
- {
5853
- "name": "user-image-src",
5854
- "type": {
5855
- "text": "string | undefined"
5856
- },
5857
- "fieldName": "userImageSrc"
5858
- },
5859
- {
5860
- "name": "placeholder",
5861
- "type": {
5862
- "text": "string"
5863
- },
5864
- "default": "'Message assistant...'",
5865
- "fieldName": "placeholder"
5866
- },
5867
- {
5868
- "name": "popout-mode",
5869
- "type": {
5870
- "text": "PopoutMode | undefined"
5871
- },
5872
- "description": "Controls the pop-out button shown next to the settings cog.\n\"expand\" — in bubble, expands to layout panel (fires chat-popout).\n\"collapse\" — in layout panel, collapses back to bubble (fires chat-popin).\nAbsent — no button (default standalone behaviour, no breaking change).",
5873
- "fieldName": "popoutMode"
5874
- },
5875
- {
5876
- "name": "debug-redux",
5877
- "type": {
5878
- "text": "boolean"
5879
- },
5880
- "default": "false",
5881
- "description": "When set, enables Redux DevTools for this instance's session store.",
5882
- "fieldName": "debugRedux"
5883
6054
  }
5884
6055
  ],
5885
- "superclass": {
5886
- "name": "GenesisElement",
5887
- "package": "@genesislcap/web-core"
5888
- },
5889
- "tagName": "foundation-ai-assistant",
5890
- "customElement": true
5891
- }
5892
- ],
5893
- "exports": [
5894
- {
5895
- "kind": "js",
5896
- "name": "sparkleIconSvg",
5897
- "declaration": {
5898
- "name": "sparkleIconSvg",
5899
- "module": "src/main/main.ts"
5900
- }
5901
- },
5902
- {
5903
- "kind": "js",
5904
- "name": "userIconSvg",
5905
- "declaration": {
5906
- "name": "userIconSvg",
5907
- "module": "src/main/main.ts"
5908
- }
5909
- },
5910
- {
5911
- "kind": "js",
5912
- "name": "genesisIconSvg",
5913
- "declaration": {
5914
- "name": "genesisIconSvg",
5915
- "module": "src/main/main.ts"
5916
- }
5917
- },
5918
- {
5919
- "kind": "js",
5920
- "name": "budgetPercentOf",
5921
- "declaration": {
5922
- "name": "budgetPercentOf",
5923
- "module": "./budget-controller"
5924
- }
5925
- },
5926
- {
5927
- "kind": "js",
5928
- "name": "formatBlockedReason",
5929
- "declaration": {
5930
- "name": "formatBlockedReason",
5931
- "module": "./budget-controller"
5932
- }
5933
- },
5934
- {
5935
- "kind": "js",
5936
- "name": "FoundationAiAssistant",
5937
- "declaration": {
5938
- "name": "FoundationAiAssistant",
5939
- "module": "src/main/main.ts"
5940
- }
5941
- },
5942
- {
5943
- "kind": "custom-element-definition",
5944
- "name": "foundation-ai-assistant",
5945
- "declaration": {
5946
- "name": "FoundationAiAssistant",
5947
- "module": "src/main/main.ts"
5948
- }
5949
- }
5950
- ]
5951
- },
5952
- {
5953
- "kind": "javascript-module",
5954
- "path": "src/main/main.types.ts",
5955
- "declarations": [
5956
- {
5957
- "kind": "variable",
5958
- "name": "AiAssistantEvent",
5959
- "type": {
5960
- "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}"
5961
- },
5962
- "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}",
5963
- "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."
5964
- },
5965
- {
5966
- "kind": "variable",
5967
- "name": "ANIMATION_DEFS",
5968
- "type": {
5969
- "text": "object"
5970
- },
5971
- "default": "{\n loading: {\n label: 'Dots',\n description: 'Shows pulsing dots while the assistant is generating a response.',\n category: 'Loading style',\n },\n waves: {\n label: 'Waves',\n description:\n 'Shows glowing sine waves inside a circle while the assistant is generating a response.',\n category: 'Loading style',\n },\n flowingWaves: {\n label: 'Flowing waves',\n description:\n 'Shows coloured waves rising and settling from a line while the assistant is generating a response.',\n category: 'Loading style',\n },\n plasma: {\n label: 'Plasma orb',\n description:\n 'Shows a glowing plasma sphere with drifting energy while the assistant is generating a response.',\n category: 'Loading style',\n },\n halo: {\n label: 'Halo',\n description:\n 'Displays a glowing halo around the assistant avatar while a response is streaming.',\n category: 'Effects',\n },\n}",
5972
- "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5973
- },
5974
- {
5975
- "kind": "variable",
5976
- "name": "satisfies",
5977
- "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5978
- },
5979
- {
5980
- "kind": "variable",
5981
- "name": "Record",
5982
- "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
6056
+ "description": "Build a TieredAIProviderSwitcher — which registers the tier-shaped provider\nregistry — and put it on the (AIProviderSwitcher:variable) token. Call once at app\nbootstrap."
5983
6057
  }
5984
6058
  ],
5985
6059
  "exports": [
5986
6060
  {
5987
6061
  "kind": "js",
5988
- "name": "AgentPickerMode",
5989
- "declaration": {
5990
- "name": "AgentPickerMode",
5991
- "package": "@genesislcap/foundation-ai"
5992
- }
5993
- },
5994
- {
5995
- "kind": "js",
5996
- "name": "AiAssistantEvent",
5997
- "declaration": {
5998
- "name": "AiAssistantEvent",
5999
- "module": "src/main/main.types.ts"
6000
- }
6001
- },
6002
- {
6003
- "kind": "js",
6004
- "name": "ANIMATION_DEFS",
6005
- "declaration": {
6006
- "name": "ANIMATION_DEFS",
6007
- "module": "src/main/main.types.ts"
6008
- }
6009
- },
6010
- {
6011
- "kind": "js",
6012
- "name": "satisfies",
6062
+ "name": "TieredAIProviderSwitcher",
6013
6063
  "declaration": {
6014
- "name": "satisfies",
6015
- "module": "src/main/main.types.ts"
6064
+ "name": "TieredAIProviderSwitcher",
6065
+ "module": "src/provider/tiered-provider-switcher.ts"
6016
6066
  }
6017
6067
  },
6018
6068
  {
6019
6069
  "kind": "js",
6020
- "name": "Record",
6021
- "declaration": {
6022
- "name": "Record",
6023
- "module": "src/main/main.types.ts"
6070
+ "name": "registerTieredAIProviders",
6071
+ "declaration": {
6072
+ "name": "registerTieredAIProviders",
6073
+ "module": "src/provider/tiered-provider-switcher.ts"
6024
6074
  }
6025
6075
  }
6026
6076
  ]
6027
6077
  },
6028
- {
6029
- "kind": "javascript-module",
6030
- "path": "src/main/meta-snapshot.ts",
6031
- "declarations": [],
6032
- "exports": []
6033
- },
6034
6078
  {
6035
6079
  "kind": "javascript-module",
6036
6080
  "path": "src/state/ai-assistant-slice.ts",
@@ -6725,6 +6769,15 @@
6725
6769
  "kind": "javascript-module",
6726
6770
  "path": "src/suggestions/chat-suggestions.ts",
6727
6771
  "declarations": [
6772
+ {
6773
+ "kind": "variable",
6774
+ "name": "SUGGESTIONS_EXPORTPARTS",
6775
+ "type": {
6776
+ "text": "string"
6777
+ },
6778
+ "default": "'suggestions-container, suggestion-placeholder, suggestion-pill'",
6779
+ "description": "Every part this component exposes, as an `exportparts` value.\n\n`::part()` crosses exactly one shadow boundary, so a host rendering `<chat-suggestions>` in its\nown shadow root has to forward these for an embedding app to reach them at all."
6780
+ },
6728
6781
  {
6729
6782
  "kind": "class",
6730
6783
  "description": "",
@@ -6794,6 +6847,14 @@
6794
6847
  }
6795
6848
  ],
6796
6849
  "exports": [
6850
+ {
6851
+ "kind": "js",
6852
+ "name": "SUGGESTIONS_EXPORTPARTS",
6853
+ "declaration": {
6854
+ "name": "SUGGESTIONS_EXPORTPARTS",
6855
+ "module": "src/suggestions/chat-suggestions.ts"
6856
+ }
6857
+ },
6797
6858
  {
6798
6859
  "kind": "js",
6799
6860
  "name": "ChatSuggestions",
@@ -7101,6 +7162,114 @@
7101
7162
  "default": "'condensed'",
7102
7163
  "description": "Key the collapsed args are stored under — a tool-call's args must stay a Record."
7103
7164
  },
7165
+ {
7166
+ "kind": "function",
7167
+ "name": "isValidCondenseTrigger",
7168
+ "return": {
7169
+ "type": {
7170
+ "text": "boolean"
7171
+ }
7172
+ },
7173
+ "parameters": [
7174
+ {
7175
+ "name": "t",
7176
+ "type": {
7177
+ "text": "CondenseTrigger | undefined"
7178
+ }
7179
+ }
7180
+ ],
7181
+ "description": "Whether `t` is a well-formed trigger — the same rule `condenseWhen` enforces on registration."
7182
+ },
7183
+ {
7184
+ "kind": "function",
7185
+ "name": "toolCallIdsIn",
7186
+ "return": {
7187
+ "type": {
7188
+ "text": "Set<string>"
7189
+ }
7190
+ },
7191
+ "parameters": [
7192
+ {
7193
+ "name": "history",
7194
+ "type": {
7195
+ "text": "readonly ChatMessage[]"
7196
+ }
7197
+ }
7198
+ ],
7199
+ "description": "Every tool-call id carried by an assistant message in `history`. Exported so the save side\n(snapshotCondensePolicies) and the restore side (`ChatDriver.restoreCondensePolicies`)\ncompute \"is this call still present?\" from one definition — GENC-1632 review: the two had drifted\ninto separate copies of the same loop."
7200
+ },
7201
+ {
7202
+ "kind": "function",
7203
+ "name": "snapshotCondensePolicies",
7204
+ "return": {
7205
+ "type": {
7206
+ "text": "PersistedCondensePolicy[]"
7207
+ }
7208
+ },
7209
+ "parameters": [
7210
+ {
7211
+ "name": "policies",
7212
+ "type": {
7213
+ "text": "ReadonlyMap<string, RegisteredCondensePolicy>"
7214
+ }
7215
+ },
7216
+ {
7217
+ "name": "clocks",
7218
+ "type": {
7219
+ "text": "CondenseClocks"
7220
+ }
7221
+ },
7222
+ {
7223
+ "name": "history",
7224
+ "type": {
7225
+ "text": "readonly ChatMessage[]"
7226
+ }
7227
+ }
7228
+ ],
7229
+ "description": "The entries to PERSIST alongside `history` (GENC-1632): every registered policy that has not\nfired yet and whose tool call is still in the transcript being saved, re-expressed as elapsed\nclock counts (see PersistedCondensePolicy).\n\n`history` is the transcript actually being written, not the driver's live one, because the two\ncan differ: a non-resumable save freezes at the last user message, and a compaction may have\nsummarised a call away. An entry whose call is not in the saved transcript has nothing to\ncollapse after a reload, so it is not written.\n\nPure, no writes to the registry — safe on a save path that runs on every autosave."
7230
+ },
7231
+ {
7232
+ "kind": "function",
7233
+ "name": "parsePersistedCondensePolicy",
7234
+ "return": {
7235
+ "type": {
7236
+ "text": "PersistedCondensePolicy | undefined"
7237
+ }
7238
+ },
7239
+ "parameters": [
7240
+ {
7241
+ "name": "value",
7242
+ "type": {
7243
+ "text": "unknown"
7244
+ }
7245
+ }
7246
+ ],
7247
+ "description": "Validate one persisted entry read back from storage. Returns `undefined` for anything that is not\na well-formed PersistedCondensePolicy — the blob came off a disk or a network, and a\npolicy that cannot be evaluated must be dropped rather than reach `applyCondensation`, which\ntrusts its registry. A missing or malformed `elapsed` count reads as `0` (the boundary had not\npassed), which errs towards keeping a payload visible rather than eliding it."
7248
+ },
7249
+ {
7250
+ "kind": "function",
7251
+ "name": "rebaseRestoredCondensePolicy",
7252
+ "return": {
7253
+ "type": {
7254
+ "text": "RegisteredCondensePolicy"
7255
+ }
7256
+ },
7257
+ "parameters": [
7258
+ {
7259
+ "name": "entry",
7260
+ "type": {
7261
+ "text": "PersistedCondensePolicy"
7262
+ }
7263
+ },
7264
+ {
7265
+ "name": "clocks",
7266
+ "type": {
7267
+ "text": "CondenseClocks"
7268
+ }
7269
+ }
7270
+ ],
7271
+ "description": "Re-register a persisted entry against a (typically fresh) driver's clocks (GENC-1632): each\nstamp is the current clock minus the elapsed count, so every trigger stands exactly as far from\nfiring as it did when the session was saved.\n\nPer clock, what that means after a reload:\n- `age` — exact. The model-call distance is preserved, so a result seen twice of its three\n allowed looks gets one more. The rebased `iteration` is usually negative (the call predates\n this driver's first model call), which the trigger arithmetic is indifferent to; it does\n surface as a negative `turn` on the eventual `context.condensed` event.\n- `turnEnd` — a call from the turn that was running at save time collapses on the next\n `sendMessage`. That is the original intent, not an approximation: a reload ends the turn.\n- `phaseEnd` — collapses at the next `endPhase()`, or at once if the phase had already ended.\n- `agentEnd` (and `phaseEnd`'s backstop) — an entry whose activation had already ended collapses\n at once. One owned by the activation live at save time is stamped with the CURRENT\n activation, which reads as live; but the driver will very likely advance its activation clock\n when the agent is re-installed after the reload, so this stamp is provisional and the driver\n must re-stamp it at that point — see `ChatDriver.installAgent`. Leaving it here would collapse\n the payload the moment the flow resumes, which is the failure this whole mechanism exists to\n avoid.\n\nThe `reported*` latches start clear, so the eventual full→stub transition reports once, like any\nother entry. The stored transcript cannot hold a stub for an unfired entry, so there is no\nearlier report to duplicate."
7272
+ },
7104
7273
  {
7105
7274
  "kind": "function",
7106
7275
  "name": "applyCondensation",
@@ -7183,6 +7352,46 @@
7183
7352
  "module": "src/utils/condense-history.ts"
7184
7353
  }
7185
7354
  },
7355
+ {
7356
+ "kind": "js",
7357
+ "name": "isValidCondenseTrigger",
7358
+ "declaration": {
7359
+ "name": "isValidCondenseTrigger",
7360
+ "module": "src/utils/condense-history.ts"
7361
+ }
7362
+ },
7363
+ {
7364
+ "kind": "js",
7365
+ "name": "toolCallIdsIn",
7366
+ "declaration": {
7367
+ "name": "toolCallIdsIn",
7368
+ "module": "src/utils/condense-history.ts"
7369
+ }
7370
+ },
7371
+ {
7372
+ "kind": "js",
7373
+ "name": "snapshotCondensePolicies",
7374
+ "declaration": {
7375
+ "name": "snapshotCondensePolicies",
7376
+ "module": "src/utils/condense-history.ts"
7377
+ }
7378
+ },
7379
+ {
7380
+ "kind": "js",
7381
+ "name": "parsePersistedCondensePolicy",
7382
+ "declaration": {
7383
+ "name": "parsePersistedCondensePolicy",
7384
+ "module": "src/utils/condense-history.ts"
7385
+ }
7386
+ },
7387
+ {
7388
+ "kind": "js",
7389
+ "name": "rebaseRestoredCondensePolicy",
7390
+ "declaration": {
7391
+ "name": "rebaseRestoredCondensePolicy",
7392
+ "module": "src/utils/condense-history.ts"
7393
+ }
7394
+ },
7186
7395
  {
7187
7396
  "kind": "js",
7188
7397
  "name": "applyCondensation",
@@ -10581,7 +10790,15 @@
10581
10790
  "privacy": "private",
10582
10791
  "readonly": true,
10583
10792
  "default": "new Map<string, RegisteredCondensePolicy>()",
10584
- "description": "Tool-declared condensation policies, keyed by tool-call id. Populated by\n`condenseWhen` (first-wins per call); read by `applyCondensation` before each\nprovider call to collapse stale payloads from the model-bound history only.\nAccumulates across agents on a shared driver (a superseded read collapses no\nmatter which agent made it) and is never cleared — it dies with the driver."
10793
+ "description": "Tool-declared condensation policies, keyed by tool-call id. Populated by\n`condenseWhen` (first-wins per call); read by `applyCondensation` before each\nprovider call to collapse stale payloads from the model-bound history only.\nAccumulates across agents on a shared driver (a superseded read collapses no\nmatter which agent made it) and is never cleared — it dies with the driver.\n\n\"Dies with the driver\" used to mean a page reload silently disarmed every policy that had\nnot fired yet: the restored transcript carried the full payload and nothing was left to\ncollapse it, so it rode every later provider call (GENC-1632). The unfired entries are now\npersisted with the session and re-registered on restore — see\nChatDriver.getCondensePoliciesForPersistence and\nChatDriver.restoreCondensePolicies."
10794
+ },
10795
+ {
10796
+ "kind": "field",
10797
+ "name": "condenseAwaitingReactivation",
10798
+ "privacy": "private",
10799
+ "readonly": true,
10800
+ "default": "new Set<string>()",
10801
+ "description": "Restored policies whose owning activation was still live at save time, waiting for that agent\nto be re-installed so they can be stamped with the activation it resumes in (GENC-1632).\n\nThey cannot be stamped at restore time. On a fresh page `activeAgentName` is unset, so the\nfirst `installAgent` after the reload is a \"name change\" and advances `currentActivation` —\nwhich is exactly the `agentEnd` signal. An entry stamped before that bump reads as belonging\nto an activation that has ended, and it and every `phaseEnd` entry (through the `agentEnd`\nbackstop) collapse on the first provider call after the reload, mid-flow. For Create's\nPlanning phase that is the uploaded scope document vanishing the moment the user carries on\ntalking about it — a worse failure than the one being fixed. So the stamp is deferred to that\n`installAgent`, and consumed there once whichever agent it installs."
10585
10802
  },
10586
10803
  {
10587
10804
  "kind": "field",
@@ -11620,6 +11837,72 @@
11620
11837
  },
11621
11838
  "description": "The transcript as it should be **stored**: every tool payload the model has already stopped\nseeing replaced by the same stub it was sent (GENC-1566). Live history is untouched — this\nreturns a copy.\n\nCondensation deliberately spares stored history, because the live transcript and the debug\nexport both read it. A host writing that transcript to durable storage inherits the other\nhalf of that decision: it stores payloads the driver has already retired, on every autosave,\nfor the life of the session. Measured on one small Create session — 58,187 chars, 7.4% of a\n790 KB session object, across five payloads worth 14,434 tokens of context, written 86 times.\n\nOnly already-collapsed payloads are touched, so this can never store a stub for something the\nmodel can still see, and it has no side effects (see `condenseForPersistence`, which is\ninternal). A host that wants the unredacted transcript still calls\nChatDriver.getRawHistory, and a diagnostics stream that keeps full payloads is\nunaffected — which is what makes the elision recoverable."
11622
11839
  },
11840
+ {
11841
+ "kind": "method",
11842
+ "name": "condenseClocks",
11843
+ "privacy": "private",
11844
+ "return": {
11845
+ "type": {
11846
+ "text": "CondenseClocks"
11847
+ }
11848
+ },
11849
+ "description": "The four condensation clocks as they read now."
11850
+ },
11851
+ {
11852
+ "kind": "method",
11853
+ "name": "getCondensePoliciesForPersistence",
11854
+ "return": {
11855
+ "type": {
11856
+ "text": "PersistedCondensePolicy[]"
11857
+ }
11858
+ },
11859
+ "parameters": [
11860
+ {
11861
+ "name": "messages",
11862
+ "type": {
11863
+ "text": "readonly ChatMessage[]"
11864
+ }
11865
+ }
11866
+ ],
11867
+ "description": "The `condenseWhen` policies that have not fired yet, for the calls in `messages`, in the\nclock-independent form ChatDriver.restoreCondensePolicies re-registers. See\nAiDriver.getCondensePoliciesForPersistence.\n\nThe other half of ChatDriver.getHistoryForPersistence (GENC-1632). That stores the\npayloads the model has already stopped seeing as their stubs; this stores the policies for the\nones it has NOT stopped seeing yet, so a reload does not strand them at full size for the rest\nof the session. Only entries whose call is in `messages` — the transcript actually being\nwritten — are returned, so a frozen (non-resumable) or compacted save carries no policy for a\ncall it does not contain."
11868
+ },
11869
+ {
11870
+ "kind": "method",
11871
+ "name": "restoreCondensePolicies",
11872
+ "return": {
11873
+ "type": {
11874
+ "text": "{\n restored: number;\n awaitingReactivation: number;\n }"
11875
+ }
11876
+ },
11877
+ "parameters": [
11878
+ {
11879
+ "name": "entries",
11880
+ "type": {
11881
+ "text": "readonly unknown[] | undefined"
11882
+ }
11883
+ }
11884
+ ],
11885
+ "description": "Re-register policies saved by ChatDriver.getCondensePoliciesForPersistence against\nthe restored transcript. See AiDriver.restoreCondensePolicies.\n\nCall AFTER ChatDriver.loadHistory has seeded the restored transcript: an entry is\nre-registered only if its tool call is in the driver's history, so one whose call the\nrestorable-boundary trim cut away (an orphaned trailing `tool_use`) is dropped rather than\nresurrected against nothing.\n\nFirst-wins still holds per call: an entry is skipped if a policy is already registered for its\ntool call — a restore never overrides what a live handler declared. `superseded` needs no\nspecial handling — survivors are resolved from HISTORY order on every pass, so a restored entry\nand a later call on the same `by` key resolve exactly as two live ones would.\n\nClocks are rebased so each trigger is exactly as far from firing as it was at save time (see\n`rebaseRestoredCondensePolicy`), with one deferral. An entry owned by the activation that was\nlive at save time, whose agent is not the one installed right now — the normal case on a\nfresh page, where nothing is installed yet — is parked in\n`condenseAwaitingReactivation` and stamped by the next `installAgent`: with\nthat agent's resumed activation if it is the same agent, or left behind (so it reads as\nended, which it has) if a different agent took over.\n\nA host with no agent to re-activate (a bare driver built from a static config) loses nothing\nby this: the entry's owner (`undefined`) matches the installed agent (`undefined`), so it is\nstamped live straight away and ends when the driver's single activation does — on\n`releaseAgent` / `completeSubAgent`, exactly as a policy registered live would.\n\nReturns how many entries were actually re-armed, split from how many were merely present in\n`entries` (review follow-up, GENC-1632): a malformed entry, one whose call the restorable-\nboundary trim removed, or a first-wins duplicate is silently dropped, so the caller's own count\nof `entries` can't tell \"all of them came back\" from \"none did\". `restored` is every entry that\nreached `condensePolicies`; `awaitingReactivation` is the subset of those parked pending the\nnext `installAgent` rather than stamped live immediately."
11886
+ },
11887
+ {
11888
+ "kind": "method",
11889
+ "name": "resumeRestoredCondensePolicies",
11890
+ "privacy": "private",
11891
+ "return": {
11892
+ "type": {
11893
+ "text": "void"
11894
+ }
11895
+ },
11896
+ "parameters": [
11897
+ {
11898
+ "name": "agentName",
11899
+ "type": {
11900
+ "text": "string"
11901
+ }
11902
+ }
11903
+ ],
11904
+ "description": "Stamp the restored entries parked in `condenseAwaitingReactivation` now that\n`installAgent` has advanced the activation clock for `agentName` (GENC-1632).\n\nSame agent → the flow the entry belonged to is resuming, so it takes the new activation and\nstays full until THAT activation ends (and, for `phaseEnd`, until the next `endPhase()`).\nDifferent agent → its owner did not come back; its activation is over, so it keeps the stamp\nit was restored with, which is now behind the clock, and collapses on the next provider call\nexactly as a live `agentEnd` payload does on a swap.\n\nOne-shot: the set is emptied whatever the outcome, because only the FIRST activation after the\nrestore can be the resumption. Any later swap is an ordinary activation boundary."
11905
+ },
11623
11906
  {
11624
11907
  "kind": "method",
11625
11908
  "name": "getSuggestions",
@@ -13097,6 +13380,14 @@
13097
13380
  "kind": "javascript-module",
13098
13381
  "path": "src/components/chat-markdown/chat-markdown.ts",
13099
13382
  "declarations": [
13383
+ {
13384
+ "kind": "variable",
13385
+ "name": "MARKDOWN_EXPORTPARTS",
13386
+ "type": {
13387
+ "text": "string"
13388
+ },
13389
+ "description": "Every part this component exposes, as an `exportparts` value.\n\n`::part()` crosses exactly one shadow boundary, so a host that renders `<ai-chat-markdown>` in\nits own shadow root has to forward these for an app to reach them at all. Built from the map\nabove rather than written out, so the forwarded list cannot drift from what is emitted."
13390
+ },
13100
13391
  {
13101
13392
  "kind": "class",
13102
13393
  "description": "",
@@ -13110,6 +13401,25 @@
13110
13401
  },
13111
13402
  "default": "''",
13112
13403
  "description": "The markdown string to render."
13404
+ },
13405
+ {
13406
+ "kind": "method",
13407
+ "name": "annotateParts",
13408
+ "privacy": "private",
13409
+ "return": {
13410
+ "type": {
13411
+ "text": "string"
13412
+ }
13413
+ },
13414
+ "parameters": [
13415
+ {
13416
+ "name": "fragment",
13417
+ "type": {
13418
+ "text": "DocumentFragment"
13419
+ }
13420
+ }
13421
+ ],
13422
+ "description": "Tag the generated elements with shadow parts so an embedding app can style them.\n\nTakes the tree DOMPurify built rather than re-parsing its serialised output: `content` changes\non every streamed chunk, so a second parse/serialise round trip would run per chunk over the\nwhole message, and the string the browser finally parses is then serialised straight from the\ntree DOMPurify checked. Parse/serialise mismatches are where mXSS bypasses have historically\nlived, and this walk has no need to introduce one.\n\nOnly ever *adds* attributes, to DOM that has already been cleared - so it is not itself\nsanitiser surface.\n\nLists additionally carry a level: a top-level list is `md-ul md-ul-level-1`, a list nested\ninside it is `md-ul-level-2`, and an `li` takes the level of the list holding it. Levels are\nclamped at `MAX_LIST_LEVEL`, so a list deeper than that answers to the deepest level\nrather than to a name no host forwards. Chat markdown rarely nests, so this is a safety valve\nrather than a feature - without it, every list at every depth would answer to one selector and\nthere would be no way to tell them apart afterwards. Depth comes from walking the tree rather\nthan from marked's renderers, which are invoked innermost-first and so cannot count downwards."
13113
13423
  }
13114
13424
  ],
13115
13425
  "superclass": {
@@ -13121,6 +13431,14 @@
13121
13431
  }
13122
13432
  ],
13123
13433
  "exports": [
13434
+ {
13435
+ "kind": "js",
13436
+ "name": "MARKDOWN_EXPORTPARTS",
13437
+ "declaration": {
13438
+ "name": "MARKDOWN_EXPORTPARTS",
13439
+ "module": "src/components/chat-markdown/chat-markdown.ts"
13440
+ }
13441
+ },
13124
13442
  {
13125
13443
  "kind": "js",
13126
13444
  "name": "AiChatMarkdown",
@@ -13475,6 +13793,42 @@
13475
13793
  },
13476
13794
  "description": "Delegates to the inner ChatDriver — condensation policies are registered there, so it\nis the only object that knows which payloads the model has stopped seeing (GENC-1566).\n\n**This forward is the whole feature, for any multi-agent host.** `AiDriver` declares\n`getHistoryForPersistence` optional, and `SessionPersister` calls it through `?.`, falling back\nto OrchestratingDriver.getRawHistory. This class does NOT extend `ChatDriver` — it\nwraps one — so without an explicit forward the optional call resolves to `undefined` and every\nhost on an orchestrating driver silently keeps persisting the full payloads. Measured exactly\nthat way on a Create run: 10 `context.condensed` events fired, and the session still stored\nthe two largest `read_context` results at 26,907 and 23,060 chars. The method existed, the\ntests passed, and the feature did nothing."
13477
13795
  },
13796
+ {
13797
+ "kind": "method",
13798
+ "name": "getCondensePoliciesForPersistence",
13799
+ "return": {
13800
+ "type": {
13801
+ "text": "PersistedCondensePolicy[]"
13802
+ }
13803
+ },
13804
+ "parameters": [
13805
+ {
13806
+ "name": "messages",
13807
+ "type": {
13808
+ "text": "readonly ChatMessage[]"
13809
+ }
13810
+ }
13811
+ ],
13812
+ "description": "Delegates to the inner ChatDriver, which owns the condensation registry and clocks\n(GENC-1632). The forward matters for the same reason as `getHistoryForPersistence` above: the\npersister reaches it through `?.`, so a missing forward would compile, pass the ChatDriver\ntests, and do nothing for every orchestrated host — which is every host with an agents array."
13813
+ },
13814
+ {
13815
+ "kind": "method",
13816
+ "name": "restoreCondensePolicies",
13817
+ "return": {
13818
+ "type": {
13819
+ "text": "{\n restored: number;\n awaitingReactivation: number;\n }"
13820
+ }
13821
+ },
13822
+ "parameters": [
13823
+ {
13824
+ "name": "entries",
13825
+ "type": {
13826
+ "text": "readonly unknown[] | undefined"
13827
+ }
13828
+ }
13829
+ ],
13830
+ "description": "Delegates to the inner ChatDriver (GENC-1632). The deferred activation stamp it\nperforms is taken by the inner driver's `installAgent`, which this driver's own\n`installAgent` always reaches, so nothing extra is needed here."
13831
+ },
13478
13832
  {
13479
13833
  "kind": "method",
13480
13834
  "name": "setContextGuard",
@@ -14564,6 +14918,14 @@
14564
14918
  "module": "./session-snapshot"
14565
14919
  }
14566
14920
  },
14921
+ {
14922
+ "kind": "js",
14923
+ "name": "PersistedCondensePolicy",
14924
+ "declaration": {
14925
+ "name": "PersistedCondensePolicy",
14926
+ "module": "../../utils/condense-history"
14927
+ }
14928
+ },
14567
14929
  {
14568
14930
  "kind": "js",
14569
14931
  "name": "WebStorageSessionProvider",