@burdenoff/microfe-botmanor 2026.1202.1 → 2026.1203.2
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/hooks/useAgents.d.ts +5 -0
- package/dist/botlit/hooks/useAgents.js +8 -0
- package/dist/botlit/hooks/useAgents.js.map +1 -1
- package/dist/botlit/pages/AgentBuilderPage.js +508 -460
- package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
- package/dist/botlit/pages/BotWorkflowTab.js +74 -65
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
- package/dist/botlit/utils/agentSettings.d.ts +4 -1
- package/dist/botlit/utils/agentSettings.js +30 -28
- package/dist/botlit/utils/agentSettings.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +12 -0
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +3 -3
|
@@ -9,29 +9,29 @@ import { AgentFallbackModelsPicker as d } from "../components/AgentFallbackModel
|
|
|
9
9
|
import { BOTMANOR_PERMISSIONS as f } from "../permissions/botmanorPermissions.js";
|
|
10
10
|
import { useBotmanorCan as ee } from "../permissions/useBotmanorPermissions.js";
|
|
11
11
|
import { ErrorState as p } from "../components/ErrorState.js";
|
|
12
|
-
import { FormField as m, Input as h, Textarea as
|
|
13
|
-
import { useAgent as
|
|
14
|
-
import { useBot as
|
|
15
|
-
import { useLinkAgentToBot as
|
|
16
|
-
import { CreateFromTemplate as
|
|
17
|
-
import { DescribeBotDialog as
|
|
18
|
-
import { useKnowledgeBases as
|
|
19
|
-
import { useLLMModels as
|
|
20
|
-
import { useMCPServers as
|
|
21
|
-
import { AGENT_DEFAULTS as
|
|
12
|
+
import { FormField as m, Input as h, Textarea as g } from "../components/Input.js";
|
|
13
|
+
import { useAgent as _, useCreateAgent as te, useUpdateAgent as ne } from "../hooks/useAgents.js";
|
|
14
|
+
import { useBot as re, useUpdateBot as ie } from "../hooks/useBots.js";
|
|
15
|
+
import { useLinkAgentToBot as ae } from "../hooks/useBotAgents.js";
|
|
16
|
+
import { CreateFromTemplate as oe } from "../components/CreateFromTemplate.js";
|
|
17
|
+
import { DescribeBotDialog as se } from "../components/DescribeBotDialog.js";
|
|
18
|
+
import { useKnowledgeBases as ce } from "../hooks/useKnowledgeBases.js";
|
|
19
|
+
import { useLLMModels as le, useLLMProviders as ue } from "../hooks/useLLMProviders.js";
|
|
20
|
+
import { useMCPServers as de } from "../hooks/useMCPServers.js";
|
|
21
|
+
import { AGENT_DEFAULTS as v, AGENT_FIELD_MESSAGES as fe, AGENT_FIELD_TAB as pe, AGENT_MAX_CONCURRENT_RANGE as y, AGENT_MAX_TOKENS_RANGE as b, AGENT_TEMPERATURE_RANGE as x, OFFERED_CAPABILITIES as me, agentSlugFor as he, capabilityWarnings as ge, parseNumberField as S, validateAgentForm as _e } from "../utils/agentSettings.js";
|
|
22
22
|
import "../permissions/index.js";
|
|
23
|
-
import { cn as
|
|
24
|
-
import { configuredAnswerModels as
|
|
25
|
-
import { slugify as
|
|
26
|
-
import { toUnion as
|
|
27
|
-
import { useMemo as
|
|
28
|
-
import { PagePurpose as
|
|
29
|
-
import { jsx as
|
|
30
|
-
import { useParams as
|
|
31
|
-
import { AlertTriangle as
|
|
32
|
-
import { toast as
|
|
23
|
+
import { cn as ve } from "../utils/cn.js";
|
|
24
|
+
import { configuredAnswerModels as ye } from "../utils/embedding-models.js";
|
|
25
|
+
import { slugify as be } from "../utils/botIdentity.js";
|
|
26
|
+
import { toUnion as C } from "../utils/unions.js";
|
|
27
|
+
import { useMemo as xe, useRef as Se, useState as w } from "react";
|
|
28
|
+
import { PagePurpose as Ce, ThemedSelect as we } from "@burdenoff/fe-libs/ui";
|
|
29
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
30
|
+
import { useParams as D } from "react-router";
|
|
31
|
+
import { AlertTriangle as O, ArrowLeft as Te, Brain as Ee, Save as De, Settings as Oe, Sparkles as ke, Wrench as Ae } from "lucide-react";
|
|
32
|
+
import { toast as k } from "sonner";
|
|
33
33
|
// src/botlit/pages/AgentBuilderPage.tsx
|
|
34
|
-
var
|
|
34
|
+
var A = [
|
|
35
35
|
"MCP_TOOLS",
|
|
36
36
|
"RAG",
|
|
37
37
|
"REASONING",
|
|
@@ -40,19 +40,19 @@ var k = [
|
|
|
40
40
|
"CODE_EXECUTION",
|
|
41
41
|
"A2A",
|
|
42
42
|
"WEB_BROWSING"
|
|
43
|
-
],
|
|
43
|
+
], je = [
|
|
44
44
|
"ASSISTANT",
|
|
45
45
|
"ANALYST",
|
|
46
46
|
"AUTOMATION",
|
|
47
47
|
"SPECIALIST"
|
|
48
48
|
];
|
|
49
|
-
function
|
|
49
|
+
function Me(e) {
|
|
50
50
|
return e.flatMap((e) => {
|
|
51
|
-
let t =
|
|
51
|
+
let t = A.find((t) => t === e);
|
|
52
52
|
return t ? [t] : [];
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
var
|
|
55
|
+
var j = "🤖", Ne = [
|
|
56
56
|
{
|
|
57
57
|
emoji: "🤖",
|
|
58
58
|
key: "robot",
|
|
@@ -113,21 +113,23 @@ var A = "🤖", Pe = [
|
|
|
113
113
|
key: "rocket",
|
|
114
114
|
label: "Rocket"
|
|
115
115
|
}
|
|
116
|
-
],
|
|
116
|
+
], M = "You are a helpful AI assistant. Be concise, accurate, and friendly.", N = [
|
|
117
117
|
"basics",
|
|
118
118
|
"prompt",
|
|
119
119
|
"model",
|
|
120
120
|
"tools"
|
|
121
121
|
];
|
|
122
|
-
function
|
|
122
|
+
function Pe(e) {
|
|
123
123
|
return e ? {
|
|
124
124
|
name: e.name,
|
|
125
125
|
slug: e.slug,
|
|
126
126
|
description: e.description ?? "",
|
|
127
|
-
avatar: e.avatar ||
|
|
127
|
+
avatar: e.avatar || j,
|
|
128
128
|
type: e.type || "ASSISTANT",
|
|
129
|
-
visibility:
|
|
129
|
+
visibility: C(e.visibility, Fe, "PRIVATE"),
|
|
130
130
|
systemPrompt: e.systemPrompt ?? "",
|
|
131
|
+
aiDisclosureEnabled: e.aiDisclosureEnabled ?? !0,
|
|
132
|
+
aiDisclosureText: e.aiDisclosureText ?? "",
|
|
131
133
|
temperature: e.temperature == null ? "" : String(e.temperature),
|
|
132
134
|
maxTokens: e.maxTokens == null ? "" : String(e.maxTokens),
|
|
133
135
|
maxConcurrentExecutions: e.maxConcurrentExecutions == null ? "" : String(e.maxConcurrentExecutions),
|
|
@@ -140,10 +142,12 @@ function Fe(e) {
|
|
|
140
142
|
name: "",
|
|
141
143
|
slug: "",
|
|
142
144
|
description: "",
|
|
143
|
-
avatar:
|
|
145
|
+
avatar: j,
|
|
144
146
|
type: "ASSISTANT",
|
|
145
147
|
visibility: "PRIVATE",
|
|
146
|
-
systemPrompt:
|
|
148
|
+
systemPrompt: M,
|
|
149
|
+
aiDisclosureEnabled: !0,
|
|
150
|
+
aiDisclosureText: "",
|
|
147
151
|
temperature: "",
|
|
148
152
|
maxTokens: "",
|
|
149
153
|
maxConcurrentExecutions: "",
|
|
@@ -154,284 +158,288 @@ function Fe(e) {
|
|
|
154
158
|
mcpConnectionIds: []
|
|
155
159
|
};
|
|
156
160
|
}
|
|
157
|
-
var
|
|
161
|
+
var Fe = [
|
|
158
162
|
"PRIVATE",
|
|
159
163
|
"WORKSPACE",
|
|
160
164
|
"PUBLIC"
|
|
161
|
-
],
|
|
162
|
-
let r = e(), { agentId: i, botId: a } =
|
|
163
|
-
return i ? l ? /* @__PURE__ */
|
|
165
|
+
], Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", P = () => {
|
|
166
|
+
let r = e(), { agentId: i, botId: a } = D(), { navigateTo: o } = t(), { data: s, loading: l, error: d, refetch: f } = _(i);
|
|
167
|
+
return i ? l ? /* @__PURE__ */ T(n, {
|
|
164
168
|
title: r("botlit.agentBuilder.editTitle", "Edit Agent"),
|
|
165
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ T("div", {
|
|
166
170
|
role: "status",
|
|
167
171
|
"aria-busy": "true",
|
|
168
172
|
"aria-label": r("botlit.common.loading", "Loading..."),
|
|
169
173
|
className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg"
|
|
170
174
|
})
|
|
171
|
-
}) : d ? /* @__PURE__ */
|
|
175
|
+
}) : d ? /* @__PURE__ */ T(n, {
|
|
172
176
|
title: r("botlit.agentBuilder.editTitle", "Edit Agent"),
|
|
173
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ T(p, {
|
|
174
178
|
resource: r("botlit.agentBuilder.resource", "this agent"),
|
|
175
179
|
error: d,
|
|
176
180
|
onRetry: () => void f()
|
|
177
181
|
})
|
|
178
|
-
}) : s ? /* @__PURE__ */
|
|
182
|
+
}) : s ? /* @__PURE__ */ T(F, {
|
|
179
183
|
agent: s,
|
|
180
184
|
botId: a
|
|
181
|
-
}, s.id) : /* @__PURE__ */
|
|
185
|
+
}, s.id) : /* @__PURE__ */ T(n, {
|
|
182
186
|
title: r("botlit.agentDetail.notFound.title", "Agent Not Found"),
|
|
183
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ T(u, {
|
|
184
188
|
kind: "not-found",
|
|
185
189
|
illustration: "empty-agents",
|
|
186
190
|
title: r("botlit.agentDetail.notFound.title", "Agent Not Found"),
|
|
187
191
|
description: r("botlit.agentDetail.notFound.description", "The agent you're looking for doesn't exist."),
|
|
188
|
-
action: /* @__PURE__ */
|
|
192
|
+
action: /* @__PURE__ */ T(c, {
|
|
189
193
|
onClick: () => o(a ? `bots/${a}/agents` : "agents"),
|
|
190
194
|
children: r("botlit.agentDetail.notFound.backAction", "Back to Agents")
|
|
191
195
|
})
|
|
192
196
|
})
|
|
193
|
-
}) : /* @__PURE__ */
|
|
194
|
-
},
|
|
195
|
-
let
|
|
196
|
-
capabilities:
|
|
197
|
-
mcpServerCount:
|
|
198
|
-
knowledgeBaseCount:
|
|
199
|
-
}),
|
|
197
|
+
}) : /* @__PURE__ */ T(F, { botId: a });
|
|
198
|
+
}, F = ({ agent: u, botId: _ }) => {
|
|
199
|
+
let D = e(), { navigateTo: A, workspaceId: j } = t(), M = !!u, P = _ ? `bots/${_}/agents` : "agents", F = u ? `${P}/${u.id}` : P, [I, Re] = w(() => Pe(u)), [L, ze] = w("basics"), [R, Be] = w(!1), Ve = Se({}), [He, Ue] = te(), [We, Ge] = ne(), [Ke] = ae(), [qe] = ie(), { data: Je, loading: Ye, error: z, refetch: Xe } = re(_), Ze = ee(), B = Ue.loading || Ge.loading, V = !!_ && !u, { data: H, loading: Qe, error: $e, refetch: et } = ue(), { data: tt, loading: nt, error: rt, refetch: it } = le(), U = Qe || nt, W = $e || rt, G = ye(tt ?? [], H ?? []), { data: K, loading: at, error: ot, refetch: st } = ce(), { data: ct, loading: lt, error: ut, refetch: dt } = de(), q = xe(() => _e(I), [I]), ft = Object.keys(q).length, pt = (e) => R && Object.keys(q).some((t) => pe[t] === e), J = ge({
|
|
200
|
+
capabilities: I.capabilities,
|
|
201
|
+
mcpServerCount: I.mcpConnectionIds.length,
|
|
202
|
+
knowledgeBaseCount: I.knowledgeBaseIds.length
|
|
203
|
+
}), mt = I.llmModelId === "", Y = (e, t) => Re((n) => ({
|
|
200
204
|
...n,
|
|
201
205
|
[e]: t
|
|
202
|
-
})),
|
|
206
|
+
})), X = (e, t) => Re((n) => ({
|
|
203
207
|
...n,
|
|
204
208
|
[e]: n[e].includes(t) ? n[e].filter((e) => e !== t) : [...n[e], t]
|
|
205
|
-
})),
|
|
206
|
-
let t =
|
|
207
|
-
if (t) return
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
},
|
|
211
|
-
let n =
|
|
212
|
-
r !== void 0 && (e.preventDefault(),
|
|
213
|
-
},
|
|
209
|
+
})), Z = (e) => {
|
|
210
|
+
let t = R ? q[e] : void 0;
|
|
211
|
+
if (t) return D(`botlit.agentBuilder.errors.${t}`, fe[t]);
|
|
212
|
+
}, Q = (e) => `agent-form-${e}`, $ = (e) => {
|
|
213
|
+
ze(e), Ve.current[e]?.focus();
|
|
214
|
+
}, ht = (e, t) => {
|
|
215
|
+
let n = N.length - 1, r = e.key === "ArrowRight" ? (t + 1) % N.length : e.key === "ArrowLeft" ? (t - 1 + N.length) % N.length : e.key === "Home" ? 0 : e.key === "End" ? n : void 0;
|
|
216
|
+
r !== void 0 && (e.preventDefault(), $(N[r]));
|
|
217
|
+
}, gt = [
|
|
214
218
|
{
|
|
215
219
|
id: "basics",
|
|
216
|
-
label:
|
|
217
|
-
icon: /* @__PURE__ */
|
|
220
|
+
label: D("botlit.agentBuilder.tabs.basics", "Basic Info"),
|
|
221
|
+
icon: /* @__PURE__ */ T(ke, { size: 18 })
|
|
218
222
|
},
|
|
219
223
|
{
|
|
220
224
|
id: "prompt",
|
|
221
|
-
label:
|
|
222
|
-
icon: /* @__PURE__ */
|
|
225
|
+
label: D("botlit.agentBuilder.tabs.prompt", "Prompt"),
|
|
226
|
+
icon: /* @__PURE__ */ T(Ee, { size: 18 })
|
|
223
227
|
},
|
|
224
228
|
{
|
|
225
229
|
id: "model",
|
|
226
|
-
label:
|
|
227
|
-
icon: /* @__PURE__ */
|
|
230
|
+
label: D("botlit.agentBuilder.tabs.model", "LLM Model"),
|
|
231
|
+
icon: /* @__PURE__ */ T(Oe, { size: 18 })
|
|
228
232
|
},
|
|
229
233
|
{
|
|
230
234
|
id: "tools",
|
|
231
|
-
label:
|
|
232
|
-
icon: /* @__PURE__ */
|
|
235
|
+
label: D("botlit.agentBuilder.tabs.tools", "Tools & Knowledge"),
|
|
236
|
+
icon: /* @__PURE__ */ T(Ae, { size: 18 })
|
|
233
237
|
}
|
|
234
|
-
],
|
|
235
|
-
if (e.preventDefault(),
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
+
], _t = async (e) => {
|
|
239
|
+
if (e.preventDefault(), B || V && Ye) return;
|
|
240
|
+
if (V && z) {
|
|
241
|
+
k.error(D("botlit.agentBuilder.botUnavailable", "The bot could not be read, so the agent cannot be linked to it yet. Try again."));
|
|
238
242
|
return;
|
|
239
243
|
}
|
|
240
|
-
if (!
|
|
241
|
-
|
|
244
|
+
if (!j) {
|
|
245
|
+
k.error(D("botlit.agentBuilder.noWorkspace", "No workspace is selected yet. Wait for it to load, or pick a workspace, then save again."));
|
|
242
246
|
return;
|
|
243
247
|
}
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
let e =
|
|
247
|
-
e &&
|
|
248
|
+
if (ft > 0) {
|
|
249
|
+
Be(!0);
|
|
250
|
+
let e = N.find((e) => Object.keys(q).some((t) => pe[t] === e));
|
|
251
|
+
e && $(e);
|
|
248
252
|
return;
|
|
249
253
|
}
|
|
250
|
-
let t =
|
|
251
|
-
if (
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
+
let t = I.llmModelId !== (u?.llmModelId ?? "");
|
|
255
|
+
if (I.llmModelId && t) {
|
|
256
|
+
if (U) {
|
|
257
|
+
k.error(D("botlit.agentBuilder.modelLoading", "The model list is still loading. Try again in a moment.")), $("model");
|
|
254
258
|
return;
|
|
255
259
|
}
|
|
256
|
-
if (
|
|
257
|
-
|
|
260
|
+
if (W || !G.some((e) => e.id === I.llmModelId)) {
|
|
261
|
+
k.error(D("botlit.agentBuilder.modelUnavailable", "Choose an active answer model from the available catalog.")), $("model");
|
|
258
262
|
return;
|
|
259
263
|
}
|
|
260
264
|
}
|
|
261
|
-
let n =
|
|
265
|
+
let n = I.name.trim(), r = he(n, I.slug), i = S(I.temperature), a = S(I.maxTokens), o = S(I.maxConcurrentExecutions), s = I.description.trim(), c = C(I.type, je, "ASSISTANT"), l = Me(I.capabilities);
|
|
262
266
|
try {
|
|
263
267
|
if (u) {
|
|
264
|
-
await
|
|
268
|
+
await We({
|
|
265
269
|
agentId: u.id,
|
|
266
270
|
input: {
|
|
267
271
|
name: n,
|
|
268
272
|
slug: r,
|
|
269
273
|
description: s === "" ? null : s,
|
|
270
|
-
avatar:
|
|
271
|
-
systemPrompt:
|
|
274
|
+
avatar: I.avatar,
|
|
275
|
+
systemPrompt: I.systemPrompt.trim(),
|
|
276
|
+
aiDisclosureEnabled: I.aiDisclosureEnabled,
|
|
277
|
+
aiDisclosureText: I.aiDisclosureText.trim() === "" ? null : I.aiDisclosureText.trim(),
|
|
272
278
|
temperature: i ?? null,
|
|
273
279
|
maxTokens: a ?? null,
|
|
274
280
|
maxConcurrentExecutions: o ?? null,
|
|
275
281
|
capabilities: l,
|
|
276
|
-
llmModelId:
|
|
277
|
-
fallbackModelIds:
|
|
278
|
-
knowledgeBaseIds:
|
|
279
|
-
mcpConnectionIds:
|
|
282
|
+
llmModelId: I.llmModelId === "" ? null : I.llmModelId,
|
|
283
|
+
fallbackModelIds: I.fallbackModelIds.filter((e) => e !== I.llmModelId),
|
|
284
|
+
knowledgeBaseIds: I.knowledgeBaseIds,
|
|
285
|
+
mcpConnectionIds: I.mcpConnectionIds,
|
|
280
286
|
type: c,
|
|
281
|
-
visibility:
|
|
287
|
+
visibility: I.visibility
|
|
282
288
|
}
|
|
283
|
-
}),
|
|
289
|
+
}), k.success(D("botlit.agentBuilder.updated", "Agent \"{{name}}\" updated successfully", { name: n })), A(F);
|
|
284
290
|
return;
|
|
285
291
|
}
|
|
286
|
-
let e = await
|
|
287
|
-
workspaceId:
|
|
292
|
+
let e = await He({
|
|
293
|
+
workspaceId: j,
|
|
288
294
|
name: n,
|
|
289
295
|
slug: r,
|
|
290
296
|
type: c,
|
|
291
297
|
description: s === "" ? void 0 : s,
|
|
292
|
-
avatar:
|
|
293
|
-
systemPrompt:
|
|
298
|
+
avatar: I.avatar,
|
|
299
|
+
systemPrompt: I.systemPrompt.trim(),
|
|
300
|
+
aiDisclosureEnabled: I.aiDisclosureEnabled,
|
|
301
|
+
aiDisclosureText: I.aiDisclosureText.trim() === "" ? void 0 : I.aiDisclosureText.trim(),
|
|
294
302
|
temperature: i,
|
|
295
303
|
maxTokens: a,
|
|
296
304
|
maxConcurrentExecutions: o,
|
|
297
305
|
capabilities: l,
|
|
298
|
-
llmModelId:
|
|
299
|
-
fallbackModelIds:
|
|
300
|
-
knowledgeBaseIds:
|
|
301
|
-
mcpConnectionIds:
|
|
302
|
-
visibility:
|
|
306
|
+
llmModelId: I.llmModelId === "" ? void 0 : I.llmModelId,
|
|
307
|
+
fallbackModelIds: I.fallbackModelIds.filter((e) => e !== I.llmModelId),
|
|
308
|
+
knowledgeBaseIds: I.knowledgeBaseIds,
|
|
309
|
+
mcpConnectionIds: I.mcpConnectionIds,
|
|
310
|
+
visibility: I.visibility
|
|
303
311
|
});
|
|
304
|
-
if (
|
|
305
|
-
if (!
|
|
306
|
-
|
|
312
|
+
if (k.success(D("botlit.agentBuilder.created", "Agent \"{{name}}\" created successfully", { name: n })), _) {
|
|
313
|
+
if (!Ze(f.APP_AGENT_CREATE)) {
|
|
314
|
+
k.error(D("botlit.agentBuilder.linkNotAllowed", "The agent was created, but you are not allowed to link agents to bots, so it is not linked.")), A(`agents/${e.id}`);
|
|
307
315
|
return;
|
|
308
316
|
}
|
|
309
317
|
try {
|
|
310
|
-
await
|
|
311
|
-
botId:
|
|
318
|
+
await Ke({
|
|
319
|
+
botId: _,
|
|
312
320
|
agentId: e.id
|
|
313
321
|
});
|
|
314
322
|
} catch (t) {
|
|
315
|
-
|
|
323
|
+
k.error(t instanceof Error ? D("botlit.agentBuilder.linkFailed", "The agent was created but could not be linked to the bot: {{message}}", { message: t.message }) : D("botlit.agentBuilder.linkFailedShort", "The agent was created but could not be linked to the bot")), A(`agents/${e.id}`);
|
|
316
324
|
return;
|
|
317
325
|
}
|
|
318
|
-
if (
|
|
319
|
-
await
|
|
320
|
-
botId:
|
|
326
|
+
if (Je && !Je.defaultAgentId && Ze(f.APP_UPDATE)) try {
|
|
327
|
+
await qe({
|
|
328
|
+
botId: _,
|
|
321
329
|
input: { defaultAgentId: e.id }
|
|
322
330
|
});
|
|
323
331
|
} catch (e) {
|
|
324
|
-
|
|
332
|
+
k.error(e instanceof Error ? D("botlit.agentBuilder.defaultFailed", "The agent was linked, but it could not be set as the bot default: {{message}}", { message: e.message }) : D("botlit.agentBuilder.defaultFailedShort", "The agent was linked, but it could not be set as the bot default"));
|
|
325
333
|
}
|
|
326
|
-
|
|
334
|
+
A(`bots/${_}/agents`);
|
|
327
335
|
return;
|
|
328
336
|
}
|
|
329
|
-
|
|
337
|
+
A(`agents/${e.id}`);
|
|
330
338
|
} catch (e) {
|
|
331
|
-
|
|
339
|
+
k.error(e instanceof Error ? e.message : D("botlit.agentBuilder.saveFailed", "Failed to save agent"));
|
|
332
340
|
}
|
|
333
|
-
},
|
|
341
|
+
}, vt = M ? D("botlit.agentBuilder.save", "Save Changes") : D("botlit.agentBuilder.create", "Create Agent"), yt = (e) => {
|
|
334
342
|
switch (e) {
|
|
335
|
-
case "mcpToolsNeedsServer": return
|
|
336
|
-
case "ragNeedsKnowledgeBase": return
|
|
337
|
-
case "serversNeedMcpTools": return
|
|
338
|
-
case "knowledgeBasesNeedRag": return
|
|
343
|
+
case "mcpToolsNeedsServer": return D("botlit.agentBuilder.warnings.mcpToolsNeedsServer", "MCP Tools is on but no MCP server is attached, so the agent has no tools. Attach a server on the Tools & Knowledge tab or turn it off.");
|
|
344
|
+
case "ragNeedsKnowledgeBase": return D("botlit.agentBuilder.warnings.ragNeedsKnowledgeBase", "RAG is on but no knowledge base is attached, so nothing is retrieved. Attach a knowledge base or turn it off.");
|
|
345
|
+
case "serversNeedMcpTools": return D("botlit.agentBuilder.warnings.serversNeedMcpTools", "MCP servers are attached but MCP Tools is off, so the agent ignores them. Turn MCP Tools on or detach the servers.");
|
|
346
|
+
case "knowledgeBasesNeedRag": return D("botlit.agentBuilder.warnings.knowledgeBasesNeedRag", "Knowledge bases are attached but RAG is off, so the agent ignores them. Turn RAG on or detach them.");
|
|
339
347
|
}
|
|
340
|
-
},
|
|
348
|
+
}, bt = {
|
|
341
349
|
MCP_TOOLS: {
|
|
342
|
-
label:
|
|
343
|
-
description:
|
|
350
|
+
label: D("botlit.agentBuilder.capabilities.mcpTools", "MCP Tools"),
|
|
351
|
+
description: D("botlit.agentBuilder.capabilities.mcpToolsDescription", "Let the agent call the tools of the MCP servers attached below.")
|
|
344
352
|
},
|
|
345
353
|
RAG: {
|
|
346
|
-
label:
|
|
347
|
-
description:
|
|
354
|
+
label: D("botlit.agentBuilder.capabilities.rag", "RAG"),
|
|
355
|
+
description: D("botlit.agentBuilder.capabilities.ragDescription", "Answer from the knowledge bases attached below (retrieval-augmented generation).")
|
|
348
356
|
},
|
|
349
357
|
A2A: {
|
|
350
|
-
label:
|
|
351
|
-
description:
|
|
358
|
+
label: D("botlit.agentBuilder.capabilities.a2a", "Agent delegation"),
|
|
359
|
+
description: D("botlit.agentBuilder.capabilities.a2aDescription", "Let the agent hand sub-tasks to other agents it is connected to.")
|
|
352
360
|
}
|
|
353
|
-
},
|
|
354
|
-
return /* @__PURE__ */
|
|
355
|
-
title:
|
|
356
|
-
leading: /* @__PURE__ */
|
|
361
|
+
}, xt = I.capabilities.filter((e) => !me.includes(e)), St = new Set(K.map((e) => e.id)), Ct = new Set(ct.map((e) => e.id)), wt = I.knowledgeBaseIds.filter((e) => !St.has(e)), Tt = K.filter((e) => I.knowledgeBaseIds.includes(e.id) && e.indexStatus !== "READY"), Et = I.mcpConnectionIds.filter((e) => !Ct.has(e)), Dt = I.llmModelId !== "" && !U && !W && !G.some((e) => e.id === I.llmModelId);
|
|
362
|
+
return /* @__PURE__ */ E(n, {
|
|
363
|
+
title: M ? D("botlit.agentBuilder.editTitle", "Edit Agent") : D("botlit.agentBuilder.createTitle", "Create New Agent"),
|
|
364
|
+
leading: /* @__PURE__ */ T(c, {
|
|
357
365
|
variant: "ghost",
|
|
358
366
|
size: "icon",
|
|
359
|
-
"aria-label":
|
|
360
|
-
onClick: () =>
|
|
361
|
-
children: /* @__PURE__ */
|
|
367
|
+
"aria-label": D("botlit.agentBuilder.back", "Back"),
|
|
368
|
+
onClick: () => A(F),
|
|
369
|
+
children: /* @__PURE__ */ T(Te, {
|
|
362
370
|
size: 20,
|
|
363
371
|
"aria-hidden": "true"
|
|
364
372
|
})
|
|
365
373
|
}),
|
|
366
|
-
actions: /* @__PURE__ */
|
|
374
|
+
actions: /* @__PURE__ */ E("div", {
|
|
367
375
|
className: "flex gap-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ T(c, {
|
|
369
377
|
variant: "outline",
|
|
370
|
-
onClick: () =>
|
|
371
|
-
children:
|
|
372
|
-
}), /* @__PURE__ */
|
|
378
|
+
onClick: () => A(F),
|
|
379
|
+
children: D("botlit.common.cancel", "Cancel")
|
|
380
|
+
}), /* @__PURE__ */ T(c, {
|
|
373
381
|
type: "submit",
|
|
374
382
|
form: "agent-builder-form",
|
|
375
|
-
leftIcon: /* @__PURE__ */
|
|
376
|
-
isLoading:
|
|
377
|
-
children:
|
|
383
|
+
leftIcon: /* @__PURE__ */ T(De, { size: 16 }),
|
|
384
|
+
isLoading: B || V && Ye,
|
|
385
|
+
children: vt
|
|
378
386
|
})]
|
|
379
387
|
}),
|
|
380
|
-
children: [!u && !
|
|
388
|
+
children: [!u && !_ && /* @__PURE__ */ E("div", {
|
|
381
389
|
className: "mx-auto mb-6 max-w-4xl space-y-6",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ T(se, {
|
|
383
391
|
scope: "AGENTS",
|
|
384
392
|
onCreated: (e) => {
|
|
385
393
|
let t = e.agents[0];
|
|
386
|
-
|
|
394
|
+
A(e.agents.length === 1 && t ? `agents/${t.id}` : "agents");
|
|
387
395
|
}
|
|
388
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ T(oe, {
|
|
389
397
|
kind: "agent",
|
|
390
|
-
onCreated: (e) =>
|
|
398
|
+
onCreated: (e) => A(`agents/${e}`)
|
|
391
399
|
})]
|
|
392
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ E("form", {
|
|
393
401
|
id: "agent-builder-form",
|
|
394
|
-
onSubmit: (e) => void
|
|
402
|
+
onSubmit: (e) => void _t(e),
|
|
395
403
|
noValidate: !0,
|
|
396
404
|
className: "max-w-4xl mx-auto",
|
|
397
405
|
children: [
|
|
398
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ T(Ce, {
|
|
399
407
|
className: "mb-6",
|
|
400
|
-
icon: /* @__PURE__ */
|
|
401
|
-
children:
|
|
408
|
+
icon: /* @__PURE__ */ T(ke, { size: 18 }),
|
|
409
|
+
children: D("botlit.agentBuilder.purpose", "This guided builder walks you through everything an agent needs: its identity and system prompt, the model and settings it runs on, and the tools and knowledge it can reach. Work through the steps, then save the agent and test it in chat. You can come back and edit any step later.")
|
|
402
410
|
}),
|
|
403
|
-
|
|
411
|
+
V && z && /* @__PURE__ */ T("div", {
|
|
404
412
|
role: "alert",
|
|
405
413
|
className: "mb-4",
|
|
406
|
-
children: /* @__PURE__ */
|
|
407
|
-
resource:
|
|
408
|
-
error:
|
|
409
|
-
onRetry: () => void
|
|
414
|
+
children: /* @__PURE__ */ T(p, {
|
|
415
|
+
resource: D("botlit.agentBuilder.botResource", "this bot"),
|
|
416
|
+
error: z,
|
|
417
|
+
onRetry: () => void Xe()
|
|
410
418
|
})
|
|
411
419
|
}),
|
|
412
|
-
!
|
|
420
|
+
!j && /* @__PURE__ */ T("p", {
|
|
413
421
|
role: "status",
|
|
414
422
|
className: "mb-4 text-sm text-text-secondary",
|
|
415
|
-
children:
|
|
423
|
+
children: D("botlit.agentBuilder.noWorkspace", "No workspace is selected yet. Wait for it to load, or pick a workspace, then save again.")
|
|
416
424
|
}),
|
|
417
|
-
|
|
425
|
+
R && ft > 0 && /* @__PURE__ */ E("div", {
|
|
418
426
|
role: "alert",
|
|
419
427
|
className: "mb-4 flex items-start gap-2 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-text-primary",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ T(O, {
|
|
421
429
|
size: 16,
|
|
422
430
|
className: "mt-0.5 text-status-error-text",
|
|
423
431
|
"aria-hidden": "true"
|
|
424
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ T("p", { children: D("botlit.agentBuilder.errorSummary", "Fix the highlighted fields before saving. Tabs with a problem are marked.") })]
|
|
425
433
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ T("div", {
|
|
427
435
|
role: "tablist",
|
|
428
|
-
"aria-label":
|
|
436
|
+
"aria-label": D("botlit.agentBuilder.stepsLabel", "Agent setup steps"),
|
|
429
437
|
className: "mb-8 flex flex-wrap items-center gap-2",
|
|
430
|
-
children:
|
|
431
|
-
let n =
|
|
432
|
-
return /* @__PURE__ */
|
|
438
|
+
children: gt.map((e, t) => {
|
|
439
|
+
let n = L === e.id, r = pt(e.id);
|
|
440
|
+
return /* @__PURE__ */ E("button", {
|
|
433
441
|
ref: (t) => {
|
|
434
|
-
|
|
442
|
+
Ve.current[e.id] = t;
|
|
435
443
|
},
|
|
436
444
|
type: "button",
|
|
437
445
|
role: "tab",
|
|
@@ -439,162 +447,162 @@ var Ie = [
|
|
|
439
447
|
"aria-selected": n,
|
|
440
448
|
"aria-controls": `agent-panel-${e.id}`,
|
|
441
449
|
tabIndex: n ? 0 : -1,
|
|
442
|
-
onClick: () =>
|
|
443
|
-
onKeyDown: (e) =>
|
|
444
|
-
className:
|
|
450
|
+
onClick: () => ze(e.id),
|
|
451
|
+
onKeyDown: (e) => ht(e, t),
|
|
452
|
+
className: ve("flex items-center gap-2 rounded-lg px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary", n ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:bg-accent", r && "ring-2 ring-status-error-border"),
|
|
445
453
|
children: [
|
|
446
454
|
e.icon,
|
|
447
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ T("span", {
|
|
448
456
|
className: "font-medium",
|
|
449
457
|
children: e.label
|
|
450
458
|
}),
|
|
451
|
-
r && /* @__PURE__ */
|
|
459
|
+
r && /* @__PURE__ */ E("span", {
|
|
452
460
|
className: "text-status-error-text",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ T(O, {
|
|
454
462
|
size: 14,
|
|
455
463
|
"aria-hidden": "true"
|
|
456
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ T("span", {
|
|
457
465
|
className: "sr-only",
|
|
458
|
-
children:
|
|
466
|
+
children: D("botlit.agentBuilder.tabHasProblem", "This step has a problem")
|
|
459
467
|
})]
|
|
460
468
|
})
|
|
461
469
|
]
|
|
462
470
|
}, e.id);
|
|
463
471
|
})
|
|
464
472
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ E("div", {
|
|
466
474
|
className: "space-y-6",
|
|
467
475
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ T("div", {
|
|
469
477
|
role: "tabpanel",
|
|
470
478
|
id: "agent-panel-basics",
|
|
471
479
|
"aria-labelledby": "agent-tab-basics",
|
|
472
|
-
hidden:
|
|
473
|
-
children: /* @__PURE__ */
|
|
480
|
+
hidden: L !== "basics",
|
|
481
|
+
children: /* @__PURE__ */ E(r, {
|
|
474
482
|
treatment: "glass",
|
|
475
483
|
glow: !0,
|
|
476
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ T(s, { children: D("botlit.agentBuilder.basics.title", "Basic Information") }), /* @__PURE__ */ T(a, { children: D("botlit.agentBuilder.basics.description", "Set up the agent's identity and purpose") })] }), /* @__PURE__ */ E(i, {
|
|
477
485
|
className: "space-y-6",
|
|
478
486
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
480
488
|
className: "mb-2 text-sm font-medium",
|
|
481
|
-
children:
|
|
482
|
-
}), /* @__PURE__ */
|
|
483
|
-
value:
|
|
484
|
-
onChange: (e) =>
|
|
485
|
-
choices:
|
|
486
|
-
groupLabel:
|
|
487
|
-
optionLabel: (e) =>
|
|
488
|
-
currentLabel:
|
|
489
|
+
children: D("botlit.agentBuilder.avatar", "Avatar")
|
|
490
|
+
}), /* @__PURE__ */ T(l, {
|
|
491
|
+
value: I.avatar,
|
|
492
|
+
onChange: (e) => Y("avatar", e),
|
|
493
|
+
choices: Ne,
|
|
494
|
+
groupLabel: D("botlit.agentBuilder.avatar", "Avatar"),
|
|
495
|
+
optionLabel: (e) => D(`botlit.agentBuilder.avatars.${e.key}`, e.label),
|
|
496
|
+
currentLabel: D("botlit.agentBuilder.avatars.current", "Current avatar")
|
|
489
497
|
})] }),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
label:
|
|
498
|
+
/* @__PURE__ */ T(m, {
|
|
499
|
+
label: D("botlit.agentBuilder.name", "Agent Name"),
|
|
492
500
|
required: !0,
|
|
493
|
-
htmlFor:
|
|
494
|
-
error:
|
|
495
|
-
children: /* @__PURE__ */
|
|
496
|
-
id:
|
|
501
|
+
htmlFor: Q("name"),
|
|
502
|
+
error: Z("name"),
|
|
503
|
+
children: /* @__PURE__ */ T(h, {
|
|
504
|
+
id: Q("name"),
|
|
497
505
|
required: !0,
|
|
498
|
-
"aria-invalid":
|
|
499
|
-
"aria-describedby":
|
|
506
|
+
"aria-invalid": Z("name") ? !0 : void 0,
|
|
507
|
+
"aria-describedby": Z("name") ? `${Q("name")}-error` : void 0,
|
|
500
508
|
maxLength: 120,
|
|
501
|
-
placeholder:
|
|
502
|
-
value:
|
|
503
|
-
onChange: (e) =>
|
|
509
|
+
placeholder: D("botlit.agentBuilder.namePlaceholder", "e.g., Customer Support Agent"),
|
|
510
|
+
value: I.name,
|
|
511
|
+
onChange: (e) => Y("name", e.target.value)
|
|
504
512
|
})
|
|
505
513
|
}),
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
label:
|
|
508
|
-
htmlFor:
|
|
509
|
-
error:
|
|
510
|
-
description:
|
|
511
|
-
children: /* @__PURE__ */
|
|
512
|
-
id:
|
|
513
|
-
"aria-invalid":
|
|
514
|
-
"aria-describedby":
|
|
514
|
+
/* @__PURE__ */ T(m, {
|
|
515
|
+
label: D("botlit.agentBuilder.slug", "Slug"),
|
|
516
|
+
htmlFor: Q("slug"),
|
|
517
|
+
error: Z("slug"),
|
|
518
|
+
description: I.slug.trim() === "" && be(I.name) !== "" ? D("botlit.agentBuilder.slugDerived", "Will be saved as \"{{slug}}\".", { slug: be(I.name) }) : D("botlit.agentBuilder.slugHelp", "URL-friendly identifier. Leave empty to build it from the name."),
|
|
519
|
+
children: /* @__PURE__ */ T(h, {
|
|
520
|
+
id: Q("slug"),
|
|
521
|
+
"aria-invalid": Z("slug") ? !0 : void 0,
|
|
522
|
+
"aria-describedby": Z("slug") ? `${Q("slug")}-error` : `${Q("slug")}-description`,
|
|
515
523
|
placeholder: "customer-support-agent",
|
|
516
|
-
value:
|
|
517
|
-
onChange: (e) =>
|
|
524
|
+
value: I.slug,
|
|
525
|
+
onChange: (e) => Y("slug", e.target.value)
|
|
518
526
|
})
|
|
519
527
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
label:
|
|
522
|
-
htmlFor:
|
|
523
|
-
children: /* @__PURE__ */
|
|
524
|
-
id:
|
|
525
|
-
placeholder:
|
|
526
|
-
value:
|
|
527
|
-
onChange: (e) =>
|
|
528
|
+
/* @__PURE__ */ T(m, {
|
|
529
|
+
label: D("botlit.agentBuilder.descriptionLabel", "Description"),
|
|
530
|
+
htmlFor: Q("description"),
|
|
531
|
+
children: /* @__PURE__ */ T(g, {
|
|
532
|
+
id: Q("description"),
|
|
533
|
+
placeholder: D("botlit.agentBuilder.descriptionPlaceholder", "Describe what this agent does..."),
|
|
534
|
+
value: I.description,
|
|
535
|
+
onChange: (e) => Y("description", e.target.value),
|
|
528
536
|
rows: 3
|
|
529
537
|
})
|
|
530
538
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
label:
|
|
533
|
-
htmlFor:
|
|
534
|
-
description:
|
|
535
|
-
children: /* @__PURE__ */
|
|
536
|
-
id:
|
|
537
|
-
"aria-describedby": `${
|
|
538
|
-
className:
|
|
539
|
-
value:
|
|
540
|
-
onChange: (e) =>
|
|
539
|
+
/* @__PURE__ */ T(m, {
|
|
540
|
+
label: D("botlit.agentBuilder.visibilityLabel", "Visibility"),
|
|
541
|
+
htmlFor: Q("visibility"),
|
|
542
|
+
description: D("botlit.agentBuilder.visibilityHelp", "Private: only you. Workspace: everyone in this workspace. Public: shareable outside it."),
|
|
543
|
+
children: /* @__PURE__ */ E(we, {
|
|
544
|
+
id: Q("visibility"),
|
|
545
|
+
"aria-describedby": `${Q("visibility")}-description`,
|
|
546
|
+
className: Ie,
|
|
547
|
+
value: I.visibility,
|
|
548
|
+
onChange: (e) => Y("visibility", C(e.target.value, Fe, "PRIVATE")),
|
|
541
549
|
children: [
|
|
542
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ T("option", {
|
|
543
551
|
value: "PRIVATE",
|
|
544
|
-
children:
|
|
552
|
+
children: D("botlit.agentBuilder.visibility.private", "Private")
|
|
545
553
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ T("option", {
|
|
547
555
|
value: "WORKSPACE",
|
|
548
|
-
children:
|
|
556
|
+
children: D("botlit.agentBuilder.visibility.workspace", "Workspace")
|
|
549
557
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ T("option", {
|
|
551
559
|
value: "PUBLIC",
|
|
552
|
-
children:
|
|
560
|
+
children: D("botlit.agentBuilder.visibility.public", "Public")
|
|
553
561
|
})
|
|
554
562
|
]
|
|
555
563
|
})
|
|
556
564
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ E("fieldset", { children: [
|
|
566
|
+
/* @__PURE__ */ T("legend", {
|
|
559
567
|
className: "mb-1 text-sm font-medium",
|
|
560
|
-
children:
|
|
568
|
+
children: D("botlit.agentBuilder.capabilitiesLabel", "Capabilities")
|
|
561
569
|
}),
|
|
562
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ T("p", {
|
|
563
571
|
className: "mb-3 text-xs text-text-secondary",
|
|
564
|
-
children:
|
|
572
|
+
children: D("botlit.agentBuilder.capabilitiesHelp", "Capabilities are off until you turn them on. Each one only does something once what it needs is attached on the Tools & Knowledge tab.")
|
|
565
573
|
}),
|
|
566
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ T("div", {
|
|
567
575
|
className: "grid grid-cols-1 gap-3 md:grid-cols-3",
|
|
568
|
-
children:
|
|
576
|
+
children: me.map((e) => /* @__PURE__ */ E("label", {
|
|
569
577
|
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-border-subtle p-3 hover:bg-accent",
|
|
570
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ T("input", {
|
|
571
579
|
type: "checkbox",
|
|
572
580
|
className: "mt-0.5 h-4 w-4 rounded border-border-default",
|
|
573
|
-
checked:
|
|
574
|
-
onChange: () =>
|
|
575
|
-
}), /* @__PURE__ */
|
|
581
|
+
checked: I.capabilities.includes(e),
|
|
582
|
+
onChange: () => X("capabilities", e)
|
|
583
|
+
}), /* @__PURE__ */ E("span", { children: [/* @__PURE__ */ T("span", {
|
|
576
584
|
className: "block text-sm font-medium",
|
|
577
|
-
children:
|
|
578
|
-
}), /* @__PURE__ */
|
|
585
|
+
children: bt[e].label
|
|
586
|
+
}), /* @__PURE__ */ T("span", {
|
|
579
587
|
className: "block text-xs text-text-secondary",
|
|
580
|
-
children:
|
|
588
|
+
children: bt[e].description
|
|
581
589
|
})] })]
|
|
582
590
|
}, e))
|
|
583
591
|
}),
|
|
584
|
-
|
|
592
|
+
xt.length > 0 && /* @__PURE__ */ T("p", {
|
|
585
593
|
className: "mt-3 text-xs text-text-secondary",
|
|
586
|
-
children:
|
|
594
|
+
children: D("botlit.agentBuilder.unusedCapabilities", "This agent also carries {{names}}. They are kept as saved but have no effect yet.", { names: xt.join(", ") })
|
|
587
595
|
}),
|
|
588
|
-
|
|
596
|
+
J.length > 0 && /* @__PURE__ */ T("ul", {
|
|
589
597
|
role: "status",
|
|
590
598
|
className: "mt-3 space-y-1 text-sm text-status-warning-text",
|
|
591
|
-
children:
|
|
599
|
+
children: J.map((e) => /* @__PURE__ */ E("li", {
|
|
592
600
|
className: "flex items-start gap-2",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
601
|
+
children: [/* @__PURE__ */ T(O, {
|
|
594
602
|
size: 14,
|
|
595
603
|
className: "mt-0.5 shrink-0",
|
|
596
604
|
"aria-hidden": "true"
|
|
597
|
-
}),
|
|
605
|
+
}), yt(e)]
|
|
598
606
|
}, e))
|
|
599
607
|
})
|
|
600
608
|
] })
|
|
@@ -602,155 +610,195 @@ var Ie = [
|
|
|
602
610
|
})]
|
|
603
611
|
})
|
|
604
612
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ T("div", {
|
|
606
614
|
role: "tabpanel",
|
|
607
615
|
id: "agent-panel-prompt",
|
|
608
616
|
"aria-labelledby": "agent-tab-prompt",
|
|
609
|
-
hidden:
|
|
610
|
-
children: /* @__PURE__ */
|
|
617
|
+
hidden: L !== "prompt",
|
|
618
|
+
children: /* @__PURE__ */ E(r, {
|
|
611
619
|
treatment: "glass",
|
|
612
620
|
glow: !0,
|
|
613
|
-
children: [/* @__PURE__ */
|
|
621
|
+
children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ T(s, { children: D("botlit.agentBuilder.prompt.title", "Prompt Configuration") }), /* @__PURE__ */ T(a, { children: D("botlit.agentBuilder.prompt.description", "Define how the agent communicates and behaves") })] }), /* @__PURE__ */ E(i, {
|
|
614
622
|
className: "space-y-6",
|
|
615
|
-
children: [
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
htmlFor: Z("prompt"),
|
|
619
|
-
error: X("systemPrompt"),
|
|
620
|
-
description: E("botlit.agentBuilder.systemPromptHelp", "The core instructions that define the agent's behavior"),
|
|
621
|
-
children: /* @__PURE__ */ w(te, {
|
|
622
|
-
id: Z("prompt"),
|
|
623
|
+
children: [
|
|
624
|
+
/* @__PURE__ */ T(m, {
|
|
625
|
+
label: D("botlit.agentBuilder.systemPrompt", "System Prompt"),
|
|
623
626
|
required: !0,
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
children: /* @__PURE__ */
|
|
645
|
-
id:
|
|
646
|
-
type: "
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
627
|
+
htmlFor: Q("prompt"),
|
|
628
|
+
error: Z("systemPrompt"),
|
|
629
|
+
description: D("botlit.agentBuilder.systemPromptHelp", "The core instructions that define the agent's behavior"),
|
|
630
|
+
children: /* @__PURE__ */ T(g, {
|
|
631
|
+
id: Q("prompt"),
|
|
632
|
+
required: !0,
|
|
633
|
+
"aria-invalid": Z("systemPrompt") ? !0 : void 0,
|
|
634
|
+
"aria-describedby": Z("systemPrompt") ? `${Q("prompt")}-error` : `${Q("prompt")}-description`,
|
|
635
|
+
placeholder: D("botlit.agentBuilder.systemPromptPlaceholder", "You are a helpful assistant..."),
|
|
636
|
+
value: I.systemPrompt,
|
|
637
|
+
onChange: (e) => Y("systemPrompt", e.target.value),
|
|
638
|
+
rows: 8,
|
|
639
|
+
className: "font-mono text-sm"
|
|
640
|
+
})
|
|
641
|
+
}),
|
|
642
|
+
/* @__PURE__ */ E("div", {
|
|
643
|
+
className: "space-y-3 rounded-lg border border-border-default bg-bg-subtle p-4",
|
|
644
|
+
children: [/* @__PURE__ */ E("label", {
|
|
645
|
+
htmlFor: Q("ai-disclosure-enabled"),
|
|
646
|
+
className: "flex items-start gap-3 cursor-pointer",
|
|
647
|
+
children: [/* @__PURE__ */ T("input", {
|
|
648
|
+
id: Q("ai-disclosure-enabled"),
|
|
649
|
+
type: "checkbox",
|
|
650
|
+
checked: I.aiDisclosureEnabled,
|
|
651
|
+
onChange: (e) => Y("aiDisclosureEnabled", e.target.checked),
|
|
652
|
+
className: "mt-1 h-4 w-4 rounded border-border-default"
|
|
653
|
+
}), /* @__PURE__ */ E("span", {
|
|
654
|
+
className: "space-y-0.5",
|
|
655
|
+
children: [/* @__PURE__ */ T("span", {
|
|
656
|
+
className: "block text-sm font-medium text-text-primary",
|
|
657
|
+
children: D("botlit.agentBuilder.aiDisclosureEnabled", "Show AI disclosure notice on channel conversations")
|
|
658
|
+
}), /* @__PURE__ */ T("span", {
|
|
659
|
+
className: "block text-xs text-text-secondary",
|
|
660
|
+
children: D("botlit.agentBuilder.aiDisclosureEnabledHelp", "Prepends a short notice on the first agent reply of each new channel conversation so people know they are talking to an AI (ISO 42001 IA-001).")
|
|
661
|
+
})]
|
|
662
|
+
})]
|
|
663
|
+
}), I.aiDisclosureEnabled && /* @__PURE__ */ T(m, {
|
|
664
|
+
label: D("botlit.agentBuilder.aiDisclosureText", "AI Disclosure Notice"),
|
|
665
|
+
htmlFor: Q("ai-disclosure-text"),
|
|
666
|
+
error: Z("aiDisclosureText"),
|
|
667
|
+
description: D("botlit.agentBuilder.aiDisclosureTextHelp", "Leave blank to use the default notice (up to {{max}} characters).", { max: 500 }),
|
|
668
|
+
children: /* @__PURE__ */ T(g, {
|
|
669
|
+
id: Q("ai-disclosure-text"),
|
|
670
|
+
"aria-invalid": Z("aiDisclosureText") ? !0 : void 0,
|
|
671
|
+
placeholder: D("botlit.agentBuilder.aiDisclosureTextPlaceholder", "You are chatting with an AI assistant."),
|
|
672
|
+
value: I.aiDisclosureText,
|
|
673
|
+
onChange: (e) => Y("aiDisclosureText", e.target.value),
|
|
674
|
+
rows: 2,
|
|
675
|
+
className: "text-sm"
|
|
655
676
|
})
|
|
656
|
-
})
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
677
|
+
})]
|
|
678
|
+
}),
|
|
679
|
+
/* @__PURE__ */ E("div", {
|
|
680
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-3",
|
|
681
|
+
children: [
|
|
682
|
+
/* @__PURE__ */ T(m, {
|
|
683
|
+
label: D("botlit.agentBuilder.temperature", "Temperature"),
|
|
684
|
+
htmlFor: Q("temperature"),
|
|
685
|
+
error: Z("temperature"),
|
|
686
|
+
description: D("botlit.agentBuilder.temperatureHelp", "Randomness, {{min}} to {{max}}. 0 is the most predictable. Empty uses {{default}}.", {
|
|
687
|
+
min: x.min,
|
|
688
|
+
max: x.max,
|
|
689
|
+
default: v.temperature
|
|
690
|
+
}),
|
|
691
|
+
children: /* @__PURE__ */ T(h, {
|
|
692
|
+
id: Q("temperature"),
|
|
693
|
+
type: "number",
|
|
694
|
+
step: "0.1",
|
|
695
|
+
min: x.min,
|
|
696
|
+
max: x.max,
|
|
697
|
+
placeholder: String(v.temperature),
|
|
698
|
+
"aria-invalid": Z("temperature") ? !0 : void 0,
|
|
699
|
+
"aria-describedby": Z("temperature") ? `${Q("temperature")}-error` : `${Q("temperature")}-description`,
|
|
700
|
+
value: I.temperature,
|
|
701
|
+
onChange: (e) => Y("temperature", e.target.value)
|
|
702
|
+
})
|
|
665
703
|
}),
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
704
|
+
/* @__PURE__ */ T(m, {
|
|
705
|
+
label: D("botlit.agentBuilder.maxTokens", "Max Tokens"),
|
|
706
|
+
htmlFor: Q("max-tokens"),
|
|
707
|
+
error: Z("maxTokens"),
|
|
708
|
+
description: D("botlit.agentBuilder.maxTokensHelp", "Maximum response length, {{min}} to {{max}}. Empty uses {{default}}.", {
|
|
709
|
+
min: b.min,
|
|
710
|
+
max: b.max,
|
|
711
|
+
default: v.maxTokens
|
|
712
|
+
}),
|
|
713
|
+
children: /* @__PURE__ */ T(h, {
|
|
714
|
+
id: Q("max-tokens"),
|
|
715
|
+
type: "number",
|
|
716
|
+
step: "1",
|
|
717
|
+
min: b.min,
|
|
718
|
+
max: b.max,
|
|
719
|
+
placeholder: String(v.maxTokens),
|
|
720
|
+
"aria-invalid": Z("maxTokens") ? !0 : void 0,
|
|
721
|
+
"aria-describedby": Z("maxTokens") ? `${Q("max-tokens")}-error` : `${Q("max-tokens")}-description`,
|
|
722
|
+
value: I.maxTokens,
|
|
723
|
+
onChange: (e) => Y("maxTokens", e.target.value)
|
|
724
|
+
})
|
|
687
725
|
}),
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
726
|
+
/* @__PURE__ */ T(m, {
|
|
727
|
+
label: D("botlit.agentBuilder.maxConcurrent", "Max Concurrent Runs"),
|
|
728
|
+
htmlFor: Q("max-concurrent"),
|
|
729
|
+
error: Z("maxConcurrentExecutions"),
|
|
730
|
+
description: D("botlit.agentBuilder.maxConcurrentHelp", "How many runs can happen at once, {{min}} to {{max}}. Empty uses {{default}}.", {
|
|
731
|
+
min: y.min,
|
|
732
|
+
max: y.max,
|
|
733
|
+
default: v.maxConcurrentExecutions
|
|
734
|
+
}),
|
|
735
|
+
children: /* @__PURE__ */ T(h, {
|
|
736
|
+
id: Q("max-concurrent"),
|
|
737
|
+
type: "number",
|
|
738
|
+
step: "1",
|
|
739
|
+
min: y.min,
|
|
740
|
+
max: y.max,
|
|
741
|
+
placeholder: String(v.maxConcurrentExecutions),
|
|
742
|
+
"aria-invalid": Z("maxConcurrentExecutions") ? !0 : void 0,
|
|
743
|
+
"aria-describedby": Z("maxConcurrentExecutions") ? `${Q("max-concurrent")}-error` : `${Q("max-concurrent")}-description`,
|
|
744
|
+
value: I.maxConcurrentExecutions,
|
|
745
|
+
onChange: (e) => Y("maxConcurrentExecutions", e.target.value)
|
|
746
|
+
})
|
|
699
747
|
})
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
748
|
+
]
|
|
749
|
+
})
|
|
750
|
+
]
|
|
703
751
|
})]
|
|
704
752
|
})
|
|
705
753
|
}),
|
|
706
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ T("div", {
|
|
707
755
|
role: "tabpanel",
|
|
708
756
|
id: "agent-panel-model",
|
|
709
757
|
"aria-labelledby": "agent-tab-model",
|
|
710
|
-
hidden:
|
|
711
|
-
children: /* @__PURE__ */
|
|
758
|
+
hidden: L !== "model",
|
|
759
|
+
children: /* @__PURE__ */ E(r, {
|
|
712
760
|
treatment: "glass",
|
|
713
761
|
glow: !0,
|
|
714
|
-
children: [/* @__PURE__ */
|
|
762
|
+
children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ T(s, { children: D("botlit.agentBuilder.model.title", "LLM Configuration") }), /* @__PURE__ */ T(a, { children: D("botlit.agentBuilder.model.description", "Select the LLM model for this agent") })] }), /* @__PURE__ */ E(i, {
|
|
715
763
|
className: "space-y-6",
|
|
716
764
|
children: [
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
label:
|
|
719
|
-
htmlFor:
|
|
720
|
-
description:
|
|
765
|
+
/* @__PURE__ */ E(m, {
|
|
766
|
+
label: D("botlit.agentBuilder.model.label", "LLM Model"),
|
|
767
|
+
htmlFor: Q("model"),
|
|
768
|
+
description: D("botlit.agentBuilder.model.help", "An agent needs a model before it can go live. You can save it as a draft without one and test it in chat once a model is set."),
|
|
721
769
|
children: [
|
|
722
|
-
|
|
770
|
+
U && /* @__PURE__ */ T("p", {
|
|
723
771
|
role: "status",
|
|
724
|
-
children:
|
|
772
|
+
children: D("botlit.agentBuilder.model.loading", "Loading answer models…")
|
|
725
773
|
}),
|
|
726
|
-
|
|
774
|
+
W && /* @__PURE__ */ E("div", {
|
|
727
775
|
role: "alert",
|
|
728
|
-
children: [/* @__PURE__ */
|
|
776
|
+
children: [/* @__PURE__ */ T("p", { children: D("botlit.agentBuilder.model.loadFailed", "Could not load answer models.") }), /* @__PURE__ */ T(c, {
|
|
729
777
|
type: "button",
|
|
730
778
|
variant: "secondary",
|
|
731
779
|
onClick: () => {
|
|
732
|
-
|
|
780
|
+
it(), et();
|
|
733
781
|
},
|
|
734
|
-
children:
|
|
782
|
+
children: D("botlit.agentBuilder.model.retry", "Retry model catalog")
|
|
735
783
|
})]
|
|
736
784
|
}),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
id:
|
|
739
|
-
"aria-describedby": `${
|
|
740
|
-
disabled:
|
|
741
|
-
className:
|
|
742
|
-
value:
|
|
743
|
-
onChange: (e) =>
|
|
785
|
+
/* @__PURE__ */ E(we, {
|
|
786
|
+
id: Q("model"),
|
|
787
|
+
"aria-describedby": `${Q("model")}-description`,
|
|
788
|
+
disabled: U || !!W,
|
|
789
|
+
className: Ie,
|
|
790
|
+
value: I.llmModelId,
|
|
791
|
+
onChange: (e) => Y("llmModelId", e.target.value),
|
|
744
792
|
children: [
|
|
745
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ T("option", {
|
|
746
794
|
value: "",
|
|
747
|
-
children:
|
|
795
|
+
children: D("botlit.agentBuilder.model.none", "Select a model...")
|
|
748
796
|
}),
|
|
749
|
-
Dt && /* @__PURE__ */
|
|
750
|
-
value:
|
|
751
|
-
children:
|
|
797
|
+
Dt && /* @__PURE__ */ T("option", {
|
|
798
|
+
value: I.llmModelId,
|
|
799
|
+
children: D("botlit.agentBuilder.model.unavailable", "Unavailable model ({{id}})", { id: I.llmModelId })
|
|
752
800
|
}),
|
|
753
|
-
|
|
801
|
+
G.map((e) => /* @__PURE__ */ E("option", {
|
|
754
802
|
value: e.id,
|
|
755
803
|
children: [
|
|
756
804
|
e.name,
|
|
@@ -763,46 +811,46 @@ var Ie = [
|
|
|
763
811
|
})
|
|
764
812
|
]
|
|
765
813
|
}),
|
|
766
|
-
!
|
|
767
|
-
idPrefix:
|
|
768
|
-
value:
|
|
769
|
-
onChange: (e) =>
|
|
770
|
-
primaryModelId:
|
|
771
|
-
models:
|
|
814
|
+
!U && !W && /* @__PURE__ */ T(d, {
|
|
815
|
+
idPrefix: Q("model"),
|
|
816
|
+
value: I.fallbackModelIds,
|
|
817
|
+
onChange: (e) => Y("fallbackModelIds", e),
|
|
818
|
+
primaryModelId: I.llmModelId,
|
|
819
|
+
models: G.map((e) => ({
|
|
772
820
|
id: e.id,
|
|
773
821
|
name: e.name,
|
|
774
822
|
modelId: e.modelId,
|
|
775
|
-
providerName:
|
|
823
|
+
providerName: H?.find((t) => t.id === e.providerId)?.name
|
|
776
824
|
}))
|
|
777
825
|
}),
|
|
778
|
-
|
|
826
|
+
mt && !U && !W && /* @__PURE__ */ E("div", {
|
|
779
827
|
role: "status",
|
|
780
828
|
className: "flex items-start gap-2 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-3 text-sm",
|
|
781
|
-
children: [/* @__PURE__ */
|
|
829
|
+
children: [/* @__PURE__ */ T(O, {
|
|
782
830
|
size: 16,
|
|
783
831
|
className: "mt-0.5 shrink-0 text-status-warning-text",
|
|
784
832
|
"aria-hidden": "true"
|
|
785
|
-
}), /* @__PURE__ */
|
|
833
|
+
}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", { children: G.length === 0 ? D("botlit.agentBuilder.model.noneConfigured", "No provider or model is configured in this workspace yet, so this agent cannot go live. Add a provider and a model in Settings first.") : D("botlit.agentBuilder.model.noneChosen", "No model is chosen. The agent can be saved as a draft, but it cannot go live until it has one.") }), G.length === 0 && /* @__PURE__ */ T(c, {
|
|
786
834
|
type: "button",
|
|
787
835
|
variant: "ghost",
|
|
788
836
|
className: "px-0",
|
|
789
|
-
onClick: () =>
|
|
790
|
-
children:
|
|
837
|
+
onClick: () => A("settings"),
|
|
838
|
+
children: D("botlit.agentBuilder.model.openSettings", "Open Settings")
|
|
791
839
|
})] })]
|
|
792
840
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ E("div", {
|
|
794
842
|
className: "rounded-lg bg-bg-sunken p-4",
|
|
795
|
-
children: [/* @__PURE__ */
|
|
843
|
+
children: [/* @__PURE__ */ T("h4", {
|
|
796
844
|
className: "mb-2 text-sm font-medium",
|
|
797
|
-
children:
|
|
798
|
-
}), /* @__PURE__ */
|
|
845
|
+
children: D("botlit.agentBuilder.model.providers", "Available Providers")
|
|
846
|
+
}), /* @__PURE__ */ E("div", {
|
|
799
847
|
className: "grid grid-cols-2 gap-2",
|
|
800
|
-
children: [
|
|
848
|
+
children: [H?.map((e) => /* @__PURE__ */ E("div", {
|
|
801
849
|
className: "text-sm",
|
|
802
|
-
children: [/* @__PURE__ */
|
|
850
|
+
children: [/* @__PURE__ */ T("span", {
|
|
803
851
|
className: "font-medium",
|
|
804
852
|
children: e.name
|
|
805
|
-
}), /* @__PURE__ */
|
|
853
|
+
}), /* @__PURE__ */ E("span", {
|
|
806
854
|
className: "ml-2 text-text-secondary",
|
|
807
855
|
children: [
|
|
808
856
|
"(",
|
|
@@ -810,9 +858,9 @@ var Ie = [
|
|
|
810
858
|
")"
|
|
811
859
|
]
|
|
812
860
|
})]
|
|
813
|
-
}, e.id)), !
|
|
861
|
+
}, e.id)), !U && !W && !H?.length && /* @__PURE__ */ T("p", {
|
|
814
862
|
className: "text-sm text-text-secondary",
|
|
815
|
-
children:
|
|
863
|
+
children: D("botlit.agentBuilder.model.noProviders", "No providers configured")
|
|
816
864
|
})]
|
|
817
865
|
})]
|
|
818
866
|
})
|
|
@@ -820,89 +868,89 @@ var Ie = [
|
|
|
820
868
|
})]
|
|
821
869
|
})
|
|
822
870
|
}),
|
|
823
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ T("div", {
|
|
824
872
|
role: "tabpanel",
|
|
825
873
|
id: "agent-panel-tools",
|
|
826
874
|
"aria-labelledby": "agent-tab-tools",
|
|
827
|
-
hidden:
|
|
828
|
-
children: /* @__PURE__ */
|
|
875
|
+
hidden: L !== "tools",
|
|
876
|
+
children: /* @__PURE__ */ E("div", {
|
|
829
877
|
className: "space-y-6",
|
|
830
878
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ E(r, {
|
|
832
880
|
treatment: "glass",
|
|
833
881
|
glow: !0,
|
|
834
|
-
children: [/* @__PURE__ */
|
|
882
|
+
children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ E(s, {
|
|
835
883
|
className: "flex items-center gap-2",
|
|
836
|
-
children: [/* @__PURE__ */
|
|
884
|
+
children: [/* @__PURE__ */ T(Ae, {
|
|
837
885
|
size: 18,
|
|
838
886
|
"aria-hidden": "true"
|
|
839
|
-
}),
|
|
840
|
-
}), /* @__PURE__ */
|
|
841
|
-
legend:
|
|
842
|
-
items:
|
|
887
|
+
}), D("botlit.agentBuilder.tools.title", "MCP servers")]
|
|
888
|
+
}), /* @__PURE__ */ T(a, { children: D("botlit.agentBuilder.tools.description", "The tools of the servers you attach are available to the agent when MCP Tools is on.") })] }), /* @__PURE__ */ T(i, { children: /* @__PURE__ */ T(Le, {
|
|
889
|
+
legend: D("botlit.agentBuilder.tools.legend", "MCP servers attached to this agent"),
|
|
890
|
+
items: ct.map((e) => ({
|
|
843
891
|
id: e.id,
|
|
844
892
|
name: e.name,
|
|
845
893
|
detail: e.status
|
|
846
894
|
})),
|
|
847
|
-
selected:
|
|
895
|
+
selected: I.mcpConnectionIds,
|
|
848
896
|
missing: Et,
|
|
849
|
-
loading:
|
|
850
|
-
error:
|
|
851
|
-
onRetry: () => void
|
|
852
|
-
onToggle: (e) =>
|
|
853
|
-
emptyText:
|
|
854
|
-
resource:
|
|
897
|
+
loading: lt,
|
|
898
|
+
error: ut,
|
|
899
|
+
onRetry: () => void dt(),
|
|
900
|
+
onToggle: (e) => X("mcpConnectionIds", e),
|
|
901
|
+
emptyText: D("botlit.agentBuilder.tools.empty", "No MCP servers in this workspace yet. Add one on the MCP Servers page."),
|
|
902
|
+
resource: D("botlit.agentBuilder.tools.resource", "MCP servers")
|
|
855
903
|
}) })]
|
|
856
904
|
}),
|
|
857
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ E(r, {
|
|
858
906
|
treatment: "glass",
|
|
859
907
|
glow: !0,
|
|
860
|
-
children: [/* @__PURE__ */
|
|
908
|
+
children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ E(s, {
|
|
861
909
|
className: "flex items-center gap-2",
|
|
862
|
-
children: [/* @__PURE__ */
|
|
910
|
+
children: [/* @__PURE__ */ T(Ee, {
|
|
863
911
|
size: 18,
|
|
864
912
|
"aria-hidden": "true"
|
|
865
|
-
}),
|
|
866
|
-
}), /* @__PURE__ */
|
|
867
|
-
legend:
|
|
868
|
-
items:
|
|
913
|
+
}), D("botlit.agentBuilder.knowledge.title", "Knowledge bases")]
|
|
914
|
+
}), /* @__PURE__ */ T(a, { children: D("botlit.agentBuilder.knowledge.description", "The agent answers from the knowledge bases you attach when RAG is on.") })] }), /* @__PURE__ */ T(i, { children: /* @__PURE__ */ T(Le, {
|
|
915
|
+
legend: D("botlit.agentBuilder.knowledge.legend", "Knowledge bases attached to this agent"),
|
|
916
|
+
items: K.map((e) => ({
|
|
869
917
|
id: e.id,
|
|
870
918
|
name: e.name,
|
|
871
919
|
detail: e.indexStatus
|
|
872
920
|
})),
|
|
873
|
-
selected:
|
|
874
|
-
missing:
|
|
875
|
-
loading:
|
|
876
|
-
error:
|
|
877
|
-
onRetry: () => void
|
|
878
|
-
onToggle: (e) =>
|
|
879
|
-
emptyText:
|
|
880
|
-
resource:
|
|
921
|
+
selected: I.knowledgeBaseIds,
|
|
922
|
+
missing: wt,
|
|
923
|
+
loading: at,
|
|
924
|
+
error: ot,
|
|
925
|
+
onRetry: () => void st(),
|
|
926
|
+
onToggle: (e) => X("knowledgeBaseIds", e),
|
|
927
|
+
emptyText: D("botlit.agentBuilder.knowledge.empty", "No knowledge bases in this workspace yet. Create one on the Knowledge Bases page."),
|
|
928
|
+
resource: D("botlit.agentBuilder.knowledge.resource", "knowledge bases")
|
|
881
929
|
}) })]
|
|
882
930
|
}),
|
|
883
|
-
|
|
931
|
+
J.length > 0 && /* @__PURE__ */ T("ul", {
|
|
884
932
|
role: "status",
|
|
885
933
|
className: "space-y-1 text-sm text-status-warning-text",
|
|
886
|
-
children:
|
|
934
|
+
children: J.map((e) => /* @__PURE__ */ E("li", {
|
|
887
935
|
className: "flex items-start gap-2",
|
|
888
|
-
children: [/* @__PURE__ */
|
|
936
|
+
children: [/* @__PURE__ */ T(O, {
|
|
889
937
|
size: 14,
|
|
890
938
|
className: "mt-0.5 shrink-0",
|
|
891
939
|
"aria-hidden": "true"
|
|
892
|
-
}),
|
|
940
|
+
}), yt(e)]
|
|
893
941
|
}, e))
|
|
894
942
|
}),
|
|
895
|
-
|
|
943
|
+
Tt.length > 0 && /* @__PURE__ */ T("ul", {
|
|
896
944
|
role: "status",
|
|
897
945
|
"data-testid": "builder-knowledge-not-ready",
|
|
898
946
|
className: "space-y-1 text-sm text-status-warning-text",
|
|
899
|
-
children:
|
|
947
|
+
children: Tt.map((e) => /* @__PURE__ */ E("li", {
|
|
900
948
|
className: "flex items-start gap-2",
|
|
901
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ T(O, {
|
|
902
950
|
size: 14,
|
|
903
951
|
className: "mt-0.5 shrink-0",
|
|
904
952
|
"aria-hidden": "true"
|
|
905
|
-
}),
|
|
953
|
+
}), D("botlit.agentBuilder.knowledge.notReady", "\"{{name}}\" is {{status}}. An agent with RAG on cannot answer until it is ready.", {
|
|
906
954
|
name: e.name,
|
|
907
955
|
status: e.indexStatus.toLowerCase()
|
|
908
956
|
})]
|
|
@@ -911,23 +959,23 @@ var Ie = [
|
|
|
911
959
|
]
|
|
912
960
|
})
|
|
913
961
|
}),
|
|
914
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ E("div", {
|
|
915
963
|
className: "flex justify-between pt-6",
|
|
916
|
-
children: [/* @__PURE__ */
|
|
964
|
+
children: [/* @__PURE__ */ T(c, {
|
|
917
965
|
type: "button",
|
|
918
966
|
variant: "outline",
|
|
919
|
-
onClick: () =>
|
|
920
|
-
disabled:
|
|
921
|
-
children:
|
|
922
|
-
}),
|
|
967
|
+
onClick: () => $(N[Math.max(0, N.indexOf(L) - 1)]),
|
|
968
|
+
disabled: L === N[0],
|
|
969
|
+
children: D("botlit.agentBuilder.previous", "Previous")
|
|
970
|
+
}), L === N[N.length - 1] ? /* @__PURE__ */ T(c, {
|
|
923
971
|
type: "submit",
|
|
924
|
-
leftIcon: /* @__PURE__ */
|
|
925
|
-
isLoading:
|
|
926
|
-
children:
|
|
927
|
-
}, "submit") : /* @__PURE__ */
|
|
972
|
+
leftIcon: /* @__PURE__ */ T(De, { size: 16 }),
|
|
973
|
+
isLoading: B,
|
|
974
|
+
children: vt
|
|
975
|
+
}, "submit") : /* @__PURE__ */ T(c, {
|
|
928
976
|
type: "button",
|
|
929
|
-
onClick: () =>
|
|
930
|
-
children:
|
|
977
|
+
onClick: () => $(N[N.indexOf(L) + 1]),
|
|
978
|
+
children: D("botlit.agentBuilder.next", "Next")
|
|
931
979
|
}, "next")]
|
|
932
980
|
})
|
|
933
981
|
]
|
|
@@ -935,56 +983,56 @@ var Ie = [
|
|
|
935
983
|
]
|
|
936
984
|
})]
|
|
937
985
|
});
|
|
938
|
-
},
|
|
986
|
+
}, Le = ({ legend: t, items: n, selected: r, missing: i, loading: a, error: o, onRetry: s, onToggle: c, emptyText: l, resource: u }) => {
|
|
939
987
|
let d = e();
|
|
940
|
-
return a ? /* @__PURE__ */
|
|
988
|
+
return a ? /* @__PURE__ */ T("p", {
|
|
941
989
|
role: "status",
|
|
942
990
|
"aria-busy": "true",
|
|
943
991
|
className: "text-sm text-text-secondary",
|
|
944
992
|
children: d("botlit.agentBuilder.attachments.loading", "Loading {{resource}}…", { resource: u })
|
|
945
|
-
}) : o ? /* @__PURE__ */
|
|
993
|
+
}) : o ? /* @__PURE__ */ T(p, {
|
|
946
994
|
resource: u,
|
|
947
995
|
error: o,
|
|
948
996
|
onRetry: s
|
|
949
|
-
}) : n.length === 0 && i.length === 0 ? /* @__PURE__ */
|
|
997
|
+
}) : n.length === 0 && i.length === 0 ? /* @__PURE__ */ T("p", {
|
|
950
998
|
className: "text-sm text-text-secondary",
|
|
951
999
|
children: l
|
|
952
|
-
}) : /* @__PURE__ */
|
|
1000
|
+
}) : /* @__PURE__ */ E("fieldset", { children: [/* @__PURE__ */ T("legend", {
|
|
953
1001
|
className: "sr-only",
|
|
954
1002
|
children: t
|
|
955
|
-
}), /* @__PURE__ */
|
|
1003
|
+
}), /* @__PURE__ */ E("ul", {
|
|
956
1004
|
className: "grid grid-cols-1 gap-2 md:grid-cols-2",
|
|
957
|
-
children: [n.map((e) => /* @__PURE__ */
|
|
1005
|
+
children: [n.map((e) => /* @__PURE__ */ T("li", { children: /* @__PURE__ */ E("label", {
|
|
958
1006
|
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-border-subtle p-3 hover:bg-accent",
|
|
959
|
-
children: [/* @__PURE__ */
|
|
1007
|
+
children: [/* @__PURE__ */ T("input", {
|
|
960
1008
|
type: "checkbox",
|
|
961
1009
|
className: "mt-0.5 h-4 w-4 rounded border-border-default",
|
|
962
1010
|
checked: r.includes(e.id),
|
|
963
1011
|
onChange: () => c(e.id)
|
|
964
|
-
}), /* @__PURE__ */
|
|
1012
|
+
}), /* @__PURE__ */ E("span", { children: [/* @__PURE__ */ T("span", {
|
|
965
1013
|
className: "block text-sm font-medium",
|
|
966
1014
|
children: e.name
|
|
967
|
-
}), e.detail && /* @__PURE__ */
|
|
1015
|
+
}), e.detail && /* @__PURE__ */ T("span", {
|
|
968
1016
|
className: "block text-xs text-text-secondary",
|
|
969
1017
|
children: e.detail
|
|
970
1018
|
})] })]
|
|
971
|
-
}) }, e.id)), i.map((e) => /* @__PURE__ */
|
|
1019
|
+
}) }, e.id)), i.map((e) => /* @__PURE__ */ T("li", { children: /* @__PURE__ */ E("label", {
|
|
972
1020
|
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-status-warning-border p-3",
|
|
973
|
-
children: [/* @__PURE__ */
|
|
1021
|
+
children: [/* @__PURE__ */ T("input", {
|
|
974
1022
|
type: "checkbox",
|
|
975
1023
|
className: "mt-0.5 h-4 w-4 rounded border-border-default",
|
|
976
1024
|
checked: !0,
|
|
977
1025
|
onChange: () => c(e)
|
|
978
|
-
}), /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
1026
|
+
}), /* @__PURE__ */ E("span", { children: [
|
|
1027
|
+
/* @__PURE__ */ T("span", {
|
|
980
1028
|
className: "block text-sm font-medium",
|
|
981
1029
|
children: d("botlit.agentBuilder.attachments.missing", "No longer available")
|
|
982
1030
|
}),
|
|
983
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ T("span", {
|
|
984
1032
|
className: "block font-mono text-xs text-text-secondary",
|
|
985
1033
|
children: e
|
|
986
1034
|
}),
|
|
987
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ T("span", {
|
|
988
1036
|
className: "block text-xs text-text-secondary",
|
|
989
1037
|
children: d("botlit.agentBuilder.attachments.missingHelp", "Untick to remove it from this agent.")
|
|
990
1038
|
})
|
|
@@ -992,6 +1040,6 @@ var Ie = [
|
|
|
992
1040
|
}) }, e))]
|
|
993
1041
|
})] });
|
|
994
1042
|
};
|
|
995
|
-
export {
|
|
1043
|
+
export { P as AgentBuilderPage };
|
|
996
1044
|
|
|
997
1045
|
//# sourceMappingURL=AgentBuilderPage.js.map
|