@genesislcap/ai-assistant 15.53.0 → 15.55.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.
@@ -1754,6 +1754,211 @@
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
+ },
1757
1962
  {
1758
1963
  "kind": "javascript-module",
1759
1964
  "path": "src/genesis/calendar.ts",
@@ -1930,7 +2135,7 @@
1930
2135
  "type": {
1931
2136
  "text": "GenesisAiConsumes"
1932
2137
  },
1933
- "description": "What this version of the assistant reads from a generated AI config: the resource kinds it\naccepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values\nit accepts."
2138
+ "description": "What this version of the assistant reads from a generated AI config: the resource kinds it\naccepts, the resource fields its validator or a tool reads, the `vendor` and `tier` values it\naccepts, and the row-action shapes it runs."
1934
2139
  }
1935
2140
  ],
1936
2141
  "exports": [
@@ -2937,211 +3142,6 @@
2937
3142
  "declarations": [],
2938
3143
  "exports": []
2939
3144
  },
2940
- {
2941
- "kind": "javascript-module",
2942
- "path": "src/config/config.ts",
2943
- "declarations": [
2944
- {
2945
- "kind": "function",
2946
- "name": "defineAgent",
2947
- "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```"
2948
- }
2949
- ],
2950
- "exports": [
2951
- {
2952
- "kind": "js",
2953
- "name": "CachePolicy",
2954
- "declaration": {
2955
- "name": "CachePolicy",
2956
- "module": "src/config/config.ts"
2957
- }
2958
- },
2959
- {
2960
- "kind": "js",
2961
- "name": "ChatFallback",
2962
- "declaration": {
2963
- "name": "ChatFallback",
2964
- "module": "src/config/config.ts"
2965
- }
2966
- },
2967
- {
2968
- "kind": "js",
2969
- "name": "ChatInputDuringExecutionMode",
2970
- "declaration": {
2971
- "name": "ChatInputDuringExecutionMode",
2972
- "module": "src/config/config.ts"
2973
- }
2974
- },
2975
- {
2976
- "kind": "js",
2977
- "name": "ChatThinkingPolicy",
2978
- "declaration": {
2979
- "name": "ChatThinkingPolicy",
2980
- "module": "src/config/config.ts"
2981
- }
2982
- },
2983
- {
2984
- "kind": "js",
2985
- "name": "ChatToolChoice",
2986
- "declaration": {
2987
- "name": "ChatToolChoice",
2988
- "module": "src/config/config.ts"
2989
- }
2990
- },
2991
- {
2992
- "kind": "js",
2993
- "name": "defineAgent",
2994
- "declaration": {
2995
- "name": "defineAgent",
2996
- "module": "src/config/config.ts"
2997
- }
2998
- }
2999
- ]
3000
- },
3001
- {
3002
- "kind": "javascript-module",
3003
- "path": "src/config/define-stateful-agent.ts",
3004
- "declarations": [
3005
- {
3006
- "kind": "function",
3007
- "name": "restoreMachine",
3008
- "return": {
3009
- "type": {
3010
- "text": "void"
3011
- }
3012
- },
3013
- "parameters": [
3014
- {
3015
- "name": "machine",
3016
- "type": {
3017
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
3018
- },
3019
- "description": "the machine to restore (already constructed/started)."
3020
- },
3021
- {
3022
- "name": "restored",
3023
- "type": {
3024
- "text": "unknown"
3025
- },
3026
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
3027
- },
3028
- {
3029
- "name": "key",
3030
- "default": "'machine'",
3031
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
3032
- }
3033
- ],
3034
- "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."
3035
- },
3036
- {
3037
- "kind": "function",
3038
- "name": "defineStatefulAgent",
3039
- "return": {
3040
- "type": {
3041
- "text": "AgentConfig"
3042
- }
3043
- },
3044
- "parameters": [
3045
- {
3046
- "name": "opts",
3047
- "type": {
3048
- "text": "StatefulAgentInit<S>"
3049
- }
3050
- }
3051
- ],
3052
- "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."
3053
- }
3054
- ],
3055
- "exports": [
3056
- {
3057
- "kind": "js",
3058
- "name": "restoreMachine",
3059
- "declaration": {
3060
- "name": "restoreMachine",
3061
- "module": "src/config/define-stateful-agent.ts"
3062
- }
3063
- },
3064
- {
3065
- "kind": "js",
3066
- "name": "defineStatefulAgent",
3067
- "declaration": {
3068
- "name": "defineStatefulAgent",
3069
- "module": "src/config/define-stateful-agent.ts"
3070
- }
3071
- }
3072
- ]
3073
- },
3074
- {
3075
- "kind": "javascript-module",
3076
- "path": "src/config/fallback-agents.ts",
3077
- "declarations": [
3078
- {
3079
- "kind": "variable",
3080
- "name": "friendlyFallbackAgent",
3081
- "type": {
3082
- "text": "FallbackAgentConfig"
3083
- },
3084
- "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}",
3085
- "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."
3086
- },
3087
- {
3088
- "kind": "variable",
3089
- "name": "strictFallbackAgent",
3090
- "type": {
3091
- "text": "FallbackAgentConfig"
3092
- },
3093
- "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}",
3094
- "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."
3095
- }
3096
- ],
3097
- "exports": [
3098
- {
3099
- "kind": "js",
3100
- "name": "friendlyFallbackAgent",
3101
- "declaration": {
3102
- "name": "friendlyFallbackAgent",
3103
- "module": "src/config/fallback-agents.ts"
3104
- }
3105
- },
3106
- {
3107
- "kind": "js",
3108
- "name": "strictFallbackAgent",
3109
- "declaration": {
3110
- "name": "strictFallbackAgent",
3111
- "module": "src/config/fallback-agents.ts"
3112
- }
3113
- }
3114
- ]
3115
- },
3116
- {
3117
- "kind": "javascript-module",
3118
- "path": "src/config/index.ts",
3119
- "declarations": [],
3120
- "exports": [
3121
- {
3122
- "kind": "js",
3123
- "name": "*",
3124
- "declaration": {
3125
- "name": "*",
3126
- "package": "./config"
3127
- }
3128
- },
3129
- {
3130
- "kind": "js",
3131
- "name": "*",
3132
- "declaration": {
3133
- "name": "*",
3134
- "package": "./fallback-agents"
3135
- }
3136
- }
3137
- ]
3138
- },
3139
- {
3140
- "kind": "javascript-module",
3141
- "path": "src/config/validate-providers.ts",
3142
- "declarations": [],
3143
- "exports": []
3144
- },
3145
3145
  {
3146
3146
  "kind": "javascript-module",
3147
3147
  "path": "src/main/attachment-controller.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/genesis/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAGjB,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;AAsBF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,MAAoC,CAAC;AAEvF;;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C;IACjC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B,MACA,MAAM,MAAM,KAAG,MAOf,CAAC;AAEJ;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,EAC3C,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,EACjC,cAAc,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAA8B,GAC/D,MAAM,GAAG,SAAS,CAuFpB;AAED;;;;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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,oBAAoB,CA0F7E;AASD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,iBAAiB,GAAG,sBAAsB,CA6ChF"}
@@ -16,8 +16,8 @@ import type { GenesisAiConsumes } from './types';
16
16
  export type { GenesisAiConsumes } from './types';
17
17
  /**
18
18
  * What this version of the assistant reads from a generated AI config: the resource kinds it
19
- * accepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values
20
- * it accepts.
19
+ * accepts, the resource fields its validator or a tool reads, the `vendor` and `tier` values it
20
+ * accepts, and the row-action shapes it runs.
21
21
  *
22
22
  * @remarks
23
23
  * The generator must not emit what the installed assistant does not read, or a new kind is left out
@@ -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,iBAkBhC,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,iBAmBhC,CAAC"}
@@ -57,8 +57,11 @@ export interface GenesisAiResource {
57
57
  * handler loads one existing row of `entity` by its primary key, changes it, and may insert rows
58
58
  * into other tables. The generator sets it only when it could prove that from the handler's code
59
59
  * (contracts C-18.3). Without it a custom event gets no tool.
60
+ *
61
+ * `key-row` is a row action whose event carries the key and nothing else, so it takes no inputs.
62
+ * Its review shows the whole row, and every column shown is checked again before the write.
60
63
  */
61
- shape?: 'row';
64
+ shape?: 'row' | 'key-row';
62
65
  /**
63
66
  * A row action's own table, whose rows are read through `REQ_<entity>`. Accepted on any resource,
64
67
  * and used only with `shape`.
@@ -144,6 +147,8 @@ export interface GenesisAiConsumes {
144
147
  readonly vendors: readonly AITierVendor[];
145
148
  /** The `tier` values it accepts. Any other blocks the assistant. */
146
149
  readonly tiers: readonly AITierId[];
150
+ /** The row-action `shape` values it runs. A custom event with any other is left out. */
151
+ readonly shapes: readonly NonNullable<GenesisAiResource['shape']>[];
147
152
  }
148
153
  /**
149
154
  * What `customCodeOf` makes of a resource's `customCode`.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/genesis/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAErF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,mDAAoD,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;IAC1B,mBAAmB;IACnB,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC;;;;;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AAE,KAAK,CAAC;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACjD,gDAAgD;QAChD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,iGAAiG;IACjG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3F;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,MAGvB,CAAC;AAi/Bb;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,OAAO,GAAE,wBAA6B,GACrC;IACD,eAAe,EAAE,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACrD,YAAY,EAAE,gBAAgB,CAAC;IAC/B;;;;OAIG;IACH,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,CAmPA"}
@@ -200,6 +200,8 @@ function keyProblems(key, accepted = new Set()) {
200
200
  return problems;
201
201
  }
202
202
  const INPUT_KEYS = ['field', 'required'];
203
+ /** The row-action shapes this version runs; GENESIS_AI_CONSUMES says the same, and a test holds it. */
204
+ const ROW_SHAPES = ['row', 'key-row'];
203
205
  const EFFECT_KEYS = ['op', 'table'];
204
206
  const EFFECT_OPS = ['modify', 'insert'];
205
207
  const shown = (value) => typeof value === 'string' ? `'${value}'` : value === null ? 'null' : typeof value;
@@ -260,8 +262,8 @@ export function rowActionProblem(resource, requestNames, whyNotReadable = notRea
260
262
  const { shape, entity, key, inputs, effects } = fields;
261
263
  if (shape === undefined)
262
264
  return undefined;
263
- if (shape !== 'row') {
264
- return `shape ${shown(shape)} is not one this version of the assistant runs (row)`;
265
+ if (!ROW_SHAPES.includes(shape)) {
266
+ return `shape ${shown(shape)} is not one this version of the assistant runs (row, key-row)`;
265
267
  }
266
268
  const problems = [];
267
269
  const table = typeof entity === 'string' && ROW_NAME.test(entity) ? entity : undefined;
@@ -291,6 +293,9 @@ export function rowActionProblem(resource, requestNames, whyNotReadable = notRea
291
293
  if (input.required !== true)
292
294
  problems.push(`${at}.required must be true`);
293
295
  });
296
+ // Its event carries the key alone, so there is nowhere for an input to go.
297
+ if (shape === 'key-row' && inputs.length)
298
+ problems.push('a key-row action takes no inputs');
294
299
  }
295
300
  if (!Array.isArray(effects) || !effects.length) {
296
301
  problems.push('effects must list at least one write');
@@ -534,7 +539,7 @@ function keptCopy(resource, customCode) {
534
539
  }
535
540
  : {})), ((resource.op === 'modify' || resource.op === 'delete') && resource.key !== undefined
536
541
  ? { key: [...resource.key] }
537
- : {})), (resource.op === 'custom' && resource.shape === 'row'
542
+ : {})), (resource.op === 'custom' && ROW_SHAPES.includes(resource.shape)
538
543
  ? {
539
544
  shape: resource.shape,
540
545
  entity: resource.entity,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * What this version of the assistant reads from a generated AI config: the resource kinds it
3
- * accepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values
4
- * it accepts.
3
+ * accepts, the resource fields its validator or a tool reads, the `vendor` and `tier` values it
4
+ * accepts, and the row-action shapes it runs.
5
5
  *
6
6
  * @remarks
7
7
  * The generator must not emit what the installed assistant does not read, or a new kind is left out
@@ -40,4 +40,5 @@ export const GENESIS_AI_CONSUMES = Object.freeze({
40
40
  ]),
41
41
  vendors: Object.freeze(['anthropic', 'gemini']),
42
42
  tiers: Object.freeze(['low', 'high', 'reasoning']),
43
+ shapes: Object.freeze(['row', 'key-row']),
43
44
  });
@@ -305,11 +305,10 @@ function valueFor(field, raw) {
305
305
  * The two limits count differently, each the stricter way round. The most is counted in UTF-16
306
306
  * units, as Java (and so H2) counts a VARCHAR, where an emoji is two: never fewer than the code
307
307
  * points the JSON schema counts, so nothing the database would refuse gets through. The fewest is
308
- * counted in code points, so nothing the schema accepts is refused. The row's own value is never
309
- * checked, carried or echoed back: it is not a change, and the column holds it.
308
+ * counted in code points, so nothing the schema accepts is refused.
310
309
  */
311
- function lengthRefusal(field, value, rowValue) {
312
- if (typeof value !== 'string' || !field.maxLength || value === rowValue)
310
+ function lengthRefusal(field, value) {
311
+ if (typeof value !== 'string' || !field.maxLength)
313
312
  return undefined;
314
313
  if (value.length > field.maxLength) {
315
314
  return `${field.name} holds at most ${field.maxLength} characters; this value has ${value.length}. Send a shorter one.`;
@@ -320,6 +319,40 @@ function lengthRefusal(field, value, rowValue) {
320
319
  }
321
320
  return undefined;
322
321
  }
322
+ /**
323
+ * The columns a whole number can overflow: Kotlin's Int and Short. The schema gives them no bounds,
324
+ * so a value past them reaches the database. A LONG is held to the safe integers in valueFor.
325
+ */
326
+ const INT_MIN = -2147483648;
327
+ const INT_MAX = 2147483647;
328
+ const SHORT_MIN = -32768;
329
+ const SHORT_MAX = 32767;
330
+ const WHOLE_NUMBER_RANGES = {
331
+ INT: [INT_MIN, INT_MAX],
332
+ INTEGER: [INT_MIN, INT_MAX],
333
+ SHORT: [SHORT_MIN, SHORT_MAX],
334
+ };
335
+ /** Why a whole number the model sent is out of its column's range, or `undefined`. */
336
+ function rangeRefusal(field, value) {
337
+ const range = WHOLE_NUMBER_RANGES[genesisTypeName(field.type)];
338
+ // A number, or digits when the field travels as text.
339
+ if (!range || (typeof value !== 'number' && typeof value !== 'string'))
340
+ return undefined;
341
+ const [min, max] = range;
342
+ const n = Number(value);
343
+ if (n > max) {
344
+ return `${field.name} holds whole numbers from ${min} to ${max}; this value is ${value}. Send a smaller one.`;
345
+ }
346
+ if (n < min) {
347
+ return `${field.name} holds whole numbers from ${min} to ${max}; this value is ${value}. Send a larger one.`;
348
+ }
349
+ return undefined;
350
+ }
351
+ /**
352
+ * Why a value the model sent does not fit its column. The row's own value is never checked,
353
+ * carried or echoed back: it is not a change, and the column holds it.
354
+ */
355
+ const fitRefusal = (field, value, rowValue) => { var _a; return value === rowValue ? undefined : ((_a = lengthRefusal(field, value)) !== null && _a !== void 0 ? _a : rangeRefusal(field, value)); };
323
356
  /**
324
357
  * Builds one event payload from a row the model supplied.
325
358
  *
@@ -678,7 +711,7 @@ export function buildEventPayload(fields, row, { op, preImage, unchecked }) {
678
711
  }
679
712
  const converted = valueFor(field, raw);
680
713
  const { value } = converted;
681
- const problem = (_b = (_a = converted.problem) !== null && _a !== void 0 ? _a : timeOfDayRefusal(field, { raw, value, fromRow, rowValue, op })) !== null && _b !== void 0 ? _b : lengthRefusal(field, value, rowValue);
714
+ const problem = (_b = (_a = converted.problem) !== null && _a !== void 0 ? _a : timeOfDayRefusal(field, { raw, value, fromRow, rowValue, op })) !== null && _b !== void 0 ? _b : fitRefusal(field, value, rowValue);
682
715
  if (problem) {
683
716
  // Attribute it correctly. A value carried from the pre-image is the SERVER's own — most
684
717
  // often a LONG beyond 2^53 that the read stamped as text and a JSON integer cannot carry
@@ -442,7 +442,7 @@ const decideOp = (resource, requestNames, whyNotReadable) => {
442
442
  const problem = rowActionProblem(resource, requestNames, whyNotReadable);
443
443
  if (problem)
444
444
  return { refused: problem };
445
- if (resource.shape === 'row')
445
+ if (resource.shape === 'row' || resource.shape === 'key-row')
446
446
  return { op: 'row-action' };
447
447
  return {
448
448
  refused: 'a custom event gets no write tool yet: every rule this path follows was learned from ' +
@@ -460,14 +460,23 @@ const decideOp = (resource, requestNames, whyNotReadable) => {
460
460
  * model may not set. A carry-only input, a NANO_TIMESTAMP, is one this assistant never sets.
461
461
  */
462
462
  function rowActionFieldProblem(resource, fields) {
463
- var _a, _b;
463
+ var _a, _b, _c;
464
464
  const byName = new Map(fields.map((field) => [field.name, field]));
465
465
  const problems = [];
466
466
  for (const name of (_a = resource.key) !== null && _a !== void 0 ? _a : []) {
467
467
  if (!byName.has(name))
468
468
  problems.push(`its key ${name} is not a field of the event`);
469
469
  }
470
- for (const { field: name } of (_b = resource.inputs) !== null && _b !== void 0 ? _b : []) {
470
+ // A key-row's payload is its event's fields valued from the row, so any field beyond the key
471
+ // would be sent without the model or the user choosing it. The platform's own count too.
472
+ if (resource.shape === 'key-row') {
473
+ const key = new Set((_b = resource.key) !== null && _b !== void 0 ? _b : []);
474
+ for (const { name } of fields) {
475
+ if (!key.has(name))
476
+ problems.push(`its event carries ${name}, which is not part of its key`);
477
+ }
478
+ }
479
+ for (const { field: name } of (_c = resource.inputs) !== null && _c !== void 0 ? _c : []) {
471
480
  const field = byName.get(name);
472
481
  if (!field)
473
482
  problems.push(`its input ${name} is not a field of the event`);
@@ -1171,9 +1180,11 @@ function runWrite(resource, args, context, deps) {
1171
1180
  // Every column the review will RENDER needs a type, and for a delete that is more than the
1172
1181
  // event declares: it shows the whole row, including columns the event never mentions, and
1173
1182
  // without a type a date is shown to the approver as raw epoch millis — `1789948800000` is not
1174
- // a review. The row source described those columns, so it has the answer.
1183
+ // a review. The row source described those columns, so it has the answer. A key-row shows the
1184
+ // row the same way: it sends only the key, and the key alone tells the user nothing.
1185
+ const showsRow = op === 'delete' || resource.shape === 'key-row';
1175
1186
  const shownFields = [...sendableFields(fields, op)];
1176
- if (op === 'delete' && source) {
1187
+ if (showsRow && source) {
1177
1188
  const described = yield source.describes();
1178
1189
  // `?? []` is for the type, and never decides anything. A row has a pre-image to render only if
1179
1190
  // its read succeeded, a read succeeds only after the source's metadata has loaded, and the
@@ -1198,10 +1209,11 @@ function runWrite(resource, args, context, deps) {
1198
1209
  // the event's own fields, which are also everything the write can change. A delete SENDS its
1199
1210
  // key alone but SHOWS the whole row, and a check over the key let a row somebody changed while
1200
1211
  // the review was open be removed as approved: the user saw QUANTITY 7, approved removing that
1201
- // row, and the row removed held 900 — reported `written`. Columns the metadata did not type
1202
- // are compared untyped; the platform's own are left out by stillCurrent, as TIMESTAMP moves
1203
- // on every unrelated write.
1204
- const checkedFields = op === 'delete'
1212
+ // row, and the row removed held 900 — reported `written`. A key-row is the same: a check over
1213
+ // its key would run a cancel on an order that filled while the review was open. Columns the
1214
+ // metadata did not type are compared untyped; the platform's own are left out by stillCurrent,
1215
+ // as TIMESTAMP moves on every unrelated write.
1216
+ const checkedFields = showsRow
1205
1217
  ? model.columns.map(({ field }) => {
1206
1218
  var _a;
1207
1219
  return (_a = shownFields.find((shown) => shown.name === field)) !== null && _a !== void 0 ? _a : {
@@ -39,7 +39,8 @@ var GENESIS_AI_CONSUMES = Object.freeze({
39
39
  "effects"
40
40
  ]),
41
41
  vendors: Object.freeze(["anthropic", "gemini"]),
42
- tiers: Object.freeze(["low", "high", "reasoning"])
42
+ tiers: Object.freeze(["low", "high", "reasoning"]),
43
+ shapes: Object.freeze(["row", "key-row"])
43
44
  });
44
45
  // Annotate the CommonJS export names for ESM import in node:
45
46
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/genesis/consumes.ts"],
4
- "sourcesContent": ["/**\n * What this version of the assistant reads from a generated AI config\n * (`@genesislcap/ai-assistant/genesis/consumes`).\n *\n * @remarks\n * Its own entry point, loadable in bare Node, because the seed's CI reads it in a Node step and\n * `./genesis` cannot be: that entry is bundler-target ESM, and its closure registers custom\n * elements, which need a DOM. So this module imports nothing at run time. A type from `./types`\n * is all it may take, and a test holds it to that. The Node build bundles it to\n * `dist/genesis-consumes.mjs` and `.cjs`, and a smoke test loads both without a DOM.\n *\n * @packageDocumentation\n * @beta\n */\nimport type { GenesisAiConsumes } from './types';\n\nexport type { GenesisAiConsumes } from './types';\n\n/**\n * What this version of the assistant reads from a generated AI config: the resource kinds it\n * accepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values\n * it accepts.\n *\n * @remarks\n * The generator must not emit what the installed assistant does not read, or a new kind is left out\n * and a new field ignored \u2014 and an older assistant used to block entirely on a kind it did not know.\n * Nothing in the generator can say which version will run its output. So the app's seed declares\n * what it expects, and the seed's CI checks that declaration against this constant, exported from\n * the version it installs. That makes this the single statement of what an assistant consumes, and\n * it carries no version number because it needs none.\n *\n * A test holds it to the code: its kinds are the ones validation accepts, and its fields are the\n * ones read. A change that teaches the validator a kind, or a tool a field, updates it in the same\n * commit.\n *\n * A resource this version does not read is only left out, but an unknown `vendor` or `tier` still\n * blocks the whole assistant, so those are here too. They are written out rather than imported\n * from foundation-ai, which this entry must not load; a test holds them equal to its\n * `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.\n *\n * @beta\n */\nexport const GENESIS_AI_CONSUMES: GenesisAiConsumes = Object.freeze({\n kinds: Object.freeze(['request', 'event', 'query'] as const),\n resourceFields: Object.freeze([\n 'name',\n 'kind',\n 'op',\n 'context',\n 'maxRows',\n 'customCode',\n 'references',\n 'shape',\n 'entity',\n 'key',\n 'inputs',\n 'effects',\n ] as const),\n vendors: Object.freeze(['anthropic', 'gemini'] as const),\n tiers: Object.freeze(['low', 'high', 'reasoning'] as const),\n});\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CO,IAAM,sBAAyC,OAAO,OAAO;AAAA,EAClE,OAAO,OAAO,OAAO,CAAC,WAAW,SAAS,OAAO,CAAU;AAAA,EAC3D,gBAAgB,OAAO,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAU;AAAA,EACV,SAAS,OAAO,OAAO,CAAC,aAAa,QAAQ,CAAU;AAAA,EACvD,OAAO,OAAO,OAAO,CAAC,OAAO,QAAQ,WAAW,CAAU;AAC5D,CAAC;",
4
+ "sourcesContent": ["/**\n * What this version of the assistant reads from a generated AI config\n * (`@genesislcap/ai-assistant/genesis/consumes`).\n *\n * @remarks\n * Its own entry point, loadable in bare Node, because the seed's CI reads it in a Node step and\n * `./genesis` cannot be: that entry is bundler-target ESM, and its closure registers custom\n * elements, which need a DOM. So this module imports nothing at run time. A type from `./types`\n * is all it may take, and a test holds it to that. The Node build bundles it to\n * `dist/genesis-consumes.mjs` and `.cjs`, and a smoke test loads both without a DOM.\n *\n * @packageDocumentation\n * @beta\n */\nimport type { GenesisAiConsumes } from './types';\n\nexport type { GenesisAiConsumes } from './types';\n\n/**\n * What this version of the assistant reads from a generated AI config: the resource kinds it\n * accepts, the resource fields its validator or a tool reads, the `vendor` and `tier` values it\n * accepts, and the row-action shapes it runs.\n *\n * @remarks\n * The generator must not emit what the installed assistant does not read, or a new kind is left out\n * and a new field ignored \u2014 and an older assistant used to block entirely on a kind it did not know.\n * Nothing in the generator can say which version will run its output. So the app's seed declares\n * what it expects, and the seed's CI checks that declaration against this constant, exported from\n * the version it installs. That makes this the single statement of what an assistant consumes, and\n * it carries no version number because it needs none.\n *\n * A test holds it to the code: its kinds are the ones validation accepts, and its fields are the\n * ones read. A change that teaches the validator a kind, or a tool a field, updates it in the same\n * commit.\n *\n * A resource this version does not read is only left out, but an unknown `vendor` or `tier` still\n * blocks the whole assistant, so those are here too. They are written out rather than imported\n * from foundation-ai, which this entry must not load; a test holds them equal to its\n * `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.\n *\n * @beta\n */\nexport const GENESIS_AI_CONSUMES: GenesisAiConsumes = Object.freeze({\n kinds: Object.freeze(['request', 'event', 'query'] as const),\n resourceFields: Object.freeze([\n 'name',\n 'kind',\n 'op',\n 'context',\n 'maxRows',\n 'customCode',\n 'references',\n 'shape',\n 'entity',\n 'key',\n 'inputs',\n 'effects',\n ] as const),\n vendors: Object.freeze(['anthropic', 'gemini'] as const),\n tiers: Object.freeze(['low', 'high', 'reasoning'] as const),\n shapes: Object.freeze(['row', 'key-row'] as const),\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CO,IAAM,sBAAyC,OAAO,OAAO;AAAA,EAClE,OAAO,OAAO,OAAO,CAAC,WAAW,SAAS,OAAO,CAAU;AAAA,EAC3D,gBAAgB,OAAO,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAU;AAAA,EACV,SAAS,OAAO,OAAO,CAAC,aAAa,QAAQ,CAAU;AAAA,EACvD,OAAO,OAAO,OAAO,CAAC,OAAO,QAAQ,WAAW,CAAU;AAAA,EAC1D,QAAQ,OAAO,OAAO,CAAC,OAAO,SAAS,CAAU;AACnD,CAAC;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,8 @@ var GENESIS_AI_CONSUMES = Object.freeze({
16
16
  "effects"
17
17
  ]),
18
18
  vendors: Object.freeze(["anthropic", "gemini"]),
19
- tiers: Object.freeze(["low", "high", "reasoning"])
19
+ tiers: Object.freeze(["low", "high", "reasoning"]),
20
+ shapes: Object.freeze(["row", "key-row"])
20
21
  });
21
22
  export {
22
23
  GENESIS_AI_CONSUMES
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/genesis/consumes.ts"],
4
- "sourcesContent": ["/**\n * What this version of the assistant reads from a generated AI config\n * (`@genesislcap/ai-assistant/genesis/consumes`).\n *\n * @remarks\n * Its own entry point, loadable in bare Node, because the seed's CI reads it in a Node step and\n * `./genesis` cannot be: that entry is bundler-target ESM, and its closure registers custom\n * elements, which need a DOM. So this module imports nothing at run time. A type from `./types`\n * is all it may take, and a test holds it to that. The Node build bundles it to\n * `dist/genesis-consumes.mjs` and `.cjs`, and a smoke test loads both without a DOM.\n *\n * @packageDocumentation\n * @beta\n */\nimport type { GenesisAiConsumes } from './types';\n\nexport type { GenesisAiConsumes } from './types';\n\n/**\n * What this version of the assistant reads from a generated AI config: the resource kinds it\n * accepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values\n * it accepts.\n *\n * @remarks\n * The generator must not emit what the installed assistant does not read, or a new kind is left out\n * and a new field ignored \u2014 and an older assistant used to block entirely on a kind it did not know.\n * Nothing in the generator can say which version will run its output. So the app's seed declares\n * what it expects, and the seed's CI checks that declaration against this constant, exported from\n * the version it installs. That makes this the single statement of what an assistant consumes, and\n * it carries no version number because it needs none.\n *\n * A test holds it to the code: its kinds are the ones validation accepts, and its fields are the\n * ones read. A change that teaches the validator a kind, or a tool a field, updates it in the same\n * commit.\n *\n * A resource this version does not read is only left out, but an unknown `vendor` or `tier` still\n * blocks the whole assistant, so those are here too. They are written out rather than imported\n * from foundation-ai, which this entry must not load; a test holds them equal to its\n * `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.\n *\n * @beta\n */\nexport const GENESIS_AI_CONSUMES: GenesisAiConsumes = Object.freeze({\n kinds: Object.freeze(['request', 'event', 'query'] as const),\n resourceFields: Object.freeze([\n 'name',\n 'kind',\n 'op',\n 'context',\n 'maxRows',\n 'customCode',\n 'references',\n 'shape',\n 'entity',\n 'key',\n 'inputs',\n 'effects',\n ] as const),\n vendors: Object.freeze(['anthropic', 'gemini'] as const),\n tiers: Object.freeze(['low', 'high', 'reasoning'] as const),\n});\n"],
5
- "mappings": ";AA0CO,IAAM,sBAAyC,OAAO,OAAO;AAAA,EAClE,OAAO,OAAO,OAAO,CAAC,WAAW,SAAS,OAAO,CAAU;AAAA,EAC3D,gBAAgB,OAAO,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAU;AAAA,EACV,SAAS,OAAO,OAAO,CAAC,aAAa,QAAQ,CAAU;AAAA,EACvD,OAAO,OAAO,OAAO,CAAC,OAAO,QAAQ,WAAW,CAAU;AAC5D,CAAC;",
4
+ "sourcesContent": ["/**\n * What this version of the assistant reads from a generated AI config\n * (`@genesislcap/ai-assistant/genesis/consumes`).\n *\n * @remarks\n * Its own entry point, loadable in bare Node, because the seed's CI reads it in a Node step and\n * `./genesis` cannot be: that entry is bundler-target ESM, and its closure registers custom\n * elements, which need a DOM. So this module imports nothing at run time. A type from `./types`\n * is all it may take, and a test holds it to that. The Node build bundles it to\n * `dist/genesis-consumes.mjs` and `.cjs`, and a smoke test loads both without a DOM.\n *\n * @packageDocumentation\n * @beta\n */\nimport type { GenesisAiConsumes } from './types';\n\nexport type { GenesisAiConsumes } from './types';\n\n/**\n * What this version of the assistant reads from a generated AI config: the resource kinds it\n * accepts, the resource fields its validator or a tool reads, the `vendor` and `tier` values it\n * accepts, and the row-action shapes it runs.\n *\n * @remarks\n * The generator must not emit what the installed assistant does not read, or a new kind is left out\n * and a new field ignored \u2014 and an older assistant used to block entirely on a kind it did not know.\n * Nothing in the generator can say which version will run its output. So the app's seed declares\n * what it expects, and the seed's CI checks that declaration against this constant, exported from\n * the version it installs. That makes this the single statement of what an assistant consumes, and\n * it carries no version number because it needs none.\n *\n * A test holds it to the code: its kinds are the ones validation accepts, and its fields are the\n * ones read. A change that teaches the validator a kind, or a tool a field, updates it in the same\n * commit.\n *\n * A resource this version does not read is only left out, but an unknown `vendor` or `tier` still\n * blocks the whole assistant, so those are here too. They are written out rather than imported\n * from foundation-ai, which this entry must not load; a test holds them equal to its\n * `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.\n *\n * @beta\n */\nexport const GENESIS_AI_CONSUMES: GenesisAiConsumes = Object.freeze({\n kinds: Object.freeze(['request', 'event', 'query'] as const),\n resourceFields: Object.freeze([\n 'name',\n 'kind',\n 'op',\n 'context',\n 'maxRows',\n 'customCode',\n 'references',\n 'shape',\n 'entity',\n 'key',\n 'inputs',\n 'effects',\n ] as const),\n vendors: Object.freeze(['anthropic', 'gemini'] as const),\n tiers: Object.freeze(['low', 'high', 'reasoning'] as const),\n shapes: Object.freeze(['row', 'key-row'] as const),\n});\n"],
5
+ "mappings": ";AA0CO,IAAM,sBAAyC,OAAO,OAAO;AAAA,EAClE,OAAO,OAAO,OAAO,CAAC,WAAW,SAAS,OAAO,CAAU;AAAA,EAC3D,gBAAgB,OAAO,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAU;AAAA,EACV,SAAS,OAAO,OAAO,CAAC,aAAa,QAAQ,CAAU;AAAA,EACvD,OAAO,OAAO,OAAO,CAAC,OAAO,QAAQ,WAAW,CAAU;AAAA,EAC1D,QAAQ,OAAO,OAAO,CAAC,OAAO,SAAS,CAAU;AACnD,CAAC;",
6
6
  "names": []
7
7
  }
package/docs/genesis.md CHANGED
@@ -139,6 +139,7 @@ GENESIS_AI_CONSUMES;
139
139
  // 'shape', 'entity', 'key', 'inputs', 'effects'],
140
140
  // vendors: ['anthropic', 'gemini'],
141
141
  // tiers: ['low', 'high', 'reasoning'],
142
+ // shapes: ['row', 'key-row'],
142
143
  // }
143
144
  ```
144
145
 
@@ -163,6 +164,10 @@ than the rest: a resource this version does not read is only left out, but an un
163
164
  them too. The seed's check reads `kinds` and `resourceFields` today. A test holds both lists
164
165
  equal to foundation-ai's `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.
165
166
 
167
+ `shapes` are the row-action shapes this version runs (see [Row actions](#row-actions)). A seed
168
+ declares `key-row` only when the assistant it installs lists it; an older assistant leaves a
169
+ `key-row` resource out, with a warning. A test holds the list to the shapes the validator accepts.
170
+
166
171
  ---
167
172
 
168
173
  ## Read tools
@@ -308,6 +313,11 @@ one."). The most is counted as the database counts it, where an emoji is two cha
308
313
  fewest counts an emoji as one. A value the row already holds, or the model echoing it back, is not
309
314
  checked. An `ENUM` is checked against its values instead.
310
315
 
316
+ An `INT` holds whole numbers from -2147483648 to 2147483647, and a `SHORT` from -32768 to 32767.
317
+ Neither range is in the schema, so a value outside it is refused before the review in the same way
318
+ ("QUANTITY holds whole numbers from -2147483648 to 2147483647; this value is 3000000000. Send a
319
+ smaller one."). A `LONG` must be a whole number JavaScript can hold exactly, as before.
320
+
311
321
  A write tool reads a field's type from its event metadata's `GENESIS_TYPE`, and from `TYPE` only
312
322
  when there is no `GENESIS_TYPE`. `TYPE` names the Java class the value travels as, so a GSF 8.15
313
323
  app describes a `DATE` field as `TYPE: DATETIME` with `GENESIS_TYPE: DATE`. The read tools'
@@ -461,21 +471,21 @@ shape, and states in the resource what the code does:
461
471
 
462
472
  | Field | Rule |
463
473
  | --------- | ---------------------------------------------------------------------------------------------------------- |
464
- | `shape` | `row`, the only shape this version runs. |
474
+ | `shape` | `row`, or `key-row` for a handler whose event carries only the key (see below). |
465
475
  | `entity` | The handler's own table. Its rows are read through `REQ_<entity>`, which must be a request in the config. |
466
476
  | `key` | The table's primary-key fields, at least one, each once. Never `RECORD_ID` or `TIMESTAMP`. |
467
477
  | `inputs` | The other values the code reads, each `{ "field": …, "required": true }`. May be empty; never a key field. |
468
478
  | `effects` | One `{ "op": "modify" \| "insert", "table": … }` per write in the code, in order. Exactly one modify, of `entity`. |
469
479
 
470
- The bridge checks what it can. In the config: `shape` is `row`; `entity` and every name in the lists
471
- is written as a table or field name (upper-case letters, digits and underscores); `key` is not
472
- empty, names nothing twice, and never `RECORD_ID` or `TIMESTAMP`; each input is
473
- `{ "field": …, "required": true }` and not a key field; each effect is a modify or an insert, and
474
- there is exactly one modify, of `entity`; and `REQ_<entity>` is a request it can read. A row action
475
- that fails one of these is left out with a warning, and the rest of the config is kept. When the
476
- tool is built, the key fields and the inputs must be fields of the event, the row source must be
477
- searchable by every key field, and no input may be one a model cannot set; otherwise it gets no
478
- tool.
480
+ The bridge checks what it can. In the config: `shape` is `row` or `key-row`; `entity` and every name
481
+ in the lists is written as a table or field name (upper-case letters, digits and underscores); `key`
482
+ is not empty, names nothing twice, and never `RECORD_ID` or `TIMESTAMP`; each input is
483
+ `{ "field": …, "required": true }` and not a key field, and a `key-row` has none; each effect is a
484
+ modify or an insert, and there is exactly one modify, of `entity`; and `REQ_<entity>` is a request
485
+ it can read. A row action that fails one of these is left out with a warning, and the rest of the
486
+ config is kept. When the tool is built, the key fields and the inputs must be fields of the event,
487
+ the row source must be searchable by every key field, and no input may be one a model cannot set;
488
+ otherwise it gets no tool.
479
489
 
480
490
  The rest it cannot check, so the generator guarantees it and a hand-written config must get it
481
491
  right: `key` is the table's primary key, in its order; `inputs` are every other value the code
@@ -499,9 +509,10 @@ value.
499
509
 
500
510
  The review shows each row as it is now, with its key fields marked; each input shows the value
501
511
  the handler is given, marked "input:". Unlike a delete's review, it shows only the event's own
502
- fields, not every column the read returns. As in every review, `RECORD_ID` and `TIMESTAMP` are left
503
- out. It never marks a change: what the row becomes is decided by the handler's code, which the
504
- review cannot run. Under its header it says what that code wrote when the app was generated:
512
+ fields, not every column the read returns; a key-row is the exception (below). As in every
513
+ review, `RECORD_ID` and `TIMESTAMP` are left out. It never marks a change: what the row becomes is
514
+ decided by the handler's code, which the review cannot run. Under its header it says what that
515
+ code wrote when the app was generated:
505
516
 
506
517
  > Run RESPOND_RFQ on 1 RFQ row(s). Nothing is written until you choose rows and select Write.
507
518
  > When this app was generated, the handler's code wrote: modify RFQ.
@@ -513,6 +524,17 @@ that changed is not sent: it is reported as changed, naming what changed. A deni
513
524
  write tool on `entity` for the rest of the turn, the table's own insert, modify and delete
514
525
  included, but not the tables the code also inserts into.
515
526
 
527
+ A **key-row** is a row action whose event carries the key and nothing else: a handler declared on
528
+ its table's key (`eventHandler<FxOrder.ById>`) that loads the row itself. Its `shape` is
529
+ `key-row`, and its `inputs` must be `[]`. When the tool is built, the event's fields must be
530
+ exactly `key`; one more field, `RECORD_ID` or `TIMESTAMP` included, and it gets no tool. The model
531
+ names the row by its key, and the payload is the key alone, valued from the row as read. Because
532
+ the key alone tells the user nothing, its review shows the whole row, as a delete's does: every
533
+ column the read returns except `RECORD_ID` and `TIMESTAMP`, with the key marked, under the same
534
+ header and lines. Before the row is sent it is read again by its key, and every column shown is
535
+ compared, so an order that filled while the review was open is not cancelled; it is reported as
536
+ changed.
537
+
516
538
  **An `EVENT_NACK` on a run means nothing was written.** That holds only because of what the
517
539
  generator checks: it accepts a handler whose code never writes while validating and never
518
540
  returns `nack()` after a write, and a `transactional = true` handler that throws rolls back what
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "15.53.0",
4
+ "version": "15.55.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -92,31 +92,31 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@genesislcap/foundation-comms": "15.53.0",
96
- "@genesislcap/foundation-testing": "15.53.0",
97
- "@genesislcap/genx": "15.53.0",
98
- "@genesislcap/ts-builder": "15.53.0",
99
- "@genesislcap/uvu-playwright-builder": "15.53.0",
100
- "@genesislcap/vite-builder": "15.53.0",
101
- "@genesislcap/webpack-builder": "15.53.0",
95
+ "@genesislcap/foundation-comms": "15.55.0",
96
+ "@genesislcap/foundation-testing": "15.55.0",
97
+ "@genesislcap/genx": "15.55.0",
98
+ "@genesislcap/ts-builder": "15.55.0",
99
+ "@genesislcap/uvu-playwright-builder": "15.55.0",
100
+ "@genesislcap/vite-builder": "15.55.0",
101
+ "@genesislcap/webpack-builder": "15.55.0",
102
102
  "@types/dompurify": "^3.0.5",
103
103
  "@types/marked": "^5.0.2",
104
104
  "esbuild": "0.25.12"
105
105
  },
106
106
  "dependencies": {
107
- "@genesislcap/foundation-ai": "15.53.0",
108
- "@genesislcap/foundation-logger": "15.53.0",
109
- "@genesislcap/foundation-notifications": "15.53.0",
110
- "@genesislcap/foundation-redux": "15.53.0",
111
- "@genesislcap/foundation-ui": "15.53.0",
112
- "@genesislcap/foundation-utils": "15.53.0",
113
- "@genesislcap/rapid-design-system": "15.53.0",
114
- "@genesislcap/web-core": "15.53.0",
107
+ "@genesislcap/foundation-ai": "15.55.0",
108
+ "@genesislcap/foundation-logger": "15.55.0",
109
+ "@genesislcap/foundation-notifications": "15.55.0",
110
+ "@genesislcap/foundation-redux": "15.55.0",
111
+ "@genesislcap/foundation-ui": "15.55.0",
112
+ "@genesislcap/foundation-utils": "15.55.0",
113
+ "@genesislcap/rapid-design-system": "15.55.0",
114
+ "@genesislcap/web-core": "15.55.0",
115
115
  "dompurify": "^3.3.1",
116
116
  "marked": "^17.0.3"
117
117
  },
118
118
  "peerDependencies": {
119
- "@genesislcap/foundation-comms": "^15.53.0"
119
+ "@genesislcap/foundation-comms": "^15.55.0"
120
120
  },
121
121
  "peerDependenciesMeta": {
122
122
  "@genesislcap/foundation-comms": {
@@ -37,6 +37,7 @@ const EXPECTED = {
37
37
  ],
38
38
  vendors: ['anthropic', 'gemini'],
39
39
  tiers: ['low', 'high', 'reasoning'],
40
+ shapes: ['row', 'key-row'],
40
41
  };
41
42
 
42
43
  const failures = [];