@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.
- package/dist/ai-assistant.api.json +97 -0
- package/dist/ai-assistant.d.ts +65 -0
- package/dist/chat-driver.cjs +18031 -0
- package/dist/chat-driver.cjs.map +4 -4
- package/dist/chat-driver.mjs +18024 -0
- package/dist/chat-driver.mjs.map +4 -4
- package/dist/custom-elements.json +5524 -2684
- package/dist/dts/chat-driver-node.d.ts +2 -0
- package/dist/dts/chat-driver-node.d.ts.map +1 -1
- package/dist/dts/code-review/code-review.types.d.ts +76 -0
- package/dist/dts/code-review/code-review.types.d.ts.map +1 -0
- package/dist/dts/code-review/code-reviewer.agent.d.ts +77 -0
- package/dist/dts/code-review/code-reviewer.agent.d.ts.map +1 -0
- package/dist/dts/code-review/code-reviewer.prompt.d.ts +23 -0
- package/dist/dts/code-review/code-reviewer.prompt.d.ts.map +1 -0
- package/dist/dts/code-review/gate.d.ts +44 -0
- package/dist/dts/code-review/gate.d.ts.map +1 -0
- package/dist/dts/code-review/index.d.ts +27 -0
- package/dist/dts/code-review/index.d.ts.map +1 -0
- package/dist/dts/code-review/review-changes.d.ts +70 -0
- package/dist/dts/code-review/review-changes.d.ts.map +1 -0
- package/dist/dts/code-review/rules/context-trigger-map.d.ts +6 -0
- package/dist/dts/code-review/rules/context-trigger-map.d.ts.map +1 -0
- package/dist/dts/code-review/rules/context.registry.d.ts +123 -0
- package/dist/dts/code-review/rules/context.registry.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-ai-extensions.d.ts +13 -0
- package/dist/dts/code-review/rules/fui-ai-extensions.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-blotter.d.ts +16 -0
- package/dist/dts/code-review/rules/fui-blotter.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-chart.d.ts +20 -0
- package/dist/dts/code-review/rules/fui-chart.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-column-defs.d.ts +21 -0
- package/dist/dts/code-review/rules/fui-column-defs.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-components.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-components.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-criteria.d.ts +32 -0
- package/dist/dts/code-review/rules/fui-criteria.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-custom-renderer.d.ts +15 -0
- package/dist/dts/code-review/rules/fui-custom-renderer.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-dashboard.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-dashboard.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-dialogs.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-dialogs.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-entity-management.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-entity-management.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-error-boundary.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-error-boundary.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-eventing.d.ts +8 -0
- package/dist/dts/code-review/rules/fui-eventing.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-flexlayout.d.ts +17 -0
- package/dist/dts/code-review/rules/fui-flexlayout.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-flyout-panel.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-flyout-panel.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-form-component.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-form-component.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-formatters.d.ts +12 -0
- package/dist/dts/code-review/rules/fui-formatters.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-foundation-comms.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-foundation-comms.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-global-filters.d.ts +33 -0
- package/dist/dts/code-review/rules/fui-global-filters.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-import-surface.d.ts +37 -0
- package/dist/dts/code-review/rules/fui-import-surface.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-inline-editing.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-inline-editing.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-layout.d.ts +7 -0
- package/dist/dts/code-review/rules/fui-layout.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-notifications.d.ts +12 -0
- package/dist/dts/code-review/rules/fui-notifications.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-primitives.d.ts +26 -0
- package/dist/dts/code-review/rules/fui-primitives.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts +18 -0
- package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-redux-store.d.ts +8 -0
- package/dist/dts/code-review/rules/fui-redux-store.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-reporting.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-reporting.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-styling.d.ts +15 -0
- package/dist/dts/code-review/rules/fui-styling.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-trade-form.d.ts +13 -0
- package/dist/dts/code-review/rules/fui-trade-form.d.ts.map +1 -0
- package/dist/dts/code-review/submit-code-review.tool.d.ts +12 -0
- package/dist/dts/code-review/submit-code-review.tool.d.ts.map +1 -0
- package/dist/dts/code-review/unified-diff.d.ts +7 -0
- package/dist/dts/code-review/unified-diff.d.ts.map +1 -0
- package/dist/dts/code-review/verdict.d.ts +23 -0
- package/dist/dts/code-review/verdict.d.ts.map +1 -0
- package/dist/dts/components/code-review-result/code-review-result.d.ts +26 -0
- package/dist/dts/components/code-review-result/code-review-result.d.ts.map +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/react.d.ts +20 -10
- package/dist/esm/chat-driver-node.js +6 -0
- package/dist/esm/code-review/code-review.types.js +6 -0
- package/dist/esm/code-review/code-reviewer.agent.js +167 -0
- package/dist/esm/code-review/code-reviewer.prompt.js +103 -0
- package/dist/esm/code-review/gate.js +93 -0
- package/dist/esm/code-review/index.js +28 -0
- package/dist/esm/code-review/review-changes.js +123 -0
- package/dist/esm/code-review/rules/context-trigger-map.js +20 -0
- package/dist/esm/code-review/rules/context.registry.js +772 -0
- package/dist/esm/code-review/rules/fui-ai-extensions.js +306 -0
- package/dist/esm/code-review/rules/fui-blotter.js +596 -0
- package/dist/esm/code-review/rules/fui-chart.js +669 -0
- package/dist/esm/code-review/rules/fui-column-defs.js +862 -0
- package/dist/esm/code-review/rules/fui-components.js +245 -0
- package/dist/esm/code-review/rules/fui-criteria.js +538 -0
- package/dist/esm/code-review/rules/fui-custom-renderer.js +612 -0
- package/dist/esm/code-review/rules/fui-dashboard.js +604 -0
- package/dist/esm/code-review/rules/fui-dialogs.js +588 -0
- package/dist/esm/code-review/rules/fui-entity-management.js +1014 -0
- package/dist/esm/code-review/rules/fui-error-boundary.js +244 -0
- package/dist/esm/code-review/rules/fui-eventing.js +628 -0
- package/dist/esm/code-review/rules/fui-flexlayout.js +860 -0
- package/dist/esm/code-review/rules/fui-flyout-panel.js +432 -0
- package/dist/esm/code-review/rules/fui-form-component.js +898 -0
- package/dist/esm/code-review/rules/fui-formatters.js +415 -0
- package/dist/esm/code-review/rules/fui-foundation-comms.js +518 -0
- package/dist/esm/code-review/rules/fui-global-filters.js +778 -0
- package/dist/esm/code-review/rules/fui-import-surface.js +452 -0
- package/dist/esm/code-review/rules/fui-inline-editing.js +445 -0
- package/dist/esm/code-review/rules/fui-layout.js +431 -0
- package/dist/esm/code-review/rules/fui-notifications.js +439 -0
- package/dist/esm/code-review/rules/fui-primitives.js +1216 -0
- package/dist/esm/code-review/rules/fui-rapid-grid-pro.js +650 -0
- package/dist/esm/code-review/rules/fui-redux-store.js +522 -0
- package/dist/esm/code-review/rules/fui-reporting.js +506 -0
- package/dist/esm/code-review/rules/fui-styling.js +1229 -0
- package/dist/esm/code-review/rules/fui-trade-form.js +618 -0
- package/dist/esm/code-review/submit-code-review.tool.js +43 -0
- package/dist/esm/code-review/unified-diff.js +96 -0
- package/dist/esm/code-review/verdict.js +24 -0
- package/dist/esm/components/code-review-result/code-review-result.js +89 -0
- package/dist/esm/index.js +3 -0
- package/dist/react.cjs +25 -18
- package/dist/react.mjs +23 -17
- package/docs/code-review.md +137 -0
- package/package.json +24 -17
- package/scripts/smoke-chat-driver-node.mjs +15 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Compact unified diff for the code-review pre-gate: an edited file rides to the reviewer
|
|
2
|
+
// as a diff (not its full content), so the reviewer judges THIS change rather than flagging
|
|
3
|
+
// pre-existing code it was never asked about.
|
|
4
|
+
// Beyond this LCS matrix size the diff is skipped (callers fall back to full content). Capped
|
|
5
|
+
// at ~1000×1000 lines to bound the synchronous main-thread cost: the DP allocates m Uint32Arrays
|
|
6
|
+
// of n and runs m×n iterations, once per reviewable file, so a looser ceiling risks preview jank
|
|
7
|
+
// on a big multi-file batch. We already fall back to full content past the ceiling anyway.
|
|
8
|
+
const MAX_LCS_CELLS = 1000000;
|
|
9
|
+
/** Unchanged lines kept around each change inside a hunk. */
|
|
10
|
+
const HUNK_CONTEXT_LINES = 3;
|
|
11
|
+
/**
|
|
12
|
+
* Builds a compact unified diff (`--- / +++` header naming the file, then `@@` hunks with
|
|
13
|
+
* {@link HUNK_CONTEXT_LINES} lines of context) between two versions of a file. Returns null
|
|
14
|
+
* when the inputs are too large to LCS-diff cheaply — the caller then sends full content.
|
|
15
|
+
*/
|
|
16
|
+
export function buildUnifiedDiff(path, oldContent, newContent) {
|
|
17
|
+
const oldLines = oldContent.split('\n');
|
|
18
|
+
const newLines = newContent.split('\n');
|
|
19
|
+
if ((oldLines.length + 1) * (newLines.length + 1) > MAX_LCS_CELLS)
|
|
20
|
+
return null;
|
|
21
|
+
const hunks = buildHunks(lcsLineOps(oldLines, newLines));
|
|
22
|
+
const header = `--- ${path}\n+++ ${path}`;
|
|
23
|
+
if (hunks.length === 0)
|
|
24
|
+
return `${header}\n(no line changes)`;
|
|
25
|
+
return `${header}\n${hunks.join('\n')}`;
|
|
26
|
+
}
|
|
27
|
+
/** LCS line ops between the two files (same DP the vfs-code-diff viewer uses). */
|
|
28
|
+
function lcsLineOps(oldLines, newLines) {
|
|
29
|
+
const m = oldLines.length;
|
|
30
|
+
const n = newLines.length;
|
|
31
|
+
const dp = Array.from({ length: m + 1 }, () => new Uint32Array(n + 1));
|
|
32
|
+
for (let i = 1; i <= m; i += 1) {
|
|
33
|
+
for (let j = 1; j <= n; j += 1) {
|
|
34
|
+
dp[i][j] =
|
|
35
|
+
oldLines[i - 1] === newLines[j - 1]
|
|
36
|
+
? dp[i - 1][j - 1] + 1
|
|
37
|
+
: Math.max(dp[i - 1][j], dp[i][j - 1]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const ops = [];
|
|
41
|
+
let i = m;
|
|
42
|
+
let j = n;
|
|
43
|
+
while (i > 0 || j > 0) {
|
|
44
|
+
if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
|
|
45
|
+
ops.push({ kind: ' ', text: oldLines[i - 1] });
|
|
46
|
+
i -= 1;
|
|
47
|
+
j -= 1;
|
|
48
|
+
}
|
|
49
|
+
else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
|
|
50
|
+
ops.push({ kind: '+', text: newLines[j - 1] });
|
|
51
|
+
j -= 1;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
ops.push({ kind: '-', text: oldLines[i - 1] });
|
|
55
|
+
i -= 1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return ops.reverse();
|
|
59
|
+
}
|
|
60
|
+
/** Groups changed ops into `@@ -a,b +c,d @@` hunks with surrounding context lines. */
|
|
61
|
+
function buildHunks(ops) {
|
|
62
|
+
// Old/new line counts consumed BEFORE each op — drives the @@ header numbers.
|
|
63
|
+
const before = [];
|
|
64
|
+
let oldNo = 0;
|
|
65
|
+
let newNo = 0;
|
|
66
|
+
for (const op of ops) {
|
|
67
|
+
before.push({ old: oldNo, new: newNo });
|
|
68
|
+
if (op.kind !== '+')
|
|
69
|
+
oldNo += 1;
|
|
70
|
+
if (op.kind !== '-')
|
|
71
|
+
newNo += 1;
|
|
72
|
+
}
|
|
73
|
+
// Expand every changed op by the context window, merging overlapping/adjacent ranges.
|
|
74
|
+
const ranges = [];
|
|
75
|
+
for (let idx = 0; idx < ops.length; idx += 1) {
|
|
76
|
+
if (ops[idx].kind === ' ')
|
|
77
|
+
continue;
|
|
78
|
+
const lo = Math.max(0, idx - HUNK_CONTEXT_LINES);
|
|
79
|
+
const hi = Math.min(ops.length - 1, idx + HUNK_CONTEXT_LINES);
|
|
80
|
+
const last = ranges[ranges.length - 1];
|
|
81
|
+
if (last && lo <= last[1] + 1)
|
|
82
|
+
last[1] = Math.max(last[1], hi);
|
|
83
|
+
else
|
|
84
|
+
ranges.push([lo, hi]);
|
|
85
|
+
}
|
|
86
|
+
return ranges.map(([lo, hi]) => {
|
|
87
|
+
const slice = ops.slice(lo, hi + 1);
|
|
88
|
+
const oldCount = slice.filter((op) => op.kind !== '+').length;
|
|
89
|
+
const newCount = slice.filter((op) => op.kind !== '-').length;
|
|
90
|
+
// Unified convention: a zero-count side anchors on the line BEFORE the hunk.
|
|
91
|
+
const oldStart = oldCount === 0 ? before[lo].old : before[lo].old + 1;
|
|
92
|
+
const newStart = newCount === 0 ? before[lo].new : before[lo].new + 1;
|
|
93
|
+
const header = `@@ -${oldStart},${oldCount} +${newStart},${newCount} @@`;
|
|
94
|
+
return [header, ...slice.map((op) => op.kind + op.text)].join('\n');
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const LABELS = {
|
|
2
|
+
approved: 'Approved',
|
|
3
|
+
blocking: 'Blocking issues',
|
|
4
|
+
advisory: 'Advisory issues',
|
|
5
|
+
skipped: 'Skipped (minor change)',
|
|
6
|
+
unavailable: 'Review unavailable',
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Flattens a gate result (`null` = skipped) into a status, label and detail text. An unavailable
|
|
10
|
+
* review is its own status — never shown as a clean pass.
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export function summarizeCodeReview(result) {
|
|
14
|
+
var _a;
|
|
15
|
+
if (result === null)
|
|
16
|
+
return { status: 'skipped', label: LABELS.skipped, detail: '' };
|
|
17
|
+
if ('unavailable' in result) {
|
|
18
|
+
return { status: 'unavailable', label: LABELS.unavailable, detail: result.reason };
|
|
19
|
+
}
|
|
20
|
+
if (result.approved)
|
|
21
|
+
return { status: 'approved', label: LABELS.approved, detail: '' };
|
|
22
|
+
const status = result.severity === 'blocking' ? 'blocking' : 'advisory';
|
|
23
|
+
return { status, label: LABELS[status], detail: (_a = result.feedback) !== null && _a !== void 0 ? _a : '' };
|
|
24
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement, GenesisElement, html, observable, repeat, when, } from '@genesislcap/web-core';
|
|
3
|
+
import { summarizeCodeReview } from '../../code-review/verdict';
|
|
4
|
+
/**
|
|
5
|
+
* Displays one code-review verdict: the status (approved, blocking, advisory, skipped or
|
|
6
|
+
* unavailable), the files reviewed and the reviewer's feedback. Display only — it does not apply a
|
|
7
|
+
* fix; the host decides what a verdict means for its write path.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const el = document.createElement('ai-code-review-result') as AiCodeReviewResult;
|
|
12
|
+
* el.result = await runCodeReviewPreGate(files, requestSubAgent);
|
|
13
|
+
* el.files = files.map((f) => f.path);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
let AiCodeReviewResult = class AiCodeReviewResult extends GenesisElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
/** The gate result to show; `null` means the review was skipped. */
|
|
22
|
+
this.result = null;
|
|
23
|
+
/** Paths of the files the review covered. */
|
|
24
|
+
this.files = [];
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
get summary() {
|
|
28
|
+
return summarizeCodeReview(this.result);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
__decorate([
|
|
32
|
+
observable
|
|
33
|
+
], AiCodeReviewResult.prototype, "result", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
observable
|
|
36
|
+
], AiCodeReviewResult.prototype, "files", void 0);
|
|
37
|
+
AiCodeReviewResult = __decorate([
|
|
38
|
+
customElement({
|
|
39
|
+
name: 'ai-code-review-result',
|
|
40
|
+
template: html `
|
|
41
|
+
<section class="review" part="review" data-status="${(x) => x.summary.status}">
|
|
42
|
+
<header class="status" part="status">${(x) => x.summary.label}</header>
|
|
43
|
+
${when((x) => x.files.length > 0, html `
|
|
44
|
+
<ul class="files" part="files">
|
|
45
|
+
${repeat((x) => x.files, html `
|
|
46
|
+
<li>${(f) => f}</li>
|
|
47
|
+
`)}
|
|
48
|
+
</ul>
|
|
49
|
+
`)}
|
|
50
|
+
${when((x) => x.summary.detail !== '', html `
|
|
51
|
+
<pre class="detail" part="detail">${(x) => x.summary.detail}</pre>
|
|
52
|
+
`)}
|
|
53
|
+
</section>
|
|
54
|
+
`,
|
|
55
|
+
styles: `
|
|
56
|
+
:host {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
.review {
|
|
60
|
+
border-left: 3px solid var(--neutral-stroke-rest, #888);
|
|
61
|
+
padding: 8px 12px;
|
|
62
|
+
font-family: inherit;
|
|
63
|
+
}
|
|
64
|
+
.review[data-status='approved'] {
|
|
65
|
+
border-left-color: var(--success-color, #2e7d32);
|
|
66
|
+
}
|
|
67
|
+
.review[data-status='blocking'] {
|
|
68
|
+
border-left-color: var(--error-color, #c62828);
|
|
69
|
+
}
|
|
70
|
+
.review[data-status='advisory'],
|
|
71
|
+
.review[data-status='unavailable'] {
|
|
72
|
+
border-left-color: var(--warning-color, #ed6c02);
|
|
73
|
+
}
|
|
74
|
+
.status {
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
}
|
|
77
|
+
.files {
|
|
78
|
+
margin: 4px 0;
|
|
79
|
+
padding-left: 16px;
|
|
80
|
+
}
|
|
81
|
+
.detail {
|
|
82
|
+
margin: 4px 0 0;
|
|
83
|
+
white-space: pre-wrap;
|
|
84
|
+
font-family: inherit;
|
|
85
|
+
}
|
|
86
|
+
`,
|
|
87
|
+
})
|
|
88
|
+
], AiCodeReviewResult);
|
|
89
|
+
export { AiCodeReviewResult };
|
package/dist/esm/index.js
CHANGED
|
@@ -25,3 +25,6 @@ export { getInteractionRegistration, registerInteraction, } from './state/intera
|
|
|
25
25
|
// MARKDOWN_EXPORTPARTS travels with the component: a host rendering `<ai-chat-markdown>` in its
|
|
26
26
|
// own shadow root has to forward its parts, and hand-copying the list is how it drifts.
|
|
27
27
|
export { AiChatMarkdown, MARKDOWN_EXPORTPARTS } from './components/chat-markdown/chat-markdown';
|
|
28
|
+
// The code-review verdict renderer (FUI-2650). Here, not on `./code-review`, because it registers a
|
|
29
|
+
// custom element; that entry has to stay loadable in Node.
|
|
30
|
+
export { AiCodeReviewResult } from './components/code-review-result/code-review-result';
|
package/dist/react.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const { AgentPicker: AgentPickerWC } = require('./esm/components/agent-picker/ag
|
|
|
12
12
|
const { AiChatBubble: AiChatBubbleWC } = require('./esm/components/chat-bubble/chat-bubble.js');
|
|
13
13
|
const { AiChatInteractionWrapper: AiChatInteractionWrapperWC } = require('./esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js');
|
|
14
14
|
const { AiChatMarkdown: AiChatMarkdownWC } = require('./esm/components/chat-markdown/chat-markdown.js');
|
|
15
|
+
const { AiCodeReviewResult: AiCodeReviewResultWC } = require('./esm/components/code-review-result/code-review-result.js');
|
|
15
16
|
const { AiFlowingWavesIndicator: AiFlowingWavesIndicatorWC } = require('./esm/components/flowing-waves-indicator.js');
|
|
16
17
|
const { AiHaloOverlay: AiHaloOverlayWC } = require('./esm/components/halo-overlay.js');
|
|
17
18
|
const { MessageFeedback: MessageFeedbackWC } = require('./esm/components/message-feedback/message-feedback.js');
|
|
@@ -88,23 +89,6 @@ const AutopilotHandBack = React.forwardRef(function AutopilotHandBack(props, ref
|
|
|
88
89
|
return React.createElement(customElements.getName(AutopilotHandBackWC) ?? 'AUTOPILOT_HAND_BACK', { ...rest, ref }, children);
|
|
89
90
|
});
|
|
90
91
|
|
|
91
|
-
const GenesisWriteReview = React.forwardRef(function GenesisWriteReview(props, ref) {
|
|
92
|
-
const { onInteractionCompleted, children, ...rest } = props;
|
|
93
|
-
const _innerRef = React.useRef(null);
|
|
94
|
-
const _onInteractionCompletedRef = React.useRef(onInteractionCompleted);
|
|
95
|
-
_onInteractionCompletedRef.current = onInteractionCompleted;
|
|
96
|
-
React.useLayoutEffect(() => {
|
|
97
|
-
const el = _innerRef.current;
|
|
98
|
-
if (!el) return;
|
|
99
|
-
const _onInteractionCompletedFn = (e) => _onInteractionCompletedRef.current?.(e);
|
|
100
|
-
el.addEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
101
|
-
return () => {
|
|
102
|
-
el.removeEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
103
|
-
};
|
|
104
|
-
}, []);
|
|
105
|
-
return React.createElement(customElements.getName(GenesisWriteReviewWC) ?? 'GENESIS_WRITE_REVIEW', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
92
|
const AiActivityHalo = React.forwardRef(function AiActivityHalo(props, ref) {
|
|
109
93
|
const { children, ...rest } = props;
|
|
110
94
|
return React.createElement(customElements.getName(AiActivityHaloWC) ?? 'ai-activity-halo', { ...rest, ref }, children);
|
|
@@ -164,6 +148,11 @@ const AiChatMarkdown = React.forwardRef(function AiChatMarkdown(props, ref) {
|
|
|
164
148
|
return React.createElement(customElements.getName(AiChatMarkdownWC) ?? 'ai-chat-markdown', { ...rest, ref }, children);
|
|
165
149
|
});
|
|
166
150
|
|
|
151
|
+
const AiCodeReviewResult = React.forwardRef(function AiCodeReviewResult(props, ref) {
|
|
152
|
+
const { children, ...rest } = props;
|
|
153
|
+
return React.createElement(customElements.getName(AiCodeReviewResultWC) ?? 'ai-code-review-result', { ...rest, ref }, children);
|
|
154
|
+
});
|
|
155
|
+
|
|
167
156
|
const MessageFeedback = React.forwardRef(function MessageFeedback(props, ref) {
|
|
168
157
|
const { children, ...rest } = props;
|
|
169
158
|
return React.createElement(customElements.getName(MessageFeedbackWC) ?? 'foundation-ai-message-feedback', { ...rest, ref }, children);
|
|
@@ -174,6 +163,23 @@ const FoundationAiPopoutManager = React.forwardRef(function FoundationAiPopoutMa
|
|
|
174
163
|
return React.createElement(customElements.getName(FoundationAiPopoutManagerWC) ?? 'foundation-ai-popout-manager', { ...rest, ref }, children);
|
|
175
164
|
});
|
|
176
165
|
|
|
166
|
+
const GenesisWriteReview = React.forwardRef(function GenesisWriteReview(props, ref) {
|
|
167
|
+
const { onInteractionCompleted, children, ...rest } = props;
|
|
168
|
+
const _innerRef = React.useRef(null);
|
|
169
|
+
const _onInteractionCompletedRef = React.useRef(onInteractionCompleted);
|
|
170
|
+
_onInteractionCompletedRef.current = onInteractionCompleted;
|
|
171
|
+
React.useLayoutEffect(() => {
|
|
172
|
+
const el = _innerRef.current;
|
|
173
|
+
if (!el) return;
|
|
174
|
+
const _onInteractionCompletedFn = (e) => _onInteractionCompletedRef.current?.(e);
|
|
175
|
+
el.addEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
176
|
+
return () => {
|
|
177
|
+
el.removeEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
178
|
+
};
|
|
179
|
+
}, []);
|
|
180
|
+
return React.createElement(customElements.getName(GenesisWriteReviewWC) ?? 'GENESIS_WRITE_REVIEW', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
|
|
181
|
+
});
|
|
182
|
+
|
|
177
183
|
module.exports = {
|
|
178
184
|
AiFlowingWavesIndicator,
|
|
179
185
|
AiHaloOverlay,
|
|
@@ -182,12 +188,13 @@ module.exports = {
|
|
|
182
188
|
FoundationAiAssistant,
|
|
183
189
|
ChatSuggestions,
|
|
184
190
|
AutopilotHandBack,
|
|
185
|
-
GenesisWriteReview,
|
|
186
191
|
AiActivityHalo,
|
|
187
192
|
AgentPicker,
|
|
188
193
|
AiChatBubble,
|
|
189
194
|
AiChatInteractionWrapper,
|
|
190
195
|
AiChatMarkdown,
|
|
196
|
+
AiCodeReviewResult,
|
|
191
197
|
MessageFeedback,
|
|
192
198
|
FoundationAiPopoutManager,
|
|
199
|
+
GenesisWriteReview,
|
|
193
200
|
};
|
package/dist/react.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { AgentPicker as AgentPickerWC } from './esm/components/agent-picker/agen
|
|
|
10
10
|
import { AiChatBubble as AiChatBubbleWC } from './esm/components/chat-bubble/chat-bubble.js';
|
|
11
11
|
import { AiChatInteractionWrapper as AiChatInteractionWrapperWC } from './esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js';
|
|
12
12
|
import { AiChatMarkdown as AiChatMarkdownWC } from './esm/components/chat-markdown/chat-markdown.js';
|
|
13
|
+
import { AiCodeReviewResult as AiCodeReviewResultWC } from './esm/components/code-review-result/code-review-result.js';
|
|
13
14
|
import { AiFlowingWavesIndicator as AiFlowingWavesIndicatorWC } from './esm/components/flowing-waves-indicator.js';
|
|
14
15
|
import { AiHaloOverlay as AiHaloOverlayWC } from './esm/components/halo-overlay.js';
|
|
15
16
|
import { MessageFeedback as MessageFeedbackWC } from './esm/components/message-feedback/message-feedback.js';
|
|
@@ -86,23 +87,6 @@ export const AutopilotHandBack = React.forwardRef(function AutopilotHandBack(pro
|
|
|
86
87
|
return React.createElement(customElements.getName(AutopilotHandBackWC) ?? 'AUTOPILOT_HAND_BACK', { ...rest, ref }, children);
|
|
87
88
|
});
|
|
88
89
|
|
|
89
|
-
export const GenesisWriteReview = React.forwardRef(function GenesisWriteReview(props, ref) {
|
|
90
|
-
const { onInteractionCompleted, children, ...rest } = props;
|
|
91
|
-
const _innerRef = React.useRef(null);
|
|
92
|
-
const _onInteractionCompletedRef = React.useRef(onInteractionCompleted);
|
|
93
|
-
_onInteractionCompletedRef.current = onInteractionCompleted;
|
|
94
|
-
React.useLayoutEffect(() => {
|
|
95
|
-
const el = _innerRef.current;
|
|
96
|
-
if (!el) return;
|
|
97
|
-
const _onInteractionCompletedFn = (e) => _onInteractionCompletedRef.current?.(e);
|
|
98
|
-
el.addEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
99
|
-
return () => {
|
|
100
|
-
el.removeEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
101
|
-
};
|
|
102
|
-
}, []);
|
|
103
|
-
return React.createElement(customElements.getName(GenesisWriteReviewWC) ?? 'GENESIS_WRITE_REVIEW', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
90
|
export const AiActivityHalo = React.forwardRef(function AiActivityHalo(props, ref) {
|
|
107
91
|
const { children, ...rest } = props;
|
|
108
92
|
return React.createElement(customElements.getName(AiActivityHaloWC) ?? 'ai-activity-halo', { ...rest, ref }, children);
|
|
@@ -162,6 +146,11 @@ export const AiChatMarkdown = React.forwardRef(function AiChatMarkdown(props, re
|
|
|
162
146
|
return React.createElement(customElements.getName(AiChatMarkdownWC) ?? 'ai-chat-markdown', { ...rest, ref }, children);
|
|
163
147
|
});
|
|
164
148
|
|
|
149
|
+
export const AiCodeReviewResult = React.forwardRef(function AiCodeReviewResult(props, ref) {
|
|
150
|
+
const { children, ...rest } = props;
|
|
151
|
+
return React.createElement(customElements.getName(AiCodeReviewResultWC) ?? 'ai-code-review-result', { ...rest, ref }, children);
|
|
152
|
+
});
|
|
153
|
+
|
|
165
154
|
export const MessageFeedback = React.forwardRef(function MessageFeedback(props, ref) {
|
|
166
155
|
const { children, ...rest } = props;
|
|
167
156
|
return React.createElement(customElements.getName(MessageFeedbackWC) ?? 'foundation-ai-message-feedback', { ...rest, ref }, children);
|
|
@@ -171,3 +160,20 @@ export const FoundationAiPopoutManager = React.forwardRef(function FoundationAiP
|
|
|
171
160
|
const { children, ...rest } = props;
|
|
172
161
|
return React.createElement(customElements.getName(FoundationAiPopoutManagerWC) ?? 'foundation-ai-popout-manager', { ...rest, ref }, children);
|
|
173
162
|
});
|
|
163
|
+
|
|
164
|
+
export const GenesisWriteReview = React.forwardRef(function GenesisWriteReview(props, ref) {
|
|
165
|
+
const { onInteractionCompleted, children, ...rest } = props;
|
|
166
|
+
const _innerRef = React.useRef(null);
|
|
167
|
+
const _onInteractionCompletedRef = React.useRef(onInteractionCompleted);
|
|
168
|
+
_onInteractionCompletedRef.current = onInteractionCompleted;
|
|
169
|
+
React.useLayoutEffect(() => {
|
|
170
|
+
const el = _innerRef.current;
|
|
171
|
+
if (!el) return;
|
|
172
|
+
const _onInteractionCompletedFn = (e) => _onInteractionCompletedRef.current?.(e);
|
|
173
|
+
el.addEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
174
|
+
return () => {
|
|
175
|
+
el.removeEventListener('interaction-completed', _onInteractionCompletedFn);
|
|
176
|
+
};
|
|
177
|
+
}, []);
|
|
178
|
+
return React.createElement(customElements.getName(GenesisWriteReviewWC) ?? 'GENESIS_WRITE_REVIEW', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
|
|
179
|
+
});
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# UI Code Reviewer
|
|
2
|
+
|
|
3
|
+
`@genesislcap/ai-assistant/code-review` (FUI-2650) ships the reviewer that genesis-create runs before UI Builder writes code. Any app can use it to review web changes against Genesis UI patterns.
|
|
4
|
+
|
|
5
|
+
The reviewer is a read-only sub-agent. It reads the changed files and the Genesis web rule pack, then submits exactly one verdict:
|
|
6
|
+
|
|
7
|
+
| Outcome | Meaning |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `{ approved: true }` | The change follows the rules. |
|
|
10
|
+
| `{ approved: false, severity: 'blocking', feedback }` | At least one issue breaks at runtime or violates a mandatory pattern. The host decides whether to reject the change. |
|
|
11
|
+
| `{ approved: false, severity: 'advisory', feedback }` | The code works but has non-critical issues. |
|
|
12
|
+
| `null` | Skipped: the change was too small to review. |
|
|
13
|
+
| `{ unavailable: true, reason }` | The reviewer returned no verdict. **Fail open, but never report this as a clean pass.** |
|
|
14
|
+
|
|
15
|
+
A change is skipped without calling the model when it is CSS-only, a single non-CSS file whose size changed by fewer than 500 characters, or a batch of at most 3 new files totalling under 700 characters. Any batch that edits an existing non-CSS file is always reviewed.
|
|
16
|
+
|
|
17
|
+
## Register it as a sub-agent
|
|
18
|
+
|
|
19
|
+
Use this when the app already has an assistant. Add the reviewer to the agent that owns the write path, then call the gate before committing:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
createCodeReviewAgent,
|
|
24
|
+
runCodeReviewPreGate,
|
|
25
|
+
} from '@genesislcap/ai-assistant/code-review';
|
|
26
|
+
|
|
27
|
+
const reviewer = createCodeReviewAgent({
|
|
28
|
+
files: myFileReader, // see "Supply a file reader"
|
|
29
|
+
provider: 'low', // a fast, cheap tier: this runs on every meaningful write
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const writer = defineAgent({
|
|
33
|
+
name: 'Writer',
|
|
34
|
+
subAgents: [reviewer],
|
|
35
|
+
toolHandlers: {
|
|
36
|
+
save_files: async (args, context) => {
|
|
37
|
+
const verdict = await runCodeReviewPreGate(changedFiles, context.requestSubAgent, {
|
|
38
|
+
specFor: (path) => plan.find((p) => p.path === path), // optional purpose / acceptanceChecks
|
|
39
|
+
});
|
|
40
|
+
// null → skipped; unavailable → fail open; blocking → reject, advisory → proceed + feedback
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`changedFiles` is `{ path, oldContent, newContent }[]`. Use `oldContent: ''` for a new file and `newContent: ''` for a deletion; deletions are never reviewed. Edits are sent as a unified diff of just the change, and new files as full content.
|
|
47
|
+
|
|
48
|
+
## Call it directly (no assistant)
|
|
49
|
+
|
|
50
|
+
A script or CI job can review a `git diff` with a provider registry. It imports from `./chat-driver`, the Node-loadable bundle:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import {
|
|
54
|
+
createCodeReviewAgent,
|
|
55
|
+
createHeadlessSubAgentCaller,
|
|
56
|
+
reviewChanges,
|
|
57
|
+
summarizeCodeReview,
|
|
58
|
+
} from '@genesislcap/ai-assistant/chat-driver';
|
|
59
|
+
|
|
60
|
+
const reviewer = createCodeReviewAgent({ files: checkoutReader, provider: 'low' });
|
|
61
|
+
const { verdict, reviewed, outOfScope } = await reviewChanges(patchText, {
|
|
62
|
+
requestSubAgent: createHeadlessSubAgentCaller(registry, [reviewer]),
|
|
63
|
+
});
|
|
64
|
+
console.log(summarizeCodeReview(verdict).label);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`reviewChanges` reviews only the files the rule pack covers (`.ts`, `.tsx` and `.css` sources, not declarations or tests) and lists the rest in `outOfScope`. Pass `covers` to change that.
|
|
68
|
+
|
|
69
|
+
## Supply a file reader
|
|
70
|
+
|
|
71
|
+
The reviewer gets `vfs_read` and `vfs_list` tools from the `files` option:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const myFileReader: CodeReviewFileReader = {
|
|
75
|
+
read: (path) => pendingBuffer.get(path) ?? disk.read(path),
|
|
76
|
+
list: () => [...allPaths],
|
|
77
|
+
};
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**`read` must return the version under review: the post-edit content, not the file on disk.** A reader that returns the on-disk file makes the reviewer flag the old code as a bug in a change that only exists in your buffer, and you can never clear that issue.
|
|
81
|
+
|
|
82
|
+
A host that already has `vfs_read` / `vfs_list` tools can pass them as `{ definitions, handlers }`. Any other tool names are dropped, so the reviewer never holds a write tool.
|
|
83
|
+
|
|
84
|
+
## Add a project rule module
|
|
85
|
+
|
|
86
|
+
The default pack is the Genesis web reference material (`fui-*` modules): import paths, grids, forms, dialogs, styling, eventing and so on. To add your own rules, pass extra modules:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
createCodeReviewAgent({
|
|
90
|
+
files: myFileReader,
|
|
91
|
+
extraRules: [
|
|
92
|
+
{
|
|
93
|
+
name: 'acme-naming',
|
|
94
|
+
title: 'Acme naming rules',
|
|
95
|
+
description: 'How Acme names slices, routes and events.',
|
|
96
|
+
whenToUse: ['Naming a Redux slice or route'],
|
|
97
|
+
relatedContexts: [],
|
|
98
|
+
tags: ['naming', 'slice'],
|
|
99
|
+
content: '…rules and anti-patterns, with examples…',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The reviewer finds a module through `search_context`, `read_contextIndex` or the trigger table in its prompt. A module whose `name` matches a default module replaces it. To make a module load on a code signal, pass a `triggerTable` that adds a row for it.
|
|
106
|
+
|
|
107
|
+
## Grounding (optional)
|
|
108
|
+
|
|
109
|
+
genesis-create also gives the reviewer `query_project_schema`, so it can check resource names and enums against the project. Pass any read-only tool like that as `grounding: { definition, handler }`. The prompt names it only when it is registered.
|
|
110
|
+
|
|
111
|
+
## Show a verdict
|
|
112
|
+
|
|
113
|
+
`<ai-code-review-result>` (on the package root) renders a verdict for people to read. It does not apply a fix.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
const el = document.createElement('ai-code-review-result');
|
|
117
|
+
el.result = verdict;
|
|
118
|
+
el.files = reviewed;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Cost behaviour (do not tune without a measurement)
|
|
122
|
+
|
|
123
|
+
These settings are fixed inside `createCodeReviewAgent` so every host gets them:
|
|
124
|
+
|
|
125
|
+
- `cachePolicy: { scope: 'history' }`. Reviews run many turns, and `prompt` scope re-sent every earlier read uncached on every turn (GENC-1560).
|
|
126
|
+
- The system prompt is byte-stable. Turn-count nudges go in `tailContext`, so the cache survives the whole review.
|
|
127
|
+
- From turn 6 the reviewer gets a reminder to batch its reads, from turn 18 a budget warning, and at turn 25 `submit_code_review` is forced. That is well short of the framework's 50-iteration cap.
|
|
128
|
+
- Thinking defaults to `'off'`.
|
|
129
|
+
|
|
130
|
+
The numbers were measured in genesis-create; real multi-file reviews ran 22–26 turns. Change them only with a new benchmark.
|
|
131
|
+
|
|
132
|
+
## What it does not do
|
|
133
|
+
|
|
134
|
+
- It does not fix code. It returns a verdict and the host decides what to do with it.
|
|
135
|
+
- It does not replace `tsc` or the bundler. It assumes type and build errors were already checked.
|
|
136
|
+
- It does not review server, Kotlin or other non-web code.
|
|
137
|
+
- In the Gemini implement workflow it posts a verdict on the draft PR. It does not gate `open-pr`'s path vetting or replace `review-run`'s process review.
|
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.
|
|
4
|
+
"version": "15.71.0-FUI-2650.1",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/ai-assistant.d.ts",
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"import": "./dist/chat-driver.mjs",
|
|
33
33
|
"require": "./dist/chat-driver.cjs"
|
|
34
34
|
},
|
|
35
|
+
"./code-review": {
|
|
36
|
+
"types": "./dist/dts/code-review/index.d.ts",
|
|
37
|
+
"default": "./dist/esm/code-review/index.js"
|
|
38
|
+
},
|
|
35
39
|
"./genesis": {
|
|
36
40
|
"types": "./dist/dts/genesis/index.d.ts",
|
|
37
41
|
"default": "./dist/esm/genesis/index.js"
|
|
@@ -56,6 +60,9 @@
|
|
|
56
60
|
"chat-driver": [
|
|
57
61
|
"./dist/dts/chat-driver-node.d.ts"
|
|
58
62
|
],
|
|
63
|
+
"code-review": [
|
|
64
|
+
"./dist/dts/code-review/index.d.ts"
|
|
65
|
+
],
|
|
59
66
|
"genesis": [
|
|
60
67
|
"./dist/dts/genesis/index.d.ts"
|
|
61
68
|
],
|
|
@@ -92,31 +99,31 @@
|
|
|
92
99
|
}
|
|
93
100
|
},
|
|
94
101
|
"devDependencies": {
|
|
95
|
-
"@genesislcap/foundation-comms": "15.
|
|
96
|
-
"@genesislcap/foundation-testing": "15.
|
|
97
|
-
"@genesislcap/genx": "15.
|
|
98
|
-
"@genesislcap/ts-builder": "15.
|
|
99
|
-
"@genesislcap/uvu-playwright-builder": "15.
|
|
100
|
-
"@genesislcap/vite-builder": "15.
|
|
101
|
-
"@genesislcap/webpack-builder": "15.
|
|
102
|
+
"@genesislcap/foundation-comms": "15.71.0-FUI-2650.1",
|
|
103
|
+
"@genesislcap/foundation-testing": "15.71.0-FUI-2650.1",
|
|
104
|
+
"@genesislcap/genx": "15.71.0-FUI-2650.1",
|
|
105
|
+
"@genesislcap/ts-builder": "15.71.0-FUI-2650.1",
|
|
106
|
+
"@genesislcap/uvu-playwright-builder": "15.71.0-FUI-2650.1",
|
|
107
|
+
"@genesislcap/vite-builder": "15.71.0-FUI-2650.1",
|
|
108
|
+
"@genesislcap/webpack-builder": "15.71.0-FUI-2650.1",
|
|
102
109
|
"@types/dompurify": "^3.0.5",
|
|
103
110
|
"@types/marked": "^5.0.2",
|
|
104
111
|
"esbuild": "0.25.12"
|
|
105
112
|
},
|
|
106
113
|
"dependencies": {
|
|
107
|
-
"@genesislcap/foundation-ai": "15.
|
|
108
|
-
"@genesislcap/foundation-logger": "15.
|
|
109
|
-
"@genesislcap/foundation-notifications": "15.
|
|
110
|
-
"@genesislcap/foundation-redux": "15.
|
|
111
|
-
"@genesislcap/foundation-ui": "15.
|
|
112
|
-
"@genesislcap/foundation-utils": "15.
|
|
113
|
-
"@genesislcap/rapid-design-system": "15.
|
|
114
|
-
"@genesislcap/web-core": "15.
|
|
114
|
+
"@genesislcap/foundation-ai": "15.71.0-FUI-2650.1",
|
|
115
|
+
"@genesislcap/foundation-logger": "15.71.0-FUI-2650.1",
|
|
116
|
+
"@genesislcap/foundation-notifications": "15.71.0-FUI-2650.1",
|
|
117
|
+
"@genesislcap/foundation-redux": "15.71.0-FUI-2650.1",
|
|
118
|
+
"@genesislcap/foundation-ui": "15.71.0-FUI-2650.1",
|
|
119
|
+
"@genesislcap/foundation-utils": "15.71.0-FUI-2650.1",
|
|
120
|
+
"@genesislcap/rapid-design-system": "15.71.0-FUI-2650.1",
|
|
121
|
+
"@genesislcap/web-core": "15.71.0-FUI-2650.1",
|
|
115
122
|
"dompurify": "^3.3.1",
|
|
116
123
|
"marked": "^17.0.3"
|
|
117
124
|
},
|
|
118
125
|
"peerDependencies": {
|
|
119
|
-
"@genesislcap/foundation-comms": "^15.
|
|
126
|
+
"@genesislcap/foundation-comms": "^15.71.0-FUI-2650.1"
|
|
120
127
|
},
|
|
121
128
|
"peerDependenciesMeta": {
|
|
122
129
|
"@genesislcap/foundation-comms": {
|
|
@@ -59,6 +59,12 @@ const required = [
|
|
|
59
59
|
'aiServiceErrorCodeOf',
|
|
60
60
|
'DEFAULT_AI_SERVICE_ERROR_MESSAGES',
|
|
61
61
|
'isTerminalAIServiceRefusal',
|
|
62
|
+
// The UI Code Reviewer (FUI-2650): a CI job reviews a patch through this entry.
|
|
63
|
+
'CODE_REVIEWER_AGENT_NAME',
|
|
64
|
+
'createCodeReviewAgent',
|
|
65
|
+
'createHeadlessSubAgentCaller',
|
|
66
|
+
'reviewChanges',
|
|
67
|
+
'summarizeCodeReview',
|
|
62
68
|
];
|
|
63
69
|
|
|
64
70
|
for (const name of required) {
|
|
@@ -75,6 +81,15 @@ check(
|
|
|
75
81
|
'Did chat-driver-node.ts gain an `export *`?',
|
|
76
82
|
);
|
|
77
83
|
|
|
84
|
+
// The reviewer must build in Node, with its rule pack, and hold no write tool.
|
|
85
|
+
const reviewer = cjs.createCodeReviewAgent?.({ files: { read: () => undefined, list: () => [] } });
|
|
86
|
+
check(
|
|
87
|
+
reviewer?.name === 'UI Code Reviewer' &&
|
|
88
|
+
reviewer.toolDefinitions.some((t) => t.name === 'read_context') &&
|
|
89
|
+
!reviewer.toolDefinitions.some((t) => /write|edit/.test(t.name)),
|
|
90
|
+
'createCodeReviewAgent does not build a read-only reviewer with its rule pack in bare Node',
|
|
91
|
+
);
|
|
92
|
+
|
|
78
93
|
// A contract that loads but is empty would satisfy the export checks.
|
|
79
94
|
check(
|
|
80
95
|
cjs.AI_SERVICE_ERROR_CODES?.NO_API_KEY === 'NO_API_KEY' &&
|