@burdenoff/microfe-botmanor 2026.1203.1 → 2026.1203.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.
@@ -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 te } from "../components/Input.js";
13
- import { useAgent as g, useCreateAgent as ne, useUpdateAgent as re } from "../hooks/useAgents.js";
14
- import { useBot as ie, useUpdateBot as ae } from "../hooks/useBots.js";
15
- import { useLinkAgentToBot as oe } from "../hooks/useBotAgents.js";
16
- import { CreateFromTemplate as se } from "../components/CreateFromTemplate.js";
17
- import { DescribeBotDialog as ce } from "../components/DescribeBotDialog.js";
18
- import { useKnowledgeBases as le } from "../hooks/useKnowledgeBases.js";
19
- import { useLLMModels as ue, useLLMProviders as de } from "../hooks/useLLMProviders.js";
20
- import { useMCPServers as fe } from "../hooks/useMCPServers.js";
21
- import { AGENT_DEFAULTS as _, AGENT_FIELD_MESSAGES as pe, AGENT_FIELD_TAB as me, AGENT_MAX_CONCURRENT_RANGE as v, AGENT_MAX_TOKENS_RANGE as y, AGENT_TEMPERATURE_RANGE as b, OFFERED_CAPABILITIES as he, agentSlugFor as ge, capabilityWarnings as _e, parseNumberField as x, validateAgentForm as ve } from "../utils/agentSettings.js";
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 ye } from "../utils/cn.js";
24
- import { configuredAnswerModels as be } from "../utils/embedding-models.js";
25
- import { slugify as xe } from "../utils/botIdentity.js";
26
- import { toUnion as S } from "../utils/unions.js";
27
- import { useMemo as Se, useRef as Ce, useState as C } from "react";
28
- import { PagePurpose as we, ThemedSelect as Te } from "@burdenoff/fe-libs/ui";
29
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
30
- import { useParams as E } from "react-router";
31
- import { AlertTriangle as D, ArrowLeft as Ee, Brain as De, Save as Oe, Settings as ke, Sparkles as Ae, Wrench as je } from "lucide-react";
32
- import { toast as O } from "sonner";
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 k = [
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
- ], Me = [
43
+ ], je = [
44
44
  "ASSISTANT",
45
45
  "ANALYST",
46
46
  "AUTOMATION",
47
47
  "SPECIALIST"
48
48
  ];
49
- function Ne(e) {
49
+ function Me(e) {
50
50
  return e.flatMap((e) => {
51
- let t = k.find((t) => t === e);
51
+ let t = A.find((t) => t === e);
52
52
  return t ? [t] : [];
53
53
  });
54
54
  }
55
- var A = "🤖", Pe = [
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
- ], j = "You are a helpful AI assistant. Be concise, accurate, and friendly.", M = [
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 Fe(e) {
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 || A,
127
+ avatar: e.avatar || j,
128
128
  type: e.type || "ASSISTANT",
129
- visibility: S(e.visibility, Ie, "PRIVATE"),
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: A,
145
+ avatar: j,
144
146
  type: "ASSISTANT",
145
147
  visibility: "PRIVATE",
146
- systemPrompt: j,
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 Ie = [
161
+ var Fe = [
158
162
  "PRIVATE",
159
163
  "WORKSPACE",
160
164
  "PUBLIC"
161
- ], Le = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", N = () => {
162
- let r = e(), { agentId: i, botId: a } = E(), { navigateTo: o } = t(), { data: s, loading: l, error: d, refetch: f } = g(i);
163
- return i ? l ? /* @__PURE__ */ w(n, {
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__ */ w("div", {
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__ */ w(n, {
175
+ }) : d ? /* @__PURE__ */ T(n, {
172
176
  title: r("botlit.agentBuilder.editTitle", "Edit Agent"),
173
- children: /* @__PURE__ */ w(p, {
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__ */ w(P, {
182
+ }) : s ? /* @__PURE__ */ T(F, {
179
183
  agent: s,
180
184
  botId: a
181
- }, s.id) : /* @__PURE__ */ w(n, {
185
+ }, s.id) : /* @__PURE__ */ T(n, {
182
186
  title: r("botlit.agentDetail.notFound.title", "Agent Not Found"),
183
- children: /* @__PURE__ */ w(u, {
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__ */ w(c, {
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__ */ w(P, { botId: a });
194
- }, P = ({ agent: u, botId: g }) => {
195
- let E = e(), { navigateTo: k, workspaceId: A } = t(), j = !!u, N = g ? `bots/${g}/agents` : "agents", P = u ? `${N}/${u.id}` : N, [F, ze] = C(() => Fe(u)), [I, Be] = C("basics"), [L, Ve] = C(!1), He = Ce({}), [Ue, We] = ne(), [Ge, Ke] = re(), [qe] = oe(), [Je] = ae(), { data: Ye, loading: Xe, error: R, refetch: Ze } = ie(g), Qe = ee(), z = We.loading || Ke.loading, B = !!g && !u, { data: V, loading: $e, error: et, refetch: tt } = de(), { data: nt, loading: rt, error: it, refetch: at } = ue(), H = $e || rt, U = et || it, W = be(nt ?? [], V ?? []), { data: G, loading: ot, error: st, refetch: ct } = le(), { data: lt, loading: ut, error: dt, refetch: ft } = fe(), K = Se(() => ve(F), [F]), pt = Object.keys(K).length, mt = (e) => L && Object.keys(K).some((t) => me[t] === e), q = _e({
196
- capabilities: F.capabilities,
197
- mcpServerCount: F.mcpConnectionIds.length,
198
- knowledgeBaseCount: F.knowledgeBaseIds.length
199
- }), ht = F.llmModelId === "", J = (e, t) => ze((n) => ({
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
- })), Y = (e, t) => ze((n) => ({
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
- })), X = (e) => {
206
- let t = L ? K[e] : void 0;
207
- if (t) return E(`botlit.agentBuilder.errors.${t}`, pe[t]);
208
- }, Z = (e) => `agent-form-${e}`, Q = (e) => {
209
- Be(e), He.current[e]?.focus();
210
- }, gt = (e, t) => {
211
- let n = M.length - 1, r = e.key === "ArrowRight" ? (t + 1) % M.length : e.key === "ArrowLeft" ? (t - 1 + M.length) % M.length : e.key === "Home" ? 0 : e.key === "End" ? n : void 0;
212
- r !== void 0 && (e.preventDefault(), Q(M[r]));
213
- }, _t = [
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: E("botlit.agentBuilder.tabs.basics", "Basic Info"),
217
- icon: /* @__PURE__ */ w(Ae, { size: 18 })
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: E("botlit.agentBuilder.tabs.prompt", "Prompt"),
222
- icon: /* @__PURE__ */ w(De, { size: 18 })
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: E("botlit.agentBuilder.tabs.model", "LLM Model"),
227
- icon: /* @__PURE__ */ w(ke, { size: 18 })
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: E("botlit.agentBuilder.tabs.tools", "Tools & Knowledge"),
232
- icon: /* @__PURE__ */ w(je, { size: 18 })
235
+ label: D("botlit.agentBuilder.tabs.tools", "Tools & Knowledge"),
236
+ icon: /* @__PURE__ */ T(Ae, { size: 18 })
233
237
  }
234
- ], vt = async (e) => {
235
- if (e.preventDefault(), z || B && Xe) return;
236
- if (B && R) {
237
- O.error(E("botlit.agentBuilder.botUnavailable", "The bot could not be read, so the agent cannot be linked to it yet. Try again."));
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 (!A) {
241
- O.error(E("botlit.agentBuilder.noWorkspace", "No workspace is selected yet. Wait for it to load, or pick a workspace, then save again."));
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 (pt > 0) {
245
- Ve(!0);
246
- let e = M.find((e) => Object.keys(K).some((t) => me[t] === e));
247
- e && Q(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 = F.llmModelId !== (u?.llmModelId ?? "");
251
- if (F.llmModelId && t) {
252
- if (H) {
253
- O.error(E("botlit.agentBuilder.modelLoading", "The model list is still loading. Try again in a moment.")), Q("model");
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 (U || !W.some((e) => e.id === F.llmModelId)) {
257
- O.error(E("botlit.agentBuilder.modelUnavailable", "Choose an active answer model from the available catalog.")), Q("model");
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 = F.name.trim(), r = ge(n, F.slug), i = x(F.temperature), a = x(F.maxTokens), o = x(F.maxConcurrentExecutions), s = F.description.trim(), c = S(F.type, Me, "ASSISTANT"), l = Ne(F.capabilities);
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 Ge({
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: F.avatar,
271
- systemPrompt: F.systemPrompt.trim(),
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: F.llmModelId === "" ? null : F.llmModelId,
277
- fallbackModelIds: F.fallbackModelIds.filter((e) => e !== F.llmModelId),
278
- knowledgeBaseIds: F.knowledgeBaseIds,
279
- mcpConnectionIds: F.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: F.visibility
287
+ visibility: I.visibility
282
288
  }
283
- }), O.success(E("botlit.agentBuilder.updated", "Agent \"{{name}}\" updated successfully", { name: n })), k(P);
289
+ }), k.success(D("botlit.agentBuilder.updated", "Agent \"{{name}}\" updated successfully", { name: n })), A(F);
284
290
  return;
285
291
  }
286
- let e = await Ue({
287
- workspaceId: A,
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: F.avatar,
293
- systemPrompt: F.systemPrompt.trim(),
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: F.llmModelId === "" ? void 0 : F.llmModelId,
299
- fallbackModelIds: F.fallbackModelIds.filter((e) => e !== F.llmModelId),
300
- knowledgeBaseIds: F.knowledgeBaseIds,
301
- mcpConnectionIds: F.mcpConnectionIds,
302
- visibility: F.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 (O.success(E("botlit.agentBuilder.created", "Agent \"{{name}}\" created successfully", { name: n })), g) {
305
- if (!Qe(f.APP_AGENT_CREATE)) {
306
- O.error(E("botlit.agentBuilder.linkNotAllowed", "The agent was created, but you are not allowed to link agents to bots, so it is not linked.")), k(`agents/${e.id}`);
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 qe({
311
- botId: g,
318
+ await Ke({
319
+ botId: _,
312
320
  agentId: e.id
313
321
  });
314
322
  } catch (t) {
315
- O.error(t instanceof Error ? E("botlit.agentBuilder.linkFailed", "The agent was created but could not be linked to the bot: {{message}}", { message: t.message }) : E("botlit.agentBuilder.linkFailedShort", "The agent was created but could not be linked to the bot")), k(`agents/${e.id}`);
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 (Ye && !Ye.defaultAgentId && Qe(f.APP_UPDATE)) try {
319
- await Je({
320
- botId: g,
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
- O.error(e instanceof Error ? E("botlit.agentBuilder.defaultFailed", "The agent was linked, but it could not be set as the bot default: {{message}}", { message: e.message }) : E("botlit.agentBuilder.defaultFailedShort", "The agent was linked, but it could not be set as the bot default"));
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
- k(`bots/${g}/agents`);
334
+ A(`bots/${_}/agents`);
327
335
  return;
328
336
  }
329
- k(`agents/${e.id}`);
337
+ A(`agents/${e.id}`);
330
338
  } catch (e) {
331
- O.error(e instanceof Error ? e.message : E("botlit.agentBuilder.saveFailed", "Failed to save agent"));
339
+ k.error(e instanceof Error ? e.message : D("botlit.agentBuilder.saveFailed", "Failed to save agent"));
332
340
  }
333
- }, yt = j ? E("botlit.agentBuilder.save", "Save Changes") : E("botlit.agentBuilder.create", "Create Agent"), bt = (e) => {
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 E("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.");
336
- case "ragNeedsKnowledgeBase": return E("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.");
337
- case "serversNeedMcpTools": return E("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.");
338
- case "knowledgeBasesNeedRag": return E("botlit.agentBuilder.warnings.knowledgeBasesNeedRag", "Knowledge bases are attached but RAG is off, so the agent ignores them. Turn RAG on or detach them.");
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
- }, xt = {
348
+ }, bt = {
341
349
  MCP_TOOLS: {
342
- label: E("botlit.agentBuilder.capabilities.mcpTools", "MCP Tools"),
343
- description: E("botlit.agentBuilder.capabilities.mcpToolsDescription", "Let the agent call the tools of the MCP servers attached below.")
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: E("botlit.agentBuilder.capabilities.rag", "RAG"),
347
- description: E("botlit.agentBuilder.capabilities.ragDescription", "Answer from the knowledge bases attached below (retrieval-augmented generation).")
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: E("botlit.agentBuilder.capabilities.a2a", "Agent delegation"),
351
- description: E("botlit.agentBuilder.capabilities.a2aDescription", "Let the agent hand sub-tasks to other agents it is connected to.")
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
- }, St = F.capabilities.filter((e) => !he.includes(e)), Ct = new Set(G.map((e) => e.id)), wt = new Set(lt.map((e) => e.id)), Tt = F.knowledgeBaseIds.filter((e) => !Ct.has(e)), $ = G.filter((e) => F.knowledgeBaseIds.includes(e.id) && e.indexStatus !== "READY"), Et = F.mcpConnectionIds.filter((e) => !wt.has(e)), Dt = F.llmModelId !== "" && !H && !U && !W.some((e) => e.id === F.llmModelId);
354
- return /* @__PURE__ */ T(n, {
355
- title: j ? E("botlit.agentBuilder.editTitle", "Edit Agent") : E("botlit.agentBuilder.createTitle", "Create New Agent"),
356
- leading: /* @__PURE__ */ w(c, {
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": E("botlit.agentBuilder.back", "Back"),
360
- onClick: () => k(P),
361
- children: /* @__PURE__ */ w(Ee, {
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__ */ T("div", {
374
+ actions: /* @__PURE__ */ E("div", {
367
375
  className: "flex gap-2",
368
- children: [/* @__PURE__ */ w(c, {
376
+ children: [/* @__PURE__ */ T(c, {
369
377
  variant: "outline",
370
- onClick: () => k(P),
371
- children: E("botlit.common.cancel", "Cancel")
372
- }), /* @__PURE__ */ w(c, {
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__ */ w(Oe, { size: 16 }),
376
- isLoading: z || B && Xe,
377
- children: yt
383
+ leftIcon: /* @__PURE__ */ T(De, { size: 16 }),
384
+ isLoading: B || V && Ye,
385
+ children: vt
378
386
  })]
379
387
  }),
380
- children: [!u && !g && /* @__PURE__ */ T("div", {
388
+ children: [!u && !_ && /* @__PURE__ */ E("div", {
381
389
  className: "mx-auto mb-6 max-w-4xl space-y-6",
382
- children: [/* @__PURE__ */ w(ce, {
390
+ children: [/* @__PURE__ */ T(se, {
383
391
  scope: "AGENTS",
384
392
  onCreated: (e) => {
385
393
  let t = e.agents[0];
386
- k(e.agents.length === 1 && t ? `agents/${t.id}` : "agents");
394
+ A(e.agents.length === 1 && t ? `agents/${t.id}` : "agents");
387
395
  }
388
- }), /* @__PURE__ */ w(se, {
396
+ }), /* @__PURE__ */ T(oe, {
389
397
  kind: "agent",
390
- onCreated: (e) => k(`agents/${e}`)
398
+ onCreated: (e) => A(`agents/${e}`)
391
399
  })]
392
- }), /* @__PURE__ */ T("form", {
400
+ }), /* @__PURE__ */ E("form", {
393
401
  id: "agent-builder-form",
394
- onSubmit: (e) => void vt(e),
402
+ onSubmit: (e) => void _t(e),
395
403
  noValidate: !0,
396
404
  className: "max-w-4xl mx-auto",
397
405
  children: [
398
- /* @__PURE__ */ w(we, {
406
+ /* @__PURE__ */ T(Ce, {
399
407
  className: "mb-6",
400
- icon: /* @__PURE__ */ w(Ae, { size: 18 }),
401
- children: E("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.")
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
- B && R && /* @__PURE__ */ w("div", {
411
+ V && z && /* @__PURE__ */ T("div", {
404
412
  role: "alert",
405
413
  className: "mb-4",
406
- children: /* @__PURE__ */ w(p, {
407
- resource: E("botlit.agentBuilder.botResource", "this bot"),
408
- error: R,
409
- onRetry: () => void Ze()
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
- !A && /* @__PURE__ */ w("p", {
420
+ !j && /* @__PURE__ */ T("p", {
413
421
  role: "status",
414
422
  className: "mb-4 text-sm text-text-secondary",
415
- children: E("botlit.agentBuilder.noWorkspace", "No workspace is selected yet. Wait for it to load, or pick a workspace, then save again.")
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
- L && pt > 0 && /* @__PURE__ */ T("div", {
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__ */ w(D, {
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__ */ w("p", { children: E("botlit.agentBuilder.errorSummary", "Fix the highlighted fields before saving. Tabs with a problem are marked.") })]
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__ */ w("div", {
434
+ /* @__PURE__ */ T("div", {
427
435
  role: "tablist",
428
- "aria-label": E("botlit.agentBuilder.stepsLabel", "Agent setup steps"),
436
+ "aria-label": D("botlit.agentBuilder.stepsLabel", "Agent setup steps"),
429
437
  className: "mb-8 flex flex-wrap items-center gap-2",
430
- children: _t.map((e, t) => {
431
- let n = I === e.id, r = mt(e.id);
432
- return /* @__PURE__ */ T("button", {
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
- He.current[e.id] = t;
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: () => Be(e.id),
443
- onKeyDown: (e) => gt(e, t),
444
- className: ye("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"),
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__ */ w("span", {
455
+ /* @__PURE__ */ T("span", {
448
456
  className: "font-medium",
449
457
  children: e.label
450
458
  }),
451
- r && /* @__PURE__ */ T("span", {
459
+ r && /* @__PURE__ */ E("span", {
452
460
  className: "text-status-error-text",
453
- children: [/* @__PURE__ */ w(D, {
461
+ children: [/* @__PURE__ */ T(O, {
454
462
  size: 14,
455
463
  "aria-hidden": "true"
456
- }), /* @__PURE__ */ w("span", {
464
+ }), /* @__PURE__ */ T("span", {
457
465
  className: "sr-only",
458
- children: E("botlit.agentBuilder.tabHasProblem", "This step has a problem")
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__ */ T("div", {
473
+ /* @__PURE__ */ E("div", {
466
474
  className: "space-y-6",
467
475
  children: [
468
- /* @__PURE__ */ w("div", {
476
+ /* @__PURE__ */ T("div", {
469
477
  role: "tabpanel",
470
478
  id: "agent-panel-basics",
471
479
  "aria-labelledby": "agent-tab-basics",
472
- hidden: I !== "basics",
473
- children: /* @__PURE__ */ T(r, {
480
+ hidden: L !== "basics",
481
+ children: /* @__PURE__ */ E(r, {
474
482
  treatment: "glass",
475
483
  glow: !0,
476
- children: [/* @__PURE__ */ T(o, { children: [/* @__PURE__ */ w(s, { children: E("botlit.agentBuilder.basics.title", "Basic Information") }), /* @__PURE__ */ w(a, { children: E("botlit.agentBuilder.basics.description", "Set up the agent's identity and purpose") })] }), /* @__PURE__ */ T(i, {
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__ */ T("div", { children: [/* @__PURE__ */ w("p", {
487
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
480
488
  className: "mb-2 text-sm font-medium",
481
- children: E("botlit.agentBuilder.avatar", "Avatar")
482
- }), /* @__PURE__ */ w(l, {
483
- value: F.avatar,
484
- onChange: (e) => J("avatar", e),
485
- choices: Pe,
486
- groupLabel: E("botlit.agentBuilder.avatar", "Avatar"),
487
- optionLabel: (e) => E(`botlit.agentBuilder.avatars.${e.key}`, e.label),
488
- currentLabel: E("botlit.agentBuilder.avatars.current", "Current avatar")
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__ */ w(m, {
491
- label: E("botlit.agentBuilder.name", "Agent Name"),
498
+ /* @__PURE__ */ T(m, {
499
+ label: D("botlit.agentBuilder.name", "Agent Name"),
492
500
  required: !0,
493
- htmlFor: Z("name"),
494
- error: X("name"),
495
- children: /* @__PURE__ */ w(h, {
496
- id: Z("name"),
501
+ htmlFor: Q("name"),
502
+ error: Z("name"),
503
+ children: /* @__PURE__ */ T(h, {
504
+ id: Q("name"),
497
505
  required: !0,
498
- "aria-invalid": X("name") ? !0 : void 0,
499
- "aria-describedby": X("name") ? `${Z("name")}-error` : void 0,
506
+ "aria-invalid": Z("name") ? !0 : void 0,
507
+ "aria-describedby": Z("name") ? `${Q("name")}-error` : void 0,
500
508
  maxLength: 120,
501
- placeholder: E("botlit.agentBuilder.namePlaceholder", "e.g., Customer Support Agent"),
502
- value: F.name,
503
- onChange: (e) => J("name", e.target.value)
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__ */ w(m, {
507
- label: E("botlit.agentBuilder.slug", "Slug"),
508
- htmlFor: Z("slug"),
509
- error: X("slug"),
510
- description: F.slug.trim() === "" && xe(F.name) !== "" ? E("botlit.agentBuilder.slugDerived", "Will be saved as \"{{slug}}\".", { slug: xe(F.name) }) : E("botlit.agentBuilder.slugHelp", "URL-friendly identifier. Leave empty to build it from the name."),
511
- children: /* @__PURE__ */ w(h, {
512
- id: Z("slug"),
513
- "aria-invalid": X("slug") ? !0 : void 0,
514
- "aria-describedby": X("slug") ? `${Z("slug")}-error` : `${Z("slug")}-description`,
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: F.slug,
517
- onChange: (e) => J("slug", e.target.value)
524
+ value: I.slug,
525
+ onChange: (e) => Y("slug", e.target.value)
518
526
  })
519
527
  }),
520
- /* @__PURE__ */ w(m, {
521
- label: E("botlit.agentBuilder.descriptionLabel", "Description"),
522
- htmlFor: Z("description"),
523
- children: /* @__PURE__ */ w(te, {
524
- id: Z("description"),
525
- placeholder: E("botlit.agentBuilder.descriptionPlaceholder", "Describe what this agent does..."),
526
- value: F.description,
527
- onChange: (e) => J("description", e.target.value),
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__ */ w(m, {
532
- label: E("botlit.agentBuilder.visibilityLabel", "Visibility"),
533
- htmlFor: Z("visibility"),
534
- description: E("botlit.agentBuilder.visibilityHelp", "Private: only you. Workspace: everyone in this workspace. Public: shareable outside it."),
535
- children: /* @__PURE__ */ T(Te, {
536
- id: Z("visibility"),
537
- "aria-describedby": `${Z("visibility")}-description`,
538
- className: Le,
539
- value: F.visibility,
540
- onChange: (e) => J("visibility", S(e.target.value, Ie, "PRIVATE")),
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__ */ w("option", {
550
+ /* @__PURE__ */ T("option", {
543
551
  value: "PRIVATE",
544
- children: E("botlit.agentBuilder.visibility.private", "Private")
552
+ children: D("botlit.agentBuilder.visibility.private", "Private")
545
553
  }),
546
- /* @__PURE__ */ w("option", {
554
+ /* @__PURE__ */ T("option", {
547
555
  value: "WORKSPACE",
548
- children: E("botlit.agentBuilder.visibility.workspace", "Workspace")
556
+ children: D("botlit.agentBuilder.visibility.workspace", "Workspace")
549
557
  }),
550
- /* @__PURE__ */ w("option", {
558
+ /* @__PURE__ */ T("option", {
551
559
  value: "PUBLIC",
552
- children: E("botlit.agentBuilder.visibility.public", "Public")
560
+ children: D("botlit.agentBuilder.visibility.public", "Public")
553
561
  })
554
562
  ]
555
563
  })
556
564
  }),
557
- /* @__PURE__ */ T("fieldset", { children: [
558
- /* @__PURE__ */ w("legend", {
565
+ /* @__PURE__ */ E("fieldset", { children: [
566
+ /* @__PURE__ */ T("legend", {
559
567
  className: "mb-1 text-sm font-medium",
560
- children: E("botlit.agentBuilder.capabilitiesLabel", "Capabilities")
568
+ children: D("botlit.agentBuilder.capabilitiesLabel", "Capabilities")
561
569
  }),
562
- /* @__PURE__ */ w("p", {
570
+ /* @__PURE__ */ T("p", {
563
571
  className: "mb-3 text-xs text-text-secondary",
564
- children: E("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.")
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__ */ w("div", {
574
+ /* @__PURE__ */ T("div", {
567
575
  className: "grid grid-cols-1 gap-3 md:grid-cols-3",
568
- children: he.map((e) => /* @__PURE__ */ T("label", {
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__ */ w("input", {
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: F.capabilities.includes(e),
574
- onChange: () => Y("capabilities", e)
575
- }), /* @__PURE__ */ T("span", { children: [/* @__PURE__ */ w("span", {
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: xt[e].label
578
- }), /* @__PURE__ */ w("span", {
585
+ children: bt[e].label
586
+ }), /* @__PURE__ */ T("span", {
579
587
  className: "block text-xs text-text-secondary",
580
- children: xt[e].description
588
+ children: bt[e].description
581
589
  })] })]
582
590
  }, e))
583
591
  }),
584
- St.length > 0 && /* @__PURE__ */ w("p", {
592
+ xt.length > 0 && /* @__PURE__ */ T("p", {
585
593
  className: "mt-3 text-xs text-text-secondary",
586
- children: E("botlit.agentBuilder.unusedCapabilities", "This agent also carries {{names}}. They are kept as saved but have no effect yet.", { names: St.join(", ") })
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
- q.length > 0 && /* @__PURE__ */ w("ul", {
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: q.map((e) => /* @__PURE__ */ T("li", {
599
+ children: J.map((e) => /* @__PURE__ */ E("li", {
592
600
  className: "flex items-start gap-2",
593
- children: [/* @__PURE__ */ w(D, {
601
+ children: [/* @__PURE__ */ T(O, {
594
602
  size: 14,
595
603
  className: "mt-0.5 shrink-0",
596
604
  "aria-hidden": "true"
597
- }), bt(e)]
605
+ }), yt(e)]
598
606
  }, e))
599
607
  })
600
608
  ] })
@@ -602,155 +610,195 @@ var Ie = [
602
610
  })]
603
611
  })
604
612
  }),
605
- /* @__PURE__ */ w("div", {
613
+ /* @__PURE__ */ T("div", {
606
614
  role: "tabpanel",
607
615
  id: "agent-panel-prompt",
608
616
  "aria-labelledby": "agent-tab-prompt",
609
- hidden: I !== "prompt",
610
- children: /* @__PURE__ */ T(r, {
617
+ hidden: L !== "prompt",
618
+ children: /* @__PURE__ */ E(r, {
611
619
  treatment: "glass",
612
620
  glow: !0,
613
- children: [/* @__PURE__ */ T(o, { children: [/* @__PURE__ */ w(s, { children: E("botlit.agentBuilder.prompt.title", "Prompt Configuration") }), /* @__PURE__ */ w(a, { children: E("botlit.agentBuilder.prompt.description", "Define how the agent communicates and behaves") })] }), /* @__PURE__ */ T(i, {
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: [/* @__PURE__ */ w(m, {
616
- label: E("botlit.agentBuilder.systemPrompt", "System Prompt"),
617
- required: !0,
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
- "aria-invalid": X("systemPrompt") ? !0 : void 0,
625
- "aria-describedby": X("systemPrompt") ? `${Z("prompt")}-error` : `${Z("prompt")}-description`,
626
- placeholder: E("botlit.agentBuilder.systemPromptPlaceholder", "You are a helpful assistant..."),
627
- value: F.systemPrompt,
628
- onChange: (e) => J("systemPrompt", e.target.value),
629
- rows: 8,
630
- className: "font-mono text-sm"
631
- })
632
- }), /* @__PURE__ */ T("div", {
633
- className: "grid grid-cols-1 gap-4 md:grid-cols-3",
634
- children: [
635
- /* @__PURE__ */ w(m, {
636
- label: E("botlit.agentBuilder.temperature", "Temperature"),
637
- htmlFor: Z("temperature"),
638
- error: X("temperature"),
639
- description: E("botlit.agentBuilder.temperatureHelp", "Randomness, {{min}} to {{max}}. 0 is the most predictable. Empty uses {{default}}.", {
640
- min: b.min,
641
- max: b.max,
642
- default: _.temperature
643
- }),
644
- children: /* @__PURE__ */ w(h, {
645
- id: Z("temperature"),
646
- type: "number",
647
- step: "0.1",
648
- min: b.min,
649
- max: b.max,
650
- placeholder: String(_.temperature),
651
- "aria-invalid": X("temperature") ? !0 : void 0,
652
- "aria-describedby": X("temperature") ? `${Z("temperature")}-error` : `${Z("temperature")}-description`,
653
- value: F.temperature,
654
- onChange: (e) => J("temperature", e.target.value)
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
- /* @__PURE__ */ w(m, {
658
- label: E("botlit.agentBuilder.maxTokens", "Max Tokens"),
659
- htmlFor: Z("max-tokens"),
660
- error: X("maxTokens"),
661
- description: E("botlit.agentBuilder.maxTokensHelp", "Maximum response length, {{min}} to {{max}}. Empty uses {{default}}.", {
662
- min: y.min,
663
- max: y.max,
664
- default: _.maxTokens
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
- children: /* @__PURE__ */ w(h, {
667
- id: Z("max-tokens"),
668
- type: "number",
669
- step: "1",
670
- min: y.min,
671
- max: y.max,
672
- placeholder: String(_.maxTokens),
673
- "aria-invalid": X("maxTokens") ? !0 : void 0,
674
- "aria-describedby": X("maxTokens") ? `${Z("max-tokens")}-error` : `${Z("max-tokens")}-description`,
675
- value: F.maxTokens,
676
- onChange: (e) => J("maxTokens", e.target.value)
677
- })
678
- }),
679
- /* @__PURE__ */ w(m, {
680
- label: E("botlit.agentBuilder.maxConcurrent", "Max Concurrent Runs"),
681
- htmlFor: Z("max-concurrent"),
682
- error: X("maxConcurrentExecutions"),
683
- description: E("botlit.agentBuilder.maxConcurrentHelp", "How many runs can happen at once, {{min}} to {{max}}. Empty uses {{default}}.", {
684
- min: v.min,
685
- max: v.max,
686
- default: _.maxConcurrentExecutions
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
- children: /* @__PURE__ */ w(h, {
689
- id: Z("max-concurrent"),
690
- type: "number",
691
- step: "1",
692
- min: v.min,
693
- max: v.max,
694
- placeholder: String(_.maxConcurrentExecutions),
695
- "aria-invalid": X("maxConcurrentExecutions") ? !0 : void 0,
696
- "aria-describedby": X("maxConcurrentExecutions") ? `${Z("max-concurrent")}-error` : `${Z("max-concurrent")}-description`,
697
- value: F.maxConcurrentExecutions,
698
- onChange: (e) => J("maxConcurrentExecutions", e.target.value)
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__ */ w("div", {
754
+ /* @__PURE__ */ T("div", {
707
755
  role: "tabpanel",
708
756
  id: "agent-panel-model",
709
757
  "aria-labelledby": "agent-tab-model",
710
- hidden: I !== "model",
711
- children: /* @__PURE__ */ T(r, {
758
+ hidden: L !== "model",
759
+ children: /* @__PURE__ */ E(r, {
712
760
  treatment: "glass",
713
761
  glow: !0,
714
- children: [/* @__PURE__ */ T(o, { children: [/* @__PURE__ */ w(s, { children: E("botlit.agentBuilder.model.title", "LLM Configuration") }), /* @__PURE__ */ w(a, { children: E("botlit.agentBuilder.model.description", "Select the LLM model for this agent") })] }), /* @__PURE__ */ T(i, {
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__ */ T(m, {
718
- label: E("botlit.agentBuilder.model.label", "LLM Model"),
719
- htmlFor: Z("model"),
720
- description: E("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."),
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
- H && /* @__PURE__ */ w("p", {
770
+ U && /* @__PURE__ */ T("p", {
723
771
  role: "status",
724
- children: E("botlit.agentBuilder.model.loading", "Loading answer models…")
772
+ children: D("botlit.agentBuilder.model.loading", "Loading answer models…")
725
773
  }),
726
- U && /* @__PURE__ */ T("div", {
774
+ W && /* @__PURE__ */ E("div", {
727
775
  role: "alert",
728
- children: [/* @__PURE__ */ w("p", { children: E("botlit.agentBuilder.model.loadFailed", "Could not load answer models.") }), /* @__PURE__ */ w(c, {
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
- at(), tt();
780
+ it(), et();
733
781
  },
734
- children: E("botlit.agentBuilder.model.retry", "Retry model catalog")
782
+ children: D("botlit.agentBuilder.model.retry", "Retry model catalog")
735
783
  })]
736
784
  }),
737
- /* @__PURE__ */ T(Te, {
738
- id: Z("model"),
739
- "aria-describedby": `${Z("model")}-description`,
740
- disabled: H || !!U,
741
- className: Le,
742
- value: F.llmModelId,
743
- onChange: (e) => J("llmModelId", e.target.value),
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__ */ w("option", {
793
+ /* @__PURE__ */ T("option", {
746
794
  value: "",
747
- children: E("botlit.agentBuilder.model.none", "Select a model...")
795
+ children: D("botlit.agentBuilder.model.none", "Select a model...")
748
796
  }),
749
- Dt && /* @__PURE__ */ w("option", {
750
- value: F.llmModelId,
751
- children: E("botlit.agentBuilder.model.unavailable", "Unavailable model ({{id}})", { id: F.llmModelId })
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
- W.map((e) => /* @__PURE__ */ T("option", {
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
- !H && !U && /* @__PURE__ */ w(d, {
767
- idPrefix: Z("model"),
768
- value: F.fallbackModelIds,
769
- onChange: (e) => J("fallbackModelIds", e),
770
- primaryModelId: F.llmModelId,
771
- models: W.map((e) => ({
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: V?.find((t) => t.id === e.providerId)?.name
823
+ providerName: H?.find((t) => t.id === e.providerId)?.name
776
824
  }))
777
825
  }),
778
- ht && !H && !U && /* @__PURE__ */ T("div", {
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__ */ w(D, {
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__ */ T("div", { children: [/* @__PURE__ */ w("p", { children: W.length === 0 ? E("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.") : E("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.") }), W.length === 0 && /* @__PURE__ */ w(c, {
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: () => k("settings"),
790
- children: E("botlit.agentBuilder.model.openSettings", "Open Settings")
837
+ onClick: () => A("settings"),
838
+ children: D("botlit.agentBuilder.model.openSettings", "Open Settings")
791
839
  })] })]
792
840
  }),
793
- /* @__PURE__ */ T("div", {
841
+ /* @__PURE__ */ E("div", {
794
842
  className: "rounded-lg bg-bg-sunken p-4",
795
- children: [/* @__PURE__ */ w("h4", {
843
+ children: [/* @__PURE__ */ T("h4", {
796
844
  className: "mb-2 text-sm font-medium",
797
- children: E("botlit.agentBuilder.model.providers", "Available Providers")
798
- }), /* @__PURE__ */ T("div", {
845
+ children: D("botlit.agentBuilder.model.providers", "Available Providers")
846
+ }), /* @__PURE__ */ E("div", {
799
847
  className: "grid grid-cols-2 gap-2",
800
- children: [V?.map((e) => /* @__PURE__ */ T("div", {
848
+ children: [H?.map((e) => /* @__PURE__ */ E("div", {
801
849
  className: "text-sm",
802
- children: [/* @__PURE__ */ w("span", {
850
+ children: [/* @__PURE__ */ T("span", {
803
851
  className: "font-medium",
804
852
  children: e.name
805
- }), /* @__PURE__ */ T("span", {
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)), !H && !U && !V?.length && /* @__PURE__ */ w("p", {
861
+ }, e.id)), !U && !W && !H?.length && /* @__PURE__ */ T("p", {
814
862
  className: "text-sm text-text-secondary",
815
- children: E("botlit.agentBuilder.model.noProviders", "No providers configured")
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__ */ w("div", {
871
+ /* @__PURE__ */ T("div", {
824
872
  role: "tabpanel",
825
873
  id: "agent-panel-tools",
826
874
  "aria-labelledby": "agent-tab-tools",
827
- hidden: I !== "tools",
828
- children: /* @__PURE__ */ T("div", {
875
+ hidden: L !== "tools",
876
+ children: /* @__PURE__ */ E("div", {
829
877
  className: "space-y-6",
830
878
  children: [
831
- /* @__PURE__ */ T(r, {
879
+ /* @__PURE__ */ E(r, {
832
880
  treatment: "glass",
833
881
  glow: !0,
834
- children: [/* @__PURE__ */ T(o, { children: [/* @__PURE__ */ T(s, {
882
+ children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ E(s, {
835
883
  className: "flex items-center gap-2",
836
- children: [/* @__PURE__ */ w(je, {
884
+ children: [/* @__PURE__ */ T(Ae, {
837
885
  size: 18,
838
886
  "aria-hidden": "true"
839
- }), E("botlit.agentBuilder.tools.title", "MCP servers")]
840
- }), /* @__PURE__ */ w(a, { children: E("botlit.agentBuilder.tools.description", "The tools of the servers you attach are available to the agent when MCP Tools is on.") })] }), /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(Re, {
841
- legend: E("botlit.agentBuilder.tools.legend", "MCP servers attached to this agent"),
842
- items: lt.map((e) => ({
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: F.mcpConnectionIds,
895
+ selected: I.mcpConnectionIds,
848
896
  missing: Et,
849
- loading: ut,
850
- error: dt,
851
- onRetry: () => void ft(),
852
- onToggle: (e) => Y("mcpConnectionIds", e),
853
- emptyText: E("botlit.agentBuilder.tools.empty", "No MCP servers in this workspace yet. Add one on the MCP Servers page."),
854
- resource: E("botlit.agentBuilder.tools.resource", "MCP servers")
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__ */ T(r, {
905
+ /* @__PURE__ */ E(r, {
858
906
  treatment: "glass",
859
907
  glow: !0,
860
- children: [/* @__PURE__ */ T(o, { children: [/* @__PURE__ */ T(s, {
908
+ children: [/* @__PURE__ */ E(o, { children: [/* @__PURE__ */ E(s, {
861
909
  className: "flex items-center gap-2",
862
- children: [/* @__PURE__ */ w(De, {
910
+ children: [/* @__PURE__ */ T(Ee, {
863
911
  size: 18,
864
912
  "aria-hidden": "true"
865
- }), E("botlit.agentBuilder.knowledge.title", "Knowledge bases")]
866
- }), /* @__PURE__ */ w(a, { children: E("botlit.agentBuilder.knowledge.description", "The agent answers from the knowledge bases you attach when RAG is on.") })] }), /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(Re, {
867
- legend: E("botlit.agentBuilder.knowledge.legend", "Knowledge bases attached to this agent"),
868
- items: G.map((e) => ({
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: F.knowledgeBaseIds,
874
- missing: Tt,
875
- loading: ot,
876
- error: st,
877
- onRetry: () => void ct(),
878
- onToggle: (e) => Y("knowledgeBaseIds", e),
879
- emptyText: E("botlit.agentBuilder.knowledge.empty", "No knowledge bases in this workspace yet. Create one on the Knowledge Bases page."),
880
- resource: E("botlit.agentBuilder.knowledge.resource", "knowledge bases")
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
- q.length > 0 && /* @__PURE__ */ w("ul", {
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: q.map((e) => /* @__PURE__ */ T("li", {
934
+ children: J.map((e) => /* @__PURE__ */ E("li", {
887
935
  className: "flex items-start gap-2",
888
- children: [/* @__PURE__ */ w(D, {
936
+ children: [/* @__PURE__ */ T(O, {
889
937
  size: 14,
890
938
  className: "mt-0.5 shrink-0",
891
939
  "aria-hidden": "true"
892
- }), bt(e)]
940
+ }), yt(e)]
893
941
  }, e))
894
942
  }),
895
- $.length > 0 && /* @__PURE__ */ w("ul", {
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: $.map((e) => /* @__PURE__ */ T("li", {
947
+ children: Tt.map((e) => /* @__PURE__ */ E("li", {
900
948
  className: "flex items-start gap-2",
901
- children: [/* @__PURE__ */ w(D, {
949
+ children: [/* @__PURE__ */ T(O, {
902
950
  size: 14,
903
951
  className: "mt-0.5 shrink-0",
904
952
  "aria-hidden": "true"
905
- }), E("botlit.agentBuilder.knowledge.notReady", "\"{{name}}\" is {{status}}. An agent with RAG on cannot answer until it is ready.", {
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__ */ T("div", {
962
+ /* @__PURE__ */ E("div", {
915
963
  className: "flex justify-between pt-6",
916
- children: [/* @__PURE__ */ w(c, {
964
+ children: [/* @__PURE__ */ T(c, {
917
965
  type: "button",
918
966
  variant: "outline",
919
- onClick: () => Q(M[Math.max(0, M.indexOf(I) - 1)]),
920
- disabled: I === M[0],
921
- children: E("botlit.agentBuilder.previous", "Previous")
922
- }), I === M[M.length - 1] ? /* @__PURE__ */ w(c, {
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__ */ w(Oe, { size: 16 }),
925
- isLoading: z,
926
- children: yt
927
- }, "submit") : /* @__PURE__ */ w(c, {
972
+ leftIcon: /* @__PURE__ */ T(De, { size: 16 }),
973
+ isLoading: B,
974
+ children: vt
975
+ }, "submit") : /* @__PURE__ */ T(c, {
928
976
  type: "button",
929
- onClick: () => Q(M[M.indexOf(I) + 1]),
930
- children: E("botlit.agentBuilder.next", "Next")
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
- }, Re = ({ legend: t, items: n, selected: r, missing: i, loading: a, error: o, onRetry: s, onToggle: c, emptyText: l, resource: u }) => {
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__ */ w("p", {
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__ */ w(p, {
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__ */ w("p", {
997
+ }) : n.length === 0 && i.length === 0 ? /* @__PURE__ */ T("p", {
950
998
  className: "text-sm text-text-secondary",
951
999
  children: l
952
- }) : /* @__PURE__ */ T("fieldset", { children: [/* @__PURE__ */ w("legend", {
1000
+ }) : /* @__PURE__ */ E("fieldset", { children: [/* @__PURE__ */ T("legend", {
953
1001
  className: "sr-only",
954
1002
  children: t
955
- }), /* @__PURE__ */ T("ul", {
1003
+ }), /* @__PURE__ */ E("ul", {
956
1004
  className: "grid grid-cols-1 gap-2 md:grid-cols-2",
957
- children: [n.map((e) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ T("label", {
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__ */ w("input", {
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__ */ T("span", { children: [/* @__PURE__ */ w("span", {
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__ */ w("span", {
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__ */ w("li", { children: /* @__PURE__ */ T("label", {
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__ */ w("input", {
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__ */ T("span", { children: [
979
- /* @__PURE__ */ w("span", {
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__ */ w("span", {
1031
+ /* @__PURE__ */ T("span", {
984
1032
  className: "block font-mono text-xs text-text-secondary",
985
1033
  children: e
986
1034
  }),
987
- /* @__PURE__ */ w("span", {
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 { N as AgentBuilderPage };
1043
+ export { P as AgentBuilderPage };
996
1044
 
997
1045
  //# sourceMappingURL=AgentBuilderPage.js.map