@solidxai/core-ui 0.1.22-beta.1 → 0.1.22-beta.3
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/components/core/chatter/SolidChatterCustomMessage.d.ts.map +1 -1
- package/dist/components/core/chatter/SolidChatterCustomMessage.js +17 -5
- package/dist/components/core/chatter/SolidChatterCustomMessage.js.map +1 -1
- package/dist/components/core/chatter/SolidChatterCustomMessage.tsx +23 -6
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +27 -24
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +14 -7
- package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.js +28 -22
- package/dist/components/core/module/ModulePackageDialog.js.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.tsx +24 -2
- package/dist/resources/globals.css +10 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +5 -0
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +67 -57
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +14 -5
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.css +29 -0
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +10 -8
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +10 -5
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +38 -25
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +8 -3
- package/package.json +1 -1
|
@@ -293,6 +293,7 @@ export function ModulePackageImportContent({
|
|
|
293
293
|
const [transactionKey, setTransactionKey] = useState<string | null>(null);
|
|
294
294
|
const [overwriteExisting, setOverwriteExisting] = useState(false);
|
|
295
295
|
const [acknowledgeVersionChange, setAcknowledgeVersionChange] = useState(false);
|
|
296
|
+
const [acknowledgeLocalChanges, setAcknowledgeLocalChanges] = useState(false);
|
|
296
297
|
const [pruneOnSeed, setPruneOnSeed] = useState(false);
|
|
297
298
|
const [showAllFiles, setShowAllFiles] = useState(false);
|
|
298
299
|
const [isRestoreConfirmOpen, setRestoreConfirmOpen] = useState(false);
|
|
@@ -352,7 +353,10 @@ export function ModulePackageImportContent({
|
|
|
352
353
|
const versionComparison = previewResponse?.versionComparison ?? previewResponse?.preview?.versionComparison ?? null;
|
|
353
354
|
const requiresVersionAcknowledgement = Boolean(previewResponse?.preview?.requiresVersionAcknowledgement);
|
|
354
355
|
// Clicking the Update button approves the shown version; risky updates also need an explicit acknowledgement.
|
|
355
|
-
|
|
356
|
+
// Package files edited since the last install are replaced by the update; the user has to confirm that too.
|
|
357
|
+
const locallyModifiedReplaced: string[] = previewResponse?.preview?.fileSync?.locallyModifiedReplaced ?? [];
|
|
358
|
+
const isUpdateApproved = !isUpdate
|
|
359
|
+
|| ((!requiresVersionAcknowledgement || acknowledgeVersionChange) && (locallyModifiedReplaced.length === 0 || acknowledgeLocalChanges));
|
|
356
360
|
const backup = previewResponse?.backup ?? null;
|
|
357
361
|
|
|
358
362
|
const canImport = steps.preview.status !== "pending" && isArchiveValid && isUpdateApproved && steps.import.status !== "success" && !isProcessing && !isPreviewing;
|
|
@@ -411,6 +415,7 @@ export function ModulePackageImportContent({
|
|
|
411
415
|
setTransactionKey(response?.transactionKey ?? null);
|
|
412
416
|
setOverwriteExisting(false);
|
|
413
417
|
setAcknowledgeVersionChange(false);
|
|
418
|
+
setAcknowledgeLocalChanges(false);
|
|
414
419
|
setShowAllFiles(false);
|
|
415
420
|
setFinalSummary(null);
|
|
416
421
|
setSteps(hydrateStepsFromTransaction(response, fallbackMode));
|
|
@@ -616,7 +621,7 @@ export function ModulePackageImportContent({
|
|
|
616
621
|
|
|
617
622
|
const response = await confirmModulePackageImport(
|
|
618
623
|
isUpdate
|
|
619
|
-
? { transactionKey, confirmedVersion: incomingVersion, acknowledgeVersionChange }
|
|
624
|
+
? { transactionKey, confirmedVersion: incomingVersion, acknowledgeVersionChange, acknowledgeLocalChanges }
|
|
620
625
|
: { transactionKey, overwriteExisting },
|
|
621
626
|
).unwrap();
|
|
622
627
|
|
|
@@ -807,6 +812,7 @@ export function ModulePackageImportContent({
|
|
|
807
812
|
setTransactionKey(null);
|
|
808
813
|
setOverwriteExisting(false);
|
|
809
814
|
setAcknowledgeVersionChange(false);
|
|
815
|
+
setAcknowledgeLocalChanges(false);
|
|
810
816
|
setFinalSummary(null);
|
|
811
817
|
setSelectedStep("preview");
|
|
812
818
|
setSteps(createInitialSteps(fallbackMode));
|
|
@@ -846,6 +852,22 @@ export function ModulePackageImportContent({
|
|
|
846
852
|
|
|
847
853
|
<div className="solid-module-package-checklist">
|
|
848
854
|
{isUpdate ? renderVersionApproval() : null}
|
|
855
|
+
|
|
856
|
+
{isUpdate && isArchiveValid && locallyModifiedReplaced.length > 0 ? (
|
|
857
|
+
<div className="solid-module-package-notice is-warning">
|
|
858
|
+
<div className="solid-module-package-notice__title">Files changed locally will be replaced</div>
|
|
859
|
+
<ul className="solid-module-package-inline-list">
|
|
860
|
+
{locallyModifiedReplaced.map((file) => (
|
|
861
|
+
<li key={file}>{file}</li>
|
|
862
|
+
))}
|
|
863
|
+
</ul>
|
|
864
|
+
<SolidCheckbox
|
|
865
|
+
checked={acknowledgeLocalChanges}
|
|
866
|
+
onChange={(event) => setAcknowledgeLocalChanges(event.currentTarget.checked)}
|
|
867
|
+
label="I understand these files will be replaced. The backup keeps my versions."
|
|
868
|
+
/>
|
|
869
|
+
</div>
|
|
870
|
+
) : null}
|
|
849
871
|
{isUpdate ? renderChangeSummary() : null}
|
|
850
872
|
|
|
851
873
|
<div className="solid-module-package-checklist__section">
|
|
@@ -1932,6 +1932,15 @@ li.header-li-px {
|
|
|
1932
1932
|
padding: 0 1px 3px;
|
|
1933
1933
|
}
|
|
1934
1934
|
|
|
1935
|
+
.kanban-column:not(.kanban-column-folded) > .kaban-heading-area {
|
|
1936
|
+
position: sticky;
|
|
1937
|
+
top: 0;
|
|
1938
|
+
z-index: 5;
|
|
1939
|
+
min-height: 36px;
|
|
1940
|
+
padding: 8px 6px;
|
|
1941
|
+
background: var(--card);
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1935
1944
|
.solid-kanban-lane-selection {
|
|
1936
1945
|
display: flex;
|
|
1937
1946
|
align-items: center;
|
|
@@ -5596,7 +5605,7 @@ flex-shrink: 0; */
|
|
|
5596
5605
|
}
|
|
5597
5606
|
|
|
5598
5607
|
.solid-kanban-board-scroll-context {
|
|
5599
|
-
align-items:
|
|
5608
|
+
align-items: stretch;
|
|
5600
5609
|
overflow: visible;
|
|
5601
5610
|
flex: 0 0 auto;
|
|
5602
5611
|
width: max-content;
|
|
@@ -76,6 +76,11 @@
|
|
|
76
76
|
.agent-editor__test-chat { width:100%; height:100%!important; border:0!important; border-radius:0!important; }
|
|
77
77
|
.agent-editor__persona { padding:0; overflow:hidden; }
|
|
78
78
|
.agent-editor__persona .agent-editor__section-head { padding:1rem; }
|
|
79
|
+
.agent-editor__persona-actions { display:flex; align-items:center; gap:.4rem; flex:0 0 auto; }
|
|
80
|
+
.agent-editor__persona-preview-toggle { display:inline-flex; align-items:center; justify-content:center; width:2.15rem; height:2.15rem; padding:0; border:1px solid var(--surface-border,var(--border)); border-radius:.6rem; background:var(--surface-card,var(--card)); color:var(--text-color-secondary,var(--muted-foreground)); cursor:pointer; }
|
|
81
|
+
.agent-editor__persona-preview-toggle:hover,.agent-editor__persona-preview-toggle[aria-pressed="true"] { border-color:color-mix(in srgb,var(--primary-color,var(--primary)) 42%,var(--surface-border,var(--border))); background:color-mix(in srgb,var(--primary-color,var(--primary)) 7%,var(--surface-card,var(--card))); color:var(--primary-color,var(--primary)); }
|
|
82
|
+
.agent-editor__persona-preview-toggle:focus-visible { outline:2px solid var(--primary-color,var(--primary)); outline-offset:2px; }
|
|
83
|
+
.agent-editor__persona-preview { box-sizing:border-box; min-height:max(34rem,calc(100dvh - 18rem)); padding:1.25rem; border-top:1px solid var(--surface-border,var(--border)); background:var(--surface-ground,var(--background)); }
|
|
79
84
|
.agent-editor__persona .agent-editor__error { padding:0 1rem; }
|
|
80
85
|
.agent-editor__picker { position:relative; max-width:32rem; }
|
|
81
86
|
.agent-editor__picker-results { position:absolute; z-index:20; top:100%; left:0; right:0; max-height:18rem; overflow:auto; margin-top:.2rem; padding:.3rem; border:1px solid var(--surface-border,var(--border)); border-radius:.55rem; background:var(--surface-card,var(--card)); box-shadow:0 8px 24px #0002; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentRegistryEditorPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentRegistryEditorPage.tsx"],"names":[],"mappings":"AA2BA,OAAO,+BAA+B,CAAC;AA6TvC,wBAAgB,uBAAuB,4CA4hBtC"}
|
|
@@ -62,6 +62,8 @@ import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
|
62
62
|
import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
|
|
63
63
|
import { solidPost } from "../../../../http/solidHttp";
|
|
64
64
|
import { useGetSolidSettingsQuery } from "../../../../redux/api/solidSettingsApi";
|
|
65
|
+
import { hasAnyRole } from "../../../../helpers/rolesHelper";
|
|
66
|
+
import { useSession } from "../../../../hooks/useSession";
|
|
65
67
|
import { getSettingsMap } from "../../../../helpers/settingsPayload";
|
|
66
68
|
import { showToast } from "../../../../redux/features/toastSlice";
|
|
67
69
|
import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
|
|
@@ -336,8 +338,10 @@ function LinkPicker(_a) {
|
|
|
336
338
|
}
|
|
337
339
|
export function AgentRegistryEditorPage() {
|
|
338
340
|
var _this = this;
|
|
339
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
340
|
-
var
|
|
341
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
342
|
+
var _u = useParams().id, id = _u === void 0 ? "new" : _u;
|
|
343
|
+
var session = useSession().data;
|
|
344
|
+
var isAdmin = hasAnyRole((_a = session === null || session === void 0 ? void 0 : session.user) === null || _a === void 0 ? void 0 : _a.roles, ["Admin"]);
|
|
341
345
|
var searchParams = useSearchParams()[0];
|
|
342
346
|
var navigate = useNavigate();
|
|
343
347
|
var dispatch = useDispatch();
|
|
@@ -353,13 +357,13 @@ export function AgentRegistryEditorPage() {
|
|
|
353
357
|
return undefined;
|
|
354
358
|
return __assign(__assign({}, agent), { agentSkills: resourceLinksFrom(skillLinks.currentData, "agentSkills", "agentSkillRegistry", "alwaysInclude", skillFields), agentTools: resourceLinksFrom(toolLinks.currentData, "agentTools", "agentToolRegistry", "requiresApproval", toolFields) });
|
|
355
359
|
}, [agentResult.currentData, skillLinks.currentData, toolLinks.currentData]);
|
|
356
|
-
var
|
|
360
|
+
var _v = useGetSolidSettingsQuery(undefined), settings = _v.data, settingsError = _v.isError;
|
|
357
361
|
var skills = useCatalog(skillApi, "offset=0&limit=1000&populate[0]=tags&".concat(fieldsQuery(skillFields)));
|
|
358
362
|
var tools = useCatalog(toolApi, "offset=0&limit=1000&populate[0]=tags&".concat(fieldsQuery(toolFields)));
|
|
359
363
|
var roles = useCatalog(roleApi, "offset=0&limit=1000&populate[0]=module");
|
|
360
364
|
var secrets = useCatalog(secretApi, "offset=0&limit=1000&fields[0]=id&fields[1]=key&fields[2]=displayName&fields[3]=description");
|
|
361
|
-
var
|
|
362
|
-
var
|
|
365
|
+
var _w = entityApi.useCreateSolidEntityMutation(), createAgent = _w[0], creating = _w[1].isLoading;
|
|
366
|
+
var _x = entityApi.useUpdateSolidEntityMutation(), updateAgent = _x[0], updating = _x[1].isLoading;
|
|
363
367
|
var createSkillLink = agentSkillApi.useCreateSolidEntityMutation()[0];
|
|
364
368
|
var deleteSkillLink = agentSkillApi.useDeleteSolidEntityMutation()[0];
|
|
365
369
|
var updateSkillLink = agentSkillApi.useUpdateSolidEntityMutation()[0];
|
|
@@ -372,7 +376,8 @@ export function AgentRegistryEditorPage() {
|
|
|
372
376
|
var deleteSecretLink = agentSecretApi.useDeleteSolidEntityMutation()[0];
|
|
373
377
|
var updateSecretLink = agentSecretApi.useUpdateSolidEntityMutation()[0];
|
|
374
378
|
var record = recordFrom(response);
|
|
375
|
-
var
|
|
379
|
+
var _y = React.useState(searchParams.get("tab") === "config-versions" ? "config-versions" : "basics"), tab = _y[0], setTab = _y[1];
|
|
380
|
+
var _z = React.useState(false), previewSystemPrompt = _z[0], setPreviewSystemPrompt = _z[1];
|
|
376
381
|
var jobs = jobApi.useGetSolidEntitiesQuery("offset=0&limit=1000&filters[agent][id][$eq]=".concat(encodeURIComponent(id), "&").concat(fieldsQuery(["id", "status"])), { skip: id === "new" || tab !== "jobs" });
|
|
377
382
|
var refetch = function () {
|
|
378
383
|
void agentResult.refetch();
|
|
@@ -408,43 +413,43 @@ export function AgentRegistryEditorPage() {
|
|
|
408
413
|
// ignore
|
|
409
414
|
}
|
|
410
415
|
};
|
|
411
|
-
var
|
|
412
|
-
var
|
|
413
|
-
var
|
|
414
|
-
var
|
|
415
|
-
var
|
|
416
|
-
var
|
|
417
|
-
var
|
|
418
|
-
var
|
|
419
|
-
var
|
|
420
|
-
var
|
|
421
|
-
var
|
|
422
|
-
var
|
|
423
|
-
var
|
|
424
|
-
var
|
|
425
|
-
var
|
|
426
|
-
var
|
|
427
|
-
var
|
|
428
|
-
var
|
|
429
|
-
var
|
|
430
|
-
var
|
|
431
|
-
var
|
|
432
|
-
var
|
|
433
|
-
var
|
|
434
|
-
var
|
|
435
|
-
var
|
|
436
|
-
var
|
|
437
|
-
var
|
|
438
|
-
var
|
|
439
|
-
var
|
|
440
|
-
var
|
|
441
|
-
var
|
|
442
|
-
var
|
|
443
|
-
var
|
|
444
|
-
var
|
|
445
|
-
var
|
|
446
|
-
var
|
|
447
|
-
var
|
|
416
|
+
var _0 = React.useState(function () { return readTestAgentPrefs(id).open; }), testAgentOpen = _0[0], setTestAgentOpen = _0[1];
|
|
417
|
+
var _1 = React.useState(null), preview = _1[0], setPreview = _1[1];
|
|
418
|
+
var _2 = React.useState(function () { return readTestAgentPrefs(id).mode; }), testAgentWindowMode = _2[0], setTestAgentWindowMode = _2[1];
|
|
419
|
+
var _3 = React.useState(""), name = _3[0], setName = _3[1];
|
|
420
|
+
var _4 = React.useState(""), title = _4[0], setTitle = _4[1];
|
|
421
|
+
var _5 = React.useState(""), description = _5[0], setDescription = _5[1];
|
|
422
|
+
var _6 = React.useState(""), iconName = _6[0], setIconName = _6[1];
|
|
423
|
+
var _7 = React.useState([]), inputs = _7[0], setInputs = _7[1];
|
|
424
|
+
var _8 = React.useState(""), reasoningModelKey = _8[0], setReasoningModelKey = _8[1];
|
|
425
|
+
var _9 = React.useState(""), fastModelKey = _9[0], setFastModelKey = _9[1];
|
|
426
|
+
var _10 = React.useState(""), systemPrompt = _10[0], setSystemPrompt = _10[1];
|
|
427
|
+
var _11 = React.useState(100), stepLimit = _11[0], setStepLimit = _11[1];
|
|
428
|
+
var _12 = React.useState(20), turnStepLimit = _12[0], setTurnStepLimit = _12[1];
|
|
429
|
+
var _13 = React.useState(3), costLimit = _13[0], setCostLimit = _13[1];
|
|
430
|
+
var _14 = React.useState([]), tags = _14[0], setTags = _14[1];
|
|
431
|
+
var _15 = React.useState(null), module = _15[0], setModule = _15[1];
|
|
432
|
+
var _16 = React.useState(false), creatingTag = _16[0], setCreatingTag = _16[1];
|
|
433
|
+
var _17 = React.useState([]), skillIds = _17[0], setSkillIds = _17[1];
|
|
434
|
+
var _18 = React.useState([]), toolIds = _18[0], setToolIds = _18[1];
|
|
435
|
+
var _19 = React.useState([]), roleIds = _19[0], setRoleIds = _19[1];
|
|
436
|
+
var _20 = React.useState([]), secretIds = _20[0], setSecretIds = _20[1];
|
|
437
|
+
var _21 = React.useState({}), alwaysIncludeValues = _21[0], setAlwaysIncludeValues = _21[1];
|
|
438
|
+
var _22 = React.useState({}), requiresApprovalValues = _22[0], setRequiresApprovalValues = _22[1];
|
|
439
|
+
var _23 = React.useState({}), secretEnvVarNames = _23[0], setSecretEnvVarNames = _23[1];
|
|
440
|
+
var _24 = React.useState(null), pendingSecret = _24[0], setPendingSecret = _24[1];
|
|
441
|
+
var _25 = React.useState(""), secretEnvVarDraft = _25[0], setSecretEnvVarDraft = _25[1];
|
|
442
|
+
var _26 = React.useState(""), secretEnvVarError = _26[0], setSecretEnvVarError = _26[1];
|
|
443
|
+
var _27 = React.useState({}), errors = _27[0], setErrors = _27[1];
|
|
444
|
+
var _28 = React.useState(0), auditVersion = _28[0], setAuditVersion = _28[1];
|
|
445
|
+
var _29 = React.useState(false), confirmRefresh = _29[0], setConfirmRefresh = _29[1];
|
|
446
|
+
var _30 = React.useState(false), activateDialogOpen = _30[0], setActivateDialogOpen = _30[1];
|
|
447
|
+
var _31 = React.useState(false), includeVersionDetails = _31[0], setIncludeVersionDetails = _31[1];
|
|
448
|
+
var _32 = React.useState(""), versionName = _32[0], setVersionName = _32[1];
|
|
449
|
+
var _33 = React.useState(""), versionDescription = _33[0], setVersionDescription = _33[1];
|
|
450
|
+
var _34 = React.useState(false), activating = _34[0], setActivating = _34[1];
|
|
451
|
+
var _35 = React.useState(function () { return id === "new" ? null : savedActivationReadyAt(id); }), activationReadyAt = _35[0], setActivationReadyAt = _35[1];
|
|
452
|
+
var _36 = React.useState(Date.now()), countdownNow = _36[0], setCountdownNow = _36[1];
|
|
448
453
|
var baseline = React.useRef("");
|
|
449
454
|
React.useEffect(function () {
|
|
450
455
|
if (id === "new") {
|
|
@@ -536,13 +541,13 @@ export function AgentRegistryEditorPage() {
|
|
|
536
541
|
var configValue = getSettingsMap(settings).solidXGenAiCodeBuilderConfig;
|
|
537
542
|
var aiConfig = {};
|
|
538
543
|
try {
|
|
539
|
-
aiConfig = (
|
|
544
|
+
aiConfig = (_b = (typeof configValue === "string" ? JSON.parse(configValue) : configValue)) !== null && _b !== void 0 ? _b : {};
|
|
540
545
|
}
|
|
541
|
-
catch ( /* Invalid configuration has no enabled providers. */
|
|
546
|
+
catch ( /* Invalid configuration has no enabled providers. */_37) { /* Invalid configuration has no enabled providers. */ }
|
|
542
547
|
var modelsCatalog = useModelsDevCatalog().catalog;
|
|
543
548
|
var savedModelKeys = [record === null || record === void 0 ? void 0 : record.reasoningModelKey, record === null || record === void 0 ? void 0 : record.fastModelKey].filter(function (key) { return !!key; });
|
|
544
|
-
var modelOptions = buildModelOptions((
|
|
545
|
-
var providerOptions = Object.entries((
|
|
549
|
+
var modelOptions = buildModelOptions((_c = aiConfig.providers) !== null && _c !== void 0 ? _c : {}, { Reasoning: (_e = (_d = aiConfig.models) === null || _d === void 0 ? void 0 : _d.default) !== null && _e !== void 0 ? _e : (_f = aiConfig.models) === null || _f === void 0 ? void 0 : _f.main, Fast: (_g = aiConfig.models) === null || _g === void 0 ? void 0 : _g.fast }, modelsCatalog, savedModelKeys);
|
|
550
|
+
var providerOptions = Object.entries((_h = aiConfig.providers) !== null && _h !== void 0 ? _h : {})
|
|
546
551
|
.filter(function (_a) {
|
|
547
552
|
var entry = _a[1];
|
|
548
553
|
return typeof (entry === null || entry === void 0 ? void 0 : entry.apiKey) === "string" && entry.apiKey.trim().length > 0;
|
|
@@ -660,7 +665,7 @@ export function AgentRegistryEditorPage() {
|
|
|
660
665
|
next.limits = "Step limits must be positive and cost limit cannot be negative.";
|
|
661
666
|
setErrors(next);
|
|
662
667
|
if (Object.keys(next).length) {
|
|
663
|
-
setTab(next.systemPrompt ? "persona" : next.limits ? "policies" : "basics");
|
|
668
|
+
setTab(next.systemPrompt ? "persona" : next.limits && isAdmin ? "policies" : "basics");
|
|
664
669
|
dispatch(showToast({ severity: "error", summary: "Missing information", detail: Object.values(next).join(" ") }));
|
|
665
670
|
return [2 /*return*/, false];
|
|
666
671
|
}
|
|
@@ -798,7 +803,7 @@ export function AgentRegistryEditorPage() {
|
|
|
798
803
|
var linkSetting = function (label, checked, onChange, hint) {
|
|
799
804
|
return _jsxs("label", { className: "agent-editor__link-setting", children: [_jsx("input", { type: "checkbox", checked: checked, onChange: function (event) { return onChange(event.target.checked); } }), _jsxs("span", { children: [_jsx("strong", { children: label }), _jsx("small", { children: hint })] })] });
|
|
800
805
|
};
|
|
801
|
-
var agentStatus = (
|
|
806
|
+
var agentStatus = (_j = record === null || record === void 0 ? void 0 : record.status) !== null && _j !== void 0 ? _j : "draft";
|
|
802
807
|
var activationRemainingMs = Math.max(0, (activationReadyAt !== null && activationReadyAt !== void 0 ? activationReadyAt : 0) - countdownNow);
|
|
803
808
|
var activationRemainingSeconds = Math.ceil(activationRemainingMs / 1000);
|
|
804
809
|
var activationWaiting = agentStatus === "draft" && activationRemainingSeconds > 0;
|
|
@@ -827,7 +832,8 @@ export function AgentRegistryEditorPage() {
|
|
|
827
832
|
void save(value);
|
|
828
833
|
}, children: [value === "active" && activationWaiting ? _jsxs("span", { className: "agent-editor__activation-countdown", "aria-label": "Active available in ".concat(activationRemainingSeconds, " seconds"), children: [_jsxs("svg", { viewBox: "0 0 36 36", "aria-hidden": "true", children: [_jsx("circle", { className: "agent-editor__activation-countdown-track", cx: "18", cy: "18", r: "15" }), _jsx("circle", { className: "agent-editor__activation-countdown-progress", cx: "18", cy: "18", r: "15", pathLength: "100", strokeDasharray: "100", strokeDashoffset: 100 - activationRemainingMs / ACTIVATION_WAIT_MS * 100 })] }), _jsx("span", { children: activationRemainingSeconds })] }) : _jsx("span", { className: "agent-editor__workflow-stage-mark", children: index + 1 }), _jsxs("div", { className: "agent-editor__workflow-stage-copy", children: [_jsx("strong", { children: label }), _jsx("small", { children: description }), _jsx("small", { className: "agent-editor__workflow-stage-cta", children: agentStatus === value ? "Current stage" : value === "active" && activationWaiting ? "Available in ".concat(activationRemainingSeconds, "s") : "Click to move to this stage" })] }), agentStatus === value && _jsx("span", { className: "agent-editor__workflow-current", children: "Current" })] })] }, value);
|
|
829
834
|
}) }), _jsx("small", { className: "agent-editor__workflow-save-hint", children: "Changing stage saves the current form and its linked skills, tools, roles, and secrets." })] })] }) },
|
|
830
|
-
{ 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." })] }), (
|
|
835
|
+
{ 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." }) })
|
|
836
|
+
: _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 })] }) },
|
|
831
837
|
{ 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)), onAdd: function (id) { return toggle(setSkillIds, id); }, 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); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
|
|
832
838
|
var _a;
|
|
833
839
|
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) {
|
|
@@ -854,16 +860,20 @@ export function AgentRegistryEditorPage() {
|
|
|
854
860
|
var _a, _b, _c, _d, _e, _f;
|
|
855
861
|
return _jsxs("div", { className: "agent-editor__secret", children: [_jsx("strong", { children: (_b = (_a = item.displayName) !== null && _a !== void 0 ? _a : item.name) !== null && _b !== void 0 ? _b : item.key }), _jsx("span", { children: item.key }), _jsx("p", { children: item.description }), _jsxs("div", { className: "agent-editor__secret-env", children: [_jsx("span", { children: "Process environment" }), _jsx("code", { children: (_e = (_d = (_c = secretEnvVarNames[item.id]) !== null && _c !== void 0 ? _c : link === null || link === void 0 ? void 0 : link.envVarName) !== null && _d !== void 0 ? _d : item.key) !== null && _e !== void 0 ? _e : item.name }), _jsx("button", { type: "button", "aria-label": "Edit environment variable name for ".concat((_f = item.displayName) !== null && _f !== void 0 ? _f : item.key), onClick: function () { return beginSecretEnvVarEdit(item); }, children: _jsx(Pencil, { size: 14 }) })] })] });
|
|
856
862
|
} }) }
|
|
857
|
-
], ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "processes", label: "Processes", content: _jsx(AgentProcessesPanel, { agentId: record.id, agentLabel: (
|
|
858
|
-
["jobs", "Jobs", (
|
|
863
|
+
], ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "processes", label: "Processes", content: _jsx(AgentProcessesPanel, { agentId: record.id, agentLabel: (_l = record.name) !== null && _l !== void 0 ? _l : record.title }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [
|
|
864
|
+
["jobs", "Jobs", (_m = jobs.currentData) === null || _m === void 0 ? void 0 : _m.records],
|
|
859
865
|
] : []).map(function (_a) {
|
|
860
866
|
var value = _a[0], label = _a[1], related = _a[2];
|
|
861
867
|
return ({ value: value, label: label, content: _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: label }), jobs.isLoading || jobs.isFetching ? _jsx("div", { className: "agent-editor__empty", children: "Loading jobs\u2026" })
|
|
862
868
|
: jobs.isError ? _jsx("div", { className: "agent-editor__empty", children: "Jobs could not be loaded." })
|
|
863
869
|
: items(related).length ? _jsx("div", { className: "agent-editor__related", children: items(related).map(function (item) { var _a, _b, _c; return _jsxs("article", { children: [_jsx("strong", { children: (_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.title) !== null && _b !== void 0 ? _b : "#".concat(item.id) }), _jsx("span", { children: (_c = item.status) !== null && _c !== void 0 ? _c : "" })] }, item.id); }) })
|
|
864
870
|
: _jsxs("div", { className: "agent-editor__empty", children: ["No ", label.toLowerCase(), " for this agent yet."] })] }) });
|
|
865
|
-
}), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "sessions", label: "Sessions", content: _jsx(AgentSessionsPanel, { agentId: record.id, agentLabel: (
|
|
866
|
-
var
|
|
871
|
+
}), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "sessions", label: "Sessions", content: _jsx(AgentSessionsPanel, { agentId: record.id, agentLabel: (_o = record.name) !== null && _o !== void 0 ? _o : record.title }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "config-versions", label: "Version History", content: _jsx(AgentConfigVersionsPanel, { agentId: record.id, active: tab === "config-versions" }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "embedding", label: "Embedding", content: _jsx(AgentEmbeddingPanel, { agentId: record.id, fields: parseInputs(record.requiredInputs), active: record.status === "active", hubUrl: String((_p = getSettingsMap(settings).solidxAgentHubBackendUrl) !== null && _p !== void 0 ? _p : "") }) }] : []), true);
|
|
872
|
+
var visibleTabs = isAdmin ? tabs : tabs.filter(function (_a) {
|
|
873
|
+
var value = _a.value;
|
|
874
|
+
return !["policies", "processes", "jobs", "sessions", "embedding"].includes(value);
|
|
875
|
+
});
|
|
876
|
+
var content = _jsx(SolidTabGroup, { tabs: visibleTabs, value: tab, onValueChange: setTab, className: "agent-editor__tabs", listClassName: "agent-editor__tab-list", panelClassName: "agent-editor__tab-panel" });
|
|
867
877
|
return _jsxs("main", { className: "agent-editor", children: [_jsxs("header", { className: "agent-editor__header", children: [_jsxs("div", { className: "agent-editor__heading-with-refresh", children: [_jsx("h1", { children: (record === null || record === void 0 ? void 0 : record.id) ? "Edit Agent" : "Create Agent" }), (record === null || record === void 0 ? void 0 : record.id) && _jsx("button", { type: "button", className: "agent-editor__refresh".concat(isFetching ? " is-loading" : ""), "aria-label": "Refresh agent", title: "Refresh agent", disabled: isFetching || updating, onClick: requestRefresh, children: _jsx(RefreshCw, { size: 14 }) })] }), _jsxs("div", { className: "agent-editor__actions", children: [_jsx(SolidButton, { variant: "secondary", leftIcon: _jsx(ArrowLeft, { size: 16 }), onClick: function () { return navigate(-1); }, children: "Back" }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(SolidButton, { variant: "secondary", leftIcon: _jsx(FlaskConical, { size: 16 }), onClick: openAgentTest, children: "Test Agent" }), _jsx(SolidButton, { loading: creating || updating, disabled: creatingTag || isLoading || isFetching || isError || (id !== "new" && !(record === null || record === void 0 ? void 0 : record.id)), onClick: function () { return void save(); }, children: "Save Agent" })] })] }), preview && _jsx(ResourcePreviewDialog, { item: preview.item, kind: preview.kind, onClose: function () { return setPreview(null); } }), _jsx(SolidDialog, { open: confirmRefresh, onOpenChange: setConfirmRefresh, header: "Discard unsaved changes?", style: { width: "min(28rem, 94vw)" }, footer: _jsxs(_Fragment, { children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: function () { return setConfirmRefresh(false); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", disabled: isFetching, onClick: function () { setConfirmRefresh(false); void refetch(); }, children: "Refresh and discard" })] }), children: _jsx(SolidDialogBody, { children: _jsx("p", { children: "You have unsaved changes. Refreshing will discard them and load the latest agent content." }) }) }), _jsx(SolidDialog, { open: activateDialogOpen, onOpenChange: function (open) { if (!activating)
|
|
868
878
|
setActivateDialogOpen(open); }, header: "Activate agent with a new config version?", style: { width: "min(34rem, 94vw)" }, footer: _jsxs(_Fragment, { children: [_jsx(SolidButton, { type: "button", variant: "secondary", disabled: activating, onClick: function () { return setActivateDialogOpen(false); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", loading: activating || creating || updating, disabled: creatingTag || creating || updating || activating || activationWaiting, onClick: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
869
879
|
var saved;
|
|
@@ -885,15 +895,15 @@ export function AgentRegistryEditorPage() {
|
|
|
885
895
|
_jsx(AgentRegistryAuditPanel, { modelSingularName: "agentRegistry", recordId: record.id, refreshVersion: auditVersion, modelUserKey: record.name, children: content }) : content, _jsx(SolidDialog, { open: Boolean(pendingSecret), onOpenChange: function (open) { if (!open) {
|
|
886
896
|
setPendingSecret(null);
|
|
887
897
|
setSecretEnvVarError("");
|
|
888
|
-
} }, header: "Set secret environment variable", style: { width: "min(34rem, 94vw)" }, footer: _jsxs("div", { className: "agent-editor__secret-dialog-actions", children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: function () { setPendingSecret(null); setSecretEnvVarError(""); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", onClick: commitSecretEnvVar, children: "Use secret" })] }), children: _jsx(SolidDialogBody, { className: "agent-editor__secret-dialog-body", children: _jsxs("div", { className: "agent-editor__secret-dialog", children: [_jsxs("p", { children: ["Choose the environment variable name AgentHub will set for ", _jsx("strong", { children: (
|
|
898
|
+
} }, header: "Set secret environment variable", style: { width: "min(34rem, 94vw)" }, footer: _jsxs("div", { className: "agent-editor__secret-dialog-actions", children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: function () { setPendingSecret(null); setSecretEnvVarError(""); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", onClick: commitSecretEnvVar, children: "Use secret" })] }), children: _jsx(SolidDialogBody, { className: "agent-editor__secret-dialog-body", children: _jsxs("div", { className: "agent-editor__secret-dialog", children: [_jsxs("p", { children: ["Choose the environment variable name AgentHub will set for ", _jsx("strong", { children: (_r = (_q = pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.displayName) !== null && _q !== void 0 ? _q : pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.name) !== null && _r !== void 0 ? _r : pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.key }), ". The default is the secret name."] }), _jsxs("label", { className: "agent-editor__field", children: [_jsx("span", { children: "Environment variable name" }), _jsx(SolidInput, { autoFocus: true, value: secretEnvVarDraft, "aria-invalid": Boolean(secretEnvVarError), onChange: function (event) { setSecretEnvVarDraft(event.target.value); setSecretEnvVarError(""); } }), secretEnvVarError && _jsx("small", { className: "agent-editor__error", children: secretEnvVarError })] })] }) }) }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(SolidDialog, { open: testAgentOpen, dismissible: false, onOpenChange: function (open) {
|
|
889
899
|
setTestAgentOpen(open);
|
|
890
900
|
writeTestAgentPrefs(record.id, { open: open });
|
|
891
901
|
}, onHide: function () {
|
|
892
902
|
setTestAgentOpen(false);
|
|
893
903
|
writeTestAgentPrefs(record.id, { open: false });
|
|
894
|
-
}, showHeader: false, overlayClassName: "agent-editor__test-dialog-overlay", ariaLabel: "Test ".concat((
|
|
904
|
+
}, showHeader: false, overlayClassName: "agent-editor__test-dialog-overlay", ariaLabel: "Test ".concat((_s = record.name) !== null && _s !== void 0 ? _s : "SolidX Agent"), className: "agent-editor__test-dialog", style: testAgentWindowMode === "maximized"
|
|
895
905
|
? { position: "fixed", inset: 16, width: "auto", maxWidth: "none", height: "auto", maxHeight: "none", transform: "none", borderRadius: 14, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }
|
|
896
|
-
: { position: "fixed", top: 16, right: 16, bottom: 16, left: "auto", width: "min(28rem, calc(100vw - 32px))", maxWidth: "none", height: "auto", maxHeight: "none", transform: "none", borderRadius: 14, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: _jsx("div", { className: "agent-editor__test-dialog-body", children: _jsx(SolidAgentEmbedded, { agentRuntime: "agentHub", agentId: record.id, agentVersion: record.configVersion, title: (
|
|
906
|
+
: { position: "fixed", top: 16, right: 16, bottom: 16, left: "auto", width: "min(28rem, calc(100vw - 32px))", maxWidth: "none", height: "auto", maxHeight: "none", transform: "none", borderRadius: 14, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: _jsx("div", { className: "agent-editor__test-dialog-body", children: _jsx(SolidAgentEmbedded, { agentRuntime: "agentHub", agentId: record.id, agentVersion: record.configVersion, title: (_t = record.name) !== null && _t !== void 0 ? _t : "SolidX Agent", requiredInputs: parseInputs(record.requiredInputs), height: "100%", className: "agent-editor__test-chat", windowControls: {
|
|
897
907
|
mode: testAgentWindowMode,
|
|
898
908
|
onDock: function () { setTestAgentWindowMode("docked"); writeTestAgentPrefs(record.id, { mode: "docked" }); },
|
|
899
909
|
onMaximize: function () { setTestAgentWindowMode("maximized"); writeTestAgentPrefs(record.id, { mode: "maximized" }); },
|