@burdenoff/microfe-botmanor 2026.1007.1 → 2026.1008.1
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 +58 -146
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/BotmanorRoot.js.map +1 -1
- package/dist/botlit/BotmanorRootInner.js +39 -67
- package/dist/botlit/BotmanorRootInner.js.map +1 -1
- package/dist/botlit/hooks/useBotWorkflow.js +56 -0
- package/dist/botlit/hooks/useBotWorkflow.js.map +1 -0
- package/dist/botlit/pages/BotWorkflowTab.js +33 -33
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
- package/dist/botlit/providers/BotlitProvider.js +30 -26
- package/dist/botlit/providers/BotlitProvider.js.map +1 -1
- package/package.json +1 -3
|
@@ -3,18 +3,11 @@ import { useBotlit as t } from "./providers/BotlitProvider.js";
|
|
|
3
3
|
import { DashboardPage as n } from "./pages/DashboardPage.js";
|
|
4
4
|
import { Suspense as r, lazy as i } from "react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
import { Navigate as s, Route as c, Routes as l, useLocation as u
|
|
7
|
-
import { ExecutionDetailPage as f, ExecutionsListPage as p, HistoryPage as ee, NodesPage as m, SettingsPage as h, TemplatePreview as g, TemplatesPage as _, WorkflowBuilderPage as v, WorkflowsList as y } from "@burdenoff/fluidgrids-fe-sdk";
|
|
6
|
+
import { Navigate as s, Route as c, Routes as l, useLocation as u } from "react-router";
|
|
8
7
|
//#region src/botlit/BotlitRoutes.tsx
|
|
9
|
-
var
|
|
10
|
-
let {
|
|
11
|
-
return /* @__PURE__ */ a(
|
|
12
|
-
to: `${e}/workflows/runs/${t ?? ""}`,
|
|
13
|
-
replace: !0
|
|
14
|
-
});
|
|
15
|
-
}, Q = () => {
|
|
16
|
-
let { basePath: i, isStandalone: d } = t(), Q = u(), $ = i === "/" ? "" : i.replace(/\/$/, "");
|
|
17
|
-
return $ && !d && !(Q.pathname === $ || Q.pathname.startsWith($ + "/")) ? null : /* @__PURE__ */ a("div", {
|
|
8
|
+
var d = i(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.BotsListPage }))), f = i(() => import("./pages/BotDetailPage.js").then((e) => ({ default: e.BotDetailPage }))), p = i(() => import("./pages/AgentsListPage.js").then((e) => ({ default: e.AgentsListPage }))), m = i(() => import("./pages/AgentDetailPage.js").then((e) => ({ default: e.AgentDetailPage }))), h = i(() => import("./pages/AgentBuilderPage.js").then((e) => ({ default: e.AgentBuilderPage }))), g = i(() => import("./pages/KnowledgeBasesPage.js").then((e) => ({ default: e.KnowledgeBasesPage }))), _ = i(() => import("./pages/KnowledgeBaseDetailPage.js").then((e) => ({ default: e.KnowledgeBaseDetailPage }))), v = i(() => import("./pages/RetrievalProfilesPage.js").then((e) => ({ default: e.RetrievalProfilesPage }))), y = i(() => import("./pages/RetrievalProfileDetailPage.js").then((e) => ({ default: e.RetrievalProfileDetailPage }))), b = i(() => import("./pages/MCPServersPage.js").then((e) => ({ default: e.MCPServersPage }))), x = i(() => import("./pages/MCPServerDetailPage.js").then((e) => ({ default: e.MCPServerDetailPage }))), S = i(() => import("./pages/A2ARegistryPage.js").then((e) => ({ default: e.A2ARegistryPage }))), C = i(() => import("./pages/A2AAgentDetailPage.js").then((e) => ({ default: e.A2AAgentDetailPage }))), w = i(() => import("./pages/ChannelsPage.js").then((e) => ({ default: e.ChannelsPage }))), T = i(() => import("./pages/ChannelDetailPage.js").then((e) => ({ default: e.ChannelDetailPage }))), E = i(() => import("./pages/ChannelRoutesPage.js").then((e) => ({ default: e.ChannelRoutesPage }))), D = i(() => import("./pages/PoliciesPage.js").then((e) => ({ default: e.PoliciesPage }))), O = i(() => import("./pages/PolicyDetailPage.js").then((e) => ({ default: e.PolicyDetailPage }))), k = i(() => import("./pages/SkillsPage.js").then((e) => ({ default: e.SkillsPage }))), A = i(() => import("./pages/SkillDetailPage.js").then((e) => ({ default: e.SkillDetailPage }))), j = i(() => import("./pages/PromptTemplatesPage.js").then((e) => ({ default: e.PromptTemplatesPage }))), M = i(() => import("./pages/PromptTemplateDetailPage.js").then((e) => ({ default: e.PromptTemplateDetailPage }))), N = i(() => import("./pages/PromptStudioPage.js").then((e) => ({ default: e.PromptStudioPage }))), P = i(() => import("./pages/ExecutionsPage.js").then((e) => ({ default: e.ExecutionsPage }))), F = i(() => import("./pages/ExecutionDetailPage.js").then((e) => ({ default: e.ExecutionDetailPage }))), I = i(() => import("./pages/BucketsPage.js").then((e) => ({ default: e.BucketsPage }))), L = i(() => import("./pages/StorePage.js").then((e) => ({ default: e.StorePage }))), R = i(() => import("./pages/StorePackageDetailPage.js").then((e) => ({ default: e.StorePackageDetailPage }))), z = i(() => import("./pages/InstalledPackagesPage.js").then((e) => ({ default: e.InstalledPackagesPage }))), B = i(() => import("./pages/SettingsPage.js").then((e) => ({ default: e.SettingsPage }))), V = i(() => import("./pages/ChatPage.js").then((e) => ({ default: e.ChatPage }))), H = () => {
|
|
9
|
+
let { basePath: i, isStandalone: H } = t(), U = u(), W = i === "/" ? "" : i.replace(/\/$/, "");
|
|
10
|
+
return W && !H && !(U.pathname === W || U.pathname.startsWith(W + "/")) ? null : /* @__PURE__ */ a("div", {
|
|
18
11
|
className: "flex flex-col min-h-full bg-bg-surface",
|
|
19
12
|
children: /* @__PURE__ */ a(r, {
|
|
20
13
|
fallback: /* @__PURE__ */ a(e, {}),
|
|
@@ -32,63 +25,63 @@ var b = i(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bots
|
|
|
32
25
|
}),
|
|
33
26
|
/* @__PURE__ */ a(c, {
|
|
34
27
|
path: "bots",
|
|
35
|
-
element: /* @__PURE__ */ a(
|
|
28
|
+
element: /* @__PURE__ */ a(d, {})
|
|
36
29
|
}),
|
|
37
30
|
/* @__PURE__ */ a(c, {
|
|
38
31
|
path: "bots/new",
|
|
39
|
-
element: /* @__PURE__ */ a(
|
|
32
|
+
element: /* @__PURE__ */ a(f, { isNew: !0 })
|
|
40
33
|
}),
|
|
41
34
|
/* @__PURE__ */ a(c, {
|
|
42
35
|
path: "bots/:botId",
|
|
43
|
-
element: /* @__PURE__ */ a(
|
|
36
|
+
element: /* @__PURE__ */ a(f, {})
|
|
44
37
|
}),
|
|
45
38
|
/* @__PURE__ */ a(c, {
|
|
46
39
|
path: "bots/:botId/edit",
|
|
47
|
-
element: /* @__PURE__ */ a(
|
|
40
|
+
element: /* @__PURE__ */ a(f, { isEditing: !0 })
|
|
48
41
|
}),
|
|
49
42
|
/* @__PURE__ */ a(c, {
|
|
50
43
|
path: "bots/:botId/agents",
|
|
51
|
-
element: /* @__PURE__ */ a(
|
|
44
|
+
element: /* @__PURE__ */ a(p, {})
|
|
52
45
|
}),
|
|
53
46
|
/* @__PURE__ */ a(c, {
|
|
54
47
|
path: "bots/:botId/agents/new",
|
|
55
|
-
element: /* @__PURE__ */ a(
|
|
48
|
+
element: /* @__PURE__ */ a(h, {})
|
|
56
49
|
}),
|
|
57
50
|
/* @__PURE__ */ a(c, {
|
|
58
51
|
path: "bots/:botId/agents/:agentId",
|
|
59
|
-
element: /* @__PURE__ */ a(
|
|
52
|
+
element: /* @__PURE__ */ a(m, {})
|
|
60
53
|
}),
|
|
61
54
|
/* @__PURE__ */ a(c, {
|
|
62
55
|
path: "bots/:botId/agents/:agentId/edit",
|
|
63
|
-
element: /* @__PURE__ */ a(
|
|
56
|
+
element: /* @__PURE__ */ a(h, {})
|
|
64
57
|
}),
|
|
65
58
|
/* @__PURE__ */ a(c, {
|
|
66
59
|
path: "bots/:botId/knowledge",
|
|
67
|
-
element: /* @__PURE__ */ a(
|
|
60
|
+
element: /* @__PURE__ */ a(g, {})
|
|
68
61
|
}),
|
|
69
62
|
/* @__PURE__ */ a(c, {
|
|
70
63
|
path: "bots/:botId/knowledge/:kbId",
|
|
71
|
-
element: /* @__PURE__ */ a(
|
|
64
|
+
element: /* @__PURE__ */ a(_, {})
|
|
72
65
|
}),
|
|
73
66
|
/* @__PURE__ */ a(c, {
|
|
74
67
|
path: "agents",
|
|
75
|
-
element: /* @__PURE__ */ a(
|
|
68
|
+
element: /* @__PURE__ */ a(p, {})
|
|
76
69
|
}),
|
|
77
70
|
/* @__PURE__ */ a(c, {
|
|
78
71
|
path: "agents/new",
|
|
79
|
-
element: /* @__PURE__ */ a(
|
|
72
|
+
element: /* @__PURE__ */ a(h, {})
|
|
80
73
|
}),
|
|
81
74
|
/* @__PURE__ */ a(c, {
|
|
82
75
|
path: "agents/:agentId",
|
|
83
|
-
element: /* @__PURE__ */ a(
|
|
76
|
+
element: /* @__PURE__ */ a(m, {})
|
|
84
77
|
}),
|
|
85
78
|
/* @__PURE__ */ a(c, {
|
|
86
79
|
path: "agents/:agentId/edit",
|
|
87
|
-
element: /* @__PURE__ */ a(
|
|
80
|
+
element: /* @__PURE__ */ a(h, {})
|
|
88
81
|
}),
|
|
89
82
|
/* @__PURE__ */ a(c, {
|
|
90
83
|
path: "agents/:agentId/chat",
|
|
91
|
-
element: /* @__PURE__ */ a(
|
|
84
|
+
element: /* @__PURE__ */ a(V, {})
|
|
92
85
|
}),
|
|
93
86
|
/* @__PURE__ */ a(c, {
|
|
94
87
|
path: "conversations",
|
|
@@ -106,237 +99,156 @@ var b = i(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bots
|
|
|
106
99
|
}),
|
|
107
100
|
/* @__PURE__ */ a(c, {
|
|
108
101
|
path: "knowledge",
|
|
109
|
-
element: /* @__PURE__ */ a(
|
|
102
|
+
element: /* @__PURE__ */ a(g, {})
|
|
110
103
|
}),
|
|
111
104
|
/* @__PURE__ */ a(c, {
|
|
112
105
|
path: "knowledge/new",
|
|
113
|
-
element: /* @__PURE__ */ a(
|
|
106
|
+
element: /* @__PURE__ */ a(_, { isNew: !0 })
|
|
114
107
|
}),
|
|
115
108
|
/* @__PURE__ */ a(c, {
|
|
116
109
|
path: "knowledge/:kbId",
|
|
117
|
-
element: /* @__PURE__ */ a(
|
|
110
|
+
element: /* @__PURE__ */ a(_, {})
|
|
118
111
|
}),
|
|
119
112
|
/* @__PURE__ */ a(c, {
|
|
120
113
|
path: "retrieval-profiles",
|
|
121
|
-
element: /* @__PURE__ */ a(
|
|
114
|
+
element: /* @__PURE__ */ a(v, {})
|
|
122
115
|
}),
|
|
123
116
|
/* @__PURE__ */ a(c, {
|
|
124
117
|
path: "retrieval-profiles/new",
|
|
125
|
-
element: /* @__PURE__ */ a(
|
|
118
|
+
element: /* @__PURE__ */ a(y, { isNew: !0 })
|
|
126
119
|
}),
|
|
127
120
|
/* @__PURE__ */ a(c, {
|
|
128
121
|
path: "retrieval-profiles/:profileId",
|
|
129
|
-
element: /* @__PURE__ */ a(
|
|
122
|
+
element: /* @__PURE__ */ a(y, {})
|
|
130
123
|
}),
|
|
131
124
|
/* @__PURE__ */ a(c, {
|
|
132
125
|
path: "mcp",
|
|
133
|
-
element: /* @__PURE__ */ a(
|
|
126
|
+
element: /* @__PURE__ */ a(b, {})
|
|
134
127
|
}),
|
|
135
128
|
/* @__PURE__ */ a(c, {
|
|
136
129
|
path: "mcp/new",
|
|
137
|
-
element: /* @__PURE__ */ a(
|
|
130
|
+
element: /* @__PURE__ */ a(x, { isNew: !0 })
|
|
138
131
|
}),
|
|
139
132
|
/* @__PURE__ */ a(c, {
|
|
140
133
|
path: "mcp/:serverId",
|
|
141
|
-
element: /* @__PURE__ */ a(
|
|
134
|
+
element: /* @__PURE__ */ a(x, {})
|
|
142
135
|
}),
|
|
143
136
|
/* @__PURE__ */ a(c, {
|
|
144
137
|
path: "a2a",
|
|
145
|
-
element: /* @__PURE__ */ a(
|
|
138
|
+
element: /* @__PURE__ */ a(S, {})
|
|
146
139
|
}),
|
|
147
140
|
/* @__PURE__ */ a(c, {
|
|
148
141
|
path: "a2a/register",
|
|
149
|
-
element: /* @__PURE__ */ a(
|
|
142
|
+
element: /* @__PURE__ */ a(C, { isNew: !0 })
|
|
150
143
|
}),
|
|
151
144
|
/* @__PURE__ */ a(c, {
|
|
152
145
|
path: "a2a/:agentId",
|
|
153
|
-
element: /* @__PURE__ */ a(
|
|
146
|
+
element: /* @__PURE__ */ a(C, {})
|
|
154
147
|
}),
|
|
155
148
|
/* @__PURE__ */ a(c, {
|
|
156
149
|
path: "channels",
|
|
157
|
-
element: /* @__PURE__ */ a(
|
|
150
|
+
element: /* @__PURE__ */ a(w, {})
|
|
158
151
|
}),
|
|
159
152
|
/* @__PURE__ */ a(c, {
|
|
160
153
|
path: "channels/new",
|
|
161
|
-
element: /* @__PURE__ */ a(
|
|
154
|
+
element: /* @__PURE__ */ a(T, { isNew: !0 })
|
|
162
155
|
}),
|
|
163
156
|
/* @__PURE__ */ a(c, {
|
|
164
157
|
path: "channels/routes",
|
|
165
|
-
element: /* @__PURE__ */ a(
|
|
158
|
+
element: /* @__PURE__ */ a(E, {})
|
|
166
159
|
}),
|
|
167
160
|
/* @__PURE__ */ a(c, {
|
|
168
161
|
path: "channels/:connectorId",
|
|
169
|
-
element: /* @__PURE__ */ a(
|
|
162
|
+
element: /* @__PURE__ */ a(T, {})
|
|
170
163
|
}),
|
|
171
164
|
/* @__PURE__ */ a(c, {
|
|
172
165
|
path: "policies",
|
|
173
|
-
element: /* @__PURE__ */ a(
|
|
166
|
+
element: /* @__PURE__ */ a(D, {})
|
|
174
167
|
}),
|
|
175
168
|
/* @__PURE__ */ a(c, {
|
|
176
169
|
path: "policies/new",
|
|
177
|
-
element: /* @__PURE__ */ a(
|
|
170
|
+
element: /* @__PURE__ */ a(O, { isNew: !0 })
|
|
178
171
|
}),
|
|
179
172
|
/* @__PURE__ */ a(c, {
|
|
180
173
|
path: "policies/:policyId",
|
|
181
|
-
element: /* @__PURE__ */ a(
|
|
174
|
+
element: /* @__PURE__ */ a(O, {})
|
|
182
175
|
}),
|
|
183
176
|
/* @__PURE__ */ a(c, {
|
|
184
177
|
path: "skills",
|
|
185
|
-
element: /* @__PURE__ */ a(
|
|
178
|
+
element: /* @__PURE__ */ a(k, {})
|
|
186
179
|
}),
|
|
187
180
|
/* @__PURE__ */ a(c, {
|
|
188
181
|
path: "skills/new",
|
|
189
|
-
element: /* @__PURE__ */ a(
|
|
182
|
+
element: /* @__PURE__ */ a(A, { isNew: !0 })
|
|
190
183
|
}),
|
|
191
184
|
/* @__PURE__ */ a(c, {
|
|
192
185
|
path: "skills/:skillId",
|
|
193
|
-
element: /* @__PURE__ */ a(
|
|
186
|
+
element: /* @__PURE__ */ a(A, {})
|
|
194
187
|
}),
|
|
195
188
|
/* @__PURE__ */ a(c, {
|
|
196
189
|
path: "prompt-templates",
|
|
197
|
-
element: /* @__PURE__ */ a(
|
|
190
|
+
element: /* @__PURE__ */ a(j, {})
|
|
198
191
|
}),
|
|
199
192
|
/* @__PURE__ */ a(c, {
|
|
200
193
|
path: "prompt-templates/new",
|
|
201
|
-
element: /* @__PURE__ */ a(
|
|
194
|
+
element: /* @__PURE__ */ a(M, { isNew: !0 })
|
|
202
195
|
}),
|
|
203
196
|
/* @__PURE__ */ a(c, {
|
|
204
197
|
path: "prompt-templates/:templateId",
|
|
205
|
-
element: /* @__PURE__ */ a(
|
|
198
|
+
element: /* @__PURE__ */ a(M, {})
|
|
206
199
|
}),
|
|
207
200
|
/* @__PURE__ */ a(c, {
|
|
208
201
|
path: "prompts",
|
|
209
|
-
element: /* @__PURE__ */ a(
|
|
202
|
+
element: /* @__PURE__ */ a(N, {})
|
|
210
203
|
}),
|
|
211
204
|
/* @__PURE__ */ a(c, {
|
|
212
205
|
path: "executions",
|
|
213
|
-
element: /* @__PURE__ */ a(
|
|
206
|
+
element: /* @__PURE__ */ a(P, {})
|
|
214
207
|
}),
|
|
215
208
|
/* @__PURE__ */ a(c, {
|
|
216
209
|
path: "executions/:executionId",
|
|
217
|
-
element: /* @__PURE__ */ a(
|
|
210
|
+
element: /* @__PURE__ */ a(F, {})
|
|
218
211
|
}),
|
|
219
212
|
/* @__PURE__ */ a(c, {
|
|
220
213
|
path: "buckets",
|
|
221
|
-
element: /* @__PURE__ */ a(
|
|
214
|
+
element: /* @__PURE__ */ a(I, {})
|
|
222
215
|
}),
|
|
223
216
|
/* @__PURE__ */ a(c, {
|
|
224
217
|
path: "buckets/new",
|
|
225
|
-
element: /* @__PURE__ */ a(
|
|
218
|
+
element: /* @__PURE__ */ a(I, {})
|
|
226
219
|
}),
|
|
227
220
|
/* @__PURE__ */ a(c, {
|
|
228
221
|
path: "buckets/:bucketId",
|
|
229
|
-
element: /* @__PURE__ */ a(
|
|
222
|
+
element: /* @__PURE__ */ a(I, {})
|
|
230
223
|
}),
|
|
231
224
|
/* @__PURE__ */ a(c, {
|
|
232
225
|
path: "store",
|
|
233
|
-
element: /* @__PURE__ */ a(
|
|
226
|
+
element: /* @__PURE__ */ a(L, {})
|
|
234
227
|
}),
|
|
235
228
|
/* @__PURE__ */ a(c, {
|
|
236
229
|
path: "store/installed",
|
|
237
|
-
element: /* @__PURE__ */ a(
|
|
230
|
+
element: /* @__PURE__ */ a(z, {})
|
|
238
231
|
}),
|
|
239
232
|
/* @__PURE__ */ a(c, {
|
|
240
233
|
path: "store/package/:slug",
|
|
241
|
-
element: /* @__PURE__ */ a(
|
|
234
|
+
element: /* @__PURE__ */ a(R, {})
|
|
242
235
|
}),
|
|
243
236
|
/* @__PURE__ */ a(c, {
|
|
244
237
|
path: "chat",
|
|
245
|
-
element: /* @__PURE__ */ a(
|
|
238
|
+
element: /* @__PURE__ */ a(V, {})
|
|
246
239
|
}),
|
|
247
240
|
/* @__PURE__ */ a(c, {
|
|
248
241
|
path: "chat/:agentId",
|
|
249
|
-
element: /* @__PURE__ */ a(
|
|
242
|
+
element: /* @__PURE__ */ a(V, {})
|
|
250
243
|
}),
|
|
251
244
|
/* @__PURE__ */ a(c, {
|
|
252
245
|
path: "settings",
|
|
253
|
-
element: /* @__PURE__ */ a(
|
|
254
|
-
}),
|
|
255
|
-
/* @__PURE__ */ a(c, {
|
|
256
|
-
path: "workflows",
|
|
257
|
-
element: /* @__PURE__ */ a(y, {})
|
|
258
|
-
}),
|
|
259
|
-
/* @__PURE__ */ a(c, {
|
|
260
|
-
path: "workflows/list",
|
|
261
|
-
element: /* @__PURE__ */ a(y, {})
|
|
262
|
-
}),
|
|
263
|
-
/* @__PURE__ */ a(c, {
|
|
264
|
-
path: "workflows/new",
|
|
265
|
-
element: /* @__PURE__ */ a(v, {})
|
|
266
|
-
}),
|
|
267
|
-
/* @__PURE__ */ a(c, {
|
|
268
|
-
path: "workflows/workflow/:id/:version",
|
|
269
|
-
element: /* @__PURE__ */ a(v, {})
|
|
270
|
-
}),
|
|
271
|
-
/* @__PURE__ */ a(c, {
|
|
272
|
-
path: "workflows/builder",
|
|
273
|
-
element: /* @__PURE__ */ a(v, {})
|
|
274
|
-
}),
|
|
275
|
-
/* @__PURE__ */ a(c, {
|
|
276
|
-
path: "workflows/builder/:id/:version",
|
|
277
|
-
element: /* @__PURE__ */ a(v, {})
|
|
278
|
-
}),
|
|
279
|
-
/* @__PURE__ */ a(c, {
|
|
280
|
-
path: "workflows/runs",
|
|
281
|
-
element: /* @__PURE__ */ a(p, {})
|
|
282
|
-
}),
|
|
283
|
-
/* @__PURE__ */ a(c, {
|
|
284
|
-
path: "workflows/runs/:runId",
|
|
285
|
-
element: /* @__PURE__ */ a(f, {})
|
|
286
|
-
}),
|
|
287
|
-
/* @__PURE__ */ a(c, {
|
|
288
|
-
path: "workflows/history",
|
|
289
|
-
element: /* @__PURE__ */ a(ee, {})
|
|
290
|
-
}),
|
|
291
|
-
/* @__PURE__ */ a(c, {
|
|
292
|
-
path: "workflows/templates",
|
|
293
|
-
element: /* @__PURE__ */ a(_, {})
|
|
294
|
-
}),
|
|
295
|
-
/* @__PURE__ */ a(c, {
|
|
296
|
-
path: "workflows/templates/:productId/preview",
|
|
297
|
-
element: /* @__PURE__ */ a(g, {})
|
|
298
|
-
}),
|
|
299
|
-
/* @__PURE__ */ a(c, {
|
|
300
|
-
path: "workflows/nodes",
|
|
301
|
-
element: /* @__PURE__ */ a(m, {})
|
|
302
|
-
}),
|
|
303
|
-
/* @__PURE__ */ a(c, {
|
|
304
|
-
path: "workflows/settings",
|
|
305
|
-
element: /* @__PURE__ */ a(h, {})
|
|
306
|
-
}),
|
|
307
|
-
/* @__PURE__ */ a(c, {
|
|
308
|
-
path: "workflows/executions",
|
|
309
|
-
element: /* @__PURE__ */ a(s, {
|
|
310
|
-
to: `${$}/workflows/runs`,
|
|
311
|
-
replace: !0
|
|
312
|
-
})
|
|
313
|
-
}),
|
|
314
|
-
/* @__PURE__ */ a(c, {
|
|
315
|
-
path: "workflows/executions/:runId",
|
|
316
|
-
element: /* @__PURE__ */ a(Z, { basePath: $ })
|
|
317
|
-
}),
|
|
318
|
-
/* @__PURE__ */ a(c, {
|
|
319
|
-
path: "workflows/credentials",
|
|
320
|
-
element: /* @__PURE__ */ a(s, {
|
|
321
|
-
to: "/integrations/connections",
|
|
322
|
-
replace: !0
|
|
323
|
-
})
|
|
324
|
-
}),
|
|
325
|
-
/* @__PURE__ */ a(c, {
|
|
326
|
-
path: "workflows/oauth/callback",
|
|
327
|
-
element: /* @__PURE__ */ a(s, {
|
|
328
|
-
to: "/integrations/connections",
|
|
329
|
-
replace: !0
|
|
330
|
-
})
|
|
331
|
-
}),
|
|
332
|
-
/* @__PURE__ */ a(c, {
|
|
333
|
-
path: "workflow/:id/:version",
|
|
334
|
-
element: /* @__PURE__ */ a(v, {})
|
|
246
|
+
element: /* @__PURE__ */ a(B, {})
|
|
335
247
|
}),
|
|
336
248
|
/* @__PURE__ */ a(c, {
|
|
337
249
|
path: "list",
|
|
338
250
|
element: /* @__PURE__ */ a(s, {
|
|
339
|
-
to: `${
|
|
251
|
+
to: `${W}/workflows/list`,
|
|
340
252
|
replace: !0
|
|
341
253
|
})
|
|
342
254
|
}),
|
|
@@ -352,6 +264,6 @@ var b = i(() => import("./pages/BotsListPage.js").then((e) => ({ default: e.Bots
|
|
|
352
264
|
});
|
|
353
265
|
};
|
|
354
266
|
//#endregion
|
|
355
|
-
export {
|
|
267
|
+
export { H as BotlitRoutes };
|
|
356
268
|
|
|
357
269
|
//# sourceMappingURL=BotlitRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotlitRoutes.js","names":[],"sources":["../../src/botlit/BotlitRoutes.tsx"],"sourcesContent":["/**\n * BotManor Routes\n * @module botlit\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation, useParams } from 'react-router';\nimport { useBotlit } from './providers/BotlitProvider';\nimport { RouteLoader } from './components/RouteLoader';\n\n// Import FluidGrids SDK workflow components (EXACT same as microfe-bigconsole)\nimport {\n WorkflowsList,\n WorkflowBuilderPage,\n ExecutionsListPage,\n ExecutionDetailPage as WorkflowExecutionDetailPage,\n HistoryPage,\n TemplatesPage,\n TemplatePreview,\n NodesPage,\n SettingsPage as WorkflowSettingsPage,\n} from '@burdenoff/fluidgrids-fe-sdk';\n\n// Eager load - Dashboard (primary landing page)\nimport { DashboardPage } from './pages/DashboardPage';\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 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// Note: ExecutionDetailPage is imported from @burdenoff/fluidgrids-fe-sdk (line 15)\n\n// Lazy loaded pages - Buckets\nconst BucketsPage = lazy(() =>\n import('./pages/BucketsPage').then((m) => ({ default: m.BucketsPage }))\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 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 ChatPage = lazy(() => import('./pages/ChatPage').then((m) => ({ default: m.ChatPage })));\n\n/**\n * Resolves the :runId param for the legacy `workflows/executions/:runId` →\n * `workflows/runs/:runId` redirect. Without this wrapper `<Navigate>` would\n * redirect to the literal string \":runId\".\n */\nconst LegacyWorkflowRunRedirect: FC<{ basePath: string }> = ({ basePath }) => {\n const { runId } = useParams<{ runId: string }>();\n return <Navigate to={`${basePath}/workflows/runs/${runId ?? ''}`} replace />;\n};\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\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : basePath.replace(/\\/$/, '');\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=\"/\" replace />} />\n\n {/* Bots */}\n <Route path=\"bots\" element={<BotsListPage />} />\n <Route path=\"bots/new\" element={<BotDetailPage isNew />} />\n <Route path=\"bots/:botId\" element={<BotDetailPage />} />\n <Route path=\"bots/:botId/edit\" element={<BotDetailPage isEditing />} />\n <Route path=\"bots/:botId/agents\" element={<AgentsListPage />} />\n <Route path=\"bots/:botId/agents/new\" element={<AgentBuilderPage />} />\n <Route path=\"bots/:botId/agents/:agentId\" element={<AgentDetailPage />} />\n <Route path=\"bots/:botId/agents/:agentId/edit\" element={<AgentBuilderPage />} />\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 path=\"agents/new\" element={<AgentBuilderPage />} />\n <Route path=\"agents/:agentId\" element={<AgentDetailPage />} />\n <Route path=\"agents/:agentId/edit\" element={<AgentBuilderPage />} />\n <Route path=\"agents/:agentId/chat\" element={<ChatPage />} />\n\n {/* Conversations - Redirect to conversations microfe */}\n <Route path=\"conversations\" element={<Navigate to=\"/conversations\" replace />} />\n <Route\n path=\"conversations/:conversationId\"\n element={<Navigate to=\"/conversations\" replace />}\n />\n\n {/* Knowledge Bases */}\n <Route path=\"knowledge\" element={<KnowledgeBasesPage />} />\n <Route path=\"knowledge/new\" element={<KnowledgeBaseDetailPage isNew />} />\n <Route path=\"knowledge/:kbId\" element={<KnowledgeBaseDetailPage />} />\n\n {/* Retrieval Profiles */}\n <Route path=\"retrieval-profiles\" element={<RetrievalProfilesPage />} />\n <Route path=\"retrieval-profiles/new\" element={<RetrievalProfileDetailPage isNew />} />\n <Route path=\"retrieval-profiles/:profileId\" element={<RetrievalProfileDetailPage />} />\n\n {/* MCP Servers */}\n <Route path=\"mcp\" element={<MCPServersPage />} />\n <Route path=\"mcp/new\" element={<MCPServerDetailPage isNew />} />\n <Route path=\"mcp/:serverId\" element={<MCPServerDetailPage />} />\n\n {/* A2A Registry */}\n <Route path=\"a2a\" element={<A2ARegistryPage />} />\n <Route path=\"a2a/register\" element={<A2AAgentDetailPage isNew />} />\n <Route path=\"a2a/:agentId\" element={<A2AAgentDetailPage />} />\n\n {/* Channels */}\n <Route path=\"channels\" element={<ChannelsPage />} />\n <Route path=\"channels/new\" element={<ChannelDetailPage isNew />} />\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 path=\"policies/new\" element={<PolicyDetailPage isNew />} />\n <Route path=\"policies/:policyId\" element={<PolicyDetailPage />} />\n\n {/* Skills */}\n <Route path=\"skills\" element={<SkillsPage />} />\n <Route path=\"skills/new\" element={<SkillDetailPage isNew />} />\n <Route path=\"skills/:skillId\" element={<SkillDetailPage />} />\n\n {/* Prompt Templates */}\n <Route path=\"prompt-templates\" element={<PromptTemplatesPage />} />\n <Route path=\"prompt-templates/new\" element={<PromptTemplateDetailPage isNew />} />\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=\"executions/:executionId\" element={<ExecutionDetailPage />} />\n\n {/* Buckets */}\n <Route path=\"buckets\" element={<BucketsPage />} />\n <Route path=\"buckets/new\" element={<BucketsPage />} />\n <Route path=\"buckets/:bucketId\" element={<BucketsPage />} />\n\n {/* Store */}\n <Route path=\"store\" element={<StorePage />} />\n <Route path=\"store/installed\" element={<InstalledPackagesPage />} />\n <Route path=\"store/package/:slug\" element={<StorePackageDetailPage />} />\n\n {/* Chat */}\n <Route path=\"chat\" element={<ChatPage />} />\n <Route path=\"chat/:agentId\" element={<ChatPage />} />\n\n {/* Settings */}\n <Route path=\"settings\" element={<SettingsPage />} />\n\n {/* Workflow Routes - FluidGrids SDK Integration (mirrors microfe-workflows) */}\n <Route path=\"workflows\" element={<WorkflowsList />} />\n <Route path=\"workflows/list\" element={<WorkflowsList />} />\n <Route path=\"workflows/new\" element={<WorkflowBuilderPage />} />\n <Route path=\"workflows/workflow/:id/:version\" element={<WorkflowBuilderPage />} />\n <Route path=\"workflows/builder\" element={<WorkflowBuilderPage />} />\n <Route path=\"workflows/builder/:id/:version\" element={<WorkflowBuilderPage />} />\n <Route path=\"workflows/runs\" element={<ExecutionsListPage />} />\n <Route path=\"workflows/runs/:runId\" element={<WorkflowExecutionDetailPage />} />\n <Route path=\"workflows/history\" element={<HistoryPage />} />\n <Route path=\"workflows/templates\" element={<TemplatesPage />} />\n {/* Read-only preview of a store workflow template */}\n <Route path=\"workflows/templates/:productId/preview\" element={<TemplatePreview />} />\n <Route path=\"workflows/nodes\" element={<NodesPage />} />\n <Route path=\"workflows/settings\" element={<WorkflowSettingsPage />} />\n\n {/* Legacy FluidGrids paths — the SDK still links to some of these */}\n <Route\n path=\"workflows/executions\"\n element={<Navigate to={`${normalizedBasePath}/workflows/runs`} replace />}\n />\n <Route\n path=\"workflows/executions/:runId\"\n element={<LegacyWorkflowRunRedirect basePath={normalizedBasePath} />}\n />\n {/* Connection management lives in microfe-integrations */}\n <Route\n path=\"workflows/credentials\"\n element={<Navigate to=\"/integrations/connections\" replace />}\n />\n <Route\n path=\"workflows/oauth/callback\"\n element={<Navigate to=\"/integrations/connections\" replace />}\n />\n\n {/* Support SDK's navigation pattern (without /workflows/ prefix) */}\n <Route path=\"workflow/:id/:version\" element={<WorkflowBuilderPage />} />\n {/*\n The SDK navigates relatively to `list`. Resolve it against the mounted\n base path — a relative `../workflows/list` resolves differently\n depending on how deep the shell mounted this MFE.\n */}\n <Route\n path=\"list\"\n element={<Navigate to={`${normalizedBasePath}/workflows/list`} replace />}\n />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"/\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AA2BA,IAAM,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EAGK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAmB,QACvB,OAAO,+BAA4B,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAClF,EAGK,IAAqB,QACzB,OAAO,iCAA8B,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACtF,EACK,IAA0B,QAC9B,OAAO,sCAAmC,MAAM,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAChG,EAGK,IAAwB,QAC5B,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAC5F,EACK,IAA6B,QACjC,OAAO,yCAAsC,MAAM,OAAO,EACxD,SAAS,EAAE,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;MAAU,IAAG;MAA4B,SAAA;MAAU,CAAA;KAC5D,CAAA;IAGF,kBAAC,GAAD;KAAO,MAAK;KAAwB,SAAS,kBAAC,GAAD,EAAuB,CAAA;KAAI,CAAA;IAMxE,kBAAC,GAAD;KACE,MAAK;KACL,SAAS,kBAAC,GAAD;MAAU,IAAI,GAAG,EAAmB;MAAkB,SAAA;MAAU,CAAA;KACzE,CAAA;IAGF,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAI,SAAA;MAAU,CAAA;KAAI,CAAA;IACjD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
1
|
+
{"version":3,"file":"BotlitRoutes.js","names":[],"sources":["../../src/botlit/BotlitRoutes.tsx"],"sourcesContent":["/**\n * BotManor Routes\n * @module botlit\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useBotlit } from './providers/BotlitProvider';\nimport { RouteLoader } from './components/RouteLoader';\n\n// Eager load - Dashboard (primary landing page)\nimport { DashboardPage } from './pages/DashboardPage';\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 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 - Buckets\nconst BucketsPage = lazy(() =>\n import('./pages/BucketsPage').then((m) => ({ default: m.BucketsPage }))\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 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 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\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : basePath.replace(/\\/$/, '');\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=\"/\" replace />} />\n\n {/* Bots */}\n <Route path=\"bots\" element={<BotsListPage />} />\n <Route path=\"bots/new\" element={<BotDetailPage isNew />} />\n <Route path=\"bots/:botId\" element={<BotDetailPage />} />\n <Route path=\"bots/:botId/edit\" element={<BotDetailPage isEditing />} />\n <Route path=\"bots/:botId/agents\" element={<AgentsListPage />} />\n <Route path=\"bots/:botId/agents/new\" element={<AgentBuilderPage />} />\n <Route path=\"bots/:botId/agents/:agentId\" element={<AgentDetailPage />} />\n <Route path=\"bots/:botId/agents/:agentId/edit\" element={<AgentBuilderPage />} />\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 path=\"agents/new\" element={<AgentBuilderPage />} />\n <Route path=\"agents/:agentId\" element={<AgentDetailPage />} />\n <Route path=\"agents/:agentId/edit\" element={<AgentBuilderPage />} />\n <Route path=\"agents/:agentId/chat\" element={<ChatPage />} />\n\n {/* Conversations - Redirect to conversations microfe */}\n <Route path=\"conversations\" element={<Navigate to=\"/conversations\" replace />} />\n <Route\n path=\"conversations/:conversationId\"\n element={<Navigate to=\"/conversations\" replace />}\n />\n\n {/* Knowledge Bases */}\n <Route path=\"knowledge\" element={<KnowledgeBasesPage />} />\n <Route path=\"knowledge/new\" element={<KnowledgeBaseDetailPage isNew />} />\n <Route path=\"knowledge/:kbId\" element={<KnowledgeBaseDetailPage />} />\n\n {/* Retrieval Profiles */}\n <Route path=\"retrieval-profiles\" element={<RetrievalProfilesPage />} />\n <Route path=\"retrieval-profiles/new\" element={<RetrievalProfileDetailPage isNew />} />\n <Route path=\"retrieval-profiles/:profileId\" element={<RetrievalProfileDetailPage />} />\n\n {/* MCP Servers */}\n <Route path=\"mcp\" element={<MCPServersPage />} />\n <Route path=\"mcp/new\" element={<MCPServerDetailPage isNew />} />\n <Route path=\"mcp/:serverId\" element={<MCPServerDetailPage />} />\n\n {/* A2A Registry */}\n <Route path=\"a2a\" element={<A2ARegistryPage />} />\n <Route path=\"a2a/register\" element={<A2AAgentDetailPage isNew />} />\n <Route path=\"a2a/:agentId\" element={<A2AAgentDetailPage />} />\n\n {/* Channels */}\n <Route path=\"channels\" element={<ChannelsPage />} />\n <Route path=\"channels/new\" element={<ChannelDetailPage isNew />} />\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 path=\"policies/new\" element={<PolicyDetailPage isNew />} />\n <Route path=\"policies/:policyId\" element={<PolicyDetailPage />} />\n\n {/* Skills */}\n <Route path=\"skills\" element={<SkillsPage />} />\n <Route path=\"skills/new\" element={<SkillDetailPage isNew />} />\n <Route path=\"skills/:skillId\" element={<SkillDetailPage />} />\n\n {/* Prompt Templates */}\n <Route path=\"prompt-templates\" element={<PromptTemplatesPage />} />\n <Route path=\"prompt-templates/new\" element={<PromptTemplateDetailPage isNew />} />\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=\"executions/:executionId\" element={<ExecutionDetailPage />} />\n\n {/* Buckets */}\n <Route path=\"buckets\" element={<BucketsPage />} />\n <Route path=\"buckets/new\" element={<BucketsPage />} />\n <Route path=\"buckets/:bucketId\" element={<BucketsPage />} />\n\n {/* Store */}\n <Route path=\"store\" element={<StorePage />} />\n <Route path=\"store/installed\" element={<InstalledPackagesPage />} />\n <Route path=\"store/package/:slug\" element={<StorePackageDetailPage />} />\n\n {/* Chat */}\n <Route path=\"chat\" element={<ChatPage />} />\n <Route path=\"chat/:agentId\" element={<ChatPage />} />\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 */}\n <Route path=\"*\" element={<Navigate to=\"/\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAcA,IAAM,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EAGK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAmB,QACvB,OAAO,+BAA4B,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAClF,EAGK,IAAqB,QACzB,OAAO,iCAA8B,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACtF,EACK,IAA0B,QAC9B,OAAO,sCAAmC,MAAM,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAChG,EAGK,IAAwB,QAC5B,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAC5F,EACK,IAA6B,QACjC,OAAO,yCAAsC,MAAM,OAAO,EACxD,SAAS,EAAE,4BACZ,EAAE,CACJ,EAGK,IAAiB,QACrB,OAAO,6BAA0B,MAA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,GAAD;KAAO,MAAK;KAA0B,SAAS,kBAAC,GAAD,EAAuB,CAAA;KAAI,CAAA;IAG1E,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IACtD,kBAAC,GAAD;KAAO,MAAK;KAAoB,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAG5D,kBAAC,GAAD;KAAO,MAAK;KAAQ,SAAS,kBAAC,GAAD,EAAa,CAAA;KAAI,CAAA;IAC9C,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,EAAyB,CAAA;KAAI,CAAA;IACpE,kBAAC,GAAD;KAAO,MAAK;KAAsB,SAAS,kBAAC,GAAD,EAA0B,CAAA;KAAI,CAAA;IAGzE,kBAAC,GAAD;KAAO,MAAK;KAAO,SAAS,kBAAC,GAAD,EAAY,CAAA;KAAI,CAAA;IAC5C,kBAAC,GAAD;KAAO,MAAK;KAAgB,SAAS,kBAAC,GAAD,EAAY,CAAA;KAAI,CAAA;IAGrD,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;KAAI,CAAA;IAGpD,kBAAC,GAAD;KACE,MAAK;KACL,SAAS,kBAAC,GAAD;MAAU,IAAI,GAAG,EAAmB;MAAkB,SAAA;MAAU,CAAA;KACzE,CAAA;IAGF,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAI,SAAA;MAAU,CAAA;KAAI,CAAA;IACjD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotmanorRoot.js","names":[],"sources":["../../src/botlit/BotmanorRoot.tsx"],"sourcesContent":["/**\n * BotManor Root Component\n * @module botlit\n */\n\nimport type { FC } from 'react';\nimport { lazy, Suspense } from 'react';\nimport { RouteLoader } from './components/RouteLoader';\nimport type { BotmanorRootProps } from './types';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"BotmanorRoot.js","names":[],"sources":["../../src/botlit/BotmanorRoot.tsx"],"sourcesContent":["/**\n * BotManor Root Component\n * @module botlit\n */\n\nimport type { FC } from 'react';\nimport { lazy, Suspense } from 'react';\nimport { RouteLoader } from './components/RouteLoader';\nimport type { BotmanorRootProps } from './types';\n\n/**\n * Lazy product screens keep the entry point small and show a loader while\n * loading. Workflow screens are mounted separately by the shell's shared\n * WorkflowsRoot. Chunk failures reach the host's recovery boundary.\n */\nconst BotmanorRootInner = lazy(() =>\n import('./BotmanorRootInner').then((module) => ({ default: module.BotmanorRootInner }))\n);\n\nexport const BotmanorRoot: FC<BotmanorRootProps> = (props) => (\n <Suspense fallback={<RouteLoader />}>\n <BotmanorRootInner {...props} />\n </Suspense>\n);\n"],"mappings":";;;;AAeA,IAAM,IAAoB,QACxB,OAAO,0BAAuB,MAAM,OAAY,EAAE,SAAS,EAAO,mBAAmB,EAAE,CACxF,EAEY,KAAuC,MAClD,kBAAC,GAAD;CAAU,UAAU,kBAAC,GAAD,EAAe,CAAA;WACjC,kBAAC,GAAD,EAAmB,GAAI,GAAS,CAAA;CACvB,CAAA"}
|
|
@@ -2,100 +2,72 @@ import { RouteLoader as e } from "./components/RouteLoader.js";
|
|
|
2
2
|
import { BotlitProvider as t } from "./providers/BotlitProvider.js";
|
|
3
3
|
import { BotlitRoutes as n } from "./BotlitRoutes.js";
|
|
4
4
|
import { WorkspaceRequired as r } from "./components/WorkspaceRequired.js";
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useGatewayClient as
|
|
8
|
-
import { ApolloProvider as
|
|
9
|
-
import { QueryClient as
|
|
10
|
-
import { ErrorBoundary as
|
|
11
|
-
import { FeatureFlagProvider as
|
|
12
|
-
import { refetchStoreNodes as _, resetFluidGridsClient as v, resetFluidGridsConfig as y, resetGlobalStoreClient as b, setFluidGridsClient as x, setFluidGridsConfig as S, setGlobalStoreClient as C } from "@burdenoff/fluidgrids-fe-sdk";
|
|
5
|
+
import { useEffect as i, useState as a } from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { useGatewayClient as c } from "@burdenoff/fe-libs/shared/graphql";
|
|
8
|
+
import { ApolloProvider as l } from "@apollo/client/react";
|
|
9
|
+
import { QueryClient as u, QueryClientProvider as d } from "@tanstack/react-query";
|
|
10
|
+
import { ErrorBoundary as f } from "@burdenoff/fe-libs/shared/components";
|
|
11
|
+
import { FeatureFlagProvider as p } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
13
12
|
//#region src/botlit/BotmanorRootInner.tsx
|
|
14
|
-
var
|
|
13
|
+
var m = 1e4, h = 2e3, g = new u({ defaultOptions: { queries: {
|
|
15
14
|
staleTime: 300 * 1e3,
|
|
16
15
|
retry: 1
|
|
17
|
-
} } }),
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}), M(!0)), () => {
|
|
22
|
-
v(), b();
|
|
23
|
-
}), [k, A]), a(() => {
|
|
24
|
-
if (j) return;
|
|
16
|
+
} } }), _ = (u) => {
|
|
17
|
+
let _ = c("workspace"), v = !!_, [y, b] = a(null), [x, S] = a(!1);
|
|
18
|
+
if (i(() => {
|
|
19
|
+
if (v) return;
|
|
25
20
|
let e = setTimeout(() => {
|
|
26
|
-
|
|
27
|
-
},
|
|
21
|
+
b("BotManor could not connect to the gateway. Please refresh the page or check your configuration.");
|
|
22
|
+
}, m);
|
|
28
23
|
return () => clearTimeout(e);
|
|
29
|
-
}, [
|
|
30
|
-
if (
|
|
31
|
-
let e = setTimeout(() =>
|
|
24
|
+
}, [v]), i(() => {
|
|
25
|
+
if (u.workspaceId) return;
|
|
26
|
+
let e = setTimeout(() => S(!0), h);
|
|
32
27
|
return () => clearTimeout(e);
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (p.apiGatewayUrl) return S({
|
|
39
|
-
apiGatewayUrl: p.apiGatewayUrl.endsWith("/") ? p.apiGatewayUrl.slice(0, -1) : p.apiGatewayUrl,
|
|
40
|
-
authToken: p.authToken,
|
|
41
|
-
workspaceId: p.workspaceId ?? "",
|
|
42
|
-
tenantId: p.tenantId,
|
|
43
|
-
productId: p.productId ?? w,
|
|
44
|
-
productName: p.productName ?? T,
|
|
45
|
-
onWorkflowSaved: (e) => R.current(e)
|
|
46
|
-
}), () => {
|
|
47
|
-
y();
|
|
48
|
-
};
|
|
49
|
-
}, [
|
|
50
|
-
p.apiGatewayUrl,
|
|
51
|
-
p.authToken,
|
|
52
|
-
p.workspaceId,
|
|
53
|
-
p.tenantId,
|
|
54
|
-
p.productId,
|
|
55
|
-
p.productName
|
|
56
|
-
]), !p.workspaceId) return F ? /* @__PURE__ */ l(r, {
|
|
57
|
-
basePath: p.basePath,
|
|
58
|
-
navigate: p.navigate
|
|
59
|
-
}) : /* @__PURE__ */ l(e, { label: "Loading your workspace…" });
|
|
60
|
-
if (!j) return N ? /* @__PURE__ */ l("div", {
|
|
28
|
+
}, [u.workspaceId]), !u.workspaceId) return x ? /* @__PURE__ */ o(r, {
|
|
29
|
+
basePath: u.basePath,
|
|
30
|
+
navigate: u.navigate
|
|
31
|
+
}) : /* @__PURE__ */ o(e, { label: "Loading your workspace…" });
|
|
32
|
+
if (!v) return y ? /* @__PURE__ */ o("div", {
|
|
61
33
|
className: "flex h-full min-h-[200px] w-full items-center justify-center p-6",
|
|
62
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ s("div", {
|
|
63
35
|
className: "text-center",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ o("p", {
|
|
65
37
|
className: "mb-4 text-sm text-text-secondary",
|
|
66
|
-
children:
|
|
67
|
-
}), /* @__PURE__ */
|
|
38
|
+
children: y
|
|
39
|
+
}), /* @__PURE__ */ o("button", {
|
|
68
40
|
type: "button",
|
|
69
41
|
onClick: () => window.location.reload(),
|
|
70
42
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
71
43
|
children: "Reload Page"
|
|
72
44
|
})]
|
|
73
45
|
})
|
|
74
|
-
}) : /* @__PURE__ */
|
|
75
|
-
let
|
|
76
|
-
...
|
|
77
|
-
children: /* @__PURE__ */
|
|
46
|
+
}) : /* @__PURE__ */ o(e, {});
|
|
47
|
+
let C = !!u.basePath, w = /* @__PURE__ */ o(t, {
|
|
48
|
+
...u,
|
|
49
|
+
children: /* @__PURE__ */ o(n, {})
|
|
78
50
|
});
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
fallback: /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ o(f, {
|
|
52
|
+
fallback: /* @__PURE__ */ o("div", {
|
|
81
53
|
className: "p-6 text-center text-text-secondary",
|
|
82
54
|
children: "Something went wrong loading BotManor. Please refresh the page."
|
|
83
55
|
}),
|
|
84
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ o(p, {
|
|
85
57
|
workspaceId: null,
|
|
86
58
|
gateway: "global",
|
|
87
59
|
defaultEnabled: !0,
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
client:
|
|
90
|
-
children:
|
|
91
|
-
client:
|
|
92
|
-
children:
|
|
60
|
+
children: /* @__PURE__ */ o(d, {
|
|
61
|
+
client: g,
|
|
62
|
+
children: C ? w : /* @__PURE__ */ o(l, {
|
|
63
|
+
client: _,
|
|
64
|
+
children: w
|
|
93
65
|
})
|
|
94
66
|
})
|
|
95
67
|
})
|
|
96
68
|
});
|
|
97
69
|
};
|
|
98
70
|
//#endregion
|
|
99
|
-
export {
|
|
71
|
+
export { _ as BotmanorRootInner };
|
|
100
72
|
|
|
101
73
|
//# sourceMappingURL=BotmanorRootInner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotmanorRootInner.js","names":[],"sources":["../../src/botlit/BotmanorRootInner.tsx"],"sourcesContent":["/**\n * BotManor Root — implementation\n * @module botlit\n *\n * The heavy half of {@link BotmanorRoot}. Everything that pulls a large\n * dependency graph lives behind this module so the package entry point stays\n * small: `BotmanorRootInner` statically imports `BotlitRoutes`, which in turn\n * pulls the whole `@burdenoff/fluidgrids-fe-sdk` barrel (workflow builder,\n * @xyflow/react, framer-motion …). `BotmanorRoot` loads this module lazily and\n * paints a skeleton meanwhile, so the host never shows an empty content\n * region while that graph downloads.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { BotlitProvider } from './providers/BotlitProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { BotlitRoutes } from './BotlitRoutes';\nimport { RouteLoader } from './components/RouteLoader';\nimport { WorkspaceRequired } from './components/WorkspaceRequired';\nimport type { BotmanorRootProps } from './types';\n\n// FluidGrids SDK client injection (needed for workflow components)\nimport {\n setFluidGridsClient,\n resetFluidGridsClient,\n setFluidGridsConfig,\n resetFluidGridsConfig,\n setGlobalStoreClient,\n resetGlobalStoreClient,\n refetchStoreNodes,\n type WorkflowSavedResult,\n} from '@burdenoff/fluidgrids-fe-sdk';\n// Use the shared gateway Apollo clients from the shell\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\n/**\n * Product identity handed to the FluidGrids SDK when the shell does not override it.\n * `botmanor` since the Botlit -> BotManor rename's Stage 5a; workflow\n * definitions stored under the legacy `botlit` were migrated, and the workflow\n * service matches either slug.\n */\nconst DEFAULT_PRODUCT_ID = 'botmanor';\nconst DEFAULT_PRODUCT_NAME = 'BotManor';\n\n/** How long to wait for the shell's gateway clients before showing an error. */\nconst CLIENT_READY_TIMEOUT_MS = 10_000;\n\n/**\n * How long to keep showing the loading skeleton before concluding that the\n * shell really has no active workspace.\n *\n * The shell resolves org/workspace asynchronously and passes `workspaceId=\"\"`\n * until it lands, which is indistinguishable from \"this user has no\n * workspace\". Without this settle window the guided zero state would flash on\n * every cold load — a get-started screen appearing and vanishing reads as a\n * broken page, which is exactly what this component exists to avoid.\n */\nconst WORKSPACE_SETTLE_MS = 2_000;\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const BotmanorRootInner: FC<BotmanorRootProps> = (props) => {\n // NOTE: Navigation is now handled by the shell's NavRegistration.tsx\n // The shell manages all product submenu items in a centralized way\n\n // Get shell's Apollo clients (both workspace and global for FluidGrids SDK)\n const workspaceClient = useGatewayClient('workspace');\n const globalClient = useGatewayClient('global');\n const [clientReady, setClientReady] = useState(false);\n const [clientError, setClientError] = useState<string | null>(null);\n const [workspaceSettled, setWorkspaceSettled] = useState(false);\n\n // Inject Apollo clients into FluidGrids SDK (for workflow components).\n // This synchronizes external stores (module-level client singletons in the SDK)\n // with React's lifecycle. The setState call is intentional — it gates rendering\n // so children don't mount before the SDK clients are available.\n //\n // KNOWN TRADE-OFF (mirrors microfe-bigconsole): clientReady is NOT reset in\n // cleanup. When the client references change (e.g. token refresh) children keep\n // rendering against a briefly uninitialised SDK client until the effect re-runs.\n // That avoids a spinner flash mid-session; failed requests are retried by\n // Apollo/React Query.\n useEffect(() => {\n if (workspaceClient && globalClient) {\n setFluidGridsClient(workspaceClient);\n setGlobalStoreClient(globalClient);\n // Node definitions come from the global store — refresh them now that the\n // SDK has a client, otherwise the builder palette stays empty.\n void refetchStoreNodes().catch((error: unknown) => {\n console.warn('[BotManor] Failed to refresh FluidGrids store nodes', error);\n });\n setClientReady(true);\n }\n return () => {\n resetFluidGridsClient();\n resetGlobalStoreClient();\n };\n }, [workspaceClient, globalClient]);\n\n // Timeout fallback: if gateway clients are never provided (test env, shell\n // misconfiguration, auth failure before hydration), show an error rather than\n // spinning indefinitely.\n useEffect(() => {\n if (clientReady) return;\n const timer = setTimeout(() => {\n setClientError(\n 'BotManor could not connect to the gateway. Please refresh the page or check your configuration.'\n );\n }, CLIENT_READY_TIMEOUT_MS);\n return () => clearTimeout(timer);\n }, [clientReady]);\n\n // Give the shell a bounded window to resolve the active workspace before the\n // guided zero state is allowed to render. Cancelled the moment a workspace\n // arrives — a workspace that is already present never starts the timer.\n useEffect(() => {\n if (props.workspaceId) return;\n const timer = setTimeout(() => setWorkspaceSettled(true), WORKSPACE_SETTLE_MS);\n return () => clearTimeout(timer);\n }, [props.workspaceId]);\n\n // Hook point for syncing a saved workflow back into BotManor. BotManor keeps no\n // separate workflow record (unlike BigConsole), so there is nothing to write —\n // the bridge exists so a future sync can be added without re-initialising the SDK.\n const handleWorkflowSaved = useCallback((result: WorkflowSavedResult) => {\n if (import.meta.env.DEV) {\n console.info('[BotManor] Workflow saved', result.workflowKey, result.operation);\n }\n }, []);\n\n // Ref-forwarding: decouple the callback from the SDK config effect so that\n // workspaceClient reference changes don't trigger resetFluidGridsConfig() + re-init.\n const handleWorkflowSavedRef = useRef(handleWorkflowSaved);\n useLayoutEffect(() => {\n handleWorkflowSavedRef.current = handleWorkflowSaved;\n }, [handleWorkflowSaved]);\n\n // Configure FluidGrids SDK settings\n useEffect(() => {\n if (!props.apiGatewayUrl) return;\n\n const normalizedBase = props.apiGatewayUrl.endsWith('/')\n ? props.apiGatewayUrl.slice(0, -1)\n : props.apiGatewayUrl;\n\n setFluidGridsConfig({\n apiGatewayUrl: normalizedBase,\n authToken: props.authToken,\n workspaceId: props.workspaceId ?? '',\n tenantId: props.tenantId,\n // The SDK filters workflows by productId. It MUST be this product — falling\n // back to the shell's default ('workspaces') would leak another product's\n // workflows into BotManor.\n productId: props.productId ?? DEFAULT_PRODUCT_ID,\n productName: props.productName ?? DEFAULT_PRODUCT_NAME,\n // Stable wrapper via ref — avoids SDK re-init when workspaceClient changes reference\n onWorkflowSaved: (result: WorkflowSavedResult) => handleWorkflowSavedRef.current(result),\n });\n\n return () => {\n resetFluidGridsConfig();\n };\n }, [\n props.apiGatewayUrl,\n props.authToken,\n props.workspaceId,\n props.tenantId,\n props.productId,\n props.productName,\n ]);\n\n // Without a workspace every BotManor query is unscoped and every write is\n // rejected — guide the user instead of rendering empty lists. Until the\n // settle window elapses we cannot tell \"still resolving\" from \"none\", so we\n // keep the same skeleton the shell was already showing.\n if (!props.workspaceId) {\n if (!workspaceSettled) {\n return <RouteLoader label=\"Loading your workspace…\" />;\n }\n return <WorkspaceRequired basePath={props.basePath} navigate={props.navigate} />;\n }\n\n // Don't render until clients are ready (same pattern as microfe-bigconsole)\n if (!clientReady) {\n if (clientError) {\n return (\n <div className=\"flex h-full min-h-[200px] w-full items-center justify-center p-6\">\n <div className=\"text-center\">\n <p className=\"mb-4 text-sm text-text-secondary\">{clientError}</p>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover\"\n >\n Reload Page\n </button>\n </div>\n </div>\n );\n }\n // Same skeleton as the lazy-chunk fallback, so the content region never\n // switches loading idioms between first paint and the page rendering.\n return <RouteLoader />;\n }\n\n const isIntegrated = !!props.basePath;\n\n const content = (\n <BotlitProvider {...props}>\n <BotlitRoutes />\n </BotlitProvider>\n );\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading BotManor. Please refresh the page.\n </div>\n }\n >\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <QueryClientProvider client={queryClient}>\n {isIntegrated ? (\n content\n ) : (\n <ApolloProvider client={workspaceClient}>{content}</ApolloProvider>\n )}\n </QueryClientProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\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AU,EAAM;GAIhB,WAAW,EAAM,aAAa;GAC9B,aAAa,EAAM,eAAe;GAElC,kBAAkB,MAAgC,EAAuB,QAAQ,EAAO;GACzF,CAAC,QAEW;AACX,MAAuB;;IAExB;EACD,EAAM;EACN,EAAM;EACN,EAAM;EACN,EAAM;EACN,EAAM;EACN,EAAM;EACP,CAAC,EAME,CAAC,EAAM,YAIT,QAHK,IAGE,kBAAC,GAAD;EAAmB,UAAU,EAAM;EAAU,UAAU,EAAM;EAAY,CAAA,GAFvE,kBAAC,GAAD,EAAa,OAAM,2BAA4B,CAAA;AAM1D,KAAI,CAAC,EAmBH,QAlBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAoC;IAAgB,CAAA,EACjE,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,OAAO,SAAS,QAAQ;IACvC,WAAU;cACX;IAEQ,CAAA,CACL;;EACF,CAAA,GAKH,kBAAC,GAAD,EAAe,CAAA;CAGxB,IAAM,IAAe,CAAC,CAAC,EAAM,UAEvB,IACJ,kBAAC,GAAD;EAAgB,GAAI;YAClB,kBAAC,GAAD,EAAgB,CAAA;EACD,CAAA;AAGnB,QACE,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAqB,QAAQ;cAC1B,IACC,IAEA,kBAAC,GAAD;KAAgB,QAAQ;eAAkB;KAAyB,CAAA;IAEjD,CAAA;GACF,CAAA;EACR,CAAA"}
|
|
1
|
+
{"version":3,"file":"BotmanorRootInner.js","names":[],"sources":["../../src/botlit/BotmanorRootInner.tsx"],"sourcesContent":["/**\n * BotManor Root — implementation\n * @module botlit\n *\n * Product pages live behind this lazy boundary. Workflow routes and SDK\n * lifecycle are owned by the app-shell WorkflowsRoot, shared with every host.\n */\n\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { BotlitProvider } from './providers/BotlitProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { BotlitRoutes } from './BotlitRoutes';\nimport { RouteLoader } from './components/RouteLoader';\nimport { WorkspaceRequired } from './components/WorkspaceRequired';\nimport type { BotmanorRootProps } from './types';\n\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\n/** How long to wait for the shell's gateway clients before showing an error. */\nconst CLIENT_READY_TIMEOUT_MS = 10_000;\n\n/**\n * How long to keep showing the loading skeleton before concluding that the\n * shell really has no active workspace.\n *\n * The shell resolves org/workspace asynchronously and passes `workspaceId=\"\"`\n * until it lands, which is indistinguishable from \"this user has no\n * workspace\". Without this settle window the guided zero state would flash on\n * every cold load — a get-started screen appearing and vanishing reads as a\n * broken page, which is exactly what this component exists to avoid.\n */\nconst WORKSPACE_SETTLE_MS = 2_000;\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const BotmanorRootInner: FC<BotmanorRootProps> = (props) => {\n // NOTE: Navigation is now handled by the shell's NavRegistration.tsx\n // The shell manages all product submenu items in a centralized way\n\n // Product operations use the shell's authenticated workspace gateway client.\n const workspaceClient = useGatewayClient('workspace');\n const clientReady = Boolean(workspaceClient);\n const [clientError, setClientError] = useState<string | null>(null);\n const [workspaceSettled, setWorkspaceSettled] = useState(false);\n\n // Timeout fallback: if gateway clients are never provided (test env, shell\n // misconfiguration, auth failure before hydration), show an error rather than\n // spinning indefinitely.\n useEffect(() => {\n if (clientReady) return;\n const timer = setTimeout(() => {\n setClientError(\n 'BotManor could not connect to the gateway. Please refresh the page or check your configuration.'\n );\n }, CLIENT_READY_TIMEOUT_MS);\n return () => clearTimeout(timer);\n }, [clientReady]);\n\n // Give the shell a bounded window to resolve the active workspace before the\n // guided zero state is allowed to render. Cancelled the moment a workspace\n // arrives — a workspace that is already present never starts the timer.\n useEffect(() => {\n if (props.workspaceId) return;\n const timer = setTimeout(() => setWorkspaceSettled(true), WORKSPACE_SETTLE_MS);\n return () => clearTimeout(timer);\n }, [props.workspaceId]);\n\n // Without a workspace every BotManor query is unscoped and every write is\n // rejected — guide the user instead of rendering empty lists. Until the\n // settle window elapses we cannot tell \"still resolving\" from \"none\", so we\n // keep the same skeleton the shell was already showing.\n if (!props.workspaceId) {\n if (!workspaceSettled) {\n return <RouteLoader label=\"Loading your workspace…\" />;\n }\n return <WorkspaceRequired basePath={props.basePath} navigate={props.navigate} />;\n }\n\n // Don't render until clients are ready (same pattern as microfe-bigconsole)\n if (!clientReady) {\n if (clientError) {\n return (\n <div className=\"flex h-full min-h-[200px] w-full items-center justify-center p-6\">\n <div className=\"text-center\">\n <p className=\"mb-4 text-sm text-text-secondary\">{clientError}</p>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover\"\n >\n Reload Page\n </button>\n </div>\n </div>\n );\n }\n // Same skeleton as the lazy-chunk fallback, so the content region never\n // switches loading idioms between first paint and the page rendering.\n return <RouteLoader />;\n }\n\n const isIntegrated = !!props.basePath;\n\n const content = (\n <BotlitProvider {...props}>\n <BotlitRoutes />\n </BotlitProvider>\n );\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading BotManor. Please refresh the page.\n </div>\n }\n >\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <QueryClientProvider client={queryClient}>\n {isIntegrated ? (\n content\n ) : (\n <ApolloProvider client={workspaceClient}>{content}</ApolloProvider>\n )}\n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C,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAqB,QAAQ;cAC1B,IACC,IAEA,kBAAC,GAAD;KAAgB,QAAQ;eAAkB;KAAyB,CAAA;IAEjD,CAAA;GACF,CAAA;EACR,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { gql as n } from "@apollo/client";
|
|
4
|
+
import { useGatewayClient as r } from "@burdenoff/fe-libs/shared/graphql";
|
|
5
|
+
import { useQuery as i } from "@apollo/client/react";
|
|
6
|
+
//#region src/botlit/hooks/useBotWorkflow.ts
|
|
7
|
+
var a = n`
|
|
8
|
+
query BotWorkflowDefinition($id: ID!) {
|
|
9
|
+
workflowDefinition(id: $id) {
|
|
10
|
+
id
|
|
11
|
+
workflowKey
|
|
12
|
+
version
|
|
13
|
+
name
|
|
14
|
+
status
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`, o = n`
|
|
18
|
+
mutation CreateBotWorkflow($input: CreateWorkflowDefinitionInput!) {
|
|
19
|
+
createWorkflowDefinition(input: $input) {
|
|
20
|
+
id
|
|
21
|
+
workflowKey
|
|
22
|
+
version
|
|
23
|
+
name
|
|
24
|
+
status
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
function s(e, t) {
|
|
29
|
+
let n = r("workspace"), { data: o, loading: s } = i(a, {
|
|
30
|
+
client: n ?? void 0,
|
|
31
|
+
variables: { id: t },
|
|
32
|
+
skip: !t || !n,
|
|
33
|
+
fetchPolicy: "network-only"
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
workflow: s ? null : o?.workflowDefinition ?? null,
|
|
37
|
+
loading: s
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function c() {
|
|
41
|
+
let { productId: n } = e(), i = r("workspace");
|
|
42
|
+
return { createWorkflow: t(async (e) => {
|
|
43
|
+
if (!i) throw Error("Workspace gateway is unavailable");
|
|
44
|
+
return (await i.mutate({
|
|
45
|
+
mutation: o,
|
|
46
|
+
variables: { input: {
|
|
47
|
+
...e,
|
|
48
|
+
context: { productId: n || "botmanor" }
|
|
49
|
+
} }
|
|
50
|
+
})).data?.createWorkflowDefinition ?? null;
|
|
51
|
+
}, [i, n]) };
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { s as useBotWorkflowDefinition, c as useCreateBotWorkflow };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=useBotWorkflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBotWorkflow.js","names":[],"sources":["../../../src/botlit/hooks/useBotWorkflow.ts"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useCallback } from 'react';\nimport { useQuery } from '@apollo/client/react';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\ninterface BotWorkflowDefinition {\n id: string;\n workflowKey: string;\n version: string;\n name: string;\n status: string;\n}\n\nconst GET_WORKFLOW = gql`\n query BotWorkflowDefinition($id: ID!) {\n workflowDefinition(id: $id) {\n id\n workflowKey\n version\n name\n status\n }\n }\n`;\nconst CREATE_WORKFLOW = gql`\n mutation CreateBotWorkflow($input: CreateWorkflowDefinitionInput!) {\n createWorkflowDefinition(input: $input) {\n id\n workflowKey\n version\n name\n status\n }\n }\n`;\n\n/** Product-side binding does not initialize the shared builder's SDK singleton. */\nexport function useBotWorkflowDefinition(_key: undefined, id?: string) {\n const client = useGatewayClient('workspace');\n const { data, loading } = useQuery<{ workflowDefinition: BotWorkflowDefinition | null }>(\n GET_WORKFLOW,\n {\n client: client ?? undefined,\n variables: { id },\n skip: !id || !client,\n fetchPolicy: 'network-only',\n }\n );\n return { workflow: loading ? null : (data?.workflowDefinition ?? null), loading };\n}\n\nexport function useCreateBotWorkflow() {\n const { productId } = useBotlit();\n const client = useGatewayClient('workspace');\n const createWorkflow = useCallback(\n async (input: {\n workflowKey: string;\n version: string;\n name: string;\n description?: string;\n definitionJson: unknown;\n }) => {\n if (!client) throw new Error('Workspace gateway is unavailable');\n const result = await client.mutate<{ createWorkflowDefinition: BotWorkflowDefinition }>({\n mutation: CREATE_WORKFLOW,\n variables: { input: { ...input, context: { productId: productId || 'botmanor' } } },\n });\n return result.data?.createWorkflowDefinition ?? null;\n },\n [client, productId]\n );\n return { createWorkflow };\n}\n"],"mappings":";;;;;;AAcA,IAAM,IAAe,CAAG;;;;;;;;;;GAWlB,IAAkB,CAAG;;;;;;;;;;;AAa3B,SAAgB,EAAyB,GAAiB,GAAa;CACrE,IAAM,IAAS,EAAiB,YAAY,EACtC,EAAE,SAAM,eAAY,EACxB,GACA;EACE,QAAQ,KAAU,KAAA;EAClB,WAAW,EAAE,OAAI;EACjB,MAAM,CAAC,KAAM,CAAC;EACd,aAAa;EACd,CACF;AACD,QAAO;EAAE,UAAU,IAAU,OAAQ,GAAM,sBAAsB;EAAO;EAAS;;AAGnF,SAAgB,IAAuB;CACrC,IAAM,EAAE,iBAAc,GAAW,EAC3B,IAAS,EAAiB,YAAY;AAkB5C,QAAO,EAAE,gBAjBc,EACrB,OAAO,MAMD;AACJ,MAAI,CAAC,EAAQ,OAAU,MAAM,mCAAmC;AAKhE,UAJe,MAAM,EAAO,OAA4D;GACtF,UAAU;GACV,WAAW,EAAE,OAAO;IAAE,GAAG;IAAO,SAAS,EAAE,WAAW,KAAa,YAAY;IAAE,EAAE;GACpF,CAAC,EACY,MAAM,4BAA4B;IAElD,CAAC,GAAQ,EAAU,CACpB,EACwB"}
|
|
@@ -5,9 +5,9 @@ import { Card as r, CardContent as i, CardDescription as a, CardHeader as o, Car
|
|
|
5
5
|
import { Button as c } from "../components/Button.js";
|
|
6
6
|
import { Badge as l, StatusBadge as u } from "../components/Badge.js";
|
|
7
7
|
import { EmptyState as d } from "../components/EmptyState.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { useBotWorkflowDefinition as f, useCreateBotWorkflow as p } from "../hooks/useBotWorkflow.js";
|
|
9
|
+
import { useCallback as m, useState as h } from "react";
|
|
10
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
11
|
import { ExternalLink as v, Sparkles as y, Unlink as b, Workflow as x } from "lucide-react";
|
|
12
12
|
import { toast as S } from "sonner";
|
|
13
13
|
//#region src/botlit/pages/BotWorkflowTab.tsx
|
|
@@ -82,9 +82,9 @@ function j(e, t) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
var M = ({ botId: w, botName: T, workflowId: E, onWorkflowChanged: D }) => {
|
|
85
|
-
let O = e(), { navigateTo: k } = t(), { createWorkflow: M } =
|
|
85
|
+
let O = e(), { navigateTo: k } = t(), { createWorkflow: M } = p(), [N] = n(), [P, F] = h(!1), { workflow: I, loading: L } = f(void 0, E ?? void 0), R = m((e, t) => {
|
|
86
86
|
k(`workflows/workflow/${e}/${t || C}`);
|
|
87
|
-
}, [k]), z =
|
|
87
|
+
}, [k]), z = m(async () => {
|
|
88
88
|
F(!0);
|
|
89
89
|
try {
|
|
90
90
|
let e = A(), t = `${T} workflow`, n = await M({
|
|
@@ -113,7 +113,7 @@ var M = ({ botId: w, botName: T, workflowId: E, onWorkflowChanged: D }) => {
|
|
|
113
113
|
R,
|
|
114
114
|
O,
|
|
115
115
|
N
|
|
116
|
-
]), B =
|
|
116
|
+
]), B = m(async () => {
|
|
117
117
|
if (confirm(O("botlit.botDetail.workflow.unbindConfirm", "Unbind this workflow from the bot? The workflow itself is not deleted."))) {
|
|
118
118
|
F(!0);
|
|
119
119
|
try {
|
|
@@ -134,69 +134,69 @@ var M = ({ botId: w, botName: T, workflowId: E, onWorkflowChanged: D }) => {
|
|
|
134
134
|
O,
|
|
135
135
|
N
|
|
136
136
|
]);
|
|
137
|
-
return E ? /* @__PURE__ */
|
|
137
|
+
return E ? /* @__PURE__ */ g("div", {
|
|
138
138
|
className: "space-y-6",
|
|
139
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
|
|
140
140
|
className: "flex items-center gap-2",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
142
|
-
}), /* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ g(x, { size: 18 }), O("botlit.botDetail.workflow.bound.title", "Bound workflow")]
|
|
142
|
+
}), /* @__PURE__ */ g(a, { children: O("botlit.botDetail.workflow.bound.description", "This workflow defines what the bot does when it is invoked.") })] }), /* @__PURE__ */ _(i, {
|
|
143
143
|
className: "space-y-6",
|
|
144
|
-
children: [L ? /* @__PURE__ */
|
|
144
|
+
children: [L ? /* @__PURE__ */ g("div", { className: "h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer" }) : I ? /* @__PURE__ */ _("div", {
|
|
145
145
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
146
146
|
children: [
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
148
148
|
className: "text-sm text-text-secondary",
|
|
149
149
|
children: O("botlit.botDetail.workflow.fields.name", "Name")
|
|
150
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ g("p", {
|
|
151
151
|
className: "font-medium text-text-primary",
|
|
152
152
|
children: I.name
|
|
153
153
|
})] }),
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
155
155
|
className: "text-sm text-text-secondary",
|
|
156
156
|
children: O("botlit.botDetail.workflow.fields.key", "Key")
|
|
157
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ g("p", {
|
|
158
158
|
className: "mt-1 break-all font-mono text-sm text-text-primary",
|
|
159
159
|
children: I.workflowKey
|
|
160
160
|
})] }),
|
|
161
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
162
162
|
className: "text-sm text-text-secondary",
|
|
163
163
|
children: O("botlit.botDetail.workflow.fields.version", "Version")
|
|
164
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ g(l, {
|
|
165
165
|
variant: "outline",
|
|
166
166
|
className: "mt-1",
|
|
167
167
|
children: I.version
|
|
168
168
|
})] }),
|
|
169
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
170
170
|
className: "text-sm text-text-secondary",
|
|
171
171
|
children: O("botlit.botDetail.workflow.fields.status", "Status")
|
|
172
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ g("div", {
|
|
173
173
|
className: "mt-1",
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ g(u, { status: I.status })
|
|
175
175
|
})] })
|
|
176
176
|
]
|
|
177
|
-
}) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
177
|
+
}) : /* @__PURE__ */ _("div", { children: [
|
|
178
|
+
/* @__PURE__ */ g("p", {
|
|
179
179
|
className: "text-sm text-text-secondary",
|
|
180
180
|
children: O("botlit.botDetail.workflow.fields.workflowId", "Workflow ID")
|
|
181
181
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ g("p", {
|
|
183
183
|
className: "mt-1 break-all font-mono text-sm text-text-primary",
|
|
184
184
|
children: E
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ g("p", {
|
|
187
187
|
className: "mt-2 text-sm text-text-secondary",
|
|
188
188
|
children: O("botlit.botDetail.workflow.unresolved", "This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.")
|
|
189
189
|
})
|
|
190
|
-
] }), /* @__PURE__ */
|
|
190
|
+
] }), /* @__PURE__ */ _("div", {
|
|
191
191
|
className: "flex flex-wrap gap-2",
|
|
192
|
-
children: [I && /* @__PURE__ */
|
|
193
|
-
leftIcon: /* @__PURE__ */
|
|
192
|
+
children: [I && /* @__PURE__ */ g(c, {
|
|
193
|
+
leftIcon: /* @__PURE__ */ g(v, { size: 16 }),
|
|
194
194
|
disabled: P,
|
|
195
195
|
onClick: () => R(I.workflowKey, I.version),
|
|
196
196
|
children: O("botlit.botDetail.workflow.actions.openBuilder", "Open in builder")
|
|
197
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ g(c, {
|
|
198
198
|
variant: "outline",
|
|
199
|
-
leftIcon: /* @__PURE__ */
|
|
199
|
+
leftIcon: /* @__PURE__ */ g(b, { size: 16 }),
|
|
200
200
|
isLoading: P,
|
|
201
201
|
disabled: P,
|
|
202
202
|
onClick: () => void B(),
|
|
@@ -204,14 +204,14 @@ var M = ({ botId: w, botName: T, workflowId: E, onWorkflowChanged: D }) => {
|
|
|
204
204
|
})]
|
|
205
205
|
})]
|
|
206
206
|
})] })
|
|
207
|
-
}) : /* @__PURE__ */
|
|
207
|
+
}) : /* @__PURE__ */ g(r, { children: /* @__PURE__ */ g(i, {
|
|
208
208
|
className: "pt-6",
|
|
209
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ g(d, {
|
|
210
210
|
illustration: "empty-generic",
|
|
211
211
|
title: O("botlit.botDetail.workflow.empty.title", "Design this bot as a workflow"),
|
|
212
212
|
description: O("botlit.botDetail.workflow.empty.description", "A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you."),
|
|
213
|
-
action: /* @__PURE__ */
|
|
214
|
-
leftIcon: /* @__PURE__ */
|
|
213
|
+
action: /* @__PURE__ */ g(c, {
|
|
214
|
+
leftIcon: /* @__PURE__ */ g(y, { size: 16 }),
|
|
215
215
|
isLoading: P,
|
|
216
216
|
disabled: P,
|
|
217
217
|
onClick: () => void z(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotWorkflowTab.js","names":[],"sources":["../../../src/botlit/pages/BotWorkflowTab.tsx"],"sourcesContent":["/**\n * BotWorkflowTab\n * @module botlit/pages\n *\n * Shown inside BotDetailPage → \"Workflow\" tab.\n *\n * A bot's behaviour is designed as a FluidGrids workflow. `BotApp.workflowId`\n * holds the binding (validated server-side by `assertWorkflowBindingsResolvable`\n * on wspace-botlit-svc), and the FluidGrids builder is already mounted INSIDE\n * BotManor at `workflows/workflow/:id/:version` — so this tab never leaves the\n * product.\n *\n * Flow:\n * 1. Bound → resolve the definition by id (`useWorkflowDefinition`), show\n * name / key / version / status, \"Open in builder\", \"Unbind\".\n * A binding that no longer resolves falls back to the raw id so\n * the user can still clear it.\n * 2. Not bound → zero state whose primary action creates a seeded workflow\n * definition, binds it via `updateBotApp(workflowId)` and drops\n * the user straight into the embedded builder.\n *\n * IMPORTANT — seed graph shape. `BotlitFluidGridsBridge.extractTriggerNodeIds`\n * reads nodes from `definitionJson.data.nodes` (NOT the top level) and treats a\n * node as a trigger when its `type` is `trigger`/`trigger:*`/`*_trigger`, OR its\n * `kind[]` / `data.nodeData.kind[]` contains `trigger`. The seed below uses the\n * workflow service's own BUILTIN manual trigger (`internal:api`, \"Trigger\n * Manually\") — the node the executor resolves as the entry point — and carries\n * `kind: ['trigger', ...]` in both places, so a freshly designed bot is\n * immediately runnable instead of failing with `WORKFLOW_NO_TRIGGER_NODE`.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useState } from 'react';\nimport { ExternalLink, Sparkles, Unlink, Workflow } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { useCreateWorkflow, useWorkflowDefinition } from '@burdenoff/fluidgrids-fe-sdk';\nimport { Card, CardHeader, CardTitle, CardContent, CardDescription } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge, StatusBadge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { useUpdateBot } from '../hooks/useBots';\nimport { useBotlit } from '../providers/BotlitProvider';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Seed graph\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** First version minted for a bot's workflow — matches the builder's own default. */\nconst INITIAL_VERSION = 'v1';\n\n/**\n * BUILTIN \"Trigger Manually\" node (`MANUAL_TRIGGER_MANIFEST` in\n * wspace-workflow-svc). The executor resolves this type as a workflow's entry\n * node, and the builder renders it from the seeded node registry.\n */\nconst MANUAL_TRIGGER_NODE_TYPE = 'internal:api';\nconst MANUAL_TRIGGER_NODE_VERSION = '1.0.0';\nconst MANUAL_TRIGGER_OPERATION = 'onManualTrigger';\nconst MANUAL_TRIGGER_NAME = 'Trigger Manually';\nconst MANUAL_TRIGGER_DESCRIPTION =\n \"Runs the flow when you click 'Test workflow', or when this bot is invoked.\";\n\n/** `kind[]` the BotManor bridge scans for when classifying a node as a trigger. */\nconst MANUAL_TRIGGER_KIND = ['trigger', 'manual', 'entry'];\n\n/** Node shape written into `definitionJson.data.nodes`. */\ntype SeedNode = {\n id: string;\n type: string;\n position: { x: number; y: number };\n /** Top-level kind — the bridge's second trigger-detection path. */\n kind: string[];\n data: {\n operation_name: string;\n operation_type: string;\n version: string;\n nodeData: {\n nodeType: string;\n name: string;\n description: string;\n version: string;\n /** The bridge's third trigger-detection path. */\n kind: string[];\n operations: { name: string; type: string; role: string; description: string }[];\n };\n args: {\n context: { node: { id: string; type: string; kind: string[] } };\n state: Record<string, never>;\n credentials: never[];\n };\n };\n};\n\n/**\n * `definitionJson` document. Mirrors what the builder itself persists\n * (`useSaveWorkflow`) so the graph round-trips through the builder unchanged.\n */\ntype SeedDefinition = {\n key: string;\n name: string;\n description: string;\n workflow_type: string;\n data: {\n id: string;\n workflowKey: string;\n version: string;\n name: string;\n nodes: SeedNode[];\n edges: never[];\n sidebar: { active: string; panels: { nodeProperties: { selectedNode: null } } };\n stickyNotes: never[];\n };\n meta: { creator: string; version: string };\n tags: string[];\n};\n\n/**\n * Generate an opaque id. `crypto.randomUUID` is unavailable on insecure origins\n * and in some test environments, so fall back to a time+random token rather than\n * throwing mid-create.\n */\nfunction generateId(): string {\n const webCrypto = globalThis.crypto as Crypto | undefined;\n if (webCrypto && typeof webCrypto.randomUUID === 'function') {\n return webCrypto.randomUUID();\n }\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\n/** Build the starter graph: one manual trigger, nothing else. */\nfunction buildSeedDefinition(workflowKey: string, name: string): SeedDefinition {\n const triggerNode: SeedNode = {\n id: generateId(),\n type: MANUAL_TRIGGER_NODE_TYPE,\n position: { x: 160, y: 160 },\n kind: MANUAL_TRIGGER_KIND,\n data: {\n operation_name: MANUAL_TRIGGER_OPERATION,\n operation_type: 'trigger',\n version: MANUAL_TRIGGER_NODE_VERSION,\n nodeData: {\n nodeType: MANUAL_TRIGGER_NODE_TYPE,\n name: MANUAL_TRIGGER_NAME,\n description: MANUAL_TRIGGER_DESCRIPTION,\n version: MANUAL_TRIGGER_NODE_VERSION,\n kind: MANUAL_TRIGGER_KIND,\n operations: [\n {\n name: MANUAL_TRIGGER_OPERATION,\n type: 'trigger',\n role: 'trigger',\n description: MANUAL_TRIGGER_DESCRIPTION,\n },\n ],\n },\n args: {\n context: {\n node: {\n id: MANUAL_TRIGGER_NODE_TYPE,\n type: MANUAL_TRIGGER_NODE_TYPE,\n kind: MANUAL_TRIGGER_KIND,\n },\n },\n state: {},\n credentials: [],\n },\n },\n };\n\n return {\n key: workflowKey,\n name,\n description: name,\n workflow_type: 'query-conditional',\n data: {\n id: workflowKey,\n workflowKey,\n version: INITIAL_VERSION,\n name,\n nodes: [triggerNode],\n edges: [],\n sidebar: { active: 'store-browse', panels: { nodeProperties: { selectedNode: null } } },\n stickyNotes: [],\n },\n meta: { creator: 'botlit_bot_design', version: INITIAL_VERSION },\n tags: [],\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Component\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface BotWorkflowTabProps {\n botId: string;\n botName: string;\n /** `BotApp.workflowId` — the bound workflow definition id, if any. */\n workflowId: string | null | undefined;\n /** Refetch the bot so the tab reflects the new binding. */\n onWorkflowChanged: () => Promise<void> | void;\n}\n\nexport const BotWorkflowTab: FC<BotWorkflowTabProps> = ({\n botId,\n botName,\n workflowId,\n onWorkflowChanged,\n}) => {\n const t = useTr();\n const { navigateTo } = useBotlit();\n const { createWorkflow } = useCreateWorkflow();\n const [updateBot] = useUpdateBot();\n const [busy, setBusy] = useState(false);\n\n // Resolve by id — `BotApp.workflowId` stores the definition's opaque id, not\n // its workflowKey (which is what the builder route takes). The hook refetches\n // on its own when the bound id changes, so binding/unbinding only has to\n // refresh the bot.\n const { workflow, loading: workflowLoading } = useWorkflowDefinition(\n undefined,\n workflowId ?? undefined\n );\n\n const openBuilder = useCallback(\n (workflowKey: string, version: string) => {\n navigateTo(`workflows/workflow/${workflowKey}/${version || INITIAL_VERSION}`);\n },\n [navigateTo]\n );\n\n const handleDesign = useCallback(async () => {\n setBusy(true);\n try {\n const workflowKey = generateId();\n const name = `${botName} workflow`;\n const created = await createWorkflow({\n workflowKey,\n version: INITIAL_VERSION,\n name,\n description: t(\n 'botlit.botDetail.workflow.createdDescription',\n 'Behaviour designed for this BotManor bot.'\n ),\n definitionJson: buildSeedDefinition(workflowKey, name),\n });\n\n if (!created) {\n throw new Error(\n t('botlit.botDetail.workflow.createError', 'Failed to create the workflow')\n );\n }\n\n await updateBot({ botId, input: { workflowId: created.id } });\n await onWorkflowChanged();\n toast.success(\n t('botlit.botDetail.workflow.createSuccess', 'Workflow created and bound to this bot')\n );\n openBuilder(created.workflowKey, created.version);\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.createError', 'Failed to create the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, botName, createWorkflow, onWorkflowChanged, openBuilder, t, updateBot]);\n\n const handleUnbind = useCallback(async () => {\n if (\n !confirm(\n t(\n 'botlit.botDetail.workflow.unbindConfirm',\n 'Unbind this workflow from the bot? The workflow itself is not deleted.'\n )\n )\n ) {\n return;\n }\n setBusy(true);\n try {\n await updateBot({ botId, input: { workflowId: null } });\n await onWorkflowChanged();\n toast.success(t('botlit.botDetail.workflow.unbindSuccess', 'Workflow unbound'));\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.unbindError', 'Failed to unbind the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, onWorkflowChanged, t, updateBot]);\n\n // ── Not bound ─────────────────────────────────────────────────────────────\n if (!workflowId) {\n return (\n <Card>\n <CardContent className=\"pt-6\">\n <EmptyState\n illustration=\"empty-generic\"\n title={t('botlit.botDetail.workflow.empty.title', 'Design this bot as a workflow')}\n description={t(\n 'botlit.botDetail.workflow.empty.description',\n \"A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you.\"\n )}\n action={\n <Button\n leftIcon={<Sparkles size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleDesign()}\n >\n {t('botlit.botDetail.workflow.empty.action', 'Design in workflow builder')}\n </Button>\n }\n />\n </CardContent>\n </Card>\n );\n }\n\n // ── Bound ─────────────────────────────────────────────────────────────────\n return (\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Workflow size={18} />\n {t('botlit.botDetail.workflow.bound.title', 'Bound workflow')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.botDetail.workflow.bound.description',\n 'This workflow defines what the bot does when it is invoked.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-6\">\n {workflowLoading ? (\n <div className=\"h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer\" />\n ) : workflow ? (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.name', 'Name')}\n </p>\n <p className=\"font-medium text-text-primary\">{workflow.name}</p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.key', 'Key')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">\n {workflow.workflowKey}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.version', 'Version')}\n </p>\n <Badge variant=\"outline\" className=\"mt-1\">\n {workflow.version}\n </Badge>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.status', 'Status')}\n </p>\n <div className=\"mt-1\">\n <StatusBadge status={workflow.status} />\n </div>\n </div>\n </div>\n ) : (\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.workflowId', 'Workflow ID')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">{workflowId}</p>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {t(\n 'botlit.botDetail.workflow.unresolved',\n 'This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.'\n )}\n </p>\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {workflow && (\n <Button\n leftIcon={<ExternalLink size={16} />}\n disabled={busy}\n onClick={() => openBuilder(workflow.workflowKey, workflow.version)}\n >\n {t('botlit.botDetail.workflow.actions.openBuilder', 'Open in builder')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n leftIcon={<Unlink size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleUnbind()}\n >\n {t('botlit.botDetail.workflow.actions.unbind', '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,EAAa,QAAQ,EAAS,QAAU,CAAA;MACpC,CAAA,CACF,EAAA,CAAA;KACF;QAEN,kBAAC,OAAD,EAAA,UAAA;IACE,kBAAC,KAAD;KAAG,WAAU;eACV,EAAE,+CAA+C,cAAc;KAC9D,CAAA;IACJ,kBAAC,KAAD;KAAG,WAAU;eAAsD;KAAe,CAAA;IAClF,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,wCACA,gGACD;KACC,CAAA;IACA,EAAA,CAAA,EAGR,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KACC,kBAAC,GAAD;KACE,UAAU,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;KACpC,UAAU;KACV,eAAe,EAAY,EAAS,aAAa,EAAS,QAAQ;eAEjE,EAAE,iDAAiD,kBAAkB;KAC/D,CAAA,EAEX,kBAAC,GAAD;KACE,SAAQ;KACR,UAAU,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;KAC9B,WAAW;KACX,UAAU;KACV,eAAe,KAAK,GAAc;eAEjC,EAAE,4CAA4C,SAAS;KACjD,CAAA,CACL;MACM;KACT,EAAA,CAAA;EACH,CAAA,GAlHJ,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAa,WAAU;YACrB,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,yCAAyC,gCAAgC;GAClF,aAAa,EACX,+CACA,gOACD;GACD,QACE,kBAAC,GAAD;IACE,UAAU,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAChC,WAAW;IACX,UAAU;IACV,eAAe,KAAK,GAAc;cAEjC,EAAE,0CAA0C,6BAA6B;IACnE,CAAA;GAEX,CAAA;EACU,CAAA,EACT,CAAA"}
|
|
1
|
+
{"version":3,"file":"BotWorkflowTab.js","names":[],"sources":["../../../src/botlit/pages/BotWorkflowTab.tsx"],"sourcesContent":["/**\n * BotWorkflowTab\n * @module botlit/pages\n *\n * Shown inside BotDetailPage → \"Workflow\" tab.\n *\n * A bot's behaviour is designed as a FluidGrids workflow. `BotApp.workflowId`\n * holds the binding (validated server-side by `assertWorkflowBindingsResolvable`\n * on wspace-botlit-svc), and the FluidGrids builder is already mounted INSIDE\n * BotManor at `workflows/workflow/:id/:version` — so this tab never leaves the\n * product.\n *\n * Flow:\n * 1. Bound → resolve the definition by id (`useWorkflowDefinition`), show\n * name / key / version / status, \"Open in builder\", \"Unbind\".\n * A binding that no longer resolves falls back to the raw id so\n * the user can still clear it.\n * 2. Not bound → zero state whose primary action creates a seeded workflow\n * definition, binds it via `updateBotApp(workflowId)` and drops\n * the user straight into the embedded builder.\n *\n * IMPORTANT — seed graph shape. `BotlitFluidGridsBridge.extractTriggerNodeIds`\n * reads nodes from `definitionJson.data.nodes` (NOT the top level) and treats a\n * node as a trigger when its `type` is `trigger`/`trigger:*`/`*_trigger`, OR its\n * `kind[]` / `data.nodeData.kind[]` contains `trigger`. The seed below uses the\n * workflow service's own BUILTIN manual trigger (`internal:api`, \"Trigger\n * Manually\") — the node the executor resolves as the entry point — and carries\n * `kind: ['trigger', ...]` in both places, so a freshly designed bot is\n * immediately runnable instead of failing with `WORKFLOW_NO_TRIGGER_NODE`.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useState } from 'react';\nimport { ExternalLink, Sparkles, Unlink, Workflow } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n useCreateBotWorkflow as useCreateWorkflow,\n useBotWorkflowDefinition as useWorkflowDefinition,\n} from '../hooks/useBotWorkflow';\nimport { Card, CardHeader, CardTitle, CardContent, CardDescription } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge, StatusBadge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { useUpdateBot } from '../hooks/useBots';\nimport { useBotlit } from '../providers/BotlitProvider';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Seed graph\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** First version minted for a bot's workflow — matches the builder's own default. */\nconst INITIAL_VERSION = 'v1';\n\n/**\n * BUILTIN \"Trigger Manually\" node (`MANUAL_TRIGGER_MANIFEST` in\n * wspace-workflow-svc). The executor resolves this type as a workflow's entry\n * node, and the builder renders it from the seeded node registry.\n */\nconst MANUAL_TRIGGER_NODE_TYPE = 'internal:api';\nconst MANUAL_TRIGGER_NODE_VERSION = '1.0.0';\nconst MANUAL_TRIGGER_OPERATION = 'onManualTrigger';\nconst MANUAL_TRIGGER_NAME = 'Trigger Manually';\nconst MANUAL_TRIGGER_DESCRIPTION =\n \"Runs the flow when you click 'Test workflow', or when this bot is invoked.\";\n\n/** `kind[]` the BotManor bridge scans for when classifying a node as a trigger. */\nconst MANUAL_TRIGGER_KIND = ['trigger', 'manual', 'entry'];\n\n/** Node shape written into `definitionJson.data.nodes`. */\ntype SeedNode = {\n id: string;\n type: string;\n position: { x: number; y: number };\n /** Top-level kind — the bridge's second trigger-detection path. */\n kind: string[];\n data: {\n operation_name: string;\n operation_type: string;\n version: string;\n nodeData: {\n nodeType: string;\n name: string;\n description: string;\n version: string;\n /** The bridge's third trigger-detection path. */\n kind: string[];\n operations: { name: string; type: string; role: string; description: string }[];\n };\n args: {\n context: { node: { id: string; type: string; kind: string[] } };\n state: Record<string, never>;\n credentials: never[];\n };\n };\n};\n\n/**\n * `definitionJson` document. Mirrors what the builder itself persists\n * (`useSaveWorkflow`) so the graph round-trips through the builder unchanged.\n */\ntype SeedDefinition = {\n key: string;\n name: string;\n description: string;\n workflow_type: string;\n data: {\n id: string;\n workflowKey: string;\n version: string;\n name: string;\n nodes: SeedNode[];\n edges: never[];\n sidebar: { active: string; panels: { nodeProperties: { selectedNode: null } } };\n stickyNotes: never[];\n };\n meta: { creator: string; version: string };\n tags: string[];\n};\n\n/**\n * Generate an opaque id. `crypto.randomUUID` is unavailable on insecure origins\n * and in some test environments, so fall back to a time+random token rather than\n * throwing mid-create.\n */\nfunction generateId(): string {\n const webCrypto = globalThis.crypto as Crypto | undefined;\n if (webCrypto && typeof webCrypto.randomUUID === 'function') {\n return webCrypto.randomUUID();\n }\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\n/** Build the starter graph: one manual trigger, nothing else. */\nfunction buildSeedDefinition(workflowKey: string, name: string): SeedDefinition {\n const triggerNode: SeedNode = {\n id: generateId(),\n type: MANUAL_TRIGGER_NODE_TYPE,\n position: { x: 160, y: 160 },\n kind: MANUAL_TRIGGER_KIND,\n data: {\n operation_name: MANUAL_TRIGGER_OPERATION,\n operation_type: 'trigger',\n version: MANUAL_TRIGGER_NODE_VERSION,\n nodeData: {\n nodeType: MANUAL_TRIGGER_NODE_TYPE,\n name: MANUAL_TRIGGER_NAME,\n description: MANUAL_TRIGGER_DESCRIPTION,\n version: MANUAL_TRIGGER_NODE_VERSION,\n kind: MANUAL_TRIGGER_KIND,\n operations: [\n {\n name: MANUAL_TRIGGER_OPERATION,\n type: 'trigger',\n role: 'trigger',\n description: MANUAL_TRIGGER_DESCRIPTION,\n },\n ],\n },\n args: {\n context: {\n node: {\n id: MANUAL_TRIGGER_NODE_TYPE,\n type: MANUAL_TRIGGER_NODE_TYPE,\n kind: MANUAL_TRIGGER_KIND,\n },\n },\n state: {},\n credentials: [],\n },\n },\n };\n\n return {\n key: workflowKey,\n name,\n description: name,\n workflow_type: 'query-conditional',\n data: {\n id: workflowKey,\n workflowKey,\n version: INITIAL_VERSION,\n name,\n nodes: [triggerNode],\n edges: [],\n sidebar: { active: 'store-browse', panels: { nodeProperties: { selectedNode: null } } },\n stickyNotes: [],\n },\n meta: { creator: 'botlit_bot_design', version: INITIAL_VERSION },\n tags: [],\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Component\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface BotWorkflowTabProps {\n botId: string;\n botName: string;\n /** `BotApp.workflowId` — the bound workflow definition id, if any. */\n workflowId: string | null | undefined;\n /** Refetch the bot so the tab reflects the new binding. */\n onWorkflowChanged: () => Promise<void> | void;\n}\n\nexport const BotWorkflowTab: FC<BotWorkflowTabProps> = ({\n botId,\n botName,\n workflowId,\n onWorkflowChanged,\n}) => {\n const t = useTr();\n const { navigateTo } = useBotlit();\n const { createWorkflow } = useCreateWorkflow();\n const [updateBot] = useUpdateBot();\n const [busy, setBusy] = useState(false);\n\n // Resolve by id — `BotApp.workflowId` stores the definition's opaque id, not\n // its workflowKey (which is what the builder route takes). The hook refetches\n // on its own when the bound id changes, so binding/unbinding only has to\n // refresh the bot.\n const { workflow, loading: workflowLoading } = useWorkflowDefinition(\n undefined,\n workflowId ?? undefined\n );\n\n const openBuilder = useCallback(\n (workflowKey: string, version: string) => {\n navigateTo(`workflows/workflow/${workflowKey}/${version || INITIAL_VERSION}`);\n },\n [navigateTo]\n );\n\n const handleDesign = useCallback(async () => {\n setBusy(true);\n try {\n const workflowKey = generateId();\n const name = `${botName} workflow`;\n const created = await createWorkflow({\n workflowKey,\n version: INITIAL_VERSION,\n name,\n description: t(\n 'botlit.botDetail.workflow.createdDescription',\n 'Behaviour designed for this BotManor bot.'\n ),\n definitionJson: buildSeedDefinition(workflowKey, name),\n });\n\n if (!created) {\n throw new Error(\n t('botlit.botDetail.workflow.createError', 'Failed to create the workflow')\n );\n }\n\n await updateBot({ botId, input: { workflowId: created.id } });\n await onWorkflowChanged();\n toast.success(\n t('botlit.botDetail.workflow.createSuccess', 'Workflow created and bound to this bot')\n );\n openBuilder(created.workflowKey, created.version);\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.createError', 'Failed to create the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, botName, createWorkflow, onWorkflowChanged, openBuilder, t, updateBot]);\n\n const handleUnbind = useCallback(async () => {\n if (\n !confirm(\n t(\n 'botlit.botDetail.workflow.unbindConfirm',\n 'Unbind this workflow from the bot? The workflow itself is not deleted.'\n )\n )\n ) {\n return;\n }\n setBusy(true);\n try {\n await updateBot({ botId, input: { workflowId: null } });\n await onWorkflowChanged();\n toast.success(t('botlit.botDetail.workflow.unbindSuccess', 'Workflow unbound'));\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.unbindError', 'Failed to unbind the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, onWorkflowChanged, t, updateBot]);\n\n // ── Not bound ─────────────────────────────────────────────────────────────\n if (!workflowId) {\n return (\n <Card>\n <CardContent className=\"pt-6\">\n <EmptyState\n illustration=\"empty-generic\"\n title={t('botlit.botDetail.workflow.empty.title', 'Design this bot as a workflow')}\n description={t(\n 'botlit.botDetail.workflow.empty.description',\n \"A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you.\"\n )}\n action={\n <Button\n leftIcon={<Sparkles size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleDesign()}\n >\n {t('botlit.botDetail.workflow.empty.action', 'Design in workflow builder')}\n </Button>\n }\n />\n </CardContent>\n </Card>\n );\n }\n\n // ── Bound ─────────────────────────────────────────────────────────────────\n return (\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Workflow size={18} />\n {t('botlit.botDetail.workflow.bound.title', 'Bound workflow')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.botDetail.workflow.bound.description',\n 'This workflow defines what the bot does when it is invoked.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-6\">\n {workflowLoading ? (\n <div className=\"h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer\" />\n ) : workflow ? (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.name', 'Name')}\n </p>\n <p className=\"font-medium text-text-primary\">{workflow.name}</p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.key', 'Key')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">\n {workflow.workflowKey}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.version', 'Version')}\n </p>\n <Badge variant=\"outline\" className=\"mt-1\">\n {workflow.version}\n </Badge>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.status', 'Status')}\n </p>\n <div className=\"mt-1\">\n <StatusBadge status={workflow.status} />\n </div>\n </div>\n </div>\n ) : (\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.workflowId', 'Workflow ID')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">{workflowId}</p>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {t(\n 'botlit.botDetail.workflow.unresolved',\n 'This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.'\n )}\n </p>\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {workflow && (\n <Button\n leftIcon={<ExternalLink size={16} />}\n disabled={busy}\n onClick={() => openBuilder(workflow.workflowKey, workflow.version)}\n >\n {t('botlit.botDetail.workflow.actions.openBuilder', 'Open in builder')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n leftIcon={<Unlink size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleUnbind()}\n >\n {t('botlit.botDetail.workflow.actions.unbind', 'Unbind')}\n </Button>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAoDA,IAAM,IAAkB,MAOlB,IAA2B,gBAC3B,IAA8B,SAC9B,IAA2B,mBAC3B,IAAsB,oBACtB,IACJ,8EAGI,IAAsB;CAAC;CAAW;CAAU;CAAQ;AA0D1D,SAAS,IAAqB;CAC5B,IAAM,IAAY,WAAW;AAI7B,QAHI,KAAa,OAAO,EAAU,cAAe,aACxC,EAAU,YAAY,GAExB,G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AK,WAAU;cAAf,CACG,KACC,kBAAC,GAAD;KACE,UAAU,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;KACpC,UAAU;KACV,eAAe,EAAY,EAAS,aAAa,EAAS,QAAQ;eAEjE,EAAE,iDAAiD,kBAAkB;KAC/D,CAAA,EAEX,kBAAC,GAAD;KACE,SAAQ;KACR,UAAU,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;KAC9B,WAAW;KACX,UAAU;KACV,eAAe,KAAK,GAAc;eAEjC,EAAE,4CAA4C,SAAS;KACjD,CAAA,CACL;MACM;KACT,EAAA,CAAA;EACH,CAAA,GAlHJ,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAa,WAAU;YACrB,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,yCAAyC,gCAAgC;GAClF,aAAa,EACX,+CACA,gOACD;GACD,QACE,kBAAC,GAAD;IACE,UAAU,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAChC,WAAW;IACX,UAAU;IACV,eAAe,KAAK,GAAc;cAEjC,EAAE,0CAA0C,6BAA6B;IACnE,CAAA;GAEX,CAAA;EACU,CAAA,EACT,CAAA"}
|
|
@@ -9,24 +9,25 @@ function l() {
|
|
|
9
9
|
if (!e) throw Error("useBotlit must be used within a BotlitProvider");
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f,
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
basePath:
|
|
12
|
+
var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f, productId: p, onBotSelect: m, onAgentSelect: h }) => {
|
|
13
|
+
let g = s(), _ = r || "/", v = n((t) => e(_, t), [_]), y = n((t) => {
|
|
14
|
+
g(e(_, t));
|
|
15
|
+
}, [_, g]), b = i(() => ({
|
|
16
|
+
basePath: _,
|
|
17
17
|
navigate: void 0,
|
|
18
18
|
currentUser: o,
|
|
19
19
|
tenantId: l,
|
|
20
20
|
workspaceId: u,
|
|
21
21
|
apiGatewayUrl: d,
|
|
22
22
|
authToken: f,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
productId: p,
|
|
24
|
+
onBotSelect: m,
|
|
25
|
+
onAgentSelect: h,
|
|
25
26
|
isStandalone: !0,
|
|
26
|
-
navigateTo:
|
|
27
|
-
getPath:
|
|
27
|
+
navigateTo: y,
|
|
28
|
+
getPath: v
|
|
28
29
|
}), [
|
|
29
|
-
|
|
30
|
+
_,
|
|
30
31
|
o,
|
|
31
32
|
l,
|
|
32
33
|
u,
|
|
@@ -34,31 +35,33 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u
|
|
|
34
35
|
f,
|
|
35
36
|
p,
|
|
36
37
|
m,
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
h,
|
|
39
|
+
y,
|
|
40
|
+
v
|
|
39
41
|
]);
|
|
40
42
|
return /* @__PURE__ */ a(c.Provider, {
|
|
41
|
-
value:
|
|
43
|
+
value: b,
|
|
42
44
|
children: t
|
|
43
45
|
});
|
|
44
|
-
}, d = ({ children: t, basePath: r, navigate: o, currentUser: s, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f,
|
|
45
|
-
let
|
|
46
|
-
o(e(
|
|
47
|
-
}, [
|
|
48
|
-
basePath:
|
|
46
|
+
}, d = ({ children: t, basePath: r, navigate: o, currentUser: s, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f, productId: p, onBotSelect: m, onAgentSelect: h }) => {
|
|
47
|
+
let g = r || "/", _ = n((t) => e(g, t), [g]), v = n((t) => {
|
|
48
|
+
o(e(g, t));
|
|
49
|
+
}, [g, o]), y = i(() => ({
|
|
50
|
+
basePath: g,
|
|
49
51
|
navigate: o,
|
|
50
52
|
currentUser: s,
|
|
51
53
|
tenantId: l,
|
|
52
54
|
workspaceId: u,
|
|
53
55
|
apiGatewayUrl: d,
|
|
54
56
|
authToken: f,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
productId: p,
|
|
58
|
+
onBotSelect: m,
|
|
59
|
+
onAgentSelect: h,
|
|
57
60
|
isStandalone: !1,
|
|
58
|
-
navigateTo:
|
|
59
|
-
getPath:
|
|
61
|
+
navigateTo: v,
|
|
62
|
+
getPath: _
|
|
60
63
|
}), [
|
|
61
|
-
|
|
64
|
+
g,
|
|
62
65
|
o,
|
|
63
66
|
s,
|
|
64
67
|
l,
|
|
@@ -67,11 +70,12 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, workspaceId: u
|
|
|
67
70
|
f,
|
|
68
71
|
p,
|
|
69
72
|
m,
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
h,
|
|
74
|
+
v,
|
|
75
|
+
_
|
|
72
76
|
]);
|
|
73
77
|
return /* @__PURE__ */ a(c.Provider, {
|
|
74
|
-
value:
|
|
78
|
+
value: y,
|
|
75
79
|
children: t
|
|
76
80
|
});
|
|
77
81
|
}, f = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotlitProvider.js","names":[],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAgB,EAAyC,KAAK;AAMpE,SAAgB,IAAgC;CAC9C,IAAM,IAAU,EAAW,EAAc;AACzC,KAAI,CAAC,EACH,OAAU,MAAM,iDAAiD;AAEnE,QAAO;;AAYT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,gBACA,uBACI;CAEJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CAClC;IAE1B,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;EAAe;EAAkC,CAAA;GAInF,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,gBACA,uBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CACxC;IAEpB,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;EAAe;EAAkC,CAAA;GAG5E,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,gBAAa;AAiB/B,QAdsB,IAepB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAZxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
|
|
1
|
+
{"version":3,"file":"BotlitProvider.js","names":[],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAgB,EAAyC,KAAK;AAMpE,SAAgB,IAAgC;CAC9C,IAAM,IAAU,EAAW,EAAc;AACzC,KAAI,CAAC,EACH,OAAU,MAAM,iDAAiD;AAEnE,QAAO;;AAYT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CAEJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CAClC;IAE1B,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;EAAe;EAAkC,CAAA;GAInF,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CACxC;IAEpB,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;EAAe;EAAkC,CAAA;GAG5E,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,gBAAa;AAiB/B,QAdsB,IAepB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAZxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-botmanor",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1008.1",
|
|
4
4
|
"description": "Burdenoff BotManor Microfrontend - AI Agent platform interface for building, deploying and managing AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"zustand": "^5.0.7"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@burdenoff/fluidgrids-fe-sdk": "2026.724.2",
|
|
61
60
|
"@eslint/js": "^10.0.1",
|
|
62
61
|
"@graphql-codegen/add": "^5.0.0",
|
|
63
62
|
"@graphql-codegen/cli": "^5.0.0",
|
|
@@ -98,7 +97,6 @@
|
|
|
98
97
|
"peerDependencies": {
|
|
99
98
|
"@apollo/client": "^4.0.11",
|
|
100
99
|
"@burdenoff/fe-libs": "2026.1006.1",
|
|
101
|
-
"@burdenoff/fluidgrids-fe-sdk": "2026.724.2",
|
|
102
100
|
"@tanstack/react-query": "^5.90.16",
|
|
103
101
|
"clsx": "^2.1.1",
|
|
104
102
|
"graphql": "^16.12.0",
|