@burdenoff/microfe-botmanor 2026.1127.2 → 2026.1127.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/botlit/BotlitRoutes.js +31 -24
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/hooks/useLLMProviders.d.ts +1 -1
- package/dist/botlit/hooks/useLLMProviders.js.map +1 -1
- package/dist/botlit/hooks/useMCPServers.d.ts +1 -1
- package/dist/botlit/hooks/useMCPServers.js.map +1 -1
- package/dist/botlit/pages/MCPServerDetailPage.js +3 -3
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
- package/dist/botlit/pages/SettingsPage.js +1 -1
- package/dist/botlit/pages/SettingsPage.js.map +1 -1
- package/dist/botlit/permissions/PermissionRequired.d.ts +2 -0
- package/dist/botlit/permissions/PermissionRequired.js +6 -6
- package/dist/botlit/permissions/PermissionRequired.js.map +1 -1
- package/dist/botlit/permissions/botmanorPermissions.d.ts +1 -0
- package/dist/botlit/permissions/botmanorPermissions.js +1 -0
- package/dist/botlit/permissions/botmanorPermissions.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +6 -6
- package/dist/generated/wspace-operations.js +6 -6
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { Suspense as ee, lazy as s } from "react";
|
|
|
10
10
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
11
|
import { Navigate as u, Route as d, Routes as te, useLocation as ne } from "react-router";
|
|
12
12
|
// src/botlit/BotlitRoutes.tsx
|
|
13
|
-
var re = s(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.BotsListPage }))), f = s(() => import("./pages/BotDetailPage.js").then((e) => ({ default: e.BotDetailPage }))), p = s(() => import("./pages/AgentsListPage.js").then((e) => ({ default: e.AgentsListPage }))),
|
|
13
|
+
var re = s(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.BotsListPage }))), f = s(() => import("./pages/BotDetailPage.js").then((e) => ({ default: e.BotDetailPage }))), p = s(() => import("./pages/AgentsListPage.js").then((e) => ({ default: e.AgentsListPage }))), ie = s(() => import("./pages/AgentApprovalsPage.js").then((e) => ({ default: e.AgentApprovalsPage }))), m = s(() => import("./pages/AgentDetailPage.js").then((e) => ({ default: e.AgentDetailPage }))), h = s(() => import("./pages/AgentBuilderPage.js").then((e) => ({ default: e.AgentBuilderPage }))), g = s(() => import("./pages/KnowledgeBasesPage.js").then((e) => ({ default: e.KnowledgeBasesPage }))), _ = s(() => import("./pages/KnowledgeBaseDetailPage.js").then((e) => ({ default: e.KnowledgeBaseDetailPage }))), v = s(() => import("./pages/RetrievalProfilesPage.js").then((e) => ({ default: e.RetrievalProfilesPage }))), y = s(() => import("./pages/RetrievalProfileDetailPage.js").then((e) => ({ default: e.RetrievalProfileDetailPage }))), b = s(() => import("./pages/MCPServersPage.js").then((e) => ({ default: e.MCPServersPage }))), x = s(() => import("./pages/MCPServerDetailPage.js").then((e) => ({ default: e.MCPServerDetailPage }))), S = s(() => import("./pages/A2ARegistryPage.js").then((e) => ({ default: e.A2ARegistryPage }))), C = s(() => import("./pages/A2AAgentDetailPage.js").then((e) => ({ default: e.A2AAgentDetailPage }))), w = s(() => import("./pages/ChannelsPage.js").then((e) => ({ default: e.ChannelsPage }))), T = s(() => import("./pages/ChannelDetailPage.js").then((e) => ({ default: e.ChannelDetailPage }))), E = s(() => import("./pages/ChannelRoutesPage.js").then((e) => ({ default: e.ChannelRoutesPage }))), D = s(() => import("./pages/PoliciesPage.js").then((e) => ({ default: e.PoliciesPage }))), O = s(() => import("./pages/PolicyDetailPage.js").then((e) => ({ default: e.PolicyDetailPage }))), k = s(() => import("./pages/SkillsPage.js").then((e) => ({ default: e.SkillsPage }))), A = s(() => import("./pages/SkillDetailPage.js").then((e) => ({ default: e.SkillDetailPage }))), j = s(() => import("./pages/PromptTemplatesPage.js").then((e) => ({ default: e.PromptTemplatesPage }))), M = s(() => import("./pages/PromptTemplateDetailPage.js").then((e) => ({ default: e.PromptTemplateDetailPage }))), N = s(() => import("./pages/PromptStudioPage.js").then((e) => ({ default: e.PromptStudioPage }))), P = s(() => import("./pages/ExecutionsPage.js").then((e) => ({ default: e.ExecutionsPage }))), F = s(() => import("./pages/ExecutionDetailPage.js").then((e) => ({ default: e.ExecutionDetailPage }))), I = s(() => import("./pages/AiOperationsPage.js").then((e) => ({ default: e.AiOperationsPage }))), L = s(() => import("./pages/HandoffsPage.js").then((e) => ({ default: e.HandoffsPage }))), R = s(() => import("./pages/BucketsPage.js").then((e) => ({ default: e.BucketsPage }))), z = s(() => import("./pages/BucketDetailPage.js").then((e) => ({ default: e.BucketDetailPage }))), B = s(() => import("./pages/StorePage.js").then((e) => ({ default: e.StorePage }))), V = s(() => import("./pages/StorePackageDetailPage.js").then((e) => ({ default: e.StorePackageDetailPage }))), H = s(() => import("./pages/StorePublishingPage.js").then((e) => ({ default: e.StorePublishingPage }))), U = s(() => import("./pages/InstalledPackagesPage.js").then((e) => ({ default: e.InstalledPackagesPage }))), W = s(() => import("./pages/SettingsPage.js").then((e) => ({ default: e.SettingsPage }))), G = s(() => import("./pages/AgentTestChatPage.js").then((e) => ({ default: e.AgentTestChatPage }))), K = s(() => import("./pages/ChatPage.js").then((e) => ({ default: e.ChatPage }))), q = () => {
|
|
14
14
|
let { basePath: s, isStandalone: q } = e(), J = ne(), Y = i(), X = (e, t, n, i, a) => /* @__PURE__ */ c(r, {
|
|
15
15
|
permission: e,
|
|
16
16
|
title: t,
|
|
@@ -56,23 +56,23 @@ var re = s(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bot
|
|
|
56
56
|
}),
|
|
57
57
|
/* @__PURE__ */ c(d, {
|
|
58
58
|
path: "bots/:botId/agents/new",
|
|
59
|
-
element: X(n.AGENT_CREATE, Y("botlit.agentsList.actions.createAgent", "Create Agent"), "agents", Z, /* @__PURE__ */ c(
|
|
59
|
+
element: X(n.AGENT_CREATE, Y("botlit.agentsList.actions.createAgent", "Create Agent"), "agents", Z, /* @__PURE__ */ c(h, {}))
|
|
60
60
|
}),
|
|
61
61
|
/* @__PURE__ */ c(d, {
|
|
62
62
|
path: "bots/:botId/agents/:agentId",
|
|
63
|
-
element: /* @__PURE__ */ c(
|
|
63
|
+
element: /* @__PURE__ */ c(m, {})
|
|
64
64
|
}),
|
|
65
65
|
/* @__PURE__ */ c(d, {
|
|
66
66
|
path: "bots/:botId/agents/:agentId/edit",
|
|
67
|
-
element: X(n.AGENT_UPDATE, Y("botlit.agentsList.menu.editAgent", "Edit Agent"), "agents", Z, /* @__PURE__ */ c(
|
|
67
|
+
element: X(n.AGENT_UPDATE, Y("botlit.agentsList.menu.editAgent", "Edit Agent"), "agents", Z, /* @__PURE__ */ c(h, {}))
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ c(d, {
|
|
70
70
|
path: "bots/:botId/knowledge",
|
|
71
|
-
element: /* @__PURE__ */ c(
|
|
71
|
+
element: /* @__PURE__ */ c(g, {})
|
|
72
72
|
}),
|
|
73
73
|
/* @__PURE__ */ c(d, {
|
|
74
74
|
path: "bots/:botId/knowledge/:kbId",
|
|
75
|
-
element: /* @__PURE__ */ c(
|
|
75
|
+
element: /* @__PURE__ */ c(_, {})
|
|
76
76
|
}),
|
|
77
77
|
/* @__PURE__ */ c(d, {
|
|
78
78
|
path: "agents",
|
|
@@ -80,19 +80,19 @@ var re = s(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bot
|
|
|
80
80
|
}),
|
|
81
81
|
/* @__PURE__ */ c(d, {
|
|
82
82
|
path: "agents/new",
|
|
83
|
-
element: X(n.AGENT_CREATE, Y("botlit.agentsList.actions.createAgent", "Create Agent"), "agents", Z, /* @__PURE__ */ c(
|
|
83
|
+
element: X(n.AGENT_CREATE, Y("botlit.agentsList.actions.createAgent", "Create Agent"), "agents", Z, /* @__PURE__ */ c(h, {}))
|
|
84
84
|
}),
|
|
85
85
|
/* @__PURE__ */ c(d, {
|
|
86
86
|
path: "agents/approvals",
|
|
87
|
-
element: /* @__PURE__ */ c(
|
|
87
|
+
element: /* @__PURE__ */ c(ie, {})
|
|
88
88
|
}),
|
|
89
89
|
/* @__PURE__ */ c(d, {
|
|
90
90
|
path: "agents/:agentId",
|
|
91
|
-
element: /* @__PURE__ */ c(
|
|
91
|
+
element: /* @__PURE__ */ c(m, {})
|
|
92
92
|
}),
|
|
93
93
|
/* @__PURE__ */ c(d, {
|
|
94
94
|
path: "agents/:agentId/edit",
|
|
95
|
-
element: X(n.AGENT_UPDATE, Y("botlit.agentsList.menu.editAgent", "Edit Agent"), "agents", Z, /* @__PURE__ */ c(
|
|
95
|
+
element: X(n.AGENT_UPDATE, Y("botlit.agentsList.menu.editAgent", "Edit Agent"), "agents", Z, /* @__PURE__ */ c(h, {}))
|
|
96
96
|
}),
|
|
97
97
|
/* @__PURE__ */ c(d, {
|
|
98
98
|
path: "agents/:agentId/test",
|
|
@@ -104,55 +104,55 @@ var re = s(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bot
|
|
|
104
104
|
}),
|
|
105
105
|
/* @__PURE__ */ c(d, {
|
|
106
106
|
path: "knowledge",
|
|
107
|
-
element: /* @__PURE__ */ c(
|
|
107
|
+
element: /* @__PURE__ */ c(g, {})
|
|
108
108
|
}),
|
|
109
109
|
/* @__PURE__ */ c(d, {
|
|
110
110
|
path: "knowledge/new",
|
|
111
|
-
element: X(n.KNOWLEDGE_CREATE, Y("botlit.knowledge.actions.create", "Create Knowledge Base"), "knowledge", Z, /* @__PURE__ */ c(
|
|
111
|
+
element: X(n.KNOWLEDGE_CREATE, Y("botlit.knowledge.actions.create", "Create Knowledge Base"), "knowledge", Z, /* @__PURE__ */ c(_, { isNew: !0 }))
|
|
112
112
|
}),
|
|
113
113
|
/* @__PURE__ */ c(d, {
|
|
114
114
|
path: "knowledge/:kbId",
|
|
115
|
-
element: /* @__PURE__ */ c(
|
|
115
|
+
element: /* @__PURE__ */ c(_, {})
|
|
116
116
|
}),
|
|
117
117
|
/* @__PURE__ */ c(d, {
|
|
118
118
|
path: "retrieval-profiles",
|
|
119
|
-
element: /* @__PURE__ */ c(
|
|
119
|
+
element: /* @__PURE__ */ c(v, {})
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ c(d, {
|
|
122
122
|
path: "retrieval-profiles/new",
|
|
123
|
-
element: X(n.RETRIEVAL_PROFILE_CREATE, Y("botlit.retrievalProfiles.actions.create", "Create Retrieval Profile"), "retrieval-profiles", Z, /* @__PURE__ */ c(
|
|
123
|
+
element: X(n.RETRIEVAL_PROFILE_CREATE, Y("botlit.retrievalProfiles.actions.create", "Create Retrieval Profile"), "retrieval-profiles", Z, /* @__PURE__ */ c(y, { isNew: !0 }))
|
|
124
124
|
}),
|
|
125
125
|
/* @__PURE__ */ c(d, {
|
|
126
126
|
path: "retrieval-profiles/:profileId",
|
|
127
|
-
element: /* @__PURE__ */ c(
|
|
127
|
+
element: /* @__PURE__ */ c(y, {})
|
|
128
128
|
}),
|
|
129
129
|
/* @__PURE__ */ c(d, {
|
|
130
130
|
path: "mcp",
|
|
131
|
-
element: /* @__PURE__ */ c(
|
|
131
|
+
element: /* @__PURE__ */ c(b, {})
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ c(d, {
|
|
134
134
|
path: "mcp/new",
|
|
135
|
-
element: X(n.MCP_CREATE, Y("botlit.mcpServers.actions.add", "Add MCP Server"), "mcp", Z, /* @__PURE__ */ c(
|
|
135
|
+
element: X(n.MCP_CREATE, Y("botlit.mcpServers.actions.add", "Add MCP Server"), "mcp", Z, /* @__PURE__ */ c(x, { isNew: !0 }))
|
|
136
136
|
}),
|
|
137
137
|
/* @__PURE__ */ c(d, {
|
|
138
138
|
path: "mcp/:serverId",
|
|
139
|
-
element: /* @__PURE__ */ c(
|
|
139
|
+
element: /* @__PURE__ */ c(x, {})
|
|
140
140
|
}),
|
|
141
141
|
/* @__PURE__ */ c(d, {
|
|
142
142
|
path: "a2a",
|
|
143
|
-
element: /* @__PURE__ */ c(
|
|
143
|
+
element: /* @__PURE__ */ c(S, {})
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ c(d, {
|
|
146
146
|
path: "a2a/register",
|
|
147
|
-
element: X(n.A2A_REGISTRY_CREATE, Y("botlit.a2aRegistry.actions.registerAgent", "Register Agent"), "a2a", Z, /* @__PURE__ */ c(
|
|
147
|
+
element: X(n.A2A_REGISTRY_CREATE, Y("botlit.a2aRegistry.actions.registerAgent", "Register Agent"), "a2a", Z, /* @__PURE__ */ c(C, { isNew: !0 }))
|
|
148
148
|
}),
|
|
149
149
|
/* @__PURE__ */ c(d, {
|
|
150
150
|
path: "a2a/:agentId",
|
|
151
|
-
element: /* @__PURE__ */ c(
|
|
151
|
+
element: /* @__PURE__ */ c(C, {})
|
|
152
152
|
}),
|
|
153
153
|
/* @__PURE__ */ c(d, {
|
|
154
154
|
path: "channels",
|
|
155
|
-
element: /* @__PURE__ */ c(
|
|
155
|
+
element: /* @__PURE__ */ c(w, {})
|
|
156
156
|
}),
|
|
157
157
|
/* @__PURE__ */ c(d, {
|
|
158
158
|
path: "channels/new",
|
|
@@ -266,7 +266,14 @@ var re = s(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bot
|
|
|
266
266
|
}),
|
|
267
267
|
/* @__PURE__ */ c(d, {
|
|
268
268
|
path: "settings",
|
|
269
|
-
element: /* @__PURE__ */ c(
|
|
269
|
+
element: /* @__PURE__ */ c(r, {
|
|
270
|
+
permission: n.LLM_READ,
|
|
271
|
+
title: Y("botlit.settings.title", "Settings"),
|
|
272
|
+
description: Y("botlit.settings.noAccess", "Ask a workspace admin for permission to view model provider settings."),
|
|
273
|
+
backTo: "",
|
|
274
|
+
backLabel: Z,
|
|
275
|
+
children: /* @__PURE__ */ c(W, {})
|
|
276
|
+
})
|
|
270
277
|
}),
|
|
271
278
|
/* @__PURE__ */ c(d, {
|
|
272
279
|
path: "list",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotlitRoutes.js","names":["BotsListPage","lazy","m","BotDetailPage","AgentsListPage","AgentApprovalsPage","AgentDetailPage","AgentBuilderPage","KnowledgeBasesPage","KnowledgeBaseDetailPage","RetrievalProfilesPage","RetrievalProfileDetailPage","MCPServersPage","MCPServerDetailPage","A2ARegistryPage","A2AAgentDetailPage","ChannelsPage","ChannelDetailPage","ChannelRoutesPage","PoliciesPage","PolicyDetailPage","SkillsPage","SkillDetailPage","PromptTemplatesPage","PromptTemplateDetailPage","PromptStudioPage","ExecutionsPage","ExecutionDetailPage","AiOperationsPage","HandoffsPage","BucketsPage","BucketDetailPage","StorePage","StorePackageDetailPage","StorePublishingPage","InstalledPackagesPage","SettingsPage","AgentTestChatPage","ChatPage","BotlitRoutes","useBotlit","location","useLocation","t","useTr","gated","RequirePermission","element","back","normalizedBasePath","basePath","createBucketSearch","BUCKET_CREATE_PARAM","isStandalone","Suspense","RouteLoader","Routes","Route","DashboardPage","Navigate","BOTMANOR_PERMISSIONS"],"sources":["../../src/botlit/BotlitRoutes.tsx"],"sourcesContent":["/**\n * BotManor Routes\n * @module botlit\n */\n\nimport { type FC, type ReactElement, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useBotlit } from './providers/BotlitProvider';\nimport { RouteLoader } from './components/RouteLoader';\nimport { BOTMANOR_PERMISSIONS, RequirePermission, type BotmanorPermission } from './permissions';\nimport { useTr } from '../shared/hooks/useTr';\n\n// Eager load - Dashboard (primary landing page)\nimport { DashboardPage } from './pages/DashboardPage';\nimport { BUCKET_CREATE_PARAM } from './pages/bucketCreateDialog';\n\n// Lazy loaded pages - Bots\nconst BotsListPage = lazy(() =>\n import('./pages/BotsListPage').then((m) => ({ default: m.BotsListPage }))\n);\nconst BotDetailPage = lazy(() =>\n import('./pages/BotDetailPage').then((m) => ({ default: m.BotDetailPage }))\n);\n\n// Lazy loaded pages - Agents\nconst AgentsListPage = lazy(() =>\n import('./pages/AgentsListPage').then((m) => ({ default: m.AgentsListPage }))\n);\nconst AgentApprovalsPage = lazy(() =>\n import('./pages/AgentApprovalsPage').then((m) => ({ default: m.AgentApprovalsPage }))\n);\nconst AgentDetailPage = lazy(() =>\n import('./pages/AgentDetailPage').then((m) => ({ default: m.AgentDetailPage }))\n);\nconst AgentBuilderPage = lazy(() =>\n import('./pages/AgentBuilderPage').then((m) => ({ default: m.AgentBuilderPage }))\n);\n\n// Lazy loaded pages - Knowledge Bases\nconst KnowledgeBasesPage = lazy(() =>\n import('./pages/KnowledgeBasesPage').then((m) => ({ default: m.KnowledgeBasesPage }))\n);\nconst KnowledgeBaseDetailPage = lazy(() =>\n import('./pages/KnowledgeBaseDetailPage').then((m) => ({ default: m.KnowledgeBaseDetailPage }))\n);\n\n// Lazy loaded pages - Retrieval Profiles\nconst RetrievalProfilesPage = lazy(() =>\n import('./pages/RetrievalProfilesPage').then((m) => ({ default: m.RetrievalProfilesPage }))\n);\nconst RetrievalProfileDetailPage = lazy(() =>\n import('./pages/RetrievalProfileDetailPage').then((m) => ({\n default: m.RetrievalProfileDetailPage,\n }))\n);\n\n// Lazy loaded pages - MCP Servers\nconst MCPServersPage = lazy(() =>\n import('./pages/MCPServersPage').then((m) => ({ default: m.MCPServersPage }))\n);\nconst MCPServerDetailPage = lazy(() =>\n import('./pages/MCPServerDetailPage').then((m) => ({ default: m.MCPServerDetailPage }))\n);\n\n// Lazy loaded pages - A2A Registry\nconst A2ARegistryPage = lazy(() =>\n import('./pages/A2ARegistryPage').then((m) => ({ default: m.A2ARegistryPage }))\n);\nconst A2AAgentDetailPage = lazy(() =>\n import('./pages/A2AAgentDetailPage').then((m) => ({ default: m.A2AAgentDetailPage }))\n);\n\n// Lazy loaded pages - Channels\nconst ChannelsPage = lazy(() =>\n import('./pages/ChannelsPage').then((m) => ({ default: m.ChannelsPage }))\n);\nconst ChannelDetailPage = lazy(() =>\n import('./pages/ChannelDetailPage').then((m) => ({ default: m.ChannelDetailPage }))\n);\nconst ChannelRoutesPage = lazy(() =>\n import('./pages/ChannelRoutesPage').then((m) => ({ default: m.ChannelRoutesPage }))\n);\n\n// Lazy loaded pages - Policies\nconst PoliciesPage = lazy(() =>\n import('./pages/PoliciesPage').then((m) => ({ default: m.PoliciesPage }))\n);\nconst PolicyDetailPage = lazy(() =>\n import('./pages/PolicyDetailPage').then((m) => ({ default: m.PolicyDetailPage }))\n);\n\n// Lazy loaded pages - Skills\nconst SkillsPage = lazy(() =>\n import('./pages/SkillsPage').then((m) => ({ default: m.SkillsPage }))\n);\nconst SkillDetailPage = lazy(() =>\n import('./pages/SkillDetailPage').then((m) => ({ default: m.SkillDetailPage }))\n);\n\n// Lazy loaded pages - Prompt Templates\nconst PromptTemplatesPage = lazy(() =>\n import('./pages/PromptTemplatesPage').then((m) => ({ default: m.PromptTemplatesPage }))\n);\nconst PromptTemplateDetailPage = lazy(() =>\n import('./pages/PromptTemplateDetailPage').then((m) => ({ default: m.PromptTemplateDetailPage }))\n);\nconst PromptStudioPage = lazy(() =>\n import('./pages/PromptStudioPage').then((m) => ({ default: m.PromptStudioPage }))\n);\n\n// Lazy loaded pages - Executions\nconst ExecutionsPage = lazy(() =>\n import('./pages/ExecutionsPage').then((m) => ({ default: m.ExecutionsPage }))\n);\nconst ExecutionDetailPage = lazy(() =>\n import('./pages/ExecutionDetailPage').then((m) => ({ default: m.ExecutionDetailPage }))\n);\n\n// Lazy loaded pages - AI Operations (supervisor decision feed, BOFF-3839)\nconst AiOperationsPage = lazy(() =>\n import('./pages/AiOperationsPage').then((m) => ({ default: m.AiOperationsPage }))\n);\n\n// Lazy loaded pages - Human handoffs (shared team inbox, BOFF-5813)\nconst HandoffsPage = lazy(() =>\n import('./pages/HandoffsPage').then((m) => ({ default: m.HandoffsPage }))\n);\n\n// Lazy loaded pages - Buckets\nconst BucketsPage = lazy(() =>\n import('./pages/BucketsPage').then((m) => ({ default: m.BucketsPage }))\n);\nconst BucketDetailPage = lazy(() =>\n import('./pages/BucketDetailPage').then((m) => ({ default: m.BucketDetailPage }))\n);\n\n// Lazy loaded pages - Store\nconst StorePage = lazy(() => import('./pages/StorePage').then((m) => ({ default: m.StorePage })));\nconst StorePackageDetailPage = lazy(() =>\n import('./pages/StorePackageDetailPage').then((m) => ({ default: m.StorePackageDetailPage }))\n);\nconst StorePublishingPage = lazy(() =>\n import('./pages/StorePublishingPage').then((m) => ({ default: m.StorePublishingPage }))\n);\nconst InstalledPackagesPage = lazy(() =>\n import('./pages/InstalledPackagesPage').then((m) => ({ default: m.InstalledPackagesPage }))\n);\n\n// Lazy loaded pages - Settings & Chat\nconst SettingsPage = lazy(() =>\n import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage }))\n);\nconst AgentTestChatPage = lazy(() =>\n import('./pages/AgentTestChatPage').then((m) => ({ default: m.AgentTestChatPage }))\n);\nconst ChatPage = lazy(() => import('./pages/ChatPage').then((m) => ({ default: m.ChatPage })));\n\n// Loading fallback — the same skeleton `BotmanorRoot` paints while its\n// implementation chunk resolves, so the content region never switches loading\n// idioms (and never goes empty) between first paint and the page rendering.\n\nexport const BotlitRoutes: FC = () => {\n const { basePath, isStandalone } = useBotlit();\n const location = useLocation();\n const t = useTr();\n\n /**\n * Create, edit and chat routes are reachable by URL, so they are gated here\n * as well as at the buttons that link to them: a member without the\n * permission gets a clear \"no access\" state instead of a form the gateway\n * would refuse to save.\n */\n const gated = (\n permission: BotmanorPermission,\n title: string,\n backTo: string,\n backLabel: string,\n element: ReactElement\n ): ReactElement => (\n <RequirePermission permission={permission} title={title} backTo={backTo} backLabel={backLabel}>\n {element}\n </RequirePermission>\n );\n const back = t('permissions.required.back', 'Go back');\n\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : basePath.replace(/\\/$/, '');\n const createBucketSearch = new URLSearchParams(location.search);\n createBucketSearch.set(BUCKET_CREATE_PARAM, '1');\n\n // Guard: Only render if path matches basePath (when integrated)\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex flex-col min-h-full bg-bg-surface\">\n <Suspense fallback={<RouteLoader />}>\n <Routes>\n {/* Dashboard - Eager loaded */}\n <Route index element={<DashboardPage />} />\n <Route path=\"home\" element={<Navigate to={normalizedBasePath || '/'} replace />} />\n\n {/* Bots */}\n <Route path=\"bots\" element={<BotsListPage />} />\n <Route\n path=\"bots/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.APP_CREATE,\n t('botlit.botsList.actions.createBot', 'Create Bot'),\n 'bots',\n back,\n <BotDetailPage isNew />\n )}\n />\n <Route path=\"bots/:botId\" element={<BotDetailPage />} />\n <Route\n path=\"bots/:botId/edit\"\n element={gated(\n BOTMANOR_PERMISSIONS.APP_UPDATE,\n t('botlit.botsList.menu.editBot', 'Edit Bot'),\n 'bots',\n back,\n <BotDetailPage isEditing />\n )}\n />\n <Route path=\"bots/:botId/agents\" element={<AgentsListPage />} />\n <Route\n path=\"bots/:botId/agents/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_CREATE,\n t('botlit.agentsList.actions.createAgent', 'Create Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route path=\"bots/:botId/agents/:agentId\" element={<AgentDetailPage />} />\n <Route\n path=\"bots/:botId/agents/:agentId/edit\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_UPDATE,\n t('botlit.agentsList.menu.editAgent', 'Edit Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route path=\"bots/:botId/knowledge\" element={<KnowledgeBasesPage />} />\n <Route path=\"bots/:botId/knowledge/:kbId\" element={<KnowledgeBaseDetailPage />} />\n\n {/* Agents (global view) */}\n <Route path=\"agents\" element={<AgentsListPage />} />\n <Route\n path=\"agents/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_CREATE,\n t('botlit.agentsList.actions.createAgent', 'Create Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route path=\"agents/approvals\" element={<AgentApprovalsPage />} />\n <Route path=\"agents/:agentId\" element={<AgentDetailPage />} />\n <Route\n path=\"agents/:agentId/edit\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_UPDATE,\n t('botlit.agentsList.menu.editAgent', 'Edit Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route\n path=\"agents/:agentId/test\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.agentTest.title', 'Test Agent'),\n 'agents',\n back,\n <AgentTestChatPage />\n )}\n />\n <Route\n path=\"agents/:agentId/chat\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.chat.title', 'AI Chat'),\n 'agents',\n back,\n <ChatPage />\n )}\n />\n\n {/* Knowledge Bases */}\n <Route path=\"knowledge\" element={<KnowledgeBasesPage />} />\n <Route\n path=\"knowledge/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.KNOWLEDGE_CREATE,\n t('botlit.knowledge.actions.create', 'Create Knowledge Base'),\n 'knowledge',\n back,\n <KnowledgeBaseDetailPage isNew />\n )}\n />\n <Route path=\"knowledge/:kbId\" element={<KnowledgeBaseDetailPage />} />\n\n {/* Retrieval Profiles */}\n <Route path=\"retrieval-profiles\" element={<RetrievalProfilesPage />} />\n <Route\n path=\"retrieval-profiles/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.RETRIEVAL_PROFILE_CREATE,\n t('botlit.retrievalProfiles.actions.create', 'Create Retrieval Profile'),\n 'retrieval-profiles',\n back,\n <RetrievalProfileDetailPage isNew />\n )}\n />\n <Route path=\"retrieval-profiles/:profileId\" element={<RetrievalProfileDetailPage />} />\n\n {/* MCP Servers */}\n <Route path=\"mcp\" element={<MCPServersPage />} />\n <Route\n path=\"mcp/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.MCP_CREATE,\n t('botlit.mcpServers.actions.add', 'Add MCP Server'),\n 'mcp',\n back,\n <MCPServerDetailPage isNew />\n )}\n />\n <Route path=\"mcp/:serverId\" element={<MCPServerDetailPage />} />\n\n {/* A2A Registry */}\n <Route path=\"a2a\" element={<A2ARegistryPage />} />\n <Route\n path=\"a2a/register\"\n element={gated(\n BOTMANOR_PERMISSIONS.A2A_REGISTRY_CREATE,\n t('botlit.a2aRegistry.actions.registerAgent', 'Register Agent'),\n 'a2a',\n back,\n <A2AAgentDetailPage isNew />\n )}\n />\n <Route path=\"a2a/:agentId\" element={<A2AAgentDetailPage />} />\n\n {/* Channels */}\n <Route path=\"channels\" element={<ChannelsPage />} />\n <Route\n path=\"channels/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.CHANNEL_CREATE,\n t('botlit.channels.actions.addChannel', 'Add Channel'),\n 'channels',\n back,\n <ChannelDetailPage isNew />\n )}\n />\n <Route path=\"channels/routes\" element={<ChannelRoutesPage />} />\n <Route path=\"channels/:connectorId\" element={<ChannelDetailPage />} />\n\n {/* Policies & Guardrails */}\n <Route path=\"policies\" element={<PoliciesPage />} />\n <Route\n path=\"policies/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.POLICY_CREATE,\n t('botlit.policies.actions.createPolicy', 'Create Policy'),\n 'policies',\n back,\n <PolicyDetailPage isNew />\n )}\n />\n <Route path=\"policies/:policyId\" element={<PolicyDetailPage />} />\n\n {/* Skills */}\n <Route path=\"skills\" element={<SkillsPage />} />\n <Route\n path=\"skills/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.SKILL_CREATE,\n t('botlit.skills.actions.create', 'Create Skill'),\n 'skills',\n back,\n <SkillDetailPage isNew />\n )}\n />\n <Route path=\"skills/:skillId\" element={<SkillDetailPage />} />\n\n {/* Prompt Templates */}\n <Route path=\"prompt-templates\" element={<PromptTemplatesPage />} />\n <Route\n path=\"prompt-templates/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.PROMPT_TEMPLATE_CREATE,\n t('botlit.promptTemplates.actions.create', 'Create Template'),\n 'prompt-templates',\n back,\n <PromptTemplateDetailPage isNew />\n )}\n />\n <Route path=\"prompt-templates/:templateId\" element={<PromptTemplateDetailPage />} />\n\n {/* Prompt Studio (legacy) */}\n <Route path=\"prompts\" element={<PromptStudioPage />} />\n\n {/* Executions */}\n <Route path=\"executions\" element={<ExecutionsPage />} />\n <Route path=\"ai\" element={<AiOperationsPage />} />\n <Route path=\"handoffs\" element={<HandoffsPage />} />\n <Route path=\"executions/:executionId\" element={<ExecutionDetailPage />} />\n\n {/* Buckets */}\n <Route path=\"buckets\" element={<BucketsPage />} />\n {/* Create is a dialog on the list page. Old and shared links to `buckets/new`\n (the website's use-case steps link here) open that dialog (BOFF-9571). */}\n <Route\n path=\"buckets/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.BUCKET_CREATE,\n t('botlit.buckets.newBucket', 'New Bucket'),\n `${normalizedBasePath}/buckets`,\n back,\n <Navigate\n to={{\n pathname: `${normalizedBasePath}/buckets`,\n search: createBucketSearch.toString(),\n }}\n replace\n />\n )}\n />\n <Route path=\"buckets/:bucketId\" element={<BucketDetailPage />} />\n\n {/* Store */}\n <Route path=\"store\" element={<StorePage />} />\n <Route path=\"store/installed\" element={<InstalledPackagesPage />} />\n <Route path=\"store/publish\" element={<StorePublishingPage />} />\n {/* Package slugs are namespaced (\"botlit/rag-starter\"), so the detail\n route takes the rest of the path, raw or encoded (BOFF-12424). */}\n <Route path=\"store/package/*\" element={<StorePackageDetailPage />} />\n\n {/* Chat */}\n <Route\n path=\"chat\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.chat.title', 'AI Chat'),\n 'agents',\n back,\n <ChatPage />\n )}\n />\n <Route\n path=\"chat/:agentId\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.chat.title', 'AI Chat'),\n 'agents',\n back,\n <ChatPage />\n )}\n />\n\n {/* Settings */}\n <Route path=\"settings\" element={<SettingsPage />} />\n\n {/* Workflow routes are owned by the shared app-shell WorkflowsRoot. */}\n <Route\n path=\"list\"\n element={<Navigate to={`${normalizedBasePath}/workflows/list`} replace />}\n />\n\n {/* Fallback - land back on the BotManor dashboard, not the app-shell root */}\n <Route path=\"*\" element={<Navigate to={normalizedBasePath || '/'} replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAMA,KAAeC,QACnB,OAAO,0BAAuB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CAC1E,GACMC,IAAgBF,QACpB,OAAO,2BAAwB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,cAAc,EAAE,CAC5E,GAGME,IAAiBH,QACrB,OAAO,4BAAyB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CAC9E,GACMG,IAAqBJ,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMI,IAAkBL,QACtB,OAAO,6BAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,gBAAgB,EAAE,CAChF,GACMK,IAAmBN,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAClF,GAGMM,IAAqBP,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMO,IAA0BR,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,wBAAwB,EAAE,CAChG,GAGMQ,IAAwBT,QAC5B,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,sBAAsB,EAAE,CAC5F,GACMS,IAA6BV,QACjC,OAAO,wCAAqC,CAAC,MAAM,OAAO,EACxD,SAASC,EAAE,2BACb,EAAE,CACJ,GAGMU,IAAiBX,QACrB,OAAO,4BAAyB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eA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otsListPage","lazy","m","BotDetailPage","AgentsListPage","AgentApprovalsPage","AgentDetailPage","AgentBuilderPage","KnowledgeBasesPage","KnowledgeBaseDetailPage","RetrievalProfilesPage","RetrievalProfileDetailPage","MCPServersPage","MCPServerDetailPage","A2ARegistryPage","A2AAgentDetailPage","ChannelsPage","ChannelDetailPage","ChannelRoutesPage","PoliciesPage","PolicyDetailPage","SkillsPage","SkillDetailPage","PromptTemplatesPage","PromptTemplateDetailPage","PromptStudioPage","ExecutionsPage","ExecutionDetailPage","AiOperationsPage","HandoffsPage","BucketsPage","BucketDetailPage","StorePage","StorePackageDetailPage","StorePublishingPage","InstalledPackagesPage","SettingsPage","AgentTestChatPage","ChatPage","BotlitRoutes","useBotlit","location","useLocation","t","useTr","gated","RequirePermission","element","back","normalizedBasePath","basePath","createBucketSearch","BUCKET_CREATE_PARAM","isStandalone","Suspense","RouteLoader","Routes","Route","DashboardPage","Navigate","BOTMANOR_PERMISSIONS"],"sources":["../../src/botlit/BotlitRoutes.tsx"],"sourcesContent":["/**\n * BotManor Routes\n * @module botlit\n */\n\nimport { type FC, type ReactElement, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useBotlit } from './providers/BotlitProvider';\nimport { RouteLoader } from './components/RouteLoader';\nimport { BOTMANOR_PERMISSIONS, RequirePermission, type BotmanorPermission } from './permissions';\nimport { useTr } from '../shared/hooks/useTr';\n\n// Eager load - Dashboard (primary landing page)\nimport { DashboardPage } from './pages/DashboardPage';\nimport { BUCKET_CREATE_PARAM } from './pages/bucketCreateDialog';\n\n// Lazy loaded pages - Bots\nconst BotsListPage = lazy(() =>\n import('./pages/BotsListPage').then((m) => ({ default: m.BotsListPage }))\n);\nconst BotDetailPage = lazy(() =>\n import('./pages/BotDetailPage').then((m) => ({ default: m.BotDetailPage }))\n);\n\n// Lazy loaded pages - Agents\nconst AgentsListPage = lazy(() =>\n import('./pages/AgentsListPage').then((m) => ({ default: m.AgentsListPage }))\n);\nconst AgentApprovalsPage = lazy(() =>\n import('./pages/AgentApprovalsPage').then((m) => ({ default: m.AgentApprovalsPage }))\n);\nconst AgentDetailPage = lazy(() =>\n import('./pages/AgentDetailPage').then((m) => ({ default: m.AgentDetailPage }))\n);\nconst AgentBuilderPage = lazy(() =>\n import('./pages/AgentBuilderPage').then((m) => ({ default: m.AgentBuilderPage }))\n);\n\n// Lazy loaded pages - Knowledge Bases\nconst KnowledgeBasesPage = lazy(() =>\n import('./pages/KnowledgeBasesPage').then((m) => ({ default: m.KnowledgeBasesPage }))\n);\nconst KnowledgeBaseDetailPage = lazy(() =>\n import('./pages/KnowledgeBaseDetailPage').then((m) => ({ default: m.KnowledgeBaseDetailPage }))\n);\n\n// Lazy loaded pages - Retrieval Profiles\nconst RetrievalProfilesPage = lazy(() =>\n import('./pages/RetrievalProfilesPage').then((m) => ({ default: m.RetrievalProfilesPage }))\n);\nconst RetrievalProfileDetailPage = lazy(() =>\n import('./pages/RetrievalProfileDetailPage').then((m) => ({\n default: m.RetrievalProfileDetailPage,\n }))\n);\n\n// Lazy loaded pages - MCP Servers\nconst MCPServersPage = lazy(() =>\n import('./pages/MCPServersPage').then((m) => ({ default: m.MCPServersPage }))\n);\nconst MCPServerDetailPage = lazy(() =>\n import('./pages/MCPServerDetailPage').then((m) => ({ default: m.MCPServerDetailPage }))\n);\n\n// Lazy loaded pages - A2A Registry\nconst A2ARegistryPage = lazy(() =>\n import('./pages/A2ARegistryPage').then((m) => ({ default: m.A2ARegistryPage }))\n);\nconst A2AAgentDetailPage = lazy(() =>\n import('./pages/A2AAgentDetailPage').then((m) => ({ default: m.A2AAgentDetailPage }))\n);\n\n// Lazy loaded pages - Channels\nconst ChannelsPage = lazy(() =>\n import('./pages/ChannelsPage').then((m) => ({ default: m.ChannelsPage }))\n);\nconst ChannelDetailPage = lazy(() =>\n import('./pages/ChannelDetailPage').then((m) => ({ default: m.ChannelDetailPage }))\n);\nconst ChannelRoutesPage = lazy(() =>\n import('./pages/ChannelRoutesPage').then((m) => ({ default: m.ChannelRoutesPage }))\n);\n\n// Lazy loaded pages - Policies\nconst PoliciesPage = lazy(() =>\n import('./pages/PoliciesPage').then((m) => ({ default: m.PoliciesPage }))\n);\nconst PolicyDetailPage = lazy(() =>\n import('./pages/PolicyDetailPage').then((m) => ({ default: m.PolicyDetailPage }))\n);\n\n// Lazy loaded pages - Skills\nconst SkillsPage = lazy(() =>\n import('./pages/SkillsPage').then((m) => ({ default: m.SkillsPage }))\n);\nconst SkillDetailPage = lazy(() =>\n import('./pages/SkillDetailPage').then((m) => ({ default: m.SkillDetailPage }))\n);\n\n// Lazy loaded pages - Prompt Templates\nconst PromptTemplatesPage = lazy(() =>\n import('./pages/PromptTemplatesPage').then((m) => ({ default: m.PromptTemplatesPage }))\n);\nconst PromptTemplateDetailPage = lazy(() =>\n import('./pages/PromptTemplateDetailPage').then((m) => ({ default: m.PromptTemplateDetailPage }))\n);\nconst PromptStudioPage = lazy(() =>\n import('./pages/PromptStudioPage').then((m) => ({ default: m.PromptStudioPage }))\n);\n\n// Lazy loaded pages - Executions\nconst ExecutionsPage = lazy(() =>\n import('./pages/ExecutionsPage').then((m) => ({ default: m.ExecutionsPage }))\n);\nconst ExecutionDetailPage = lazy(() =>\n import('./pages/ExecutionDetailPage').then((m) => ({ default: m.ExecutionDetailPage }))\n);\n\n// Lazy loaded pages - AI Operations (supervisor decision feed, BOFF-3839)\nconst AiOperationsPage = lazy(() =>\n import('./pages/AiOperationsPage').then((m) => ({ default: m.AiOperationsPage }))\n);\n\n// Lazy loaded pages - Human handoffs (shared team inbox, BOFF-5813)\nconst HandoffsPage = lazy(() =>\n import('./pages/HandoffsPage').then((m) => ({ default: m.HandoffsPage }))\n);\n\n// Lazy loaded pages - Buckets\nconst BucketsPage = lazy(() =>\n import('./pages/BucketsPage').then((m) => ({ default: m.BucketsPage }))\n);\nconst BucketDetailPage = lazy(() =>\n import('./pages/BucketDetailPage').then((m) => ({ default: m.BucketDetailPage }))\n);\n\n// Lazy loaded pages - Store\nconst StorePage = lazy(() => import('./pages/StorePage').then((m) => ({ default: m.StorePage })));\nconst StorePackageDetailPage = lazy(() =>\n import('./pages/StorePackageDetailPage').then((m) => ({ default: m.StorePackageDetailPage }))\n);\nconst StorePublishingPage = lazy(() =>\n import('./pages/StorePublishingPage').then((m) => ({ default: m.StorePublishingPage }))\n);\nconst InstalledPackagesPage = lazy(() =>\n import('./pages/InstalledPackagesPage').then((m) => ({ default: m.InstalledPackagesPage }))\n);\n\n// Lazy loaded pages - Settings & Chat\nconst SettingsPage = lazy(() =>\n import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage }))\n);\nconst AgentTestChatPage = lazy(() =>\n import('./pages/AgentTestChatPage').then((m) => ({ default: m.AgentTestChatPage }))\n);\nconst ChatPage = lazy(() => import('./pages/ChatPage').then((m) => ({ default: m.ChatPage })));\n\n// Loading fallback — the same skeleton `BotmanorRoot` paints while its\n// implementation chunk resolves, so the content region never switches loading\n// idioms (and never goes empty) between first paint and the page rendering.\n\nexport const BotlitRoutes: FC = () => {\n const { basePath, isStandalone } = useBotlit();\n const location = useLocation();\n const t = useTr();\n\n /**\n * Create, edit and chat routes are reachable by URL, so they are gated here\n * as well as at the buttons that link to them: a member without the\n * permission gets a clear \"no access\" state instead of a form the gateway\n * would refuse to save.\n */\n const gated = (\n permission: BotmanorPermission,\n title: string,\n backTo: string,\n backLabel: string,\n element: ReactElement\n ): ReactElement => (\n <RequirePermission permission={permission} title={title} backTo={backTo} backLabel={backLabel}>\n {element}\n </RequirePermission>\n );\n const back = t('permissions.required.back', 'Go back');\n\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : basePath.replace(/\\/$/, '');\n const createBucketSearch = new URLSearchParams(location.search);\n createBucketSearch.set(BUCKET_CREATE_PARAM, '1');\n\n // Guard: Only render if path matches basePath (when integrated)\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex flex-col min-h-full bg-bg-surface\">\n <Suspense fallback={<RouteLoader />}>\n <Routes>\n {/* Dashboard - Eager loaded */}\n <Route index element={<DashboardPage />} />\n <Route path=\"home\" element={<Navigate to={normalizedBasePath || '/'} replace />} />\n\n {/* Bots */}\n <Route path=\"bots\" element={<BotsListPage />} />\n <Route\n path=\"bots/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.APP_CREATE,\n t('botlit.botsList.actions.createBot', 'Create Bot'),\n 'bots',\n back,\n <BotDetailPage isNew />\n )}\n />\n <Route path=\"bots/:botId\" element={<BotDetailPage />} />\n <Route\n path=\"bots/:botId/edit\"\n element={gated(\n BOTMANOR_PERMISSIONS.APP_UPDATE,\n t('botlit.botsList.menu.editBot', 'Edit Bot'),\n 'bots',\n back,\n <BotDetailPage isEditing />\n )}\n />\n <Route path=\"bots/:botId/agents\" element={<AgentsListPage />} />\n <Route\n path=\"bots/:botId/agents/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_CREATE,\n t('botlit.agentsList.actions.createAgent', 'Create Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route path=\"bots/:botId/agents/:agentId\" element={<AgentDetailPage />} />\n <Route\n path=\"bots/:botId/agents/:agentId/edit\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_UPDATE,\n t('botlit.agentsList.menu.editAgent', 'Edit Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route path=\"bots/:botId/knowledge\" element={<KnowledgeBasesPage />} />\n <Route path=\"bots/:botId/knowledge/:kbId\" element={<KnowledgeBaseDetailPage />} />\n\n {/* Agents (global view) */}\n <Route path=\"agents\" element={<AgentsListPage />} />\n <Route\n path=\"agents/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_CREATE,\n t('botlit.agentsList.actions.createAgent', 'Create Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route path=\"agents/approvals\" element={<AgentApprovalsPage />} />\n <Route path=\"agents/:agentId\" element={<AgentDetailPage />} />\n <Route\n path=\"agents/:agentId/edit\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_UPDATE,\n t('botlit.agentsList.menu.editAgent', 'Edit Agent'),\n 'agents',\n back,\n <AgentBuilderPage />\n )}\n />\n <Route\n path=\"agents/:agentId/test\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.agentTest.title', 'Test Agent'),\n 'agents',\n back,\n <AgentTestChatPage />\n )}\n />\n <Route\n path=\"agents/:agentId/chat\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.chat.title', 'AI Chat'),\n 'agents',\n back,\n <ChatPage />\n )}\n />\n\n {/* Knowledge Bases */}\n <Route path=\"knowledge\" element={<KnowledgeBasesPage />} />\n <Route\n path=\"knowledge/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.KNOWLEDGE_CREATE,\n t('botlit.knowledge.actions.create', 'Create Knowledge Base'),\n 'knowledge',\n back,\n <KnowledgeBaseDetailPage isNew />\n )}\n />\n <Route path=\"knowledge/:kbId\" element={<KnowledgeBaseDetailPage />} />\n\n {/* Retrieval Profiles */}\n <Route path=\"retrieval-profiles\" element={<RetrievalProfilesPage />} />\n <Route\n path=\"retrieval-profiles/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.RETRIEVAL_PROFILE_CREATE,\n t('botlit.retrievalProfiles.actions.create', 'Create Retrieval Profile'),\n 'retrieval-profiles',\n back,\n <RetrievalProfileDetailPage isNew />\n )}\n />\n <Route path=\"retrieval-profiles/:profileId\" element={<RetrievalProfileDetailPage />} />\n\n {/* MCP Servers */}\n <Route path=\"mcp\" element={<MCPServersPage />} />\n <Route\n path=\"mcp/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.MCP_CREATE,\n t('botlit.mcpServers.actions.add', 'Add MCP Server'),\n 'mcp',\n back,\n <MCPServerDetailPage isNew />\n )}\n />\n <Route path=\"mcp/:serverId\" element={<MCPServerDetailPage />} />\n\n {/* A2A Registry */}\n <Route path=\"a2a\" element={<A2ARegistryPage />} />\n <Route\n path=\"a2a/register\"\n element={gated(\n BOTMANOR_PERMISSIONS.A2A_REGISTRY_CREATE,\n t('botlit.a2aRegistry.actions.registerAgent', 'Register Agent'),\n 'a2a',\n back,\n <A2AAgentDetailPage isNew />\n )}\n />\n <Route path=\"a2a/:agentId\" element={<A2AAgentDetailPage />} />\n\n {/* Channels */}\n <Route path=\"channels\" element={<ChannelsPage />} />\n <Route\n path=\"channels/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.CHANNEL_CREATE,\n t('botlit.channels.actions.addChannel', 'Add Channel'),\n 'channels',\n back,\n <ChannelDetailPage isNew />\n )}\n />\n <Route path=\"channels/routes\" element={<ChannelRoutesPage />} />\n <Route path=\"channels/:connectorId\" element={<ChannelDetailPage />} />\n\n {/* Policies & Guardrails */}\n <Route path=\"policies\" element={<PoliciesPage />} />\n <Route\n path=\"policies/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.POLICY_CREATE,\n t('botlit.policies.actions.createPolicy', 'Create Policy'),\n 'policies',\n back,\n <PolicyDetailPage isNew />\n )}\n />\n <Route path=\"policies/:policyId\" element={<PolicyDetailPage />} />\n\n {/* Skills */}\n <Route path=\"skills\" element={<SkillsPage />} />\n <Route\n path=\"skills/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.SKILL_CREATE,\n t('botlit.skills.actions.create', 'Create Skill'),\n 'skills',\n back,\n <SkillDetailPage isNew />\n )}\n />\n <Route path=\"skills/:skillId\" element={<SkillDetailPage />} />\n\n {/* Prompt Templates */}\n <Route path=\"prompt-templates\" element={<PromptTemplatesPage />} />\n <Route\n path=\"prompt-templates/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.PROMPT_TEMPLATE_CREATE,\n t('botlit.promptTemplates.actions.create', 'Create Template'),\n 'prompt-templates',\n back,\n <PromptTemplateDetailPage isNew />\n )}\n />\n <Route path=\"prompt-templates/:templateId\" element={<PromptTemplateDetailPage />} />\n\n {/* Prompt Studio (legacy) */}\n <Route path=\"prompts\" element={<PromptStudioPage />} />\n\n {/* Executions */}\n <Route path=\"executions\" element={<ExecutionsPage />} />\n <Route path=\"ai\" element={<AiOperationsPage />} />\n <Route path=\"handoffs\" element={<HandoffsPage />} />\n <Route path=\"executions/:executionId\" element={<ExecutionDetailPage />} />\n\n {/* Buckets */}\n <Route path=\"buckets\" element={<BucketsPage />} />\n {/* Create is a dialog on the list page. Old and shared links to `buckets/new`\n (the website's use-case steps link here) open that dialog (BOFF-9571). */}\n <Route\n path=\"buckets/new\"\n element={gated(\n BOTMANOR_PERMISSIONS.BUCKET_CREATE,\n t('botlit.buckets.newBucket', 'New Bucket'),\n `${normalizedBasePath}/buckets`,\n back,\n <Navigate\n to={{\n pathname: `${normalizedBasePath}/buckets`,\n search: createBucketSearch.toString(),\n }}\n replace\n />\n )}\n />\n <Route path=\"buckets/:bucketId\" element={<BucketDetailPage />} />\n\n {/* Store */}\n <Route path=\"store\" element={<StorePage />} />\n <Route path=\"store/installed\" element={<InstalledPackagesPage />} />\n <Route path=\"store/publish\" element={<StorePublishingPage />} />\n {/* Package slugs are namespaced (\"botlit/rag-starter\"), so the detail\n route takes the rest of the path, raw or encoded (BOFF-12424). */}\n <Route path=\"store/package/*\" element={<StorePackageDetailPage />} />\n\n {/* Chat */}\n <Route\n path=\"chat\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.chat.title', 'AI Chat'),\n 'agents',\n back,\n <ChatPage />\n )}\n />\n <Route\n path=\"chat/:agentId\"\n element={gated(\n BOTMANOR_PERMISSIONS.AGENT_EXECUTE,\n t('botlit.chat.title', 'AI Chat'),\n 'agents',\n back,\n <ChatPage />\n )}\n />\n\n {/* Settings */}\n <Route\n path=\"settings\"\n element={\n <RequirePermission\n permission={BOTMANOR_PERMISSIONS.LLM_READ}\n title={t('botlit.settings.title', 'Settings')}\n description={t(\n 'botlit.settings.noAccess',\n 'Ask a workspace admin for permission to view model provider settings.'\n )}\n backTo=\"\"\n backLabel={back}\n >\n <SettingsPage />\n </RequirePermission>\n }\n />\n\n {/* Workflow routes are owned by the shared app-shell WorkflowsRoot. */}\n <Route\n path=\"list\"\n element={<Navigate to={`${normalizedBasePath}/workflows/list`} replace />}\n />\n\n {/* Fallback - land back on the BotManor dashboard, not the app-shell root */}\n <Route path=\"*\" element={<Navigate to={normalizedBasePath || '/'} replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAMA,KAAeC,QACnB,OAAO,0BAAuB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CAC1E,GACMC,IAAgBF,QACpB,OAAO,2BAAwB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,cAAc,EAAE,CAC5E,GAGME,IAAiBH,QACrB,OAAO,4BAAyB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CAC9E,GACMG,KAAqBJ,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMI,IAAkBL,QACtB,OAAO,6BAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,gBAAgB,EAAE,CAChF,GACMK,IAAmBN,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAClF,GAGMM,IAAqBP,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMO,IAA0BR,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,wBAAwB,EAAE,CAChG,GAGMQ,IAAwBT,QAC5B,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,sBAAsB,EAAE,CAC5F,GACMS,IAA6B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;KACL,SAAS,kBAACE,GAAD;MAAU,IAAI,GAAGV,EAAmB;MAAkB,SAAA;KAAS,CAAA;IACzE,CAAA;IAGD,kBAACQ,GAAD;KAAO,MAAK;KAAI,SAAS,kBAACE,GAAD;MAAU,IAAIV,KAAsB;MAAK,SAAA;KAAS,CAAA;IAAI,CAAA;GACzE,EAAA,CAAA;EACA,CAAA;CACP,CAAA;AAET"}
|
|
@@ -7,7 +7,7 @@ export interface LLMProviderRecord {
|
|
|
7
7
|
type: string;
|
|
8
8
|
isActive: boolean;
|
|
9
9
|
apiEndpoint?: string | null;
|
|
10
|
-
|
|
10
|
+
hasStoredCredentials?: boolean;
|
|
11
11
|
connectionId?: string | null;
|
|
12
12
|
metadata?: Record<string, unknown> | null;
|
|
13
13
|
createdAt: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLLMProviders.js","names":["LIST_LIMIT","NO_PROVIDERS","NO_MODELS","CREATE_PROVIDER_FIELDS","fieldsOf","UPDATE_PROVIDER_FIELDS","useLLMList","client","useWorkspaceClient","useBotlit","query","useQuery","workspaceId","currentUser","kind","providerId","records","offset","result","document","page","select","fallback","useLLMProviders","ListBotmanorLlmProvidersDocument","data","useLLMModels","ListBotmanorLlmModelsDocument","filters","useConfigureLLMProvider","useWorkspaceId","create","createState","useWorkspaceMutation","CreateBotmanorLlmProviderDocument","buildMutationInput","input","update","updateState","UpdateBotmanorLlmProviderDocument","useCallback","existingId","useTestLLMConnection","TestLlmConnectionDocument","useCreateLLMModel","createModel","state","CreateBotmanorLlmModelDocument"],"sources":["../../../src/botlit/hooks/useLLMProviders.ts"],"sourcesContent":["/**\n * LLM Providers Hooks\n * @module botlit/hooks\n *\n * These go through the shell's workspace gateway client like every other BotManor\n * hook. They deliberately do NOT use the generated `useQuery`/`useMutation`\n * wrappers: `BotmanorRoot` only mounts an `<ApolloProvider>` in standalone mode,\n * so an Apollo React hook throws \"Could not find client in the context\" the\n * moment the MFE is mounted by an app shell — which is every production route.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport type { DocumentNode } from 'graphql';\nimport { useQuery } from '@tanstack/react-query';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport {\n CreateBotmanorLlmProviderDocument,\n CreateBotmanorLlmModelDocument,\n DeleteLlmProviderDocument,\n GetBotmanorLlmProviderDocument,\n ListBotmanorLlmModelsDocument,\n ListBotmanorLlmProvidersDocument,\n TestLlmConnectionDocument,\n UpdateBotmanorLlmProviderDocument,\n type CreateBotmanorLlmProviderMutation,\n type CreateBotmanorLlmModelMutation,\n type DeleteLlmProviderMutation,\n type GetBotmanorLlmProviderQuery,\n type ListBotmanorLlmModelsQuery,\n type ListBotmanorLlmProvidersQuery,\n type TestLlmConnectionMutation,\n type UpdateBotmanorLlmProviderMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateBotmanorLlmModelInput,\n CreateBotmanorLlmProviderInput,\n UpdateBotmanorLlmProviderInput,\n} from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceClient,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 50;\n\nexport interface LLMProviderRecord {\n id: string;\n name: string;\n type: string;\n isActive: boolean;\n apiEndpoint?: string | null;\n credentialsHash?: string | null;\n connectionId?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n workspaceId: string;\n}\n\nexport interface LLMModelRecord {\n id: string;\n name: string;\n modelId: string;\n providerId: string;\n contextWindow: number;\n maxOutputTokens: number;\n inputPricePerMToken: number;\n outputPricePerMToken: number;\n isActive: boolean;\n supportsStreaming: boolean;\n supportsFunctionCalling: boolean;\n supportsVision: boolean;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** `CreateBotmanorLLMProviderInput` minus the `workspaceId` the hook supplies. */\nexport type ConfigureLLMProviderVariables = Omit<\n GraphQLInput<CreateBotmanorLlmProviderInput>,\n 'workspaceId'\n> & { isActive?: boolean };\n\nconst NO_PROVIDERS: LLMProviderRecord[] = [];\nconst NO_MODELS: LLMModelRecord[] = [];\n\nconst CREATE_PROVIDER_FIELDS = fieldsOf<CreateBotmanorLlmProviderInput>({\n apiEndpoint: true,\n connectionId: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n workspaceId: true,\n});\n\nconst UPDATE_PROVIDER_FIELDS = fieldsOf<UpdateBotmanorLlmProviderInput>({\n apiEndpoint: true,\n clearCredentials: true,\n connectionId: true,\n credentials: true,\n isActive: true,\n metadata: true,\n name: true,\n});\n\nexport const llmProviderKeys = {\n all: ['llmProviders'] as const,\n lists: () => [...llmProviderKeys.all, 'list'] as const,\n details: () => [...llmProviderKeys.all, 'detail'] as const,\n detail: (id: string) => [...llmProviderKeys.details(), id] as const,\n};\n\nfunction useLLMList<TData, TRecord>(\n document: DocumentNode,\n kind: string,\n select: (data: TData | undefined) => TRecord[],\n fallback: TRecord[],\n providerId?: string\n): QueryResult<TRecord[]> {\n const client = useWorkspaceClient();\n const { workspaceId, currentUser } = useBotlit();\n const query = useQuery({\n queryKey: ['botmanor-llm-catalog', workspaceId, currentUser?.id, kind, providerId],\n enabled: Boolean(workspaceId),\n retry: false,\n queryFn: async () => {\n const records: TRecord[] = [];\n for (let offset = 0; offset < 10000; offset += LIST_LIMIT) {\n const result = await client.query<TData>({\n query: document,\n fetchPolicy: 'network-only',\n variables: {\n filters: providerId ? { providerId } : undefined,\n pagination: { limit: LIST_LIMIT, offset },\n },\n });\n if (!result.data) throw new Error('Model catalog unavailable');\n const page = select(result.data);\n if (!Array.isArray(page) || page.length > LIST_LIMIT)\n throw new Error('Model catalog unavailable');\n records.push(...page);\n if (page.length < LIST_LIMIT) return records;\n }\n throw new Error('Model catalog exceeds the supported limit');\n },\n });\n return {\n data: query.data ?? fallback,\n loading: query.isFetching,\n error: query.error ?? undefined,\n refetch: async () => {\n await query.refetch();\n },\n };\n}\n\nexport function useLLMProviders(): QueryResult<LLMProviderRecord[]> {\n return useLLMList<ListBotmanorLlmProvidersQuery, LLMProviderRecord>(\n ListBotmanorLlmProvidersDocument,\n 'providers',\n (data) => data?.listBotmanorLLMProviders ?? NO_PROVIDERS,\n NO_PROVIDERS\n );\n}\n\nexport function useLLMProvider(\n providerId: string | undefined\n): QueryResult<LLMProviderRecord | null> {\n const variables = useMemo(() => ({ id: providerId ?? '' }), [providerId]);\n\n return useWorkspaceQuery<GetBotmanorLlmProviderQuery, LLMProviderRecord | null>({\n document: GetBotmanorLlmProviderDocument,\n variables,\n select: (data) => data?.getBotmanorLLMProvider ?? null,\n fallback: null,\n enabled: Boolean(providerId),\n errorMessage: 'Failed to load LLM provider',\n });\n}\n\nexport function useLLMModels(filters?: { providerId?: string }): QueryResult<LLMModelRecord[]> {\n return useLLMList<ListBotmanorLlmModelsQuery, LLMModelRecord>(\n ListBotmanorLlmModelsDocument,\n 'models',\n (data) => data?.listBotmanorLLMModels ?? NO_MODELS,\n NO_MODELS,\n filters?.providerId\n );\n}\n\n/**\n * Creates a provider, or updates the one whose id the caller passes.\n * `UpdateBotmanorLLMProviderInput` has no `type`/`workspaceId`, so the update\n * payload is projected onto the fields that input actually declares.\n */\nexport function useConfigureLLMProvider() {\n const workspaceId = useWorkspaceId();\n\n const [create, createState] = useWorkspaceMutation<\n CreateBotmanorLlmProviderMutation,\n ConfigureLLMProviderVariables,\n LLMProviderRecord\n >({\n document: CreateBotmanorLlmProviderDocument,\n variables: (input) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.createBotmanorLLMProvider,\n errorMessage: 'Failed to create the LLM provider',\n });\n\n const [update, updateState] = useWorkspaceMutation<\n UpdateBotmanorLlmProviderMutation,\n { providerId: string; input: ConfigureLLMProviderVariables },\n LLMProviderRecord\n >({\n document: UpdateBotmanorLlmProviderDocument,\n variables: ({ providerId, input }) => ({\n id: providerId,\n input: buildMutationInput(input, UPDATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.updateBotmanorLLMProvider,\n errorMessage: 'Failed to update the LLM provider',\n });\n\n const configureProvider = useCallback(\n async (input: ConfigureLLMProviderVariables, existingId?: string) =>\n existingId ? update({ providerId: existingId, input }) : create(input),\n [create, update]\n );\n\n return {\n configureProvider,\n isConfiguring: createState.loading || updateState.loading,\n error: createState.error ?? updateState.error,\n };\n}\n\nexport function useDeleteLLMProvider() {\n return useWorkspaceMutation<DeleteLlmProviderMutation, string, boolean>({\n document: DeleteLlmProviderDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.deleteLLMProvider,\n errorMessage: 'Failed to delete the LLM provider',\n });\n}\n\nexport function useTestLLMConnection() {\n return useWorkspaceMutation<TestLlmConnectionMutation, string, boolean>({\n document: TestLlmConnectionDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.testLlmConnection,\n errorMessage: 'Failed to test the LLM connection',\n });\n}\n\n/** Register models through the same authenticated workspace gateway as providers. */\nexport function useCreateLLMModel() {\n const [createModel, state] = useWorkspaceMutation<\n CreateBotmanorLlmModelMutation,\n CreateBotmanorLlmModelInput,\n LLMModelRecord\n >({\n document: CreateBotmanorLlmModelDocument,\n variables: (input) => ({\n input: buildMutationInput(\n input,\n fieldsOf<CreateBotmanorLlmModelInput>({\n providerId: true,\n name: true,\n modelId: true,\n contextWindow: true,\n maxOutputTokens: true,\n inputPricePerMToken: true,\n outputPricePerMToken: true,\n supportsStreaming: true,\n supportsFunctionCalling: true,\n supportsVision: true,\n metadata: true,\n })\n ),\n }),\n select: (data) => data?.createBotmanorLLMModel,\n errorMessage: 'Failed to register the model',\n });\n return { createModel, isCreating: state.loading, error: state.error };\n}\n"],"mappings":";;;;;;;AA+CA,IAAMA,IAAa,IAwCbC,IAAoC,CAAC,GACrCC,IAA8B,CAAC,GAE/BC,IAAyBC,EAAyC;CACtE,aAAa;CACb,cAAc;CACd,aAAa;CACb,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EAAM;EAAS,OAAOA,EAAM;CAAM;AACtE"}
|
|
1
|
+
{"version":3,"file":"useLLMProviders.js","names":["LIST_LIMIT","NO_PROVIDERS","NO_MODELS","CREATE_PROVIDER_FIELDS","fieldsOf","UPDATE_PROVIDER_FIELDS","useLLMList","client","useWorkspaceClient","useBotlit","query","useQuery","workspaceId","currentUser","kind","providerId","records","offset","result","document","page","select","fallback","useLLMProviders","ListBotmanorLlmProvidersDocument","data","useLLMModels","ListBotmanorLlmModelsDocument","filters","useConfigureLLMProvider","useWorkspaceId","create","createState","useWorkspaceMutation","CreateBotmanorLlmProviderDocument","buildMutationInput","input","update","updateState","UpdateBotmanorLlmProviderDocument","useCallback","existingId","useTestLLMConnection","TestLlmConnectionDocument","useCreateLLMModel","createModel","state","CreateBotmanorLlmModelDocument"],"sources":["../../../src/botlit/hooks/useLLMProviders.ts"],"sourcesContent":["/**\n * LLM Providers Hooks\n * @module botlit/hooks\n *\n * These go through the shell's workspace gateway client like every other BotManor\n * hook. They deliberately do NOT use the generated `useQuery`/`useMutation`\n * wrappers: `BotmanorRoot` only mounts an `<ApolloProvider>` in standalone mode,\n * so an Apollo React hook throws \"Could not find client in the context\" the\n * moment the MFE is mounted by an app shell — which is every production route.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport type { DocumentNode } from 'graphql';\nimport { useQuery } from '@tanstack/react-query';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport {\n CreateBotmanorLlmProviderDocument,\n CreateBotmanorLlmModelDocument,\n DeleteLlmProviderDocument,\n GetBotmanorLlmProviderDocument,\n ListBotmanorLlmModelsDocument,\n ListBotmanorLlmProvidersDocument,\n TestLlmConnectionDocument,\n UpdateBotmanorLlmProviderDocument,\n type CreateBotmanorLlmProviderMutation,\n type CreateBotmanorLlmModelMutation,\n type DeleteLlmProviderMutation,\n type GetBotmanorLlmProviderQuery,\n type ListBotmanorLlmModelsQuery,\n type ListBotmanorLlmProvidersQuery,\n type TestLlmConnectionMutation,\n type UpdateBotmanorLlmProviderMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateBotmanorLlmModelInput,\n CreateBotmanorLlmProviderInput,\n UpdateBotmanorLlmProviderInput,\n} from '../../generated/wspace-types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceClient,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 50;\n\nexport interface LLMProviderRecord {\n id: string;\n name: string;\n type: string;\n isActive: boolean;\n apiEndpoint?: string | null;\n hasStoredCredentials?: boolean;\n connectionId?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n workspaceId: string;\n}\n\nexport interface LLMModelRecord {\n id: string;\n name: string;\n modelId: string;\n providerId: string;\n contextWindow: number;\n maxOutputTokens: number;\n inputPricePerMToken: number;\n outputPricePerMToken: number;\n isActive: boolean;\n supportsStreaming: boolean;\n supportsFunctionCalling: boolean;\n supportsVision: boolean;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** `CreateBotmanorLLMProviderInput` minus the `workspaceId` the hook supplies. */\nexport type ConfigureLLMProviderVariables = Omit<\n GraphQLInput<CreateBotmanorLlmProviderInput>,\n 'workspaceId'\n> & { isActive?: boolean };\n\nconst NO_PROVIDERS: LLMProviderRecord[] = [];\nconst NO_MODELS: LLMModelRecord[] = [];\n\nconst CREATE_PROVIDER_FIELDS = fieldsOf<CreateBotmanorLlmProviderInput>({\n apiEndpoint: true,\n connectionId: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n workspaceId: true,\n});\n\nconst UPDATE_PROVIDER_FIELDS = fieldsOf<UpdateBotmanorLlmProviderInput>({\n apiEndpoint: true,\n clearCredentials: true,\n connectionId: true,\n credentials: true,\n isActive: true,\n metadata: true,\n name: true,\n});\n\nexport const llmProviderKeys = {\n all: ['llmProviders'] as const,\n lists: () => [...llmProviderKeys.all, 'list'] as const,\n details: () => [...llmProviderKeys.all, 'detail'] as const,\n detail: (id: string) => [...llmProviderKeys.details(), id] as const,\n};\n\nfunction useLLMList<TData, TRecord>(\n document: DocumentNode,\n kind: string,\n select: (data: TData | undefined) => TRecord[],\n fallback: TRecord[],\n providerId?: string\n): QueryResult<TRecord[]> {\n const client = useWorkspaceClient();\n const { workspaceId, currentUser } = useBotlit();\n const query = useQuery({\n queryKey: ['botmanor-llm-catalog', workspaceId, currentUser?.id, kind, providerId],\n enabled: Boolean(workspaceId),\n retry: false,\n queryFn: async () => {\n const records: TRecord[] = [];\n for (let offset = 0; offset < 10000; offset += LIST_LIMIT) {\n const result = await client.query<TData>({\n query: document,\n fetchPolicy: 'network-only',\n variables: {\n filters: providerId ? { providerId } : undefined,\n pagination: { limit: LIST_LIMIT, offset },\n },\n });\n if (!result.data) throw new Error('Model catalog unavailable');\n const page = select(result.data);\n if (!Array.isArray(page) || page.length > LIST_LIMIT)\n throw new Error('Model catalog unavailable');\n records.push(...page);\n if (page.length < LIST_LIMIT) return records;\n }\n throw new Error('Model catalog exceeds the supported limit');\n },\n });\n return {\n data: query.data ?? fallback,\n loading: query.isFetching,\n error: query.error ?? undefined,\n refetch: async () => {\n await query.refetch();\n },\n };\n}\n\nexport function useLLMProviders(): QueryResult<LLMProviderRecord[]> {\n return useLLMList<ListBotmanorLlmProvidersQuery, LLMProviderRecord>(\n ListBotmanorLlmProvidersDocument,\n 'providers',\n (data) => data?.listBotmanorLLMProviders ?? NO_PROVIDERS,\n NO_PROVIDERS\n );\n}\n\nexport function useLLMProvider(\n providerId: string | undefined\n): QueryResult<LLMProviderRecord | null> {\n const variables = useMemo(() => ({ id: providerId ?? '' }), [providerId]);\n\n return useWorkspaceQuery<GetBotmanorLlmProviderQuery, LLMProviderRecord | null>({\n document: GetBotmanorLlmProviderDocument,\n variables,\n select: (data) => data?.getBotmanorLLMProvider ?? null,\n fallback: null,\n enabled: Boolean(providerId),\n errorMessage: 'Failed to load LLM provider',\n });\n}\n\nexport function useLLMModels(filters?: { providerId?: string }): QueryResult<LLMModelRecord[]> {\n return useLLMList<ListBotmanorLlmModelsQuery, LLMModelRecord>(\n ListBotmanorLlmModelsDocument,\n 'models',\n (data) => data?.listBotmanorLLMModels ?? NO_MODELS,\n NO_MODELS,\n filters?.providerId\n );\n}\n\n/**\n * Creates a provider, or updates the one whose id the caller passes.\n * `UpdateBotmanorLLMProviderInput` has no `type`/`workspaceId`, so the update\n * payload is projected onto the fields that input actually declares.\n */\nexport function useConfigureLLMProvider() {\n const workspaceId = useWorkspaceId();\n\n const [create, createState] = useWorkspaceMutation<\n CreateBotmanorLlmProviderMutation,\n ConfigureLLMProviderVariables,\n LLMProviderRecord\n >({\n document: CreateBotmanorLlmProviderDocument,\n variables: (input) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.createBotmanorLLMProvider,\n errorMessage: 'Failed to create the LLM provider',\n });\n\n const [update, updateState] = useWorkspaceMutation<\n UpdateBotmanorLlmProviderMutation,\n { providerId: string; input: ConfigureLLMProviderVariables },\n LLMProviderRecord\n >({\n document: UpdateBotmanorLlmProviderDocument,\n variables: ({ providerId, input }) => ({\n id: providerId,\n input: buildMutationInput(input, UPDATE_PROVIDER_FIELDS),\n }),\n select: (data) => data?.updateBotmanorLLMProvider,\n errorMessage: 'Failed to update the LLM provider',\n });\n\n const configureProvider = useCallback(\n async (input: ConfigureLLMProviderVariables, existingId?: string) =>\n existingId ? update({ providerId: existingId, input }) : create(input),\n [create, update]\n );\n\n return {\n configureProvider,\n isConfiguring: createState.loading || updateState.loading,\n error: createState.error ?? updateState.error,\n };\n}\n\nexport function useDeleteLLMProvider() {\n return useWorkspaceMutation<DeleteLlmProviderMutation, string, boolean>({\n document: DeleteLlmProviderDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.deleteLLMProvider,\n errorMessage: 'Failed to delete the LLM provider',\n });\n}\n\nexport function useTestLLMConnection() {\n return useWorkspaceMutation<TestLlmConnectionMutation, string, boolean>({\n document: TestLlmConnectionDocument,\n variables: (providerId) => ({ id: providerId }),\n select: (data) => data?.testLlmConnection,\n errorMessage: 'Failed to test the LLM connection',\n });\n}\n\n/** Register models through the same authenticated workspace gateway as providers. */\nexport function useCreateLLMModel() {\n const [createModel, state] = useWorkspaceMutation<\n CreateBotmanorLlmModelMutation,\n CreateBotmanorLlmModelInput,\n LLMModelRecord\n >({\n document: CreateBotmanorLlmModelDocument,\n variables: (input) => ({\n input: buildMutationInput(\n input,\n fieldsOf<CreateBotmanorLlmModelInput>({\n providerId: true,\n name: true,\n modelId: true,\n contextWindow: true,\n maxOutputTokens: true,\n inputPricePerMToken: true,\n outputPricePerMToken: true,\n supportsStreaming: true,\n supportsFunctionCalling: true,\n supportsVision: true,\n metadata: true,\n })\n ),\n }),\n select: (data) => data?.createBotmanorLLMModel,\n errorMessage: 'Failed to register the model',\n });\n return { createModel, isCreating: state.loading, error: state.error };\n}\n"],"mappings":";;;;;;;AA+CA,IAAMA,IAAa,IAwCbC,IAAoC,CAAC,GACrCC,IAA8B,CAAC,GAE/BC,IAAyBC,EAAyC;CACtE,aAAa;CACb,cAAc;CACd,aAAa;CACb,UAAU;CACV,MAAM;CACN,MAAM;CACN,aAAa;AACf,CAAC,GAEKC,IAAyBD,EAAyC;CACtE,aAAa;CACb,kBAAkB;CAClB,cAAc;CACd,aAAa;CACb,UAAU;CACV,UAAU;CACV,MAAM;AACR,CAAC;AASD,SAASE,EACP,GACA,GACA,GACA,GACA,GACwB;CACxB,IAAMC,IAASC,EAAmB,GAC5B,EAAE,gBAAa,mBAAgBC,EAAU,GACzCC,IAAQC,EAAS;EACrB,UAAU;GAAC;GAAwBC;GAAaC,GAAa;GAAIC;GAAMC;EAAU;EACjF,SAAS,EAAQH;EACjB,OAAO;EACP,SAAS,YAAY;GACnB,IAAMI,IAAqB,CAAC;GAC5B,KAAK,IAAIC,IAAS,GAAGA,IAAS,KAA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EACxB,cAAc;CAChB,CAAC;CAQD,OAAO;EACL,mBAPwBe,EACxB,OAAO,GAAsC,MAC3CC,IAAaJ,EAAO;GAAE,YAAYI;GAAY;EAAM,CAAC,IAAIV,EAAOK,CAAK,GACvE,CAACL,GAAQM,CAAM,CAIf;EACA,eAAeL,EAAY,WAAWM,EAAY;EAClD,OAAON,EAAY,SAASM,EAAY;CAC1C;AACF;AAWA,SAAgBI,IAAuB;CACrC,OAAOT,EAAiE;EACtE,UAAUU;EACV,YAAY,OAAgB,EAAE,IAAI5B,EAAW;EAC7C,SAAS,MAASU,GAAM;EACxB,cAAc;CAChB,CAAC;AACH;AAGA,SAAgBmB,IAAoB;CAClC,IAAM,CAACC,GAAaC,KAASb,EAI3B;EACA,UAAUc;EACV,YAAY,OAAW,EACrB,OAAOZ,EACLC,GACAhC,EAAsC;GACpC,YAAY;GACZ,MAAM;GACN,SAAS;GACT,eAAe;GACf,iBAAiB;GACjB,qBAAqB;GACrB,sBAAsB;GACtB,mBAAmB;GACnB,yBAAyB;GACzB,gBAAgB;GAChB,UAAU;EACZ,CAAC,CACH,EACF;EACA,SAAS,MAASqB,GAAM;EACxB,cAAc;CAChB,CAAC;CACD,OAAO;EAAE;EAAa,YAAYqB,EAAM;EAAS,OAAOA,EAAM;CAAM;AACtE"}
|
|
@@ -9,7 +9,7 @@ export interface MCPServerRecord {
|
|
|
9
9
|
type: string;
|
|
10
10
|
status: string;
|
|
11
11
|
config: Record<string, unknown>;
|
|
12
|
-
|
|
12
|
+
hasCredentials?: boolean;
|
|
13
13
|
errorMessage?: string | null;
|
|
14
14
|
lastConnectedAt?: string | null;
|
|
15
15
|
lastErrorAt?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMCPServers.js","names":["LIST_LIMIT","CREATE_CONNECTION_FIELDS","fieldsOf","UPDATE_CONNECTION_FIELDS","NO_SERVERS","NO_TOOLS","NO_RESOURCES","isMCPServerHealthy","status","mcpServerEndpoint","url","server","mcpServerDescription","description","selectServers","data","selectServer","selectTools","selectResources","useMCPServers","workspaceId","useWorkspaceId","search","filter","variables","useMemo","all","useAllPagesQuery","ListMcpConnectionsDocument","row","useMCPServer","serverId","useWorkspaceQuery","GetMcpConnectionDocument","useMCPTools","ListMcpToolsDocument","useMCPResources","ListMcpResourcesDocument","useCreateMCPServer","useCallback","buildMutationInput","input","useWorkspaceMutation","CreateMcpConnectionDocument","useUpdateMCPServer","UpdateMcpConnectionDocument","useDeleteMCPServer","DeleteMcpConnectionDocument","useTestMCPConnection","TestMcpConnectionDocument","useUpdateMCPTool","UpdateMcpToolDocument","toolId"],"sources":["../../../src/botlit/hooks/useMCPServers.ts"],"sourcesContent":["/**\n * MCP Servers Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listMCPConnections` / `getMCPConnection` / `listMCPTools`\n * / `listMCPResources` operations and the create/update/delete/test mutations on\n * wspace-botlit-svc.\n *\n * The service models an MCP server as an `MCPConnection`: `type` is the\n * transport, `config` holds the endpoint, and `status` reports health.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateMcpConnectionDocument,\n DeleteMcpConnectionDocument,\n GetMcpConnectionDocument,\n ListMcpConnectionsDocument,\n ListMcpResourcesDocument,\n ListMcpToolsDocument,\n TestMcpConnectionDocument,\n UpdateMcpConnectionDocument,\n UpdateMcpToolDocument,\n type CreateMcpConnectionMutation,\n type DeleteMcpConnectionMutation,\n type GetMcpConnectionQuery,\n type ListMcpConnectionsQuery,\n type ListMcpResourcesQuery,\n type ListMcpToolsQuery,\n type TestMcpConnectionMutation,\n type UpdateMcpConnectionMutation,\n type UpdateMcpToolMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateMcpConnectionInput,\n McpToolRiskLevel,\n UpdateMcpConnectionInput,\n UpdateMcpToolInput,\n} from '../../generated/wspace-types';\nimport type { BaseFilter } from '../types';\nimport { useAllPagesQuery } from './internal/allPages';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface MCPServerRecord {\n id: string;\n name: string;\n /** Transport / server kind, e.g. `HTTP_JSON`. */\n type: string;\n status: string;\n config: Record<string, unknown>;\n credentialsHash?: string | null;\n errorMessage?: string | null;\n lastConnectedAt?: string | null;\n lastErrorAt?: string | null;\n deletedAt?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface MCPToolRecord {\n id: string;\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n riskLevel: McpToolRiskLevel;\n}\n\nexport interface MCPResourceRecord {\n name: string;\n uri: string;\n description?: string | null;\n mimeType?: string | null;\n}\n\n/** `CreateMCPConnectionInput` minus the `workspaceId` the hook supplies. */\nexport type CreateMCPServerVariables = Omit<GraphQLInput<CreateMcpConnectionInput>, 'workspaceId'>;\n\nexport interface UpdateMCPServerVariables {\n serverId: string;\n input: GraphQLInput<UpdateMcpConnectionInput>;\n}\n\nexport interface UpdateMCPToolVariables {\n toolId: string;\n input: GraphQLInput<UpdateMcpToolInput>;\n}\n\nconst CREATE_CONNECTION_FIELDS = fieldsOf<CreateMcpConnectionInput>({\n config: true,\n credential: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n workspaceId: true,\n});\n\nconst UPDATE_CONNECTION_FIELDS = fieldsOf<UpdateMcpConnectionInput>({\n clearCredential: true,\n config: true,\n credential: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n});\n\nconst NO_SERVERS: MCPServerRecord[] = [];\nconst NO_TOOLS: MCPToolRecord[] = [];\nconst NO_RESOURCES: MCPResourceRecord[] = [];\n\n/** `CONNECTED` is the only status that means the server is usable right now. */\nexport function isMCPServerHealthy(status: string | null | undefined): boolean {\n return status === 'CONNECTED';\n}\n\nexport function isMCPServerUnhealthy(status: string | null | undefined): boolean {\n return status === 'ERROR' || status === 'DISCONNECTED';\n}\n\n/** Endpoint the connection points at — the service stores it on the free-form config. */\nexport function mcpServerEndpoint(server: Pick<MCPServerRecord, 'config'>): string | undefined {\n const url = server.config?.url;\n return typeof url === 'string' ? url : undefined;\n}\n\n/** Optional human description the UI stores alongside the endpoint. */\nexport function mcpServerDescription(server: Pick<MCPServerRecord, 'config'>): string | undefined {\n const description = server.config?.description;\n return typeof description === 'string' ? description : undefined;\n}\n\nfunction selectServers(data: ListMcpConnectionsQuery | undefined): MCPServerRecord[] {\n return data?.listMCPConnections ?? NO_SERVERS;\n}\n\nfunction selectServer(data: GetMcpConnectionQuery | undefined): MCPServerRecord | null {\n return data?.getMCPConnection ?? null;\n}\n\nfunction selectTools(data: ListMcpToolsQuery | undefined): MCPToolRecord[] {\n return data?.listMCPTools ?? NO_TOOLS;\n}\n\nfunction selectResources(data: ListMcpResourcesQuery | undefined): MCPResourceRecord[] {\n return data?.listMCPResources ?? NO_RESOURCES;\n}\n\nexport const mcpServerKeys = {\n all: ['mcpServers'] as const,\n lists: () => [...mcpServerKeys.all, 'list'] as const,\n list: (filter?: BaseFilter) => [...mcpServerKeys.lists(), filter] as const,\n details: () => [...mcpServerKeys.all, 'detail'] as const,\n detail: (id: string) => [...mcpServerKeys.details(), id] as const,\n resources: (serverId?: string) => [...mcpServerKeys.all, 'resources', serverId] as const,\n tools: (serverId?: string) => [...mcpServerKeys.all, 'tools', serverId] as const,\n};\n\nexport function useMCPServers(filter?: BaseFilter): QueryResult<MCPServerRecord[]> {\n const workspaceId = useWorkspaceId();\n const search = filter?.search?.trim().toLowerCase() ?? '';\n\n const variables = useMemo(\n () => ({\n // MCPConnectionFilterInput has no free-text field — search is narrowed on the client.\n filters: { workspaceId },\n }),\n [workspaceId]\n );\n\n // Every page: pickers and lookups need the whole list, not the first 100.\n const all = useAllPagesQuery<ListMcpConnectionsQuery, MCPServerRecord>({\n document: ListMcpConnectionsDocument,\n variables,\n pageSize: LIST_LIMIT,\n extractRows: selectServers,\n fallback: NO_SERVERS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load MCP servers',\n });\n\n // Narrowed on the client, over the whole list.\n const data = useMemo(\n () => (search ? all.data.filter((row) => row.name.toLowerCase().includes(search)) : all.data),\n [all.data, search]\n );\n return { ...all, data };\n}\n\nexport function useMCPServer(serverId: string | undefined): QueryResult<MCPServerRecord | null> {\n const variables = useMemo(() => ({ id: serverId ?? '' }), [serverId]);\n\n return useWorkspaceQuery<GetMcpConnectionQuery, MCPServerRecord | null>({\n document: GetMcpConnectionDocument,\n variables,\n select: selectServer,\n fallback: null,\n enabled: Boolean(serverId),\n errorMessage: 'Failed to load MCP server',\n });\n}\n\nexport function useMCPTools(serverId: string | undefined): QueryResult<MCPToolRecord[]> {\n const variables = useMemo(() => ({ connectionId: serverId ?? '' }), [serverId]);\n\n return useWorkspaceQuery<ListMcpToolsQuery, MCPToolRecord[]>({\n document: ListMcpToolsDocument,\n variables,\n select: selectTools,\n fallback: NO_TOOLS,\n enabled: Boolean(serverId),\n errorMessage: 'Failed to load MCP tools',\n });\n}\n\nexport function useMCPResources(serverId: string | undefined): QueryResult<MCPResourceRecord[]> {\n const variables = useMemo(() => ({ connectionId: serverId ?? '' }), [serverId]);\n\n return useWorkspaceQuery<ListMcpResourcesQuery, MCPResourceRecord[]>({\n document: ListMcpResourcesDocument,\n variables,\n select: selectResources,\n fallback: NO_RESOURCES,\n enabled: Boolean(serverId),\n errorMessage: 'Failed to load MCP resources',\n });\n}\n\nexport function useCreateMCPServer() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateMCPServerVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_CONNECTION_FIELDS),\n }),\n [workspaceId]\n );\n\n return useWorkspaceMutation<\n CreateMcpConnectionMutation,\n CreateMCPServerVariables,\n MCPServerRecord\n >({\n document: CreateMcpConnectionDocument,\n variables,\n select: (data) => data?.createMCPConnection,\n errorMessage: 'Failed to connect MCP server',\n });\n}\n\nexport function useUpdateMCPServer() {\n return useWorkspaceMutation<\n UpdateMcpConnectionMutation,\n UpdateMCPServerVariables,\n MCPServerRecord\n >({\n document: UpdateMcpConnectionDocument,\n variables: ({ serverId, input }) => ({\n id: serverId,\n input: buildMutationInput(input, UPDATE_CONNECTION_FIELDS),\n }),\n select: (data) => data?.updateMCPConnection,\n errorMessage: 'Failed to update MCP server',\n });\n}\n\nexport function useDeleteMCPServer() {\n return useWorkspaceMutation<DeleteMcpConnectionMutation, string, boolean>({\n document: DeleteMcpConnectionDocument,\n variables: (serverId) => ({ id: serverId }),\n select: (data) => data?.deleteMCPConnection,\n errorMessage: 'Failed to disconnect MCP server',\n });\n}\n\nexport function useTestMCPConnection() {\n return useWorkspaceMutation<TestMcpConnectionMutation, string, boolean>({\n document: TestMcpConnectionDocument,\n variables: (serverId) => ({ id: serverId }),\n select: (data) => data?.testMCPConnection,\n errorMessage: 'Failed to test MCP connection',\n });\n}\n\nexport function useUpdateMCPTool() {\n return useWorkspaceMutation<UpdateMcpToolMutation, UpdateMCPToolVariables, MCPToolRecord>({\n document: UpdateMcpToolDocument,\n variables: ({ toolId, input }) => ({ id: toolId, input }),\n select: (data) => data?.updateMCPTool,\n errorMessage: 'Failed to update MCP tool risk level',\n });\n}\n"],"mappings":";;;;;;AAiDA,IAAMA,IAAa,KAkDbC,IAA2BC,EAAmC;CAClE,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,UAAU;CACV,MAAM;CACN,MAAM;CACN,aAAa;AACf,CAAC,GAEKC,IAA2BD,EAAmC;CAClE,iBAAiB;CACjB,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,UAAU;CACV,MAAM;CACN,MAAM;AACR,CAAC,GAEKE,IAAgC,CAAC,GACjCC,IAA4B,CAAC,GAC7BC,IAAoC,CAAC;AAG3C,SAAgBC,EAAmB,GAA4C;CAC7E,OAAOC,MAAW;AACpB;AAOA,SAAgBC,EAAkB,GAA6D;CAC7F,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SAAS,MAASrC,GAAM;EACxB,cAAc;CAChB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"useMCPServers.js","names":["LIST_LIMIT","CREATE_CONNECTION_FIELDS","fieldsOf","UPDATE_CONNECTION_FIELDS","NO_SERVERS","NO_TOOLS","NO_RESOURCES","isMCPServerHealthy","status","mcpServerEndpoint","url","server","mcpServerDescription","description","selectServers","data","selectServer","selectTools","selectResources","useMCPServers","workspaceId","useWorkspaceId","search","filter","variables","useMemo","all","useAllPagesQuery","ListMcpConnectionsDocument","row","useMCPServer","serverId","useWorkspaceQuery","GetMcpConnectionDocument","useMCPTools","ListMcpToolsDocument","useMCPResources","ListMcpResourcesDocument","useCreateMCPServer","useCallback","buildMutationInput","input","useWorkspaceMutation","CreateMcpConnectionDocument","useUpdateMCPServer","UpdateMcpConnectionDocument","useDeleteMCPServer","DeleteMcpConnectionDocument","useTestMCPConnection","TestMcpConnectionDocument","useUpdateMCPTool","UpdateMcpToolDocument","toolId"],"sources":["../../../src/botlit/hooks/useMCPServers.ts"],"sourcesContent":["/**\n * MCP Servers Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listMCPConnections` / `getMCPConnection` / `listMCPTools`\n * / `listMCPResources` operations and the create/update/delete/test mutations on\n * wspace-botlit-svc.\n *\n * The service models an MCP server as an `MCPConnection`: `type` is the\n * transport, `config` holds the endpoint, and `status` reports health.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateMcpConnectionDocument,\n DeleteMcpConnectionDocument,\n GetMcpConnectionDocument,\n ListMcpConnectionsDocument,\n ListMcpResourcesDocument,\n ListMcpToolsDocument,\n TestMcpConnectionDocument,\n UpdateMcpConnectionDocument,\n UpdateMcpToolDocument,\n type CreateMcpConnectionMutation,\n type DeleteMcpConnectionMutation,\n type GetMcpConnectionQuery,\n type ListMcpConnectionsQuery,\n type ListMcpResourcesQuery,\n type ListMcpToolsQuery,\n type TestMcpConnectionMutation,\n type UpdateMcpConnectionMutation,\n type UpdateMcpToolMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateMcpConnectionInput,\n McpToolRiskLevel,\n UpdateMcpConnectionInput,\n UpdateMcpToolInput,\n} from '../../generated/wspace-types';\nimport type { BaseFilter } from '../types';\nimport { useAllPagesQuery } from './internal/allPages';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface MCPServerRecord {\n id: string;\n name: string;\n /** Transport / server kind, e.g. `HTTP_JSON`. */\n type: string;\n status: string;\n config: Record<string, unknown>;\n hasCredentials?: boolean;\n errorMessage?: string | null;\n lastConnectedAt?: string | null;\n lastErrorAt?: string | null;\n deletedAt?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface MCPToolRecord {\n id: string;\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n riskLevel: McpToolRiskLevel;\n}\n\nexport interface MCPResourceRecord {\n name: string;\n uri: string;\n description?: string | null;\n mimeType?: string | null;\n}\n\n/** `CreateMCPConnectionInput` minus the `workspaceId` the hook supplies. */\nexport type CreateMCPServerVariables = Omit<GraphQLInput<CreateMcpConnectionInput>, 'workspaceId'>;\n\nexport interface UpdateMCPServerVariables {\n serverId: string;\n input: GraphQLInput<UpdateMcpConnectionInput>;\n}\n\nexport interface UpdateMCPToolVariables {\n toolId: string;\n input: GraphQLInput<UpdateMcpToolInput>;\n}\n\nconst CREATE_CONNECTION_FIELDS = fieldsOf<CreateMcpConnectionInput>({\n config: true,\n credential: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n workspaceId: true,\n});\n\nconst UPDATE_CONNECTION_FIELDS = fieldsOf<UpdateMcpConnectionInput>({\n clearCredential: true,\n config: true,\n credential: true,\n credentials: true,\n metadata: true,\n name: true,\n type: true,\n});\n\nconst NO_SERVERS: MCPServerRecord[] = [];\nconst NO_TOOLS: MCPToolRecord[] = [];\nconst NO_RESOURCES: MCPResourceRecord[] = [];\n\n/** `CONNECTED` is the only status that means the server is usable right now. */\nexport function isMCPServerHealthy(status: string | null | undefined): boolean {\n return status === 'CONNECTED';\n}\n\nexport function isMCPServerUnhealthy(status: string | null | undefined): boolean {\n return status === 'ERROR' || status === 'DISCONNECTED';\n}\n\n/** Endpoint the connection points at — the service stores it on the free-form config. */\nexport function mcpServerEndpoint(server: Pick<MCPServerRecord, 'config'>): string | undefined {\n const url = server.config?.url;\n return typeof url === 'string' ? url : undefined;\n}\n\n/** Optional human description the UI stores alongside the endpoint. */\nexport function mcpServerDescription(server: Pick<MCPServerRecord, 'config'>): string | undefined {\n const description = server.config?.description;\n return typeof description === 'string' ? description : undefined;\n}\n\nfunction selectServers(data: ListMcpConnectionsQuery | undefined): MCPServerRecord[] {\n return data?.listMCPConnections ?? NO_SERVERS;\n}\n\nfunction selectServer(data: GetMcpConnectionQuery | undefined): MCPServerRecord | null {\n return data?.getMCPConnection ?? null;\n}\n\nfunction selectTools(data: ListMcpToolsQuery | undefined): MCPToolRecord[] {\n return data?.listMCPTools ?? NO_TOOLS;\n}\n\nfunction selectResources(data: ListMcpResourcesQuery | undefined): MCPResourceRecord[] {\n return data?.listMCPResources ?? NO_RESOURCES;\n}\n\nexport const mcpServerKeys = {\n all: ['mcpServers'] as const,\n lists: () => [...mcpServerKeys.all, 'list'] as const,\n list: (filter?: BaseFilter) => [...mcpServerKeys.lists(), filter] as const,\n details: () => [...mcpServerKeys.all, 'detail'] as const,\n detail: (id: string) => [...mcpServerKeys.details(), id] as const,\n resources: (serverId?: string) => [...mcpServerKeys.all, 'resources', serverId] as const,\n tools: (serverId?: string) => [...mcpServerKeys.all, 'tools', serverId] as const,\n};\n\nexport function useMCPServers(filter?: BaseFilter): QueryResult<MCPServerRecord[]> {\n const workspaceId = useWorkspaceId();\n const search = filter?.search?.trim().toLowerCase() ?? '';\n\n const variables = useMemo(\n () => ({\n // MCPConnectionFilterInput has no free-text field — search is narrowed on the client.\n filters: { workspaceId },\n }),\n [workspaceId]\n );\n\n // Every page: pickers and lookups need the whole list, not the first 100.\n const all = useAllPagesQuery<ListMcpConnectionsQuery, MCPServerRecord>({\n document: ListMcpConnectionsDocument,\n variables,\n pageSize: LIST_LIMIT,\n extractRows: selectServers,\n fallback: NO_SERVERS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load MCP servers',\n });\n\n // Narrowed on the client, over the whole list.\n const data = useMemo(\n () => (search ? all.data.filter((row) => row.name.toLowerCase().includes(search)) : all.data),\n [all.data, search]\n );\n return { ...all, data };\n}\n\nexport function useMCPServer(serverId: string | undefined): QueryResult<MCPServerRecord | null> {\n const variables = useMemo(() => ({ id: serverId ?? '' }), [serverId]);\n\n return useWorkspaceQuery<GetMcpConnectionQuery, MCPServerRecord | null>({\n document: GetMcpConnectionDocument,\n variables,\n select: selectServer,\n fallback: null,\n enabled: Boolean(serverId),\n errorMessage: 'Failed to load MCP server',\n });\n}\n\nexport function useMCPTools(serverId: string | undefined): QueryResult<MCPToolRecord[]> {\n const variables = useMemo(() => ({ connectionId: serverId ?? '' }), [serverId]);\n\n return useWorkspaceQuery<ListMcpToolsQuery, MCPToolRecord[]>({\n document: ListMcpToolsDocument,\n variables,\n select: selectTools,\n fallback: NO_TOOLS,\n enabled: Boolean(serverId),\n errorMessage: 'Failed to load MCP tools',\n });\n}\n\nexport function useMCPResources(serverId: string | undefined): QueryResult<MCPResourceRecord[]> {\n const variables = useMemo(() => ({ connectionId: serverId ?? '' }), [serverId]);\n\n return useWorkspaceQuery<ListMcpResourcesQuery, MCPResourceRecord[]>({\n document: ListMcpResourcesDocument,\n variables,\n select: selectResources,\n fallback: NO_RESOURCES,\n enabled: Boolean(serverId),\n errorMessage: 'Failed to load MCP resources',\n });\n}\n\nexport function useCreateMCPServer() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateMCPServerVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_CONNECTION_FIELDS),\n }),\n [workspaceId]\n );\n\n return useWorkspaceMutation<\n CreateMcpConnectionMutation,\n CreateMCPServerVariables,\n MCPServerRecord\n >({\n document: CreateMcpConnectionDocument,\n variables,\n select: (data) => data?.createMCPConnection,\n errorMessage: 'Failed to connect MCP server',\n });\n}\n\nexport function useUpdateMCPServer() {\n return useWorkspaceMutation<\n UpdateMcpConnectionMutation,\n UpdateMCPServerVariables,\n MCPServerRecord\n >({\n document: UpdateMcpConnectionDocument,\n variables: ({ serverId, input }) => ({\n id: serverId,\n input: buildMutationInput(input, UPDATE_CONNECTION_FIELDS),\n }),\n select: (data) => data?.updateMCPConnection,\n errorMessage: 'Failed to update MCP server',\n });\n}\n\nexport function useDeleteMCPServer() {\n return useWorkspaceMutation<DeleteMcpConnectionMutation, string, boolean>({\n document: DeleteMcpConnectionDocument,\n variables: (serverId) => ({ id: serverId }),\n select: (data) => data?.deleteMCPConnection,\n errorMessage: 'Failed to disconnect MCP server',\n });\n}\n\nexport function useTestMCPConnection() {\n return useWorkspaceMutation<TestMcpConnectionMutation, string, boolean>({\n document: TestMcpConnectionDocument,\n variables: (serverId) => ({ id: serverId }),\n select: (data) => data?.testMCPConnection,\n errorMessage: 'Failed to test MCP connection',\n });\n}\n\nexport function useUpdateMCPTool() {\n return useWorkspaceMutation<UpdateMcpToolMutation, UpdateMCPToolVariables, MCPToolRecord>({\n document: UpdateMcpToolDocument,\n variables: ({ toolId, input }) => ({ id: toolId, input }),\n select: (data) => data?.updateMCPTool,\n errorMessage: 'Failed to update MCP tool risk level',\n });\n}\n"],"mappings":";;;;;;AAiDA,IAAMA,IAAa,KAkDbC,IAA2BC,EAAmC;CAClE,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,UAAU;CACV,MAAM;CACN,MAAM;CACN,aAAa;AACf,CAAC,GAEKC,IAA2BD,EAAmC;CAClE,iBAAiB;CACjB,QAAQ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ACtE,UAAUO;EACV,YAAY,OAAc,EAAE,IAAIlB,EAAS;EACzC,SAAS,MAAShB,GAAM;EACxB,cAAc;CAChB,CAAC;AACH;AAEA,SAAgBmC,IAAmB;CACjC,OAAOR,EAAmF;EACxF,UAAUS;EACV,YAAY,EAAE,WAAQ,gBAAa;GAAE,IAAIC;GAAQ;EAAM;EACvD,SAAS,MAASrC,GAAM;EACxB,cAAc;CAChB,CAAC;AACH"}
|
|
@@ -591,10 +591,10 @@ var B = ({ isNew: B }) => {
|
|
|
591
591
|
})] }),
|
|
592
592
|
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
593
593
|
className: "text-text-secondary",
|
|
594
|
-
children: "
|
|
594
|
+
children: "Stored credentials"
|
|
595
595
|
}), /* @__PURE__ */ D(x, {
|
|
596
|
-
variant: U.
|
|
597
|
-
children: U.
|
|
596
|
+
variant: U.hasCredentials ? "success" : "secondary",
|
|
597
|
+
children: U.hasCredentials ? "Configured" : "None"
|
|
598
598
|
})] })
|
|
599
599
|
]
|
|
600
600
|
}) })] })
|