@genesislcap/ai-assistant 15.43.0 → 15.44.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 (30) hide show
  1. package/dist/custom-elements.json +265 -206
  2. package/dist/dts/genesis/config.d.ts +28 -1
  3. package/dist/dts/genesis/config.d.ts.map +1 -1
  4. package/dist/dts/genesis/consumes.d.ts.map +1 -1
  5. package/dist/dts/genesis/index.d.ts +2 -1
  6. package/dist/dts/genesis/index.d.ts.map +1 -1
  7. package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
  8. package/dist/dts/genesis/review-model.d.ts +22 -1
  9. package/dist/dts/genesis/review-model.d.ts.map +1 -1
  10. package/dist/dts/genesis/types.d.ts +32 -0
  11. package/dist/dts/genesis/types.d.ts.map +1 -1
  12. package/dist/dts/genesis/write-review/write-review.d.ts +7 -0
  13. package/dist/dts/genesis/write-review/write-review.d.ts.map +1 -1
  14. package/dist/dts/genesis/write-review/write-review.template.d.ts.map +1 -1
  15. package/dist/dts/genesis/write-tools.d.ts.map +1 -1
  16. package/dist/esm/genesis/config.js +108 -7
  17. package/dist/esm/genesis/consumes.js +8 -1
  18. package/dist/esm/genesis/index.js +1 -0
  19. package/dist/esm/genesis/register-genesis-assistant.js +7 -0
  20. package/dist/esm/genesis/review-model.js +37 -7
  21. package/dist/esm/genesis/write-review/write-review.js +11 -1
  22. package/dist/esm/genesis/write-review/write-review.template.js +9 -1
  23. package/dist/esm/genesis/write-tools.js +35 -11
  24. package/dist/genesis-consumes.cjs +8 -1
  25. package/dist/genesis-consumes.cjs.map +2 -2
  26. package/dist/genesis-consumes.mjs +8 -1
  27. package/dist/genesis-consumes.mjs.map +2 -2
  28. package/docs/genesis.md +49 -1
  29. package/package.json +18 -18
  30. package/scripts/smoke-genesis-consumes-node.mjs +1 -1
@@ -1754,211 +1754,6 @@
1754
1754
  }
1755
1755
  ]
1756
1756
  },
1757
- {
1758
- "kind": "javascript-module",
1759
- "path": "src/config/config.ts",
1760
- "declarations": [
1761
- {
1762
- "kind": "function",
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```"
1765
- }
1766
- ],
1767
- "exports": [
1768
- {
1769
- "kind": "js",
1770
- "name": "CachePolicy",
1771
- "declaration": {
1772
- "name": "CachePolicy",
1773
- "module": "src/config/config.ts"
1774
- }
1775
- },
1776
- {
1777
- "kind": "js",
1778
- "name": "ChatFallback",
1779
- "declaration": {
1780
- "name": "ChatFallback",
1781
- "module": "src/config/config.ts"
1782
- }
1783
- },
1784
- {
1785
- "kind": "js",
1786
- "name": "ChatInputDuringExecutionMode",
1787
- "declaration": {
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"
1814
- }
1815
- }
1816
- ]
1817
- },
1818
- {
1819
- "kind": "javascript-module",
1820
- "path": "src/config/define-stateful-agent.ts",
1821
- "declarations": [
1822
- {
1823
- "kind": "function",
1824
- "name": "restoreMachine",
1825
- "return": {
1826
- "type": {
1827
- "text": "void"
1828
- }
1829
- },
1830
- "parameters": [
1831
- {
1832
- "name": "machine",
1833
- "type": {
1834
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
1835
- },
1836
- "description": "the machine to restore (already constructed/started)."
1837
- },
1838
- {
1839
- "name": "restored",
1840
- "type": {
1841
- "text": "unknown"
1842
- },
1843
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
1844
- },
1845
- {
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."
1849
- }
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."
1852
- },
1853
- {
1854
- "kind": "function",
1855
- "name": "defineStatefulAgent",
1856
- "return": {
1857
- "type": {
1858
- "text": "AgentConfig"
1859
- }
1860
- },
1861
- "parameters": [
1862
- {
1863
- "name": "opts",
1864
- "type": {
1865
- "text": "StatefulAgentInit<S>"
1866
- }
1867
- }
1868
- ],
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."
1870
- }
1871
- ],
1872
- "exports": [
1873
- {
1874
- "kind": "js",
1875
- "name": "restoreMachine",
1876
- "declaration": {
1877
- "name": "restoreMachine",
1878
- "module": "src/config/define-stateful-agent.ts"
1879
- }
1880
- },
1881
- {
1882
- "kind": "js",
1883
- "name": "defineStatefulAgent",
1884
- "declaration": {
1885
- "name": "defineStatefulAgent",
1886
- "module": "src/config/define-stateful-agent.ts"
1887
- }
1888
- }
1889
- ]
1890
- },
1891
- {
1892
- "kind": "javascript-module",
1893
- "path": "src/config/fallback-agents.ts",
1894
- "declarations": [
1895
- {
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
1757
  {
1963
1758
  "kind": "javascript-module",
1964
1759
  "path": "src/genesis/calendar.ts",
@@ -2003,6 +1798,24 @@
2003
1798
  }
2004
1799
  ],
2005
1800
  "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."
1801
+ },
1802
+ {
1803
+ "kind": "function",
1804
+ "name": "customCodeOf",
1805
+ "return": {
1806
+ "type": {
1807
+ "text": "GenesisCustomCodeCheck"
1808
+ }
1809
+ },
1810
+ "parameters": [
1811
+ {
1812
+ "name": "resource",
1813
+ "type": {
1814
+ "text": "GenesisAiResource"
1815
+ }
1816
+ }
1817
+ ],
1818
+ "description": "A resource's `customCode` as it is used: the one reader of the field."
2006
1819
  }
2007
1820
  ],
2008
1821
  "exports": [
@@ -2029,6 +1842,14 @@
2029
1842
  "name": "toolNameOf",
2030
1843
  "module": "src/genesis/config.ts"
2031
1844
  }
1845
+ },
1846
+ {
1847
+ "kind": "js",
1848
+ "name": "customCodeOf",
1849
+ "declaration": {
1850
+ "name": "customCodeOf",
1851
+ "module": "src/genesis/config.ts"
1852
+ }
2032
1853
  }
2033
1854
  ]
2034
1855
  },
@@ -2180,6 +2001,14 @@
2180
2001
  "module": "./register-genesis-assistant"
2181
2002
  }
2182
2003
  },
2004
+ {
2005
+ "kind": "js",
2006
+ "name": "customCodeOf",
2007
+ "declaration": {
2008
+ "name": "customCodeOf",
2009
+ "module": "./config"
2010
+ }
2011
+ },
2183
2012
  {
2184
2013
  "kind": "js",
2185
2014
  "name": "GENESIS_AI_CONSUMES",
@@ -2388,6 +2217,22 @@
2388
2217
  "module": "./types"
2389
2218
  }
2390
2219
  },
2220
+ {
2221
+ "kind": "js",
2222
+ "name": "GenesisCustomCode",
2223
+ "declaration": {
2224
+ "name": "GenesisCustomCode",
2225
+ "module": "./types"
2226
+ }
2227
+ },
2228
+ {
2229
+ "kind": "js",
2230
+ "name": "GenesisCustomCodeCheck",
2231
+ "declaration": {
2232
+ "name": "GenesisCustomCodeCheck",
2233
+ "module": "./types"
2234
+ }
2235
+ },
2391
2236
  {
2392
2237
  "kind": "js",
2393
2238
  "name": "GenesisEventOp",
@@ -2809,6 +2654,211 @@
2809
2654
  "declarations": [],
2810
2655
  "exports": []
2811
2656
  },
2657
+ {
2658
+ "kind": "javascript-module",
2659
+ "path": "src/config/config.ts",
2660
+ "declarations": [
2661
+ {
2662
+ "kind": "function",
2663
+ "name": "defineAgent",
2664
+ "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```"
2665
+ }
2666
+ ],
2667
+ "exports": [
2668
+ {
2669
+ "kind": "js",
2670
+ "name": "CachePolicy",
2671
+ "declaration": {
2672
+ "name": "CachePolicy",
2673
+ "module": "src/config/config.ts"
2674
+ }
2675
+ },
2676
+ {
2677
+ "kind": "js",
2678
+ "name": "ChatFallback",
2679
+ "declaration": {
2680
+ "name": "ChatFallback",
2681
+ "module": "src/config/config.ts"
2682
+ }
2683
+ },
2684
+ {
2685
+ "kind": "js",
2686
+ "name": "ChatInputDuringExecutionMode",
2687
+ "declaration": {
2688
+ "name": "ChatInputDuringExecutionMode",
2689
+ "module": "src/config/config.ts"
2690
+ }
2691
+ },
2692
+ {
2693
+ "kind": "js",
2694
+ "name": "ChatThinkingPolicy",
2695
+ "declaration": {
2696
+ "name": "ChatThinkingPolicy",
2697
+ "module": "src/config/config.ts"
2698
+ }
2699
+ },
2700
+ {
2701
+ "kind": "js",
2702
+ "name": "ChatToolChoice",
2703
+ "declaration": {
2704
+ "name": "ChatToolChoice",
2705
+ "module": "src/config/config.ts"
2706
+ }
2707
+ },
2708
+ {
2709
+ "kind": "js",
2710
+ "name": "defineAgent",
2711
+ "declaration": {
2712
+ "name": "defineAgent",
2713
+ "module": "src/config/config.ts"
2714
+ }
2715
+ }
2716
+ ]
2717
+ },
2718
+ {
2719
+ "kind": "javascript-module",
2720
+ "path": "src/config/define-stateful-agent.ts",
2721
+ "declarations": [
2722
+ {
2723
+ "kind": "function",
2724
+ "name": "restoreMachine",
2725
+ "return": {
2726
+ "type": {
2727
+ "text": "void"
2728
+ }
2729
+ },
2730
+ "parameters": [
2731
+ {
2732
+ "name": "machine",
2733
+ "type": {
2734
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
2735
+ },
2736
+ "description": "the machine to restore (already constructed/started)."
2737
+ },
2738
+ {
2739
+ "name": "restored",
2740
+ "type": {
2741
+ "text": "unknown"
2742
+ },
2743
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
2744
+ },
2745
+ {
2746
+ "name": "key",
2747
+ "default": "'machine'",
2748
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
2749
+ }
2750
+ ],
2751
+ "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."
2752
+ },
2753
+ {
2754
+ "kind": "function",
2755
+ "name": "defineStatefulAgent",
2756
+ "return": {
2757
+ "type": {
2758
+ "text": "AgentConfig"
2759
+ }
2760
+ },
2761
+ "parameters": [
2762
+ {
2763
+ "name": "opts",
2764
+ "type": {
2765
+ "text": "StatefulAgentInit<S>"
2766
+ }
2767
+ }
2768
+ ],
2769
+ "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."
2770
+ }
2771
+ ],
2772
+ "exports": [
2773
+ {
2774
+ "kind": "js",
2775
+ "name": "restoreMachine",
2776
+ "declaration": {
2777
+ "name": "restoreMachine",
2778
+ "module": "src/config/define-stateful-agent.ts"
2779
+ }
2780
+ },
2781
+ {
2782
+ "kind": "js",
2783
+ "name": "defineStatefulAgent",
2784
+ "declaration": {
2785
+ "name": "defineStatefulAgent",
2786
+ "module": "src/config/define-stateful-agent.ts"
2787
+ }
2788
+ }
2789
+ ]
2790
+ },
2791
+ {
2792
+ "kind": "javascript-module",
2793
+ "path": "src/config/fallback-agents.ts",
2794
+ "declarations": [
2795
+ {
2796
+ "kind": "variable",
2797
+ "name": "friendlyFallbackAgent",
2798
+ "type": {
2799
+ "text": "FallbackAgentConfig"
2800
+ },
2801
+ "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}",
2802
+ "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."
2803
+ },
2804
+ {
2805
+ "kind": "variable",
2806
+ "name": "strictFallbackAgent",
2807
+ "type": {
2808
+ "text": "FallbackAgentConfig"
2809
+ },
2810
+ "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}",
2811
+ "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."
2812
+ }
2813
+ ],
2814
+ "exports": [
2815
+ {
2816
+ "kind": "js",
2817
+ "name": "friendlyFallbackAgent",
2818
+ "declaration": {
2819
+ "name": "friendlyFallbackAgent",
2820
+ "module": "src/config/fallback-agents.ts"
2821
+ }
2822
+ },
2823
+ {
2824
+ "kind": "js",
2825
+ "name": "strictFallbackAgent",
2826
+ "declaration": {
2827
+ "name": "strictFallbackAgent",
2828
+ "module": "src/config/fallback-agents.ts"
2829
+ }
2830
+ }
2831
+ ]
2832
+ },
2833
+ {
2834
+ "kind": "javascript-module",
2835
+ "path": "src/config/index.ts",
2836
+ "declarations": [],
2837
+ "exports": [
2838
+ {
2839
+ "kind": "js",
2840
+ "name": "*",
2841
+ "declaration": {
2842
+ "name": "*",
2843
+ "package": "./config"
2844
+ }
2845
+ },
2846
+ {
2847
+ "kind": "js",
2848
+ "name": "*",
2849
+ "declaration": {
2850
+ "name": "*",
2851
+ "package": "./fallback-agents"
2852
+ }
2853
+ }
2854
+ ]
2855
+ },
2856
+ {
2857
+ "kind": "javascript-module",
2858
+ "path": "src/config/validate-providers.ts",
2859
+ "declarations": [],
2860
+ "exports": []
2861
+ },
2812
2862
  {
2813
2863
  "kind": "javascript-module",
2814
2864
  "path": "src/main/attachment-controller.ts",
@@ -15558,7 +15608,7 @@
15558
15608
  "type": {
15559
15609
  "text": "ViewTemplate<GenesisWriteReview>"
15560
15610
  },
15561
- "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`"
15611
+ "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 ${when(\n (x) => !!x.customCodeLine,\n html<GenesisWriteReview>`\n <p class=\"custom-code\" id=\"${CUSTOM_CODE_LINE_ID}\">${(x) => x.customCodeLine}</p>\n `,\n )}\n <div class=\"scroller\">\n <table\n aria-label=\"Rows to be written to ${(x) => x.model?.resource}\"\n aria-describedby=\"${(x) => (x.customCodeLine ? CUSTOM_CODE_LINE_ID : undefined)}\"\n >\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`"
15562
15612
  }
15563
15613
  ],
15564
15614
  "exports": [
@@ -15668,6 +15718,15 @@
15668
15718
  },
15669
15719
  "readonly": true
15670
15720
  },
15721
+ {
15722
+ "kind": "field",
15723
+ "name": "customCodeLine",
15724
+ "type": {
15725
+ "text": "string"
15726
+ },
15727
+ "description": "What the review says about custom code the event runs, or `''` when it runs none. Read from\nthe model, which history keeps, so it is there whether the review is open, resolved or\nre-mounted. Not repeated in the closed summary: the resolved review still shows it, and the\nsummary's live region would announce it as though code had run.",
15728
+ "readonly": true
15729
+ },
15671
15730
  {
15672
15731
  "kind": "field",
15673
15732
  "name": "answered",
@@ -1,4 +1,4 @@
1
- import { type GenesisAiResource, type GenesisEventOp } from './types';
1
+ import { type GenesisAiResource, type GenesisCustomCodeCheck, type GenesisEventOp } from './types';
2
2
  /** The default read cap, and the ceiling the config may raise it to. */
3
3
  export declare const DEFAULT_MAX_ROWS = 50;
4
4
  export declare const MAX_ROWS_CEILING = 1000;
@@ -61,6 +61,14 @@ export interface GenesisAiConfigCheck {
61
61
  resources: GenesisAiResource[];
62
62
  /** The ones that did not. Each is left out on its own. */
63
63
  dropped: DroppedResource[];
64
+ /**
65
+ * What was changed on a resource that was kept, for the console: see `customCodeOf`. Each
66
+ * names its resource, so a caller that goes on to leave one out can leave out its warning.
67
+ */
68
+ warnings: Array<{
69
+ name: string;
70
+ warning: string;
71
+ }>;
64
72
  }
65
73
  /**
66
74
  * Checks a generated AI config before anything is registered, and says what can be kept.
@@ -80,4 +88,23 @@ export interface GenesisAiConfigCheck {
80
88
  * @internal
81
89
  */
82
90
  export declare function validateGenesisAiConfig(config: unknown): GenesisAiConfigCheck;
91
+ /**
92
+ * A resource's `customCode` as it is used: the one reader of the field.
93
+ *
94
+ * @remarks
95
+ * Called by the validator AND by the write tools, because `createGenesisWriteTools` is exported
96
+ * and never validates: one rule, whichever way the resource arrives. It never throws and never
97
+ * drops the resource.
98
+ *
99
+ * - On anything but an insert, modify or delete event, the field has no meaning: it is dropped,
100
+ * with a warning, and the resource is kept.
101
+ * - Malformed — not an object, a key it has no place for, `alsoWrites` not a list, a member that
102
+ * is not a table name or is named twice, `listComplete` not true or false — keeps the valid
103
+ * names, in order, and reads `listComplete` as FALSE, with a warning. The review then says the
104
+ * code can also write to other records: over-disclosure is the safe end, and a malformed value
105
+ * must never read as a complete list.
106
+ *
107
+ * @beta
108
+ */
109
+ export declare function customCodeOf(resource: GenesisAiResource): GenesisCustomCodeCheck;
83
110
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/genesis/config.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAEjB,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,iBAAiB,KAAG,OAG3D,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,MAAoC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,cAAc,GAAG,SAGlE,CAAC;AAKF;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,qEAAqE;IACrE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,0DAA0D;IAC1D,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,oBAAoB,CAoD7E"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/genesis/config.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAEjB,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,iBAAiB,KAAG,OAG3D,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,MAAoC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,cAAc,GAAG,SAGlE,CAAC;AAKF;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,qEAAqE;IACrE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,0DAA0D;IAC1D,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,oBAAoB,CAoE7E;AASD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,iBAAiB,GAAG,sBAAsB,CA6ChF"}
@@ -1 +1 @@
1
- {"version":3,"file":"consumes.d.ts","sourceRoot":"","sources":["../../../src/genesis/consumes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAKhC,CAAC"}
1
+ {"version":3,"file":"consumes.d.ts","sourceRoot":"","sources":["../../../src/genesis/consumes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAYhC,CAAC"}
@@ -11,6 +11,7 @@
11
11
  * @beta
12
12
  */
13
13
  export { GENESIS_AGENT_NAME, registerGenesisAssistant } from './register-genesis-assistant';
14
+ export { customCodeOf } from './config';
14
15
  export { GENESIS_AI_CONSUMES } from './consumes';
15
16
  export type { GenesisFilter, GenesisFilterField, GenesisFilterOp } from './criteria';
16
17
  export { createGenesisResourceTools, GENESIS_DATA_SOURCE } from './resource-tools';
@@ -20,5 +21,5 @@ export { GENESIS_WRITE_REVIEW, GenesisWriteReview } from './write-review/write-r
20
21
  export type { GenesisChangeRequest, GenesisReviewPayload, GenesisWriteReviewCompletedEventDetail, } from './review-payload';
21
22
  export type { GenesisReadResult, GenesisResourceTools, GenesisResourceToolsOptions, GenesisToolError, } from './resource-tools';
22
23
  export { GENESIS_EVENT_OPS } from './types';
23
- export type { GenesisAiConfig, GenesisAiConsumes, GenesisAiResource, GenesisAssistantExtensions, GenesisAssistantRegistration, GenesisEventOp, GenesisResourceKind, RegisterGenesisAssistantOptions, } from './types';
24
+ export type { GenesisAiConfig, GenesisAiConsumes, GenesisAiResource, GenesisAssistantExtensions, GenesisAssistantRegistration, GenesisCustomCode, GenesisCustomCodeCheck, GenesisEventOp, GenesisResourceKind, RegisterGenesisAssistantOptions, } from './types';
24
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACvF,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,4BAA4B,EAC5B,cAAc,EACd,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACvF,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"register-genesis-assistant.d.ts","sourceRoot":"","sources":["../../../src/genesis/register-genesis-assistant.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,sCAAsC,CAAC;AAI9C,OAAO,KAAK,EACV,eAAe,EAEf,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,SAAS,CAAC;AAGjB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAGN,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAOgB,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,QAKqD,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gDAAgD,CAAC;AAElF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,QAEA,CAAC;AAgCpC;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,MAAoB,GAAG,MAAM,CAI5E;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,IAAI,CAAC,+BAA+B,EAAE,cAAc,GAAG,SAAS,CAAM,GAC9E,IAAI,CAAC,+BAA+B,EAAE,WAAW,CAAC,CAUpD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,4BAA4B,CAsO9B"}
1
+ {"version":3,"file":"register-genesis-assistant.d.ts","sourceRoot":"","sources":["../../../src/genesis/register-genesis-assistant.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,sCAAsC,CAAC;AAI9C,OAAO,KAAK,EACV,eAAe,EAEf,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,SAAS,CAAC;AAGjB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAGN,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAOgB,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,QAKqD,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gDAAgD,CAAC;AAElF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,QAEA,CAAC;AAgCpC;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,MAAoB,GAAG,MAAM,CAI5E;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,IAAI,CAAC,+BAA+B,EAAE,cAAc,GAAG,SAAS,CAAM,GAC9E,IAAI,CAAC,+BAA+B,EAAE,WAAW,CAAC,CAUpD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,4BAA4B,CA4O9B"}