@solidxai/core-ui 0.1.23-beta.1 → 0.1.23-beta.2
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/routes/pages/admin/core/AgentConfigComparisonPage.css +2 -1
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js +16 -9
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.tsx +18 -5
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +2 -0
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +22 -12
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +20 -10
- package/dist/routes/pages/admin/core/agentConfigComparison.d.ts +17 -0
- package/dist/routes/pages/admin/core/agentConfigComparison.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/agentConfigComparison.js.map +1 -1
- package/dist/routes/pages/admin/core/agentConfigComparison.ts +4 -0
- package/package.json +1 -1
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
.config-compare__rows { display:flex; flex-direction:column; gap:.4rem; }
|
|
34
34
|
.config-compare__cell { display:flex; flex-direction:column; justify-content:center; gap:.1rem; min-width:0; padding:.55rem .75rem; border:1px solid var(--cc-border); border-radius:.5rem; background:var(--surface-card,var(--card)); overflow-wrap:anywhere; transition:border-color .15s,background-color .15s; }
|
|
35
35
|
.config-compare__cell strong { color:var(--cc-ink); font-size:.85rem; font-weight:600; }
|
|
36
|
+
.config-compare__general-row .config-compare__cell strong { white-space:pre-wrap; }
|
|
36
37
|
.config-compare__cell p,.config-compare__cell small { margin:0; color:var(--cc-muted); font-size:.76rem; }
|
|
37
38
|
.config-compare__cell small { font-size:.7rem; font-weight:500; }
|
|
38
39
|
.config-compare__cell.is-absent { border-style:dashed; background:var(--surface-ground,var(--muted)); }
|
|
@@ -52,7 +53,7 @@ button.config-compare__mark:disabled { cursor:default; opacity:.7; }
|
|
|
52
53
|
.config-compare__change-tag.is-removed { color:var(--cc-bad); background:var(--cc-bad-bg); }
|
|
53
54
|
.config-compare__model-group + .config-compare__model-group { margin-top:.8rem; }
|
|
54
55
|
.config-compare__model-group h3 { margin:0 0 .4rem; color:var(--cc-muted); font-size:.68rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; }
|
|
55
|
-
.config-compare__dialog.solid-radix-dialog-content { display:flex; flex-direction:column; width:min(
|
|
56
|
+
.config-compare__dialog.solid-radix-dialog-content { display:flex; flex-direction:column; width:min(96vw,110rem); max-width:min(96vw,110rem); height:min(94dvh,90rem); max-height:94dvh; padding:0; overflow:hidden; border-radius:1rem; }
|
|
56
57
|
.config-compare__dialog .config-compare__dialog-header { flex:0 0 auto; align-items:center; gap:.75rem; padding:1rem 1.25rem; border-bottom:1px solid var(--cc-border); background:color-mix(in srgb,var(--cc-primary) 4%,var(--surface-card,var(--card))); }
|
|
57
58
|
.config-compare__dialog .config-compare__section-icon { width:2.1rem; height:2.1rem; border-radius:.55rem; }
|
|
58
59
|
.config-compare__dialog-heading { flex:1 1 auto; min-width:0; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentConfigComparisonPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentConfigComparisonPage.tsx"],"names":[],"mappings":"AAMA,OAAO,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentConfigComparisonPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentConfigComparisonPage.tsx"],"names":[],"mappings":"AAMA,OAAO,iCAAiC,CAAC;AAqHzC,wBAAgB,yBAAyB,4CAqDxC"}
|
|
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
import React from "react";
|
|
25
|
-
import { ArrowLeft, ArrowRight, Check, CircleHelp, Cpu, EqualNot, FileText, GitCompareArrows, Puzzle, X } from "lucide-react";
|
|
25
|
+
import { ArrowLeft, ArrowRight, Check, CircleHelp, Cpu, EqualNot, FileText, GitCompareArrows, Puzzle, Settings, Wrench, X } from "lucide-react";
|
|
26
26
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
|
27
27
|
import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
|
|
28
28
|
import { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogDescription, SolidDialogHeader, SolidDialogTitle, SolidTooltip, SolidTooltipContent, SolidTooltipTrigger } from "../../../../components/shad-cn-ui";
|
|
@@ -99,20 +99,21 @@ function ComparisonRowView(_a) {
|
|
|
99
99
|
var _d = React.useState(false), open = _d[0], setOpen = _d[1];
|
|
100
100
|
var matched = row.status === "matched";
|
|
101
101
|
var label = ((_b = row.right) === null || _b === void 0 ? void 0 : _b.label) || ((_c = row.left) === null || _c === void 0 ? void 0 : _c.label) || "Configuration";
|
|
102
|
-
var
|
|
103
|
-
|
|
102
|
+
var item = kind === "tool" ? "Tool" : "Skill";
|
|
103
|
+
var subtitle = kind === "prompt" ? "System prompt changes" : "".concat(item, " ").concat(row.status === "added" ? "added" : row.status === "removed" ? "removed" : "changes");
|
|
104
|
+
return _jsx("div", { className: "config-compare__row is-".concat(row.status), children: ["left", "right"].map(function (side) { return _jsxs(React.Fragment, { children: [side === "right" && _jsxs("div", { className: "config-compare__center", children: [_jsx(StatusMark, { matched: matched, label: label, disabled: !row.diffKey, "aria-haspopup": "dialog", onClick: function () { return setOpen(true); } }), !matched && row.diffKey && _jsx(DiffDialog, { open: open, onOpenChange: setOpen, comparison: comparison, diffKey: row.diffKey, title: label, subtitle: subtitle, icon: kind === "prompt" ? _jsx(FileText, { size: 16 }) : kind === "tool" ? _jsx(Wrench, { size: 16 }) : _jsx(Puzzle, { size: 16 }) })] }), _jsx("div", { className: "config-compare__cell".concat(!row[side] ? " is-absent" : ""), children: row[side] ? _jsxs(_Fragment, { children: [_jsxs("div", { className: "config-compare__cell-title", children: [_jsx("strong", { children: row[side].label }), ((side === "right" && row.status === "added") || (side === "left" && row.status === "removed")) && _jsx("span", { className: "config-compare__change-tag is-".concat(row.status), children: row.status === "added" ? "Added" : "Removed" })] }), row[side].summary && _jsx("p", { children: row[side].summary })] }) : _jsx("span", { className: "config-compare__sr-only", children: "Not included in this version" }) })] }, side); }) });
|
|
104
105
|
}
|
|
105
106
|
export function AgentConfigComparisonPage() {
|
|
106
|
-
var _a, _b;
|
|
107
|
+
var _a, _b, _c, _d, _e, _f;
|
|
107
108
|
var params = useSearchParams()[0];
|
|
108
109
|
var navigate = useNavigate();
|
|
109
110
|
var agentId = Number(params.get("agentId"));
|
|
110
111
|
var leftVersionId = Number(params.get("leftVersionId"));
|
|
111
112
|
var rightVersionId = Number(params.get("rightVersionId"));
|
|
112
113
|
var valid = [agentId, leftVersionId, rightVersionId].every(function (id) { return Number.isSafeInteger(id) && id > 0; }) && leftVersionId !== rightVersionId;
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
114
|
+
var _g = React.useState(null), comparison = _g[0], setComparison = _g[1];
|
|
115
|
+
var _h = React.useState(""), error = _h[0], setError = _h[1];
|
|
116
|
+
var _j = React.useState(0), attempt = _j[0], setAttempt = _j[1];
|
|
116
117
|
React.useEffect(function () {
|
|
117
118
|
var active = true;
|
|
118
119
|
var controller = new AbortController();
|
|
@@ -132,11 +133,17 @@ export function AgentConfigComparisonPage() {
|
|
|
132
133
|
var failed = error || (!valid ? "Select two different config versions from an agent editor." : "");
|
|
133
134
|
return _jsxs("main", { className: "config-compare", children: [_jsxs(SolidButton, { variant: "secondary", onClick: back, children: [_jsx(ArrowLeft, { size: 15 }), " Back to agent"] }), _jsxs("div", { className: "config-compare__empty", role: failed ? "alert" : "status", children: [failed || "Loading comparison…", error && _jsx("button", { type: "button", onClick: function () { return setAttempt(function (value) { return value + 1; }); }, children: "Retry" })] })] });
|
|
134
135
|
}
|
|
135
|
-
var
|
|
136
|
+
var _k = comparison.sections, systemPrompt = _k.systemPrompt, skills = _k.skills, tools = _k.tools, generalConfiguration = _k.generalConfiguration, modelConfiguration = _k.modelConfiguration;
|
|
136
137
|
var changedSkills = (_a = skills === null || skills === void 0 ? void 0 : skills.rows.filter(function (row) { return row.status !== "matched"; })) !== null && _a !== void 0 ? _a : [];
|
|
138
|
+
var changedTools = (_b = tools === null || tools === void 0 ? void 0 : tools.rows.filter(function (row) { return row.status !== "matched"; })) !== null && _b !== void 0 ? _b : [];
|
|
139
|
+
var generalChanges = (_c = generalConfiguration === null || generalConfiguration === void 0 ? void 0 : generalConfiguration.fields.filter(function (field) { return field.status !== "matched"; })) !== null && _c !== void 0 ? _c : [];
|
|
137
140
|
var modelChanges = modelConfiguration.groups.reduce(function (total, group) { return total + group.fields.filter(function (field) { return field.status !== "matched"; }).length; }, 0);
|
|
138
141
|
var subtitle = comparison.agent.title && comparison.agent.title !== comparison.agent.name ? comparison.agent.title : null;
|
|
139
|
-
return _jsxs("main", { className: "config-compare", children: [_jsxs("header", { className: "config-compare__page-header", children: [_jsxs("div", { children: [_jsxs("div", { className: "config-compare__eyebrow", children: [_jsx(GitCompareArrows, { size: 13 }), " Config comparison"] }), _jsx("h1", { children: comparison.agent.name }), subtitle && _jsx("p", { children: subtitle })] }), _jsxs(SolidButton, { variant: "secondary", size: "sm", onClick: back, children: [_jsx(ArrowLeft, { size: 14 }), " Back to agent"] })] }), _jsxs("div", { className: "config-compare__sheet", children: [_jsxs("div", { className: "config-compare__version-headers", children: [_jsx(VersionHeader, { version: comparison.versions.left, side: "Older" }), _jsx("span", { className: "config-compare__center", children: _jsx("span", { className: "config-compare__arrow", children: _jsx(ArrowRight, { size: 14 }) }) }), _jsx(VersionHeader, { version: comparison.versions.right, side: "Newer" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(FileText, { size: 15 }), title: systemPrompt.title, changes: systemPrompt.status === "matched" ? 0 : 1 }), systemPrompt.status === "matched" ? _jsx("p", { className: "config-compare__empty", children: "No changes to persona" }) : _jsx(ComparisonRowView, { comparison: comparison, row: systemPrompt, kind: "prompt" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(Puzzle, { size: 15 }), title: (
|
|
142
|
+
return _jsxs("main", { className: "config-compare", children: [_jsxs("header", { className: "config-compare__page-header", children: [_jsxs("div", { children: [_jsxs("div", { className: "config-compare__eyebrow", children: [_jsx(GitCompareArrows, { size: 13 }), " Config comparison"] }), _jsx("h1", { children: comparison.agent.name }), subtitle && _jsx("p", { children: subtitle })] }), _jsxs(SolidButton, { variant: "secondary", size: "sm", onClick: back, children: [_jsx(ArrowLeft, { size: 14 }), " Back to agent"] })] }), _jsxs("div", { className: "config-compare__sheet", children: [_jsxs("div", { className: "config-compare__version-headers", children: [_jsx(VersionHeader, { version: comparison.versions.left, side: "Older" }), _jsx("span", { className: "config-compare__center", children: _jsx("span", { className: "config-compare__arrow", children: _jsx(ArrowRight, { size: 14 }) }) }), _jsx(VersionHeader, { version: comparison.versions.right, side: "Newer" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(FileText, { size: 15 }), title: systemPrompt.title, changes: systemPrompt.status === "matched" ? 0 : 1 }), systemPrompt.status === "matched" ? _jsx("p", { className: "config-compare__empty", children: "No changes to persona" }) : _jsx(ComparisonRowView, { comparison: comparison, row: systemPrompt, kind: "prompt" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(Puzzle, { size: 15 }), title: (_d = skills === null || skills === void 0 ? void 0 : skills.title) !== null && _d !== void 0 ? _d : "Skills", count: (skills === null || skills === void 0 ? void 0 : skills.rows.length) ? "".concat(changedSkills.length, " of ").concat(skills.rows.length) : undefined, changes: changedSkills.length }), !skills ? _jsx("p", { className: "config-compare__empty", children: "Skill comparison is not available yet." }) : changedSkills.length ? _jsx("div", { className: "config-compare__rows", children: changedSkills.map(function (row) { return _jsx(ComparisonRowView, { comparison: comparison, row: row, kind: "skill" }, row.id); }) }) : _jsx("p", { className: "config-compare__empty", children: "No changes to skills" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(Wrench, { size: 15 }), title: (_e = tools === null || tools === void 0 ? void 0 : tools.title) !== null && _e !== void 0 ? _e : "Tools", count: (tools === null || tools === void 0 ? void 0 : tools.rows.length) ? "".concat(changedTools.length, " of ").concat(tools.rows.length) : undefined, changes: changedTools.length }), !tools ? _jsx("p", { className: "config-compare__empty", children: "Tool comparison is not available yet." }) : changedTools.length ? _jsx("div", { className: "config-compare__rows", children: changedTools.map(function (row) { return _jsx(ComparisonRowView, { comparison: comparison, row: row, kind: "tool" }, row.id); }) }) : _jsx("p", { className: "config-compare__empty", children: "No changes to tools" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(Settings, { size: 15 }), title: (_f = generalConfiguration === null || generalConfiguration === void 0 ? void 0 : generalConfiguration.title) !== null && _f !== void 0 ? _f : "General configuration", changes: generalChanges.length }), !generalConfiguration ? _jsx("p", { className: "config-compare__empty", children: "General configuration comparison is not available yet." })
|
|
143
|
+
: generalChanges.length ? _jsx("div", { className: "config-compare__rows", children: generalChanges.map(function (field) {
|
|
144
|
+
var _a, _b, _c, _d;
|
|
145
|
+
return _jsxs("div", { className: "config-compare__row config-compare__general-row is-".concat(field.status), children: [_jsxs("div", { className: "config-compare__cell", children: [_jsx("small", { children: field.label }), _jsx("strong", { children: (_b = (_a = field.left) !== null && _a !== void 0 ? _a : field.emptyLabel) !== null && _b !== void 0 ? _b : "Not set" })] }), _jsx("div", { className: "config-compare__center", children: _jsx(StatusMark, { matched: false, label: field.label, interactive: false }) }), _jsxs("div", { className: "config-compare__cell", children: [_jsx("small", { children: field.label }), _jsx("strong", { children: (_d = (_c = field.right) !== null && _c !== void 0 ? _c : field.emptyLabel) !== null && _d !== void 0 ? _d : "Not set" })] })] }, field.key);
|
|
146
|
+
}) }) : _jsx("p", { className: "config-compare__empty", children: "No changes to general configuration" })] }), _jsxs("section", { className: "config-compare__section", children: [_jsx(SectionHeader, { icon: _jsx(Cpu, { size: 15 }), title: modelConfiguration.title, changes: modelChanges }), modelChanges === 0 ? _jsx("p", { className: "config-compare__empty", children: "No changes to model configuration" }) : modelConfiguration.groups.map(function (group) { return _jsxs("div", { className: "config-compare__model-group", children: [_jsx("h3", { children: group.title }), _jsx("div", { className: "config-compare__rows", children: group.fields.map(function (field) {
|
|
140
147
|
var _a, _b;
|
|
141
148
|
return _jsxs("div", { className: "config-compare__row config-compare__model-row is-".concat(field.status), children: [_jsxs("div", { className: "config-compare__cell", children: [_jsx("small", { children: field.label }), _jsx("strong", { children: (_a = field.left) !== null && _a !== void 0 ? _a : "—" })] }), _jsx("div", { className: "config-compare__center", children: _jsx(StatusMark, { matched: field.status === "matched", label: field.label, interactive: false }) }), _jsxs("div", { className: "config-compare__cell", children: [_jsx("small", { children: field.label }), _jsx("strong", { children: (_b = field.right) !== null && _b !== void 0 ? _b : "—" })] })] }, field.key);
|
|
142
149
|
}) })] }, group.id); })] })] })] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentConfigComparisonPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentConfigComparisonPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC9H,OAAO,EA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C,KAAC,aAAa,IAAC,IAAI,EAAE,KAAC,GAAG,IAAC,IAAI,EAAE,EAAE,GAAI,EAAE,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,GAAI,EAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,uBAAuB,kDAAsC,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,eAAK,SAAS,EAAC,6BAA6B,aAAgB,uBAAK,KAAK,CAAC,KAAK,GAAM,EAAA,cAAK,SAAS,EAAC,sBAAsB,YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK;;4CAAK,OAAA,eAAK,SAAS,EAAE,2DAAoD,KAAK,CAAC,MAAM,CAAE,aAChgB,eAAK,SAAS,EAAC,sBAAsB,aAAC,0BAAQ,KAAK,CAAC,KAAK,GAAS,EAAA,2BAAS,MAAA,KAAK,CAAC,IAAI,mCAAI,GAAG,GAAU,IAAM,EAAA,cAAK,SAAS,EAAC,wBAAwB,YAAC,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,GAAI,GAAM,EAAA,eAAK,SAAS,EAAC,sBAAsB,aAAC,0BAAQ,KAAK,CAAC,KAAK,GAAS,EAAA,2BAAS,MAAA,KAAK,CAAC,KAAK,mCAAI,GAAG,GAAU,IAAM,KADqK,KAAK,CAAC,GAAG,CAE5gB,CAAA;yCAAA,CAAC,GAAO,KAF+T,KAAK,CAAC,EAAE,CAEjU,EAFuQ,CAEvQ,CAAC,IAAW,IAC5B,IACD,CAAC;AACV,CAAC","sourcesContent":["import React from \"react\";\nimport { ArrowLeft, ArrowRight, Check, CircleHelp, Cpu, EqualNot, FileText, GitCompareArrows, Puzzle, X } from \"lucide-react\";\nimport { useNavigate, useSearchParams } from \"react-router-dom\";\nimport ReactDiffViewer, { DiffMethod } from \"react-diff-viewer-continued\";\nimport { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogDescription, SolidDialogHeader, SolidDialogTitle, SolidTooltip, SolidTooltipContent, SolidTooltipTrigger } from \"../../../../components/shad-cn-ui\";\nimport { formatConfigDate, loadConfigComparison, loadConfigDiff, type ConfigComparison, type ConfigDiff, type ConfigVersion, type ComparisonRow } from \"./agentConfigComparison\";\nimport \"./AgentConfigComparisonPage.css\";\n\nfunction VersionHeader({ version, side }: { version: ConfigVersion; side: \"Older\" | \"Newer\" }) {\n const name = version.name || `Version ${version.versionNumber}`;\n return <div className={`config-compare__version is-${side.toLowerCase()}`}>\n <span className=\"config-compare__version-badge\">v{version.versionNumber}</span>\n <div className=\"config-compare__version-copy\">\n <div className=\"config-compare__version-title\"><h2>{name}</h2>\n <SolidTooltip><SolidTooltipTrigger asChild><button type=\"button\" className=\"config-compare__help\" aria-label={`About version ${version.versionNumber}`}><CircleHelp size={14} /></button></SolidTooltipTrigger>\n <SolidTooltipContent><div className=\"config-compare__tooltip\"><strong>{name}</strong><p>{version.description || \"No description added.\"}</p></div></SolidTooltipContent>\n </SolidTooltip>\n </div>\n <span className=\"config-compare__version-meta\">{side} · <time dateTime={version.createdAt}>{formatConfigDate(version.createdAt)}</time></span>\n </div>\n </div>;\n}\n\ntype StatusMarkProps = { matched: boolean; label: string; interactive?: boolean } & React.ButtonHTMLAttributes<HTMLButtonElement>;\nconst StatusMark = React.forwardRef<HTMLButtonElement, StatusMarkProps>(({ matched, label, interactive = true, className, ...rest }, ref) => {\n const icon = matched ? <Check size={14} strokeWidth={2.75} /> : <EqualNot size={14} strokeWidth={2.5} />;\n const classes = `config-compare__mark ${matched ? \"is-matched\" : \"is-changed\"}${className ? ` ${className}` : \"\"}`;\n if (matched || !interactive) return <span className={classes} role=\"img\" aria-label={`${label}: ${matched ? \"no differences\" : \"different\"}`} title={matched ? \"No differences\" : \"Different\"}>{icon}</span>;\n return <button ref={ref} type=\"button\" className={classes} aria-label={`${label}: view differences`} title={rest.disabled ? \"Different\" : \"View differences\"} {...rest}>{icon}</button>;\n});\nStatusMark.displayName = \"StatusMark\";\n\nfunction SectionHeader({ icon, title, count, changes }: { icon: React.ReactNode; title: string; count?: string; changes: number }) {\n return <header className=\"config-compare__section-head\">\n <span className=\"config-compare__section-icon\">{icon}</span>\n <h2>{title}</h2>\n {count !== undefined && <span className=\"config-compare__count\">{count}</span>}\n <span className={`config-compare__section-status ${changes ? \"is-changed\" : \"is-matched\"}`} aria-label={changes ? `${changes} difference${changes === 1 ? \"\" : \"s\"}` : \"No differences\"}>\n {changes ? <><EqualNot size={12} strokeWidth={2.75} />{changes}</> : <Check size={12} strokeWidth={3} />}\n </span>\n </header>;\n}\n\nfunction DiffContent({ comparison, diffKey }: { comparison: ConfigComparison; diffKey: string }) {\n const [detail, setDetail] = React.useState<ConfigDiff | null>(null);\n const [error, setError] = React.useState(\"\");\n const [attempt, setAttempt] = React.useState(0);\n const { left, right } = comparison.versions;\n React.useEffect(() => {\n let active = true;\n const controller = new AbortController();\n setDetail(null); setError(\"\");\n void loadConfigDiff({ agentId: comparison.agent.id, leftVersionId: left.id, rightVersionId: right.id, diffKey }, controller.signal)\n .then((result) => { if (active) setDetail(result); })\n .catch((reason) => { if (active) setError(reason instanceof Error ? reason.message : \"The diff could not be loaded.\"); });\n return () => { active = false; controller.abort(); };\n }, [comparison.agent.id, left.id, right.id, diffKey, attempt]);\n if (error) return <div className=\"config-compare__empty\" role=\"alert\">{error} <button type=\"button\" onClick={() => setAttempt((value) => value + 1)}>Retry</button></div>;\n if (!detail) return <div className=\"config-compare__empty\" role=\"status\">Loading diff…</div>;\n const rows = detail.rows ?? [{ id: diffKey, title: detail.title, oldValue: detail.oldValue, newValue: detail.newValue }];\n return <div className=\"config-compare__diff\">{rows.map((row) => <section key={row.id} className=\"config-compare__diff-block\" aria-label={row.title}>\n <header className=\"config-compare__diff-block-head\"><h3>{row.title}</h3><StatusMark matched={row.oldValue === row.newValue} label={row.title} interactive={false} /></header>\n {isFlagChange(row.oldValue, row.newValue) ? <div className={`config-compare__value-change${row.oldValue === row.newValue ? \" is-same\" : \"\"}`}>\n <ValueSide version={left} value={row.oldValue} tone=\"old\" /><span className=\"config-compare__arrow\" aria-hidden=\"true\"><ArrowRight size={14} /></span><ValueSide version={right} value={row.newValue} tone=\"new\" />\n </div> : <div className=\"config-compare__diff-viewer\"><ReactDiffViewer oldValue={row.oldValue} newValue={row.newValue} splitView compareMethod={DiffMethod.WORDS} styles={diffViewerStyles}\n leftTitle={`v${left.versionNumber} · ${left.name || \"Older version\"}`} rightTitle={`v${right.versionNumber} · ${right.name || \"Newer version\"}`} showDiffOnly={false} /></div>}\n </section>)}</div>;\n}\n\n// Settings such as \"Always include\" arrive as \"true\"/\"false\" (\"\" when the skill is absent); text fields always use the diff viewer.\nconst flagOf = (value: string) => value.trim().toLowerCase();\nconst isFlagChange = (oldValue: string, newValue: string) => [oldValue, newValue].every((value) => [\"true\", \"false\", \"\"].includes(flagOf(value))) && [oldValue, newValue].some((value) => flagOf(value) !== \"\");\n\nfunction ValueSide({ version, value, tone }: { version: ConfigVersion; value: string; tone: \"old\" | \"new\" }) {\n const flag = flagOf(value);\n return <div className={`config-compare__value is-${tone}`}>\n <span className=\"config-compare__value-version\">v{version.versionNumber} · {version.name || (tone === \"old\" ? \"Older version\" : \"Newer version\")}</span>\n {flag ? <span className={`config-compare__value-flag is-${flag === \"true\" ? \"on\" : \"off\"}`}>{flag === \"true\" ? <Check size={13} strokeWidth={3} /> : <X size={13} strokeWidth={3} />}{flag === \"true\" ? \"Yes\" : \"No\"}</span>\n : <span className=\"config-compare__value-empty\">Not included</span>}\n </div>;\n}\n\nconst diffViewerStyles = {\n contentText: { fontSize: \"0.8rem\", lineHeight: 1.6 },\n lineNumber: { fontSize: \"0.72rem\" },\n gutter: { minWidth: \"2.25rem\", padding: \"0 0.5rem\" },\n marker: { width: \"1.5rem\", paddingLeft: \"0.4rem\" },\n titleBlock: { padding: \"0.5rem 0.75rem\", fontFamily: \"inherit\", fontSize: \"0.72rem\", fontWeight: 600, letterSpacing: \"0.02em\" },\n};\n\nfunction DiffDialog({ open, onOpenChange, comparison, diffKey, icon, title, subtitle }: { open: boolean; onOpenChange: (open: boolean) => void; comparison: ConfigComparison; diffKey: string; icon: React.ReactNode; title: string; subtitle: string }) {\n const { left, right } = comparison.versions;\n return <SolidDialog open={open} onOpenChange={onOpenChange} showHeader={false} ariaLabel={`${title} differences`} className=\"config-compare__dialog\">\n <SolidDialogHeader className=\"config-compare__dialog-header\">\n <span className=\"config-compare__section-icon\">{icon}</span>\n <div className=\"config-compare__dialog-heading\"><SolidDialogTitle>{title}</SolidDialogTitle><SolidDialogDescription>{subtitle}</SolidDialogDescription></div>\n <div className=\"config-compare__dialog-versions\" aria-label={`Comparing version ${left.versionNumber} with version ${right.versionNumber}`}>\n <span className=\"config-compare__version-badge\">v{left.versionNumber}</span><ArrowRight size={13} /><span className=\"config-compare__version-badge is-newer\">v{right.versionNumber}</span>\n </div>\n <SolidDialogClose aria-label=\"Close\" />\n </SolidDialogHeader>\n <SolidDialogBody>{open && <DiffContent comparison={comparison} diffKey={diffKey} />}</SolidDialogBody>\n </SolidDialog>;\n}\n\nfunction ComparisonRowView({ row, comparison, kind }: { row: ComparisonRow; comparison: ConfigComparison; kind: \"prompt\" | \"skill\" }) {\n const [open, setOpen] = React.useState(false);\n const matched = row.status === \"matched\";\n const label = row.right?.label || row.left?.label || \"Configuration\";\n const subtitle = kind === \"prompt\" ? \"System prompt changes\" : row.status === \"added\" ? \"Skill added\" : row.status === \"removed\" ? \"Skill removed\" : \"Skill changes\";\n return <div className={`config-compare__row is-${row.status}`}>\n {([\"left\", \"right\"] as const).map((side) => <React.Fragment key={side}>\n {side === \"right\" && <div className=\"config-compare__center\"><StatusMark matched={matched} label={label} disabled={!row.diffKey} aria-haspopup=\"dialog\" onClick={() => setOpen(true)} />\n {!matched && row.diffKey && <DiffDialog open={open} onOpenChange={setOpen} comparison={comparison} diffKey={row.diffKey} title={label} subtitle={subtitle} icon={kind === \"prompt\" ? <FileText size={16} /> : <Puzzle size={16} />} />}</div>}\n <div className={`config-compare__cell${!row[side] ? \" is-absent\" : \"\"}`}>\n {row[side] ? <><div className=\"config-compare__cell-title\"><strong>{row[side]!.label}</strong>{((side === \"right\" && row.status === \"added\") || (side === \"left\" && row.status === \"removed\")) && <span className={`config-compare__change-tag is-${row.status}`}>{row.status === \"added\" ? \"Added\" : \"Removed\"}</span>}</div>\n {row[side]!.summary && <p>{row[side]!.summary}</p>}</> : <span className=\"config-compare__sr-only\">Not included in this version</span>}\n </div>\n </React.Fragment>)}\n </div>;\n}\n\nexport function AgentConfigComparisonPage() {\n const [params] = useSearchParams();\n const navigate = useNavigate();\n const agentId = Number(params.get(\"agentId\"));\n const leftVersionId = Number(params.get(\"leftVersionId\"));\n const rightVersionId = Number(params.get(\"rightVersionId\"));\n const valid = [agentId, leftVersionId, rightVersionId].every((id) => Number.isSafeInteger(id) && id > 0) && leftVersionId !== rightVersionId;\n const [comparison, setComparison] = React.useState<ConfigComparison | null>(null);\n const [error, setError] = React.useState(\"\");\n const [attempt, setAttempt] = React.useState(0);\n React.useEffect(() => {\n let active = true;\n const controller = new AbortController();\n setComparison(null); setError(\"\");\n if (!valid) return;\n void loadConfigComparison({ agentId, leftVersionId, rightVersionId }, controller.signal)\n .then((result) => { if (active) setComparison(result); })\n .catch((reason) => { if (active) setError(reason instanceof Error ? reason.message : \"The comparison could not be loaded.\"); });\n return () => { active = false; controller.abort(); };\n }, [valid, agentId, leftVersionId, rightVersionId, attempt]);\n const back = () => navigate(valid ? `/admin/core/solid-core/agent-registry/editor/${agentId}?tab=config-versions` : \"/admin/core/solid-core/agent-registry/list\");\n if (!comparison) {\n const failed = error || (!valid ? \"Select two different config versions from an agent editor.\" : \"\");\n return <main className=\"config-compare\"><SolidButton variant=\"secondary\" onClick={back}><ArrowLeft size={15} /> Back to agent</SolidButton><div className=\"config-compare__empty\" role={failed ? \"alert\" : \"status\"}>{failed || \"Loading comparison…\"}\n {error && <button type=\"button\" onClick={() => setAttempt((value) => value + 1)}>Retry</button>}</div></main>;\n }\n const { systemPrompt, skills, modelConfiguration } = comparison.sections;\n const changedSkills = skills?.rows.filter((row) => row.status !== \"matched\") ?? [];\n const modelChanges = modelConfiguration.groups.reduce((total, group) => total + group.fields.filter((field) => field.status !== \"matched\").length, 0);\n const subtitle = comparison.agent.title && comparison.agent.title !== comparison.agent.name ? comparison.agent.title : null;\n return <main className=\"config-compare\">\n <header className=\"config-compare__page-header\"><div><div className=\"config-compare__eyebrow\"><GitCompareArrows size={13} /> Config comparison</div><h1>{comparison.agent.name}</h1>{subtitle && <p>{subtitle}</p>}</div><SolidButton variant=\"secondary\" size=\"sm\" onClick={back}><ArrowLeft size={14} /> Back to agent</SolidButton></header>\n <div className=\"config-compare__sheet\">\n <div className=\"config-compare__version-headers\"><VersionHeader version={comparison.versions.left} side=\"Older\" /><span className=\"config-compare__center\"><span className=\"config-compare__arrow\"><ArrowRight size={14} /></span></span><VersionHeader version={comparison.versions.right} side=\"Newer\" /></div>\n <section className=\"config-compare__section\"><SectionHeader icon={<FileText size={15} />} title={systemPrompt.title} changes={systemPrompt.status === \"matched\" ? 0 : 1} />{systemPrompt.status === \"matched\" ? <p className=\"config-compare__empty\">No changes to persona</p> : <ComparisonRowView comparison={comparison} row={systemPrompt} kind=\"prompt\" />}</section>\n <section className=\"config-compare__section\"><SectionHeader icon={<Puzzle size={15} />} title={skills?.title ?? \"Skills\"} count={skills?.rows.length ? `${changedSkills.length} of ${skills.rows.length}` : undefined} changes={changedSkills.length} />{!skills ? <p className=\"config-compare__empty\">Skill comparison is not available yet.</p> : changedSkills.length ? <div className=\"config-compare__rows\">{changedSkills.map((row) => <ComparisonRowView key={row.id} comparison={comparison} row={row} kind=\"skill\" />)}</div> : <p className=\"config-compare__empty\">No changes to skills</p>}</section>\n <section className=\"config-compare__section\"><SectionHeader icon={<Cpu size={15} />} title={modelConfiguration.title} changes={modelChanges} />{modelChanges === 0 ? <p className=\"config-compare__empty\">No changes to model configuration</p> : modelConfiguration.groups.map((group) => <div className=\"config-compare__model-group\" key={group.id}><h3>{group.title}</h3><div className=\"config-compare__rows\">{group.fields.map((field) => <div className={`config-compare__row config-compare__model-row is-${field.status}`} key={field.key}>\n <div className=\"config-compare__cell\"><small>{field.label}</small><strong>{field.left ?? \"—\"}</strong></div><div className=\"config-compare__center\"><StatusMark matched={field.status === \"matched\"} label={field.label} interactive={false} /></div><div className=\"config-compare__cell\"><small>{field.label}</small><strong>{field.right ?? \"—\"}</strong></div>\n </div>)}</div></div>)}</section>\n </div>\n </main>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AgentConfigComparisonPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentConfigComparisonPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAChJ,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,eAAe,EAAE,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACrO,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,cAAc,EAAkF,MAAM,yBAAyB,CAAC;AACjL,OAAO,iCAAiC,CAAC;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,IAAK,OAAA,eAAK,SAAS,EAAC,6BAA6B,aAAgB,uBAAK,KAAK,CAAC,KAAK,GAAM,EAAA,cAAK,SAAS,EAAC,sBAAsB,YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK;;4CAAK,OAAA,eAAK,SAAS,EAAE,2DAAoD,KAAK,CAAC,MAAM,CAAE,aAChgB,eAAK,SAAS,EAAC,sBAAsB,aAAC,0BAAQ,KAAK,CAAC,KAAK,GAAS,EAAA,2BAAS,MAAA,KAAK,CAAC,IAAI,mCAAI,GAAG,GAAU,IAAM,EAAA,cAAK,SAAS,EAAC,wBAAwB,YAAC,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,GAAI,GAAM,EAAA,eAAK,SAAS,EAAC,sBAAsB,aAAC,0BAAQ,KAAK,CAAC,KAAK,GAAS,EAAA,2BAAS,MAAA,KAAK,CAAC,KAAK,mCAAI,GAAG,GAAU,IAAM,KADqK,KAAK,CAAC,GAAG,CAE5gB,CAAA;yCAAA,CAAC,GAAO,KAF+T,KAAK,CAAC,EAAE,CAEjU,EAFuQ,CAEvQ,CAAC,IAAW,IAC5B,IACD,CAAC;AACV,CAAC","sourcesContent":["import React from \"react\";\nimport { ArrowLeft, ArrowRight, Check, CircleHelp, Cpu, EqualNot, FileText, GitCompareArrows, Puzzle, Settings, Wrench, X } from \"lucide-react\";\nimport { useNavigate, useSearchParams } from \"react-router-dom\";\nimport ReactDiffViewer, { DiffMethod } from \"react-diff-viewer-continued\";\nimport { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogDescription, SolidDialogHeader, SolidDialogTitle, SolidTooltip, SolidTooltipContent, SolidTooltipTrigger } from \"../../../../components/shad-cn-ui\";\nimport { formatConfigDate, loadConfigComparison, loadConfigDiff, type ConfigComparison, type ConfigDiff, type ConfigVersion, type ComparisonRow } from \"./agentConfigComparison\";\nimport \"./AgentConfigComparisonPage.css\";\n\nfunction VersionHeader({ version, side }: { version: ConfigVersion; side: \"Older\" | \"Newer\" }) {\n const name = version.name || `Version ${version.versionNumber}`;\n return <div className={`config-compare__version is-${side.toLowerCase()}`}>\n <span className=\"config-compare__version-badge\">v{version.versionNumber}</span>\n <div className=\"config-compare__version-copy\">\n <div className=\"config-compare__version-title\"><h2>{name}</h2>\n <SolidTooltip><SolidTooltipTrigger asChild><button type=\"button\" className=\"config-compare__help\" aria-label={`About version ${version.versionNumber}`}><CircleHelp size={14} /></button></SolidTooltipTrigger>\n <SolidTooltipContent><div className=\"config-compare__tooltip\"><strong>{name}</strong><p>{version.description || \"No description added.\"}</p></div></SolidTooltipContent>\n </SolidTooltip>\n </div>\n <span className=\"config-compare__version-meta\">{side} · <time dateTime={version.createdAt}>{formatConfigDate(version.createdAt)}</time></span>\n </div>\n </div>;\n}\n\ntype StatusMarkProps = { matched: boolean; label: string; interactive?: boolean } & React.ButtonHTMLAttributes<HTMLButtonElement>;\nconst StatusMark = React.forwardRef<HTMLButtonElement, StatusMarkProps>(({ matched, label, interactive = true, className, ...rest }, ref) => {\n const icon = matched ? <Check size={14} strokeWidth={2.75} /> : <EqualNot size={14} strokeWidth={2.5} />;\n const classes = `config-compare__mark ${matched ? \"is-matched\" : \"is-changed\"}${className ? ` ${className}` : \"\"}`;\n if (matched || !interactive) return <span className={classes} role=\"img\" aria-label={`${label}: ${matched ? \"no differences\" : \"different\"}`} title={matched ? \"No differences\" : \"Different\"}>{icon}</span>;\n return <button ref={ref} type=\"button\" className={classes} aria-label={`${label}: view differences`} title={rest.disabled ? \"Different\" : \"View differences\"} {...rest}>{icon}</button>;\n});\nStatusMark.displayName = \"StatusMark\";\n\nfunction SectionHeader({ icon, title, count, changes }: { icon: React.ReactNode; title: string; count?: string; changes: number }) {\n return <header className=\"config-compare__section-head\">\n <span className=\"config-compare__section-icon\">{icon}</span>\n <h2>{title}</h2>\n {count !== undefined && <span className=\"config-compare__count\">{count}</span>}\n <span className={`config-compare__section-status ${changes ? \"is-changed\" : \"is-matched\"}`} aria-label={changes ? `${changes} difference${changes === 1 ? \"\" : \"s\"}` : \"No differences\"}>\n {changes ? <><EqualNot size={12} strokeWidth={2.75} />{changes}</> : <Check size={12} strokeWidth={3} />}\n </span>\n </header>;\n}\n\nfunction DiffContent({ comparison, diffKey }: { comparison: ConfigComparison; diffKey: string }) {\n const [detail, setDetail] = React.useState<ConfigDiff | null>(null);\n const [error, setError] = React.useState(\"\");\n const [attempt, setAttempt] = React.useState(0);\n const { left, right } = comparison.versions;\n React.useEffect(() => {\n let active = true;\n const controller = new AbortController();\n setDetail(null); setError(\"\");\n void loadConfigDiff({ agentId: comparison.agent.id, leftVersionId: left.id, rightVersionId: right.id, diffKey }, controller.signal)\n .then((result) => { if (active) setDetail(result); })\n .catch((reason) => { if (active) setError(reason instanceof Error ? reason.message : \"The diff could not be loaded.\"); });\n return () => { active = false; controller.abort(); };\n }, [comparison.agent.id, left.id, right.id, diffKey, attempt]);\n if (error) return <div className=\"config-compare__empty\" role=\"alert\">{error} <button type=\"button\" onClick={() => setAttempt((value) => value + 1)}>Retry</button></div>;\n if (!detail) return <div className=\"config-compare__empty\" role=\"status\">Loading diff…</div>;\n const rows = detail.rows ?? [{ id: diffKey, title: detail.title, oldValue: detail.oldValue, newValue: detail.newValue }];\n return <div className=\"config-compare__diff\">{rows.map((row) => <section key={row.id} className=\"config-compare__diff-block\" aria-label={row.title}>\n <header className=\"config-compare__diff-block-head\"><h3>{row.title}</h3><StatusMark matched={row.oldValue === row.newValue} label={row.title} interactive={false} /></header>\n {isFlagChange(row.oldValue, row.newValue) ? <div className={`config-compare__value-change${row.oldValue === row.newValue ? \" is-same\" : \"\"}`}>\n <ValueSide version={left} value={row.oldValue} tone=\"old\" /><span className=\"config-compare__arrow\" aria-hidden=\"true\"><ArrowRight size={14} /></span><ValueSide version={right} value={row.newValue} tone=\"new\" />\n </div> : <div className=\"config-compare__diff-viewer\"><ReactDiffViewer oldValue={row.oldValue} newValue={row.newValue} splitView compareMethod={DiffMethod.WORDS} styles={diffViewerStyles}\n leftTitle={`v${left.versionNumber} · ${left.name || \"Older version\"}`} rightTitle={`v${right.versionNumber} · ${right.name || \"Newer version\"}`} showDiffOnly={false} /></div>}\n </section>)}</div>;\n}\n\n// Settings such as \"Always include\" arrive as \"true\"/\"false\" (\"\" when the skill is absent); text fields always use the diff viewer.\nconst flagOf = (value: string) => value.trim().toLowerCase();\nconst isFlagChange = (oldValue: string, newValue: string) => [oldValue, newValue].every((value) => [\"true\", \"false\", \"\"].includes(flagOf(value))) && [oldValue, newValue].some((value) => flagOf(value) !== \"\");\n\nfunction ValueSide({ version, value, tone }: { version: ConfigVersion; value: string; tone: \"old\" | \"new\" }) {\n const flag = flagOf(value);\n return <div className={`config-compare__value is-${tone}`}>\n <span className=\"config-compare__value-version\">v{version.versionNumber} · {version.name || (tone === \"old\" ? \"Older version\" : \"Newer version\")}</span>\n {flag ? <span className={`config-compare__value-flag is-${flag === \"true\" ? \"on\" : \"off\"}`}>{flag === \"true\" ? <Check size={13} strokeWidth={3} /> : <X size={13} strokeWidth={3} />}{flag === \"true\" ? \"Yes\" : \"No\"}</span>\n : <span className=\"config-compare__value-empty\">Not included</span>}\n </div>;\n}\n\nconst diffViewerStyles = {\n contentText: { fontSize: \"0.8rem\", lineHeight: 1.6 },\n lineNumber: { fontSize: \"0.72rem\" },\n gutter: { minWidth: \"2.25rem\", padding: \"0 0.5rem\" },\n marker: { width: \"1.5rem\", paddingLeft: \"0.4rem\" },\n titleBlock: { padding: \"0.5rem 0.75rem\", fontFamily: \"inherit\", fontSize: \"0.72rem\", fontWeight: 600, letterSpacing: \"0.02em\" },\n};\n\nfunction DiffDialog({ open, onOpenChange, comparison, diffKey, icon, title, subtitle }: { open: boolean; onOpenChange: (open: boolean) => void; comparison: ConfigComparison; diffKey: string; icon: React.ReactNode; title: string; subtitle: string }) {\n const { left, right } = comparison.versions;\n return <SolidDialog open={open} onOpenChange={onOpenChange} showHeader={false} ariaLabel={`${title} differences`} className=\"config-compare__dialog\">\n <SolidDialogHeader className=\"config-compare__dialog-header\">\n <span className=\"config-compare__section-icon\">{icon}</span>\n <div className=\"config-compare__dialog-heading\"><SolidDialogTitle>{title}</SolidDialogTitle><SolidDialogDescription>{subtitle}</SolidDialogDescription></div>\n <div className=\"config-compare__dialog-versions\" aria-label={`Comparing version ${left.versionNumber} with version ${right.versionNumber}`}>\n <span className=\"config-compare__version-badge\">v{left.versionNumber}</span><ArrowRight size={13} /><span className=\"config-compare__version-badge is-newer\">v{right.versionNumber}</span>\n </div>\n <SolidDialogClose aria-label=\"Close\" />\n </SolidDialogHeader>\n <SolidDialogBody>{open && <DiffContent comparison={comparison} diffKey={diffKey} />}</SolidDialogBody>\n </SolidDialog>;\n}\n\nfunction ComparisonRowView({ row, comparison, kind }: { row: ComparisonRow; comparison: ConfigComparison; kind: \"prompt\" | \"skill\" | \"tool\" }) {\n const [open, setOpen] = React.useState(false);\n const matched = row.status === \"matched\";\n const label = row.right?.label || row.left?.label || \"Configuration\";\n const item = kind === \"tool\" ? \"Tool\" : \"Skill\";\n const subtitle = kind === \"prompt\" ? \"System prompt changes\" : `${item} ${row.status === \"added\" ? \"added\" : row.status === \"removed\" ? \"removed\" : \"changes\"}`;\n return <div className={`config-compare__row is-${row.status}`}>\n {([\"left\", \"right\"] as const).map((side) => <React.Fragment key={side}>\n {side === \"right\" && <div className=\"config-compare__center\"><StatusMark matched={matched} label={label} disabled={!row.diffKey} aria-haspopup=\"dialog\" onClick={() => setOpen(true)} />\n {!matched && row.diffKey && <DiffDialog open={open} onOpenChange={setOpen} comparison={comparison} diffKey={row.diffKey} title={label} subtitle={subtitle} icon={kind === \"prompt\" ? <FileText size={16} /> : kind === \"tool\" ? <Wrench size={16} /> : <Puzzle size={16} />} />}</div>}\n <div className={`config-compare__cell${!row[side] ? \" is-absent\" : \"\"}`}>\n {row[side] ? <><div className=\"config-compare__cell-title\"><strong>{row[side]!.label}</strong>{((side === \"right\" && row.status === \"added\") || (side === \"left\" && row.status === \"removed\")) && <span className={`config-compare__change-tag is-${row.status}`}>{row.status === \"added\" ? \"Added\" : \"Removed\"}</span>}</div>\n {row[side]!.summary && <p>{row[side]!.summary}</p>}</> : <span className=\"config-compare__sr-only\">Not included in this version</span>}\n </div>\n </React.Fragment>)}\n </div>;\n}\n\nexport function AgentConfigComparisonPage() {\n const [params] = useSearchParams();\n const navigate = useNavigate();\n const agentId = Number(params.get(\"agentId\"));\n const leftVersionId = Number(params.get(\"leftVersionId\"));\n const rightVersionId = Number(params.get(\"rightVersionId\"));\n const valid = [agentId, leftVersionId, rightVersionId].every((id) => Number.isSafeInteger(id) && id > 0) && leftVersionId !== rightVersionId;\n const [comparison, setComparison] = React.useState<ConfigComparison | null>(null);\n const [error, setError] = React.useState(\"\");\n const [attempt, setAttempt] = React.useState(0);\n React.useEffect(() => {\n let active = true;\n const controller = new AbortController();\n setComparison(null); setError(\"\");\n if (!valid) return;\n void loadConfigComparison({ agentId, leftVersionId, rightVersionId }, controller.signal)\n .then((result) => { if (active) setComparison(result); })\n .catch((reason) => { if (active) setError(reason instanceof Error ? reason.message : \"The comparison could not be loaded.\"); });\n return () => { active = false; controller.abort(); };\n }, [valid, agentId, leftVersionId, rightVersionId, attempt]);\n const back = () => navigate(valid ? `/admin/core/solid-core/agent-registry/editor/${agentId}?tab=config-versions` : \"/admin/core/solid-core/agent-registry/list\");\n if (!comparison) {\n const failed = error || (!valid ? \"Select two different config versions from an agent editor.\" : \"\");\n return <main className=\"config-compare\"><SolidButton variant=\"secondary\" onClick={back}><ArrowLeft size={15} /> Back to agent</SolidButton><div className=\"config-compare__empty\" role={failed ? \"alert\" : \"status\"}>{failed || \"Loading comparison…\"}\n {error && <button type=\"button\" onClick={() => setAttempt((value) => value + 1)}>Retry</button>}</div></main>;\n }\n const { systemPrompt, skills, tools, generalConfiguration, modelConfiguration } = comparison.sections;\n const changedSkills = skills?.rows.filter((row) => row.status !== \"matched\") ?? [];\n const changedTools = tools?.rows.filter((row) => row.status !== \"matched\") ?? [];\n const generalChanges = generalConfiguration?.fields.filter((field) => field.status !== \"matched\") ?? [];\n const modelChanges = modelConfiguration.groups.reduce((total, group) => total + group.fields.filter((field) => field.status !== \"matched\").length, 0);\n const subtitle = comparison.agent.title && comparison.agent.title !== comparison.agent.name ? comparison.agent.title : null;\n return <main className=\"config-compare\">\n <header className=\"config-compare__page-header\"><div><div className=\"config-compare__eyebrow\"><GitCompareArrows size={13} /> Config comparison</div><h1>{comparison.agent.name}</h1>{subtitle && <p>{subtitle}</p>}</div><SolidButton variant=\"secondary\" size=\"sm\" onClick={back}><ArrowLeft size={14} /> Back to agent</SolidButton></header>\n <div className=\"config-compare__sheet\">\n <div className=\"config-compare__version-headers\"><VersionHeader version={comparison.versions.left} side=\"Older\" /><span className=\"config-compare__center\"><span className=\"config-compare__arrow\"><ArrowRight size={14} /></span></span><VersionHeader version={comparison.versions.right} side=\"Newer\" /></div>\n <section className=\"config-compare__section\"><SectionHeader icon={<FileText size={15} />} title={systemPrompt.title} changes={systemPrompt.status === \"matched\" ? 0 : 1} />{systemPrompt.status === \"matched\" ? <p className=\"config-compare__empty\">No changes to persona</p> : <ComparisonRowView comparison={comparison} row={systemPrompt} kind=\"prompt\" />}</section>\n <section className=\"config-compare__section\"><SectionHeader icon={<Puzzle size={15} />} title={skills?.title ?? \"Skills\"} count={skills?.rows.length ? `${changedSkills.length} of ${skills.rows.length}` : undefined} changes={changedSkills.length} />{!skills ? <p className=\"config-compare__empty\">Skill comparison is not available yet.</p> : changedSkills.length ? <div className=\"config-compare__rows\">{changedSkills.map((row) => <ComparisonRowView key={row.id} comparison={comparison} row={row} kind=\"skill\" />)}</div> : <p className=\"config-compare__empty\">No changes to skills</p>}</section>\n <section className=\"config-compare__section\"><SectionHeader icon={<Wrench size={15} />} title={tools?.title ?? \"Tools\"} count={tools?.rows.length ? `${changedTools.length} of ${tools.rows.length}` : undefined} changes={changedTools.length} />{!tools ? <p className=\"config-compare__empty\">Tool comparison is not available yet.</p> : changedTools.length ? <div className=\"config-compare__rows\">{changedTools.map((row) => <ComparisonRowView key={row.id} comparison={comparison} row={row} kind=\"tool\" />)}</div> : <p className=\"config-compare__empty\">No changes to tools</p>}</section>\n <section className=\"config-compare__section\">\n <SectionHeader icon={<Settings size={15} />} title={generalConfiguration?.title ?? \"General configuration\"} changes={generalChanges.length} />\n {!generalConfiguration ? <p className=\"config-compare__empty\">General configuration comparison is not available yet.</p>\n : generalChanges.length ? <div className=\"config-compare__rows\">{generalChanges.map((field) => <div className={`config-compare__row config-compare__general-row is-${field.status}`} key={field.key}>\n <div className=\"config-compare__cell\"><small>{field.label}</small><strong>{field.left ?? field.emptyLabel ?? \"Not set\"}</strong></div>\n <div className=\"config-compare__center\"><StatusMark matched={false} label={field.label} interactive={false} /></div>\n <div className=\"config-compare__cell\"><small>{field.label}</small><strong>{field.right ?? field.emptyLabel ?? \"Not set\"}</strong></div>\n </div>)}</div> : <p className=\"config-compare__empty\">No changes to general configuration</p>}\n </section>\n <section className=\"config-compare__section\"><SectionHeader icon={<Cpu size={15} />} title={modelConfiguration.title} changes={modelChanges} />{modelChanges === 0 ? <p className=\"config-compare__empty\">No changes to model configuration</p> : modelConfiguration.groups.map((group) => <div className=\"config-compare__model-group\" key={group.id}><h3>{group.title}</h3><div className=\"config-compare__rows\">{group.fields.map((field) => <div className={`config-compare__row config-compare__model-row is-${field.status}`} key={field.key}>\n <div className=\"config-compare__cell\"><small>{field.label}</small><strong>{field.left ?? \"—\"}</strong></div><div className=\"config-compare__center\"><StatusMark matched={field.status === \"matched\"} label={field.label} interactive={false} /></div><div className=\"config-compare__cell\"><small>{field.label}</small><strong>{field.right ?? \"—\"}</strong></div>\n </div>)}</div></div>)}</section>\n </div>\n </main>;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ArrowLeft, ArrowRight, Check, CircleHelp, Cpu, EqualNot, FileText, GitCompareArrows, Puzzle, X } from "lucide-react";
|
|
2
|
+
import { ArrowLeft, ArrowRight, Check, CircleHelp, Cpu, EqualNot, FileText, GitCompareArrows, Puzzle, Settings, Wrench, X } from "lucide-react";
|
|
3
3
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
|
4
4
|
import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
|
|
5
5
|
import { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogDescription, SolidDialogHeader, SolidDialogTitle, SolidTooltip, SolidTooltipContent, SolidTooltipTrigger } from "../../../../components/shad-cn-ui";
|
|
@@ -103,15 +103,16 @@ function DiffDialog({ open, onOpenChange, comparison, diffKey, icon, title, subt
|
|
|
103
103
|
</SolidDialog>;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
function ComparisonRowView({ row, comparison, kind }: { row: ComparisonRow; comparison: ConfigComparison; kind: "prompt" | "skill" }) {
|
|
106
|
+
function ComparisonRowView({ row, comparison, kind }: { row: ComparisonRow; comparison: ConfigComparison; kind: "prompt" | "skill" | "tool" }) {
|
|
107
107
|
const [open, setOpen] = React.useState(false);
|
|
108
108
|
const matched = row.status === "matched";
|
|
109
109
|
const label = row.right?.label || row.left?.label || "Configuration";
|
|
110
|
-
const
|
|
110
|
+
const item = kind === "tool" ? "Tool" : "Skill";
|
|
111
|
+
const subtitle = kind === "prompt" ? "System prompt changes" : `${item} ${row.status === "added" ? "added" : row.status === "removed" ? "removed" : "changes"}`;
|
|
111
112
|
return <div className={`config-compare__row is-${row.status}`}>
|
|
112
113
|
{(["left", "right"] as const).map((side) => <React.Fragment key={side}>
|
|
113
114
|
{side === "right" && <div className="config-compare__center"><StatusMark matched={matched} label={label} disabled={!row.diffKey} aria-haspopup="dialog" onClick={() => setOpen(true)} />
|
|
114
|
-
{!matched && row.diffKey && <DiffDialog open={open} onOpenChange={setOpen} comparison={comparison} diffKey={row.diffKey} title={label} subtitle={subtitle} icon={kind === "prompt" ? <FileText size={16} /> : <Puzzle size={16} />} />}</div>}
|
|
115
|
+
{!matched && row.diffKey && <DiffDialog open={open} onOpenChange={setOpen} comparison={comparison} diffKey={row.diffKey} title={label} subtitle={subtitle} icon={kind === "prompt" ? <FileText size={16} /> : kind === "tool" ? <Wrench size={16} /> : <Puzzle size={16} />} />}</div>}
|
|
115
116
|
<div className={`config-compare__cell${!row[side] ? " is-absent" : ""}`}>
|
|
116
117
|
{row[side] ? <><div className="config-compare__cell-title"><strong>{row[side]!.label}</strong>{((side === "right" && row.status === "added") || (side === "left" && row.status === "removed")) && <span className={`config-compare__change-tag is-${row.status}`}>{row.status === "added" ? "Added" : "Removed"}</span>}</div>
|
|
117
118
|
{row[side]!.summary && <p>{row[side]!.summary}</p>}</> : <span className="config-compare__sr-only">Not included in this version</span>}
|
|
@@ -146,8 +147,10 @@ export function AgentConfigComparisonPage() {
|
|
|
146
147
|
return <main className="config-compare"><SolidButton variant="secondary" onClick={back}><ArrowLeft size={15} /> Back to agent</SolidButton><div className="config-compare__empty" role={failed ? "alert" : "status"}>{failed || "Loading comparison…"}
|
|
147
148
|
{error && <button type="button" onClick={() => setAttempt((value) => value + 1)}>Retry</button>}</div></main>;
|
|
148
149
|
}
|
|
149
|
-
const { systemPrompt, skills, modelConfiguration } = comparison.sections;
|
|
150
|
+
const { systemPrompt, skills, tools, generalConfiguration, modelConfiguration } = comparison.sections;
|
|
150
151
|
const changedSkills = skills?.rows.filter((row) => row.status !== "matched") ?? [];
|
|
152
|
+
const changedTools = tools?.rows.filter((row) => row.status !== "matched") ?? [];
|
|
153
|
+
const generalChanges = generalConfiguration?.fields.filter((field) => field.status !== "matched") ?? [];
|
|
151
154
|
const modelChanges = modelConfiguration.groups.reduce((total, group) => total + group.fields.filter((field) => field.status !== "matched").length, 0);
|
|
152
155
|
const subtitle = comparison.agent.title && comparison.agent.title !== comparison.agent.name ? comparison.agent.title : null;
|
|
153
156
|
return <main className="config-compare">
|
|
@@ -156,6 +159,16 @@ export function AgentConfigComparisonPage() {
|
|
|
156
159
|
<div className="config-compare__version-headers"><VersionHeader version={comparison.versions.left} side="Older" /><span className="config-compare__center"><span className="config-compare__arrow"><ArrowRight size={14} /></span></span><VersionHeader version={comparison.versions.right} side="Newer" /></div>
|
|
157
160
|
<section className="config-compare__section"><SectionHeader icon={<FileText size={15} />} title={systemPrompt.title} changes={systemPrompt.status === "matched" ? 0 : 1} />{systemPrompt.status === "matched" ? <p className="config-compare__empty">No changes to persona</p> : <ComparisonRowView comparison={comparison} row={systemPrompt} kind="prompt" />}</section>
|
|
158
161
|
<section className="config-compare__section"><SectionHeader icon={<Puzzle size={15} />} title={skills?.title ?? "Skills"} count={skills?.rows.length ? `${changedSkills.length} of ${skills.rows.length}` : undefined} changes={changedSkills.length} />{!skills ? <p className="config-compare__empty">Skill comparison is not available yet.</p> : changedSkills.length ? <div className="config-compare__rows">{changedSkills.map((row) => <ComparisonRowView key={row.id} comparison={comparison} row={row} kind="skill" />)}</div> : <p className="config-compare__empty">No changes to skills</p>}</section>
|
|
162
|
+
<section className="config-compare__section"><SectionHeader icon={<Wrench size={15} />} title={tools?.title ?? "Tools"} count={tools?.rows.length ? `${changedTools.length} of ${tools.rows.length}` : undefined} changes={changedTools.length} />{!tools ? <p className="config-compare__empty">Tool comparison is not available yet.</p> : changedTools.length ? <div className="config-compare__rows">{changedTools.map((row) => <ComparisonRowView key={row.id} comparison={comparison} row={row} kind="tool" />)}</div> : <p className="config-compare__empty">No changes to tools</p>}</section>
|
|
163
|
+
<section className="config-compare__section">
|
|
164
|
+
<SectionHeader icon={<Settings size={15} />} title={generalConfiguration?.title ?? "General configuration"} changes={generalChanges.length} />
|
|
165
|
+
{!generalConfiguration ? <p className="config-compare__empty">General configuration comparison is not available yet.</p>
|
|
166
|
+
: generalChanges.length ? <div className="config-compare__rows">{generalChanges.map((field) => <div className={`config-compare__row config-compare__general-row is-${field.status}`} key={field.key}>
|
|
167
|
+
<div className="config-compare__cell"><small>{field.label}</small><strong>{field.left ?? field.emptyLabel ?? "Not set"}</strong></div>
|
|
168
|
+
<div className="config-compare__center"><StatusMark matched={false} label={field.label} interactive={false} /></div>
|
|
169
|
+
<div className="config-compare__cell"><small>{field.label}</small><strong>{field.right ?? field.emptyLabel ?? "Not set"}</strong></div>
|
|
170
|
+
</div>)}</div> : <p className="config-compare__empty">No changes to general configuration</p>}
|
|
171
|
+
</section>
|
|
159
172
|
<section className="config-compare__section"><SectionHeader icon={<Cpu size={15} />} title={modelConfiguration.title} changes={modelChanges} />{modelChanges === 0 ? <p className="config-compare__empty">No changes to model configuration</p> : modelConfiguration.groups.map((group) => <div className="config-compare__model-group" key={group.id}><h3>{group.title}</h3><div className="config-compare__rows">{group.fields.map((field) => <div className={`config-compare__row config-compare__model-row is-${field.status}`} key={field.key}>
|
|
160
173
|
<div className="config-compare__cell"><small>{field.label}</small><strong>{field.left ?? "—"}</strong></div><div className="config-compare__center"><StatusMark matched={field.status === "matched"} label={field.label} interactive={false} /></div><div className="config-compare__cell"><small>{field.label}</small><strong>{field.right ?? "—"}</strong></div>
|
|
161
174
|
</div>)}</div></div>)}</section>
|
|
@@ -108,6 +108,8 @@
|
|
|
108
108
|
.agent-editor__icon-button[aria-expanded=true] { color:var(--primary-color,var(--primary)); }
|
|
109
109
|
.agent-editor__icon-button:focus-visible { outline:2px solid var(--primary-color,var(--primary)); outline-offset:1px; }
|
|
110
110
|
.agent-editor__add-dialog { display:flex; flex-direction:column; gap:.6rem; }
|
|
111
|
+
.agent-editor__lookup-search { display:flex; align-items:center; gap:.4rem; }
|
|
112
|
+
.agent-editor__lookup-search > :first-child { flex:1; min-width:0; }
|
|
111
113
|
.agent-editor__add-options { display:flex; flex-direction:column; height:20rem; max-height:50vh; overflow:auto; padding:0 .25rem .25rem; border:1px solid var(--surface-border,var(--border)); border-radius:.55rem; }
|
|
112
114
|
.agent-editor__add-option { display:flex; flex:0 0 auto; align-items:flex-start; gap:.6rem; padding:.5rem .6rem; border-radius:.35rem; cursor:pointer; }
|
|
113
115
|
.agent-editor__add-option:hover { background:var(--surface-hover,#f2f3f4); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentRegistryEditorPage.tsx"],"names":[],"mappings":"AA4BA,OAAO,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentRegistryEditorPage.tsx"],"names":[],"mappings":"AA4BA,OAAO,+BAA+B,CAAC;AA2ZvC,wBAAgB,uBAAuB,4CA+iBtC"}
|
|
@@ -323,9 +323,9 @@ function ResourcePreviewDialog(_a) {
|
|
|
323
323
|
: _jsx(SolidCodeEditor, { value: content, language: "python", readOnly: true, fontSize: 12, height: "min(65vh, 42rem)" }) }) });
|
|
324
324
|
}
|
|
325
325
|
var itemLabel = function (item) { var _a, _b, _c; return String((_c = (_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.displayName) !== null && _b !== void 0 ? _b : item.key) !== null && _c !== void 0 ? _c : ""); };
|
|
326
|
-
var itemMatches = function (item, query) { var _a; return "".concat(itemLabel(item), " ").concat((_a = item.
|
|
326
|
+
var itemMatches = function (item, query) { var _a, _b; return "".concat(itemLabel(item), " ").concat((_a = item.key) !== null && _a !== void 0 ? _a : "", " ").concat((_b = item.description) !== null && _b !== void 0 ? _b : "").toLowerCase().includes(query); };
|
|
327
327
|
function AddLinksDialog(_a) {
|
|
328
|
-
var label = _a.label, options = _a.options, selected = _a.selected, createUrl = _a.createUrl, onClose = _a.onClose, onConfirm = _a.onConfirm;
|
|
328
|
+
var label = _a.label, options = _a.options, selected = _a.selected, createUrl = _a.createUrl, onClose = _a.onClose, onConfirm = _a.onConfirm, onRefresh = _a.onRefresh;
|
|
329
329
|
var _b = React.useState(""), search = _b[0], setSearch = _b[1];
|
|
330
330
|
var _c = React.useState([]), picked = _c[0], setPicked = _c[1];
|
|
331
331
|
var plural = label.toLowerCase();
|
|
@@ -344,17 +344,17 @@ function AddLinksDialog(_a) {
|
|
|
344
344
|
setPicked(function (current) { return allPicked ? current.filter(function (id) { return !ids.includes(id); }) : Array.from(new Set(__spreadArray(__spreadArray([], current, true), ids, true))); });
|
|
345
345
|
};
|
|
346
346
|
return _jsx(SolidDialog, { open: true, onOpenChange: function (next) { if (!next)
|
|
347
|
-
onClose(); }, header: "Add ".concat(plural), style: { width: "min(34rem, 94vw)" }, footer: _jsxs(_Fragment, { children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: onClose, children: "Cancel" }), _jsx(SolidButton, { type: "button", disabled: !picked.length, onClick: function () { onConfirm(picked); onClose(); }, children: picked.length ? "Add ".concat(picked.length, " ").concat(picked.length === 1 ? singular : plural) : "Add ".concat(plural) })] }), children: _jsx(SolidDialogBody, { children: _jsxs("div", { className: "agent-editor__add-dialog", children: [_jsx(SolidInput, { autoFocus: true, value: search, placeholder: "Search ".concat(plural, "\u2026"), "aria-label": "Search ".concat(plural), onChange: function (event) { return setSearch(event.target.value); } }), _jsxs("div", { className: "agent-editor__add-options", role: "group", "aria-label": "Available ".concat(plural), children: [visible.length > 0 && _jsxs("label", { className: "agent-editor__add-option agent-editor__add-option--all", children: [_jsx("input", { type: "checkbox", checked: allPicked, ref: function (element) { if (element)
|
|
347
|
+
onClose(); }, header: "Add ".concat(plural), style: { width: "min(34rem, 94vw)" }, footer: _jsxs(_Fragment, { children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: onClose, children: "Cancel" }), _jsx(SolidButton, { type: "button", disabled: !picked.length, onClick: function () { onConfirm(picked); onClose(); }, children: picked.length ? "Add ".concat(picked.length, " ").concat(picked.length === 1 ? singular : plural) : "Add ".concat(plural) })] }), children: _jsx(SolidDialogBody, { children: _jsxs("div", { className: "agent-editor__add-dialog", children: [_jsxs("div", { className: "agent-editor__lookup-search", children: [_jsx(SolidInput, { autoFocus: true, value: search, placeholder: "Search ".concat(plural, "\u2026"), "aria-label": "Search ".concat(plural), onChange: function (event) { return setSearch(event.target.value); } }), onRefresh && _jsx("button", { type: "button", className: "agent-editor__icon-button", "aria-label": "Refresh ".concat(plural), title: "Refresh ".concat(plural), onClick: onRefresh, children: _jsx(RefreshCw, { size: 15 }) })] }), _jsxs("div", { className: "agent-editor__add-options", role: "group", "aria-label": "Available ".concat(plural), children: [visible.length > 0 && _jsxs("label", { className: "agent-editor__add-option agent-editor__add-option--all", children: [_jsx("input", { type: "checkbox", checked: allPicked, ref: function (element) { if (element)
|
|
348
348
|
element.indeterminate = visiblePicked > 0 && !allPicked; }, onChange: toggleAll }), _jsx("span", { children: _jsxs("strong", { children: ["Select all (", visible.length, ")"] }) })] }), visible.map(function (item) { return _jsxs("label", { className: "agent-editor__add-option", children: [_jsx("input", { type: "checkbox", checked: pickedIds.has(item.id), onChange: function () { return togglePicked(item.id); } }), _jsxs("span", { children: [_jsx("strong", { title: itemLabel(item), children: itemLabel(item) }), item.description && _jsx("small", { title: item.description, children: item.description })] })] }, item.id); }), !visible.length && !canCreate && _jsxs("p", { className: "agent-editor__add-empty", children: ["No available ", plural, " found."] }), canCreate && _jsxs("a", { className: "agent-editor__add-create", href: "".concat(createUrl, "?name=").concat(encodeURIComponent(typedName)), target: "_blank", rel: "noopener noreferrer", children: [_jsx(Plus, { size: 16, "aria-hidden": "true" }), _jsxs("strong", { children: ["Create a new ", singular, " \"", typedName, "\""] }), _jsx(ExternalLink, { size: 14, "aria-hidden": "true" })] })] })] }) }) });
|
|
349
349
|
}
|
|
350
350
|
function LinkPicker(_a) {
|
|
351
|
-
var label = _a.label, description = _a.description, options = _a.options, selected = _a.selected, onAdd = _a.onAdd, onAddMany = _a.onAddMany, onRemove = _a.onRemove, createUrl = _a.createUrl, render = _a.render, renderSettings = _a.renderSettings, linkFor = _a.linkFor, onView = _a.onView, editUrlFor = _a.editUrlFor, compact = _a.compact, view = _a.view, onViewChange = _a.onViewChange, renderRow = _a.renderRow;
|
|
351
|
+
var label = _a.label, description = _a.description, options = _a.options, selected = _a.selected, onAdd = _a.onAdd, onAddMany = _a.onAddMany, onRemove = _a.onRemove, createUrl = _a.createUrl, onRefresh = _a.onRefresh, render = _a.render, renderSettings = _a.renderSettings, linkFor = _a.linkFor, onView = _a.onView, editUrlFor = _a.editUrlFor, compact = _a.compact, view = _a.view, onViewChange = _a.onViewChange, renderRow = _a.renderRow;
|
|
352
352
|
var _b = React.useState(""), search = _b[0], setSearch = _b[1];
|
|
353
353
|
var _c = React.useState(false), open = _c[0], setOpen = _c[1];
|
|
354
354
|
var _d = React.useState(false), searchOpen = _d[0], setSearchOpen = _d[1];
|
|
355
355
|
var _e = React.useState(false), addOpen = _e[0], setAddOpen = _e[1];
|
|
356
356
|
var pickerRef = React.useRef(null);
|
|
357
|
-
var showAssociatedCount = label === "Skills" || label === "Tools";
|
|
357
|
+
var showAssociatedCount = label === "Skills" || label === "Tools" || label === "Secrets";
|
|
358
358
|
var typedName = search.trim();
|
|
359
359
|
var query = typedName.toLowerCase();
|
|
360
360
|
var available = options.filter(function (item) { return !selected.some(function (selectedItem) { return selectedItem.id === item.id; }) && itemMatches(item, query); }).slice(0, 20);
|
|
@@ -387,7 +387,7 @@ function LinkPicker(_a) {
|
|
|
387
387
|
}) : _jsxs("p", { children: ["No available ", label.toLowerCase(), " found."] }) })] }), view && onViewChange && renderRow && _jsxs("div", { className: "agent-editor__view-toggle", role: "group", "aria-label": "".concat(label, " view"), children: [_jsx("button", { type: "button", "aria-label": "List view", title: "List view", "aria-pressed": view === "list", onClick: function () { return onViewChange("list"); }, children: _jsx(List, { size: 16 }) }), _jsx("button", { type: "button", "aria-label": "Card view", title: "Card view", "aria-pressed": view === "card", onClick: function () { return onViewChange("card"); }, children: _jsx(LayoutGrid, { size: 16 }) })] })] }), visibleSelected.length ? _jsx("div", { className: isList ? "agent-editor__list" : "agent-editor__cards", children: visibleSelected.map(function (item) {
|
|
388
388
|
var _a, _b, _c, _d;
|
|
389
389
|
return _jsxs("div", { className: "agent-editor__linked-card".concat(compact || isList ? " agent-editor__linked-card--compact" : ""), children: [_jsx("div", { className: "agent-editor__card-content", children: isList ? renderRow === null || renderRow === void 0 ? void 0 : renderRow(item) : render(item, linkFor === null || linkFor === void 0 ? void 0 : linkFor(item.id)) }), renderSettings === null || renderSettings === void 0 ? void 0 : renderSettings(item, linkFor === null || linkFor === void 0 ? void 0 : linkFor(item.id)), onView && editUrlFor ? _jsxs(SolidDropdownMenu, { children: [_jsx(SolidDropdownMenuTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "agent-editor__resource-menu-trigger", "aria-label": "Actions for ".concat((_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.displayName) !== null && _b !== void 0 ? _b : item.key), children: _jsx(Ellipsis, { size: 18 }) }) }), _jsxs(SolidDropdownMenuContent, { className: "agent-editor__resource-menu", children: [_jsxs(SolidDropdownMenuItem, { onSelect: function () { return onView(item); }, children: [_jsx(Eye, { size: 16 }), " View"] }), item.type !== "solidx" && _jsx(SolidDropdownMenuItem, { asChild: true, children: _jsxs("a", { href: editUrlFor(item), target: "_blank", rel: "noopener noreferrer", children: [_jsx(Pencil, { size: 16 }), " Edit"] }) }), _jsxs(SolidDropdownMenuItem, { className: "agent-editor__resource-delete", onSelect: function () { return onRemove(item.id); }, children: [_jsx(Trash2, { size: 16 }), " Delete"] })] })] }) : _jsx("button", { type: "button", "aria-label": "Remove ".concat((_d = (_c = item.name) !== null && _c !== void 0 ? _c : item.displayName) !== null && _d !== void 0 ? _d : item.key), onClick: function () { return onRemove(item.id); }, children: _jsx(Trash2, { size: 16 }) })] }, item.id);
|
|
390
|
-
}) }) : _jsx("div", { className: "agent-editor__empty", children: selected.length ? "No linked ".concat(label.toLowerCase(), " match \"").concat(typedName, "\".") : "No ".concat(label.toLowerCase(), " linked yet.") }), addOpen && onAddMany && _jsx(AddLinksDialog, { label: label, options: options, selected: selected, createUrl: createUrl, onClose: function () { return setAddOpen(false); }, onConfirm: onAddMany })] });
|
|
390
|
+
}) }) : _jsx("div", { className: "agent-editor__empty", children: selected.length ? "No linked ".concat(label.toLowerCase(), " match \"").concat(typedName, "\".") : "No ".concat(label.toLowerCase(), " linked yet.") }), addOpen && onAddMany && _jsx(AddLinksDialog, { label: label, options: options, selected: selected, createUrl: createUrl, onClose: function () { return setAddOpen(false); }, onConfirm: onAddMany, onRefresh: onRefresh })] });
|
|
391
391
|
}
|
|
392
392
|
export function AgentRegistryEditorPage() {
|
|
393
393
|
var _this = this;
|
|
@@ -695,7 +695,7 @@ export function AgentRegistryEditorPage() {
|
|
|
695
695
|
var save = function (nextStatus, versionDetails) {
|
|
696
696
|
if (versionDetails === void 0) { versionDetails = {}; }
|
|
697
697
|
return __awaiter(_this, void 0, void 0, function () {
|
|
698
|
-
var next, normalizedInputs, payload, newlyCreatedId, scalarSaved, activationAttempted, result, _a, savedId, readyAt, error_1;
|
|
698
|
+
var next, envNames, normalizedInputs, payload, newlyCreatedId, scalarSaved, activationAttempted, result, _a, savedId, readyAt, error_1;
|
|
699
699
|
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
700
700
|
return __generator(this, function (_k) {
|
|
701
701
|
switch (_k.label) {
|
|
@@ -725,9 +725,13 @@ export function AgentRegistryEditorPage() {
|
|
|
725
725
|
next.limits = "Step limits must be positive and cost limit cannot be negative.";
|
|
726
726
|
if (deployment.minProcesses != null && deployment.maxProcesses != null && deployment.minProcesses > deployment.maxProcesses)
|
|
727
727
|
next.deployment = "Minimum processes cannot exceed maximum processes.";
|
|
728
|
+
envNames = secretIds.map(function (id) { var _a; return (_a = secretEnvVarNames[id]) !== null && _a !== void 0 ? _a : ""; });
|
|
729
|
+
if (envNames.some(function (value) { return !/^[A-Za-z_][A-Za-z0-9_]*$/.test(value) || ["APP_ENCRYPTION_KEY", "DATABASE_URL", "AGENT_HUB_MANAGER_INTERNAL_TOKEN", "AGENT_HUB_BRIDGE_PROCESS_KEY"].includes(value); }) || new Set(envNames).size !== envNames.length) {
|
|
730
|
+
next.secrets = "Each linked secret needs a valid, unique environment variable name. Use the pencil icon to update it.";
|
|
731
|
+
}
|
|
728
732
|
setErrors(next);
|
|
729
733
|
if (Object.keys(next).length) {
|
|
730
|
-
setTab(next.systemPrompt ? "persona" : next.limits && isAdmin ? "policies" : "basics");
|
|
734
|
+
setTab(next.secrets ? "secrets" : next.systemPrompt ? "persona" : next.limits && isAdmin ? "policies" : "basics");
|
|
731
735
|
dispatch(showToast({ severity: "error", summary: "Missing information", detail: Object.values(next).join(" ") }));
|
|
732
736
|
return [2 /*return*/, false];
|
|
733
737
|
}
|
|
@@ -896,14 +900,14 @@ export function AgentRegistryEditorPage() {
|
|
|
896
900
|
}) }), _jsx("small", { className: "agent-editor__workflow-save-hint", children: "Changing stage saves the current form and its linked skills, tools, roles, and secrets." })] }), _jsx(AgentDeploymentPanel, { value: deployment, onChange: setDeployment })] }) },
|
|
897
901
|
{ value: "persona", label: "System Prompt", content: _jsxs("section", { className: "agent-editor__section agent-editor__persona", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: "System prompt *" }), _jsx("p", { children: "Describe the agent's role, behavior, and instructions in Markdown." })] }), _jsxs("div", { className: "agent-editor__persona-actions", children: [_jsx("button", { type: "button", className: "agent-editor__persona-preview-toggle", "aria-pressed": previewSystemPrompt, "aria-label": previewSystemPrompt ? "Edit system prompt" : "Preview system prompt", title: previewSystemPrompt ? "Edit system prompt" : "Preview system prompt", onClick: function () { return setPreviewSystemPrompt(function (current) { return !current; }); }, children: previewSystemPrompt ? _jsx(Pencil, { size: 15, "aria-hidden": "true" }) : _jsx(Eye, { size: 15, "aria-hidden": "true" }) }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(AgentPersonaHistory, { agentId: record.id, savedPrompt: (_k = record.systemPrompt) !== null && _k !== void 0 ? _k : "", refreshVersion: auditVersion })] })] }), previewSystemPrompt ? _jsx("div", { className: "agent-editor__persona-preview", role: "region", "aria-label": "System prompt preview", children: systemPrompt.trim() ? _jsx(SolidAgentMarkdown, { text: systemPrompt }) : _jsx("p", { className: "agent-editor__hint", children: "Nothing to preview yet." }) })
|
|
898
902
|
: _jsx(SolidCodeEditor, { value: systemPrompt, onChange: function (value) { setSystemPrompt(value !== null && value !== void 0 ? value : ""); setErrors(function (current) { return (__assign(__assign({}, current), { systemPrompt: "" })); }); }, language: "markdown", wordWrap: "on", fontSize: 11, height: "max(34rem, calc(100dvh - 18rem))" }), errors.systemPrompt && _jsx("small", { className: "agent-editor__error", children: errors.systemPrompt })] }) },
|
|
899
|
-
{ value: "skills", label: "Skills", content: _jsx(LinkPicker, { label: "Skills", description: "Skills available to this agent.", options: skills.records, selected: linked(skillIds, skills.records, items(record === null || record === void 0 ? void 0 : record.agentSkills).map(function (link) { return link.agentSkillRegistry; }).filter(Boolean)), onAddMany: function (ids) { return addAll(setSkillIds, ids); }, onRemove: function (id) { return toggle(setSkillIds, id); }, createUrl: "/admin/core/solid-core/agent-skill-registry/editor/new", onView: function (item) { return setPreview({ item: item, kind: "skill" }); }, editUrlFor: function (item) { return "/admin/core/solid-core/agent-skill-registry/editor/".concat(item.id); }, linkFor: function (id) { return linkForTarget(record === null || record === void 0 ? void 0 : record.agentSkills, "agentSkillRegistry", id); }, view: resourceView, onViewChange: setResourceView, renderRow: function (item) { return _jsx(AgentResourceRowWidget, { rowData: item }); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
|
|
903
|
+
{ value: "skills", label: "Skills", content: _jsx(LinkPicker, { label: "Skills", description: "Skills available to this agent.", options: skills.records, selected: linked(skillIds, skills.records, items(record === null || record === void 0 ? void 0 : record.agentSkills).map(function (link) { return link.agentSkillRegistry; }).filter(Boolean)), onRefresh: function () { return void skills.refetch(); }, onAddMany: function (ids) { return addAll(setSkillIds, ids); }, onRemove: function (id) { return toggle(setSkillIds, id); }, createUrl: "/admin/core/solid-core/agent-skill-registry/editor/new", onView: function (item) { return setPreview({ item: item, kind: "skill" }); }, editUrlFor: function (item) { return "/admin/core/solid-core/agent-skill-registry/editor/".concat(item.id); }, linkFor: function (id) { return linkForTarget(record === null || record === void 0 ? void 0 : record.agentSkills, "agentSkillRegistry", id); }, view: resourceView, onViewChange: setResourceView, renderRow: function (item) { return _jsx(AgentResourceRowWidget, { rowData: item }); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
|
|
900
904
|
var _a;
|
|
901
905
|
return _jsx("div", { className: "agent-editor__link-settings", children: linkSetting("Always include", (_a = alwaysIncludeValues[item.id]) !== null && _a !== void 0 ? _a : true, function (checked) { return setAlwaysIncludeValues(function (current) {
|
|
902
906
|
var _a;
|
|
903
907
|
return (__assign(__assign({}, current), (_a = {}, _a[item.id] = checked, _a)));
|
|
904
908
|
}); }, "Add the full skill to the agent prompt. Turn off to load it on demand.") });
|
|
905
909
|
} }) },
|
|
906
|
-
{ value: "tools", label: "Tools", content: _jsx(LinkPicker, { label: "Tools", description: "Tools available to this agent.", options: tools.records, selected: linked(toolIds, tools.records, items(record === null || record === void 0 ? void 0 : record.agentTools).map(function (link) { return link.agentToolRegistry; }).filter(Boolean)), onAddMany: function (ids) { return addAll(setToolIds, ids); }, onRemove: function (id) { return toggle(setToolIds, id); }, createUrl: "/admin/core/solid-core/agent-tool-registry/editor/new", onView: function (item) { return setPreview({ item: item, kind: "tool" }); }, editUrlFor: function (item) { return "/admin/core/solid-core/agent-tool-registry/editor/".concat(item.id); }, linkFor: function (id) { return linkForTarget(record === null || record === void 0 ? void 0 : record.agentTools, "agentToolRegistry", id); }, view: resourceView, onViewChange: setResourceView, renderRow: function (item) { return _jsx(AgentResourceRowWidget, { rowData: item }); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
|
|
910
|
+
{ value: "tools", label: "Tools", content: _jsx(LinkPicker, { label: "Tools", description: "Tools available to this agent.", options: tools.records, selected: linked(toolIds, tools.records, items(record === null || record === void 0 ? void 0 : record.agentTools).map(function (link) { return link.agentToolRegistry; }).filter(Boolean)), onRefresh: function () { return void tools.refetch(); }, onAddMany: function (ids) { return addAll(setToolIds, ids); }, onRemove: function (id) { return toggle(setToolIds, id); }, createUrl: "/admin/core/solid-core/agent-tool-registry/editor/new", onView: function (item) { return setPreview({ item: item, kind: "tool" }); }, editUrlFor: function (item) { return "/admin/core/solid-core/agent-tool-registry/editor/".concat(item.id); }, linkFor: function (id) { return linkForTarget(record === null || record === void 0 ? void 0 : record.agentTools, "agentToolRegistry", id); }, view: resourceView, onViewChange: setResourceView, renderRow: function (item) { return _jsx(AgentResourceRowWidget, { rowData: item }); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
|
|
907
911
|
var _a;
|
|
908
912
|
return _jsx("div", { className: "agent-editor__link-settings", children: linkSetting("Require approval", (_a = requiresApprovalValues[item.id]) !== null && _a !== void 0 ? _a : false, function (checked) { return setRequiresApprovalValues(function (current) {
|
|
909
913
|
var _a;
|
|
@@ -917,8 +921,14 @@ export function AgentRegistryEditorPage() {
|
|
|
917
921
|
var label = _a[0], value = _a[1], setter = _a[2];
|
|
918
922
|
return _jsxs("label", { className: "agent-editor__field", children: [_jsx("span", { children: label }), _jsx("input", { type: "number", min: label === "Cost limit" ? 0 : 1, step: label === "Cost limit" ? 0.01 : 1, value: value, onChange: function (event) { return setter(Number(event.target.value)); } }), label === "Cost limit" && _jsx("small", { className: "agent-editor__hint", children: "Cost is an estimate and is not guaranteed to be correct." })] }, label);
|
|
919
923
|
}) }), errors.limits && _jsx("small", { className: "agent-editor__error", children: errors.limits })] })] }) },
|
|
920
|
-
{ value: "secrets", label: "Secrets", content: _jsx(LinkPicker, { label: "Secrets", description: "Grant access to existing secrets. Secret values are never shown here.", options: secrets.records, selected: linked(secretIds, secrets.records, items(record === null || record === void 0 ? void 0 : record.agentSecrets).map(function (link) { return link.secret; }).filter(Boolean)),
|
|
921
|
-
|
|
924
|
+
{ value: "secrets", label: "Secrets", content: _jsx(LinkPicker, { label: "Secrets", description: "Grant access to existing secrets. Secret values are never shown here.", options: secrets.records, selected: linked(secretIds, secrets.records, items(record === null || record === void 0 ? void 0 : record.agentSecrets).map(function (link) { return link.secret; }).filter(Boolean)), onRefresh: function () { return void secrets.refetch(); }, onAddMany: function (ids) { ids.forEach(function (secretId) { var secret = secrets.records.find(function (item) { return item.id === secretId; }); if (secret) {
|
|
925
|
+
setSecretIds(function (current) { return Array.from(new Set(__spreadArray(__spreadArray([], current, true), [secretId], false))); });
|
|
926
|
+
setSecretEnvVarNames(function (current) {
|
|
927
|
+
var _a;
|
|
928
|
+
var _b, _c, _d;
|
|
929
|
+
return (__assign(__assign({}, current), (_a = {}, _a[secretId] = String((_d = (_c = (_b = secret.key) !== null && _b !== void 0 ? _b : secret.name) !== null && _c !== void 0 ? _c : secret.displayName) !== null && _d !== void 0 ? _d : ""), _a)));
|
|
930
|
+
});
|
|
931
|
+
} }); }, createUrl: "/admin/core/solid-core/secret/form/new", onRemove: function (id) { return toggle(setSecretIds, id); }, compact: true, renderSettings: function () { return errors.secrets ? _jsx("small", { className: "agent-editor__error", children: errors.secrets }) : null; }, render: function (item) {
|
|
922
932
|
var _a, _b, _c, _d, _e;
|
|
923
933
|
return _jsxs("div", { className: "agent-editor__secret", children: [_jsx("strong", { title: (_b = (_a = item.displayName) !== null && _a !== void 0 ? _a : item.name) !== null && _b !== void 0 ? _b : item.key, children: (_d = (_c = item.displayName) !== null && _c !== void 0 ? _c : item.name) !== null && _d !== void 0 ? _d : item.key }), _jsx("button", { type: "button", "aria-label": "Edit environment variable name for ".concat((_e = item.displayName) !== null && _e !== void 0 ? _e : item.key), onClick: function () { return beginSecretEnvVarEdit(item); }, children: _jsx(Pencil, { size: 16 }) })] });
|
|
924
934
|
} }) }
|