@solidxai/core-ui 0.1.22-beta.3 → 0.1.22-beta.4
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/auth/AuthLayout.js +1 -1
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +1 -1
- package/dist/components/common/CancelButton.js +1 -1
- package/dist/components/common/CancelButton.js.map +1 -1
- package/dist/components/common/CancelButton.tsx +3 -3
- package/dist/components/common/SolidModuleHome.js +1 -1
- package/dist/components/common/SolidModuleHome.js.map +1 -1
- package/dist/components/common/SolidModuleHome.tsx +1 -1
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +1 -1
- package/dist/components/core/common/SolidCreateButton.js +1 -1
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +4 -4
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.module.css +51 -0
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts +2 -0
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js +20 -5
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.tsx +32 -4
- package/dist/components/core/form/SolidFormActionHeader.js +18 -18
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +28 -28
- package/dist/components/core/form/SolidFormViewShimmerLoading.js +1 -1
- package/dist/components/core/form/SolidFormViewShimmerLoading.js.map +1 -1
- package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +2 -2
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js +2 -2
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +2 -2
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +1 -1
- package/dist/components/core/list/SolidListView.js +1 -1
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +2 -2
- package/dist/components/core/list/SolidListViewConfigure.js +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +2 -2
- package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.d.ts +10 -0
- package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.d.ts.map +1 -0
- package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.js +35 -0
- package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.js.map +1 -0
- package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.module.css +46 -0
- package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.tsx +57 -0
- package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.d.ts +3 -0
- package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.d.ts.map +1 -0
- package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.js +9 -0
- package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.js.map +1 -0
- package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.tsx +32 -0
- package/dist/components/core/solid-agent/SolidAgent.module.css +25 -0
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts +4 -1
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.js +53 -50
- package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.tsx +51 -64
- package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts +4 -0
- package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.js +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentEmbedded.tsx +6 -2
- package/dist/components/core/solid-agent/agentEvents.d.ts +4 -0
- package/dist/components/core/solid-agent/agentEvents.d.ts.map +1 -1
- package/dist/components/core/solid-agent/agentEvents.js +126 -32
- package/dist/components/core/solid-agent/agentEvents.js.map +1 -1
- package/dist/components/core/solid-agent/agentEvents.ts +94 -3
- package/dist/components/core/solid-agent/client/agentAuth.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentAuth.js +27 -11
- package/dist/components/core/solid-agent/client/agentAuth.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentAuth.ts +10 -3
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts +2 -1
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.js +66 -27
- package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.ts +35 -3
- package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.js +6 -0
- package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.ts +6 -0
- package/dist/components/core/solid-agent/embed/agentWorkspace.d.ts +16 -0
- package/dist/components/core/solid-agent/embed/agentWorkspace.d.ts.map +1 -0
- package/dist/components/core/solid-agent/embed/agentWorkspace.js +16 -0
- package/dist/components/core/solid-agent/embed/agentWorkspace.js.map +1 -0
- package/dist/components/core/solid-agent/embed/agentWorkspace.ts +29 -0
- package/dist/components/core/solid-agent/humanReview.d.ts +19 -0
- package/dist/components/core/solid-agent/humanReview.d.ts.map +1 -0
- package/dist/components/core/solid-agent/humanReview.js +54 -0
- package/dist/components/core/solid-agent/humanReview.js.map +1 -0
- package/dist/components/core/solid-agent/humanReview.ts +63 -0
- package/dist/components/core/solid-agent/thread/AgentThread.d.ts +2 -1
- package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.js +17 -68
- package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.tsx +21 -106
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +4 -2
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +34 -12
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +33 -10
- package/dist/components/core/solid-agent/types.d.ts +6 -0
- package/dist/components/core/solid-agent/types.d.ts.map +1 -1
- package/dist/components/core/solid-agent/types.js.map +1 -1
- package/dist/components/core/solid-agent/types.ts +1 -0
- package/dist/components/core/solid-agent/useAgentChat.d.ts +1 -1
- package/dist/components/core/solid-agent/useAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/useAgentChat.js +3 -3
- package/dist/components/core/solid-agent/useAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/useAgentChat.ts +3 -3
- package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.d.ts +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.js +24 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.tsx +60 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.d.ts +7 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.js +39 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.tsx +96 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.d.ts +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.js +60 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.tsx +79 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.d.ts +7 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.js +18 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.tsx +30 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.d.ts +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.js +8 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.tsx +11 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.d.ts +8 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.js +41 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.tsx +99 -0
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js +2 -2
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.tsx +2 -2
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +10 -4
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +28 -5
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.d.ts +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +1 -1
- package/dist/components/core/tree/SolidTreeView.js +1 -1
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +2 -2
- package/dist/components/layout/AdminHeaderActions.js +1 -1
- package/dist/components/layout/AdminHeaderActions.js.map +1 -1
- package/dist/components/layout/AdminHeaderActions.tsx +1 -1
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +7 -1
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +21 -3
- package/dist/helpers/registry.d.ts +13 -1
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +77 -25
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +75 -25
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +4 -0
- package/dist/redux/features/agentSlice.d.ts.map +1 -1
- package/dist/redux/features/agentSlice.js +4 -1
- package/dist/redux/features/agentSlice.js.map +1 -1
- package/dist/redux/features/agentSlice.ts +3 -1
- package/dist/resources/solid-custom.css +24 -0
- package/dist/resources/solid-responsive.css +13 -0
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js +2 -2
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentConfigComparisonPage.tsx +3 -3
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.d.ts +13 -0
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.js +88 -0
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.tsx +71 -0
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.d.ts +2 -0
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.js +539 -0
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.module.css +87 -0
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.tsx +422 -0
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +47 -9
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +92 -37
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +125 -28
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +23 -20
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +4 -2
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +25 -23
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +4 -2
- package/dist/routes/pages/embed/AgentEmbedPage.d.ts.map +1 -1
- package/dist/routes/pages/embed/AgentEmbedPage.js +13 -5
- package/dist/routes/pages/embed/AgentEmbedPage.js.map +1 -1
- package/dist/routes/pages/embed/AgentEmbedPage.tsx +10 -2
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +2 -0
- package/dist/types/extension-registry.d.ts +7 -1
- package/dist/types/extension-registry.d.ts.map +1 -1
- package/dist/types/extension-registry.js +9 -1
- package/dist/types/extension-registry.js.map +1 -1
- package/dist/types/extension-registry.ts +10 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/solid-core.d.ts +30 -2
- package/package.json +3 -2
|
@@ -58,7 +58,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
58
58
|
import React from "react";
|
|
59
59
|
import { ArrowLeft, RefreshCw } from "lucide-react";
|
|
60
60
|
import { useDispatch } from "react-redux";
|
|
61
|
-
import { useNavigate, useParams } from "react-router-dom";
|
|
61
|
+
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
62
62
|
import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
|
|
63
63
|
import { hasAnyRole } from "../../../../helpers/rolesHelper";
|
|
64
64
|
import { useSession } from "../../../../hooks/useSession";
|
|
@@ -121,32 +121,34 @@ function getSaveErrorMessage(error) {
|
|
|
121
121
|
}
|
|
122
122
|
export function AgentToolRegistryEditorPage() {
|
|
123
123
|
var _this = this;
|
|
124
|
-
var _a, _b;
|
|
125
|
-
var
|
|
124
|
+
var _a, _b, _c;
|
|
125
|
+
var _d = useParams().id, id = _d === void 0 ? "" : _d;
|
|
126
|
+
var searchParams = useSearchParams()[0];
|
|
127
|
+
var initialName = id === "new" ? (_a = searchParams.get("name")) !== null && _a !== void 0 ? _a : "" : "";
|
|
126
128
|
var session = useSession().data;
|
|
127
|
-
var isAdmin = hasAnyRole((
|
|
129
|
+
var isAdmin = hasAnyRole((_b = session === null || session === void 0 ? void 0 : session.user) === null || _b === void 0 ? void 0 : _b.roles, ["Admin"]);
|
|
128
130
|
var navigate = useNavigate();
|
|
129
131
|
var dispatch = useDispatch();
|
|
130
132
|
var entityApi = React.useMemo(function () { return createSolidEntityApi("agentToolRegistry"); }, []);
|
|
131
133
|
var useCreateSolidEntityMutation = entityApi.useCreateSolidEntityMutation, useGetSolidEntityByIdQuery = entityApi.useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation = entityApi.useUpdateSolidEntityMutation;
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
var
|
|
134
|
+
var _e = useGetSolidEntityByIdQuery({ id: id, qs: "populate[0]=agentTools&populate[1]=agentTools.agentRegistry&populate[2]=tags&populate[3]=module" }, { skip: !id || id === "new" }), response = _e.data, isLoading = _e.isLoading, isFetching = _e.isFetching, refetch = _e.refetch;
|
|
135
|
+
var _f = useCreateSolidEntityMutation(), createTool = _f[0], isCreating = _f[1].isLoading;
|
|
136
|
+
var _g = useUpdateSolidEntityMutation(), updateTool = _g[0], isSaving = _g[1].isLoading;
|
|
135
137
|
var record = extractEntityRecord(response);
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
var
|
|
146
|
-
var
|
|
147
|
-
var
|
|
148
|
-
var
|
|
149
|
-
var
|
|
138
|
+
var _h = React.useState("general"), activeTab = _h[0], setActiveTab = _h[1];
|
|
139
|
+
var _j = React.useState(""), name = _j[0], setName = _j[1];
|
|
140
|
+
var _k = React.useState(""), iconName = _k[0], setIconName = _k[1];
|
|
141
|
+
var _l = React.useState(""), description = _l[0], setDescription = _l[1];
|
|
142
|
+
var _m = React.useState("custom"), type = _m[0], setType = _m[1];
|
|
143
|
+
var _o = React.useState(""), sourceCode = _o[0], setSourceCode = _o[1];
|
|
144
|
+
var _p = React.useState([]), tags = _p[0], setTags = _p[1];
|
|
145
|
+
var _q = React.useState(null), module = _q[0], setModule = _q[1];
|
|
146
|
+
var _r = React.useState(false), creatingTag = _r[0], setCreatingTag = _r[1];
|
|
147
|
+
var _s = React.useState({}), fieldErrors = _s[0], setFieldErrors = _s[1];
|
|
148
|
+
var _t = React.useState(0), auditRefreshVersion = _t[0], setAuditRefreshVersion = _t[1];
|
|
149
|
+
var _u = React.useState(false), confirmRefresh = _u[0], setConfirmRefresh = _u[1];
|
|
150
|
+
var _v = React.useState(false), activationOpen = _v[0], setActivationOpen = _v[1];
|
|
151
|
+
var _w = React.useState(null), activationTool = _w[0], setActivationTool = _w[1];
|
|
150
152
|
var preparingActivation = React.useRef(false);
|
|
151
153
|
var baseline = React.useRef("");
|
|
152
154
|
var currentForm = function () { var _a; return JSON.stringify({ name: name, iconName: iconName, description: description, type: type, sourceCode: sourceCode, tags: tags, moduleId: (_a = module === null || module === void 0 ? void 0 : module.id) !== null && _a !== void 0 ? _a : null }); };
|
|
@@ -154,7 +156,7 @@ export function AgentToolRegistryEditorPage() {
|
|
|
154
156
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
155
157
|
var nextTags = agentHubTagsFrom(record === null || record === void 0 ? void 0 : record.tags);
|
|
156
158
|
var nextModule = agentHubModuleFrom(record === null || record === void 0 ? void 0 : record.module);
|
|
157
|
-
setName((_a = record === null || record === void 0 ? void 0 : record.name) !== null && _a !== void 0 ? _a :
|
|
159
|
+
setName((_a = record === null || record === void 0 ? void 0 : record.name) !== null && _a !== void 0 ? _a : initialName);
|
|
158
160
|
setIconName((_b = record === null || record === void 0 ? void 0 : record.iconName) !== null && _b !== void 0 ? _b : "");
|
|
159
161
|
setDescription((_c = record === null || record === void 0 ? void 0 : record.description) !== null && _c !== void 0 ? _c : "");
|
|
160
162
|
setType((_d = record === null || record === void 0 ? void 0 : record.type) !== null && _d !== void 0 ? _d : "custom");
|
|
@@ -307,7 +309,7 @@ export function AgentToolRegistryEditorPage() {
|
|
|
307
309
|
}, [record === null || record === void 0 ? void 0 : record.agentTools]);
|
|
308
310
|
var sessionAgents = React.useMemo(function () { return agents.filter(function (agent) { return agent.id !== undefined && agent.id !== null; }); }, [agents]);
|
|
309
311
|
var tabs = __spreadArray([
|
|
310
|
-
{ value: "general", label: "General Info", content: _jsxs("fieldset", { className: "agent-tool-editor__general", disabled: isReadOnly, children: [isReadOnly && _jsx("p", { className: "agent-tool-editor__readonly-note", children: "SolidX tools cannot be edited." }), (record === null || record === void 0 ? void 0 : record.status) && _jsxs("section", { className: "agent-tool-editor__runtime-status".concat(record.status === "load_failed" ? " agent-tool-editor__runtime-status--failed" : ""), role: record.status === "load_failed" ? "alert" : "status", children: [_jsxs("div", { className: "agent-tool-editor__runtime-heading", children: [_jsx("strong", { children: "Runtime status" }), _jsx("span", { children: record.status.replace(/[_-]+/g, " ") })] }), record.status === "load_failed" ? _jsxs(_Fragment, { children: [_jsx("p", { children: "The AgentHub runtime could not load this tool. After correcting its source or checksum, restart linked agent processes so the runtime retries loading it." }), record.lastLoadError && _jsx("pre", { children: record.lastLoadError })] }) : _jsx("p", { children: record.lastLoadError || "No tool load error has been reported." })] }), _jsxs("div", { className: "agent-tool-editor__fields", children: [_jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Name ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: name, "aria-invalid": Boolean(fieldErrors.name), "aria-describedby": fieldErrors.name ? "agent-tool-name-error" : undefined, className: fieldErrors.name ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setName(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { name: "" })); }); } }), fieldErrors.name && _jsx("small", { id: "agent-tool-name-error", className: "agent-tool-editor__field-error", children: fieldErrors.name })] }), _jsxs("div", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Description ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: description, "aria-invalid": Boolean(fieldErrors.description), "aria-describedby": fieldErrors.description ? "agent-tool-description-error" : undefined, className: fieldErrors.description ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setDescription(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { description: "" })); }); } }), fieldErrors.description && _jsx("small", { id: "agent-tool-description-error", className: "agent-tool-editor__field-error", children: fieldErrors.description })] })] }), !(record === null || record === void 0 ? void 0 : record.id) && _jsxs("label", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Tool status" }), _jsx("select", { value: "inactive", disabled: true, "aria-label": "Tool status", children: _jsx("option", { value: "inactive", children: "Inactive" }) }), _jsx("small", { children: "New tools start inactive. Run configuration and initialization checks to activate." })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Tool type ", _jsx("b", { children: "*" })] }), _jsxs("select", { value: type, "aria-invalid": Boolean(fieldErrors.type), "aria-describedby": fieldErrors.type ? "agent-tool-type-error" : undefined, className: fieldErrors.type ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setType(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { type: "" })); }); }, children: [isReadOnly && _jsx("option", { value: "solidx", children: "SolidX" }), _jsx("option", { value: "thirdparty", children: "Third Party" }), _jsx("option", { value: "custom", children: "Custom" })] }), fieldErrors.type && _jsx("small", { id: "agent-tool-type-error", className: "agent-tool-editor__field-error", children: fieldErrors.type })] }), _jsx(AgentHubModuleField, { className: "agent-tool-editor__field", value: module, onChange: function (value) { setModule(value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { module: "" })); }); }, disabled: isReadOnly || isCreating || isSaving, clearable: false, required: true, error: fieldErrors.module }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, module: module, disabled: isReadOnly || isCreating || isSaving, onBusyChange: setCreatingTag }), (record === null || record === void 0 ? void 0 : record.id) && _jsxs("section", { className: "agent-tool-editor__workflow", "aria-labelledby": "agent-tool-lifecycle-title", children: [_jsx("div", { className: "agent-tool-editor__workflow-head", children: _jsxs("div", { children: [_jsx("h2", { id: "agent-tool-lifecycle-title", children: "Tool lifecycle" }), _jsx("p", { children: "Configuration and initialization must pass before this tool can be activated." })] }) }), _jsx("div", { className: "agent-tool-editor__workflow-stages", "aria-label": "Current tool stage: ".concat(((
|
|
312
|
+
{ value: "general", label: "General Info", content: _jsxs("fieldset", { className: "agent-tool-editor__general", disabled: isReadOnly, children: [isReadOnly && _jsx("p", { className: "agent-tool-editor__readonly-note", children: "SolidX tools cannot be edited." }), (record === null || record === void 0 ? void 0 : record.status) && _jsxs("section", { className: "agent-tool-editor__runtime-status".concat(record.status === "load_failed" ? " agent-tool-editor__runtime-status--failed" : ""), role: record.status === "load_failed" ? "alert" : "status", children: [_jsxs("div", { className: "agent-tool-editor__runtime-heading", children: [_jsx("strong", { children: "Runtime status" }), _jsx("span", { children: record.status.replace(/[_-]+/g, " ") })] }), record.status === "load_failed" ? _jsxs(_Fragment, { children: [_jsx("p", { children: "The AgentHub runtime could not load this tool. After correcting its source or checksum, restart linked agent processes so the runtime retries loading it." }), record.lastLoadError && _jsx("pre", { children: record.lastLoadError })] }) : _jsx("p", { children: record.lastLoadError || "No tool load error has been reported." })] }), _jsxs("div", { className: "agent-tool-editor__fields", children: [_jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Name ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: name, "aria-invalid": Boolean(fieldErrors.name), "aria-describedby": fieldErrors.name ? "agent-tool-name-error" : undefined, className: fieldErrors.name ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setName(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { name: "" })); }); } }), fieldErrors.name && _jsx("small", { id: "agent-tool-name-error", className: "agent-tool-editor__field-error", children: fieldErrors.name })] }), _jsxs("div", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Description ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: description, "aria-invalid": Boolean(fieldErrors.description), "aria-describedby": fieldErrors.description ? "agent-tool-description-error" : undefined, className: fieldErrors.description ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setDescription(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { description: "" })); }); } }), fieldErrors.description && _jsx("small", { id: "agent-tool-description-error", className: "agent-tool-editor__field-error", children: fieldErrors.description })] })] }), !(record === null || record === void 0 ? void 0 : record.id) && _jsxs("label", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Tool status" }), _jsx("select", { value: "inactive", disabled: true, "aria-label": "Tool status", children: _jsx("option", { value: "inactive", children: "Inactive" }) }), _jsx("small", { children: "New tools start inactive. Run configuration and initialization checks to activate." })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Tool type ", _jsx("b", { children: "*" })] }), _jsxs("select", { value: type, "aria-invalid": Boolean(fieldErrors.type), "aria-describedby": fieldErrors.type ? "agent-tool-type-error" : undefined, className: fieldErrors.type ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setType(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { type: "" })); }); }, children: [isReadOnly && _jsx("option", { value: "solidx", children: "SolidX" }), _jsx("option", { value: "thirdparty", children: "Third Party" }), _jsx("option", { value: "custom", children: "Custom" })] }), fieldErrors.type && _jsx("small", { id: "agent-tool-type-error", className: "agent-tool-editor__field-error", children: fieldErrors.type })] }), _jsx(AgentHubModuleField, { className: "agent-tool-editor__field", value: module, onChange: function (value) { setModule(value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { module: "" })); }); }, disabled: isReadOnly || isCreating || isSaving, clearable: false, required: true, error: fieldErrors.module }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, module: module, disabled: isReadOnly || isCreating || isSaving, onBusyChange: setCreatingTag }), (record === null || record === void 0 ? void 0 : record.id) && _jsxs("section", { className: "agent-tool-editor__workflow", "aria-labelledby": "agent-tool-lifecycle-title", children: [_jsx("div", { className: "agent-tool-editor__workflow-head", children: _jsxs("div", { children: [_jsx("h2", { id: "agent-tool-lifecycle-title", children: "Tool lifecycle" }), _jsx("p", { children: "Configuration and initialization must pass before this tool can be activated." })] }) }), _jsx("div", { className: "agent-tool-editor__workflow-stages", "aria-label": "Current tool stage: ".concat(((_c = record.status) !== null && _c !== void 0 ? _c : "inactive").replace(/[_-]+/g, " ")), children: [["active", "Active", "Enabled for loading into linked agents."], ["inactive", "Inactive", "Not loaded for linked agents."], ["load_failed", "Load failed", "AgentHub could not load this tool."]].map(function (_a, index) {
|
|
311
313
|
var _b;
|
|
312
314
|
var value = _a[0], label = _a[1], description = _a[2];
|
|
313
315
|
var currentStatus = (_b = record.status) !== null && _b !== void 0 ? _b : "inactive";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentToolRegistryEditorPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/adm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AyB,EAAC,aAAa,EAAC,6BAA6B,EAAC,cAAc,EAAC,8BAA8B,GAAG,GACzL,CAC3B,CAAC,CAAC,CAAC,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAC,yBAAyB,EAAC,aAAa,EAAC,6BAA6B,EAAC,cAAc,EAAC,8BAA8B,GAAG,IAChN,CAAC;AACV,CAAC","sourcesContent":["import React from \"react\";\nimport { ArrowLeft, RefreshCw } from \"lucide-react\";\nimport { useDispatch } from \"react-redux\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport { createSolidEntityApi } from \"../../../../redux/api/solidEntityApi\";\nimport { hasAnyRole } from \"../../../../helpers/rolesHelper\";\nimport { useSession } from \"../../../../hooks/useSession\";\nimport { showToast } from \"../../../../redux/features/toastSlice\";\nimport { solidPatch } from \"../../../../http/solidHttp\";\nimport { AgentRegistryAuditPanel } from \"./AgentRegistryAuditPanel\";\nimport { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload, type AgentHubTag } from \"./AgentHubTagsField\";\nimport { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload, type AgentHubModule } from \"./AgentHubModuleField\";\nimport { AgentToolActivationDialog } from \"./AgentToolActivationDialog\";\nimport { AgentToolSessionsPanel } from \"../../../../components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel\";\nimport { AgentRegistryCardWidget } from \"../../../../components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget\";\nimport { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidIconPicker, SolidInput, SolidTabGroup } from \"../../../../components/shad-cn-ui\";\nimport \"./AgentToolRegistryEditorPage.css\";\n\nconst SharedAgentRegistryCard = AgentRegistryCardWidget as React.ComponentType<{ rowData: Record<string, any> }>;\n\ntype Agent = { id?: number | string; name?: string; title?: string; [key: string]: any };\ntype AgentToolLink = { agentRegistry?: Agent | number | string | null };\ntype ToolRecord = {\n id: number;\n name?: string;\n iconName?: string | null;\n description?: string;\n tags?: AgentHubTag[];\n module?: AgentHubModule | null;\n type?: string;\n status?: string | null;\n lastLoadError?: string | null;\n sourceCode?: string;\n checksum?: string;\n agentTools?: AgentToolLink[] | AgentToolLink | null;\n};\n\nfunction extractEntityRecord(response: unknown): Record<string, any> | undefined {\n let candidate: unknown = response;\n for (let depth = 0; depth < 3; depth += 1) {\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const value = candidate as Record<string, unknown>;\n if (\"id\" in value || \"name\" in value) return value;\n candidate = value.data;\n }\n return candidate && typeof candidate === \"object\" ? candidate as Record<string, any> : undefined;\n}\n\nasync function sha256Hex(value: string): Promise<string> {\n const digest = await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(value));\n return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction formatErrorMessage(value: unknown): string | undefined {\n if (typeof value === \"string\") return value.trim() || undefined;\n if (Array.isArray(value)) {\n const messages = value.map(formatErrorMessage).filter((message): message is string => Boolean(message));\n return messages.length ? messages.join(\"; \") : undefined;\n }\n if (value && typeof value === \"object\") {\n const error = value as Record<string, unknown>;\n return formatErrorMessage(error.message)\n ?? formatErrorMessage(error.constraints)\n ?? formatErrorMessage(error.error);\n }\n return undefined;\n}\n\nfunction getSaveErrorMessage(error: unknown): string {\n if (!error || typeof error !== \"object\") return \"Failed to save tool.\";\n const apiError = error as Record<string, any>;\n return formatErrorMessage(apiError.data?.data?.message)\n ?? formatErrorMessage(apiError.data?.message)\n ?? formatErrorMessage(apiError.data?.error)\n ?? formatErrorMessage(apiError.message)\n ?? \"Failed to save tool.\";\n}\n\nexport function AgentToolRegistryEditorPage() {\n const { id = \"\" } = useParams<{ id: string }>();\n const { data: session } = useSession();\n const isAdmin = hasAnyRole(session?.user?.roles, [\"Admin\"]);\n const navigate = useNavigate();\n const dispatch = useDispatch();\n const entityApi = React.useMemo(() => createSolidEntityApi(\"agentToolRegistry\"), []);\n const { useCreateSolidEntityMutation, useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation } = entityApi;\n const { data: response, isLoading, isFetching, refetch } = useGetSolidEntityByIdQuery(\n { id, qs: \"populate[0]=agentTools&populate[1]=agentTools.agentRegistry&populate[2]=tags&populate[3]=module\" },\n { skip: !id || id === \"new\" },\n );\n const [createTool, { isLoading: isCreating }] = useCreateSolidEntityMutation();\n const [updateTool, { isLoading: isSaving }] = useUpdateSolidEntityMutation();\n const record = extractEntityRecord(response) as ToolRecord | undefined;\n const [activeTab, setActiveTab] = React.useState(\"general\");\n const [name, setName] = React.useState(\"\");\n const [iconName, setIconName] = React.useState(\"\");\n const [description, setDescription] = React.useState(\"\");\n const [type, setType] = React.useState(\"custom\");\n const [sourceCode, setSourceCode] = React.useState(\"\");\n const [tags, setTags] = React.useState<AgentHubTag[]>([]);\n const [module, setModule] = React.useState<AgentHubModule | null>(null);\n const [creatingTag, setCreatingTag] = React.useState(false);\n const [fieldErrors, setFieldErrors] = React.useState<Record<string, string>>({});\n const [auditRefreshVersion, setAuditRefreshVersion] = React.useState(0);\n const [confirmRefresh, setConfirmRefresh] = React.useState(false);\n const [activationOpen, setActivationOpen] = React.useState(false);\n const [activationTool, setActivationTool] = React.useState<{ id: number; checksum: string; name: string } | null>(null);\n const preparingActivation = React.useRef(false);\n const baseline = React.useRef(\"\");\n\n const currentForm = () => JSON.stringify({ name, iconName, description, type, sourceCode, tags, moduleId: module?.id ?? null });\n\n React.useEffect(() => {\n const nextTags = agentHubTagsFrom(record?.tags);\n const nextModule = agentHubModuleFrom(record?.module);\n setName(record?.name ?? \"\");\n setIconName(record?.iconName ?? \"\");\n setDescription(record?.description ?? \"\");\n setType(record?.type ?? \"custom\");\n setSourceCode(record?.sourceCode ?? \"\");\n setTags(nextTags);\n setModule(nextModule);\n baseline.current = JSON.stringify({ name: record?.name ?? \"\", iconName: record?.iconName ?? \"\", description: record?.description ?? \"\", type: record?.type ?? \"custom\", sourceCode: record?.sourceCode ?? \"\", tags: nextTags, moduleId: nextModule?.id ?? null });\n }, [record]);\n\n const isReadOnly = record?.type === \"solidx\";\n const isDirty = Boolean(record?.id) && currentForm() !== baseline.current;\n const requestRefresh = () => isDirty ? setConfirmRefresh(true) : void refetch();\n\n const save = async (nextStatus?: \"inactive\") => {\n if (creatingTag) return;\n const nextErrors: Record<string, string> = {};\n if (!name.trim()) nextErrors.name = \"Name is required.\";\n if (!description.trim()) nextErrors.description = \"Description is required.\";\n if (!type.trim()) nextErrors.type = \"Tool type is required.\";\n if (!sourceCode.trim()) nextErrors.sourceCode = \"Tool source code is required.\";\n if (!module) nextErrors.module = \"Module is required. Select a module before saving this tool.\";\n\n setFieldErrors(nextErrors);\n if (Object.keys(nextErrors).length > 0) {\n setActiveTab(nextErrors.sourceCode ? \"tool\" : \"general\");\n dispatch(showToast({ severity: \"error\", summary: \"Missing information\", detail: Object.values(nextErrors).join(\" \") }));\n return;\n }\n const payload = {\n name: name.trim(), iconName: iconName || null, description: description.trim(), type,\n sourceCode, ...agentHubTagsPayload(tags), ...agentHubModulePayload(module),\n ...([\"custom\", \"thirdparty\"].includes(type) ? { checksum: await sha256Hex(sourceCode) } : {}),\n status: nextStatus ?? (record && (sourceCode !== record.sourceCode || name.trim() !== record.name || type !== record.type)\n ? \"inactive\" : record?.status ?? \"inactive\"),\n };\n try {\n if (record?.id) {\n const result = await updateTool({ id: record.id, data: payload }).unwrap();\n dispatch(showToast({ severity: \"success\", summary: nextStatus ? \"Tool status updated\" : \"Saved\", detail: nextStatus ? `Tool moved to ${nextStatus}. Restart linked agent processes to apply the change.` : \"Tool updated successfully.\" }));\n setAuditRefreshVersion((version) => version + 1);\n refetch();\n return (extractEntityRecord(result) ?? { ...record, ...payload }) as ToolRecord;\n } else {\n const result: any = await createTool(payload).unwrap();\n const createdId = result?.data?.id ?? result?.id;\n dispatch(showToast({ severity: \"success\", summary: \"Created\", detail: \"Tool created successfully.\" }));\n if (createdId) navigate(`/admin/core/solid-core/agent-tool-registry/editor/${createdId}`, { replace: true });\n }\n } catch (error: any) {\n const errorDetail = getSaveErrorMessage(error);\n const serverFieldErrors: Record<string, string> = {};\n if (/required|not be empty|cannot be empty|should not be empty/i.test(errorDetail)) {\n for (const field of [\"name\", \"description\", \"type\", \"sourceCode\", \"module\"]) {\n if (!new RegExp(`\\\\b${field}\\\\b`, \"i\").test(errorDetail)) continue;\n const label = field === \"sourceCode\" ? \"Tool source code\" : field === \"module\" ? \"Module\" : field[0].toUpperCase() + field.slice(1);\n serverFieldErrors[field] = `${label} is required.`;\n }\n }\n if (Object.keys(serverFieldErrors).length > 0) {\n setFieldErrors(serverFieldErrors);\n setActiveTab(serverFieldErrors.sourceCode ? \"tool\" : \"general\");\n }\n dispatch(showToast({ severity: \"error\", summary: \"Save failed\", detail: errorDetail }));\n }\n };\n\n const beginActivation = async () => {\n if (isReadOnly) return;\n if (!record || activationOpen || isSaving || preparingActivation.current) return;\n preparingActivation.current = true;\n try {\n const saved = isDirty || record.status === \"load_failed\" ? await save(\"inactive\") : record;\n if (!saved?.id) return;\n const checksum = await sha256Hex(saved.sourceCode ?? sourceCode);\n setActivationTool({ id: saved.id, checksum, name: saved.name ?? name });\n setActivationOpen(true);\n } catch {\n dispatch(showToast({ severity: \"error\", summary: \"Activation failed\", detail: \"Could not prepare the saved tool source for checks.\" }));\n } finally {\n preparingActivation.current = false;\n }\n };\n\n const agents = React.useMemo(() => {\n const relatedTools = record?.agentTools;\n const links = Array.isArray(relatedTools) ? relatedTools : relatedTools ? [relatedTools] : [];\n const seen = new Set<string>();\n return links.map((link) => link.agentRegistry).filter((agent): agent is Agent => Boolean(agent && typeof agent === \"object\"))\n .filter((agent) => {\n const key = String(agent.id ?? agent.name ?? agent.title ?? \"\");\n if (!key || seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n }, [record?.agentTools]);\n const sessionAgents = React.useMemo(() => agents.filter((agent): agent is Agent & { id: number | string } => agent.id !== undefined && agent.id !== null), [agents]);\n const tabs = [\n { value: \"general\", label: \"General Info\", content: <fieldset className=\"agent-tool-editor__general\" disabled={isReadOnly}>\n {isReadOnly && <p className=\"agent-tool-editor__readonly-note\">SolidX tools cannot be edited.</p>}\n {record?.status && <section className={`agent-tool-editor__runtime-status${record.status === \"load_failed\" ? \" agent-tool-editor__runtime-status--failed\" : \"\"}`} role={record.status === \"load_failed\" ? \"alert\" : \"status\"}>\n <div className=\"agent-tool-editor__runtime-heading\"><strong>Runtime status</strong><span>{record.status.replace(/[_-]+/g, \" \")}</span></div>\n {record.status === \"load_failed\" ? <>\n <p>The AgentHub runtime could not load this tool. After correcting its source or checksum, restart linked agent processes so the runtime retries loading it.</p>\n {record.lastLoadError && <pre>{record.lastLoadError}</pre>}\n </> : <p>{record.lastLoadError || \"No tool load error has been reported.\"}</p>}\n </section>}\n <div className=\"agent-tool-editor__fields\">\n <label className=\"agent-tool-editor__field\"><span>Name <b>*</b></span><SolidInput value={name} aria-invalid={Boolean(fieldErrors.name)} aria-describedby={fieldErrors.name ? \"agent-tool-name-error\" : undefined} className={fieldErrors.name ? \"agent-tool-editor__input--invalid\" : undefined} onChange={(e) => { setName(e.target.value); setFieldErrors((current) => ({ ...current, name: \"\" })); }} />{fieldErrors.name && <small id=\"agent-tool-name-error\" className=\"agent-tool-editor__field-error\">{fieldErrors.name}</small>}</label>\n <div className=\"agent-tool-editor__field\"><span>Icon</span><SolidIconPicker value={iconName} onChange={setIconName} /></div>\n <label className=\"agent-tool-editor__field\"><span>Description <b>*</b></span><SolidInput value={description} aria-invalid={Boolean(fieldErrors.description)} aria-describedby={fieldErrors.description ? \"agent-tool-description-error\" : undefined} className={fieldErrors.description ? \"agent-tool-editor__input--invalid\" : undefined} onChange={(e) => { setDescription(e.target.value); setFieldErrors((current) => ({ ...current, description: \"\" })); }} />{fieldErrors.description && <small id=\"agent-tool-description-error\" className=\"agent-tool-editor__field-error\">{fieldErrors.description}</small>}</label>\n </div>\n {!record?.id && <label className=\"agent-tool-editor__field\"><span>Tool status</span><select value=\"inactive\" disabled aria-label=\"Tool status\"><option value=\"inactive\">Inactive</option></select><small>New tools start inactive. Run configuration and initialization checks to activate.</small></label>}\n <label className=\"agent-tool-editor__field\"><span>Tool type <b>*</b></span><select value={type} aria-invalid={Boolean(fieldErrors.type)} aria-describedby={fieldErrors.type ? \"agent-tool-type-error\" : undefined} className={fieldErrors.type ? \"agent-tool-editor__input--invalid\" : undefined} onChange={(e) => { setType(e.target.value); setFieldErrors((current) => ({ ...current, type: \"\" })); }}>\n {isReadOnly && <option value=\"solidx\">SolidX</option>}<option value=\"thirdparty\">Third Party</option><option value=\"custom\">Custom</option>\n </select>{fieldErrors.type && <small id=\"agent-tool-type-error\" className=\"agent-tool-editor__field-error\">{fieldErrors.type}</small>}</label>\n <AgentHubModuleField className=\"agent-tool-editor__field\" value={module} onChange={(value) => { setModule(value); setFieldErrors((current) => ({ ...current, module: \"\" })); }} disabled={isReadOnly || isCreating || isSaving} clearable={false} required error={fieldErrors.module} />\n <AgentHubTagsField value={tags} onChange={setTags} module={module} disabled={isReadOnly || isCreating || isSaving} onBusyChange={setCreatingTag} />\n {record?.id && <section className=\"agent-tool-editor__workflow\" aria-labelledby=\"agent-tool-lifecycle-title\">\n <div className=\"agent-tool-editor__workflow-head\"><div><h2 id=\"agent-tool-lifecycle-title\">Tool lifecycle</h2><p>Configuration and initialization must pass before this tool can be activated.</p></div></div>\n <div className=\"agent-tool-editor__workflow-stages\" aria-label={`Current tool stage: ${(record.status ?? \"inactive\").replace(/[_-]+/g, \" \")}`}>\n {([ [\"active\", \"Active\", \"Enabled for loading into linked agents.\"], [\"inactive\", \"Inactive\", \"Not loaded for linked agents.\"], [\"load_failed\", \"Load failed\", \"AgentHub could not load this tool.\"] ] as const).map(([value, label, description], index) => {\n const currentStatus = record.status ?? \"inactive\";\n const isCurrent = currentStatus === value;\n const canRetry = value === \"load_failed\" && isCurrent;\n const disabled = isReadOnly || activationOpen || isCreating || isSaving || (!canRetry && (value === \"load_failed\" || isCurrent));\n return <React.Fragment key={value}>\n {index > 0 && <div className=\"agent-tool-editor__workflow-connector\" aria-hidden=\"true\" />}\n <button type=\"button\" className={`agent-tool-editor__workflow-stage agent-tool-editor__workflow-stage--${value}${isCurrent ? \" is-current\" : \"\"}`}\n aria-current={isCurrent ? \"step\" : undefined} aria-pressed={isCurrent} disabled={disabled}\n onClick={() => value === \"inactive\" ? void save(\"inactive\") : void beginActivation()}>\n <span className=\"agent-tool-editor__workflow-mark\">{index + 1}</span>\n <span className=\"agent-tool-editor__workflow-copy\"><strong>{label}</strong><small>{description}</small><small className=\"agent-tool-editor__workflow-cta\">{canRetry ? \"Run checks and retry activation\" : isCurrent ? \"Current stage\" : value === \"load_failed\" ? \"Set automatically by AgentHub\" : value === \"active\" ? \"Run checks to activate\" : \"Click to deactivate\"}</small></span>\n {isCurrent && <span className=\"agent-tool-editor__workflow-current\">Current</span>}\n </button>\n </React.Fragment>;\n })}\n </div>\n {record.status === \"load_failed\" && <small className=\"agent-tool-editor__workflow-hint\">Fix the source or checksum, then run configuration and initialization checks before retrying activation.</small>}\n <small className=\"agent-tool-editor__workflow-hint\">Activation checks use the saved tool configuration. Restart linked agent processes to apply status changes.</small>\n </section>}\n </fieldset> },\n { value: \"tool\", label: \"Tool\", content: <div className=\"agent-tool-editor__tool\">\n <section className=\"agent-tool-editor__panel\">\n <header><h2>Tool source code <b>*</b></h2><p>Write the tool's Python code here.</p></header>\n <SolidCodeEditor value={sourceCode} onChange={(value) => { setSourceCode(value ?? \"\"); setFieldErrors((current) => ({ ...current, sourceCode: \"\" })); }} language=\"python\" wordWrap=\"on\" readOnly={isReadOnly} fontSize={11} height=\"max(32rem, calc(100dvh - 18rem))\" className={`agent-tool-editor__code${fieldErrors.sourceCode ? \" agent-tool-editor__code--invalid\" : \"\"}`} />\n {fieldErrors.sourceCode && <small className=\"agent-tool-editor__field-error agent-tool-editor__code-error\">{fieldErrors.sourceCode}</small>}\n </section>\n </div> },\n { value: \"agents\", label: \"Agents\", content: <section className=\"agent-tool-editor__agents\"><div><h2>Associated agents</h2><p>Agents linked to this tool. Associations are read-only here.</p></div>\n {isLoading ? <p>Loading associated agents…</p> : agents.length ? <div className=\"agent-tool-editor__agent-grid\">{agents.map((agent, index) => <div className=\"agent-tool-editor__agent-card\" key={String(agent.id ?? agent.name ?? index)}><SharedAgentRegistryCard rowData={agent} /></div>)}</div> : <div className=\"agent-tool-editor__empty\">No agents are currently associated with this tool.</div>}\n </section> },\n ...(isAdmin ? [{ value: \"sessions\", label: \"Sessions\", content: <AgentToolSessionsPanel agents={sessionAgents} /> }] : []),\n ];\n const visibleActiveTab = !isAdmin && activeTab === \"sessions\" ? \"general\" : activeTab;\n\n return <main className=\"agent-tool-editor\">\n <header className=\"agent-tool-editor__header\"><div><div className=\"agent-tool-editor__heading-with-refresh\"><h1>{record ? \"Edit Tool\" : \"Create Tool\"}</h1>{record?.id && <button type=\"button\" className={`agent-tool-editor__refresh${isFetching ? \" is-loading\" : \"\"}`} aria-label=\"Refresh tool\" title=\"Refresh tool\" disabled={isFetching || isSaving} onClick={requestRefresh}><RefreshCw size={14} /></button>}</div></div><div className=\"agent-tool-editor__actions\">\n <SolidButton variant=\"secondary\" leftIcon={<ArrowLeft size={16} />} onClick={() => navigate(-1)}>Back</SolidButton>\n {!isReadOnly && <SolidButton disabled={activationOpen || creatingTag} loading={isCreating || isSaving} onClick={() => void save()}>Save Tool</SolidButton>}\n </div></header>\n <SolidDialog open={confirmRefresh} onOpenChange={setConfirmRefresh} header=\"Discard unsaved changes?\" style={{ width: \"min(28rem, 94vw)\" }}\n footer={<><SolidButton type=\"button\" variant=\"secondary\" onClick={() => setConfirmRefresh(false)}>Cancel</SolidButton><SolidButton type=\"button\" disabled={isFetching} onClick={() => { setConfirmRefresh(false); void refetch(); }}>Refresh and discard</SolidButton></>}>\n <SolidDialogBody><p>You have unsaved changes. Refreshing will discard them and load the latest tool content.</p></SolidDialogBody>\n </SolidDialog>\n {activationOpen && activationTool && <AgentToolActivationDialog open={activationOpen} onOpenChange={setActivationOpen}\n toolId={activationTool.id} checksum={activationTool.checksum} toolName={activationTool.name}\n onActivated={async () => {\n await solidPatch(`/agent-tool-registry/${activationTool.id}`, { status: \"active\", checksum: activationTool.checksum });\n setAuditRefreshVersion((version) => version + 1);\n void refetch();\n dispatch(showToast({ severity: \"success\", summary: \"Tool activated\", detail: \"Configuration and initialization checks passed.\" }));\n }} />}\n {isLoading ? <div className=\"agent-tool-editor__loading\">Loading tool…</div> : record?.id ? (\n <AgentRegistryAuditPanel modelSingularName=\"agentToolRegistry\" recordId={record.id} refreshVersion={auditRefreshVersion} modelUserKey={record.name}>\n <SolidTabGroup tabs={tabs} value={visibleActiveTab} onValueChange={setActiveTab} className=\"agent-tool-editor__tabs\" listClassName=\"agent-tool-editor__tab-list\" panelClassName=\"agent-tool-editor__tab-panel\" />\n </AgentRegistryAuditPanel>\n ) : <SolidTabGroup tabs={tabs} value={visibleActiveTab} onValueChange={setActiveTab} className=\"agent-tool-editor__tabs\" listClassName=\"agent-tool-editor__tab-list\" panelClassName=\"agent-tool-editor__tab-panel\" />}\n </main>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AgentToolRegistryEditorPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;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A6B,EAAC,cAAc,EAAC,8BAA8B,GAAG,IAChN,CAAC;AACV,CAAC","sourcesContent":["import React from \"react\";\nimport { ArrowLeft, RefreshCw } from \"lucide-react\";\nimport { useDispatch } from \"react-redux\";\nimport { useNavigate, useParams, useSearchParams } from \"react-router-dom\";\nimport { createSolidEntityApi } from \"../../../../redux/api/solidEntityApi\";\nimport { hasAnyRole } from \"../../../../helpers/rolesHelper\";\nimport { useSession } from \"../../../../hooks/useSession\";\nimport { showToast } from \"../../../../redux/features/toastSlice\";\nimport { solidPatch } from \"../../../../http/solidHttp\";\nimport { AgentRegistryAuditPanel } from \"./AgentRegistryAuditPanel\";\nimport { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload, type AgentHubTag } from \"./AgentHubTagsField\";\nimport { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload, type AgentHubModule } from \"./AgentHubModuleField\";\nimport { AgentToolActivationDialog } from \"./AgentToolActivationDialog\";\nimport { AgentToolSessionsPanel } from \"../../../../components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel\";\nimport { AgentRegistryCardWidget } from \"../../../../components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget\";\nimport { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidIconPicker, SolidInput, SolidTabGroup } from \"../../../../components/shad-cn-ui\";\nimport \"./AgentToolRegistryEditorPage.css\";\n\nconst SharedAgentRegistryCard = AgentRegistryCardWidget as React.ComponentType<{ rowData: Record<string, any> }>;\n\ntype Agent = { id?: number | string; name?: string; title?: string; [key: string]: any };\ntype AgentToolLink = { agentRegistry?: Agent | number | string | null };\ntype ToolRecord = {\n id: number;\n name?: string;\n iconName?: string | null;\n description?: string;\n tags?: AgentHubTag[];\n module?: AgentHubModule | null;\n type?: string;\n status?: string | null;\n lastLoadError?: string | null;\n sourceCode?: string;\n checksum?: string;\n agentTools?: AgentToolLink[] | AgentToolLink | null;\n};\n\nfunction extractEntityRecord(response: unknown): Record<string, any> | undefined {\n let candidate: unknown = response;\n for (let depth = 0; depth < 3; depth += 1) {\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const value = candidate as Record<string, unknown>;\n if (\"id\" in value || \"name\" in value) return value;\n candidate = value.data;\n }\n return candidate && typeof candidate === \"object\" ? candidate as Record<string, any> : undefined;\n}\n\nasync function sha256Hex(value: string): Promise<string> {\n const digest = await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(value));\n return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction formatErrorMessage(value: unknown): string | undefined {\n if (typeof value === \"string\") return value.trim() || undefined;\n if (Array.isArray(value)) {\n const messages = value.map(formatErrorMessage).filter((message): message is string => Boolean(message));\n return messages.length ? messages.join(\"; \") : undefined;\n }\n if (value && typeof value === \"object\") {\n const error = value as Record<string, unknown>;\n return formatErrorMessage(error.message)\n ?? formatErrorMessage(error.constraints)\n ?? formatErrorMessage(error.error);\n }\n return undefined;\n}\n\nfunction getSaveErrorMessage(error: unknown): string {\n if (!error || typeof error !== \"object\") return \"Failed to save tool.\";\n const apiError = error as Record<string, any>;\n return formatErrorMessage(apiError.data?.data?.message)\n ?? formatErrorMessage(apiError.data?.message)\n ?? formatErrorMessage(apiError.data?.error)\n ?? formatErrorMessage(apiError.message)\n ?? \"Failed to save tool.\";\n}\n\nexport function AgentToolRegistryEditorPage() {\n const { id = \"\" } = useParams<{ id: string }>();\n const [searchParams] = useSearchParams();\n const initialName = id === \"new\" ? searchParams.get(\"name\") ?? \"\" : \"\";\n const { data: session } = useSession();\n const isAdmin = hasAnyRole(session?.user?.roles, [\"Admin\"]);\n const navigate = useNavigate();\n const dispatch = useDispatch();\n const entityApi = React.useMemo(() => createSolidEntityApi(\"agentToolRegistry\"), []);\n const { useCreateSolidEntityMutation, useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation } = entityApi;\n const { data: response, isLoading, isFetching, refetch } = useGetSolidEntityByIdQuery(\n { id, qs: \"populate[0]=agentTools&populate[1]=agentTools.agentRegistry&populate[2]=tags&populate[3]=module\" },\n { skip: !id || id === \"new\" },\n );\n const [createTool, { isLoading: isCreating }] = useCreateSolidEntityMutation();\n const [updateTool, { isLoading: isSaving }] = useUpdateSolidEntityMutation();\n const record = extractEntityRecord(response) as ToolRecord | undefined;\n const [activeTab, setActiveTab] = React.useState(\"general\");\n const [name, setName] = React.useState(\"\");\n const [iconName, setIconName] = React.useState(\"\");\n const [description, setDescription] = React.useState(\"\");\n const [type, setType] = React.useState(\"custom\");\n const [sourceCode, setSourceCode] = React.useState(\"\");\n const [tags, setTags] = React.useState<AgentHubTag[]>([]);\n const [module, setModule] = React.useState<AgentHubModule | null>(null);\n const [creatingTag, setCreatingTag] = React.useState(false);\n const [fieldErrors, setFieldErrors] = React.useState<Record<string, string>>({});\n const [auditRefreshVersion, setAuditRefreshVersion] = React.useState(0);\n const [confirmRefresh, setConfirmRefresh] = React.useState(false);\n const [activationOpen, setActivationOpen] = React.useState(false);\n const [activationTool, setActivationTool] = React.useState<{ id: number; checksum: string; name: string } | null>(null);\n const preparingActivation = React.useRef(false);\n const baseline = React.useRef(\"\");\n\n const currentForm = () => JSON.stringify({ name, iconName, description, type, sourceCode, tags, moduleId: module?.id ?? null });\n\n React.useEffect(() => {\n const nextTags = agentHubTagsFrom(record?.tags);\n const nextModule = agentHubModuleFrom(record?.module);\n setName(record?.name ?? initialName);\n setIconName(record?.iconName ?? \"\");\n setDescription(record?.description ?? \"\");\n setType(record?.type ?? \"custom\");\n setSourceCode(record?.sourceCode ?? \"\");\n setTags(nextTags);\n setModule(nextModule);\n baseline.current = JSON.stringify({ name: record?.name ?? \"\", iconName: record?.iconName ?? \"\", description: record?.description ?? \"\", type: record?.type ?? \"custom\", sourceCode: record?.sourceCode ?? \"\", tags: nextTags, moduleId: nextModule?.id ?? null });\n }, [record]);\n\n const isReadOnly = record?.type === \"solidx\";\n const isDirty = Boolean(record?.id) && currentForm() !== baseline.current;\n const requestRefresh = () => isDirty ? setConfirmRefresh(true) : void refetch();\n\n const save = async (nextStatus?: \"inactive\") => {\n if (creatingTag) return;\n const nextErrors: Record<string, string> = {};\n if (!name.trim()) nextErrors.name = \"Name is required.\";\n if (!description.trim()) nextErrors.description = \"Description is required.\";\n if (!type.trim()) nextErrors.type = \"Tool type is required.\";\n if (!sourceCode.trim()) nextErrors.sourceCode = \"Tool source code is required.\";\n if (!module) nextErrors.module = \"Module is required. Select a module before saving this tool.\";\n\n setFieldErrors(nextErrors);\n if (Object.keys(nextErrors).length > 0) {\n setActiveTab(nextErrors.sourceCode ? \"tool\" : \"general\");\n dispatch(showToast({ severity: \"error\", summary: \"Missing information\", detail: Object.values(nextErrors).join(\" \") }));\n return;\n }\n const payload = {\n name: name.trim(), iconName: iconName || null, description: description.trim(), type,\n sourceCode, ...agentHubTagsPayload(tags), ...agentHubModulePayload(module),\n ...([\"custom\", \"thirdparty\"].includes(type) ? { checksum: await sha256Hex(sourceCode) } : {}),\n status: nextStatus ?? (record && (sourceCode !== record.sourceCode || name.trim() !== record.name || type !== record.type)\n ? \"inactive\" : record?.status ?? \"inactive\"),\n };\n try {\n if (record?.id) {\n const result = await updateTool({ id: record.id, data: payload }).unwrap();\n dispatch(showToast({ severity: \"success\", summary: nextStatus ? \"Tool status updated\" : \"Saved\", detail: nextStatus ? `Tool moved to ${nextStatus}. Restart linked agent processes to apply the change.` : \"Tool updated successfully.\" }));\n setAuditRefreshVersion((version) => version + 1);\n refetch();\n return (extractEntityRecord(result) ?? { ...record, ...payload }) as ToolRecord;\n } else {\n const result: any = await createTool(payload).unwrap();\n const createdId = result?.data?.id ?? result?.id;\n dispatch(showToast({ severity: \"success\", summary: \"Created\", detail: \"Tool created successfully.\" }));\n if (createdId) navigate(`/admin/core/solid-core/agent-tool-registry/editor/${createdId}`, { replace: true });\n }\n } catch (error: any) {\n const errorDetail = getSaveErrorMessage(error);\n const serverFieldErrors: Record<string, string> = {};\n if (/required|not be empty|cannot be empty|should not be empty/i.test(errorDetail)) {\n for (const field of [\"name\", \"description\", \"type\", \"sourceCode\", \"module\"]) {\n if (!new RegExp(`\\\\b${field}\\\\b`, \"i\").test(errorDetail)) continue;\n const label = field === \"sourceCode\" ? \"Tool source code\" : field === \"module\" ? \"Module\" : field[0].toUpperCase() + field.slice(1);\n serverFieldErrors[field] = `${label} is required.`;\n }\n }\n if (Object.keys(serverFieldErrors).length > 0) {\n setFieldErrors(serverFieldErrors);\n setActiveTab(serverFieldErrors.sourceCode ? \"tool\" : \"general\");\n }\n dispatch(showToast({ severity: \"error\", summary: \"Save failed\", detail: errorDetail }));\n }\n };\n\n const beginActivation = async () => {\n if (isReadOnly) return;\n if (!record || activationOpen || isSaving || preparingActivation.current) return;\n preparingActivation.current = true;\n try {\n const saved = isDirty || record.status === \"load_failed\" ? await save(\"inactive\") : record;\n if (!saved?.id) return;\n const checksum = await sha256Hex(saved.sourceCode ?? sourceCode);\n setActivationTool({ id: saved.id, checksum, name: saved.name ?? name });\n setActivationOpen(true);\n } catch {\n dispatch(showToast({ severity: \"error\", summary: \"Activation failed\", detail: \"Could not prepare the saved tool source for checks.\" }));\n } finally {\n preparingActivation.current = false;\n }\n };\n\n const agents = React.useMemo(() => {\n const relatedTools = record?.agentTools;\n const links = Array.isArray(relatedTools) ? relatedTools : relatedTools ? [relatedTools] : [];\n const seen = new Set<string>();\n return links.map((link) => link.agentRegistry).filter((agent): agent is Agent => Boolean(agent && typeof agent === \"object\"))\n .filter((agent) => {\n const key = String(agent.id ?? agent.name ?? agent.title ?? \"\");\n if (!key || seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n }, [record?.agentTools]);\n const sessionAgents = React.useMemo(() => agents.filter((agent): agent is Agent & { id: number | string } => agent.id !== undefined && agent.id !== null), [agents]);\n const tabs = [\n { value: \"general\", label: \"General Info\", content: <fieldset className=\"agent-tool-editor__general\" disabled={isReadOnly}>\n {isReadOnly && <p className=\"agent-tool-editor__readonly-note\">SolidX tools cannot be edited.</p>}\n {record?.status && <section className={`agent-tool-editor__runtime-status${record.status === \"load_failed\" ? \" agent-tool-editor__runtime-status--failed\" : \"\"}`} role={record.status === \"load_failed\" ? \"alert\" : \"status\"}>\n <div className=\"agent-tool-editor__runtime-heading\"><strong>Runtime status</strong><span>{record.status.replace(/[_-]+/g, \" \")}</span></div>\n {record.status === \"load_failed\" ? <>\n <p>The AgentHub runtime could not load this tool. After correcting its source or checksum, restart linked agent processes so the runtime retries loading it.</p>\n {record.lastLoadError && <pre>{record.lastLoadError}</pre>}\n </> : <p>{record.lastLoadError || \"No tool load error has been reported.\"}</p>}\n </section>}\n <div className=\"agent-tool-editor__fields\">\n <label className=\"agent-tool-editor__field\"><span>Name <b>*</b></span><SolidInput value={name} aria-invalid={Boolean(fieldErrors.name)} aria-describedby={fieldErrors.name ? \"agent-tool-name-error\" : undefined} className={fieldErrors.name ? \"agent-tool-editor__input--invalid\" : undefined} onChange={(e) => { setName(e.target.value); setFieldErrors((current) => ({ ...current, name: \"\" })); }} />{fieldErrors.name && <small id=\"agent-tool-name-error\" className=\"agent-tool-editor__field-error\">{fieldErrors.name}</small>}</label>\n <div className=\"agent-tool-editor__field\"><span>Icon</span><SolidIconPicker value={iconName} onChange={setIconName} /></div>\n <label className=\"agent-tool-editor__field\"><span>Description <b>*</b></span><SolidInput value={description} aria-invalid={Boolean(fieldErrors.description)} aria-describedby={fieldErrors.description ? \"agent-tool-description-error\" : undefined} className={fieldErrors.description ? \"agent-tool-editor__input--invalid\" : undefined} onChange={(e) => { setDescription(e.target.value); setFieldErrors((current) => ({ ...current, description: \"\" })); }} />{fieldErrors.description && <small id=\"agent-tool-description-error\" className=\"agent-tool-editor__field-error\">{fieldErrors.description}</small>}</label>\n </div>\n {!record?.id && <label className=\"agent-tool-editor__field\"><span>Tool status</span><select value=\"inactive\" disabled aria-label=\"Tool status\"><option value=\"inactive\">Inactive</option></select><small>New tools start inactive. Run configuration and initialization checks to activate.</small></label>}\n <label className=\"agent-tool-editor__field\"><span>Tool type <b>*</b></span><select value={type} aria-invalid={Boolean(fieldErrors.type)} aria-describedby={fieldErrors.type ? \"agent-tool-type-error\" : undefined} className={fieldErrors.type ? \"agent-tool-editor__input--invalid\" : undefined} onChange={(e) => { setType(e.target.value); setFieldErrors((current) => ({ ...current, type: \"\" })); }}>\n {isReadOnly && <option value=\"solidx\">SolidX</option>}<option value=\"thirdparty\">Third Party</option><option value=\"custom\">Custom</option>\n </select>{fieldErrors.type && <small id=\"agent-tool-type-error\" className=\"agent-tool-editor__field-error\">{fieldErrors.type}</small>}</label>\n <AgentHubModuleField className=\"agent-tool-editor__field\" value={module} onChange={(value) => { setModule(value); setFieldErrors((current) => ({ ...current, module: \"\" })); }} disabled={isReadOnly || isCreating || isSaving} clearable={false} required error={fieldErrors.module} />\n <AgentHubTagsField value={tags} onChange={setTags} module={module} disabled={isReadOnly || isCreating || isSaving} onBusyChange={setCreatingTag} />\n {record?.id && <section className=\"agent-tool-editor__workflow\" aria-labelledby=\"agent-tool-lifecycle-title\">\n <div className=\"agent-tool-editor__workflow-head\"><div><h2 id=\"agent-tool-lifecycle-title\">Tool lifecycle</h2><p>Configuration and initialization must pass before this tool can be activated.</p></div></div>\n <div className=\"agent-tool-editor__workflow-stages\" aria-label={`Current tool stage: ${(record.status ?? \"inactive\").replace(/[_-]+/g, \" \")}`}>\n {([ [\"active\", \"Active\", \"Enabled for loading into linked agents.\"], [\"inactive\", \"Inactive\", \"Not loaded for linked agents.\"], [\"load_failed\", \"Load failed\", \"AgentHub could not load this tool.\"] ] as const).map(([value, label, description], index) => {\n const currentStatus = record.status ?? \"inactive\";\n const isCurrent = currentStatus === value;\n const canRetry = value === \"load_failed\" && isCurrent;\n const disabled = isReadOnly || activationOpen || isCreating || isSaving || (!canRetry && (value === \"load_failed\" || isCurrent));\n return <React.Fragment key={value}>\n {index > 0 && <div className=\"agent-tool-editor__workflow-connector\" aria-hidden=\"true\" />}\n <button type=\"button\" className={`agent-tool-editor__workflow-stage agent-tool-editor__workflow-stage--${value}${isCurrent ? \" is-current\" : \"\"}`}\n aria-current={isCurrent ? \"step\" : undefined} aria-pressed={isCurrent} disabled={disabled}\n onClick={() => value === \"inactive\" ? void save(\"inactive\") : void beginActivation()}>\n <span className=\"agent-tool-editor__workflow-mark\">{index + 1}</span>\n <span className=\"agent-tool-editor__workflow-copy\"><strong>{label}</strong><small>{description}</small><small className=\"agent-tool-editor__workflow-cta\">{canRetry ? \"Run checks and retry activation\" : isCurrent ? \"Current stage\" : value === \"load_failed\" ? \"Set automatically by AgentHub\" : value === \"active\" ? \"Run checks to activate\" : \"Click to deactivate\"}</small></span>\n {isCurrent && <span className=\"agent-tool-editor__workflow-current\">Current</span>}\n </button>\n </React.Fragment>;\n })}\n </div>\n {record.status === \"load_failed\" && <small className=\"agent-tool-editor__workflow-hint\">Fix the source or checksum, then run configuration and initialization checks before retrying activation.</small>}\n <small className=\"agent-tool-editor__workflow-hint\">Activation checks use the saved tool configuration. Restart linked agent processes to apply status changes.</small>\n </section>}\n </fieldset> },\n { value: \"tool\", label: \"Tool\", content: <div className=\"agent-tool-editor__tool\">\n <section className=\"agent-tool-editor__panel\">\n <header><h2>Tool source code <b>*</b></h2><p>Write the tool's Python code here.</p></header>\n <SolidCodeEditor value={sourceCode} onChange={(value) => { setSourceCode(value ?? \"\"); setFieldErrors((current) => ({ ...current, sourceCode: \"\" })); }} language=\"python\" wordWrap=\"on\" readOnly={isReadOnly} fontSize={11} height=\"max(32rem, calc(100dvh - 18rem))\" className={`agent-tool-editor__code${fieldErrors.sourceCode ? \" agent-tool-editor__code--invalid\" : \"\"}`} />\n {fieldErrors.sourceCode && <small className=\"agent-tool-editor__field-error agent-tool-editor__code-error\">{fieldErrors.sourceCode}</small>}\n </section>\n </div> },\n { value: \"agents\", label: \"Agents\", content: <section className=\"agent-tool-editor__agents\"><div><h2>Associated agents</h2><p>Agents linked to this tool. Associations are read-only here.</p></div>\n {isLoading ? <p>Loading associated agents…</p> : agents.length ? <div className=\"agent-tool-editor__agent-grid\">{agents.map((agent, index) => <div className=\"agent-tool-editor__agent-card\" key={String(agent.id ?? agent.name ?? index)}><SharedAgentRegistryCard rowData={agent} /></div>)}</div> : <div className=\"agent-tool-editor__empty\">No agents are currently associated with this tool.</div>}\n </section> },\n ...(isAdmin ? [{ value: \"sessions\", label: \"Sessions\", content: <AgentToolSessionsPanel agents={sessionAgents} /> }] : []),\n ];\n const visibleActiveTab = !isAdmin && activeTab === \"sessions\" ? \"general\" : activeTab;\n\n return <main className=\"agent-tool-editor\">\n <header className=\"agent-tool-editor__header\"><div><div className=\"agent-tool-editor__heading-with-refresh\"><h1>{record ? \"Edit Tool\" : \"Create Tool\"}</h1>{record?.id && <button type=\"button\" className={`agent-tool-editor__refresh${isFetching ? \" is-loading\" : \"\"}`} aria-label=\"Refresh tool\" title=\"Refresh tool\" disabled={isFetching || isSaving} onClick={requestRefresh}><RefreshCw size={14} /></button>}</div></div><div className=\"agent-tool-editor__actions\">\n <SolidButton variant=\"secondary\" leftIcon={<ArrowLeft size={16} />} onClick={() => navigate(-1)}>Back</SolidButton>\n {!isReadOnly && <SolidButton disabled={activationOpen || creatingTag} loading={isCreating || isSaving} onClick={() => void save()}>Save Tool</SolidButton>}\n </div></header>\n <SolidDialog open={confirmRefresh} onOpenChange={setConfirmRefresh} header=\"Discard unsaved changes?\" style={{ width: \"min(28rem, 94vw)\" }}\n footer={<><SolidButton type=\"button\" variant=\"secondary\" onClick={() => setConfirmRefresh(false)}>Cancel</SolidButton><SolidButton type=\"button\" disabled={isFetching} onClick={() => { setConfirmRefresh(false); void refetch(); }}>Refresh and discard</SolidButton></>}>\n <SolidDialogBody><p>You have unsaved changes. Refreshing will discard them and load the latest tool content.</p></SolidDialogBody>\n </SolidDialog>\n {activationOpen && activationTool && <AgentToolActivationDialog open={activationOpen} onOpenChange={setActivationOpen}\n toolId={activationTool.id} checksum={activationTool.checksum} toolName={activationTool.name}\n onActivated={async () => {\n await solidPatch(`/agent-tool-registry/${activationTool.id}`, { status: \"active\", checksum: activationTool.checksum });\n setAuditRefreshVersion((version) => version + 1);\n void refetch();\n dispatch(showToast({ severity: \"success\", summary: \"Tool activated\", detail: \"Configuration and initialization checks passed.\" }));\n }} />}\n {isLoading ? <div className=\"agent-tool-editor__loading\">Loading tool…</div> : record?.id ? (\n <AgentRegistryAuditPanel modelSingularName=\"agentToolRegistry\" recordId={record.id} refreshVersion={auditRefreshVersion} modelUserKey={record.name}>\n <SolidTabGroup tabs={tabs} value={visibleActiveTab} onValueChange={setActiveTab} className=\"agent-tool-editor__tabs\" listClassName=\"agent-tool-editor__tab-list\" panelClassName=\"agent-tool-editor__tab-panel\" />\n </AgentRegistryAuditPanel>\n ) : <SolidTabGroup tabs={tabs} value={visibleActiveTab} onValueChange={setActiveTab} className=\"agent-tool-editor__tabs\" listClassName=\"agent-tool-editor__tab-list\" panelClassName=\"agent-tool-editor__tab-panel\" />}\n </main>;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ArrowLeft, RefreshCw } from "lucide-react";
|
|
3
3
|
import { useDispatch } from "react-redux";
|
|
4
|
-
import { useNavigate, useParams } from "react-router-dom";
|
|
4
|
+
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
5
5
|
import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
|
|
6
6
|
import { hasAnyRole } from "../../../../helpers/rolesHelper";
|
|
7
7
|
import { useSession } from "../../../../hooks/useSession";
|
|
@@ -78,6 +78,8 @@ function getSaveErrorMessage(error: unknown): string {
|
|
|
78
78
|
|
|
79
79
|
export function AgentToolRegistryEditorPage() {
|
|
80
80
|
const { id = "" } = useParams<{ id: string }>();
|
|
81
|
+
const [searchParams] = useSearchParams();
|
|
82
|
+
const initialName = id === "new" ? searchParams.get("name") ?? "" : "";
|
|
81
83
|
const { data: session } = useSession();
|
|
82
84
|
const isAdmin = hasAnyRole(session?.user?.roles, ["Admin"]);
|
|
83
85
|
const navigate = useNavigate();
|
|
@@ -113,7 +115,7 @@ export function AgentToolRegistryEditorPage() {
|
|
|
113
115
|
React.useEffect(() => {
|
|
114
116
|
const nextTags = agentHubTagsFrom(record?.tags);
|
|
115
117
|
const nextModule = agentHubModuleFrom(record?.module);
|
|
116
|
-
setName(record?.name ??
|
|
118
|
+
setName(record?.name ?? initialName);
|
|
117
119
|
setIconName(record?.iconName ?? "");
|
|
118
120
|
setDescription(record?.description ?? "");
|
|
119
121
|
setType(record?.type ?? "custom");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentEmbedPage.d.ts","sourceRoot":"","sources":["../../../../src/routes/pages/embed/AgentEmbedPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentEmbedPage.d.ts","sourceRoot":"","sources":["../../../../src/routes/pages/embed/AgentEmbedPage.tsx"],"names":[],"mappings":"AAkBA,4GAA4G;AAC5G,wBAAgB,cAAc,4CAwN7B"}
|
|
@@ -19,6 +19,7 @@ import { SolidAgentEmbedded } from "../../../components/core/solid-agent/SolidAg
|
|
|
19
19
|
import { onAgentPublicEvent } from "../../../components/core/solid-agent/client/agentPublicEvents";
|
|
20
20
|
import { registerExternalAgentAuth, renewExternalAgentAuth } from "../../../components/core/solid-agent/client/agentAuth";
|
|
21
21
|
import { EMBED_CHANNEL, EMBED_PUBLIC_PROTOCOL_VERSION, MissingAgentInputsError, validateBootstrap, validateEmbedInputs, validateMessageContext } from "../../../components/core/solid-agent/embed/agentEmbedProtocol";
|
|
22
|
+
import { parseAgentWorkspaceState } from "../../../components/core/solid-agent/embed/agentWorkspace";
|
|
22
23
|
import styles from "./AgentEmbedPage.module.css";
|
|
23
24
|
/** Request IDs correlate iframe messages; they are not credentials and need not be cryptographic. */
|
|
24
25
|
function createEmbedRequestId() {
|
|
@@ -32,9 +33,11 @@ export function AgentEmbedPage() {
|
|
|
32
33
|
var agentId = Number(useParams().agentId);
|
|
33
34
|
var store = useState(function () { return configureStore({ reducer: { solidAgent: agentReducer } }); })[0];
|
|
34
35
|
var _c = useState(null), bootstrap = _c[0], setBootstrap = _c[1];
|
|
35
|
-
var _d = useState(
|
|
36
|
-
var _e = useState(
|
|
37
|
-
var _f = useState(
|
|
36
|
+
var _d = useState(), agentName = _d[0], setAgentName = _d[1];
|
|
37
|
+
var _e = useState(null), workspace = _e[0], setWorkspace = _e[1];
|
|
38
|
+
var _f = useState({}), inputs = _f[0], setInputs = _f[1];
|
|
39
|
+
var _g = useState(""), error = _g[0], setError = _g[1];
|
|
40
|
+
var _h = useState([]), missingInputs = _h[0], setMissingInputs = _h[1];
|
|
38
41
|
var locked = useRef(false);
|
|
39
42
|
var schema = useRef(null);
|
|
40
43
|
var contextRequests = useRef(new Map());
|
|
@@ -138,6 +141,8 @@ export function AgentEmbedPage() {
|
|
|
138
141
|
setInputs(data.inputs);
|
|
139
142
|
}
|
|
140
143
|
schema.current = next;
|
|
144
|
+
setAgentName(typeof data.agentName === "string" && data.agentName.trim() ? data.agentName.trim() : undefined);
|
|
145
|
+
setWorkspace(parseAgentWorkspaceState(data.workspace));
|
|
141
146
|
setBootstrap(next);
|
|
142
147
|
setError("");
|
|
143
148
|
setMissingInputs([]);
|
|
@@ -155,6 +160,9 @@ export function AgentEmbedPage() {
|
|
|
155
160
|
send("error", { error: message });
|
|
156
161
|
}
|
|
157
162
|
}
|
|
163
|
+
else if (data.type === "workspace_state") {
|
|
164
|
+
setWorkspace(parseAgentWorkspaceState(data.workspace));
|
|
165
|
+
}
|
|
158
166
|
else if (data.type === "set_inputs") {
|
|
159
167
|
try {
|
|
160
168
|
if (locked.current)
|
|
@@ -206,7 +214,7 @@ export function AgentEmbedPage() {
|
|
|
206
214
|
send("close"); };
|
|
207
215
|
window.addEventListener("keydown", onKey);
|
|
208
216
|
send("ready", { protocolVersion: EMBED_PUBLIC_PROTOCOL_VERSION,
|
|
209
|
-
capabilities: ["inlinePanel", "asyncBeforeSend", "messageContextV1", "publicCommands"] });
|
|
217
|
+
capabilities: ["inlinePanel", "asyncBeforeSend", "messageContextV1", "publicCommands", "workspaceControlsV1"] });
|
|
210
218
|
void renewExternalAgentAuth(agentUrl).then(function () {
|
|
211
219
|
console.info("[agent-embed][iframe] initial auth renewal completed");
|
|
212
220
|
}).catch(function (failure) {
|
|
@@ -227,7 +235,7 @@ export function AgentEmbedPage() {
|
|
|
227
235
|
registration.dispose();
|
|
228
236
|
};
|
|
229
237
|
}, [agentId, agentUrl, instanceId, parentOrigin, send, relayRuntimeEvent]);
|
|
230
|
-
return _jsx(Provider, { store: store, children: _jsxs("main", { className: styles.page, children: [missingInputs.length > 0 ? (_jsx("section", { role: "alert", className: styles.errorPage, children: _jsxs("div", { className: styles.errorCard, children: [_jsx("span", { className: styles.errorMark, "aria-hidden": "true", children: "!" }), _jsx("p", { className: styles.errorEyebrow, children: "Agent setup required" }), _jsx("h1", { children: "This agent needs input values" }), _jsx("p", { className: styles.errorCopy, children: "The chat could not start because the host application did not provide all required inputs." }), _jsxs("div", { className: styles.missingInputs, children: [_jsx("strong", { children: "Missing inputs" }), _jsx("ul", { children: missingInputs.map(function (name) { return _jsx("li", { children: _jsx("code", { children: name }) }, name); }) })] }), _jsxs("p", { className: styles.errorHint, children: ["Update the SDK integration to pass these values in its ", _jsx("code", { children: "inputs" }), " option, then open the chat again."] }), _jsx("button", { type: "button", className: styles.errorClose, onClick: function () { return send("close"); }, children: "Close chat" })] }) })) : error ? (_jsx("section", { role: "alert", className: styles.errorPage, children: _jsxs("div", { className: styles.errorCard, children: [_jsx("span", { className: styles.errorMark, "aria-hidden": "true", children: "!" }), _jsx("p", { className: styles.errorEyebrow, children: "Connection problem" }), _jsx("h1", { children: "We couldn\u2019t start this chat" }), _jsx("p", { className: styles.errorCopy, children: error }), _jsx("button", { type: "button", className: styles.reconnect, onClick: function () { return void renewExternalAgentAuth(agentUrl).catch(function () { }); }, children: "Try again" })] }) })) : null, bootstrap ? _jsx(SolidAgentEmbedded, { agentRuntime: "agentHub", agentId: agentId, title: bootstrap.title, inputs: inputs, height: "100%", externalEmbed: { agentUrl: agentUrl, sessionOwnerKey: String(bootstrap.user.id), beforeSend: beforeSend, onInputsLocked: function (value) { locked.current = value; send("inputs_locked", { locked: value }); } } })
|
|
238
|
+
return _jsx(Provider, { store: store, children: _jsxs("main", { className: styles.page, children: [missingInputs.length > 0 ? (_jsx("section", { role: "alert", className: styles.errorPage, children: _jsxs("div", { className: styles.errorCard, children: [_jsx("span", { className: styles.errorMark, "aria-hidden": "true", children: "!" }), _jsx("p", { className: styles.errorEyebrow, children: "Agent setup required" }), _jsx("h1", { children: "This agent needs input values" }), _jsx("p", { className: styles.errorCopy, children: "The chat could not start because the host application did not provide all required inputs." }), _jsxs("div", { className: styles.missingInputs, children: [_jsx("strong", { children: "Missing inputs" }), _jsx("ul", { children: missingInputs.map(function (name) { return _jsx("li", { children: _jsx("code", { children: name }) }, name); }) })] }), _jsxs("p", { className: styles.errorHint, children: ["Update the SDK integration to pass these values in its ", _jsx("code", { children: "inputs" }), " option, then open the chat again."] }), _jsx("button", { type: "button", className: styles.errorClose, onClick: function () { return send("close"); }, children: "Close chat" })] }) })) : error ? (_jsx("section", { role: "alert", className: styles.errorPage, children: _jsxs("div", { className: styles.errorCard, children: [_jsx("span", { className: styles.errorMark, "aria-hidden": "true", children: "!" }), _jsx("p", { className: styles.errorEyebrow, children: "Connection problem" }), _jsx("h1", { children: "We couldn\u2019t start this chat" }), _jsx("p", { className: styles.errorCopy, children: error }), _jsx("button", { type: "button", className: styles.reconnect, onClick: function () { return void renewExternalAgentAuth(agentUrl).catch(function () { }); }, children: "Try again" })] }) })) : null, bootstrap ? _jsx(SolidAgentEmbedded, { agentRuntime: "agentHub", agentId: agentId, agentName: agentName, title: bootstrap.title, inputs: inputs, height: "100%", workspaceControls: workspace ? __assign(__assign({}, workspace), { onAction: function (action, nextAgentName) { return send("workspace_request", { action: action, agentName: nextAgentName }); } }) : undefined, externalEmbed: { agentUrl: agentUrl, sessionOwnerKey: String(bootstrap.user.id), beforeSend: beforeSend, onInputsLocked: function (value) { locked.current = value; send("inputs_locked", { locked: value }); } } })
|
|
231
239
|
: !error && missingInputs.length === 0 && _jsx("div", { className: styles.loading, role: "status", "aria-live": "polite", children: _jsxs("div", { className: styles.loadingCard, children: [_jsx("span", { className: styles.spinner, "aria-hidden": "true" }), _jsx("span", { className: styles.loadingTitle, children: "Please wait" }), _jsx("span", { className: styles.loadingMessage, children: "Connecting to your assistant" })] }) })] }) });
|
|
232
240
|
}
|
|
233
241
|
//# sourceMappingURL=AgentEmbedPage.js.map
|