@genesislcap/ai-assistant 15.69.0 → 15.71.0-FUI-2650.1

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 (139) hide show
  1. package/dist/ai-assistant.api.json +97 -0
  2. package/dist/ai-assistant.d.ts +65 -0
  3. package/dist/chat-driver.cjs +18031 -0
  4. package/dist/chat-driver.cjs.map +4 -4
  5. package/dist/chat-driver.mjs +18024 -0
  6. package/dist/chat-driver.mjs.map +4 -4
  7. package/dist/custom-elements.json +5524 -2684
  8. package/dist/dts/chat-driver-node.d.ts +2 -0
  9. package/dist/dts/chat-driver-node.d.ts.map +1 -1
  10. package/dist/dts/code-review/code-review.types.d.ts +76 -0
  11. package/dist/dts/code-review/code-review.types.d.ts.map +1 -0
  12. package/dist/dts/code-review/code-reviewer.agent.d.ts +77 -0
  13. package/dist/dts/code-review/code-reviewer.agent.d.ts.map +1 -0
  14. package/dist/dts/code-review/code-reviewer.prompt.d.ts +23 -0
  15. package/dist/dts/code-review/code-reviewer.prompt.d.ts.map +1 -0
  16. package/dist/dts/code-review/gate.d.ts +44 -0
  17. package/dist/dts/code-review/gate.d.ts.map +1 -0
  18. package/dist/dts/code-review/index.d.ts +27 -0
  19. package/dist/dts/code-review/index.d.ts.map +1 -0
  20. package/dist/dts/code-review/review-changes.d.ts +70 -0
  21. package/dist/dts/code-review/review-changes.d.ts.map +1 -0
  22. package/dist/dts/code-review/rules/context-trigger-map.d.ts +6 -0
  23. package/dist/dts/code-review/rules/context-trigger-map.d.ts.map +1 -0
  24. package/dist/dts/code-review/rules/context.registry.d.ts +123 -0
  25. package/dist/dts/code-review/rules/context.registry.d.ts.map +1 -0
  26. package/dist/dts/code-review/rules/fui-ai-extensions.d.ts +13 -0
  27. package/dist/dts/code-review/rules/fui-ai-extensions.d.ts.map +1 -0
  28. package/dist/dts/code-review/rules/fui-blotter.d.ts +16 -0
  29. package/dist/dts/code-review/rules/fui-blotter.d.ts.map +1 -0
  30. package/dist/dts/code-review/rules/fui-chart.d.ts +20 -0
  31. package/dist/dts/code-review/rules/fui-chart.d.ts.map +1 -0
  32. package/dist/dts/code-review/rules/fui-column-defs.d.ts +21 -0
  33. package/dist/dts/code-review/rules/fui-column-defs.d.ts.map +1 -0
  34. package/dist/dts/code-review/rules/fui-components.d.ts +9 -0
  35. package/dist/dts/code-review/rules/fui-components.d.ts.map +1 -0
  36. package/dist/dts/code-review/rules/fui-criteria.d.ts +32 -0
  37. package/dist/dts/code-review/rules/fui-criteria.d.ts.map +1 -0
  38. package/dist/dts/code-review/rules/fui-custom-renderer.d.ts +15 -0
  39. package/dist/dts/code-review/rules/fui-custom-renderer.d.ts.map +1 -0
  40. package/dist/dts/code-review/rules/fui-dashboard.d.ts +19 -0
  41. package/dist/dts/code-review/rules/fui-dashboard.d.ts.map +1 -0
  42. package/dist/dts/code-review/rules/fui-dialogs.d.ts +19 -0
  43. package/dist/dts/code-review/rules/fui-dialogs.d.ts.map +1 -0
  44. package/dist/dts/code-review/rules/fui-entity-management.d.ts +19 -0
  45. package/dist/dts/code-review/rules/fui-entity-management.d.ts.map +1 -0
  46. package/dist/dts/code-review/rules/fui-error-boundary.d.ts +9 -0
  47. package/dist/dts/code-review/rules/fui-error-boundary.d.ts.map +1 -0
  48. package/dist/dts/code-review/rules/fui-eventing.d.ts +8 -0
  49. package/dist/dts/code-review/rules/fui-eventing.d.ts.map +1 -0
  50. package/dist/dts/code-review/rules/fui-flexlayout.d.ts +17 -0
  51. package/dist/dts/code-review/rules/fui-flexlayout.d.ts.map +1 -0
  52. package/dist/dts/code-review/rules/fui-flyout-panel.d.ts +10 -0
  53. package/dist/dts/code-review/rules/fui-flyout-panel.d.ts.map +1 -0
  54. package/dist/dts/code-review/rules/fui-form-component.d.ts +9 -0
  55. package/dist/dts/code-review/rules/fui-form-component.d.ts.map +1 -0
  56. package/dist/dts/code-review/rules/fui-formatters.d.ts +12 -0
  57. package/dist/dts/code-review/rules/fui-formatters.d.ts.map +1 -0
  58. package/dist/dts/code-review/rules/fui-foundation-comms.d.ts +10 -0
  59. package/dist/dts/code-review/rules/fui-foundation-comms.d.ts.map +1 -0
  60. package/dist/dts/code-review/rules/fui-global-filters.d.ts +33 -0
  61. package/dist/dts/code-review/rules/fui-global-filters.d.ts.map +1 -0
  62. package/dist/dts/code-review/rules/fui-import-surface.d.ts +37 -0
  63. package/dist/dts/code-review/rules/fui-import-surface.d.ts.map +1 -0
  64. package/dist/dts/code-review/rules/fui-inline-editing.d.ts +10 -0
  65. package/dist/dts/code-review/rules/fui-inline-editing.d.ts.map +1 -0
  66. package/dist/dts/code-review/rules/fui-layout.d.ts +7 -0
  67. package/dist/dts/code-review/rules/fui-layout.d.ts.map +1 -0
  68. package/dist/dts/code-review/rules/fui-notifications.d.ts +12 -0
  69. package/dist/dts/code-review/rules/fui-notifications.d.ts.map +1 -0
  70. package/dist/dts/code-review/rules/fui-primitives.d.ts +26 -0
  71. package/dist/dts/code-review/rules/fui-primitives.d.ts.map +1 -0
  72. package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts +18 -0
  73. package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts.map +1 -0
  74. package/dist/dts/code-review/rules/fui-redux-store.d.ts +8 -0
  75. package/dist/dts/code-review/rules/fui-redux-store.d.ts.map +1 -0
  76. package/dist/dts/code-review/rules/fui-reporting.d.ts +19 -0
  77. package/dist/dts/code-review/rules/fui-reporting.d.ts.map +1 -0
  78. package/dist/dts/code-review/rules/fui-styling.d.ts +15 -0
  79. package/dist/dts/code-review/rules/fui-styling.d.ts.map +1 -0
  80. package/dist/dts/code-review/rules/fui-trade-form.d.ts +13 -0
  81. package/dist/dts/code-review/rules/fui-trade-form.d.ts.map +1 -0
  82. package/dist/dts/code-review/submit-code-review.tool.d.ts +12 -0
  83. package/dist/dts/code-review/submit-code-review.tool.d.ts.map +1 -0
  84. package/dist/dts/code-review/unified-diff.d.ts +7 -0
  85. package/dist/dts/code-review/unified-diff.d.ts.map +1 -0
  86. package/dist/dts/code-review/verdict.d.ts +23 -0
  87. package/dist/dts/code-review/verdict.d.ts.map +1 -0
  88. package/dist/dts/components/code-review-result/code-review-result.d.ts +26 -0
  89. package/dist/dts/components/code-review-result/code-review-result.d.ts.map +1 -0
  90. package/dist/dts/index.d.ts +1 -0
  91. package/dist/dts/index.d.ts.map +1 -1
  92. package/dist/dts/react.d.ts +20 -10
  93. package/dist/esm/chat-driver-node.js +6 -0
  94. package/dist/esm/code-review/code-review.types.js +6 -0
  95. package/dist/esm/code-review/code-reviewer.agent.js +167 -0
  96. package/dist/esm/code-review/code-reviewer.prompt.js +103 -0
  97. package/dist/esm/code-review/gate.js +93 -0
  98. package/dist/esm/code-review/index.js +28 -0
  99. package/dist/esm/code-review/review-changes.js +123 -0
  100. package/dist/esm/code-review/rules/context-trigger-map.js +20 -0
  101. package/dist/esm/code-review/rules/context.registry.js +772 -0
  102. package/dist/esm/code-review/rules/fui-ai-extensions.js +306 -0
  103. package/dist/esm/code-review/rules/fui-blotter.js +596 -0
  104. package/dist/esm/code-review/rules/fui-chart.js +669 -0
  105. package/dist/esm/code-review/rules/fui-column-defs.js +862 -0
  106. package/dist/esm/code-review/rules/fui-components.js +245 -0
  107. package/dist/esm/code-review/rules/fui-criteria.js +538 -0
  108. package/dist/esm/code-review/rules/fui-custom-renderer.js +612 -0
  109. package/dist/esm/code-review/rules/fui-dashboard.js +604 -0
  110. package/dist/esm/code-review/rules/fui-dialogs.js +588 -0
  111. package/dist/esm/code-review/rules/fui-entity-management.js +1014 -0
  112. package/dist/esm/code-review/rules/fui-error-boundary.js +244 -0
  113. package/dist/esm/code-review/rules/fui-eventing.js +628 -0
  114. package/dist/esm/code-review/rules/fui-flexlayout.js +860 -0
  115. package/dist/esm/code-review/rules/fui-flyout-panel.js +432 -0
  116. package/dist/esm/code-review/rules/fui-form-component.js +898 -0
  117. package/dist/esm/code-review/rules/fui-formatters.js +415 -0
  118. package/dist/esm/code-review/rules/fui-foundation-comms.js +518 -0
  119. package/dist/esm/code-review/rules/fui-global-filters.js +778 -0
  120. package/dist/esm/code-review/rules/fui-import-surface.js +452 -0
  121. package/dist/esm/code-review/rules/fui-inline-editing.js +445 -0
  122. package/dist/esm/code-review/rules/fui-layout.js +431 -0
  123. package/dist/esm/code-review/rules/fui-notifications.js +439 -0
  124. package/dist/esm/code-review/rules/fui-primitives.js +1216 -0
  125. package/dist/esm/code-review/rules/fui-rapid-grid-pro.js +650 -0
  126. package/dist/esm/code-review/rules/fui-redux-store.js +522 -0
  127. package/dist/esm/code-review/rules/fui-reporting.js +506 -0
  128. package/dist/esm/code-review/rules/fui-styling.js +1229 -0
  129. package/dist/esm/code-review/rules/fui-trade-form.js +618 -0
  130. package/dist/esm/code-review/submit-code-review.tool.js +43 -0
  131. package/dist/esm/code-review/unified-diff.js +96 -0
  132. package/dist/esm/code-review/verdict.js +24 -0
  133. package/dist/esm/components/code-review-result/code-review-result.js +89 -0
  134. package/dist/esm/index.js +3 -0
  135. package/dist/react.cjs +25 -18
  136. package/dist/react.mjs +23 -17
  137. package/docs/code-review.md +137 -0
  138. package/package.json +24 -17
  139. package/scripts/smoke-chat-driver-node.mjs +15 -0
@@ -0,0 +1,244 @@
1
+ /**
2
+ * Context injected into the UI Builder system prompt.
3
+ * Covers the TileErrorBoundary pattern for new custom component files.
4
+ *
5
+ * Tags for selective context injection — loaded when the conversation mentions these keywords.
6
+ */
7
+ export const FUI_ERROR_BOUNDARY_TAGS = [
8
+ 'TileErrorBoundary',
9
+ 'AppErrorBoundary',
10
+ 'withTileErrorBoundary',
11
+ 'ErrorBoundary',
12
+ 'error boundary',
13
+ 'error fallback',
14
+ 'ErrorBoundaryFallback',
15
+ 'handle crash',
16
+ 'catch error',
17
+ 'component crash',
18
+ 'tile crash',
19
+ 'error handling',
20
+ 'crash recovery',
21
+ 'retry on error',
22
+ 'show error message',
23
+ 'error isolation',
24
+ 'something went wrong',
25
+ ];
26
+ export const FUI_ERROR_BOUNDARY_CONTEXT = `
27
+ ## GENESIS ERROR BOUNDARY
28
+
29
+ New **standalone utility / helper** components you create MUST be wrapped with \`TileErrorBoundary\`. This isolates crashes so the rest of the app keeps running and shows the user a recovery UI with copy-able diagnostics.
30
+
31
+ **Exception — route tile components:** If you are creating a new component that will be registered in a route's \`componentMap\` (i.e. a tile component like \`TradeFiltersComponent.tsx\`), do **NOT** wrap it with \`TileErrorBoundary\` or \`withTileErrorBoundary\`. The route \`factory\` function already wraps every \`componentMap\` entry automatically — adding a second boundary would double-wrap the component.
32
+
33
+ ### Source
34
+
35
+ \`TileErrorBoundary\`, \`AppErrorBoundary\`, and \`withTileErrorBoundary\` are **local** React components shipped as part of the app scaffold — they live at \`src/components/error-boundary/ErrorBoundary.tsx\`. They are **NOT** imported from any \`@genesislcap/*\` npm package.
36
+
37
+ ### Exports from \`components/error-boundary/ErrorBoundary\`
38
+
39
+ | Export | Use for |
40
+ |---|---|
41
+ | \`TileErrorBoundary\` | JSX wrapper around a tile's root element |
42
+ | \`withTileErrorBoundary\` | HOC — wraps a component at the export boundary |
43
+ | \`AppErrorBoundary\` | Top-level app wrapper — do not add more of these |
44
+
45
+ ### Type signatures (source-verified against \`ErrorBoundary.tsx\`)
46
+
47
+ \`\`\`ts
48
+ // TileErrorBoundary
49
+ type TileErrorBoundaryProps = {
50
+ title: string; // human-readable tile name shown in the error UI
51
+ tileRegistration: string; // camelCase component/tile key used in the layout
52
+ children: React.ReactNode;
53
+ };
54
+
55
+ // AppErrorBoundary — only accepts children, no extra props
56
+ type AppErrorBoundaryProps = {
57
+ children: React.ReactNode;
58
+ };
59
+
60
+ // withTileErrorBoundary HOC signature
61
+ const withTileErrorBoundary: (
62
+ Component: React.ComponentType,
63
+ title: string,
64
+ tileRegistration: string,
65
+ ) => React.FC;
66
+ \`\`\`
67
+
68
+ The fallback UI (\`ErrorBoundaryFallback\`) is built into \`TileErrorBoundary\` — it shows a human-readable title, a copy-able diagnostics textarea (error name, message, stack, component stack, reference ID, timestamp, URL), and a Retry button that resets the boundary state.
69
+
70
+ Every caught error is also pushed to \`window.__GENESIS_ERROR_BOUNDARY_REPORTS__\` (last 20), which
71
+ preview diagnostics read — a crash in an UNwrapped component escapes this reporting AND takes down
72
+ the whole page instead of one tile. This is why the boundary discipline below is mandatory.
73
+
74
+ ### Pattern A — wrap in JSX (preferred for inline usage)
75
+
76
+ \`\`\`tsx
77
+ import { TileErrorBoundary } from '../../components/error-boundary/ErrorBoundary';
78
+
79
+ const MyTile: React.FC = () => {
80
+ return (
81
+ <TileErrorBoundary title="My Tile" tileRegistration="myTile">
82
+ {/* tile content */}
83
+ </TileErrorBoundary>
84
+ );
85
+ };
86
+ \`\`\`
87
+
88
+ ### Pattern B — HOC at export boundary (preferred for new standalone tile files)
89
+
90
+ \`\`\`tsx
91
+ import { withTileErrorBoundary } from '../../components/error-boundary/ErrorBoundary';
92
+
93
+ const MyTileInner: React.FC = () => {
94
+ return <div>{/* tile content */}</div>;
95
+ };
96
+
97
+ export const MyTile = withTileErrorBoundary(MyTileInner, 'My Tile', 'myTile');
98
+ \`\`\`
99
+
100
+ The HOC automatically sets \`displayName\` to \`WithTileErrorBoundary(title:tileRegistration:ComponentName)\` for easier debugging in React DevTools.
101
+
102
+ ### Import path
103
+
104
+ The path is **relative** to the component file. Adjust the number of \`../\` segments based on file depth:
105
+
106
+ | File location | Import |
107
+ |---|---|
108
+ | \`pages/Home/Home.tsx\` | \`../../components/error-boundary/ErrorBoundary\` |
109
+ | \`pages/Home/SummaryCards.tsx\` (sibling of route page) | \`../../components/error-boundary/ErrorBoundary\` |
110
+ | \`pages/Home/MyWidget/MyWidget.tsx\` | \`../../../components/error-boundary/ErrorBoundary\` |
111
+ | \`pages/Home/MyWidget/sub/Deep.tsx\` | \`../../../../components/error-boundary/ErrorBoundary\` |
112
+ | \`main.tsx\` or \`App.tsx\` (app root) | \`./components/error-boundary/ErrorBoundary\` |
113
+
114
+ ### KEY RULES
115
+
116
+ - **Before wrapping any new component, decide where it will live:**
117
+ - **Will it be added to a route's \`componentMap\`?** → Do **NOT** use \`TileErrorBoundary\` or \`withTileErrorBoundary\` — the route \`factory\` wraps it automatically.
118
+ - **Is it a standalone utility/helper NOT in \`componentMap\`?** → DO wrap it with \`TileErrorBoundary\` or \`withTileErrorBoundary\`.
119
+ - Route page files (e.g. \`Home.tsx\`) contain the \`factory\` that wraps every tile — do not add \`TileErrorBoundary\` inside the route page either.
120
+ - When in doubt: call \`vfs_read\` on the route page and check whether a \`factory\` function wraps components from \`componentMap\`. If yes, tile components do not need their own boundary.
121
+ - Use \`withTileErrorBoundary\` when the component is a self-contained standalone export. Use inline \`TileErrorBoundary\` JSX when wrapping a specific section inside a larger component.
122
+ - \`title\` should be human-readable (e.g. \`'Trade Blotter'\`). \`tileRegistration\` should be camelCase matching the layout key (e.g. \`'tradeBlotter'\`).
123
+ - Do NOT import from \`@genesislcap/foundation-errors\` for error boundary usage — that package provides the web-component-based error boundary (deprecated \`foundation-error-boundary\` WC). The React app uses the local \`ErrorBoundary.tsx\` scaffold instead.
124
+
125
+ ---
126
+
127
+ ### Where error boundaries live — the three levels
128
+
129
+ \`\`\`
130
+ AppErrorBoundary ← wraps the entire app in main.tsx (one instance only)
131
+ TileErrorBoundary ← placed by the route factory around each componentMap entry
132
+ (NOT in the tile component itself — the factory does it)
133
+ (none) ← pure utility components outside componentMap don't need one
134
+ \`\`\`
135
+
136
+ The \`AppErrorBoundary\` is already placed by the app template in \`main.tsx\` — do NOT add more instances.
137
+
138
+ ### Correct factory pattern (single source of wrapping — from route.hbs template)
139
+
140
+ \`\`\`tsx
141
+ // pages/Home/Home.tsx — route page
142
+ import { TileErrorBoundary } from '../../components/error-boundary/ErrorBoundary';
143
+
144
+ const factory = (node: TabNode) => {
145
+ const Component = componentMap[node.getComponent() ?? ''];
146
+ return Component ? (
147
+ <TileErrorBoundary
148
+ title={node.getName() ?? node.getComponent() ?? ''}
149
+ tileRegistration={node.getComponent() ?? ''}
150
+ >
151
+ <Component />
152
+ </TileErrorBoundary>
153
+ ) : null;
154
+ };
155
+ \`\`\`
156
+
157
+ ### Standalone non-tile components — wrap explicitly
158
+
159
+ When creating a component that is NOT in \`componentMap\` (e.g. a shared utility, a summary strip, a global filter bar), it will NOT be wrapped by the factory. Wrap it yourself:
160
+
161
+ \`\`\`tsx
162
+ // Option A — wrap in JSX at usage site:
163
+ <TileErrorBoundary title="Summary Cards" tileRegistration="summaryCards">
164
+ <SummaryCards />
165
+ </TileErrorBoundary>
166
+
167
+ // Option B — HOC at export:
168
+ export const SummaryCards = withTileErrorBoundary(SummaryCardsInner, 'Summary Cards', 'summaryCards');
169
+ \`\`\`
170
+
171
+ ### ErrorBoundaryFallback
172
+
173
+ The fallback UI shown when a tile crashes. Displays:
174
+ - Human-readable error title (\`title\` prop from TileErrorBoundary)
175
+ - Stack trace + component stack (copyable textarea)
176
+ - Retry button (resets boundary state so the component remounts)
177
+ - Reference ID for correlating bug reports
178
+
179
+ This is built into \`TileErrorBoundary\` — you don't need to configure it separately.
180
+
181
+ ---
182
+
183
+ ### DANGEROUS PATTERNS
184
+
185
+ #### DP-1: Double-wrapping tile components (factory already wraps)
186
+
187
+ \`\`\`tsx
188
+ // WRONG — factory already wraps every componentMap entry with TileErrorBoundary:
189
+ const componentMap = {
190
+ MyTile: () => (
191
+ <TileErrorBoundary title="My Tile" tileRegistration="myTile">
192
+ <MyTileInner />
193
+ </TileErrorBoundary>
194
+ ),
195
+ };
196
+
197
+ // CORRECT — register the component directly; factory adds the boundary:
198
+ const componentMap = { myTile: MyTile };
199
+ // The factory (in the route page) does:
200
+ // <TileErrorBoundary title={...} tileRegistration={...}><MyTile /></TileErrorBoundary>
201
+ \`\`\`
202
+
203
+ #### DP-2: Adding AppErrorBoundary inside tiles or routes
204
+
205
+ \`\`\`tsx
206
+ // WRONG — AppErrorBoundary is a single top-level wrapper; nesting it breaks recovery:
207
+ return <AppErrorBoundary><MyRoute /></AppErrorBoundary>;
208
+
209
+ // CORRECT — AppErrorBoundary lives only at the app root (main.tsx).
210
+ // Use TileErrorBoundary for per-tile wrapping.
211
+ \`\`\`
212
+
213
+ #### DP-3: Wrong import depth
214
+
215
+ The import path is always relative. Tiles at different nesting depths need different \`../\` counts:
216
+
217
+ \`\`\`tsx
218
+ // 2 levels deep (pages/Home/Home.tsx):
219
+ import { TileErrorBoundary } from '../../components/error-boundary/ErrorBoundary';
220
+
221
+ // 3 levels deep (pages/Home/MyWidget/MyWidget.tsx):
222
+ import { TileErrorBoundary } from '../../../components/error-boundary/ErrorBoundary';
223
+ \`\`\`
224
+
225
+ #### DP-4: Importing from @genesislcap/foundation-errors instead of local ErrorBoundary
226
+
227
+ \`\`\`tsx
228
+ // WRONG — foundation-errors ships the deprecated web-component ErrorBoundary WC, not the React scaffold:
229
+ import { ErrorBoundary } from '@genesislcap/foundation-errors';
230
+
231
+ // CORRECT — always import from the local scaffold file:
232
+ import { TileErrorBoundary, withTileErrorBoundary } from '../../components/error-boundary/ErrorBoundary';
233
+ \`\`\`
234
+
235
+ #### DP-5: Using withTileErrorBoundary with wrong argument order
236
+
237
+ \`\`\`tsx
238
+ // WRONG — title and tileRegistration are swapped:
239
+ export const MyTile = withTileErrorBoundary(MyTileInner, 'myTile', 'My Tile');
240
+
241
+ // CORRECT — title (human-readable) first, tileRegistration (camelCase key) second:
242
+ export const MyTile = withTileErrorBoundary(MyTileInner, 'My Tile', 'myTile');
243
+ \`\`\`
244
+ `.trim();