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