@genesislcap/ai-assistant 15.40.0 → 15.42.0

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 (73) hide show
  1. package/dist/ai-assistant.api.json +409 -9
  2. package/dist/ai-assistant.d.ts +196 -6
  3. package/dist/chat-driver.cjs +682 -140
  4. package/dist/chat-driver.cjs.map +3 -3
  5. package/dist/chat-driver.mjs +675 -140
  6. package/dist/chat-driver.mjs.map +3 -3
  7. package/dist/custom-elements.json +1007 -436
  8. package/dist/dts/chat-driver-node.d.ts +2 -2
  9. package/dist/dts/chat-driver-node.d.ts.map +1 -1
  10. package/dist/dts/components/ai-driver/ai-driver.d.ts +4 -0
  11. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  12. package/dist/dts/components/chat-driver/chat-driver.d.ts +121 -4
  13. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  14. package/dist/dts/components/chat-driver/interaction-controller.d.ts.map +1 -1
  15. package/dist/dts/components/chat-driver/turn-failures.d.ts +7 -1
  16. package/dist/dts/components/chat-driver/turn-failures.d.ts.map +1 -1
  17. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +3 -1
  18. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  19. package/dist/dts/genesis/index.d.ts +2 -1
  20. package/dist/dts/genesis/index.d.ts.map +1 -1
  21. package/dist/dts/genesis/register-genesis-assistant.d.ts +21 -0
  22. package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
  23. package/dist/dts/genesis/review-model.d.ts +40 -0
  24. package/dist/dts/genesis/review-model.d.ts.map +1 -1
  25. package/dist/dts/genesis/review-payload.d.ts +47 -0
  26. package/dist/dts/genesis/review-payload.d.ts.map +1 -0
  27. package/dist/dts/genesis/write-review/write-review.d.ts +75 -11
  28. package/dist/dts/genesis/write-review/write-review.d.ts.map +1 -1
  29. package/dist/dts/genesis/write-review/write-review.styles.d.ts.map +1 -1
  30. package/dist/dts/genesis/write-review/write-review.template.d.ts.map +1 -1
  31. package/dist/dts/genesis/write-tools.d.ts +49 -0
  32. package/dist/dts/genesis/write-tools.d.ts.map +1 -1
  33. package/dist/dts/genesis/write-turn.d.ts +114 -0
  34. package/dist/dts/genesis/write-turn.d.ts.map +1 -0
  35. package/dist/dts/index.d.ts +2 -0
  36. package/dist/dts/index.d.ts.map +1 -1
  37. package/dist/dts/main/budget-controller.d.ts +12 -2
  38. package/dist/dts/main/budget-controller.d.ts.map +1 -1
  39. package/dist/dts/main/main.d.ts +33 -6
  40. package/dist/dts/main/main.d.ts.map +1 -1
  41. package/dist/dts/react.d.ts +2 -1
  42. package/dist/dts/state/ai-assistant-slice.d.ts +15 -0
  43. package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
  44. package/dist/dts/state/session-store.d.ts +1 -0
  45. package/dist/dts/state/session-store.d.ts.map +1 -1
  46. package/dist/dts/suggestions/generate-suggestions.d.ts.map +1 -1
  47. package/dist/dts/utils/history-transform.d.ts.map +1 -1
  48. package/dist/esm/chat-driver-node.js +5 -1
  49. package/dist/esm/components/chat-driver/chat-driver.js +431 -92
  50. package/dist/esm/components/chat-driver/interaction-controller.js +25 -2
  51. package/dist/esm/components/chat-driver/turn-failures.js +9 -2
  52. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +30 -4
  53. package/dist/esm/genesis/register-genesis-assistant.js +38 -2
  54. package/dist/esm/genesis/review-model.js +47 -1
  55. package/dist/esm/genesis/review-payload.js +18 -0
  56. package/dist/esm/genesis/write-review/write-review.js +225 -40
  57. package/dist/esm/genesis/write-review/write-review.styles.js +18 -0
  58. package/dist/esm/genesis/write-review/write-review.template.js +46 -22
  59. package/dist/esm/genesis/write-tools.js +321 -49
  60. package/dist/esm/genesis/write-turn.js +110 -0
  61. package/dist/esm/main/budget-controller.js +39 -5
  62. package/dist/esm/main/main.js +45 -23
  63. package/dist/esm/state/ai-assistant-slice.js +11 -1
  64. package/dist/esm/state/debug-event-log.js +1 -1
  65. package/dist/esm/suggestions/generate-suggestions.js +4 -1
  66. package/dist/esm/utils/history-transform.js +7 -1
  67. package/dist/react.cjs +14 -2
  68. package/dist/react.mjs +14 -2
  69. package/docs/genesis.md +120 -3
  70. package/docs/migration-GENC-1464.md +12 -2
  71. package/docs/sub_agent.md +21 -4
  72. package/package.json +18 -18
  73. package/scripts/smoke-chat-driver-node.mjs +15 -0
@@ -143,6 +143,62 @@
143
143
  "package": "@genesislcap/foundation-ai"
144
144
  }
145
145
  },
146
+ {
147
+ "kind": "js",
148
+ "name": "AI_SERVICE_ACCESS_REFUSALS",
149
+ "declaration": {
150
+ "name": "AI_SERVICE_ACCESS_REFUSALS",
151
+ "package": "@genesislcap/foundation-ai"
152
+ }
153
+ },
154
+ {
155
+ "kind": "js",
156
+ "name": "AI_SERVICE_ERROR_CODES",
157
+ "declaration": {
158
+ "name": "AI_SERVICE_ERROR_CODES",
159
+ "package": "@genesislcap/foundation-ai"
160
+ }
161
+ },
162
+ {
163
+ "kind": "js",
164
+ "name": "AIServiceError",
165
+ "declaration": {
166
+ "name": "AIServiceError",
167
+ "package": "@genesislcap/foundation-ai"
168
+ }
169
+ },
170
+ {
171
+ "kind": "js",
172
+ "name": "aiServiceAccessRefusalOf",
173
+ "declaration": {
174
+ "name": "aiServiceAccessRefusalOf",
175
+ "package": "@genesislcap/foundation-ai"
176
+ }
177
+ },
178
+ {
179
+ "kind": "js",
180
+ "name": "aiServiceErrorCodeOf",
181
+ "declaration": {
182
+ "name": "aiServiceErrorCodeOf",
183
+ "package": "@genesislcap/foundation-ai"
184
+ }
185
+ },
186
+ {
187
+ "kind": "js",
188
+ "name": "DEFAULT_AI_SERVICE_ERROR_MESSAGES",
189
+ "declaration": {
190
+ "name": "DEFAULT_AI_SERVICE_ERROR_MESSAGES",
191
+ "package": "@genesislcap/foundation-ai"
192
+ }
193
+ },
194
+ {
195
+ "kind": "js",
196
+ "name": "isTerminalAIServiceRefusal",
197
+ "declaration": {
198
+ "name": "isTerminalAIServiceRefusal",
199
+ "package": "@genesislcap/foundation-ai"
200
+ }
201
+ },
146
202
  {
147
203
  "kind": "js",
148
204
  "name": "isObservableAIProviderRegistry",
@@ -287,6 +343,30 @@
287
343
  "package": "@genesislcap/foundation-ai"
288
344
  }
289
345
  },
346
+ {
347
+ "kind": "js",
348
+ "name": "AIServiceAccessRefusal",
349
+ "declaration": {
350
+ "name": "AIServiceAccessRefusal",
351
+ "package": "@genesislcap/foundation-ai"
352
+ }
353
+ },
354
+ {
355
+ "kind": "js",
356
+ "name": "AIServiceErrorCode",
357
+ "declaration": {
358
+ "name": "AIServiceErrorCode",
359
+ "package": "@genesislcap/foundation-ai"
360
+ }
361
+ },
362
+ {
363
+ "kind": "js",
364
+ "name": "AIServiceRefusal",
365
+ "declaration": {
366
+ "name": "AIServiceRefusal",
367
+ "package": "@genesislcap/foundation-ai"
368
+ }
369
+ },
290
370
  {
291
371
  "kind": "js",
292
372
  "name": "AnthropicModelId",
@@ -774,6 +854,14 @@
774
854
  "module": "./state/ai-assistant-slice"
775
855
  }
776
856
  },
857
+ {
858
+ "kind": "js",
859
+ "name": "BlockedCause",
860
+ "declaration": {
861
+ "name": "BlockedCause",
862
+ "module": "./state/ai-assistant-slice"
863
+ }
864
+ },
777
865
  {
778
866
  "kind": "js",
779
867
  "name": "*",
@@ -901,6 +989,30 @@
901
989
  "name": "MARKDOWN_EXPORTPARTS",
902
990
  "module": "./components/chat-markdown/chat-markdown"
903
991
  }
992
+ },
993
+ {
994
+ "kind": "js",
995
+ "name": "GenesisChangeRequest",
996
+ "declaration": {
997
+ "name": "GenesisChangeRequest",
998
+ "module": "./genesis/review-payload"
999
+ }
1000
+ },
1001
+ {
1002
+ "kind": "js",
1003
+ "name": "GenesisReviewPayload",
1004
+ "declaration": {
1005
+ "name": "GenesisReviewPayload",
1006
+ "module": "./genesis/review-payload"
1007
+ }
1008
+ },
1009
+ {
1010
+ "kind": "js",
1011
+ "name": "GenesisWriteReviewCompletedEventDetail",
1012
+ "declaration": {
1013
+ "name": "GenesisWriteReviewCompletedEventDetail",
1014
+ "module": "./genesis/review-payload"
1015
+ }
904
1016
  }
905
1017
  ]
906
1018
  },
@@ -1644,188 +1756,393 @@
1644
1756
  },
1645
1757
  {
1646
1758
  "kind": "javascript-module",
1647
- "path": "src/genesis/calendar.ts",
1648
- "declarations": [],
1649
- "exports": []
1650
- },
1651
- {
1652
- "kind": "javascript-module",
1653
- "path": "src/genesis/config.ts",
1759
+ "path": "src/config/config.ts",
1654
1760
  "declarations": [
1655
- {
1656
- "kind": "variable",
1657
- "name": "DEFAULT_MAX_ROWS",
1658
- "type": {
1659
- "text": "number"
1660
- },
1661
- "default": "50",
1662
- "description": "The default read cap, and the ceiling the config may raise it to."
1663
- },
1664
- {
1665
- "kind": "variable",
1666
- "name": "MAX_ROWS_CEILING",
1667
- "type": {
1668
- "text": "number"
1669
- },
1670
- "default": "1000"
1671
- },
1672
1761
  {
1673
1762
  "kind": "function",
1674
- "name": "toolNameOf",
1675
- "return": {
1676
- "type": {
1677
- "text": "string"
1678
- }
1679
- },
1680
- "parameters": [
1681
- {
1682
- "name": "resourceName",
1683
- "type": {
1684
- "text": "string"
1685
- }
1686
- }
1687
- ],
1688
- "description": "The model-facing tool name for a resource. Deterministic and collision-free (resource names\nare unique), and trivially mapped back to the resource in a debug log. What the tool is FOR\nreaches the model through its description, not its name."
1763
+ "name": "defineAgent",
1764
+ "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```"
1689
1765
  }
1690
1766
  ],
1691
1767
  "exports": [
1692
1768
  {
1693
1769
  "kind": "js",
1694
- "name": "DEFAULT_MAX_ROWS",
1770
+ "name": "CachePolicy",
1695
1771
  "declaration": {
1696
- "name": "DEFAULT_MAX_ROWS",
1697
- "module": "src/genesis/config.ts"
1772
+ "name": "CachePolicy",
1773
+ "module": "src/config/config.ts"
1698
1774
  }
1699
1775
  },
1700
1776
  {
1701
1777
  "kind": "js",
1702
- "name": "MAX_ROWS_CEILING",
1778
+ "name": "ChatFallback",
1703
1779
  "declaration": {
1704
- "name": "MAX_ROWS_CEILING",
1705
- "module": "src/genesis/config.ts"
1780
+ "name": "ChatFallback",
1781
+ "module": "src/config/config.ts"
1706
1782
  }
1707
1783
  },
1708
1784
  {
1709
1785
  "kind": "js",
1710
- "name": "toolNameOf",
1786
+ "name": "ChatInputDuringExecutionMode",
1711
1787
  "declaration": {
1712
- "name": "toolNameOf",
1713
- "module": "src/genesis/config.ts"
1788
+ "name": "ChatInputDuringExecutionMode",
1789
+ "module": "src/config/config.ts"
1790
+ }
1791
+ },
1792
+ {
1793
+ "kind": "js",
1794
+ "name": "ChatThinkingPolicy",
1795
+ "declaration": {
1796
+ "name": "ChatThinkingPolicy",
1797
+ "module": "src/config/config.ts"
1798
+ }
1799
+ },
1800
+ {
1801
+ "kind": "js",
1802
+ "name": "ChatToolChoice",
1803
+ "declaration": {
1804
+ "name": "ChatToolChoice",
1805
+ "module": "src/config/config.ts"
1806
+ }
1807
+ },
1808
+ {
1809
+ "kind": "js",
1810
+ "name": "defineAgent",
1811
+ "declaration": {
1812
+ "name": "defineAgent",
1813
+ "module": "src/config/config.ts"
1714
1814
  }
1715
1815
  }
1716
1816
  ]
1717
1817
  },
1718
1818
  {
1719
1819
  "kind": "javascript-module",
1720
- "path": "src/genesis/criteria.ts",
1820
+ "path": "src/config/define-stateful-agent.ts",
1721
1821
  "declarations": [
1722
1822
  {
1723
1823
  "kind": "function",
1724
- "name": "dateFragment",
1824
+ "name": "restoreMachine",
1725
1825
  "return": {
1726
1826
  "type": {
1727
- "text": "string | undefined"
1827
+ "text": "void"
1728
1828
  }
1729
1829
  },
1730
1830
  "parameters": [
1731
1831
  {
1732
- "name": "field",
1832
+ "name": "machine",
1733
1833
  "type": {
1734
- "text": "string"
1735
- }
1834
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
1835
+ },
1836
+ "description": "the machine to restore (already constructed/started)."
1736
1837
  },
1737
1838
  {
1738
- "name": "op",
1839
+ "name": "restored",
1739
1840
  "type": {
1740
- "text": "GenesisFilterOp"
1741
- }
1841
+ "text": "unknown"
1842
+ },
1843
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
1742
1844
  },
1743
1845
  {
1744
- "name": "date",
1745
- "type": {
1746
- "text": "string"
1747
- }
1846
+ "name": "key",
1847
+ "default": "'machine'",
1848
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
1748
1849
  }
1749
- ]
1850
+ ],
1851
+ "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."
1750
1852
  },
1751
1853
  {
1752
1854
  "kind": "function",
1753
- "name": "dateTimeFragment",
1855
+ "name": "defineStatefulAgent",
1754
1856
  "return": {
1755
1857
  "type": {
1756
- "text": "string | undefined"
1858
+ "text": "AgentConfig"
1757
1859
  }
1758
1860
  },
1759
1861
  "parameters": [
1760
1862
  {
1761
- "name": "field",
1762
- "type": {
1763
- "text": "string"
1764
- }
1765
- },
1766
- {
1767
- "name": "op",
1768
- "type": {
1769
- "text": "GenesisFilterOp"
1770
- }
1771
- },
1772
- {
1773
- "name": "bound",
1863
+ "name": "opts",
1774
1864
  "type": {
1775
- "text": "string"
1865
+ "text": "StatefulAgentInit<S>"
1776
1866
  }
1777
1867
  }
1778
1868
  ],
1779
- "description": "Timestamp columns get the dateTime helpers, which take a `yyyyMMdd-HH:mm:ss` bound."
1869
+ "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."
1780
1870
  }
1781
1871
  ],
1782
1872
  "exports": [
1783
1873
  {
1784
1874
  "kind": "js",
1785
- "name": "dateFragment",
1875
+ "name": "restoreMachine",
1786
1876
  "declaration": {
1787
- "name": "dateFragment",
1788
- "module": "src/genesis/criteria.ts"
1877
+ "name": "restoreMachine",
1878
+ "module": "src/config/define-stateful-agent.ts"
1789
1879
  }
1790
1880
  },
1791
1881
  {
1792
1882
  "kind": "js",
1793
- "name": "dateTimeFragment",
1883
+ "name": "defineStatefulAgent",
1794
1884
  "declaration": {
1795
- "name": "dateTimeFragment",
1796
- "module": "src/genesis/criteria.ts"
1885
+ "name": "defineStatefulAgent",
1886
+ "module": "src/config/define-stateful-agent.ts"
1797
1887
  }
1798
1888
  }
1799
1889
  ]
1800
1890
  },
1801
1891
  {
1802
1892
  "kind": "javascript-module",
1803
- "path": "src/genesis/event-fields.ts",
1804
- "declarations": [],
1805
- "exports": []
1806
- },
1807
- {
1808
- "kind": "javascript-module",
1809
- "path": "src/genesis/filter-fields.ts",
1810
- "declarations": [],
1811
- "exports": []
1812
- },
1813
- {
1814
- "kind": "javascript-module",
1815
- "path": "src/genesis/index.ts",
1816
- "declarations": [],
1817
- "exports": [
1818
- {
1819
- "kind": "js",
1820
- "name": "GENESIS_AGENT_NAME",
1821
- "declaration": {
1822
- "name": "GENESIS_AGENT_NAME",
1823
- "module": "./register-genesis-assistant"
1824
- }
1825
- },
1893
+ "path": "src/config/fallback-agents.ts",
1894
+ "declarations": [
1826
1895
  {
1827
- "kind": "js",
1828
- "name": "registerGenesisAssistant",
1896
+ "kind": "variable",
1897
+ "name": "friendlyFallbackAgent",
1898
+ "type": {
1899
+ "text": "FallbackAgentConfig"
1900
+ },
1901
+ "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}",
1902
+ "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."
1903
+ },
1904
+ {
1905
+ "kind": "variable",
1906
+ "name": "strictFallbackAgent",
1907
+ "type": {
1908
+ "text": "FallbackAgentConfig"
1909
+ },
1910
+ "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}",
1911
+ "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."
1912
+ }
1913
+ ],
1914
+ "exports": [
1915
+ {
1916
+ "kind": "js",
1917
+ "name": "friendlyFallbackAgent",
1918
+ "declaration": {
1919
+ "name": "friendlyFallbackAgent",
1920
+ "module": "src/config/fallback-agents.ts"
1921
+ }
1922
+ },
1923
+ {
1924
+ "kind": "js",
1925
+ "name": "strictFallbackAgent",
1926
+ "declaration": {
1927
+ "name": "strictFallbackAgent",
1928
+ "module": "src/config/fallback-agents.ts"
1929
+ }
1930
+ }
1931
+ ]
1932
+ },
1933
+ {
1934
+ "kind": "javascript-module",
1935
+ "path": "src/config/index.ts",
1936
+ "declarations": [],
1937
+ "exports": [
1938
+ {
1939
+ "kind": "js",
1940
+ "name": "*",
1941
+ "declaration": {
1942
+ "name": "*",
1943
+ "package": "./config"
1944
+ }
1945
+ },
1946
+ {
1947
+ "kind": "js",
1948
+ "name": "*",
1949
+ "declaration": {
1950
+ "name": "*",
1951
+ "package": "./fallback-agents"
1952
+ }
1953
+ }
1954
+ ]
1955
+ },
1956
+ {
1957
+ "kind": "javascript-module",
1958
+ "path": "src/config/validate-providers.ts",
1959
+ "declarations": [],
1960
+ "exports": []
1961
+ },
1962
+ {
1963
+ "kind": "javascript-module",
1964
+ "path": "src/genesis/calendar.ts",
1965
+ "declarations": [],
1966
+ "exports": []
1967
+ },
1968
+ {
1969
+ "kind": "javascript-module",
1970
+ "path": "src/genesis/config.ts",
1971
+ "declarations": [
1972
+ {
1973
+ "kind": "variable",
1974
+ "name": "DEFAULT_MAX_ROWS",
1975
+ "type": {
1976
+ "text": "number"
1977
+ },
1978
+ "default": "50",
1979
+ "description": "The default read cap, and the ceiling the config may raise it to."
1980
+ },
1981
+ {
1982
+ "kind": "variable",
1983
+ "name": "MAX_ROWS_CEILING",
1984
+ "type": {
1985
+ "text": "number"
1986
+ },
1987
+ "default": "1000"
1988
+ },
1989
+ {
1990
+ "kind": "function",
1991
+ "name": "toolNameOf",
1992
+ "return": {
1993
+ "type": {
1994
+ "text": "string"
1995
+ }
1996
+ },
1997
+ "parameters": [
1998
+ {
1999
+ "name": "resourceName",
2000
+ "type": {
2001
+ "text": "string"
2002
+ }
2003
+ }
2004
+ ],
2005
+ "description": "The model-facing tool name for a resource. Deterministic and collision-free (resource names\nare unique), and trivially mapped back to the resource in a debug log. What the tool is FOR\nreaches the model through its description, not its name."
2006
+ }
2007
+ ],
2008
+ "exports": [
2009
+ {
2010
+ "kind": "js",
2011
+ "name": "DEFAULT_MAX_ROWS",
2012
+ "declaration": {
2013
+ "name": "DEFAULT_MAX_ROWS",
2014
+ "module": "src/genesis/config.ts"
2015
+ }
2016
+ },
2017
+ {
2018
+ "kind": "js",
2019
+ "name": "MAX_ROWS_CEILING",
2020
+ "declaration": {
2021
+ "name": "MAX_ROWS_CEILING",
2022
+ "module": "src/genesis/config.ts"
2023
+ }
2024
+ },
2025
+ {
2026
+ "kind": "js",
2027
+ "name": "toolNameOf",
2028
+ "declaration": {
2029
+ "name": "toolNameOf",
2030
+ "module": "src/genesis/config.ts"
2031
+ }
2032
+ }
2033
+ ]
2034
+ },
2035
+ {
2036
+ "kind": "javascript-module",
2037
+ "path": "src/genesis/criteria.ts",
2038
+ "declarations": [
2039
+ {
2040
+ "kind": "function",
2041
+ "name": "dateFragment",
2042
+ "return": {
2043
+ "type": {
2044
+ "text": "string | undefined"
2045
+ }
2046
+ },
2047
+ "parameters": [
2048
+ {
2049
+ "name": "field",
2050
+ "type": {
2051
+ "text": "string"
2052
+ }
2053
+ },
2054
+ {
2055
+ "name": "op",
2056
+ "type": {
2057
+ "text": "GenesisFilterOp"
2058
+ }
2059
+ },
2060
+ {
2061
+ "name": "date",
2062
+ "type": {
2063
+ "text": "string"
2064
+ }
2065
+ }
2066
+ ]
2067
+ },
2068
+ {
2069
+ "kind": "function",
2070
+ "name": "dateTimeFragment",
2071
+ "return": {
2072
+ "type": {
2073
+ "text": "string | undefined"
2074
+ }
2075
+ },
2076
+ "parameters": [
2077
+ {
2078
+ "name": "field",
2079
+ "type": {
2080
+ "text": "string"
2081
+ }
2082
+ },
2083
+ {
2084
+ "name": "op",
2085
+ "type": {
2086
+ "text": "GenesisFilterOp"
2087
+ }
2088
+ },
2089
+ {
2090
+ "name": "bound",
2091
+ "type": {
2092
+ "text": "string"
2093
+ }
2094
+ }
2095
+ ],
2096
+ "description": "Timestamp columns get the dateTime helpers, which take a `yyyyMMdd-HH:mm:ss` bound."
2097
+ }
2098
+ ],
2099
+ "exports": [
2100
+ {
2101
+ "kind": "js",
2102
+ "name": "dateFragment",
2103
+ "declaration": {
2104
+ "name": "dateFragment",
2105
+ "module": "src/genesis/criteria.ts"
2106
+ }
2107
+ },
2108
+ {
2109
+ "kind": "js",
2110
+ "name": "dateTimeFragment",
2111
+ "declaration": {
2112
+ "name": "dateTimeFragment",
2113
+ "module": "src/genesis/criteria.ts"
2114
+ }
2115
+ }
2116
+ ]
2117
+ },
2118
+ {
2119
+ "kind": "javascript-module",
2120
+ "path": "src/genesis/event-fields.ts",
2121
+ "declarations": [],
2122
+ "exports": []
2123
+ },
2124
+ {
2125
+ "kind": "javascript-module",
2126
+ "path": "src/genesis/filter-fields.ts",
2127
+ "declarations": [],
2128
+ "exports": []
2129
+ },
2130
+ {
2131
+ "kind": "javascript-module",
2132
+ "path": "src/genesis/index.ts",
2133
+ "declarations": [],
2134
+ "exports": [
2135
+ {
2136
+ "kind": "js",
2137
+ "name": "GENESIS_AGENT_NAME",
2138
+ "declaration": {
2139
+ "name": "GENESIS_AGENT_NAME",
2140
+ "module": "./register-genesis-assistant"
2141
+ }
2142
+ },
2143
+ {
2144
+ "kind": "js",
2145
+ "name": "registerGenesisAssistant",
1829
2146
  "declaration": {
1830
2147
  "name": "registerGenesisAssistant",
1831
2148
  "module": "./register-genesis-assistant"
@@ -1879,6 +2196,14 @@
1879
2196
  "module": "./write-tools"
1880
2197
  }
1881
2198
  },
2199
+ {
2200
+ "kind": "js",
2201
+ "name": "GenesisWriteDecision",
2202
+ "declaration": {
2203
+ "name": "GenesisWriteDecision",
2204
+ "module": "./write-tools"
2205
+ }
2206
+ },
1882
2207
  {
1883
2208
  "kind": "js",
1884
2209
  "name": "GenesisWriteResult",
@@ -1919,6 +2244,30 @@
1919
2244
  "module": "./write-review/write-review"
1920
2245
  }
1921
2246
  },
2247
+ {
2248
+ "kind": "js",
2249
+ "name": "GenesisChangeRequest",
2250
+ "declaration": {
2251
+ "name": "GenesisChangeRequest",
2252
+ "module": "./review-payload"
2253
+ }
2254
+ },
2255
+ {
2256
+ "kind": "js",
2257
+ "name": "GenesisReviewPayload",
2258
+ "declaration": {
2259
+ "name": "GenesisReviewPayload",
2260
+ "module": "./review-payload"
2261
+ }
2262
+ },
2263
+ {
2264
+ "kind": "js",
2265
+ "name": "GenesisWriteReviewCompletedEventDetail",
2266
+ "declaration": {
2267
+ "name": "GenesisWriteReviewCompletedEventDetail",
2268
+ "module": "./review-payload"
2269
+ }
2270
+ },
1922
2271
  {
1923
2272
  "kind": "js",
1924
2273
  "name": "GenesisReadResult",
@@ -2141,6 +2490,22 @@
2141
2490
  }
2142
2491
  ],
2143
2492
  "exports": [
2493
+ {
2494
+ "kind": "js",
2495
+ "name": "GenesisChangeRequest",
2496
+ "declaration": {
2497
+ "name": "GenesisChangeRequest",
2498
+ "module": "./review-payload"
2499
+ }
2500
+ },
2501
+ {
2502
+ "kind": "js",
2503
+ "name": "GenesisReviewPayload",
2504
+ "declaration": {
2505
+ "name": "GenesisReviewPayload",
2506
+ "module": "./review-payload"
2507
+ }
2508
+ },
2144
2509
  {
2145
2510
  "kind": "js",
2146
2511
  "name": "LONG_VALUE",
@@ -2151,6 +2516,12 @@
2151
2516
  }
2152
2517
  ]
2153
2518
  },
2519
+ {
2520
+ "kind": "javascript-module",
2521
+ "path": "src/genesis/review-payload.ts",
2522
+ "declarations": [],
2523
+ "exports": []
2524
+ },
2154
2525
  {
2155
2526
  "kind": "javascript-module",
2156
2527
  "path": "src/genesis/row-source.ts",
@@ -2240,352 +2611,153 @@
2240
2611
  "text": "['insert', 'modify', 'delete', 'custom']"
2241
2612
  },
2242
2613
  "default": "['insert', 'modify', 'delete', 'custom']",
2243
- "description": "The wire vocabulary for an event resource's operation. Custom handlers keep their own name."
2244
- }
2245
- ],
2246
- "exports": [
2247
- {
2248
- "kind": "js",
2249
- "name": "GENESIS_EVENT_OPS",
2250
- "declaration": {
2251
- "name": "GENESIS_EVENT_OPS",
2252
- "module": "src/genesis/types.ts"
2253
- }
2254
- }
2255
- ]
2256
- },
2257
- {
2258
- "kind": "javascript-module",
2259
- "path": "src/genesis/value-compare.ts",
2260
- "declarations": [],
2261
- "exports": []
2262
- },
2263
- {
2264
- "kind": "javascript-module",
2265
- "path": "src/genesis/write-commit.ts",
2266
- "declarations": [],
2267
- "exports": []
2268
- },
2269
- {
2270
- "kind": "javascript-module",
2271
- "path": "src/genesis/write-outcome.ts",
2272
- "declarations": [],
2273
- "exports": []
2274
- },
2275
- {
2276
- "kind": "javascript-module",
2277
- "path": "src/genesis/write-payload.ts",
2278
- "declarations": [
2279
- {
2280
- "kind": "function",
2281
- "name": "buildEventPayload",
2282
- "return": {
2283
- "type": {
2284
- "text": "PayloadResult"
2285
- }
2286
- },
2287
- "parameters": [
2288
- {
2289
- "name": "fields",
2290
- "type": {
2291
- "text": "readonly GenesisEventField[]"
2292
- }
2293
- },
2294
- {
2295
- "name": "row",
2296
- "type": {
2297
- "text": "unknown"
2298
- }
2299
- },
2300
- {
2301
- "name": "{ op, preImage }",
2302
- "default": "{}",
2303
- "type": {
2304
- "text": "BuildPayloadOptions"
2305
- }
2306
- }
2307
- ]
2308
- }
2309
- ],
2310
- "exports": [
2311
- {
2312
- "kind": "js",
2313
- "name": "buildEventPayload",
2314
- "declaration": {
2315
- "name": "buildEventPayload",
2316
- "module": "src/genesis/write-payload.ts"
2317
- }
2318
- }
2319
- ]
2320
- },
2321
- {
2322
- "kind": "javascript-module",
2323
- "path": "src/genesis/write-plan.ts",
2324
- "declarations": [
2325
- {
2326
- "kind": "variable",
2327
- "name": "MAX_WRITE_ROWS",
2328
- "type": {
2329
- "text": "number"
2330
- },
2331
- "default": "25",
2332
- "description": "A batch a person can actually read before approving it."
2333
- }
2334
- ],
2335
- "exports": [
2336
- {
2337
- "kind": "js",
2338
- "name": "MAX_WRITE_ROWS",
2339
- "declaration": {
2340
- "name": "MAX_WRITE_ROWS",
2341
- "module": "src/genesis/write-plan.ts"
2342
- }
2343
- }
2344
- ]
2345
- },
2346
- {
2347
- "kind": "javascript-module",
2348
- "path": "src/genesis/write-tools.ts",
2349
- "declarations": [
2350
- {
2351
- "kind": "function",
2352
- "name": "createGenesisWriteTools",
2353
- "return": {
2354
- "type": {
2355
- "text": "{ toolDefinitions: () => Promise<ChatToolDefinition[]>; toolHandlers: ChatToolHandlers }"
2356
- }
2357
- },
2358
- "parameters": [
2359
- {
2360
- "name": "resources",
2361
- "type": {
2362
- "text": "readonly GenesisAiResource[]"
2363
- }
2364
- },
2365
- {
2366
- "name": "options",
2367
- "default": "{}",
2368
- "type": {
2369
- "text": "GenesisWriteToolsOptions"
2370
- }
2371
- }
2372
- ],
2373
- "description": "Builds the assistant's write tools from an app's event resources."
2374
- }
2375
- ],
2376
- "exports": [
2377
- {
2378
- "kind": "js",
2379
- "name": "createGenesisWriteTools",
2380
- "declaration": {
2381
- "name": "createGenesisWriteTools",
2382
- "module": "src/genesis/write-tools.ts"
2383
- }
2384
- }
2385
- ]
2386
- },
2387
- {
2388
- "kind": "javascript-module",
2389
- "path": "src/config/config.ts",
2390
- "declarations": [
2391
- {
2392
- "kind": "function",
2393
- "name": "defineAgent",
2394
- "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```"
2395
- }
2396
- ],
2397
- "exports": [
2398
- {
2399
- "kind": "js",
2400
- "name": "CachePolicy",
2401
- "declaration": {
2402
- "name": "CachePolicy",
2403
- "module": "src/config/config.ts"
2404
- }
2405
- },
2406
- {
2407
- "kind": "js",
2408
- "name": "ChatFallback",
2409
- "declaration": {
2410
- "name": "ChatFallback",
2411
- "module": "src/config/config.ts"
2412
- }
2413
- },
2414
- {
2415
- "kind": "js",
2416
- "name": "ChatInputDuringExecutionMode",
2417
- "declaration": {
2418
- "name": "ChatInputDuringExecutionMode",
2419
- "module": "src/config/config.ts"
2420
- }
2421
- },
2422
- {
2423
- "kind": "js",
2424
- "name": "ChatThinkingPolicy",
2425
- "declaration": {
2426
- "name": "ChatThinkingPolicy",
2427
- "module": "src/config/config.ts"
2428
- }
2429
- },
2430
- {
2431
- "kind": "js",
2432
- "name": "ChatToolChoice",
2433
- "declaration": {
2434
- "name": "ChatToolChoice",
2435
- "module": "src/config/config.ts"
2436
- }
2437
- },
2614
+ "description": "The wire vocabulary for an event resource's operation. Custom handlers keep their own name."
2615
+ }
2616
+ ],
2617
+ "exports": [
2438
2618
  {
2439
2619
  "kind": "js",
2440
- "name": "defineAgent",
2620
+ "name": "GENESIS_EVENT_OPS",
2441
2621
  "declaration": {
2442
- "name": "defineAgent",
2443
- "module": "src/config/config.ts"
2622
+ "name": "GENESIS_EVENT_OPS",
2623
+ "module": "src/genesis/types.ts"
2444
2624
  }
2445
2625
  }
2446
2626
  ]
2447
2627
  },
2448
2628
  {
2449
2629
  "kind": "javascript-module",
2450
- "path": "src/config/define-stateful-agent.ts",
2630
+ "path": "src/genesis/value-compare.ts",
2631
+ "declarations": [],
2632
+ "exports": []
2633
+ },
2634
+ {
2635
+ "kind": "javascript-module",
2636
+ "path": "src/genesis/write-commit.ts",
2637
+ "declarations": [],
2638
+ "exports": []
2639
+ },
2640
+ {
2641
+ "kind": "javascript-module",
2642
+ "path": "src/genesis/write-outcome.ts",
2643
+ "declarations": [],
2644
+ "exports": []
2645
+ },
2646
+ {
2647
+ "kind": "javascript-module",
2648
+ "path": "src/genesis/write-payload.ts",
2451
2649
  "declarations": [
2452
2650
  {
2453
2651
  "kind": "function",
2454
- "name": "restoreMachine",
2652
+ "name": "buildEventPayload",
2455
2653
  "return": {
2456
2654
  "type": {
2457
- "text": "void"
2655
+ "text": "PayloadResult"
2458
2656
  }
2459
2657
  },
2460
2658
  "parameters": [
2461
2659
  {
2462
- "name": "machine",
2660
+ "name": "fields",
2463
2661
  "type": {
2464
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
2465
- },
2466
- "description": "the machine to restore (already constructed/started)."
2662
+ "text": "readonly GenesisEventField[]"
2663
+ }
2467
2664
  },
2468
2665
  {
2469
- "name": "restored",
2666
+ "name": "row",
2470
2667
  "type": {
2471
2668
  "text": "unknown"
2472
- },
2473
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
2669
+ }
2474
2670
  },
2475
2671
  {
2476
- "name": "key",
2477
- "default": "'machine'",
2478
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
2479
- }
2480
- ],
2481
- "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."
2482
- },
2483
- {
2484
- "kind": "function",
2485
- "name": "defineStatefulAgent",
2486
- "return": {
2487
- "type": {
2488
- "text": "AgentConfig"
2489
- }
2490
- },
2491
- "parameters": [
2492
- {
2493
- "name": "opts",
2672
+ "name": "{ op, preImage }",
2673
+ "default": "{}",
2494
2674
  "type": {
2495
- "text": "StatefulAgentInit<S>"
2675
+ "text": "BuildPayloadOptions"
2496
2676
  }
2497
2677
  }
2498
- ],
2499
- "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."
2678
+ ]
2500
2679
  }
2501
2680
  ],
2502
2681
  "exports": [
2503
2682
  {
2504
2683
  "kind": "js",
2505
- "name": "restoreMachine",
2506
- "declaration": {
2507
- "name": "restoreMachine",
2508
- "module": "src/config/define-stateful-agent.ts"
2509
- }
2510
- },
2511
- {
2512
- "kind": "js",
2513
- "name": "defineStatefulAgent",
2684
+ "name": "buildEventPayload",
2514
2685
  "declaration": {
2515
- "name": "defineStatefulAgent",
2516
- "module": "src/config/define-stateful-agent.ts"
2686
+ "name": "buildEventPayload",
2687
+ "module": "src/genesis/write-payload.ts"
2517
2688
  }
2518
2689
  }
2519
2690
  ]
2520
2691
  },
2521
2692
  {
2522
2693
  "kind": "javascript-module",
2523
- "path": "src/config/fallback-agents.ts",
2694
+ "path": "src/genesis/write-plan.ts",
2524
2695
  "declarations": [
2525
2696
  {
2526
2697
  "kind": "variable",
2527
- "name": "friendlyFallbackAgent",
2528
- "type": {
2529
- "text": "FallbackAgentConfig"
2530
- },
2531
- "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}",
2532
- "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."
2533
- },
2534
- {
2535
- "kind": "variable",
2536
- "name": "strictFallbackAgent",
2698
+ "name": "MAX_WRITE_ROWS",
2537
2699
  "type": {
2538
- "text": "FallbackAgentConfig"
2700
+ "text": "number"
2539
2701
  },
2540
- "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}",
2541
- "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."
2702
+ "default": "25",
2703
+ "description": "A batch a person can actually read before approving it."
2542
2704
  }
2543
2705
  ],
2544
2706
  "exports": [
2545
2707
  {
2546
2708
  "kind": "js",
2547
- "name": "friendlyFallbackAgent",
2548
- "declaration": {
2549
- "name": "friendlyFallbackAgent",
2550
- "module": "src/config/fallback-agents.ts"
2551
- }
2552
- },
2553
- {
2554
- "kind": "js",
2555
- "name": "strictFallbackAgent",
2709
+ "name": "MAX_WRITE_ROWS",
2556
2710
  "declaration": {
2557
- "name": "strictFallbackAgent",
2558
- "module": "src/config/fallback-agents.ts"
2711
+ "name": "MAX_WRITE_ROWS",
2712
+ "module": "src/genesis/write-plan.ts"
2559
2713
  }
2560
2714
  }
2561
2715
  ]
2562
2716
  },
2563
2717
  {
2564
2718
  "kind": "javascript-module",
2565
- "path": "src/config/index.ts",
2566
- "declarations": [],
2567
- "exports": [
2719
+ "path": "src/genesis/write-tools.ts",
2720
+ "declarations": [
2568
2721
  {
2569
- "kind": "js",
2570
- "name": "*",
2571
- "declaration": {
2572
- "name": "*",
2573
- "package": "./config"
2574
- }
2575
- },
2722
+ "kind": "function",
2723
+ "name": "createGenesisWriteTools",
2724
+ "return": {
2725
+ "type": {
2726
+ "text": "{ toolDefinitions: () => Promise<ChatToolDefinition[]>; toolHandlers: ChatToolHandlers }"
2727
+ }
2728
+ },
2729
+ "parameters": [
2730
+ {
2731
+ "name": "resources",
2732
+ "type": {
2733
+ "text": "readonly GenesisAiResource[]"
2734
+ }
2735
+ },
2736
+ {
2737
+ "name": "options",
2738
+ "default": "{}",
2739
+ "type": {
2740
+ "text": "GenesisWriteToolsOptions"
2741
+ }
2742
+ }
2743
+ ],
2744
+ "description": "Builds the assistant's write tools from an app's event resources."
2745
+ }
2746
+ ],
2747
+ "exports": [
2576
2748
  {
2577
2749
  "kind": "js",
2578
- "name": "*",
2750
+ "name": "createGenesisWriteTools",
2579
2751
  "declaration": {
2580
- "name": "*",
2581
- "package": "./fallback-agents"
2752
+ "name": "createGenesisWriteTools",
2753
+ "module": "src/genesis/write-tools.ts"
2582
2754
  }
2583
2755
  }
2584
2756
  ]
2585
2757
  },
2586
2758
  {
2587
2759
  "kind": "javascript-module",
2588
- "path": "src/config/validate-providers.ts",
2760
+ "path": "src/genesis/write-turn.ts",
2589
2761
  "declarations": [],
2590
2762
  "exports": []
2591
2763
  },
@@ -2951,6 +3123,14 @@
2951
3123
  "default": "{}",
2952
3124
  "description": "Optional session persistence (GENC-1351). Off by default — set `enabled`\nand a `provider` (e.g. a `WebStorageSessionProvider`) to have the assistant\nautosave on idle and auto-restore the conversation on page reload. Exposed\nas a top-level property (like `agents`/`providerRegistry`) rather than via\n`chatConfig`, since the provider type lives in this package while\n`ChatConfig` lives in `foundation-ai`."
2953
3125
  },
3126
+ {
3127
+ "kind": "field",
3128
+ "name": "aiServiceErrorMessages",
3129
+ "type": {
3130
+ "text": "Partial<Record<AIServiceRefusal, string>> | undefined"
3131
+ },
3132
+ "description": "Replaces the transcript sentence shown when the app's AI service refuses a request with one of\n`AI_SERVICE_ERROR_CODES`, or its router with one of `AI_SERVICE_ACCESS_REFUSALS` (GENC-1611), per\ncode; a code with no entry keeps\n`DEFAULT_AI_SERVICE_ERROR_MESSAGES`. Read when the driver is created, so set it before the\nelement connects."
3133
+ },
2954
3134
  {
2955
3135
  "kind": "field",
2956
3136
  "name": "agentPicker",
@@ -3234,7 +3414,7 @@
3234
3414
  "type": {
3235
3415
  "text": "boolean"
3236
3416
  },
3237
- "description": "Whether the assistant is blocked by a backend condition and cannot send —\ntoday, an exhausted AI-spend budget (GENC-1464). While true the composer is\ndisabled, `send`/`submitMessage` refuse, suggestions stop being fetched, and\na persistent banner (`part=\"blocked-banner\"`) sits above the composer\nexplaining why. The transcript stays visible and scrollable throughout —\nunlike `compacting` and `restoring`, this does not replace the conversation.\n\n**Latched.** Nothing in the element clears it: not a new turn, not \"Clear\"\n/ \"New chat\", not a pop-in/out. It stays set until the host writes\n`false` — because nothing the user can do inside the assistant refills a\nbudget. Hosts typically set it from their own pre-flight budget check on\nmount, and clear it once a later check shows headroom again.\n\nThe driver also latches it automatically when a turn ends with the\n`'budget-exhausted'` failure reason — off the `tool-loop-end` activity bus\n(which also covers a sub-agent wall, a turn this element did not start, and\nan element swapped in mid-turn) and off the driver's return value (which\ncovers a wall hit during multi-agent classification, where no tool loop ran\nand so no bus event fires). So a host that does no pre-flight at all still\ngets a correct locked UI the moment the first 402 lands. The bus topic is\ntab-scoped, so a wall hit in a popped-out window latches the main window\ntoo — correct for a shared spend cap.\n\n**Lifetime — read this before relying on it as your source of truth.** The\nlatch is in-memory and per-`stateKey`:\n\n- It does **not** survive `switchSession`. Switching away tears the outgoing\n session's store down entirely, so switching back yields a fresh, unblocked\n store.\n- It does **not** survive a page reload. It is deliberately absent from the\n persisted session snapshot: the snapshot is long-lived, so a persisted\n latch would outlive an out-of-band budget raise with no in-element way to\n clear it — a stale lock is worse than re-deriving the state.\n\nThe durable source of truth is therefore the **host's pre-flight**, which\nshould run on mount and on every session switch. See\n`docs/migration-GENC-1464.md` §\"How to adopt\", Option B."
3417
+ "description": "Whether the assistant is blocked by a backend condition and cannot send —\ntoday, an exhausted AI-spend budget (GENC-1464). While true the composer is\ndisabled, `send`/`submitMessage` refuse, suggestions stop being fetched, and\na persistent banner (`part=\"blocked-banner\"`) sits above the composer\nexplaining why. The transcript stays visible and scrollable throughout —\nunlike `compacting` and `restoring`, this does not replace the conversation.\n\n**Latched.** Nothing in the element clears it: not a new turn, not \"Clear\"\n/ \"New chat\", not a pop-in/out. It stays set until the host writes\n`false` — because nothing the user can do inside the assistant refills a\nbudget. Hosts typically set it from their own pre-flight budget check on\nmount, and clear it once a later check shows headroom again. Such a host\nshould use `setBlocked(true, reason, { cause: 'budget' })`: a plain\n`blocked = true` is taken for a budget wall only while per-vendor budget\nwalls cover every vendor the assistant can reach (GENC-1611).\n\nThe driver also latches it automatically when a turn ends with the\n`'budget-exhausted'` failure reason — off the `tool-loop-end` activity bus\n(which also covers a sub-agent wall, a turn this element did not start, and\nan element swapped in mid-turn) and off the driver's return value (which\ncovers a wall hit during multi-agent classification, where no tool loop ran\nand so no bus event fires). So a host that does no pre-flight at all still\ngets a correct locked UI the moment the first 402 lands. The bus topic is\ntab-scoped, so a wall hit in a popped-out window latches the main window\ntoo — correct for a shared spend cap.\n\n**Lifetime — read this before relying on it as your source of truth.** The\nlatch is in-memory and per-`stateKey`:\n\n- It does **not** survive `switchSession`. Switching away tears the outgoing\n session's store down entirely, so switching back yields a fresh, unblocked\n store.\n- It does **not** survive a page reload. It is deliberately absent from the\n persisted session snapshot: the snapshot is long-lived, so a persisted\n latch would outlive an out-of-band budget raise with no in-element way to\n clear it — a stale lock is worse than re-deriving the state.\n\nThe durable source of truth is therefore the **host's pre-flight**, which\nshould run on mount and on every session switch. See\n`docs/migration-GENC-1464.md` §\"How to adopt\", Option B."
3238
3418
  },
3239
3419
  {
3240
3420
  "kind": "field",
@@ -3383,9 +3563,16 @@
3383
3563
  "type": {
3384
3564
  "text": "string | null"
3385
3565
  }
3566
+ },
3567
+ {
3568
+ "name": "options",
3569
+ "optional": true,
3570
+ "type": {
3571
+ "text": "{ cause?: BlockedCause }"
3572
+ }
3386
3573
  }
3387
3574
  ],
3388
- "description": "Block or unblock the assistant, optionally with custom banner copy.\nEquivalent to the FoundationAiAssistant.blocked setter, plus the\nreason in one atomic write.\n\nBlocking writes the **vendor-agnostic** block — what a host with one budget\npot means — and does not populate\nFoundationAiAssistant.blockedVendors. Unblocking clears the\nper-vendor walls as well, so a host asserting \"the wall is gone\" after its\nown pre-flight cannot be silently overruled by a driver latch it never saw."
3575
+ "description": "Block or unblock the assistant, optionally with custom banner copy.\nEquivalent to the FoundationAiAssistant.blocked setter, plus the\nreason in one atomic write.\n\nBlocking writes the **vendor-agnostic** block and does not populate\nFoundationAiAssistant.blockedVendors. Unblocking clears the\nper-vendor walls as well, so a host asserting \"the wall is gone\" after its\nown pre-flight cannot be silently overruled by a driver latch it never saw.\n\n`options.cause` says why (GENC-1611). Pass `'budget'` for a spend wall, so the composer reads\n\"AI usage limit reached\"; any other block reads \"Assistant unavailable\". Omitted, a block keeps\nthe cause it already has, and a new one reads as a budget wall only while per-vendor budget walls\ncover every vendor the assistant can reach."
3389
3576
  },
3390
3577
  {
3391
3578
  "kind": "field",
@@ -4632,6 +4819,17 @@
4632
4819
  "name": "stopLoadingTimer",
4633
4820
  "privacy": "private"
4634
4821
  },
4822
+ {
4823
+ "kind": "method",
4824
+ "name": "syncLoadingIndicator",
4825
+ "privacy": "private",
4826
+ "return": {
4827
+ "type": {
4828
+ "text": "void"
4829
+ }
4830
+ },
4831
+ "description": "The loading indicator for a turn that is running: shown, unless the turn is parked on the\nuser."
4832
+ },
4635
4833
  {
4636
4834
  "kind": "method",
4637
4835
  "name": "handlePopout",
@@ -6601,7 +6799,7 @@
6601
6799
  "type": {
6602
6800
  "text": "readonly string[]"
6603
6801
  },
6604
- "default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted; budget_exhausted, provider_refused and context_exhausted are all terminal for the PARENT turn too — the parent stops rather than calling the model again into the same wall), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n \"kind:'event' type 'routing.decided' — how ONE turn was routed, emitted by the orchestrating driver before the agent runs (and again after every handoff). `decision` is why that agent was chosen: 'classified' (the classifier ran and picked one), 'no-match' (it ran and answered -1 — nothing listed covers the request), 'ballot-exhausted' (every eligible specialist had already handed off this turn, so the ballot was empty and NO call was made — distinct from 'no-match', where one ran and declined), 'pinned' (a user pin or an active stateful flow owned the turn, so no call was made), 'single-candidate'/'no-specialists' (configuration left nothing to decide), 'provider-unavailable' (the registry default exposes no chat()), 'classifier-failed' (every attempt threw — `error` carries the last one). `to` names the agent and `fallback` says whether that agent is the fallback. `candidates` is what was actually ON THE BALLOT, in ballot order, so `index` — the classifier's own answer — indexes it directly; `excluded` names the specialists left off because they already handed off this turn, so the full eligible set is `candidates` ∪ `excluded`. `candidates` is absent on the four decisions that put nothing to a vote — 'pinned', 'single-candidate', 'no-specialists', 'ballot-exhausted'. It IS present on 'provider-unavailable', which is not an exception worth removing: the ballot was built there, it simply never got sent. `attempts` covers the retry ladder. `durationMs` is on EVERY routing.decided, and is the field to read when a decision looks wrong: the four decisions that can reach the fallback are told apart by the clock as much as by their name, because a fallback routing that resolved in tens of milliseconds made no network call at all whatever its `decision` says.\",\n \"kind:'event' type 'routing.decided'.`usage` — what that classifier call cost, in the same four-bucket + costUsd shape as `sessionUsage`, plus `model`. Absent on the decisions that make no call (see 'pinned' and the configuration ones). THIS SPEND IS NOT IN `sessionUsage`: a classifier call never enters the transcript and `sessionUsage` is derived from the transcript, so classifier cost is missing from the session total by construction, not by accident. Sum these events to close that gap — it is the one component of a session's real spend that the totals cannot see.\",\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it. For a turn that went to the wrong agent, read its routing.decided first — `decision` says whether anything was actually asked.',\n]",
6802
+ "default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n \"kind:'event' type 'routing.decided' — how ONE turn was routed, emitted by the orchestrating driver before the agent runs (and again after every handoff). `decision` is why that agent was chosen: 'classified' (the classifier ran and picked one), 'no-match' (it ran and answered -1 — nothing listed covers the request), 'ballot-exhausted' (every eligible specialist had already handed off this turn, so the ballot was empty and NO call was made — distinct from 'no-match', where one ran and declined), 'pinned' (a user pin or an active stateful flow owned the turn, so no call was made), 'single-candidate'/'no-specialists' (configuration left nothing to decide), 'provider-unavailable' (the registry default exposes no chat()), 'classifier-failed' (every attempt threw — `error` carries the last one). `to` names the agent and `fallback` says whether that agent is the fallback. `candidates` is what was actually ON THE BALLOT, in ballot order, so `index` — the classifier's own answer — indexes it directly; `excluded` names the specialists left off because they already handed off this turn, so the full eligible set is `candidates` ∪ `excluded`. `candidates` is absent on the four decisions that put nothing to a vote — 'pinned', 'single-candidate', 'no-specialists', 'ballot-exhausted'. It IS present on 'provider-unavailable', which is not an exception worth removing: the ballot was built there, it simply never got sent. `attempts` covers the retry ladder. `durationMs` is on EVERY routing.decided, and is the field to read when a decision looks wrong: the four decisions that can reach the fallback are told apart by the clock as much as by their name, because a fallback routing that resolved in tens of milliseconds made no network call at all whatever its `decision` says.\",\n \"kind:'event' type 'routing.decided'.`usage` — what that classifier call cost, in the same four-bucket + costUsd shape as `sessionUsage`, plus `model`. Absent on the decisions that make no call (see 'pinned' and the configuration ones). THIS SPEND IS NOT IN `sessionUsage`: a classifier call never enters the transcript and `sessionUsage` is derived from the transcript, so classifier cost is missing from the session total by construction, not by accident. Sum these events to close that gap — it is the one component of a session's real spend that the totals cannot see.\",\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it. For a turn that went to the wrong agent, read its routing.decided first — `decision` says whether anything was actually asked.',\n]",
6605
6803
  "description": "Human/agent-facing guide emitted as the first key of the exported debug log,\nso whoever opens the JSON (often an AI agent) knows how to read it without\nreverse-engineering the shape. Kept here next to the event catalogue it\ndescribes — but proximity alone demonstrably did NOT keep the two in sync\n(`refusal` was missing from both reason lists for a whole release), so\n`debug-event-log.test.ts` now asserts that every `TurnFailureReason` and every\n`SubAgentFailureReason` is named here, and fails the build when one is added\nwithout a matching sentence. Enumerations below read as exhaustive and WILL be\ntrusted by an agent reading the JSON — keep them so."
6606
6804
  }
6607
6805
  ],
@@ -11226,7 +11424,7 @@
11226
11424
  "kind": "field",
11227
11425
  "name": "subAgentFailure",
11228
11426
  "type": {
11229
- "text": "| {\n reason: SubAgentFailureReason;\n budget?: BudgetDetail;\n /**\n * The refusing vendor and kind, when a child hit the PROVIDER wall (GENC-1506).\n *\n * Carried for the same reason `budget` is: the child is a **separate driver instance**, so\n * nothing it sets on itself is visible to the parent. Without this the parent could report\n * `provider-refused` but not say which vendor or which kind — losing the only signal that\n * distinguishes \"top up the account\" from \"rotate the key\", since the user copy is cause-free.\n */\n providerRefused?: ProviderRefusedDetail;\n }\n | undefined"
11427
+ "text": "| {\n reason: SubAgentFailureReason;\n budget?: BudgetDetail;\n /**\n * The refusing vendor and kind, when a child hit the PROVIDER wall (GENC-1506).\n *\n * Carried for the same reason `budget` is: the child is a **separate driver instance**, so\n * nothing it sets on itself is visible to the parent. Without this the parent could report\n * `provider-refused` but not say which vendor or which kind — losing the only signal that\n * distinguishes \"top up the account\" from \"rotate the key\", since the user copy is cause-free.\n */\n providerRefused?: ProviderRefusedDetail;\n /** The AI service's refusal, when a child hit it (GENC-1611), so the parent can judge it. */\n aiServiceError?: AIServiceWall;\n }\n | undefined"
11230
11428
  },
11231
11429
  "privacy": "private",
11232
11430
  "description": "Set when a sub-agent's tool loop ends without `completeSubAgent` being\ncalled. Read by the parent's `invokeSubAgent` to build the `{ ok: false }`\nbranch of `requestSubAgent`. Only ever set when `isSubAgent` is true.\n\n`budget` rides along on a `'budget_exhausted'` failure so the parent inherits\nthe child's ATTRIBUTION, not just the fact of a wall — see\n`budgetWallDetail`."
@@ -11286,6 +11484,31 @@
11286
11484
  "privacy": "private",
11287
11485
  "description": "Detaches the lifecycle→turn abort link at turn end; set by `beginTurn`."
11288
11486
  },
11487
+ {
11488
+ "kind": "field",
11489
+ "name": "messageController",
11490
+ "privacy": "private",
11491
+ "default": "new AbortController()",
11492
+ "description": "The scope tool handlers see as `turnSignal`: one USER MESSAGE. Minted by `sendMessage`, so a\nhandoff's `continueFromHistory` — a new `turnController`, but the same message — keeps it,\nand a sub-agent inherits it (`inheritedTurnSignal`). Aborted by `cancel()` and by a dispose.\n`continueFromHistory` mints one only when the message it would continue was stopped.\n\nKept apart from `turnController`, which is per REQUEST and restarts on every continuation: a\nhandler that remembers something \"for the rest of the turn\" (the write tools' deny lock) keyed\non that one was reset by every handoff inside a single message."
11493
+ },
11494
+ {
11495
+ "kind": "field",
11496
+ "name": "unlinkLifecycleFromMessage",
11497
+ "type": {
11498
+ "text": "() => void | undefined"
11499
+ },
11500
+ "privacy": "private",
11501
+ "description": "Detaches the lifecycle→message abort link; replaced by the next `beginMessage`."
11502
+ },
11503
+ {
11504
+ "kind": "field",
11505
+ "name": "inheritedTurnSignal",
11506
+ "type": {
11507
+ "text": "AbortSignal | undefined"
11508
+ },
11509
+ "privacy": "private",
11510
+ "description": "A sub-agent runs inside its parent's message: the parent's `turnSignal`, handed down."
11511
+ },
11289
11512
  {
11290
11513
  "kind": "field",
11291
11514
  "name": "activeProviderInput",
@@ -11485,42 +11708,98 @@
11485
11708
  "kind": "field",
11486
11709
  "name": "budgetExhaustedMessageOverride",
11487
11710
  "type": {
11488
- "text": "string | undefined"
11711
+ "text": "string | undefined"
11712
+ },
11713
+ "privacy": "private",
11714
+ "readonly": true,
11715
+ "description": "Host override for the budget-wall transcript copy, used verbatim — see\n`ChatDriverConfig.budgetExhaustedMessage`. `undefined` means no override,\nand the bubble is composed per wall by ChatDriver.budgetExhaustedBubble.",
11716
+ "default": "budgetExhaustedMessage"
11717
+ },
11718
+ {
11719
+ "kind": "field",
11720
+ "name": "providerRefusedMessageOverride",
11721
+ "type": {
11722
+ "text": "string | undefined"
11723
+ },
11724
+ "privacy": "private",
11725
+ "readonly": true,
11726
+ "description": "Host override for the provider-refusal sentence, from\n`ChatDriverConfig.providerRefusedMessage`. `undefined` means no override, so the shipped default\nis used verbatim.",
11727
+ "default": "providerRefusedMessage"
11728
+ },
11729
+ {
11730
+ "kind": "field",
11731
+ "name": "providerRefusedThisTurn",
11732
+ "type": {
11733
+ "text": "boolean"
11734
+ },
11735
+ "privacy": "private",
11736
+ "default": "false",
11737
+ "description": "A provider refusal was observed this turn, so the tool loop must not call the model again\n(GENC-1506).\n\nExists for the SUB-AGENT path only, exactly like `budgetExhaustedThisTurn`: this driver's own\nrefusal returns straight out of the catch, whereas a child's refusal reaches the parent as a tool\nresult, and without this flag the loop would issue another call into the same wall — N batched\nchildren costing N doomed calls plus a doomed parent one."
11738
+ },
11739
+ {
11740
+ "kind": "field",
11741
+ "name": "providerRefusedDetail",
11742
+ "type": {
11743
+ "text": "ProviderRefusedDetail | undefined"
11744
+ },
11745
+ "privacy": "private",
11746
+ "description": "The refusal detail latched off a sub-agent's failure, for the parent's own result."
11747
+ },
11748
+ {
11749
+ "kind": "field",
11750
+ "name": "aiServiceErrorMessagesOverride",
11751
+ "type": {
11752
+ "text": "Partial<Record<AIServiceRefusal, string>> | undefined"
11753
+ },
11754
+ "privacy": "private",
11755
+ "readonly": true,
11756
+ "description": "Host overrides for the AI service error sentences (`ChatDriverConfig.aiServiceErrorMessages`).",
11757
+ "default": "aiServiceErrorMessages"
11758
+ },
11759
+ {
11760
+ "kind": "field",
11761
+ "name": "aiServiceErrorThisTurn",
11762
+ "type": {
11763
+ "text": "boolean"
11764
+ },
11765
+ "privacy": "private",
11766
+ "default": "false",
11767
+ "description": "A sub-agent was refused by the AI service this turn in a way that stops this driver too\n(GENC-1611): a service-wide code, from the vendor this driver calls. Sub-agent path only, like\n`providerRefusedThisTurn`; this driver's own refusal returns straight out of the catch."
11768
+ },
11769
+ {
11770
+ "kind": "field",
11771
+ "name": "aiServiceWall",
11772
+ "type": {
11773
+ "text": "AIServiceWall | undefined"
11489
11774
  },
11490
11775
  "privacy": "private",
11491
- "readonly": true,
11492
- "description": "Host override for the budget-wall transcript copy, used verbatim — see\n`ChatDriverConfig.budgetExhaustedMessage`. `undefined` means no override,\nand the bubble is composed per wall by ChatDriver.budgetExhaustedBubble.",
11493
- "default": "budgetExhaustedMessage"
11776
+ "description": "The refusal latched off that sub-agent's failure, first one wins."
11494
11777
  },
11495
11778
  {
11496
11779
  "kind": "field",
11497
- "name": "providerRefusedMessageOverride",
11780
+ "name": "hostAIServiceNotice",
11498
11781
  "type": {
11499
- "text": "string | undefined"
11782
+ "text": "(code: AIServiceRefusal) => void | undefined"
11500
11783
  },
11501
11784
  "privacy": "private",
11502
- "readonly": true,
11503
- "description": "Host override for the provider-refusal sentence, from\n`ChatDriverConfig.providerRefusedMessage`. `undefined` means no override, so the shipped default\nis used verbatim.",
11504
- "default": "providerRefusedMessage"
11785
+ "description": "Where a sub-agent sends the code of a refusal it absorbed: its parent, and from there up to the\ndriver whose transcript the user sees."
11505
11786
  },
11506
11787
  {
11507
11788
  "kind": "field",
11508
- "name": "providerRefusedThisTurn",
11509
- "type": {
11510
- "text": "boolean"
11511
- },
11789
+ "name": "aiServiceNoticesShown",
11512
11790
  "privacy": "private",
11513
- "default": "false",
11514
- "description": "A provider refusal was observed this turn, so the tool loop must not call the model again\n(GENC-1506).\n\nExists for the SUB-AGENT path only, exactly like `budgetExhaustedThisTurn`: this driver's own\nrefusal returns straight out of the catch, whereas a child's refusal reaches the parent as a tool\nresult, and without this flag the loop would issue another call into the same wall — N batched\nchildren costing N doomed calls plus a doomed parent one."
11791
+ "default": "new Set<AIServiceRefusal>()",
11792
+ "description": "Codes a child's refusal was already shown for during this user message."
11515
11793
  },
11516
11794
  {
11517
11795
  "kind": "field",
11518
- "name": "providerRefusedDetail",
11796
+ "name": "aiServiceNoticesQueued",
11519
11797
  "type": {
11520
- "text": "ProviderRefusedDetail | undefined"
11798
+ "text": "AIServiceRefusal[]"
11521
11799
  },
11522
11800
  "privacy": "private",
11523
- "description": "The refusal detail latched off a sub-agent's failure, for the parent's own result."
11801
+ "default": "[]",
11802
+ "description": "Notices waiting for the tool batch to end. Written mid-batch they would sit between the\nassistant's tool calls and their results, where a later sub-agent's primer would pick up the\nunanswered calls."
11524
11803
  },
11525
11804
  {
11526
11805
  "kind": "field",
@@ -11569,7 +11848,18 @@
11569
11848
  "text": "void"
11570
11849
  }
11571
11850
  },
11572
- "description": "Stop the current turn (user \"stop\" button). Aborts the in-flight provider\nrequest immediately; if a tool is mid-execution it runs to completion and\nthe loop bails at the next boundary (tools are atomic). No-op when idle.\nThe driver stays usable for the next message."
11851
+ "description": "Stop the current turn (user \"stop\" button). Aborts the in-flight provider\nrequest immediately; if a tool is mid-execution it runs to completion and\nthe loop bails at the next boundary (tools are atomic). When idle it only ends\nthe message (see below) and appends nothing. The driver stays usable for the\nnext message."
11852
+ },
11853
+ {
11854
+ "kind": "method",
11855
+ "name": "beginMessage",
11856
+ "privacy": "private",
11857
+ "return": {
11858
+ "type": {
11859
+ "text": "void"
11860
+ }
11861
+ },
11862
+ "description": "Start a fresh per-MESSAGE scope for tool handlers (see `messageController`). Chained to\n`lifecycleController` so a dispose aborts it; the link lives until the next message, because\na handoff continues this one."
11573
11863
  },
11574
11864
  {
11575
11865
  "kind": "method",
@@ -11624,7 +11914,7 @@
11624
11914
  "name": "overrides",
11625
11915
  "optional": true,
11626
11916
  "type": {
11627
- "text": "{\n copy?: string;\n budget?: BudgetDetail;\n providerRefused?: ProviderRefusedDetail;\n }"
11917
+ "text": "{\n copy?: string;\n budget?: BudgetDetail;\n providerRefused?: ProviderRefusedDetail;\n aiServiceError?: AIServiceWall;\n /** The user was already told, so the turn ends without saying it again. */\n silent?: boolean;\n }"
11628
11918
  }
11629
11919
  }
11630
11920
  ],
@@ -11665,6 +11955,148 @@
11665
11955
  },
11666
11956
  "description": "The sentence shown when the upstream provider refuses (GENC-1506).\n\nDeliberately far simpler than `budgetExhaustedBubble`: no vendor name, no figures, no\nswitch-provider advice, and no branching on `kind`. The copy is cause-free by design — a user who\ncan see their own remaining spend must not be told about a limit, and we must not imply the bill\nhas gone unpaid — so there is nothing here to compose. A host override wins verbatim."
11667
11957
  },
11958
+ {
11959
+ "kind": "method",
11960
+ "name": "reportAIServiceError",
11961
+ "return": {
11962
+ "type": {
11963
+ "text": "ChatDriverResult"
11964
+ }
11965
+ },
11966
+ "parameters": [
11967
+ {
11968
+ "name": "e",
11969
+ "type": {
11970
+ "text": "AIServiceError"
11971
+ }
11972
+ },
11973
+ {
11974
+ "name": "pendingUserMessage",
11975
+ "optional": true,
11976
+ "type": {
11977
+ "text": "ChatMessage"
11978
+ },
11979
+ "description": "the user's message when it has NOT been appended yet, for the reason\n`reportBudgetExhausted` gives."
11980
+ }
11981
+ ],
11982
+ "description": "A terminal AI service error hit **outside** the tool loop — `OrchestratingDriver`'s classification\nphase (GENC-1611). The same log line, debug-log entry, sentence and result as the in-loop branch."
11983
+ },
11984
+ {
11985
+ "kind": "method",
11986
+ "name": "aiServiceErrorBubble",
11987
+ "privacy": "private",
11988
+ "return": {
11989
+ "type": {
11990
+ "text": "string"
11991
+ }
11992
+ },
11993
+ "parameters": [
11994
+ {
11995
+ "name": "code",
11996
+ "optional": true,
11997
+ "type": {
11998
+ "text": "AIServiceRefusal"
11999
+ }
12000
+ }
12001
+ ],
12002
+ "description": "The sentence for an AI service error code (GENC-1611): the host's override, else the default.\nNever the service's own text, which goes to the console only."
12003
+ },
12004
+ {
12005
+ "kind": "method",
12006
+ "name": "noticeAIServiceRefusal",
12007
+ "privacy": "private",
12008
+ "return": {
12009
+ "type": {
12010
+ "text": "void"
12011
+ }
12012
+ },
12013
+ "parameters": [
12014
+ {
12015
+ "name": "code",
12016
+ "type": {
12017
+ "text": "AIServiceRefusal"
12018
+ }
12019
+ }
12020
+ ],
12021
+ "description": "Shows a sub-agent's AI-service refusal that the turn went on without, once per code in a user\nmessage: the user's sentence with the host's overrides, never the service's text. A sub-agent\npasses it up to the driver the user sees."
12022
+ },
12023
+ {
12024
+ "kind": "method",
12025
+ "name": "flushAIServiceNotices",
12026
+ "privacy": "private",
12027
+ "return": {
12028
+ "type": {
12029
+ "text": "void"
12030
+ }
12031
+ },
12032
+ "description": "Writes the notices queued during a tool batch, once its results are in the history, or before\nthe failure when the batch threw. A code counts as shown only once written."
12033
+ },
12034
+ {
12035
+ "kind": "method",
12036
+ "name": "endTurnWithAIServiceError",
12037
+ "privacy": "private",
12038
+ "return": {
12039
+ "type": {
12040
+ "text": "ChatDriverResult"
12041
+ }
12042
+ },
12043
+ "parameters": [
12044
+ {
12045
+ "name": "e",
12046
+ "type": {
12047
+ "text": "AIServiceError"
12048
+ }
12049
+ }
12050
+ ],
12051
+ "description": "Ends the turn on an AI service error: logged with the service's text, shown without it."
12052
+ },
12053
+ {
12054
+ "kind": "method",
12055
+ "name": "aiServiceSentenceShown",
12056
+ "privacy": "private",
12057
+ "return": {
12058
+ "type": {
12059
+ "text": "boolean"
12060
+ }
12061
+ },
12062
+ "parameters": [
12063
+ {
12064
+ "name": "code",
12065
+ "type": {
12066
+ "text": "AIServiceRefusal | undefined"
12067
+ }
12068
+ }
12069
+ ],
12070
+ "description": "Whether this user message already showed the sentence for `code`, so a turn-ending failure\ndoes not show it twice. Marks it shown otherwise. Only the driver the user sees keeps count."
12071
+ },
12072
+ {
12073
+ "kind": "method",
12074
+ "name": "subAgentWallThisTurn",
12075
+ "privacy": "private",
12076
+ "return": {
12077
+ "type": {
12078
+ "text": "boolean"
12079
+ }
12080
+ },
12081
+ "parameters": [
12082
+ {
12083
+ "name": "handingOff",
12084
+ "default": "false"
12085
+ }
12086
+ ],
12087
+ "description": "Whether a sub-agent hit a wall this turn that stops this driver too. A handoff goes on past an\nAI-service wall: the next agent may use another vendor, and if it uses this one its own call\nmeets the wall and says so."
12088
+ },
12089
+ {
12090
+ "kind": "method",
12091
+ "name": "endTurnOnSubAgentWall",
12092
+ "privacy": "private",
12093
+ "return": {
12094
+ "type": {
12095
+ "text": "ChatDriverResult | undefined"
12096
+ }
12097
+ },
12098
+ "description": "Ends the turn when a sub-agent hit a wall this turn that stops this driver too: the provider\nrefusing the account, the AI service (GENC-1611), or the budget. Checked before each model call,\nand again right after a tool batch, before a handoff or the iteration cap can report the turn as\nsomething else."
12099
+ },
11668
12100
  {
11669
12101
  "kind": "method",
11670
12102
  "name": "failureReasonOf",
@@ -11939,7 +12371,7 @@
11939
12371
  "name": "getSubAgentFailure",
11940
12372
  "return": {
11941
12373
  "type": {
11942
- "text": "| {\n reason: SubAgentFailureReason;\n budget?: BudgetDetail;\n providerRefused?: ProviderRefusedDetail;\n }\n | undefined"
12374
+ "text": "| {\n reason: SubAgentFailureReason;\n budget?: BudgetDetail;\n providerRefused?: ProviderRefusedDetail;\n aiServiceError?: AIServiceWall;\n }\n | undefined"
11943
12375
  }
11944
12376
  },
11945
12377
  "description": "Returns the typed failure recorded when a sub-agent run ended without\n`completeSubAgent`, if any. Called by a parent `ChatDriver` after running\nthis instance as a sub-agent."
@@ -11973,6 +12405,13 @@
11973
12405
  "type": {
11974
12406
  "text": "ProviderRefusedDetail"
11975
12407
  }
12408
+ },
12409
+ {
12410
+ "name": "aiServiceError",
12411
+ "optional": true,
12412
+ "type": {
12413
+ "text": "AIServiceWall"
12414
+ }
11976
12415
  }
11977
12416
  ],
11978
12417
  "description": "Record a sub-agent failure reason (first one wins). No-op for top-level\nagents, so loop-exit sites can call it unconditionally. The parent reads\nthis via `getSubAgentFailure()` and emits the `subagent.failed` meta event\nunder its *own* session — see `invokeSubAgent`. (A child sub-agent runs\nunder a separate session key, so recording here would orphan the event off\nthe user-visible debug-log timeline.)"
@@ -12540,7 +12979,7 @@
12540
12979
  "privacy": "private",
12541
12980
  "return": {
12542
12981
  "type": {
12543
- "text": "Promise<{\n // Closed union (see ChatToolHandlers.requestSubAgent) — keeps `result`/`reason`\n // accessible for consumers compiled without strictNullChecks.\n outcome:\n | { ok: true; result: T; reason?: never }\n | { ok: false; result?: never; reason: SubAgentFailureReason };\n trace: ChatMessage[];\n }>"
12982
+ "text": "Promise<{\n // Closed union (see ChatToolHandlers.requestSubAgent) — keeps `result`/`reason`\n // accessible for consumers compiled without strictNullChecks.\n outcome: SubAgentOutcome<T>;\n trace: ChatMessage[];\n }>"
12544
12983
  }
12545
12984
  },
12546
12985
  "parameters": [
@@ -13216,18 +13655,18 @@
13216
13655
  "type": {
13217
13656
  "text": "object"
13218
13657
  },
13219
- "default": "{\n contextGuard: {\n subReason: 'context_exhausted',\n resultReason: 'context-exhausted',\n copy:\n 'I had to stop here — this conversation has filled the available context. ' +\n 'Compact it to free up room, then ask me to continue.',\n },\n contextOverflow: {\n subReason: 'context_exhausted',\n resultReason: 'context-exhausted',\n copy: DEFAULT_CONTEXT_OVERFLOW_MESSAGE,\n },\n malformedToolCall: {\n subReason: 'malformed_tool_call',\n // Not `malformed-tool-call`: the main-turn reason is named after the provider finish\n // reason (`MALFORMED_FUNCTION_CALL`) that produces it, and is part of the published\n // TurnFailureReason union, so the two names cannot be brought into line here.\n resultReason: 'malformed-function-call',\n copy: 'While working on your request, I repeatedly called my tools incorrectly. This often works on a second try — would you like me to try again? If it happens again, try breaking your request into smaller steps.',\n },\n responseTruncated: {\n subReason: 'response_truncated',\n resultReason: 'response-truncated',\n copy: 'My response was cut off because a single step reached the model output limit. This usually means one step tried to produce too much at once — try breaking your request into smaller steps.',\n },\n timeout: {\n subReason: 'timeout',\n // There is no `timeout` member of TurnFailureReason, so the main turn reports the\n // generic `exception`. A sub-agent gets the specific reason because its parent\n // branches on it to decide whether a retry is worth attempting.\n resultReason: 'exception',\n copy: 'The request timed out. You can ask me to try again, or break this into a smaller step.',\n },\n unknownToolLimit: {\n subReason: 'unknown_tool_limit',\n resultReason: 'unknown-tool-limit',\n copy: \"I'm sorry, I repeatedly tried to use tools that aren't available to me, so I couldn't complete that. If a 'Download agent log' option appears in the Settings (cog) menu, you can download the log and share it with whoever set up this assistant to help fix the issue.\",\n },\n maxIterations: {\n subReason: 'max_iterations',\n resultReason: 'max-iterations',\n copy: \"I've reached my limit for this response. You can ask me to continue and I'll pick up where I left off.\",\n },\n refusal: {\n subReason: 'refusal',\n resultReason: 'refusal',\n copy: 'This request was declined. Try rephrasing it, or breaking it into smaller steps.',\n },\n emptyResponse: {\n subReason: 'empty_response',\n resultReason: 'empty-response',\n copy: 'While working on your request, I repeatedly generated a blank response. This often works on a second try — would you like me to try again? If it happens again, try breaking your request into smaller steps.',\n },\n providerRefused: {\n subReason: 'provider_refused',\n resultReason: 'provider-refused',\n // Overridden per wall by `ChatDriver.providerRefusedBubble`, which prefers a\n // host-supplied message; this is the fallback that method returns.\n copy: DEFAULT_PROVIDER_REFUSED_MESSAGE,\n },\n budgetExhausted: {\n subReason: 'budget_exhausted',\n resultReason: 'budget-exhausted',\n // Overridden per wall by `ChatDriver.budgetExhaustedBubble`, which upgrades this with\n // \"switch to another AI\" when a second vendor is reachable.\n copy: DEFAULT_BUDGET_EXHAUSTED_MESSAGE,\n },\n // `satisfies`, not an annotation: an annotation would widen `resultReason` to\n // `TurnFailureReason` and cost the literal types that let `turn-failures.test.ts` pin the\n // two deliberate divergences at compile time instead of at runtime.\n}",
13220
- "description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nThree entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
13658
+ "default": "{\n contextGuard: {\n subReason: 'context_exhausted',\n resultReason: 'context-exhausted',\n copy:\n 'I had to stop here — this conversation has filled the available context. ' +\n 'Compact it to free up room, then ask me to continue.',\n },\n contextOverflow: {\n subReason: 'context_exhausted',\n resultReason: 'context-exhausted',\n copy: DEFAULT_CONTEXT_OVERFLOW_MESSAGE,\n },\n malformedToolCall: {\n subReason: 'malformed_tool_call',\n // Not `malformed-tool-call`: the main-turn reason is named after the provider finish\n // reason (`MALFORMED_FUNCTION_CALL`) that produces it, and is part of the published\n // TurnFailureReason union, so the two names cannot be brought into line here.\n resultReason: 'malformed-function-call',\n copy: 'While working on your request, I repeatedly called my tools incorrectly. This often works on a second try — would you like me to try again? If it happens again, try breaking your request into smaller steps.',\n },\n responseTruncated: {\n subReason: 'response_truncated',\n resultReason: 'response-truncated',\n copy: 'My response was cut off because a single step reached the model output limit. This usually means one step tried to produce too much at once — try breaking your request into smaller steps.',\n },\n timeout: {\n subReason: 'timeout',\n // There is no `timeout` member of TurnFailureReason, so the main turn reports the\n // generic `exception`. A sub-agent gets the specific reason because its parent\n // branches on it to decide whether a retry is worth attempting.\n resultReason: 'exception',\n copy: 'The request timed out. You can ask me to try again, or break this into a smaller step.',\n },\n unknownToolLimit: {\n subReason: 'unknown_tool_limit',\n resultReason: 'unknown-tool-limit',\n copy: \"I'm sorry, I repeatedly tried to use tools that aren't available to me, so I couldn't complete that. If a 'Download agent log' option appears in the Settings (cog) menu, you can download the log and share it with whoever set up this assistant to help fix the issue.\",\n },\n maxIterations: {\n subReason: 'max_iterations',\n resultReason: 'max-iterations',\n copy: \"I've reached my limit for this response. You can ask me to continue and I'll pick up where I left off.\",\n },\n refusal: {\n subReason: 'refusal',\n resultReason: 'refusal',\n copy: 'This request was declined. Try rephrasing it, or breaking it into smaller steps.',\n },\n emptyResponse: {\n subReason: 'empty_response',\n resultReason: 'empty-response',\n copy: 'While working on your request, I repeatedly generated a blank response. This often works on a second try — would you like me to try again? If it happens again, try breaking your request into smaller steps.',\n },\n providerRefused: {\n subReason: 'provider_refused',\n resultReason: 'provider-refused',\n // Overridden per wall by `ChatDriver.providerRefusedBubble`, which prefers a\n // host-supplied message; this is the fallback that method returns.\n copy: DEFAULT_PROVIDER_REFUSED_MESSAGE,\n },\n budgetExhausted: {\n subReason: 'budget_exhausted',\n resultReason: 'budget-exhausted',\n // Overridden per wall by `ChatDriver.budgetExhaustedBubble`, which upgrades this with\n // \"switch to another AI\" when a second vendor is reachable.\n copy: DEFAULT_BUDGET_EXHAUSTED_MESSAGE,\n },\n aiServiceError: {\n subReason: 'ai_service_error',\n resultReason: 'ai-service-error',\n // Replaced per code by `ChatDriver.aiServiceErrorBubble`; this is only what a parent says when\n // a child's failure arrives without its code.\n copy: DEFAULT_AI_SERVICE_ERROR_MESSAGES.BAD_REQUEST,\n },\n // `satisfies`, not an annotation: an annotation would widen `resultReason` to\n // `TurnFailureReason` and cost the literal types that let `turn-failures.test.ts` pin the\n // two deliberate divergences at compile time instead of at runtime.\n}",
13659
+ "description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nFour entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
13221
13660
  },
13222
13661
  {
13223
13662
  "kind": "variable",
13224
13663
  "name": "satisfies",
13225
- "description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nThree entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
13664
+ "description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nFour entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
13226
13665
  },
13227
13666
  {
13228
13667
  "kind": "variable",
13229
13668
  "name": "Record",
13230
- "description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nThree entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
13669
+ "description": "The terminal outcomes of a tool loop.\n\n`contextGuard` and `contextOverflow` share a `subReason` because one failure is reached\ntwo ways the user experiences differently: the guard stops at the edge of the window with\nthe transcript intact, so its copy can point at compaction, while an overflow means the\nprovider has already rejected the request.\n\nFour entries take their copy from `@genesislcap/foundation-ai`, which owns the default\nmessage for every failure it also exports an error class for. The rest is for conditions\nthis driver detects itself, which have no upstream home."
13231
13670
  },
13232
13671
  {
13233
13672
  "kind": "function",
@@ -13844,7 +14283,7 @@
13844
14283
  },
13845
14284
  "privacy": "private",
13846
14285
  "readonly": true,
13847
- "default": "new ChatDriver(providerRegistry, {\n maxToolIterations: options.maxToolIterations,\n maxFoldOperations: options.maxFoldOperations,\n maxTurnSnapshots: options.maxTurnSnapshots,\n sessionKey: this.sessionKey,\n activityBus: options.activityBus,\n budgetExhaustedMessage: options.budgetExhaustedMessage,\n // This driver releases after the turn so it can fire the host-facing events; see the option.\n deferAgentRelease: true,\n })"
14286
+ "default": "new ChatDriver(providerRegistry, {\n maxToolIterations: options.maxToolIterations,\n maxFoldOperations: options.maxFoldOperations,\n maxTurnSnapshots: options.maxTurnSnapshots,\n sessionKey: this.sessionKey,\n activityBus: options.activityBus,\n budgetExhaustedMessage: options.budgetExhaustedMessage,\n aiServiceErrorMessages: options.aiServiceErrorMessages,\n // This driver releases after the turn so it can fire the host-facing events; see the option.\n deferAgentRelease: true,\n })"
13848
14287
  },
13849
14288
  {
13850
14289
  "kind": "field",
@@ -15047,7 +15486,7 @@
15047
15486
  {
15048
15487
  "kind": "variable",
15049
15488
  "name": "WriteReviewStyles",
15050
- "default": "css`\n :host {\n display: block;\n font: inherit;\n\n /* The diff tints — see the diff rules below for why they are backgrounds only. */\n --write-review-added: color-mix(in srgb, var(--success-fill-rest, #2da44e) 18%, transparent);\n --write-review-removed: color-mix(in srgb, var(--error-fill-rest, #cf222e) 18%, transparent);\n }\n\n /*\n * The review mounts inside the chat bubble's dialog content, which is overflow: hidden — so a\n * wide event's columns were CLIPPED rather than pushed off screen, with no scrollbar to say\n * anything was missing. A user approving values they cannot see is the failure this whole\n * component exists to prevent, so the table scrolls within itself.\n */\n .scroller {\n overflow-x: auto;\n max-width: 100%;\n }\n\n table {\n border-collapse: collapse;\n width: 100%;\n }\n\n th,\n td {\n border-bottom: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest);\n padding: calc(var(--design-unit, 4) * 1px) calc(var(--design-unit, 4) * 2px);\n text-align: left;\n }\n\n /* A heading is a column name: kept on one line. */\n th {\n white-space: nowrap;\n }\n\n /*\n * A value is never clipped. Every character stays on screen.\n *\n * Clipping was the first bound, and the wrong one: 24ch with an ellipsis cut the END of every\n * cell, which in a changed cell is the NEW value, so the user approved a value they never saw.\n * No cell is safe to clip either. An insert has no pre-image, so none of its cells is\n * \"changed\", and every one of them is a value being written; a delete's cells are the record\n * being removed; and a title attribute holding the full text reaches nobody on a keyboard or a\n * touch screen.\n *\n * A SHORT value stays whole on one line, and the table scrolls. Wrapping every cell broke a\n * short value mid-token in a squeezed table — \"101.\" over \"2345\" — and the first line could\n * pass for the whole value.\n *\n * A LONG value (review-model marks it) wraps within a bound. With no bound at all, one long\n * value (a NOTE another user wrote) widened its column until the changed one sat out of view,\n * behind a scrollbar an overlay-scrollbar platform does not draw until you scroll.\n */\n td {\n white-space: nowrap;\n }\n\n td.long {\n white-space: normal;\n overflow-wrap: anywhere;\n\n /*\n * A floor as well as a ceiling. With only the ceiling, a squeezed table shrank a long value's\n * column to a sliver (a 100-character note became 22 lines of a few characters each) while\n * the one-line cells kept their width. The table scrolls instead.\n */\n min-width: 20ch;\n max-width: 40ch;\n }\n\n /*\n * The two marks this table carries — \"this field is changing\" and \"this field decides which\n * record disappears\" — were weight, colour and a strike-through only. None of that reaches\n * somebody using a screen reader, who is the one approver with no other way to tell, so each\n * mark has words as well.\n */\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n\n /*\n * A delete shows the whole record and sends its key alone, so the fields that actually decide\n * which record disappears are marked. Not colour alone — an underline carries to a user who\n * cannot distinguish it.\n */\n td.identifying {\n font-weight: 600;\n text-decoration: underline;\n }\n\n /*\n * The diff, the way a code review shows one: what goes is tinted as removed and struck through,\n * what comes in is tinted as added and bold. Only the BACKGROUND is tinted, at low alpha, from\n * the theme's own success and error tokens (with fallbacks, as foundation-forms does), and the\n * text keeps the normal foreground colour: coloured text on a coloured ground is where contrast\n * fails, dark mode first. The tint is never the only signal. Strike-through, weight, the visible\n * + and − marks and the spoken \"was\" and \"now\" all carry the same thing without colour.\n */\n\n /* The mark a user's eye needs: this field is being changed. */\n td.changed {\n font-weight: 600;\n }\n\n /* On its own line above the new value, so neither can push the other out of view. */\n td.changed .was {\n display: block;\n font-weight: 400;\n text-decoration: line-through;\n background: var(--write-review-removed);\n }\n\n td.changed .now {\n display: block;\n background: var(--write-review-added);\n }\n\n /* Room inside the tint, so the − and + do not sit on its edge. */\n td.changed .was,\n td.changed .now {\n padding-inline: calc(var(--design-unit, 4) * 1px);\n }\n\n /*\n * A row that will not be written is never tinted, not even inside a cell. For a refused row\n * review-model already gives it no changed cells, and this is the second guard. For a row the\n * resolved review did not approve, the − and + stay as the record of what was proposed, but\n * without the tint that says it will happen.\n */\n tr.refused td.changed .was,\n tr.refused td.changed .now,\n tr.unwritten td.changed .was,\n tr.unwritten td.changed .now {\n background: none;\n }\n\n /* A whole row coming in, or going. A refused row is neither, and keeps its muted look. */\n tr.added td {\n background: var(--write-review-added);\n }\n\n tr.removed td {\n background: var(--write-review-removed);\n }\n\n /*\n * A closed review's row that was not approved says so in words — without them, a denied modify\n * read in greyscale or by a screen reader exactly like an approved one.\n */\n .not-written {\n margin-inline-start: calc(var(--design-unit, 4) * 1.5px);\n font-size: var(--type-ramp-minus-1-font-size, 0.875em);\n color: var(--neutral-foreground-hint);\n }\n\n /* The empty placeholder: a style no row text can take, so a literal \"(blank)\" cannot pass for it. */\n .blank {\n font-style: italic;\n font-weight: 400;\n color: var(--neutral-foreground-hint);\n }\n\n .mark {\n font-weight: 600;\n padding-inline-end: calc(var(--design-unit, 4) * 1px);\n user-select: none;\n }\n\n /* The row's + or − sits beside its checkbox, not on the baseline under it (where − reads as _). */\n td.select {\n white-space: nowrap;\n }\n\n td.select rapid-checkbox,\n td.select .mark {\n vertical-align: middle;\n }\n\n /* A gap from the checkbox, so the mark reads as the row's sign rather than part of the box. */\n td.select .mark {\n margin-inline-start: calc(var(--design-unit, 4) * 1.5px);\n }\n\n /* The strike-through belongs to the value, not to its − mark. */\n td.changed .was .mark {\n display: inline-block;\n text-decoration: none;\n }\n\n tr.refused {\n color: var(--neutral-foreground-hint);\n }\n\n /* A refusal is a sentence, and it spans the table: it wraps rather than running off it. */\n .problems {\n color: var(--error-fill-rest, #c00);\n white-space: normal;\n }\n\n .actions {\n display: flex;\n gap: calc(var(--design-unit, 4) * 2px);\n margin-top: calc(var(--design-unit, 4) * 2px);\n }\n`"
15489
+ "default": "css`\n :host {\n display: block;\n font: inherit;\n\n /* The diff tints — see the diff rules below for why they are backgrounds only. */\n --write-review-added: color-mix(in srgb, var(--success-fill-rest, #2da44e) 18%, transparent);\n --write-review-removed: color-mix(in srgb, var(--error-fill-rest, #cf222e) 18%, transparent);\n }\n\n /*\n * The review mounts inside the chat bubble's dialog content, which is overflow: hidden — so a\n * wide event's columns were CLIPPED rather than pushed off screen, with no scrollbar to say\n * anything was missing. A user approving values they cannot see is the failure this whole\n * component exists to prevent, so the table scrolls within itself.\n */\n .scroller {\n overflow-x: auto;\n max-width: 100%;\n }\n\n table {\n border-collapse: collapse;\n width: 100%;\n }\n\n th,\n td {\n border-bottom: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest);\n padding: calc(var(--design-unit, 4) * 1px) calc(var(--design-unit, 4) * 2px);\n text-align: left;\n }\n\n /* A heading is a column name: kept on one line. */\n th {\n white-space: nowrap;\n }\n\n /*\n * A value is never clipped. Every character stays on screen.\n *\n * Clipping was the first bound, and the wrong one: 24ch with an ellipsis cut the END of every\n * cell, which in a changed cell is the NEW value, so the user approved a value they never saw.\n * No cell is safe to clip either. An insert has no pre-image, so none of its cells is\n * \"changed\", and every one of them is a value being written; a delete's cells are the record\n * being removed; and a title attribute holding the full text reaches nobody on a keyboard or a\n * touch screen.\n *\n * A SHORT value stays whole on one line, and the table scrolls. Wrapping every cell broke a\n * short value mid-token in a squeezed table — \"101.\" over \"2345\" — and the first line could\n * pass for the whole value.\n *\n * A LONG value (review-model marks it) wraps within a bound. With no bound at all, one long\n * value (a NOTE another user wrote) widened its column until the changed one sat out of view,\n * behind a scrollbar an overlay-scrollbar platform does not draw until you scroll.\n */\n td {\n white-space: nowrap;\n }\n\n td.long {\n white-space: normal;\n overflow-wrap: anywhere;\n\n /*\n * A floor as well as a ceiling. With only the ceiling, a squeezed table shrank a long value's\n * column to a sliver (a 100-character note became 22 lines of a few characters each) while\n * the one-line cells kept their width. The table scrolls instead.\n */\n min-width: 20ch;\n max-width: 40ch;\n }\n\n /*\n * The two marks this table carries — \"this field is changing\" and \"this field decides which\n * record disappears\" — were weight, colour and a strike-through only. None of that reaches\n * somebody using a screen reader, who is the one approver with no other way to tell, so each\n * mark has words as well.\n */\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n\n /*\n * A delete shows the whole record and sends its key alone, so the fields that actually decide\n * which record disappears are marked. Not colour alone — an underline carries to a user who\n * cannot distinguish it.\n */\n td.identifying {\n font-weight: 600;\n text-decoration: underline;\n }\n\n /*\n * The diff, the way a code review shows one: what goes is tinted as removed and struck through,\n * what comes in is tinted as added and bold. Only the BACKGROUND is tinted, at low alpha, from\n * the theme's own success and error tokens (with fallbacks, as foundation-forms does), and the\n * text keeps the normal foreground colour: coloured text on a coloured ground is where contrast\n * fails, dark mode first. The tint is never the only signal. Strike-through, weight, the visible\n * + and − marks and the spoken \"was\" and \"now\" all carry the same thing without colour.\n */\n\n /* The mark a user's eye needs: this field is being changed. */\n td.changed {\n font-weight: 600;\n }\n\n /* On its own line above the new value, so neither can push the other out of view. */\n td.changed .was {\n display: block;\n font-weight: 400;\n text-decoration: line-through;\n background: var(--write-review-removed);\n }\n\n td.changed .now {\n display: block;\n background: var(--write-review-added);\n }\n\n /* Room inside the tint, so the − and + do not sit on its edge. */\n td.changed .was,\n td.changed .now {\n padding-inline: calc(var(--design-unit, 4) * 1px);\n }\n\n /*\n * A row that will not be written is never tinted, not even inside a cell. For a refused row\n * review-model already gives it no changed cells, and this is the second guard. For a row the\n * resolved review did not approve, the − and + stay as the record of what was proposed, but\n * without the tint that says it will happen.\n */\n tr.refused td.changed .was,\n tr.refused td.changed .now,\n tr.unwritten td.changed .was,\n tr.unwritten td.changed .now {\n background: none;\n }\n\n /* A whole row coming in, or going. A refused row is neither, and keeps its muted look. */\n tr.added td {\n background: var(--write-review-added);\n }\n\n tr.removed td {\n background: var(--write-review-removed);\n }\n\n /*\n * A closed review's row that was not approved says so in words — without them, a denied modify\n * read in greyscale or by a screen reader exactly like an approved one.\n */\n .not-written {\n margin-inline-start: calc(var(--design-unit, 4) * 1.5px);\n font-size: var(--type-ramp-minus-1-font-size, 0.875em);\n color: var(--neutral-foreground-hint);\n }\n\n /* The empty placeholder: a style no row text can take, so a literal \"(blank)\" cannot pass for it. */\n .blank {\n font-style: italic;\n font-weight: 400;\n color: var(--neutral-foreground-hint);\n }\n\n .mark {\n font-weight: 600;\n padding-inline-end: calc(var(--design-unit, 4) * 1px);\n user-select: none;\n }\n\n /* The row's + or − sits beside its checkbox, not on the baseline under it (where − reads as _). */\n td.select {\n white-space: nowrap;\n }\n\n td.select rapid-checkbox,\n td.select .mark {\n vertical-align: middle;\n }\n\n /* A gap from the checkbox, so the mark reads as the row's sign rather than part of the box. */\n td.select .mark {\n margin-inline-start: calc(var(--design-unit, 4) * 1.5px);\n }\n\n /* The strike-through belongs to the value, not to its − mark. */\n td.changed .was .mark {\n display: inline-block;\n text-decoration: none;\n }\n\n tr.refused {\n color: var(--neutral-foreground-hint);\n }\n\n /* A refusal is a sentence, and it spans the table: it wraps rather than running off it. */\n .problems {\n color: var(--error-fill-rest, #c00);\n white-space: normal;\n }\n\n .actions {\n display: flex;\n gap: calc(var(--design-unit, 4) * 2px);\n margin-top: calc(var(--design-unit, 4) * 2px);\n }\n\n /* The change request takes the width the buttons leave it. */\n .change-request {\n flex: 1 1 24ch;\n }\n\n /* The outcome's live region is always there; while the review is open it takes no room. */\n .closed:empty {\n margin: 0;\n }\n\n /* The count sits at the foot of the field, beside it rather than in its way. */\n .remaining {\n align-self: flex-end;\n white-space: nowrap;\n font-size: var(--type-ramp-minus-1-font-size, 0.875em);\n color: var(--neutral-foreground-hint);\n }\n`"
15051
15490
  }
15052
15491
  ],
15053
15492
  "exports": [
@@ -15071,7 +15510,7 @@
15071
15510
  "type": {
15072
15511
  "text": "ViewTemplate<GenesisWriteReview>"
15073
15512
  },
15074
- "default": "html<GenesisWriteReview>`\n ${when(\n (x) => !!x.model,\n html<GenesisWriteReview>`\n <p>\n ${(x) => x.model?.op} ${(x) => x.model?.rows.length} row(s) in ${(x) => x.model?.resource}.\n Nothing is written until you choose rows and select Write.\n </p>\n <div class=\"scroller\">\n <table aria-label=\"Rows to be written to ${(x) => x.model?.resource}\">\n <thead>\n <tr>\n <th>\n <rapid-checkbox\n aria-label=\"Select all rows\"\n :checked=\"${(x) => x.allSelected}\"\n ?disabled=\"${(x) => x.resolved || !x.model?.selectable.length}\"\n @change=\"${(x, c) => x.setAll(checkedOf(c.event))}\"\n ></rapid-checkbox>\n </th>\n ${repeat(\n (x) => x.model?.columns ?? [],\n html<ReviewColumn>`\n <th>${(c) => c.label}</th>\n `,\n )}\n </tr>\n </thead>\n <tbody>${repeat((x) => x.model?.rows ?? [], row)}</tbody>\n </table>\n </div>\n <div class=\"actions\">\n <rapid-button\n appearance=\"accent\"\n ?disabled=\"${(x) => !x.writable}\"\n @click=\"${(x) => x.write()}\"\n >\n Write ${(x) => (x.rowsSelected ? `${x.rowsSelected} row(s)` : '')}\n </rapid-button>\n ${when(\n (x) => !x.denying,\n html<GenesisWriteReview>`\n <rapid-button ?disabled=\"${(x) => x.resolved}\" @click=\"${(x) => x.startDeny()}\">\n Deny\n </rapid-button>\n `,\n )}\n ${when(\n (x) => x.denying,\n html<GenesisWriteReview>`\n <rapid-text-field\n placeholder=\"Why not? (optional)\"\n :value=\"${(x) => x.denyReason}\"\n @input=\"${(x, c) => {\n x.setDenyReason((c.event.target as HTMLInputElement).value);\n return true;\n }}\"\n ></rapid-text-field>\n <rapid-button ?disabled=\"${(x) => x.resolved}\" @click=\"${(x) => x.confirmDeny()}\">\n Confirm deny\n </rapid-button>\n `,\n )}\n </div>\n `,\n )}\n ${when(\n (x) => x.resolved,\n html<GenesisWriteReview>`\n <p class=\"closed\">${(x) => x.closedSummary}</p>\n `,\n )}\n`"
15513
+ "default": "html<GenesisWriteReview>`\n ${when(\n (x) => !!x.model,\n html<GenesisWriteReview>`\n <p>\n ${(x) => x.model?.op} ${(x) => x.model?.rows.length} row(s) in ${(x) => x.model?.resource}.\n Nothing is written until you choose rows and select Write.\n </p>\n <div class=\"scroller\">\n <table aria-label=\"Rows to be written to ${(x) => x.model?.resource}\">\n <thead>\n <tr>\n <th>\n <rapid-checkbox\n aria-label=\"Select all rows\"\n :checked=\"${(x) => x.allSelected}\"\n ?disabled=\"${(x) => x.settled || !x.model?.selectable.length}\"\n @change=\"${(x, c) => x.setAll(checkedOf(c.event))}\"\n ></rapid-checkbox>\n </th>\n ${repeat(\n (x) => x.model?.columns ?? [],\n html<ReviewColumn>`\n <th>${(c) => c.label}</th>\n `,\n )}\n </tr>\n </thead>\n <tbody>${repeat((x) => x.model?.rows ?? [], row)}</tbody>\n </table>\n </div>\n <div class=\"actions\">\n ${when(\n (x) => !x.asking,\n html<GenesisWriteReview>`\n <rapid-button\n appearance=\"accent\"\n ?disabled=\"${(x) => !x.writable}\"\n @click=\"${(x) => x.write()}\"\n >\n Write ${(x) => (x.rowsSelected ? `${x.rowsSelected} row(s)` : '')}\n </rapid-button>\n <rapid-button\n class=\"ask\"\n ?disabled=\"${(x) => x.settled}\"\n @click=\"${(x) => x.startAsking()}\"\n >\n Ask for changes\n </rapid-button>\n <rapid-button ?disabled=\"${(x) => x.settled}\" @click=\"${(x) => x.deny()}\">\n Deny\n </rapid-button>\n `,\n )}\n ${when(\n (x) => x.asking,\n html<GenesisWriteReview>`\n <rapid-text-area\n class=\"change-request\"\n :value=\"${(x) => x.changeText}\"\n ?readonly=\"${(x) => x.settled}\"\n maxlength=\"${() => MAX_FEEDBACK_CHARS}\"\n @input=\"${(x, c) => {\n x.setChangeText((c.event.target as HTMLTextAreaElement).value);\n return true;\n }}\"\n >\n What should change?\n </rapid-text-area>\n <span class=\"remaining\">${(x) => x.charactersLeft} characters left</span>\n <rapid-button\n class=\"send\"\n appearance=\"accent\"\n ?disabled=\"${(x) => !x.canSendChanges}\"\n @click=\"${(x) => x.sendChanges()}\"\n >\n Send\n </rapid-button>\n <rapid-button class=\"back\" ?disabled=\"${(x) => x.settled}\" @click=\"${(x) => x.back()}\">\n Back\n </rapid-button>\n `,\n )}\n </div>\n `,\n )}\n ${\n /* A live region, and there from the start: a screen reader announces a change to one it\n already knows, and a region added with its text already in it was not announced at all.\n Empty while the review is open; filled by sayOutcome, which also decides when. Focusable\n from script only, so focus can land on the outcome after an answer. */ ''\n }\n <p class=\"closed\" role=\"status\" tabindex=\"-1\">${(x) => x.announcement}</p>\n`"
15075
15514
  }
15076
15515
  ],
15077
15516
  "exports": [
@@ -15116,7 +15555,7 @@
15116
15555
  "kind": "field",
15117
15556
  "name": "interaction",
15118
15557
  "type": {
15119
- "text": "AiChatInteraction<ReviewModel, number[]>"
15558
+ "text": "AiChatInteraction<ReviewModel, GenesisReviewPayload>"
15120
15559
  },
15121
15560
  "description": "The host-set descriptor: the model to render while pending, the outcome once resolved."
15122
15561
  },
@@ -15130,20 +15569,39 @@
15130
15569
  },
15131
15570
  {
15132
15571
  "kind": "field",
15133
- "name": "denying",
15572
+ "name": "asking",
15134
15573
  "type": {
15135
15574
  "text": "boolean"
15136
15575
  },
15137
15576
  "default": "false",
15138
- "description": "True while the user is writing a reason for denying."
15577
+ "description": "True while the user is writing what they want changed."
15578
+ },
15579
+ {
15580
+ "kind": "field",
15581
+ "name": "changeText",
15582
+ "type": {
15583
+ "text": "string"
15584
+ },
15585
+ "default": "''",
15586
+ "description": "What they have typed so far."
15139
15587
  },
15140
15588
  {
15141
15589
  "kind": "field",
15142
- "name": "denyReason",
15590
+ "name": "announcement",
15143
15591
  "type": {
15144
15592
  "text": "string"
15145
15593
  },
15146
- "default": "''"
15594
+ "default": "''",
15595
+ "description": "What the live region says: the outcome once the review has resolved. See `sayOutcome`."
15596
+ },
15597
+ {
15598
+ "kind": "field",
15599
+ "name": "answeredNow",
15600
+ "type": {
15601
+ "text": "Answered | undefined"
15602
+ },
15603
+ "privacy": "private",
15604
+ "description": "This element's own answer, until `sayOutcome` has said it."
15147
15605
  },
15148
15606
  {
15149
15607
  "kind": "field",
@@ -15151,7 +15609,7 @@
15151
15609
  "type": {
15152
15610
  "text": "ReviewModel | undefined"
15153
15611
  },
15154
- "description": "The rows, whether the review is still open or already resolved: a user who has approved a\nwrite should still be able to see what they approved. Acting on it is what `resolved`\nstops, not reading it.",
15612
+ "description": "The rows, whether the review is still open or already resolved: a user who has approved a\nwrite should still be able to see what they approved. Acting on it is what `settled`\nstops, not reading it.",
15155
15613
  "readonly": true
15156
15614
  },
15157
15615
  {
@@ -15162,6 +15620,25 @@
15162
15620
  },
15163
15621
  "readonly": true
15164
15622
  },
15623
+ {
15624
+ "kind": "field",
15625
+ "name": "answered",
15626
+ "type": {
15627
+ "text": "boolean"
15628
+ },
15629
+ "privacy": "private",
15630
+ "default": "false",
15631
+ "description": "Set when this element sends its answer. The host marks the review resolved after that, and\nuntil it did, a second click sent a second answer — a Deny straight after a Write included."
15632
+ },
15633
+ {
15634
+ "kind": "field",
15635
+ "name": "settled",
15636
+ "type": {
15637
+ "text": "boolean"
15638
+ },
15639
+ "description": "Whether the review is past taking input: it has resolved, or it has sent its answer. Every\naction checks this rather than `resolved`, which is still false in between.",
15640
+ "readonly": true
15641
+ },
15165
15642
  {
15166
15643
  "kind": "field",
15167
15644
  "name": "approved",
@@ -15190,6 +15667,28 @@
15190
15667
  },
15191
15668
  "description": "Every mount is a fresh element whose selection starts empty, so each state says where its\nselection comes from."
15192
15669
  },
15670
+ {
15671
+ "kind": "method",
15672
+ "name": "sayOutcome",
15673
+ "privacy": "private",
15674
+ "return": {
15675
+ "type": {
15676
+ "text": "void"
15677
+ }
15678
+ },
15679
+ "description": "Puts the outcome in the live region, so that an answer given just now is heard, and one read\nback from history is not."
15680
+ },
15681
+ {
15682
+ "kind": "method",
15683
+ "name": "hasFocus",
15684
+ "privacy": "private",
15685
+ "return": {
15686
+ "type": {
15687
+ "text": "boolean"
15688
+ }
15689
+ },
15690
+ "description": "Whether focus is on something inside this review, however deep in shadow roots."
15691
+ },
15193
15692
  {
15194
15693
  "kind": "method",
15195
15694
  "name": "park",
@@ -15307,7 +15806,7 @@
15307
15806
  {
15308
15807
  "name": "result",
15309
15808
  "type": {
15310
- "text": "InteractionResult<number[]>"
15809
+ "text": "GenesisWriteReviewCompletedEventDetail"
15311
15810
  }
15312
15811
  }
15313
15812
  ],
@@ -15315,16 +15814,37 @@
15315
15814
  },
15316
15815
  {
15317
15816
  "kind": "method",
15318
- "name": "startDeny",
15817
+ "name": "deny",
15319
15818
  "return": {
15320
15819
  "type": {
15321
15820
  "text": "void"
15322
15821
  }
15323
- }
15822
+ },
15823
+ "description": "No, and nothing else: one click, no reason. Denying is the safe direction — nothing is\nwritten, and the tool is not proposed again this turn — so it needs no confirmation. A reason\nthe user wants acted on is a change request, which is what \"Ask for changes\" is for; a deny\nreason travelled inside a result the model is told to treat as data, and was ignored."
15824
+ },
15825
+ {
15826
+ "kind": "method",
15827
+ "name": "startAsking",
15828
+ "return": {
15829
+ "type": {
15830
+ "text": "void"
15831
+ }
15832
+ },
15833
+ "description": "Opens the change request, and puts the cursor in it."
15834
+ },
15835
+ {
15836
+ "kind": "method",
15837
+ "name": "back",
15838
+ "return": {
15839
+ "type": {
15840
+ "text": "void"
15841
+ }
15842
+ },
15843
+ "description": "Closes the change request without sending it; the text is kept for a second try."
15324
15844
  },
15325
15845
  {
15326
15846
  "kind": "method",
15327
- "name": "setDenyReason",
15847
+ "name": "setChangeText",
15328
15848
  "return": {
15329
15849
  "type": {
15330
15850
  "text": "void"
@@ -15332,22 +15852,73 @@
15332
15852
  },
15333
15853
  "parameters": [
15334
15854
  {
15335
- "name": "reason",
15855
+ "name": "text",
15336
15856
  "type": {
15337
15857
  "text": "string"
15338
15858
  }
15339
15859
  }
15340
15860
  ],
15341
- "description": "The deny reason as the user types it."
15861
+ "description": "The change request as the user types it, until the review has its answer."
15862
+ },
15863
+ {
15864
+ "kind": "field",
15865
+ "name": "charactersLeft",
15866
+ "type": {
15867
+ "text": "number"
15868
+ },
15869
+ "description": "How much more the change request can take. The field stops at the cap without a sound, so the\ncount is on screen rather than discovered by typing into it.",
15870
+ "readonly": true
15871
+ },
15872
+ {
15873
+ "kind": "field",
15874
+ "name": "canSendChanges",
15875
+ "type": {
15876
+ "text": "boolean"
15877
+ },
15878
+ "description": "Whether there is a change to send: text that shows something.",
15879
+ "readonly": true
15342
15880
  },
15343
15881
  {
15344
15882
  "kind": "method",
15345
- "name": "confirmDeny",
15883
+ "name": "sendChanges",
15346
15884
  "return": {
15347
15885
  "type": {
15348
15886
  "text": "void"
15349
15887
  }
15350
- }
15888
+ },
15889
+ "description": "Sends the change request. Nothing is written, whatever is ticked: the rows that were ticked\ntravel as context for the next proposal, which the user approves in a fresh review. They are\nthe review's own indexes, in the order it shows them, so they can be matched against the rows\nof the tool's result. `userMessage` shows the request on the user's side of the chat, as the\nwords the model gets (see `literalMarkdown`); the driver never sends that to the model."
15890
+ },
15891
+ {
15892
+ "kind": "method",
15893
+ "name": "focusSoon",
15894
+ "privacy": "private",
15895
+ "return": {
15896
+ "type": {
15897
+ "text": "void"
15898
+ }
15899
+ },
15900
+ "parameters": [
15901
+ {
15902
+ "name": "selector",
15903
+ "type": {
15904
+ "text": "string"
15905
+ }
15906
+ },
15907
+ {
15908
+ "name": "inner",
15909
+ "optional": true,
15910
+ "type": {
15911
+ "text": "string"
15912
+ }
15913
+ }
15914
+ ],
15915
+ "description": "Focuses an element the next render adds. The design-system controls do not delegate focus,\nso this drills into the control's own shadow root (see the chat input's\n`maybeAutoFocusChatInput`), and falls back to the host."
15916
+ }
15917
+ ],
15918
+ "events": [
15919
+ {
15920
+ "description": "Fired once, when the user writes, asks for changes or denies. detail: `GenesisWriteReviewCompletedEventDetail`",
15921
+ "name": "interaction-completed"
15351
15922
  }
15352
15923
  ],
15353
15924
  "superclass": {