@genesislcap/ai-assistant 15.35.1-GH-2547.1 → 15.35.3

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 (2) hide show
  1. package/dist/custom-elements.json +836 -836
  2. package/package.json +18 -18
@@ -1590,6 +1590,211 @@
1590
1590
  }
1591
1591
  ]
1592
1592
  },
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
+ },
1593
1798
  {
1594
1799
  "kind": "javascript-module",
1595
1800
  "path": "src/genesis/config.ts",
@@ -2041,209 +2246,268 @@
2041
2246
  },
2042
2247
  {
2043
2248
  "kind": "javascript-module",
2044
- "path": "src/config/config.ts",
2249
+ "path": "src/provider/ai-provider-switcher.ts",
2045
2250
  "declarations": [
2046
2251
  {
2047
- "kind": "function",
2048
- "name": "defineAgent",
2049
- "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```"
2252
+ "kind": "variable",
2253
+ "name": "AIProviderSwitcher",
2254
+ "description": "The DI token for the (AIProviderSwitcher:interface). Resolves a noop until the app\nregisters one."
2050
2255
  }
2051
2256
  ],
2052
2257
  "exports": [
2053
2258
  {
2054
2259
  "kind": "js",
2055
- "name": "CachePolicy",
2260
+ "name": "AIProviderSwitcher",
2056
2261
  "declaration": {
2057
- "name": "CachePolicy",
2058
- "module": "src/config/config.ts"
2262
+ "name": "AIProviderSwitcher",
2263
+ "module": "src/provider/ai-provider-switcher.ts"
2059
2264
  }
2060
- },
2265
+ }
2266
+ ]
2267
+ },
2268
+ {
2269
+ "kind": "javascript-module",
2270
+ "path": "src/provider/assistant-app-settings.ts",
2271
+ "declarations": [
2061
2272
  {
2062
- "kind": "js",
2063
- "name": "ChatFallback",
2064
- "declaration": {
2065
- "name": "ChatFallback",
2066
- "module": "src/config/config.ts"
2067
- }
2068
- },
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": [
2069
2279
  {
2070
2280
  "kind": "js",
2071
- "name": "ChatInputDuringExecutionMode",
2281
+ "name": "AssistantAppSettingsProvider",
2072
2282
  "declaration": {
2073
- "name": "ChatInputDuringExecutionMode",
2074
- "module": "src/config/config.ts"
2283
+ "name": "AssistantAppSettingsProvider",
2284
+ "module": "src/provider/assistant-app-settings.ts"
2075
2285
  }
2076
- },
2286
+ }
2287
+ ]
2288
+ },
2289
+ {
2290
+ "kind": "javascript-module",
2291
+ "path": "src/provider/tiered-provider-switcher.ts",
2292
+ "declarations": [
2077
2293
  {
2078
- "kind": "js",
2079
- "name": "ChatThinkingPolicy",
2080
- "declaration": {
2081
- "name": "ChatThinkingPolicy",
2082
- "module": "src/config/config.ts"
2083
- }
2084
- },
2085
- {
2086
- "kind": "js",
2087
- "name": "ChatToolChoice",
2088
- "declaration": {
2089
- "name": "ChatToolChoice",
2090
- "module": "src/config/config.ts"
2091
- }
2092
- },
2093
- {
2094
- "kind": "js",
2095
- "name": "defineAgent",
2096
- "declaration": {
2097
- "name": "defineAgent",
2098
- "module": "src/config/config.ts"
2099
- }
2100
- }
2101
- ]
2102
- },
2103
- {
2104
- "kind": "javascript-module",
2105
- "path": "src/config/define-stateful-agent.ts",
2106
- "declarations": [
2107
- {
2108
- "kind": "function",
2109
- "name": "restoreMachine",
2110
- "return": {
2111
- "type": {
2112
- "text": "void"
2113
- }
2114
- },
2115
- "parameters": [
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": [
2116
2298
  {
2117
- "name": "machine",
2299
+ "kind": "field",
2300
+ "name": "vendors",
2118
2301
  "type": {
2119
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
2302
+ "text": "readonly AITierVendor[]"
2120
2303
  },
2121
- "description": "the machine to restore (already constructed/started)."
2304
+ "readonly": true
2122
2305
  },
2123
2306
  {
2124
- "name": "restored",
2307
+ "kind": "field",
2308
+ "name": "options",
2125
2309
  "type": {
2126
- "text": "unknown"
2310
+ "text": "TieredAIProviderSwitcherOptions"
2127
2311
  },
2128
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
2312
+ "privacy": "private",
2313
+ "readonly": true,
2314
+ "default": "options"
2129
2315
  },
2130
2316
  {
2131
- "name": "key",
2132
- "default": "'machine'",
2133
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
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
+ },
2341
+ {
2342
+ "kind": "field",
2343
+ "name": "_vendor",
2344
+ "type": {
2345
+ "text": "AITierVendor"
2346
+ },
2347
+ "privacy": "private"
2348
+ },
2349
+ {
2350
+ "kind": "field",
2351
+ "name": "vendor",
2352
+ "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
+ }
2437
+ },
2438
+ "parameters": [
2439
+ {
2440
+ "name": "vendor",
2441
+ "type": {
2442
+ "text": "AITierVendor"
2443
+ }
2444
+ }
2445
+ ]
2446
+ },
2447
+ {
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
+ ]
2134
2464
  }
2135
- ],
2136
- "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."
2465
+ ]
2137
2466
  },
2138
2467
  {
2139
2468
  "kind": "function",
2140
- "name": "defineStatefulAgent",
2469
+ "name": "registerTieredAIProviders",
2141
2470
  "return": {
2142
2471
  "type": {
2143
- "text": "AgentConfig"
2472
+ "text": "TieredAIProviderSwitcher"
2144
2473
  }
2145
2474
  },
2146
2475
  "parameters": [
2147
2476
  {
2148
- "name": "opts",
2477
+ "name": "container",
2149
2478
  "type": {
2150
- "text": "StatefulAgentInit<S>"
2479
+ "text": "Container"
2480
+ }
2481
+ },
2482
+ {
2483
+ "name": "options",
2484
+ "type": {
2485
+ "text": "Omit<TieredAIProviderSwitcherOptions, 'container'>"
2151
2486
  }
2152
2487
  }
2153
2488
  ],
2154
- "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."
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."
2155
2490
  }
2156
2491
  ],
2157
2492
  "exports": [
2158
2493
  {
2159
2494
  "kind": "js",
2160
- "name": "restoreMachine",
2495
+ "name": "TieredAIProviderSwitcher",
2161
2496
  "declaration": {
2162
- "name": "restoreMachine",
2163
- "module": "src/config/define-stateful-agent.ts"
2497
+ "name": "TieredAIProviderSwitcher",
2498
+ "module": "src/provider/tiered-provider-switcher.ts"
2164
2499
  }
2165
2500
  },
2166
2501
  {
2167
2502
  "kind": "js",
2168
- "name": "defineStatefulAgent",
2503
+ "name": "registerTieredAIProviders",
2169
2504
  "declaration": {
2170
- "name": "defineStatefulAgent",
2171
- "module": "src/config/define-stateful-agent.ts"
2505
+ "name": "registerTieredAIProviders",
2506
+ "module": "src/provider/tiered-provider-switcher.ts"
2172
2507
  }
2173
2508
  }
2174
2509
  ]
2175
2510
  },
2176
- {
2177
- "kind": "javascript-module",
2178
- "path": "src/config/fallback-agents.ts",
2179
- "declarations": [
2180
- {
2181
- "kind": "variable",
2182
- "name": "friendlyFallbackAgent",
2183
- "type": {
2184
- "text": "FallbackAgentConfig"
2185
- },
2186
- "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}",
2187
- "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."
2188
- },
2189
- {
2190
- "kind": "variable",
2191
- "name": "strictFallbackAgent",
2192
- "type": {
2193
- "text": "FallbackAgentConfig"
2194
- },
2195
- "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}",
2196
- "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."
2197
- }
2198
- ],
2199
- "exports": [
2200
- {
2201
- "kind": "js",
2202
- "name": "friendlyFallbackAgent",
2203
- "declaration": {
2204
- "name": "friendlyFallbackAgent",
2205
- "module": "src/config/fallback-agents.ts"
2206
- }
2207
- },
2208
- {
2209
- "kind": "js",
2210
- "name": "strictFallbackAgent",
2211
- "declaration": {
2212
- "name": "strictFallbackAgent",
2213
- "module": "src/config/fallback-agents.ts"
2214
- }
2215
- }
2216
- ]
2217
- },
2218
- {
2219
- "kind": "javascript-module",
2220
- "path": "src/config/index.ts",
2221
- "declarations": [],
2222
- "exports": [
2223
- {
2224
- "kind": "js",
2225
- "name": "*",
2226
- "declaration": {
2227
- "name": "*",
2228
- "package": "./config"
2229
- }
2230
- },
2231
- {
2232
- "kind": "js",
2233
- "name": "*",
2234
- "declaration": {
2235
- "name": "*",
2236
- "package": "./fallback-agents"
2237
- }
2238
- }
2239
- ]
2240
- },
2241
- {
2242
- "kind": "javascript-module",
2243
- "path": "src/config/validate-providers.ts",
2244
- "declarations": [],
2245
- "exports": []
2246
- },
2247
2511
  {
2248
2512
  "kind": "javascript-module",
2249
2513
  "path": "src/main/attachment-controller.ts",
@@ -5222,664 +5486,110 @@
5222
5486
  "type": {
5223
5487
  "text": "string"
5224
5488
  },
5225
- "description": "must match the id the failure was reported under."
5226
- }
5227
- ],
5228
- "description": "Withdraw one reporter's warning — its save landed, or the host's own store recovered.\n\nOnly `source`'s entry is removed, so a session recovery cannot cancel a host's still-live\nproject failure (GENC-1511, caught in review; see `brokenSources`). The modal closes\nonly once nothing is broken; while anything remains, the copy falls back to the newest\nsurvivor."
5229
- },
5230
- {
5231
- "kind": "method",
5232
- "name": "syncPersistenceBrokenCopy",
5233
- "privacy": "private",
5234
- "return": {
5235
- "type": {
5236
- "text": "void"
5237
- }
5238
- },
5239
- "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."
5240
- },
5241
- {
5242
- "kind": "method",
5243
- "name": "onPersistenceBroken",
5244
- "privacy": "private",
5245
- "return": {
5246
- "type": {
5247
- "text": "void"
5248
- }
5249
- },
5250
- "parameters": [
5251
- {
5252
- "name": "d",
5253
- "type": {
5254
- "text": "{\n unsavedMessages: number;\n lastSavedAt?: string;\n reason: string;\n }"
5255
- }
5256
- }
5257
- ],
5258
- "description": "This element's own persister said the session snapshot is not landing (GENC-1511)."
5259
- },
5260
- {
5261
- "kind": "method",
5262
- "name": "onPersistenceRecovered",
5263
- "privacy": "private",
5264
- "return": {
5265
- "type": {
5266
- "text": "void"
5267
- }
5268
- },
5269
- "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."
5270
- },
5271
- {
5272
- "kind": "method",
5273
- "name": "reloadForPersistence",
5274
- "return": {
5275
- "type": {
5276
- "text": "void"
5277
- }
5278
- },
5279
- "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."
5280
- },
5281
- {
5282
- "kind": "method",
5283
- "name": "initPersistenceForNewStore",
5284
- "privacy": "private",
5285
- "return": {
5286
- "type": {
5287
- "text": "Promise<void>"
5288
- }
5289
- },
5290
- "parameters": [
5291
- {
5292
- "name": "key",
5293
- "type": {
5294
- "text": "string"
5295
- }
5296
- }
5297
- ],
5298
- "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."
5299
- },
5300
- {
5301
- "kind": "method",
5302
- "name": "triggerFileInput",
5303
- "return": {
5304
- "type": {
5305
- "text": "void"
5306
- }
5307
- }
5308
- },
5309
- {
5310
- "kind": "method",
5311
- "name": "handleFileSelect",
5312
- "return": {
5313
- "type": {
5314
- "text": "void"
5315
- }
5316
- },
5317
- "parameters": [
5318
- {
5319
- "name": "e",
5320
- "type": {
5321
- "text": "Event"
5322
- }
5323
- }
5324
- ]
5325
- },
5326
- {
5327
- "kind": "method",
5328
- "name": "removeAttachment",
5329
- "return": {
5330
- "type": {
5331
- "text": "void"
5332
- }
5333
- },
5334
- "parameters": [
5335
- {
5336
- "name": "attachment",
5337
- "type": {
5338
- "text": "ChatAttachment"
5339
- }
5340
- }
5341
- ]
5342
- },
5343
- {
5344
- "kind": "method",
5345
- "name": "removeAttachmentError",
5346
- "return": {
5347
- "type": {
5348
- "text": "void"
5349
- }
5350
- },
5351
- "parameters": [
5352
- {
5353
- "name": "message",
5354
- "type": {
5355
- "text": "string"
5356
- }
5357
- }
5358
- ]
5359
- },
5360
- {
5361
- "kind": "method",
5362
- "name": "handleSendClick"
5363
- },
5364
- {
5365
- "kind": "method",
5366
- "name": "handleStopClick",
5367
- "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."
5368
- },
5369
- {
5370
- "kind": "method",
5371
- "name": "handleSuggestionClick",
5372
- "parameters": [
5373
- {
5374
- "name": "suggestion",
5375
- "type": {
5376
- "text": "string"
5377
- }
5378
- }
5379
- ]
5380
- },
5381
- {
5382
- "kind": "method",
5383
- "name": "submitMessage",
5384
- "return": {
5385
- "type": {
5386
- "text": "Promise<SubmitMessageResult>"
5387
- }
5388
- },
5389
- "parameters": [
5390
- {
5391
- "name": "input",
5392
- "type": {
5393
- "text": "{ text?: string; files?: File[] }"
5394
- }
5395
- }
5396
- ],
5397
- "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."
5398
- },
5399
- {
5400
- "kind": "method",
5401
- "name": "fetchSuggestions",
5402
- "privacy": "private"
5403
- },
5404
- {
5405
- "kind": "field",
5406
- "name": "_pendingSendPrompt",
5407
- "type": {
5408
- "text": "string | undefined"
5409
- },
5410
- "privacy": "private",
5411
- "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)"
5412
- },
5413
- {
5414
- "kind": "method",
5415
- "name": "send",
5416
- "privacy": "private"
5417
- },
5418
- {
5419
- "kind": "method",
5420
- "name": "onChatHeaderMouseDown",
5421
- "parameters": [
5422
- {
5423
- "name": "e",
5424
- "type": {
5425
- "text": "MouseEvent"
5426
- }
5427
- }
5428
- ]
5429
- },
5430
- {
5431
- "kind": "method",
5432
- "name": "handleInteractionCompleted",
5433
- "parameters": [
5434
- {
5435
- "name": "e",
5436
- "type": {
5437
- "text": "Event"
5438
- }
5439
- }
5440
- ]
5441
- },
5442
- {
5443
- "kind": "method",
5444
- "name": "handleInteractionCost",
5445
- "parameters": [
5446
- {
5447
- "name": "e",
5448
- "type": {
5449
- "text": "Event"
5450
- }
5451
- }
5452
- ],
5453
- "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."
5454
- },
5455
- {
5456
- "kind": "field",
5457
- "name": "stopButtonVisible",
5458
- "type": {
5459
- "text": "boolean"
5460
- },
5461
- "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.",
5462
- "readonly": true
5463
- },
5464
- {
5465
- "kind": "field",
5466
- "name": "sendButtonVisible",
5467
- "type": {
5468
- "text": "boolean"
5469
- },
5470
- "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.",
5471
- "readonly": true
5472
- },
5473
- {
5474
- "kind": "field",
5475
- "name": "isComposerResizable",
5476
- "type": {
5477
- "text": "boolean"
5478
- },
5479
- "description": "Whether the message input shows a drag handle to resize its height.",
5480
- "readonly": true
5481
- },
5482
- {
5483
- "kind": "field",
5484
- "name": "composerHeightStyle",
5485
- "type": {
5486
- "text": "string"
5487
- },
5488
- "description": "Inline style carrying the dragged height into `--composer-height`.",
5489
- "readonly": true
5490
- },
5491
- {
5492
- "kind": "method",
5493
- "name": "onComposerResizeStart",
5494
- "return": {
5495
- "type": {
5496
- "text": "void"
5497
- }
5498
- },
5499
- "parameters": [
5500
- {
5501
- "name": "e",
5502
- "type": {
5503
- "text": "PointerEvent"
5504
- }
5505
- }
5506
- ]
5507
- },
5508
- {
5509
- "kind": "method",
5510
- "name": "onComposerResizeMove",
5511
- "return": {
5512
- "type": {
5513
- "text": "void"
5514
- }
5515
- },
5516
- "parameters": [
5517
- {
5518
- "name": "e",
5519
- "type": {
5520
- "text": "PointerEvent"
5521
- }
5522
- }
5523
- ]
5524
- },
5525
- {
5526
- "kind": "method",
5527
- "name": "onComposerResizeEnd",
5528
- "return": {
5529
- "type": {
5530
- "text": "void"
5531
- }
5532
- },
5533
- "parameters": [
5534
- {
5535
- "name": "e",
5536
- "type": {
5537
- "text": "PointerEvent"
5538
- }
5539
- }
5540
- ]
5541
- }
5542
- ],
5543
- "events": [
5544
- {
5545
- "name": "budget-refresh-requested",
5546
- "type": {
5547
- "text": "CustomEvent"
5548
- }
5549
- },
5550
- {
5551
- "type": {
5552
- "text": "CustomEvent"
5553
- }
5554
- },
5555
- {
5556
- "description": "Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMouseDownDetail`",
5557
- "name": "chat-header-mousedown"
5558
- },
5559
- {
5560
- "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`",
5561
- "name": "session-cleared"
5562
- }
5563
- ],
5564
- "attributes": [
5565
- {
5566
- "name": "header-title",
5567
- "type": {
5568
- "text": "string"
5569
- },
5570
- "default": "'Genesis Assistant'",
5571
- "fieldName": "headerTitle"
5572
- },
5573
- {
5574
- "name": "session-key",
5575
- "type": {
5576
- "text": "string | undefined"
5577
- },
5578
- "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.",
5579
- "fieldName": "sessionKey"
5580
- },
5581
- {
5582
- "name": "image-src",
5583
- "type": {
5584
- "text": "string | undefined"
5585
- },
5586
- "fieldName": "imageSrc"
5587
- },
5588
- {
5589
- "name": "user-image-src",
5590
- "type": {
5591
- "text": "string | undefined"
5592
- },
5593
- "fieldName": "userImageSrc"
5594
- },
5595
- {
5596
- "name": "placeholder",
5597
- "type": {
5598
- "text": "string"
5599
- },
5600
- "default": "'Message assistant...'",
5601
- "fieldName": "placeholder"
5602
- },
5603
- {
5604
- "name": "popout-mode",
5605
- "type": {
5606
- "text": "PopoutMode | undefined"
5607
- },
5608
- "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).",
5609
- "fieldName": "popoutMode"
5610
- },
5611
- {
5612
- "name": "debug-redux",
5613
- "type": {
5614
- "text": "boolean"
5615
- },
5616
- "default": "false",
5617
- "description": "When set, enables Redux DevTools for this instance's session store.",
5618
- "fieldName": "debugRedux"
5619
- }
5620
- ],
5621
- "superclass": {
5622
- "name": "GenesisElement",
5623
- "package": "@genesislcap/web-core"
5624
- },
5625
- "tagName": "foundation-ai-assistant",
5626
- "customElement": true
5627
- }
5628
- ],
5629
- "exports": [
5630
- {
5631
- "kind": "js",
5632
- "name": "sparkleIconSvg",
5633
- "declaration": {
5634
- "name": "sparkleIconSvg",
5635
- "module": "src/main/main.ts"
5636
- }
5637
- },
5638
- {
5639
- "kind": "js",
5640
- "name": "userIconSvg",
5641
- "declaration": {
5642
- "name": "userIconSvg",
5643
- "module": "src/main/main.ts"
5644
- }
5645
- },
5646
- {
5647
- "kind": "js",
5648
- "name": "genesisIconSvg",
5649
- "declaration": {
5650
- "name": "genesisIconSvg",
5651
- "module": "src/main/main.ts"
5652
- }
5653
- },
5654
- {
5655
- "kind": "js",
5656
- "name": "budgetPercentOf",
5657
- "declaration": {
5658
- "name": "budgetPercentOf",
5659
- "module": "./budget-controller"
5660
- }
5661
- },
5662
- {
5663
- "kind": "js",
5664
- "name": "formatBlockedReason",
5665
- "declaration": {
5666
- "name": "formatBlockedReason",
5667
- "module": "./budget-controller"
5668
- }
5669
- },
5670
- {
5671
- "kind": "js",
5672
- "name": "FoundationAiAssistant",
5673
- "declaration": {
5674
- "name": "FoundationAiAssistant",
5675
- "module": "src/main/main.ts"
5676
- }
5677
- },
5678
- {
5679
- "kind": "custom-element-definition",
5680
- "name": "foundation-ai-assistant",
5681
- "declaration": {
5682
- "name": "FoundationAiAssistant",
5683
- "module": "src/main/main.ts"
5684
- }
5685
- }
5686
- ]
5687
- },
5688
- {
5689
- "kind": "javascript-module",
5690
- "path": "src/main/main.types.ts",
5691
- "declarations": [
5692
- {
5693
- "kind": "variable",
5694
- "name": "AiAssistantEvent",
5695
- "type": {
5696
- "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}"
5697
- },
5698
- "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}",
5699
- "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."
5700
- },
5701
- {
5702
- "kind": "variable",
5703
- "name": "ANIMATION_DEFS",
5704
- "type": {
5705
- "text": "object"
5706
- },
5707
- "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}",
5708
- "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5709
- },
5710
- {
5711
- "kind": "variable",
5712
- "name": "satisfies",
5713
- "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5714
- },
5715
- {
5716
- "kind": "variable",
5717
- "name": "Record",
5718
- "description": "Registry of all available animations with their display metadata.\nAdding an entry here automatically extends the AiAssistantAnimation type."
5719
- }
5720
- ],
5721
- "exports": [
5722
- {
5723
- "kind": "js",
5724
- "name": "AgentPickerMode",
5725
- "declaration": {
5726
- "name": "AgentPickerMode",
5727
- "package": "@genesislcap/foundation-ai"
5728
- }
5729
- },
5730
- {
5731
- "kind": "js",
5732
- "name": "AiAssistantEvent",
5733
- "declaration": {
5734
- "name": "AiAssistantEvent",
5735
- "module": "src/main/main.types.ts"
5736
- }
5737
- },
5738
- {
5739
- "kind": "js",
5740
- "name": "ANIMATION_DEFS",
5741
- "declaration": {
5742
- "name": "ANIMATION_DEFS",
5743
- "module": "src/main/main.types.ts"
5744
- }
5745
- },
5746
- {
5747
- "kind": "js",
5748
- "name": "satisfies",
5749
- "declaration": {
5750
- "name": "satisfies",
5751
- "module": "src/main/main.types.ts"
5752
- }
5753
- },
5754
- {
5755
- "kind": "js",
5756
- "name": "Record",
5757
- "declaration": {
5758
- "name": "Record",
5759
- "module": "src/main/main.types.ts"
5760
- }
5761
- }
5762
- ]
5763
- },
5764
- {
5765
- "kind": "javascript-module",
5766
- "path": "src/main/meta-snapshot.ts",
5767
- "declarations": [],
5768
- "exports": []
5769
- },
5770
- {
5771
- "kind": "javascript-module",
5772
- "path": "src/provider/ai-provider-switcher.ts",
5773
- "declarations": [
5774
- {
5775
- "kind": "variable",
5776
- "name": "AIProviderSwitcher",
5777
- "description": "The DI token for the (AIProviderSwitcher:interface). Resolves a noop until the app\nregisters one."
5778
- }
5779
- ],
5780
- "exports": [
5781
- {
5782
- "kind": "js",
5783
- "name": "AIProviderSwitcher",
5784
- "declaration": {
5785
- "name": "AIProviderSwitcher",
5786
- "module": "src/provider/ai-provider-switcher.ts"
5787
- }
5788
- }
5789
- ]
5790
- },
5791
- {
5792
- "kind": "javascript-module",
5793
- "path": "src/provider/assistant-app-settings.ts",
5794
- "declarations": [
5795
- {
5796
- "kind": "variable",
5797
- "name": "AssistantAppSettingsProvider",
5798
- "description": "The DI token for the (AssistantAppSettingsProvider:interface). Resolves a noop\nuntil the host registers one."
5799
- }
5800
- ],
5801
- "exports": [
5802
- {
5803
- "kind": "js",
5804
- "name": "AssistantAppSettingsProvider",
5805
- "declaration": {
5806
- "name": "AssistantAppSettingsProvider",
5807
- "module": "src/provider/assistant-app-settings.ts"
5808
- }
5809
- }
5810
- ]
5811
- },
5812
- {
5813
- "kind": "javascript-module",
5814
- "path": "src/provider/tiered-provider-switcher.ts",
5815
- "declarations": [
5816
- {
5817
- "kind": "class",
5818
- "description": "Which cloud vendor backs the tier-shaped provider registry, plus the means to move it at\nruntime (GENC-1610).",
5819
- "name": "TieredAIProviderSwitcher",
5820
- "members": [
5489
+ "description": "must match the id the failure was reported under."
5490
+ }
5491
+ ],
5492
+ "description": "Withdraw one reporter's warning — its save landed, or the host's own store recovered.\n\nOnly `source`'s entry is removed, so a session recovery cannot cancel a host's still-live\nproject failure (GENC-1511, caught in review; see `brokenSources`). The modal closes\nonly once nothing is broken; while anything remains, the copy falls back to the newest\nsurvivor."
5493
+ },
5821
5494
  {
5822
- "kind": "field",
5823
- "name": "vendors",
5824
- "type": {
5825
- "text": "readonly AITierVendor[]"
5495
+ "kind": "method",
5496
+ "name": "syncPersistenceBrokenCopy",
5497
+ "privacy": "private",
5498
+ "return": {
5499
+ "type": {
5500
+ "text": "void"
5501
+ }
5826
5502
  },
5827
- "readonly": true
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."
5828
5504
  },
5829
5505
  {
5830
- "kind": "field",
5831
- "name": "options",
5832
- "type": {
5833
- "text": "TieredAIProviderSwitcherOptions"
5834
- },
5506
+ "kind": "method",
5507
+ "name": "onPersistenceBroken",
5835
5508
  "privacy": "private",
5836
- "readonly": true,
5837
- "default": "options"
5509
+ "return": {
5510
+ "type": {
5511
+ "text": "void"
5512
+ }
5513
+ },
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)."
5838
5523
  },
5839
5524
  {
5840
- "kind": "field",
5841
- "name": "defaultTier",
5842
- "type": {
5843
- "text": "AITierId"
5844
- },
5525
+ "kind": "method",
5526
+ "name": "onPersistenceRecovered",
5845
5527
  "privacy": "private",
5846
- "readonly": true
5528
+ "return": {
5529
+ "type": {
5530
+ "text": "void"
5531
+ }
5532
+ },
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."
5847
5534
  },
5848
5535
  {
5849
- "kind": "field",
5850
- "name": "registry",
5851
- "type": {
5852
- "text": "MutableAIProviderRegistry"
5536
+ "kind": "method",
5537
+ "name": "reloadForPersistence",
5538
+ "return": {
5539
+ "type": {
5540
+ "text": "void"
5541
+ }
5853
5542
  },
5854
- "privacy": "private",
5855
- "readonly": true
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."
5856
5544
  },
5857
5545
  {
5858
- "kind": "field",
5859
- "name": "listeners",
5546
+ "kind": "method",
5547
+ "name": "initPersistenceForNewStore",
5860
5548
  "privacy": "private",
5861
- "readonly": true,
5862
- "default": "new Set<(vendor: AITierVendor) => void>()"
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."
5863
5563
  },
5864
5564
  {
5865
- "kind": "field",
5866
- "name": "_vendor",
5867
- "type": {
5868
- "text": "AITierVendor"
5869
- },
5870
- "privacy": "private"
5565
+ "kind": "method",
5566
+ "name": "triggerFileInput",
5567
+ "return": {
5568
+ "type": {
5569
+ "text": "void"
5570
+ }
5571
+ }
5871
5572
  },
5872
5573
  {
5873
- "kind": "field",
5874
- "name": "vendor",
5875
- "type": {
5876
- "text": "AITierVendor"
5574
+ "kind": "method",
5575
+ "name": "handleFileSelect",
5576
+ "return": {
5577
+ "type": {
5578
+ "text": "void"
5579
+ }
5877
5580
  },
5878
- "readonly": true
5581
+ "parameters": [
5582
+ {
5583
+ "name": "e",
5584
+ "type": {
5585
+ "text": "Event"
5586
+ }
5587
+ }
5588
+ ]
5879
5589
  },
5880
5590
  {
5881
5591
  "kind": "method",
5882
- "name": "switchTo",
5592
+ "name": "removeAttachment",
5883
5593
  "return": {
5884
5594
  "type": {
5885
5595
  "text": "void"
@@ -5887,17 +5597,16 @@
5887
5597
  },
5888
5598
  "parameters": [
5889
5599
  {
5890
- "name": "vendor",
5600
+ "name": "attachment",
5891
5601
  "type": {
5892
- "text": "string"
5602
+ "text": "ChatAttachment"
5893
5603
  }
5894
5604
  }
5895
- ],
5896
- "description": "A user-driven switch: move the registry, then tell the app so it can persist the choice.\nAn unknown vendor is ignored."
5605
+ ]
5897
5606
  },
5898
5607
  {
5899
5608
  "kind": "method",
5900
- "name": "adoptPersistedVendor",
5609
+ "name": "removeAttachmentError",
5901
5610
  "return": {
5902
5611
  "type": {
5903
5612
  "text": "void"
@@ -5905,35 +5614,147 @@
5905
5614
  },
5906
5615
  "parameters": [
5907
5616
  {
5908
- "name": "vendor",
5617
+ "name": "message",
5909
5618
  "type": {
5910
5619
  "text": "string"
5911
5620
  }
5912
5621
  }
5913
- ],
5914
- "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."
5622
+ ]
5915
5623
  },
5916
5624
  {
5917
5625
  "kind": "method",
5918
- "name": "subscribe",
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",
5639
+ "type": {
5640
+ "text": "string"
5641
+ }
5642
+ }
5643
+ ]
5644
+ },
5645
+ {
5646
+ "kind": "method",
5647
+ "name": "submitMessage",
5919
5648
  "return": {
5920
5649
  "type": {
5921
- "text": "() => void"
5650
+ "text": "Promise<SubmitMessageResult>"
5922
5651
  }
5923
5652
  },
5924
5653
  "parameters": [
5925
5654
  {
5926
- "name": "listener",
5655
+ "name": "input",
5927
5656
  "type": {
5928
- "text": "(vendor: string) => void"
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"
5929
5702
  }
5930
5703
  }
5931
5704
  ]
5932
5705
  },
5933
5706
  {
5934
5707
  "kind": "method",
5935
- "name": "apply",
5936
- "privacy": "private",
5708
+ "name": "handleInteractionCost",
5709
+ "parameters": [
5710
+ {
5711
+ "name": "e",
5712
+ "type": {
5713
+ "text": "Event"
5714
+ }
5715
+ }
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
5754
+ },
5755
+ {
5756
+ "kind": "method",
5757
+ "name": "onComposerResizeStart",
5937
5758
  "return": {
5938
5759
  "type": {
5939
5760
  "text": "void"
@@ -5941,96 +5762,275 @@
5941
5762
  },
5942
5763
  "parameters": [
5943
5764
  {
5944
- "name": "vendor",
5765
+ "name": "e",
5945
5766
  "type": {
5946
- "text": "AITierVendor"
5767
+ "text": "PointerEvent"
5947
5768
  }
5948
5769
  }
5949
- ],
5950
- "description": "The registry move both entry points share, and nothing else."
5770
+ ]
5951
5771
  },
5952
5772
  {
5953
5773
  "kind": "method",
5954
- "name": "build",
5955
- "privacy": "private",
5774
+ "name": "onComposerResizeMove",
5956
5775
  "return": {
5957
5776
  "type": {
5958
- "text": "Record<string, AIProvider>"
5777
+ "text": "void"
5959
5778
  }
5960
5779
  },
5961
5780
  "parameters": [
5962
5781
  {
5963
- "name": "vendor",
5782
+ "name": "e",
5964
5783
  "type": {
5965
- "text": "AITierVendor"
5784
+ "text": "PointerEvent"
5966
5785
  }
5967
5786
  }
5968
5787
  ]
5969
5788
  },
5970
5789
  {
5971
5790
  "kind": "method",
5972
- "name": "isKnownVendor",
5973
- "privacy": "private",
5791
+ "name": "onComposerResizeEnd",
5974
5792
  "return": {
5975
5793
  "type": {
5976
- "text": "vendor is AITierVendor"
5794
+ "text": "void"
5977
5795
  }
5978
5796
  },
5979
5797
  "parameters": [
5980
5798
  {
5981
- "name": "vendor",
5799
+ "name": "e",
5982
5800
  "type": {
5983
- "text": "string"
5801
+ "text": "PointerEvent"
5984
5802
  }
5985
5803
  }
5986
5804
  ]
5987
5805
  }
5988
- ]
5989
- },
5990
- {
5991
- "kind": "function",
5992
- "name": "registerTieredAIProviders",
5993
- "return": {
5994
- "type": {
5995
- "text": "TieredAIProviderSwitcher"
5996
- }
5997
- },
5998
- "parameters": [
5806
+ ],
5807
+ "events": [
5999
5808
  {
6000
- "name": "container",
5809
+ "name": "budget-refresh-requested",
6001
5810
  "type": {
6002
- "text": "Container"
5811
+ "text": "CustomEvent"
6003
5812
  }
6004
5813
  },
6005
5814
  {
6006
- "name": "options",
6007
5815
  "type": {
6008
- "text": "Omit<TieredAIProviderSwitcherOptions, 'container'>"
5816
+ "text": "CustomEvent"
6009
5817
  }
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"
6010
5826
  }
6011
5827
  ],
6012
- "description": "Build a TieredAIProviderSwitcher — which registers the tier-shaped provider\nregistry — and put it on the (AIProviderSwitcher:variable) token. Call once at app\nbootstrap."
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
+ }
5884
+ ],
5885
+ "superclass": {
5886
+ "name": "GenesisElement",
5887
+ "package": "@genesislcap/web-core"
5888
+ },
5889
+ "tagName": "foundation-ai-assistant",
5890
+ "customElement": true
6013
5891
  }
6014
5892
  ],
6015
5893
  "exports": [
6016
5894
  {
6017
5895
  "kind": "js",
6018
- "name": "TieredAIProviderSwitcher",
5896
+ "name": "sparkleIconSvg",
6019
5897
  "declaration": {
6020
- "name": "TieredAIProviderSwitcher",
6021
- "module": "src/provider/tiered-provider-switcher.ts"
5898
+ "name": "sparkleIconSvg",
5899
+ "module": "src/main/main.ts"
6022
5900
  }
6023
5901
  },
6024
5902
  {
6025
5903
  "kind": "js",
6026
- "name": "registerTieredAIProviders",
5904
+ "name": "userIconSvg",
6027
5905
  "declaration": {
6028
- "name": "registerTieredAIProviders",
6029
- "module": "src/provider/tiered-provider-switcher.ts"
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."
5983
+ }
5984
+ ],
5985
+ "exports": [
5986
+ {
5987
+ "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",
6013
+ "declaration": {
6014
+ "name": "satisfies",
6015
+ "module": "src/main/main.types.ts"
6016
+ }
6017
+ },
6018
+ {
6019
+ "kind": "js",
6020
+ "name": "Record",
6021
+ "declaration": {
6022
+ "name": "Record",
6023
+ "module": "src/main/main.types.ts"
6030
6024
  }
6031
6025
  }
6032
6026
  ]
6033
6027
  },
6028
+ {
6029
+ "kind": "javascript-module",
6030
+ "path": "src/main/meta-snapshot.ts",
6031
+ "declarations": [],
6032
+ "exports": []
6033
+ },
6034
6034
  {
6035
6035
  "kind": "javascript-module",
6036
6036
  "path": "src/state/ai-assistant-slice.ts",