@solidxai/core-ui 0.1.22-beta.2 → 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.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +27 -24
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +15 -8
- 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/module/ModulePackageDialog.d.ts.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.js +28 -22
- package/dist/components/core/module/ModulePackageDialog.js.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.tsx +24 -2
- package/dist/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/globals.css +10 -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 +52 -9
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +144 -79
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +139 -33
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.css +29 -0
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +26 -21
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +14 -7
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +42 -27
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +12 -5
- 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
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ArrowLeft, Ellipsis, ExternalLink, Eye, FlaskConical, GitBranch, Pencil, Plus, RefreshCw, Trash2 } from "lucide-react";
|
|
2
|
+
import { ArrowLeft, Ellipsis, ExternalLink, Eye, FlaskConical, GitBranch, LayoutGrid, List, Pencil, Plus, RefreshCw, Search, Trash2 } from "lucide-react";
|
|
3
3
|
import { useDispatch } from "react-redux";
|
|
4
4
|
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
5
5
|
import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
|
|
6
6
|
import { solidPost } from "../../../../http/solidHttp";
|
|
7
7
|
import { useGetSolidSettingsQuery } from "../../../../redux/api/solidSettingsApi";
|
|
8
|
+
import { hasAnyRole } from "../../../../helpers/rolesHelper";
|
|
9
|
+
import { useSession } from "../../../../hooks/useSession";
|
|
8
10
|
import { getSettingsMap } from "../../../../helpers/settingsPayload";
|
|
9
11
|
import { showToast } from "../../../../redux/features/toastSlice";
|
|
10
12
|
import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
|
|
13
|
+
import { AgentDeploymentPanel, type AgentDeployment } from "./AgentDeploymentPanel";
|
|
11
14
|
import { AgentPersonaHistory } from "./AgentPersonaHistory";
|
|
12
15
|
import { AgentConfigVersionsPanel } from "./AgentConfigVersionsPanel";
|
|
13
16
|
import { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload, type AgentHubTag } from "./AgentHubTagsField";
|
|
14
17
|
import { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload, type AgentHubModule } from "./AgentHubModuleField";
|
|
15
|
-
import { AgentResourceCardWidget } from "../../../../components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget";
|
|
18
|
+
import { AgentResourceCardWidget, AgentResourceRowWidget } from "../../../../components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget";
|
|
16
19
|
import { AgentSessionsPanel } from "../../../../components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel";
|
|
17
20
|
import { AgentProcessesPanel } from "../../../../components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel";
|
|
18
21
|
import type { SolidKanbanCardWidgetProps } from "../../../../types/solid-core";
|
|
@@ -28,7 +31,7 @@ import "./AgentRegistryEditorPage.css";
|
|
|
28
31
|
type Item = { id: number; name?: string; title?: string; displayName?: string; description?: string; iconName?: string; key?: string; module?: { id?: number; displayName?: string }; [key: string]: any };
|
|
29
32
|
type Link = { id: number; agentSkillRegistry?: Item; agentToolRegistry?: Item; roleMetadata?: Item; secret?: Item; envVarName?: string; alwaysInclude?: boolean; requiresApproval?: boolean };
|
|
30
33
|
type Input = { name: string; description: string; dataType: string; defaultValue?: unknown; optional: boolean };
|
|
31
|
-
type Agent = Item & {
|
|
34
|
+
type Agent = Item & AgentDeployment & {
|
|
32
35
|
configVersion?: number;
|
|
33
36
|
systemPrompt?: string; requiredInputs?: string; reasoningModelKey?: string; fastModelKey?: string; status?: string;
|
|
34
37
|
stepLimit?: number; turnStepLimit?: number; costLimit?: number;
|
|
@@ -172,6 +175,7 @@ function fieldsQuery(fields: string[]): string {
|
|
|
172
175
|
const detailFields = [
|
|
173
176
|
"id", "name", "title", "description", "iconName", "systemPrompt", "requiredInputs",
|
|
174
177
|
"reasoningModelKey", "fastModelKey", "status", "stepLimit", "turnStepLimit", "costLimit", "configVersion",
|
|
178
|
+
"runner", "minProcesses", "maxProcesses", "processCpu", "processMemory",
|
|
175
179
|
];
|
|
176
180
|
|
|
177
181
|
const detailQuery = [
|
|
@@ -295,38 +299,125 @@ function ResourcePreviewDialog({ item, kind, onClose }: { item: Item; kind: "ski
|
|
|
295
299
|
</SolidDialog>;
|
|
296
300
|
}
|
|
297
301
|
|
|
298
|
-
|
|
302
|
+
type ResourceView = "card" | "list";
|
|
303
|
+
|
|
304
|
+
const itemLabel = (item: Item) => String(item.name ?? item.displayName ?? item.key ?? "");
|
|
305
|
+
const itemMatches = (item: Item, query: string) => `${itemLabel(item)} ${item.description ?? ""}`.toLowerCase().includes(query);
|
|
306
|
+
|
|
307
|
+
function AddLinksDialog({ label, options, selected, createUrl, onClose, onConfirm }: {
|
|
308
|
+
label: string; options: Item[]; selected: Item[]; createUrl?: string;
|
|
309
|
+
onClose: () => void; onConfirm: (ids: number[]) => void;
|
|
310
|
+
}) {
|
|
311
|
+
const [search, setSearch] = React.useState("");
|
|
312
|
+
const [picked, setPicked] = React.useState<number[]>([]);
|
|
313
|
+
const plural = label.toLowerCase();
|
|
314
|
+
const singular = plural.slice(0, -1);
|
|
315
|
+
const typedName = search.trim();
|
|
316
|
+
const query = typedName.toLowerCase();
|
|
317
|
+
const linkedIds = new Set(selected.map((item) => item.id));
|
|
318
|
+
const pickedIds = new Set(picked);
|
|
319
|
+
const visible = options.filter((item) => !linkedIds.has(item.id) && itemMatches(item, query));
|
|
320
|
+
const visiblePicked = visible.filter((item) => pickedIds.has(item.id)).length;
|
|
321
|
+
const allPicked = visible.length > 0 && visiblePicked === visible.length;
|
|
322
|
+
const canCreate = Boolean(createUrl && query) && ![...options, ...selected].some((item) => itemLabel(item).toLowerCase() === query);
|
|
323
|
+
const togglePicked = (id: number) => setPicked((current) => current.includes(id) ? current.filter((value) => value !== id) : [...current, id]);
|
|
324
|
+
const toggleAll = () => {
|
|
325
|
+
const ids = visible.map((item) => item.id);
|
|
326
|
+
setPicked((current) => allPicked ? current.filter((id) => !ids.includes(id)) : Array.from(new Set([...current, ...ids])));
|
|
327
|
+
};
|
|
328
|
+
return <SolidDialog open onOpenChange={(next) => { if (!next) onClose(); }} header={`Add ${plural}`} style={{ width: "min(34rem, 94vw)" }}
|
|
329
|
+
footer={<><SolidButton type="button" variant="secondary" onClick={onClose}>Cancel</SolidButton>
|
|
330
|
+
<SolidButton type="button" disabled={!picked.length} onClick={() => { onConfirm(picked); onClose(); }}>{picked.length ? `Add ${picked.length} ${picked.length === 1 ? singular : plural}` : `Add ${plural}`}</SolidButton></>}>
|
|
331
|
+
<SolidDialogBody><div className="agent-editor__add-dialog">
|
|
332
|
+
<SolidInput autoFocus value={search} placeholder={`Search ${plural}…`} aria-label={`Search ${plural}`} onChange={(event) => setSearch(event.target.value)} />
|
|
333
|
+
<div className="agent-editor__add-options" role="group" aria-label={`Available ${plural}`}>
|
|
334
|
+
{visible.length > 0 && <label className="agent-editor__add-option agent-editor__add-option--all">
|
|
335
|
+
<input type="checkbox" checked={allPicked} ref={(element) => { if (element) element.indeterminate = visiblePicked > 0 && !allPicked; }} onChange={toggleAll} />
|
|
336
|
+
<span><strong>Select all ({visible.length})</strong></span>
|
|
337
|
+
</label>}
|
|
338
|
+
{visible.map((item) => <label className="agent-editor__add-option" key={item.id}>
|
|
339
|
+
<input type="checkbox" checked={pickedIds.has(item.id)} onChange={() => togglePicked(item.id)} />
|
|
340
|
+
<span><strong title={itemLabel(item)}>{itemLabel(item)}</strong>{item.description && <small title={item.description}>{item.description}</small>}</span>
|
|
341
|
+
</label>)}
|
|
342
|
+
{!visible.length && !canCreate && <p className="agent-editor__add-empty">No available {plural} found.</p>}
|
|
343
|
+
{canCreate && <a className="agent-editor__add-create" href={`${createUrl}?name=${encodeURIComponent(typedName)}`} target="_blank" rel="noopener noreferrer">
|
|
344
|
+
<Plus size={16} aria-hidden="true" /><strong>Create a new {singular} "{typedName}"</strong><ExternalLink size={14} aria-hidden="true" />
|
|
345
|
+
</a>}
|
|
346
|
+
</div>
|
|
347
|
+
</div></SolidDialogBody>
|
|
348
|
+
</SolidDialog>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function LinkPicker({ label, description, options, selected, onAdd, onAddMany, onRemove, createUrl, render, renderSettings, linkFor, onView, editUrlFor, compact, view, onViewChange, renderRow }: {
|
|
299
352
|
label: string; description: string; options: Item[]; selected: Item[];
|
|
300
|
-
onAdd
|
|
353
|
+
onAdd?: (id: number) => void; onAddMany?: (ids: number[]) => void; onRemove: (id: number) => void; createUrl?: string;
|
|
301
354
|
render: (item: Item, link?: Link) => React.ReactNode;
|
|
302
355
|
renderSettings?: (item: Item, link?: Link) => React.ReactNode;
|
|
303
356
|
linkFor?: (id: number) => Link | undefined;
|
|
304
357
|
onView?: (item: Item) => void;
|
|
305
358
|
editUrlFor?: (item: Item) => string;
|
|
359
|
+
compact?: boolean;
|
|
360
|
+
view?: ResourceView;
|
|
361
|
+
onViewChange?: (view: ResourceView) => void;
|
|
362
|
+
renderRow?: (item: Item) => React.ReactNode;
|
|
306
363
|
}) {
|
|
307
364
|
const [search, setSearch] = React.useState("");
|
|
308
365
|
const [open, setOpen] = React.useState(false);
|
|
366
|
+
const [searchOpen, setSearchOpen] = React.useState(false);
|
|
367
|
+
const [addOpen, setAddOpen] = React.useState(false);
|
|
368
|
+
const pickerRef = React.useRef<HTMLDivElement>(null);
|
|
309
369
|
const showAssociatedCount = label === "Skills" || label === "Tools";
|
|
310
|
-
const
|
|
311
|
-
|
|
370
|
+
const typedName = search.trim();
|
|
371
|
+
const query = typedName.toLowerCase();
|
|
372
|
+
const available = options.filter((item) => !selected.some((selectedItem) => selectedItem.id === item.id) && itemMatches(item, query)).slice(0, 20);
|
|
373
|
+
const visibleSelected = selected.filter((item) => itemMatches(item, query));
|
|
374
|
+
const isList = view === "list" && Boolean(renderRow);
|
|
375
|
+
const closeSearch = () => { setSearchOpen(false); setSearch(""); };
|
|
376
|
+
|
|
377
|
+
React.useEffect(() => {
|
|
378
|
+
if (!open) return;
|
|
379
|
+
const dismiss = (event: Event) => {
|
|
380
|
+
if (!pickerRef.current?.contains(event.target as Node)) setOpen(false);
|
|
381
|
+
};
|
|
382
|
+
document.addEventListener("pointerdown", dismiss);
|
|
383
|
+
document.addEventListener("focusin", dismiss);
|
|
384
|
+
return () => {
|
|
385
|
+
document.removeEventListener("pointerdown", dismiss);
|
|
386
|
+
document.removeEventListener("focusin", dismiss);
|
|
387
|
+
};
|
|
388
|
+
}, [open]);
|
|
389
|
+
|
|
312
390
|
return <section className="agent-editor__section">
|
|
313
|
-
<div className="agent-
|
|
314
|
-
|
|
391
|
+
<div className="agent-editor__picker-bar">
|
|
392
|
+
<div className="agent-editor__picker-heading"><div className="agent-editor__picker-title"><h2>{label}</h2>
|
|
393
|
+
{showAssociatedCount && <div className="agent-editor__linked-count" role="status">
|
|
394
|
+
({query ? `${visibleSelected.length} of ${selected.length}` : selected.length})
|
|
395
|
+
</div>}
|
|
396
|
+
</div>
|
|
397
|
+
<p title={description}>{description}</p>
|
|
315
398
|
</div>
|
|
316
|
-
{
|
|
317
|
-
{
|
|
318
|
-
|
|
319
|
-
|
|
399
|
+
{onAddMany ? <div className="agent-editor__picker-actions">
|
|
400
|
+
{searchOpen && <SolidInput className="agent-editor__list-search" autoFocus value={search} placeholder={`Search linked ${label.toLowerCase()}…`} aria-label={`Search linked ${label.toLowerCase()}`}
|
|
401
|
+
onChange={(event) => setSearch(event.target.value)} onBlur={() => { if (!search.trim()) closeSearch(); }} onKeyDown={(event) => { if (event.key === "Escape") closeSearch(); }} />}
|
|
402
|
+
<button type="button" className="agent-editor__icon-button" aria-label={searchOpen ? "Close search" : `Search linked ${label.toLowerCase()}`} title={searchOpen ? "Close search" : `Search linked ${label.toLowerCase()}`} aria-expanded={searchOpen}
|
|
403
|
+
onMouseDown={(event) => event.preventDefault()} onClick={() => { if (searchOpen) closeSearch(); else setSearchOpen(true); }}><Search size={16} /></button>
|
|
404
|
+
<button type="button" className="agent-editor__icon-button" aria-label={`Add ${label.toLowerCase()}`} title={`Add ${label.toLowerCase()}`} aria-haspopup="dialog" onClick={() => setAddOpen(true)}><Plus size={16} /></button>
|
|
405
|
+
</div> : <div className="agent-editor__picker" ref={pickerRef}>
|
|
320
406
|
<SolidInput value={search} placeholder={`Search and add ${label.toLowerCase()}…`} aria-label={`Search ${label.toLowerCase()}`}
|
|
321
|
-
onFocus={() => setOpen(true)} onChange={(event) => { setSearch(event.target.value); setOpen(true); }} />
|
|
407
|
+
onFocus={() => setOpen(true)} onClick={() => setOpen(true)} onChange={(event) => { setSearch(event.target.value); setOpen(true); }} />
|
|
322
408
|
{open && <div className="agent-editor__picker-results">
|
|
323
|
-
{available.length ? available.map((item) => <button type="button" key={item.id} onClick={() => { onAdd(item.id); setSearch(""); setOpen(false); }}>
|
|
409
|
+
{available.length ? available.map((item) => <button type="button" key={item.id} onClick={() => { onAdd?.(item.id); setSearch(""); setOpen(false); }}>
|
|
324
410
|
<strong>{item.name ?? item.displayName ?? item.key}</strong><span>{item.description}</span>
|
|
325
411
|
</button>) : <p>No available {label.toLowerCase()} found.</p>}
|
|
326
412
|
</div>}
|
|
413
|
+
</div>}
|
|
414
|
+
{view && onViewChange && renderRow && <div className="agent-editor__view-toggle" role="group" aria-label={`${label} view`}>
|
|
415
|
+
<button type="button" aria-label="List view" title="List view" aria-pressed={view === "list"} onClick={() => onViewChange("list")}><List size={16} /></button>
|
|
416
|
+
<button type="button" aria-label="Card view" title="Card view" aria-pressed={view === "card"} onClick={() => onViewChange("card")}><LayoutGrid size={16} /></button>
|
|
417
|
+
</div>}
|
|
327
418
|
</div>
|
|
328
|
-
{
|
|
329
|
-
<div className="agent-editor__card-content">{render(item, linkFor?.(item.id))}</div>
|
|
419
|
+
{visibleSelected.length ? <div className={isList ? "agent-editor__list" : "agent-editor__cards"}>{visibleSelected.map((item) => <div className={`agent-editor__linked-card${compact || isList ? " agent-editor__linked-card--compact" : ""}`} key={item.id}>
|
|
420
|
+
<div className="agent-editor__card-content">{isList ? renderRow?.(item) : render(item, linkFor?.(item.id))}</div>
|
|
330
421
|
{renderSettings?.(item, linkFor?.(item.id))}
|
|
331
422
|
{onView && editUrlFor ? <SolidDropdownMenu>
|
|
332
423
|
<SolidDropdownMenuTrigger asChild><button type="button" className="agent-editor__resource-menu-trigger" aria-label={`Actions for ${item.name ?? item.displayName ?? item.key}`}><Ellipsis size={18} /></button></SolidDropdownMenuTrigger>
|
|
@@ -336,12 +427,15 @@ function LinkPicker({ label, description, options, selected, onAdd, onRemove, cr
|
|
|
336
427
|
<SolidDropdownMenuItem className="agent-editor__resource-delete" onSelect={() => onRemove(item.id)}><Trash2 size={16} /> Delete</SolidDropdownMenuItem>
|
|
337
428
|
</SolidDropdownMenuContent>
|
|
338
429
|
</SolidDropdownMenu> : <button type="button" aria-label={`Remove ${item.name ?? item.displayName ?? item.key}`} onClick={() => onRemove(item.id)}><Trash2 size={16} /></button>}
|
|
339
|
-
</div>)}</div> : <div className="agent-editor__empty">No {label.toLowerCase()} linked yet
|
|
430
|
+
</div>)}</div> : <div className="agent-editor__empty">{selected.length ? `No linked ${label.toLowerCase()} match "${typedName}".` : `No ${label.toLowerCase()} linked yet.`}</div>}
|
|
431
|
+
{addOpen && onAddMany && <AddLinksDialog label={label} options={options} selected={selected} createUrl={createUrl} onClose={() => setAddOpen(false)} onConfirm={onAddMany} />}
|
|
340
432
|
</section>;
|
|
341
433
|
}
|
|
342
434
|
|
|
343
435
|
export function AgentRegistryEditorPage() {
|
|
344
436
|
const { id = "new" } = useParams<{ id: string }>();
|
|
437
|
+
const { data: session } = useSession();
|
|
438
|
+
const isAdmin = hasAnyRole(session?.user?.roles, ["Admin"]);
|
|
345
439
|
const [searchParams] = useSearchParams();
|
|
346
440
|
const navigate = useNavigate();
|
|
347
441
|
const dispatch = useDispatch();
|
|
@@ -381,6 +475,7 @@ export function AgentRegistryEditorPage() {
|
|
|
381
475
|
const [updateSecretLink] = agentSecretApi.useUpdateSolidEntityMutation();
|
|
382
476
|
const record = recordFrom(response) as Agent | undefined;
|
|
383
477
|
const [tab, setTab] = React.useState(searchParams.get("tab") === "config-versions" ? "config-versions" : "basics");
|
|
478
|
+
const [previewSystemPrompt, setPreviewSystemPrompt] = React.useState(false);
|
|
384
479
|
const jobs = jobApi.useGetSolidEntitiesQuery(
|
|
385
480
|
`offset=0&limit=1000&filters[agent][id][$eq]=${encodeURIComponent(id)}&${fieldsQuery(["id", "status"])}`,
|
|
386
481
|
{ skip: id === "new" || tab !== "jobs" });
|
|
@@ -440,6 +535,7 @@ export function AgentRegistryEditorPage() {
|
|
|
440
535
|
const [alwaysIncludeValues, setAlwaysIncludeValues] = React.useState<Record<number, boolean>>({});
|
|
441
536
|
const [requiresApprovalValues, setRequiresApprovalValues] = React.useState<Record<number, boolean>>({});
|
|
442
537
|
const [secretEnvVarNames, setSecretEnvVarNames] = React.useState<Record<number, string>>({});
|
|
538
|
+
const [resourceView, setResourceView] = React.useState<ResourceView>("list");
|
|
443
539
|
const [pendingSecret, setPendingSecret] = React.useState<Item | null>(null);
|
|
444
540
|
const [secretEnvVarDraft, setSecretEnvVarDraft] = React.useState("");
|
|
445
541
|
const [secretEnvVarError, setSecretEnvVarError] = React.useState("");
|
|
@@ -549,6 +645,8 @@ export function AgentRegistryEditorPage() {
|
|
|
549
645
|
};
|
|
550
646
|
const toggle = (setter: React.Dispatch<React.SetStateAction<number[]>>, value: number) =>
|
|
551
647
|
setter((current) => current.includes(value) ? current.filter((id) => id !== value) : [...current, value]);
|
|
648
|
+
const addAll = (setter: React.Dispatch<React.SetStateAction<number[]>>, values: number[]) =>
|
|
649
|
+
setter((current) => Array.from(new Set([...current, ...values])));
|
|
552
650
|
|
|
553
651
|
const syncLinks = async (agentId: number, previous: Link[] | undefined, selected: number[], field: string,
|
|
554
652
|
create: any, remove: any, update: any, extra: Record<string, unknown> | ((targetId: number) => Record<string, unknown>) = {}) => {
|
|
@@ -585,7 +683,7 @@ export function AgentRegistryEditorPage() {
|
|
|
585
683
|
if (stepLimit < 1 || turnStepLimit < 1 || costLimit < 0) next.limits = "Step limits must be positive and cost limit cannot be negative.";
|
|
586
684
|
setErrors(next);
|
|
587
685
|
if (Object.keys(next).length) {
|
|
588
|
-
setTab(next.systemPrompt ? "persona" : next.limits ? "policies" : "basics");
|
|
686
|
+
setTab(next.systemPrompt ? "persona" : next.limits && isAdmin ? "policies" : "basics");
|
|
589
687
|
dispatch(showToast({ severity: "error", summary: "Missing information", detail: Object.values(next).join(" ") }));
|
|
590
688
|
return false;
|
|
591
689
|
}
|
|
@@ -689,7 +787,7 @@ export function AgentRegistryEditorPage() {
|
|
|
689
787
|
setSecretEnvVarError("");
|
|
690
788
|
};
|
|
691
789
|
const linkSetting = (label: string, checked: boolean, onChange: (checked: boolean) => void, hint: string) =>
|
|
692
|
-
<label className="agent-editor__link-setting"><input type="checkbox" checked={checked} onChange={(event) => onChange(event.target.checked)} /><span><strong>{label}</strong><small>{hint}</small></span></label>;
|
|
790
|
+
<label className="agent-editor__link-setting" title={hint}><input type="checkbox" checked={checked} onChange={(event) => onChange(event.target.checked)} /><span><strong>{label}</strong><small>{hint}</small></span></label>;
|
|
693
791
|
const agentStatus = record?.status ?? "draft";
|
|
694
792
|
const activationRemainingMs = Math.max(0, (activationReadyAt ?? 0) - countdownNow);
|
|
695
793
|
const activationRemainingSeconds = Math.ceil(activationRemainingMs / 1000);
|
|
@@ -753,20 +851,25 @@ export function AgentRegistryEditorPage() {
|
|
|
753
851
|
</section>
|
|
754
852
|
</div> },
|
|
755
853
|
{ value: "persona", label: "System Prompt", content: <section className="agent-editor__section agent-editor__persona"><div className="agent-editor__section-head"><div><h2>System prompt *</h2><p>Describe the agent's role, behavior, and instructions in Markdown.</p></div>
|
|
756
|
-
|
|
757
|
-
|
|
854
|
+
<div className="agent-editor__persona-actions"><button type="button" className="agent-editor__persona-preview-toggle" aria-pressed={previewSystemPrompt} aria-label={previewSystemPrompt ? "Edit system prompt" : "Preview system prompt"} title={previewSystemPrompt ? "Edit system prompt" : "Preview system prompt"} onClick={() => setPreviewSystemPrompt((current) => !current)}>
|
|
855
|
+
{previewSystemPrompt ? <Pencil size={15} aria-hidden="true" /> : <Eye size={15} aria-hidden="true" />}
|
|
856
|
+
</button>{record?.id && <AgentPersonaHistory agentId={record.id} savedPrompt={record.systemPrompt ?? ""} refreshVersion={auditVersion} />}</div></div>
|
|
857
|
+
{previewSystemPrompt ? <div className="agent-editor__persona-preview" role="region" aria-label="System prompt preview">{systemPrompt.trim() ? <SolidAgentMarkdown text={systemPrompt} /> : <p className="agent-editor__hint">Nothing to preview yet.</p>}</div>
|
|
858
|
+
: <SolidCodeEditor value={systemPrompt} onChange={(value) => { setSystemPrompt(value ?? ""); setErrors((current) => ({ ...current, systemPrompt: "" })); }} language="markdown" wordWrap="on" fontSize={11} height="max(34rem, calc(100dvh - 18rem))" />}
|
|
758
859
|
{errors.systemPrompt && <small className="agent-editor__error">{errors.systemPrompt}</small>}</section> },
|
|
759
860
|
{ value: "skills", label: "Skills", content: <LinkPicker label="Skills" description="Skills available to this agent." options={skills.records} selected={linked(skillIds, skills.records, items(record?.agentSkills).map((link) => link.agentSkillRegistry).filter(Boolean))}
|
|
760
|
-
|
|
861
|
+
onAddMany={(ids) => addAll(setSkillIds, ids)} onRemove={(id) => toggle(setSkillIds, id)} createUrl="/admin/core/solid-core/agent-skill-registry/editor/new"
|
|
761
862
|
onView={(item) => setPreview({ item, kind: "skill" })} editUrlFor={(item) => `/admin/core/solid-core/agent-skill-registry/editor/${item.id}`}
|
|
762
863
|
linkFor={(id) => linkForTarget(record?.agentSkills, "agentSkillRegistry", id)}
|
|
864
|
+
view={resourceView} onViewChange={setResourceView} renderRow={(item) => <AgentResourceRowWidget rowData={item} />}
|
|
763
865
|
render={(item) => <AgentResourceCardWidget {...({ rowData: item } as SolidKanbanCardWidgetProps)} />}
|
|
764
866
|
renderSettings={(item) => <div className="agent-editor__link-settings">{linkSetting("Always include", alwaysIncludeValues[item.id] ?? true,
|
|
765
867
|
(checked) => setAlwaysIncludeValues((current) => ({ ...current, [item.id]: checked })), "Add the full skill to the agent prompt. Turn off to load it on demand.")}</div>} /> },
|
|
766
868
|
{ value: "tools", label: "Tools", content: <LinkPicker label="Tools" description="Tools available to this agent." options={tools.records} selected={linked(toolIds, tools.records, items(record?.agentTools).map((link) => link.agentToolRegistry).filter(Boolean))}
|
|
767
|
-
|
|
869
|
+
onAddMany={(ids) => addAll(setToolIds, ids)} onRemove={(id) => toggle(setToolIds, id)} createUrl="/admin/core/solid-core/agent-tool-registry/editor/new"
|
|
768
870
|
onView={(item) => setPreview({ item, kind: "tool" })} editUrlFor={(item) => `/admin/core/solid-core/agent-tool-registry/editor/${item.id}`}
|
|
769
871
|
linkFor={(id) => linkForTarget(record?.agentTools, "agentToolRegistry", id)}
|
|
872
|
+
view={resourceView} onViewChange={setResourceView} renderRow={(item) => <AgentResourceRowWidget rowData={item} />}
|
|
770
873
|
render={(item) => <AgentResourceCardWidget {...({ rowData: item } as SolidKanbanCardWidgetProps)} />}
|
|
771
874
|
renderSettings={(item) => <div className="agent-editor__link-settings">{linkSetting("Require approval", requiresApprovalValues[item.id] ?? false,
|
|
772
875
|
(checked) => setRequiresApprovalValues((current) => ({ ...current, [item.id]: checked })), "Pause before running this tool until a user approves it.")}</div>} /> },
|
|
@@ -776,15 +879,17 @@ export function AgentRegistryEditorPage() {
|
|
|
776
879
|
</fieldset>)}{!roles.records.length && <div className="agent-editor__empty">No roles available.</div>}</section>
|
|
777
880
|
<section className="agent-editor__section"><h2>Execution limits</h2><div className="agent-editor__grid">
|
|
778
881
|
{[["Step limit", stepLimit, setStepLimit], ["Turn step limit", turnStepLimit, setTurnStepLimit], ["Cost limit", costLimit, setCostLimit]].map(([label, value, setter]) =>
|
|
779
|
-
<label className="agent-editor__field" key={label as string}><span>{label as string}</span><input type="number" min={label === "Cost limit" ? 0 : 1} step={label === "Cost limit" ? 0.01 : 1} value={value as number} onChange={(event) => (setter as (value: number) => void)(Number(event.target.value))}
|
|
882
|
+
<label className="agent-editor__field" key={label as string}><span>{label as string}</span><input type="number" min={label === "Cost limit" ? 0 : 1} step={label === "Cost limit" ? 0.01 : 1} value={value as number} onChange={(event) => (setter as (value: number) => void)(Number(event.target.value))} />{label === "Cost limit" && <small className="agent-editor__hint">Cost is an estimate and is not guaranteed to be correct.</small>}</label>)}
|
|
780
883
|
</div>{errors.limits && <small className="agent-editor__error">{errors.limits}</small>}</section></div> },
|
|
781
884
|
{ value: "secrets", label: "Secrets", content: <LinkPicker label="Secrets" description="Grant access to existing secrets. Secret values are never shown here." options={secrets.records} selected={linked(secretIds, secrets.records, items(record?.agentSecrets).map((link) => link.secret).filter(Boolean))}
|
|
782
885
|
onAdd={(id) => { const secret = secrets.records.find((item) => item.id === id); if (secret) beginSecretEnvVarEdit(secret); }} onRemove={(id) => toggle(setSecretIds, id)}
|
|
783
|
-
|
|
784
|
-
render={(item
|
|
785
|
-
<
|
|
786
|
-
|
|
787
|
-
|
|
886
|
+
compact
|
|
887
|
+
render={(item) => <div className="agent-editor__secret"><strong title={item.displayName ?? item.name ?? item.key}>{item.displayName ?? item.name ?? item.key}</strong>
|
|
888
|
+
<button type="button" aria-label={`Edit environment variable name for ${item.displayName ?? item.key}`} onClick={() => beginSecretEnvVarEdit(item)}><Pencil size={16} /></button></div>} /> },
|
|
889
|
+
...(record?.id ? [{ value: "processes", label: "Processes", content: <div className="agent-editor__stack">
|
|
890
|
+
<AgentDeploymentPanel key={record.id} agentId={record.id} current={record} onSaved={() => void agentResult.refetch()} />
|
|
891
|
+
<AgentProcessesPanel agentId={record.id} agentLabel={record.name ?? record.title} />
|
|
892
|
+
</div> }] : []),
|
|
788
893
|
...((record?.id ? [
|
|
789
894
|
["jobs", "Jobs", jobs.currentData?.records],
|
|
790
895
|
] : []) as [string, string, Item[]][]).map(([value, label, related]) => ({ value, label, content: <section className="agent-editor__section"><h2>{label}</h2>
|
|
@@ -793,12 +898,13 @@ export function AgentRegistryEditorPage() {
|
|
|
793
898
|
: items(related).length ? <div className="agent-editor__related">{items(related).map((item) => <article key={item.id}><strong>{item.name ?? item.title ?? `#${item.id}`}</strong><span>{item.status ?? ""}</span></article>)}</div>
|
|
794
899
|
: <div className="agent-editor__empty">No {label.toLowerCase()} for this agent yet.</div>}</section> })),
|
|
795
900
|
...(record?.id ? [{ value: "sessions", label: "Sessions", content: <AgentSessionsPanel agentId={record.id} agentLabel={record.name ?? record.title} /> }] : []),
|
|
796
|
-
...(record?.id ? [{ value: "config-versions", label: "
|
|
901
|
+
...(record?.id ? [{ value: "config-versions", label: "Version History", content: <AgentConfigVersionsPanel agentId={record.id} active={tab === "config-versions"} /> }] : []),
|
|
797
902
|
...(record?.id ? [{ value: "embedding", label: "Embedding", content: <AgentEmbeddingPanel agentId={record.id}
|
|
798
903
|
fields={parseInputs(record.requiredInputs)} active={record.status === "active"}
|
|
799
904
|
hubUrl={String(getSettingsMap(settings).solidxAgentHubBackendUrl ?? "")} /> }] : []),
|
|
800
905
|
];
|
|
801
|
-
const
|
|
906
|
+
const visibleTabs = isAdmin ? tabs : tabs.filter(({ value }) => !["policies", "processes", "jobs", "sessions", "embedding"].includes(value));
|
|
907
|
+
const content = <SolidTabGroup tabs={visibleTabs} value={tab} onValueChange={setTab} className="agent-editor__tabs" listClassName="agent-editor__tab-list" panelClassName="agent-editor__tab-panel" />;
|
|
802
908
|
return <main className="agent-editor"><header className="agent-editor__header"><div className="agent-editor__heading-with-refresh"><h1>{record?.id ? "Edit Agent" : "Create Agent"}</h1>{record?.id && <button type="button" className={`agent-editor__refresh${isFetching ? " is-loading" : ""}`} aria-label="Refresh agent" title="Refresh agent" disabled={isFetching || updating} onClick={requestRefresh}><RefreshCw size={14} /></button>}</div><div className="agent-editor__actions">
|
|
803
909
|
<SolidButton variant="secondary" leftIcon={<ArrowLeft size={16} />} onClick={() => navigate(-1)}>Back</SolidButton>
|
|
804
910
|
{record?.id && <SolidButton variant="secondary" leftIcon={<FlaskConical size={16} />} onClick={openAgentTest}>Test Agent</SolidButton>}
|
|
@@ -826,7 +932,7 @@ export function AgentRegistryEditorPage() {
|
|
|
826
932
|
<span className="agent-editor__version-details-copy"><strong>Add a name and description</strong><small>Optional details help identify this version later.</small></span>
|
|
827
933
|
</label>
|
|
828
934
|
{includeVersionDetails && <div className="agent-editor__version-details-fields">
|
|
829
|
-
<label className="agent-editor__field"><span>Version name <small>Optional</small></span><SolidInput autoFocus placeholder="e.g. Updated support workflow" value={versionName} onChange={(event) => setVersionName(event.target.value)}
|
|
935
|
+
<label className="agent-editor__field"><span>Version name <small>Optional</small></span><SolidInput autoFocus placeholder="e.g. Updated support workflow" value={versionName} onChange={(event) => setVersionName(event.target.value)} /><small className="agent-editor__hint">A _yyyymmdd_hhmm date and time suffix is always added to the name.</small></label>
|
|
830
936
|
<label className="agent-editor__field"><span>Description <small>Optional</small></span><textarea placeholder="What changed in this version?" value={versionDescription} rows={3} onChange={(event) => setVersionDescription(event.target.value)} /></label>
|
|
831
937
|
</div>}
|
|
832
938
|
</div></SolidDialogBody>
|
|
@@ -191,10 +191,39 @@
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
.agent-skill-editor__panel header {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: space-between;
|
|
197
|
+
gap: 1rem;
|
|
194
198
|
padding: 0.9rem 1rem;
|
|
195
199
|
border-bottom: 1px solid var(--surface-border, var(--border));
|
|
196
200
|
}
|
|
197
201
|
|
|
202
|
+
.agent-skill-editor__preview-toggle {
|
|
203
|
+
display: grid;
|
|
204
|
+
flex: 0 0 auto;
|
|
205
|
+
place-items: center;
|
|
206
|
+
width: 2.15rem;
|
|
207
|
+
height: 2.15rem;
|
|
208
|
+
padding: 0;
|
|
209
|
+
border: 1px solid var(--surface-border, var(--border));
|
|
210
|
+
border-radius: 0.6rem;
|
|
211
|
+
background: var(--surface-card, var(--card));
|
|
212
|
+
color: var(--text-color-secondary, var(--muted-foreground));
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.agent-skill-editor__preview-toggle:hover,
|
|
217
|
+
.agent-skill-editor__preview-toggle[aria-pressed="true"] {
|
|
218
|
+
border-color: color-mix(in srgb, var(--primary-color, var(--primary)) 42%, var(--surface-border, var(--border)));
|
|
219
|
+
background: color-mix(in srgb, var(--primary-color, var(--primary)) 7%, var(--surface-card, var(--card)));
|
|
220
|
+
color: var(--primary-color, var(--primary));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.agent-skill-editor__preview-toggle:focus-visible { outline: 2px solid var(--primary-color, var(--primary)); outline-offset: 2px; }
|
|
224
|
+
.agent-skill-editor__preview { box-sizing: border-box; min-height: max(32rem, calc(100dvh - 18rem)); padding: 1.25rem; background: var(--surface-ground, var(--background)); }
|
|
225
|
+
.agent-skill-editor__preview-empty { color: var(--text-color-secondary, var(--muted-foreground)); }
|
|
226
|
+
|
|
198
227
|
.agent-skill-editor__panel h2,
|
|
199
228
|
.agent-skill-editor__agents h2 {
|
|
200
229
|
font-size: 1rem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentSkillRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentSkillRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx"],"names":[],"mappings":"AAmBA,OAAO,oCAAoC,CAAC;AA+E5C,wBAAgB,4BAA4B,4CAsT3C"}
|
|
@@ -47,14 +47,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
49
49
|
import React from "react";
|
|
50
|
-
import { ArrowLeft, RefreshCw } from "lucide-react";
|
|
50
|
+
import { ArrowLeft, Eye, Pencil, RefreshCw } from "lucide-react";
|
|
51
51
|
import { useDispatch } from "react-redux";
|
|
52
|
-
import { useNavigate, useParams } from "react-router-dom";
|
|
52
|
+
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
53
53
|
import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
|
|
54
54
|
import { showToast } from "../../../../redux/features/toastSlice";
|
|
55
55
|
import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
|
|
56
56
|
import { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload } from "./AgentHubTagsField";
|
|
57
57
|
import { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload } from "./AgentHubModuleField";
|
|
58
|
+
import { SolidAgentMarkdown } from "../../../../components/core/solid-agent/SolidAgentMarkdown";
|
|
58
59
|
import { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidIconPicker, SolidInput, SolidTabGroup, } from "../../../../components/shad-cn-ui";
|
|
59
60
|
import "./AgentSkillRegistryEditorPage.css";
|
|
60
61
|
function extractEntityRecord(response) {
|
|
@@ -114,37 +115,41 @@ function skillAgents(record) {
|
|
|
114
115
|
}
|
|
115
116
|
export function AgentSkillRegistryEditorPage() {
|
|
116
117
|
var _this = this;
|
|
117
|
-
var _a
|
|
118
|
+
var _a;
|
|
119
|
+
var _b = useParams().id, id = _b === void 0 ? "" : _b;
|
|
120
|
+
var searchParams = useSearchParams()[0];
|
|
121
|
+
var initialName = id === "new" ? (_a = searchParams.get("name")) !== null && _a !== void 0 ? _a : "" : "";
|
|
118
122
|
var navigate = useNavigate();
|
|
119
123
|
var dispatch = useDispatch();
|
|
120
124
|
var entityApi = React.useMemo(function () { return createSolidEntityApi("agentSkillRegistry"); }, []);
|
|
121
125
|
var useCreateSolidEntityMutation = entityApi.useCreateSolidEntityMutation, useGetSolidEntityByIdQuery = entityApi.useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation = entityApi.useUpdateSolidEntityMutation;
|
|
122
|
-
var
|
|
126
|
+
var _c = useGetSolidEntityByIdQuery({
|
|
123
127
|
id: id,
|
|
124
128
|
qs: "populate[0]=agentSkills&populate[1]=agentSkills.agentRegistry&populate[2]=tags&populate[3]=module",
|
|
125
|
-
}, { skip: !id || id === "new" }), response =
|
|
126
|
-
var
|
|
127
|
-
var
|
|
129
|
+
}, { skip: !id || id === "new" }), response = _c.data, isLoading = _c.isLoading, isFetching = _c.isFetching, refetch = _c.refetch;
|
|
130
|
+
var _d = useCreateSolidEntityMutation(), createSkill = _d[0], isCreating = _d[1].isLoading;
|
|
131
|
+
var _e = useUpdateSolidEntityMutation(), updateSkill = _e[0], isSaving = _e[1].isLoading;
|
|
128
132
|
var record = extractEntityRecord(response);
|
|
129
|
-
var
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var
|
|
133
|
+
var _f = React.useState("general"), activeTab = _f[0], setActiveTab = _f[1];
|
|
134
|
+
var _g = React.useState(""), name = _g[0], setName = _g[1];
|
|
135
|
+
var _h = React.useState("custom"), type = _h[0], setType = _h[1];
|
|
136
|
+
var _j = React.useState(""), iconName = _j[0], setIconName = _j[1];
|
|
137
|
+
var _k = React.useState(""), description = _k[0], setDescription = _k[1];
|
|
138
|
+
var _l = React.useState(""), body = _l[0], setBody = _l[1];
|
|
139
|
+
var _m = React.useState(false), previewBody = _m[0], setPreviewBody = _m[1];
|
|
140
|
+
var _o = React.useState([]), tags = _o[0], setTags = _o[1];
|
|
141
|
+
var _p = React.useState(null), module = _p[0], setModule = _p[1];
|
|
142
|
+
var _q = React.useState(false), creatingTag = _q[0], setCreatingTag = _q[1];
|
|
143
|
+
var _r = React.useState({}), fieldErrors = _r[0], setFieldErrors = _r[1];
|
|
144
|
+
var _s = React.useState(0), auditRefreshVersion = _s[0], setAuditRefreshVersion = _s[1];
|
|
145
|
+
var _t = React.useState(false), confirmRefresh = _t[0], setConfirmRefresh = _t[1];
|
|
141
146
|
var baseline = React.useRef("");
|
|
142
147
|
var currentForm = function () { var _a; return JSON.stringify({ name: name, type: type, iconName: iconName, description: description, body: body, tags: tags, moduleId: (_a = module === null || module === void 0 ? void 0 : module.id) !== null && _a !== void 0 ? _a : null }); };
|
|
143
148
|
React.useEffect(function () {
|
|
144
149
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
145
150
|
var nextTags = agentHubTagsFrom(record === null || record === void 0 ? void 0 : record.tags);
|
|
146
151
|
var nextModule = agentHubModuleFrom(record === null || record === void 0 ? void 0 : record.module);
|
|
147
|
-
setName((_a = record === null || record === void 0 ? void 0 : record.name) !== null && _a !== void 0 ? _a :
|
|
152
|
+
setName((_a = record === null || record === void 0 ? void 0 : record.name) !== null && _a !== void 0 ? _a : initialName);
|
|
148
153
|
setType((_b = record === null || record === void 0 ? void 0 : record.type) !== null && _b !== void 0 ? _b : "custom");
|
|
149
154
|
setIconName((_c = record === null || record === void 0 ? void 0 : record.iconName) !== null && _c !== void 0 ? _c : "");
|
|
150
155
|
setDescription((_d = record === null || record === void 0 ? void 0 : record.description) !== null && _d !== void 0 ? _d : "");
|
|
@@ -263,7 +268,7 @@ export function AgentSkillRegistryEditorPage() {
|
|
|
263
268
|
{
|
|
264
269
|
value: "skill",
|
|
265
270
|
label: "Skill",
|
|
266
|
-
content: (_jsx("div", { className: "agent-skill-editor__skill", children: _jsxs("section", { className: "agent-skill-editor__panel", children: [_jsxs("header", { children: [_jsxs("h2", { children: ["Skill instructions ", _jsx("b", { children: "*" })] }), _jsx("p", { children: "Write the skill's Markdown body here." })] }), _jsx(SolidCodeEditor, { value: body, onChange: function (value) {
|
|
271
|
+
content: (_jsx("div", { className: "agent-skill-editor__skill", children: _jsxs("section", { className: "agent-skill-editor__panel", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsxs("h2", { children: ["Skill instructions ", _jsx("b", { children: "*" })] }), _jsx("p", { children: "Write the skill's Markdown body here." })] }), _jsx("button", { type: "button", className: "agent-skill-editor__preview-toggle", "aria-pressed": previewBody, "aria-label": previewBody ? "Edit skill body" : "Preview skill body", title: previewBody ? "Edit skill body" : "Preview skill body", onClick: function () { return setPreviewBody(function (current) { return !current; }); }, children: previewBody ? _jsx(Pencil, { size: 15, "aria-hidden": "true" }) : _jsx(Eye, { size: 15, "aria-hidden": "true" }) })] }), previewBody ? _jsx("div", { className: "agent-skill-editor__preview", role: "region", "aria-label": "Skill body preview", children: body.trim() ? _jsx(SolidAgentMarkdown, { text: body }) : _jsx("p", { className: "agent-skill-editor__preview-empty", children: "Nothing to preview yet." }) }) : _jsx(SolidCodeEditor, { value: body, onChange: function (value) {
|
|
267
272
|
setBody(value !== null && value !== void 0 ? value : "");
|
|
268
273
|
setFieldErrors(function (current) { return (__assign(__assign({}, current), { body: "" })); });
|
|
269
274
|
}, language: "markdown", wordWrap: "on", readOnly: isReadOnly, fontSize: 11, height: "max(32rem, calc(100dvh - 18rem))", className: "agent-skill-editor__code".concat(fieldErrors.body ? " agent-skill-editor__code--invalid" : "") }), fieldErrors.body && _jsx("small", { className: "agent-skill-editor__field-error agent-skill-editor__body-error", children: fieldErrors.body })] }) })),
|