@genesislcap/ai-assistant 15.35.1 → 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 +568 -206
  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",
@@ -2244,6 +2083,211 @@
2244
2083
  }
2245
2084
  ]
2246
2085
  },
2086
+ {
2087
+ "kind": "javascript-module",
2088
+ "path": "src/config/config.ts",
2089
+ "declarations": [
2090
+ {
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```"
2094
+ }
2095
+ ],
2096
+ "exports": [
2097
+ {
2098
+ "kind": "js",
2099
+ "name": "CachePolicy",
2100
+ "declaration": {
2101
+ "name": "CachePolicy",
2102
+ "module": "src/config/config.ts"
2103
+ }
2104
+ },
2105
+ {
2106
+ "kind": "js",
2107
+ "name": "ChatFallback",
2108
+ "declaration": {
2109
+ "name": "ChatFallback",
2110
+ "module": "src/config/config.ts"
2111
+ }
2112
+ },
2113
+ {
2114
+ "kind": "js",
2115
+ "name": "ChatInputDuringExecutionMode",
2116
+ "declaration": {
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"
2143
+ }
2144
+ }
2145
+ ]
2146
+ },
2147
+ {
2148
+ "kind": "javascript-module",
2149
+ "path": "src/config/define-stateful-agent.ts",
2150
+ "declarations": [
2151
+ {
2152
+ "kind": "function",
2153
+ "name": "restoreMachine",
2154
+ "return": {
2155
+ "type": {
2156
+ "text": "void"
2157
+ }
2158
+ },
2159
+ "parameters": [
2160
+ {
2161
+ "name": "machine",
2162
+ "type": {
2163
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
2164
+ },
2165
+ "description": "the machine to restore (already constructed/started)."
2166
+ },
2167
+ {
2168
+ "name": "restored",
2169
+ "type": {
2170
+ "text": "unknown"
2171
+ },
2172
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
2173
+ },
2174
+ {
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."
2178
+ }
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."
2181
+ },
2182
+ {
2183
+ "kind": "function",
2184
+ "name": "defineStatefulAgent",
2185
+ "return": {
2186
+ "type": {
2187
+ "text": "AgentConfig"
2188
+ }
2189
+ },
2190
+ "parameters": [
2191
+ {
2192
+ "name": "opts",
2193
+ "type": {
2194
+ "text": "StatefulAgentInit<S>"
2195
+ }
2196
+ }
2197
+ ],
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."
2199
+ }
2200
+ ],
2201
+ "exports": [
2202
+ {
2203
+ "kind": "js",
2204
+ "name": "restoreMachine",
2205
+ "declaration": {
2206
+ "name": "restoreMachine",
2207
+ "module": "src/config/define-stateful-agent.ts"
2208
+ }
2209
+ },
2210
+ {
2211
+ "kind": "js",
2212
+ "name": "defineStatefulAgent",
2213
+ "declaration": {
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"
2281
+ }
2282
+ }
2283
+ ]
2284
+ },
2285
+ {
2286
+ "kind": "javascript-module",
2287
+ "path": "src/config/validate-providers.ts",
2288
+ "declarations": [],
2289
+ "exports": []
2290
+ },
2247
2291
  {
2248
2292
  "kind": "javascript-module",
2249
2293
  "path": "src/main/attachment-controller.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",