@solidxai/core-ui 0.1.19 → 0.1.20-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts.map +1 -1
  2. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js +3 -10
  3. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js.map +1 -1
  4. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.tsx +3 -8
  5. package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
  6. package/dist/components/layout/AdminHeaderActions.js +1 -29
  7. package/dist/components/layout/AdminHeaderActions.js.map +1 -1
  8. package/dist/components/layout/AdminHeaderActions.tsx +0 -42
  9. package/dist/components/layout/SolidAiStudioLayout.d.ts +0 -1
  10. package/dist/components/layout/SolidAiStudioLayout.d.ts.map +1 -1
  11. package/dist/components/layout/SolidAiStudioLayout.js +9 -161
  12. package/dist/components/layout/SolidAiStudioLayout.js.map +1 -1
  13. package/dist/components/layout/SolidAiStudioLayout.tsx +7 -136
  14. package/dist/routes/AppEventListener.d.ts.map +1 -1
  15. package/dist/routes/AppEventListener.js +3 -3
  16. package/dist/routes/AppEventListener.js.map +1 -1
  17. package/dist/routes/AppEventListener.tsx +1 -2
  18. package/dist/routes/pages/admin/core/AgentHubTagsField.css +21 -0
  19. package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts +17 -0
  20. package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts.map +1 -0
  21. package/dist/routes/pages/admin/core/AgentHubTagsField.js +171 -0
  22. package/dist/routes/pages/admin/core/AgentHubTagsField.js.map +1 -0
  23. package/dist/routes/pages/admin/core/AgentHubTagsField.tsx +125 -0
  24. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +7 -0
  25. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
  26. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +65 -52
  27. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
  28. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +53 -11
  29. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
  30. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +14 -69
  31. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
  32. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +15 -83
  33. package/dist/routes/pages/admin/core/AgentToolActivationDialog.d.ts +11 -0
  34. package/dist/routes/pages/admin/core/AgentToolActivationDialog.d.ts.map +1 -0
  35. package/dist/routes/pages/admin/core/AgentToolActivationDialog.js +166 -0
  36. package/dist/routes/pages/admin/core/AgentToolActivationDialog.js.map +1 -0
  37. package/dist/routes/pages/admin/core/AgentToolActivationDialog.tsx +140 -0
  38. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.css +26 -0
  39. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
  40. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +94 -71
  41. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
  42. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +60 -52
  43. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ import React from "react";
2
+ import { Plus, Search, X } from "lucide-react";
3
+ import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
4
+ import { SolidButton } from "../../../../components/shad-cn-ui/SolidButton";
5
+ import "./AgentHubTagsField.css";
6
+
7
+ export type AgentHubTag = { id: number; name: string };
8
+
9
+ export function agentHubTagsFrom(value: unknown): AgentHubTag[] {
10
+ if (!Array.isArray(value)) return [];
11
+ const seen = new Set<number>();
12
+ return value.flatMap((tag) => {
13
+ const id = Number(tag?.id);
14
+ if (!Number.isInteger(id) || id <= 0 || typeof tag?.name !== "string" || seen.has(id)) return [];
15
+ seen.add(id);
16
+ return [{ id, name: tag.name }];
17
+ });
18
+ }
19
+
20
+ export function agentHubTagsPayload(tags: AgentHubTag[]) {
21
+ return { tagsIds: tags.map((tag) => tag.id), tagsCommand: tags.length ? "set" : "clear" };
22
+ }
23
+
24
+ const tagApi = createSolidEntityApi("agentHubTag");
25
+
26
+ export function AgentHubTagsField({ value, onChange, disabled = false, onBusyChange }: {
27
+ value: AgentHubTag[];
28
+ onChange: (tags: AgentHubTag[]) => void;
29
+ disabled?: boolean;
30
+ onBusyChange?: (busy: boolean) => void;
31
+ }) {
32
+ const { data, isFetching, isError, refetch } = tagApi.useGetSolidEntitiesQuery(
33
+ "offset=0&limit=1000&fields[0]=id&fields[1]=name", { skip: disabled });
34
+ const [createTag, { isLoading: isCreating }] = tagApi.useCreateSolidEntityMutation();
35
+ const [query, setQuery] = React.useState("");
36
+ const [open, setOpen] = React.useState(false);
37
+ const [activeIndex, setActiveIndex] = React.useState(-1);
38
+ const [error, setError] = React.useState("");
39
+ const inputRef = React.useRef<HTMLInputElement>(null);
40
+ const fieldId = React.useId();
41
+ const name = query.trim();
42
+ const catalog = agentHubTagsFrom(data?.records);
43
+ const exact = [...catalog, ...value].find((tag) => tag.name.toLowerCase() === name.toLowerCase());
44
+ const options = catalog.filter((tag) => !value.some((selected) => selected.id === tag.id)
45
+ && tag.name.toLowerCase().includes(name.toLowerCase())).sort((a, b) => a.name.localeCompare(b.name));
46
+ const canCreate = Boolean(name && !exact && !isFetching && !isError);
47
+
48
+ const select = (tag: AgentHubTag) => {
49
+ if (!value.some((selected) => selected.id === tag.id)) onChange([...value, tag]);
50
+ setQuery("");
51
+ setActiveIndex(-1);
52
+ setError("");
53
+ inputRef.current?.focus();
54
+ };
55
+
56
+ const add = async () => {
57
+ if (disabled || isCreating || !name) return;
58
+ if (exact) { select(exact); return; }
59
+ if (!canCreate) return;
60
+ setError("");
61
+ onBusyChange?.(true);
62
+ try {
63
+ let result = await createTag({ name }).unwrap();
64
+ for (let depth = 0; depth < 3 && result && !result.id; depth += 1) result = result.data;
65
+ const created = agentHubTagsFrom([result])[0];
66
+ if (!created) throw new Error("The tag could not be loaded. Search for it again.");
67
+ select(created);
68
+ } catch (failure: any) {
69
+ const refreshed = await refetch();
70
+ const existing = agentHubTagsFrom(refreshed.data?.records).find((tag) => tag.name.toLowerCase() === name.toLowerCase());
71
+ if (existing) select(existing);
72
+ else {
73
+ const message = failure?.data?.data?.message ?? failure?.data?.message ?? failure?.message;
74
+ setError(typeof message === "string" ? message : "Could not create this tag. Try again.");
75
+ }
76
+ } finally {
77
+ onBusyChange?.(false);
78
+ }
79
+ };
80
+
81
+ return <div className="agent-hub-tags" onBlur={(event) => {
82
+ if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setOpen(false);
83
+ }}>
84
+ <label htmlFor={fieldId}>Tags <span className="agent-hub-tags__count">{value.length}</span></label>
85
+ <div className="agent-hub-tags__selection">
86
+ {value.map((tag) => <span className="agent-hub-tags__chip" key={tag.id}>{tag.name}
87
+ {!disabled && <button type="button" disabled={isCreating} aria-label={`Remove ${tag.name}`}
88
+ onClick={() => onChange(value.filter((selected) => selected.id !== tag.id))}><X size={13} /></button>}
89
+ </span>)}
90
+ {!value.length && <span className="agent-hub-tags__empty">No tags selected</span>}
91
+ </div>
92
+ {!disabled && <>
93
+ <div className="agent-hub-tags__search">
94
+ <Search size={16} aria-hidden="true" />
95
+ <input ref={inputRef} id={fieldId} role="combobox" autoComplete="off" aria-expanded={open}
96
+ aria-controls={`${fieldId}-options`} aria-autocomplete="list"
97
+ aria-activedescendant={open && options[activeIndex] ? `${fieldId}-option-${activeIndex}` : undefined}
98
+ disabled={isCreating} value={query} placeholder="Search or create tags…"
99
+ onFocus={() => setOpen(true)}
100
+ onChange={(event) => { setQuery(event.target.value); setActiveIndex(-1); setOpen(true); setError(""); }}
101
+ onKeyDown={(event) => {
102
+ if (event.key === "Escape") { event.preventDefault(); setOpen(false); }
103
+ if (event.key === "ArrowDown") { event.preventDefault(); setOpen(true); setActiveIndex((index) => Math.min(index + 1, options.length - 1)); }
104
+ if (event.key === "ArrowUp") { event.preventDefault(); setActiveIndex((index) => Math.max(index - 1, 0)); }
105
+ if (event.key === "Enter") { event.preventDefault(); if (open && options[activeIndex]) select(options[activeIndex]); else void add(); }
106
+ }} />
107
+ {name && <SolidButton variant="secondary" size="small" loading={isCreating}
108
+ disabled={!exact && !canCreate} onClick={() => void add()} leftIcon={<Plus size={14} />}>
109
+ {exact ? "Select" : "Create tag"}
110
+ </SolidButton>}
111
+ </div>
112
+ {isError && <div className="agent-hub-tags__error" role="alert">Tags could not be loaded. <button type="button" onClick={() => void refetch()}>Retry</button></div>}
113
+ {open && <div className="agent-hub-tags__options" id={`${fieldId}-options`} role="listbox" aria-label="Available tags">
114
+ {isFetching ? <div className="agent-hub-tags__empty" role="status">Loading tags…</div>
115
+ : options.length ? options.map((tag, index) => <button key={tag.id} id={`${fieldId}-option-${index}`}
116
+ type="button" role="option" aria-selected={false} disabled={isCreating}
117
+ className={activeIndex === index ? "is-active" : undefined}
118
+ onMouseDown={(event) => event.preventDefault()} onClick={() => select(tag)}>{tag.name}<Plus size={14} /></button>)
119
+ : !isError && <div className="agent-hub-tags__empty">{exact ? "Tag already selected." : canCreate ? `Create “${name}” to add it.` : "No tags available. Type a name to create one."}</div>}
120
+ </div>}
121
+ {error && <small className="agent-hub-tags__error" role="alert">{error}</small>}
122
+ <small className="agent-hub-tags__hint">Tags are shared across agents, skills, and tools.</small>
123
+ </>}
124
+ </div>;
125
+ }
@@ -75,6 +75,13 @@
75
75
  .agent-editor__card-content { min-width:0; }
76
76
  .agent-editor__card-content>article { min-height:17rem; height:auto; }
77
77
  .agent-editor__linked-card>button { position:absolute; top:.3rem; right:.3rem; background:var(--surface-card,var(--card)); }
78
+ .agent-editor__linked-card>.agent-editor__resource-menu-trigger { width:2rem; min-height:2rem; }
79
+ .agent-editor__linked-card>.agent-editor__resource-menu-trigger:hover { color:var(--text-color,var(--foreground)); background:var(--surface-hover,#f2f3f4); }
80
+ .agent-editor__resource-menu-trigger:focus-visible { outline:2px solid var(--primary-color,var(--primary)); outline-offset:1px; }
81
+ .agent-editor__resource-menu .solid-dropdown-menu-item { gap:.5rem; }
82
+ .agent-editor__resource-menu .agent-editor__resource-delete { color:#dc2626; }
83
+ .agent-editor__resource-preview-body { min-height:0; max-height:72vh; overflow:auto; }
84
+ .agent-editor__resource-preview-body img { max-width:100%; height:auto; }
78
85
  .agent-editor__secret { padding:1rem; }
79
86
  .agent-editor__secret span { display:block; color:var(--text-color-secondary,var(--muted-foreground)); font-size:.8rem; }
80
87
  .agent-editor__link-settings { padding:.55rem .75rem .7rem; border-top:1px solid var(--surface-border,var(--border)); background:var(--surface-ground,var(--background)); }
@@ -1 +1 @@
1
- {"version":3,"file":"AgentRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentRegistryEditorPage.tsx"],"names":[],"mappings":"AAmBA,OAAO,+BAA+B,CAAC;AA0PvC,wBAAgB,uBAAuB,4CAwWtC"}
1
+ {"version":3,"file":"AgentRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentRegistryEditorPage.tsx"],"names":[],"mappings":"AAqBA,OAAO,+BAA+B,CAAC;AAwRvC,wBAAgB,uBAAuB,4CAkXtC"}
@@ -57,7 +57,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
57
57
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
58
58
  import React from "react";
59
59
  import { createPortal } from "react-dom";
60
- import { ArrowLeft, ChevronDown, ExternalLink, FlaskConical, Pencil, Plus, RefreshCw, Trash2 } from "lucide-react";
60
+ import { ArrowLeft, ChevronDown, Ellipsis, ExternalLink, Eye, FlaskConical, Pencil, Plus, RefreshCw, Trash2 } from "lucide-react";
61
61
  import { useDispatch } from "react-redux";
62
62
  import { useNavigate, useParams } from "react-router-dom";
63
63
  import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
@@ -65,13 +65,15 @@ import { useGetSolidSettingsQuery } from "../../../../redux/api/solidSettingsApi
65
65
  import { getSettingsMap } from "../../../../helpers/settingsPayload";
66
66
  import { showToast } from "../../../../redux/features/toastSlice";
67
67
  import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
68
+ import { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload } from "./AgentHubTagsField";
68
69
  import { AgentResourceCardWidget } from "../../../../components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget";
69
70
  import { AgentSessionsPanel } from "../../../../components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel";
70
71
  import { AgentProcessesPanel } from "../../../../components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel";
71
72
  import { SolidWorkflowStatusPill } from "../../../../components/core/form/SolidDraftPublishWorkflow";
72
73
  import { ALLOWED_MODELS_BY_PROVIDER } from "../../../../constants/allowed-ai-models";
73
- import { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidIconPicker, SolidInput, SolidTabGroup } from "../../../../components/shad-cn-ui";
74
+ import { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidDropdownMenu, SolidDropdownMenuContent, SolidDropdownMenuItem, SolidDropdownMenuTrigger, SolidIconPicker, SolidInput, SolidTabGroup } from "../../../../components/shad-cn-ui";
74
75
  import { SolidAgentEmbedded } from "../../../../components/core/solid-agent/SolidAgentEmbedded";
76
+ import { SolidAgentMarkdown } from "../../../../components/core/solid-agent/SolidAgentMarkdown";
75
77
  import { AgentEmbeddingPanel } from "../../../../components/core/solid-agent/embed/AgentEmbeddingPanel";
76
78
  import "./AgentRegistryEditorPage.css";
77
79
  var PROVIDER_LABELS = {
@@ -169,7 +171,7 @@ var agentToolApi = createSolidEntityApi("agentTool");
169
171
  var agentRoleApi = createSolidEntityApi("agentRole");
170
172
  var agentSecretApi = createSolidEntityApi("agentSecret");
171
173
  var jobApi = createSolidEntityApi("agentJob");
172
- var skillFields = ["id", "name", "iconName", "description", "tags"];
174
+ var skillFields = ["id", "name", "iconName", "description"];
173
175
  var toolFields = __spreadArray(__spreadArray([], skillFields, true), ["type", "status", "lastLoadError"], false);
174
176
  function fieldsQuery(fields) {
175
177
  return fields.map(function (name) { return "fields=".concat(encodeURIComponent(name)); }).join("&");
@@ -179,7 +181,7 @@ var detailFields = [
179
181
  "reasoningModelKey", "fastModelKey", "status", "stepLimit", "turnStepLimit", "costLimit", "configVersion",
180
182
  ];
181
183
  var detailQuery = [
182
- "agentRoles", "agentRoles.roleMetadata", "agentSecrets", "agentSecrets.secret",
184
+ "agentRoles", "agentRoles.roleMetadata", "agentSecrets", "agentSecrets.secret", "tags",
183
185
  ].map(function (name, index) { return "populate[".concat(index, "]=").concat(name); }).join("&") + "&" + fieldsQuery(detailFields);
184
186
  // Group by link ID to project summary columns without populating full registry records.
185
187
  function resourceLinksQuery(id, relation, registry, setting, fields) {
@@ -219,7 +221,7 @@ function agentFormFromRecord(record) {
219
221
  name: (_a = record.name) !== null && _a !== void 0 ? _a : "", title: (_b = record.title) !== null && _b !== void 0 ? _b : "", description: (_c = record.description) !== null && _c !== void 0 ? _c : "", iconName: (_d = record.iconName) !== null && _d !== void 0 ? _d : "",
220
222
  inputs: parseInputs(record.requiredInputs), reasoningModelKey: (_e = record.reasoningModelKey) !== null && _e !== void 0 ? _e : "", fastModelKey: (_f = record.fastModelKey) !== null && _f !== void 0 ? _f : "",
221
223
  systemPrompt: (_g = record.systemPrompt) !== null && _g !== void 0 ? _g : "", stepLimit: (_h = record.stepLimit) !== null && _h !== void 0 ? _h : 100, turnStepLimit: (_j = record.turnStepLimit) !== null && _j !== void 0 ? _j : 20,
222
- costLimit: Number((_k = record.costLimit) !== null && _k !== void 0 ? _k : 3), skillIds: skills.map(function (link) { var _a; return (_a = link.agentSkillRegistry) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean),
224
+ costLimit: Number((_k = record.costLimit) !== null && _k !== void 0 ? _k : 3), tags: agentHubTagsFrom(record.tags), skillIds: skills.map(function (link) { var _a; return (_a = link.agentSkillRegistry) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean),
223
225
  toolIds: tools.map(function (link) { var _a; return (_a = link.agentToolRegistry) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean),
224
226
  roleIds: items(record.agentRoles).map(function (link) { var _a; return (_a = link.roleMetadata) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean),
225
227
  secretIds: secrets.map(function (link) { var _a; return (_a = link.secret) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean),
@@ -273,8 +275,23 @@ function useCatalog(api, query) {
273
275
  var _a = api.useGetSolidEntitiesQuery(query), data = _a.data, isLoading = _a.isLoading, refetch = _a.refetch;
274
276
  return { records: items(data === null || data === void 0 ? void 0 : data.records), isLoading: isLoading, refetch: refetch };
275
277
  }
278
+ function ResourcePreviewDialog(_a) {
279
+ var _b, _c;
280
+ var item = _a.item, kind = _a.kind, onClose = _a.onClose;
281
+ var api = kind === "skill" ? skillApi : toolApi;
282
+ var field = kind === "skill" ? "body" : "sourceCode";
283
+ var _d = api.useGetSolidEntityByIdQuery({ id: item.id, qs: fieldsQuery(["id", field]) }, { refetchOnMountOrArgChange: true }), currentData = _d.currentData, isFetching = _d.isFetching, isError = _d.isError, refetch = _d.refetch;
284
+ var record = recordFrom(currentData);
285
+ var content = (_b = record === null || record === void 0 ? void 0 : record[field]) !== null && _b !== void 0 ? _b : "";
286
+ return _jsx(SolidDialog, { open: true, onOpenChange: function (open) { if (!open)
287
+ onClose(); }, header: (_c = item.name) !== null && _c !== void 0 ? _c : "View ".concat(kind), style: { width: "min(64rem, 94vw)", maxWidth: "94vw" }, children: _jsx(SolidDialogBody, { className: "agent-editor__resource-preview-body", children: isFetching ? _jsxs("div", { className: "agent-editor__empty", role: "status", children: ["Loading ", kind, "\u2026"] })
288
+ : isError || !record ? _jsxs("div", { className: "agent-editor__empty", children: [_jsxs("p", { role: "alert", children: ["This ", kind, " could not be loaded."] }), _jsx(SolidButton, { variant: "secondary", onClick: function () { return void refetch(); }, children: "Retry" })] })
289
+ : !content ? _jsxs("div", { className: "agent-editor__empty", children: ["No ", kind === "skill" ? "skill body" : "source code", " available."] })
290
+ : kind === "skill" ? _jsx(SolidAgentMarkdown, { text: content })
291
+ : _jsx(SolidCodeEditor, { value: content, language: "python", readOnly: true, fontSize: 12, height: "min(65vh, 42rem)" }) }) });
292
+ }
276
293
  function LinkPicker(_a) {
277
- var label = _a.label, description = _a.description, options = _a.options, selected = _a.selected, onAdd = _a.onAdd, onRemove = _a.onRemove, createUrl = _a.createUrl, render = _a.render, renderSettings = _a.renderSettings, linkFor = _a.linkFor;
294
+ var label = _a.label, description = _a.description, options = _a.options, selected = _a.selected, onAdd = _a.onAdd, onRemove = _a.onRemove, createUrl = _a.createUrl, render = _a.render, renderSettings = _a.renderSettings, linkFor = _a.linkFor, onView = _a.onView, editUrlFor = _a.editUrlFor;
278
295
  var _b = React.useState(""), search = _b[0], setSearch = _b[1];
279
296
  var _c = React.useState(false), open = _c[0], setOpen = _c[1];
280
297
  var available = options.filter(function (item) {
@@ -286,8 +303,8 @@ function LinkPicker(_a) {
286
303
  var _a, _b;
287
304
  return _jsxs("button", { type: "button", onClick: function () { onAdd(item.id); setSearch(""); setOpen(false); }, children: [_jsx("strong", { children: (_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.displayName) !== null && _b !== void 0 ? _b : item.key }), _jsx("span", { children: item.description })] }, item.id);
288
305
  }) : _jsxs("p", { children: ["No available ", label.toLowerCase(), " found."] }) })] }), selected.length ? _jsx("div", { className: "agent-editor__cards", children: selected.map(function (item) {
289
- var _a, _b;
290
- return _jsxs("div", { className: "agent-editor__linked-card", children: [_jsx("div", { className: "agent-editor__card-content", children: 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)), _jsx("button", { type: "button", "aria-label": "Remove ".concat((_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.displayName) !== null && _b !== void 0 ? _b : item.key), onClick: function () { return onRemove(item.id); }, children: _jsx(Trash2, { size: 16 }) })] }, item.id);
306
+ var _a, _b, _c, _d;
307
+ return _jsxs("div", { className: "agent-editor__linked-card", children: [_jsx("div", { className: "agent-editor__card-content", children: 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"] }), _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);
291
308
  }) }) : _jsxs("div", { className: "agent-editor__empty", children: ["No ", label.toLowerCase(), " linked yet."] })] });
292
309
  }
293
310
  export function AgentRegistryEditorPage() {
@@ -309,8 +326,8 @@ export function AgentRegistryEditorPage() {
309
326
  return __assign(__assign({}, agent), { agentSkills: resourceLinksFrom(skillLinks.currentData, "agentSkills", "agentSkillRegistry", "alwaysInclude", skillFields), agentTools: resourceLinksFrom(toolLinks.currentData, "agentTools", "agentToolRegistry", "requiresApproval", toolFields) });
310
327
  }, [agentResult.currentData, skillLinks.currentData, toolLinks.currentData]);
311
328
  var _m = useGetSolidSettingsQuery(undefined), settings = _m.data, settingsError = _m.isError;
312
- var skills = useCatalog(skillApi, "offset=0&limit=1000&".concat(fieldsQuery(skillFields)));
313
- var tools = useCatalog(toolApi, "offset=0&limit=1000&".concat(fieldsQuery(toolFields)));
329
+ var skills = useCatalog(skillApi, "offset=0&limit=1000&populate[0]=tags&".concat(fieldsQuery(skillFields)));
330
+ var tools = useCatalog(toolApi, "offset=0&limit=1000&populate[0]=tags&".concat(fieldsQuery(toolFields)));
314
331
  var roles = useCatalog(roleApi, "offset=0&limit=1000&populate[0]=module");
315
332
  var secrets = useCatalog(secretApi, "offset=0&limit=1000&fields[0]=id&fields[1]=key&fields[2]=displayName&fields[3]=description");
316
333
  var _o = entityApi.useCreateSolidEntityMutation(), createAgent = _o[0], creating = _o[1].isLoading;
@@ -337,33 +354,36 @@ export function AgentRegistryEditorPage() {
337
354
  void jobs.refetch();
338
355
  };
339
356
  var _r = React.useState(false), testAgentOpen = _r[0], setTestAgentOpen = _r[1];
340
- var _s = React.useState("maximized"), testAgentWindowMode = _s[0], setTestAgentWindowMode = _s[1];
341
- var _t = React.useState(""), name = _t[0], setName = _t[1];
342
- var _u = React.useState(""), title = _u[0], setTitle = _u[1];
343
- var _v = React.useState(""), description = _v[0], setDescription = _v[1];
344
- var _w = React.useState(""), iconName = _w[0], setIconName = _w[1];
345
- var _x = React.useState([]), inputs = _x[0], setInputs = _x[1];
346
- var _y = React.useState(""), reasoningModelKey = _y[0], setReasoningModelKey = _y[1];
347
- var _z = React.useState(""), fastModelKey = _z[0], setFastModelKey = _z[1];
348
- var _0 = React.useState(""), systemPrompt = _0[0], setSystemPrompt = _0[1];
349
- var _1 = React.useState(100), stepLimit = _1[0], setStepLimit = _1[1];
350
- var _2 = React.useState(20), turnStepLimit = _2[0], setTurnStepLimit = _2[1];
351
- var _3 = React.useState(3), costLimit = _3[0], setCostLimit = _3[1];
352
- var _4 = React.useState([]), skillIds = _4[0], setSkillIds = _4[1];
353
- var _5 = React.useState([]), toolIds = _5[0], setToolIds = _5[1];
354
- var _6 = React.useState([]), roleIds = _6[0], setRoleIds = _6[1];
355
- var _7 = React.useState([]), secretIds = _7[0], setSecretIds = _7[1];
356
- var _8 = React.useState({}), alwaysIncludeValues = _8[0], setAlwaysIncludeValues = _8[1];
357
- var _9 = React.useState({}), requiresApprovalValues = _9[0], setRequiresApprovalValues = _9[1];
358
- var _10 = React.useState({}), secretEnvVarNames = _10[0], setSecretEnvVarNames = _10[1];
359
- var _11 = React.useState(null), pendingSecret = _11[0], setPendingSecret = _11[1];
360
- var _12 = React.useState(""), secretEnvVarDraft = _12[0], setSecretEnvVarDraft = _12[1];
361
- var _13 = React.useState(""), secretEnvVarError = _13[0], setSecretEnvVarError = _13[1];
362
- var _14 = React.useState({}), errors = _14[0], setErrors = _14[1];
363
- var _15 = React.useState(0), auditVersion = _15[0], setAuditVersion = _15[1];
364
- var _16 = React.useState(false), confirmRefresh = _16[0], setConfirmRefresh = _16[1];
357
+ var _s = React.useState(null), preview = _s[0], setPreview = _s[1];
358
+ var _t = React.useState("maximized"), testAgentWindowMode = _t[0], setTestAgentWindowMode = _t[1];
359
+ var _u = React.useState(""), name = _u[0], setName = _u[1];
360
+ var _v = React.useState(""), title = _v[0], setTitle = _v[1];
361
+ var _w = React.useState(""), description = _w[0], setDescription = _w[1];
362
+ var _x = React.useState(""), iconName = _x[0], setIconName = _x[1];
363
+ var _y = React.useState([]), inputs = _y[0], setInputs = _y[1];
364
+ var _z = React.useState(""), reasoningModelKey = _z[0], setReasoningModelKey = _z[1];
365
+ var _0 = React.useState(""), fastModelKey = _0[0], setFastModelKey = _0[1];
366
+ var _1 = React.useState(""), systemPrompt = _1[0], setSystemPrompt = _1[1];
367
+ var _2 = React.useState(100), stepLimit = _2[0], setStepLimit = _2[1];
368
+ var _3 = React.useState(20), turnStepLimit = _3[0], setTurnStepLimit = _3[1];
369
+ var _4 = React.useState(3), costLimit = _4[0], setCostLimit = _4[1];
370
+ var _5 = React.useState([]), tags = _5[0], setTags = _5[1];
371
+ var _6 = React.useState(false), creatingTag = _6[0], setCreatingTag = _6[1];
372
+ var _7 = React.useState([]), skillIds = _7[0], setSkillIds = _7[1];
373
+ var _8 = React.useState([]), toolIds = _8[0], setToolIds = _8[1];
374
+ var _9 = React.useState([]), roleIds = _9[0], setRoleIds = _9[1];
375
+ var _10 = React.useState([]), secretIds = _10[0], setSecretIds = _10[1];
376
+ var _11 = React.useState({}), alwaysIncludeValues = _11[0], setAlwaysIncludeValues = _11[1];
377
+ var _12 = React.useState({}), requiresApprovalValues = _12[0], setRequiresApprovalValues = _12[1];
378
+ var _13 = React.useState({}), secretEnvVarNames = _13[0], setSecretEnvVarNames = _13[1];
379
+ var _14 = React.useState(null), pendingSecret = _14[0], setPendingSecret = _14[1];
380
+ var _15 = React.useState(""), secretEnvVarDraft = _15[0], setSecretEnvVarDraft = _15[1];
381
+ var _16 = React.useState(""), secretEnvVarError = _16[0], setSecretEnvVarError = _16[1];
382
+ var _17 = React.useState({}), errors = _17[0], setErrors = _17[1];
383
+ var _18 = React.useState(0), auditVersion = _18[0], setAuditVersion = _18[1];
384
+ var _19 = React.useState(false), confirmRefresh = _19[0], setConfirmRefresh = _19[1];
365
385
  var baseline = React.useRef("");
366
- var currentForm = function () { return JSON.stringify({ name: name, title: title, description: description, iconName: iconName, inputs: inputs, reasoningModelKey: reasoningModelKey, fastModelKey: fastModelKey, systemPrompt: systemPrompt, stepLimit: Number(stepLimit), turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit), skillIds: skillIds, toolIds: toolIds, roleIds: roleIds, secretIds: secretIds, alwaysIncludeValues: alwaysIncludeValues, requiresApprovalValues: requiresApprovalValues, secretEnvVarNames: secretEnvVarNames }); };
386
+ var currentForm = function () { return JSON.stringify({ name: name, title: title, description: description, iconName: iconName, inputs: inputs, reasoningModelKey: reasoningModelKey, fastModelKey: fastModelKey, systemPrompt: systemPrompt, stepLimit: Number(stepLimit), turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit), tags: tags, skillIds: skillIds, toolIds: toolIds, roleIds: roleIds, secretIds: secretIds, alwaysIncludeValues: alwaysIncludeValues, requiresApprovalValues: requiresApprovalValues, secretEnvVarNames: secretEnvVarNames }); };
367
387
  React.useEffect(function () {
368
388
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
369
389
  if (!record)
@@ -380,6 +400,7 @@ export function AgentRegistryEditorPage() {
380
400
  setStepLimit((_h = record.stepLimit) !== null && _h !== void 0 ? _h : 100);
381
401
  setTurnStepLimit((_j = record.turnStepLimit) !== null && _j !== void 0 ? _j : 20);
382
402
  setCostLimit(Number((_k = record.costLimit) !== null && _k !== void 0 ? _k : 3));
403
+ setTags(agentHubTagsFrom(record.tags));
383
404
  setSkillIds(items(record.agentSkills).map(function (link) { var _a; return (_a = link.agentSkillRegistry) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean));
384
405
  setToolIds(items(record.agentTools).map(function (link) { var _a; return (_a = link.agentToolRegistry) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean));
385
406
  setRoleIds(items(record.agentRoles).map(function (link) { var _a; return (_a = link.roleMetadata) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean));
@@ -414,7 +435,7 @@ export function AgentRegistryEditorPage() {
414
435
  var config = typeof configValue === "string" ? JSON.parse(configValue) : configValue;
415
436
  enabledProviders = (_a = config === null || config === void 0 ? void 0 : config.providers) !== null && _a !== void 0 ? _a : {};
416
437
  }
417
- catch ( /* Invalid configuration has no enabled providers. */_17) { /* Invalid configuration has no enabled providers. */ }
438
+ catch ( /* Invalid configuration has no enabled providers. */_20) { /* Invalid configuration has no enabled providers. */ }
418
439
  var modelOptions = Object.keys(ALLOWED_MODELS_BY_PROVIDER)
419
440
  .filter(function (provider) { var _a; return typeof ((_a = enabledProviders[provider]) === null || _a === void 0 ? void 0 : _a.apiKey) === "string" && enabledProviders[provider].apiKey.trim().length > 0; })
420
441
  .flatMap(function (provider) { return ALLOWED_MODELS_BY_PROVIDER[provider].map(function (model) { return ({
@@ -498,6 +519,8 @@ export function AgentRegistryEditorPage() {
498
519
  return __generator(this, function (_e) {
499
520
  switch (_e.label) {
500
521
  case 0:
522
+ if (creatingTag)
523
+ return [2 /*return*/];
501
524
  next = {};
502
525
  if (!name.trim())
503
526
  next.name = "Name is required.";
@@ -521,17 +544,7 @@ export function AgentRegistryEditorPage() {
521
544
  dispatch(showToast({ severity: "error", summary: "Missing information", detail: Object.values(next).join(" ") }));
522
545
  return [2 /*return*/];
523
546
  }
524
- payload = {
525
- name: name.trim(), title: title.trim(), description: description.trim(),
526
- iconName: iconName,
527
- requiredInputs: JSON.stringify(inputs.map(function (input) { return (__assign(__assign({}, input), { name: input.name.trim(), description: input.description.trim() })); })),
528
- reasoningModelKey: reasoningModelKey,
529
- fastModelKey: fastModelKey,
530
- systemPrompt: systemPrompt,
531
- stepLimit: Number(stepLimit),
532
- turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit),
533
- status: (_b = nextStatus !== null && nextStatus !== void 0 ? nextStatus : record === null || record === void 0 ? void 0 : record.status) !== null && _b !== void 0 ? _b : "draft",
534
- };
547
+ payload = __assign(__assign({ name: name.trim(), title: title.trim(), description: description.trim(), iconName: iconName, requiredInputs: JSON.stringify(inputs.map(function (input) { return (__assign(__assign({}, input), { name: input.name.trim(), description: input.description.trim() })); })), reasoningModelKey: reasoningModelKey, fastModelKey: fastModelKey, systemPrompt: systemPrompt, stepLimit: Number(stepLimit), turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit) }, agentHubTagsPayload(tags)), { status: (_b = nextStatus !== null && nextStatus !== void 0 ? nextStatus : record === null || record === void 0 ? void 0 : record.status) !== null && _b !== void 0 ? _b : "draft" });
535
548
  scalarSaved = false;
536
549
  _e.label = 1;
537
550
  case 1:
@@ -639,7 +652,7 @@ export function AgentRegistryEditorPage() {
639
652
  };
640
653
  var agentStatus = (_b = record === null || record === void 0 ? void 0 : record.status) !== null && _b !== void 0 ? _b : "draft";
641
654
  var tabs = __spreadArray(__spreadArray(__spreadArray(__spreadArray([
642
- { value: "basics", label: "Basics", content: _jsxs("div", { className: "agent-editor__stack", children: [_jsxs("div", { className: "agent-editor__grid", children: [field("Name", name, setName, "name", true), field("Title", title, setTitle, "title", true), field("Description", description, setDescription, "description"), _jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: "Required inputs" }), _jsx("p", { children: "Define the variables people must provide when starting this agent." })] }), inputs.length > 0 && _jsxs(SolidButton, { type: "button", variant: "secondary", size: "small", onClick: function () { return setInputs(function (current) { return __spreadArray(__spreadArray([], current, true), [{ name: "", description: "", dataType: "string" }], false); }); }, children: [_jsx(Plus, { size: 15 }), " Add input"] })] }), !inputs.length ? _jsxs("div", { className: "agent-editor__empty", children: ["This agent has no required inputs. ", _jsxs("button", { type: "button", onClick: function () { return setInputs([{ name: "", description: "", dataType: "string" }]); }, children: [_jsx(Plus, { size: 15 }), " Add an input variable"] })] })
655
+ { value: "basics", label: "Basics", content: _jsxs("div", { className: "agent-editor__stack", children: [_jsxs("div", { className: "agent-editor__grid", children: [field("Name", name, setName, "name", true), field("Title", title, setTitle, "title", true), field("Description", description, setDescription, "description"), _jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] })] }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, disabled: creating || updating || isLoading || isFetching || isError, onBusyChange: setCreatingTag }), _jsxs("section", { className: "agent-editor__section", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: "Required inputs" }), _jsx("p", { children: "Define the variables people must provide when starting this agent." })] }), inputs.length > 0 && _jsxs(SolidButton, { type: "button", variant: "secondary", size: "small", onClick: function () { return setInputs(function (current) { return __spreadArray(__spreadArray([], current, true), [{ name: "", description: "", dataType: "string" }], false); }); }, children: [_jsx(Plus, { size: 15 }), " Add input"] })] }), !inputs.length ? _jsxs("div", { className: "agent-editor__empty", children: ["This agent has no required inputs. ", _jsxs("button", { type: "button", onClick: function () { return setInputs([{ name: "", description: "", dataType: "string" }]); }, children: [_jsx(Plus, { size: 15 }), " Add an input variable"] })] })
643
656
  : _jsx("div", { className: "agent-editor__inputs", children: inputs.map(function (input, index) { return _jsxs("div", { className: "agent-editor__input-row", children: [_jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " name"), placeholder: "Variable name", value: input.name, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { name: event.target.value }) : item; }); }); } }), _jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " description"), placeholder: "Description", value: input.description, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { description: event.target.value }) : item; }); }); } }), _jsx("select", { "aria-label": "Input ".concat(index + 1, " data type"), value: input.dataType, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { dataType: event.target.value }) : item; }); }); }, children: ["string", "number", "integer", "boolean", "date", "datetime", "object", "array"].map(function (type) { return _jsx("option", { value: type, children: type }, type); }) }), _jsx("button", { type: "button", "aria-label": "Remove input ".concat(index + 1), onClick: function () { return setInputs(function (current) { return current.filter(function (_, i) { return i !== index; }); }); }, children: _jsx(Trash2, { size: 17 }) })] }, index); }) }), errors.inputs && _jsx("small", { className: "agent-editor__error", children: errors.inputs })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "Models" }), _jsx("p", { children: "Choose any configured provider and model pair for each role. Both lists use the models enabled in AI settings." }), _jsx("div", { className: "agent-editor__grid", children: [["Reasoning model", reasoningModelKey, setReasoningModelKey, "reasoningModelKey"], ["Fast model", fastModelKey, setFastModelKey, "fastModelKey"]].map(function (_a) {
644
657
  var label = _a[0], value = _a[1], setter = _a[2], key = _a[3];
645
658
  return _jsxs("label", { className: "agent-editor__field", children: [_jsxs("span", { children: [label, " *"] }), _jsx(ModelPicker, { value: value, options: modelOptions, placeholder: "Search providers and models\u2026", onChange: function (next) { return setter(next); } }), errors[key] && _jsx("small", { className: "agent-editor__error", children: errors[key] })] }, key);
@@ -654,14 +667,14 @@ export function AgentRegistryEditorPage() {
654
667
  return _jsxs(React.Fragment, { children: [index > 0 && _jsx("div", { className: "agent-editor__workflow-connector", "aria-hidden": "true" }), _jsxs("button", { type: "button", className: "agent-editor__workflow-stage".concat(agentStatus === value ? " is-current" : ""), "aria-current": agentStatus === value ? "step" : undefined, "aria-pressed": agentStatus === value, disabled: creating || updating || agentStatus === value, onClick: function () { return void save(value); }, children: [_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" : "Click to move to this stage" })] }), agentStatus === value && _jsx("span", { className: "agent-editor__workflow-current", children: "Current" })] })] }, value);
655
668
  }) }), _jsx("small", { className: "agent-editor__workflow-save-hint", children: "Changing stage saves the current form and its linked skills, tools, roles, and secrets." })] })] }) },
656
669
  { value: "persona", label: "Persona", content: _jsxs("section", { className: "agent-editor__section agent-editor__persona", children: [_jsx("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." })] }) }), _jsx(SolidCodeEditor, { value: systemPrompt, onChange: function (value) { setSystemPrompt(value !== null && value !== void 0 ? value : ""); setErrors(function (current) { return (__assign(__assign({}, current), { systemPrompt: "" })); }); }, language: "markdown", fontSize: 11, height: "max(34rem, calc(100dvh - 18rem))" }), errors.systemPrompt && _jsx("small", { className: "agent-editor__error", children: errors.systemPrompt })] }) },
657
- { 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", 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) {
670
+ { 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) {
658
671
  var _a;
659
672
  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) {
660
673
  var _a;
661
674
  return (__assign(__assign({}, current), (_a = {}, _a[item.id] = checked, _a)));
662
675
  }); }, "Add the full skill to the agent prompt. Turn off to load it on demand.") });
663
676
  } }) },
664
- { 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)), onAdd: function (id) { return toggle(setToolIds, id); }, onRemove: function (id) { return toggle(setToolIds, id); }, createUrl: "/admin/core/solid-core/agent-tool-registry/editor/new", linkFor: function (id) { return linkForTarget(record === null || record === void 0 ? void 0 : record.agentTools, "agentToolRegistry", id); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
677
+ { 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)), onAdd: function (id) { return toggle(setToolIds, id); }, 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); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
665
678
  var _a;
666
679
  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) {
667
680
  var _a;
@@ -690,7 +703,7 @@ export function AgentRegistryEditorPage() {
690
703
  : _jsxs("div", { className: "agent-editor__empty", children: ["No ", label.toLowerCase(), " for this agent yet."] })] }) });
691
704
  }), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "sessions", label: "Sessions", content: _jsx(AgentSessionsPanel, { agentId: record.id, agentLabel: (_e = record.name) !== null && _e !== void 0 ? _e : record.title }) }] : []), 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((_f = getSettingsMap(settings).solidxAgentHubBackendUrl) !== null && _f !== void 0 ? _f : "") }) }] : []), true);
692
705
  var content = _jsx(SolidTabGroup, { tabs: tabs, value: tab, onValueChange: setTab, className: "agent-editor__tabs", listClassName: "agent-editor__tab-list", panelClassName: "agent-editor__tab-panel" });
693
- 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: isLoading || isFetching || isError || (id !== "new" && !(record === null || record === void 0 ? void 0 : record.id)), onClick: function () { return void save(); }, children: "Save Agent" })] })] }), _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." }) }) }), isLoading ? _jsx("div", { className: "agent-editor__empty", children: "Loading agent\u2026" }) : isError || (id !== "new" && !(record === null || record === void 0 ? void 0 : record.id)) ?
706
+ 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." }) }) }), isLoading ? _jsx("div", { className: "agent-editor__empty", children: "Loading agent\u2026" }) : isError || (id !== "new" && !(record === null || record === void 0 ? void 0 : record.id)) ?
694
707
  _jsx("div", { className: "agent-editor__empty", children: "This agent could not be loaded." }) : (record === null || record === void 0 ? void 0 : record.id) ?
695
708
  _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) {
696
709
  setPendingSecret(null);