@burdenoff/microfe-botmanor 2026.1119.4 → 2026.1120.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,31 +1,32 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
2
  import { useBotlit as t } from "../providers/BotlitProvider.js";
3
3
  import { KnowledgeSourceImportPanel as n } from "../components/KnowledgeSourceImportPanel.js";
4
+ import { KnowledgeSearchPanel as ee } from "../components/KnowledgeSearchPanel.js";
4
5
  import { PageLayout as r } from "../components/PageLayout.js";
5
- import { EmptyState as ee } from "../components/EmptyState.js";
6
6
  import { BOTMANOR_PERMISSIONS as i } from "../permissions/botmanorPermissions.js";
7
7
  import { BotmanorPermissionGate as a, useBotmanorCan as te } from "../permissions/useBotmanorPermissions.js";
8
+ import { EmptyState as ne } from "../components/EmptyState.js";
8
9
  import { ErrorState as o } from "../components/ErrorState.js";
9
10
  import { Card as s, CardContent as c, CardDescription as l, CardHeader as u, CardTitle as d } from "../components/Card.js";
10
11
  import { Button as f } from "../components/Button.js";
11
- import { FormField as p, Input as m, Textarea as ne } from "../components/Input.js";
12
- import { StatusBadge as re } from "../components/Badge.js";
13
- import { useLLMModels as ie, useLLMProviders as ae } from "../hooks/useLLMProviders.js";
14
- import { useCreateKnowledgeBase as oe, useDeleteKnowledgeBase as se, useKnowledgeBase as ce, useKnowledgeDocuments as le, useLoadKnowledgeBaseUsage as ue, useRebuildKnowledgeBaseIndex as de, useRemoveKnowledgeDocument as fe, useUpdateKnowledgeBase as pe } from "../hooks/useKnowledgeBases.js";
15
- import { configuredEmbeddingModels as me } from "../utils/embedding-models.js";
12
+ import { FormField as p, Input as m, Textarea as re } from "../components/Input.js";
13
+ import { StatusBadge as ie } from "../components/Badge.js";
14
+ import { useLLMModels as ae, useLLMProviders as oe } from "../hooks/useLLMProviders.js";
15
+ import { useCreateKnowledgeBase as se, useDeleteKnowledgeBase as ce, useKnowledgeBase as le, useKnowledgeDocuments as ue, useLoadKnowledgeBaseUsage as de, useRebuildKnowledgeBaseIndex as fe, useRemoveKnowledgeDocument as pe, useUpdateKnowledgeBase as me } from "../hooks/useKnowledgeBases.js";
16
+ import { configuredEmbeddingModels as he } from "../utils/embedding-models.js";
16
17
  import { confirmAction as h } from "../utils/confirmAction.js";
17
18
  import { formatRelativeTime as g } from "../utils/formatters.js";
18
- import { knowledgeBaseDeleteMessage as he } from "../utils/kbDelete.js";
19
- import { KB_CHUNK_SIZE_RANGE as _, KB_FIELD_MESSAGES as ge, indexStatusHelp as _e, isDocumentBusy as ve, isIndexBusy as ye, parseKbNumber as v, validateKbForm as be } from "../utils/kbSettings.js";
19
+ import { knowledgeBaseDeleteMessage as ge } from "../utils/kbDelete.js";
20
+ import { KB_CHUNK_SIZE_RANGE as _, KB_FIELD_MESSAGES as _e, indexStatusHelp as ve, isDocumentBusy as ye, isIndexBusy as be, parseKbNumber as v, validateKbForm as xe } from "../utils/kbSettings.js";
20
21
  import "../permissions/index.js";
21
- import { useEffect as y, useRef as xe, useState as b } from "react";
22
- import { GlassCard as Se, PagePurpose as Ce } from "@burdenoff/fe-libs/ui";
23
- import { Fragment as we, jsx as x, jsxs as S } from "react/jsx-runtime";
22
+ import { useEffect as y, useRef as Se, useState as b } from "react";
23
+ import { GlassCard as Ce, PagePurpose as we } from "@burdenoff/fe-libs/ui";
24
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
24
25
  import { useParams as Te } from "react-router";
25
- import { AlertTriangle as Ee, ArrowLeft as De, Boxes as Oe, Database as ke, FileText as Ae, Layers as je, RefreshCw as Me, Save as C, Settings as w, Trash2 as T } from "lucide-react";
26
+ import { AlertTriangle as Ee, ArrowLeft as De, Boxes as Oe, Database as ke, FileText as Ae, Layers as je, RefreshCw as Me, Save as Ne, Settings as w, Trash2 as T } from "lucide-react";
26
27
  import { toast as E } from "sonner";
27
28
  // src/botlit/pages/KnowledgeBaseDetailPage.tsx
28
- var Ne = 5e3, D = [
29
+ var Pe = 5e3, D = [
29
30
  "RECURSIVE",
30
31
  "FIXED",
31
32
  "SENTENCE"
@@ -42,7 +43,7 @@ var Ne = 5e3, D = [
42
43
  key: "sentence",
43
44
  fallback: "Packs whole sentences into each chunk, never cutting one in half."
44
45
  }
45
- }, Pe = {
46
+ }, Fe = {
46
47
  name: "",
47
48
  description: "",
48
49
  embeddingModel: "",
@@ -51,7 +52,7 @@ var Ne = 5e3, D = [
51
52
  chunkSize: "512",
52
53
  chunkOverlap: "50"
53
54
  };
54
- function Fe(e) {
55
+ function k(e) {
55
56
  return {
56
57
  name: e.name,
57
58
  description: e.description ?? "",
@@ -62,39 +63,39 @@ function Fe(e) {
62
63
  chunkOverlap: String(e.chunkOverlap)
63
64
  };
64
65
  }
65
- var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", k = ({ isNew: k }) => {
66
- let A = e(), j = te(), { kbId: M, botId: Re } = Te(), N = Re ? `bots/${Re}/knowledge` : "knowledge", { navigateTo: P } = t(), F = ie(), I = ae(), L = F.loading || I.loading, R = F.error || I.error, z = me(F.data ?? [], I.data ?? []), { data: B, loading: ze, error: V, refetch: H } = ce(k ? void 0 : M), U = le(k ? void 0 : M), W = U.data, [Be, Ve] = oe(), [He, Ue] = pe(), [We, Ge] = de(), [Ke, qe] = se(), [Je] = fe(), Ye = ue(), [Xe, G] = b(!1), [K, q] = b(Pe), [Ze, J] = b(!1), [Qe, $e] = b(null), Y = xe(null);
66
+ var A = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", j = ({ isNew: j }) => {
67
+ let M = e(), Le = te(), { kbId: N, botId: Re } = Te(), P = Re ? `bots/${Re}/knowledge` : "knowledge", { navigateTo: F } = t(), I = ae(), L = oe(), R = I.loading || L.loading, z = I.error || L.error, B = he(I.data ?? [], L.data ?? []), { data: V, loading: ze, error: Be, refetch: H } = le(j ? void 0 : N), U = ue(j ? void 0 : N), W = U.data, [Ve, He] = se(), [Ue, We] = me(), [Ge, Ke] = fe(), [qe, Je] = ce(), [Ye] = pe(), Xe = de(), [Ze, G] = b(!1), [K, q] = b(Fe), [J, Y] = b(!1), [Qe, $e] = b(null), et = Se(null);
67
68
  y(() => {
68
- B && !k && Y.current !== B.id && (Y.current = B.id, q(Fe(B)));
69
- }, [B, k]);
70
- let X = ye(B?.indexStatus) || W.some((e) => ve(e.status));
69
+ V && !j && et.current !== V.id && (et.current = V.id, q(k(V)));
70
+ }, [V, j]);
71
+ let X = be(V?.indexStatus) || W.some((e) => ye(e.status));
71
72
  y(() => {
72
- if (k || !X) return;
73
+ if (j || !X) return;
73
74
  let e = window.setInterval(() => {
74
75
  H(), U.refetch();
75
- }, Ne);
76
+ }, Pe);
76
77
  return () => window.clearInterval(e);
77
78
  }, [
78
- k,
79
+ j,
79
80
  X,
80
81
  H,
81
82
  U
82
83
  ]);
83
- let Z = be({
84
+ let Z = xe({
84
85
  name: K.name,
85
86
  embeddingModel: K.embeddingModel,
86
87
  chunkSize: K.chunkSize,
87
88
  chunkOverlap: K.chunkOverlap
88
- }, k ? "create" : "edit"), Q = (e) => {
89
- let t = Ze ? Z[e] : void 0;
90
- return t ? A(`botlit.kb.errors.${t}`, ge[t]) : void 0;
91
- }, et = async (e) => {
92
- if (e.preventDefault(), !Ve.loading) {
93
- if (L) E.error(A("botlit.kb.catalogLoading", "The model list is still loading. Try again in a moment."));
94
- else if (Object.keys(Z).length > 0) J(!0);
95
- else if (!z.some((e) => e.id === K.embeddingModel)) J(!0), E.error(A("botlit.kb.modelUnavailable", "Choose a configured embedding model. Register one in Settings first."));
89
+ }, j ? "create" : "edit"), Q = (e) => {
90
+ let t = J ? Z[e] : void 0;
91
+ return t ? M(`botlit.kb.errors.${t}`, _e[t]) : void 0;
92
+ }, tt = async (e) => {
93
+ if (e.preventDefault(), !He.loading) {
94
+ if (R) E.error(M("botlit.kb.catalogLoading", "The model list is still loading. Try again in a moment."));
95
+ else if (Object.keys(Z).length > 0) Y(!0);
96
+ else if (!B.some((e) => e.id === K.embeddingModel)) Y(!0), E.error(M("botlit.kb.modelUnavailable", "Choose a configured embedding model. Register one in Settings first."));
96
97
  else try {
97
- let e = await Be({
98
+ let e = await Ve({
98
99
  name: K.name.trim(),
99
100
  description: K.description.trim() || null,
100
101
  embeddingModel: K.embeddingModel,
@@ -103,21 +104,21 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
103
104
  chunkSize: v(K.chunkSize),
104
105
  chunkOverlap: v(K.chunkOverlap)
105
106
  });
106
- E.success(A("botlit.kb.created", "Knowledge base \"{{name}}\" created", { name: e.name })), P(`knowledge/${e.id}`);
107
+ E.success(M("botlit.kb.created", "Knowledge base \"{{name}}\" created", { name: e.name })), F(`knowledge/${e.id}`);
107
108
  } catch (e) {
108
- E.error(e instanceof Error ? e.message : A("botlit.kb.createFailed", "Failed to create knowledge base"));
109
+ E.error(e instanceof Error ? e.message : M("botlit.kb.createFailed", "Failed to create knowledge base"));
109
110
  }
110
111
  }
111
- }, tt = async (e) => {
112
- if (e.preventDefault(), !M || !B || Ue.loading) return;
112
+ }, nt = async (e) => {
113
+ if (e.preventDefault(), !N || !V || We.loading) return;
113
114
  if (Object.keys(Z).length > 0) {
114
- J(!0);
115
+ Y(!0);
115
116
  return;
116
117
  }
117
- let t = v(K.chunkSize), n = v(K.chunkOverlap), r = t !== B.chunkSize || n !== B.chunkOverlap || K.chunkingStrategy !== B.chunkingStrategy;
118
+ let t = v(K.chunkSize), n = v(K.chunkOverlap), ee = t !== V.chunkSize || n !== V.chunkOverlap || K.chunkingStrategy !== V.chunkingStrategy;
118
119
  try {
119
- await He({
120
- kbId: M,
120
+ await Ue({
121
+ kbId: N,
121
122
  input: {
122
123
  name: K.name.trim(),
123
124
  description: K.description.trim() || null,
@@ -125,74 +126,74 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
125
126
  chunkSize: t,
126
127
  chunkOverlap: n
127
128
  }
128
- }), await H(), E.success(A("botlit.kb.updated", "Knowledge base updated")), G(!1), J(!1), r && B.totalDocuments > 0 && await h({
129
- title: A("botlit.kb.rebuildPrompt.title", "Rebuild the index?"),
130
- message: A("botlit.kb.rebuildPrompt.message", "The chunk settings changed. Your {{count}} existing document(s) keep their old chunks until the index is rebuilt. Rebuild now?", { count: B.totalDocuments }),
131
- confirmLabel: A("botlit.kb.rebuild", "Rebuild Index"),
132
- cancelLabel: A("botlit.kb.rebuildPrompt.later", "Later")
133
- }) && await nt();
129
+ }), await H(), E.success(M("botlit.kb.updated", "Knowledge base updated")), G(!1), Y(!1), ee && V.totalDocuments > 0 && await h({
130
+ title: M("botlit.kb.rebuildPrompt.title", "Rebuild the index?"),
131
+ message: M("botlit.kb.rebuildPrompt.message", "The chunk settings changed. Your {{count}} existing document(s) keep their old chunks until the index is rebuilt. Rebuild now?", { count: V.totalDocuments }),
132
+ confirmLabel: M("botlit.kb.rebuild", "Rebuild Index"),
133
+ cancelLabel: M("botlit.kb.rebuildPrompt.later", "Later")
134
+ }) && await rt();
134
135
  } catch (e) {
135
- E.error(e instanceof Error ? e.message : A("botlit.kb.updateFailed", "Failed to update knowledge base"));
136
+ E.error(e instanceof Error ? e.message : M("botlit.kb.updateFailed", "Failed to update knowledge base"));
136
137
  }
137
- }, nt = async () => {
138
- if (M) {
138
+ }, rt = async () => {
139
+ if (N) {
139
140
  $e(null);
140
141
  try {
141
- if (!await We(M)) {
142
- E.error(A("botlit.kb.rebuildNotDone", "The index could not be rebuilt."));
142
+ if (!await Ge(N)) {
143
+ E.error(M("botlit.kb.rebuildNotDone", "The index could not be rebuilt."));
143
144
  return;
144
145
  }
145
- E.success(A("botlit.kb.rebuilt", "Index rebuilt"));
146
+ E.success(M("botlit.kb.rebuilt", "Index rebuilt"));
146
147
  } catch (e) {
147
- $e(A("botlit.kb.rebuildMaybeRunning", "The rebuild did not report back. A large library can still be rebuilding in the background: this page keeps refreshing, so check the index status.")), E.error(e instanceof Error ? e.message : A("botlit.kb.rebuildFailed", "Failed to rebuild the index"));
148
+ $e(M("botlit.kb.rebuildMaybeRunning", "The rebuild did not report back. A large library can still be rebuilding in the background: this page keeps refreshing, so check the index status.")), E.error(e instanceof Error ? e.message : M("botlit.kb.rebuildFailed", "Failed to rebuild the index"));
148
149
  } finally {
149
150
  await H(), await U.refetch();
150
151
  }
151
152
  }
152
- }, rt = async () => {
153
- if (!M || !B) return;
154
- let e = await Ye(M).catch(() => null);
153
+ }, it = async () => {
154
+ if (!N || !V) return;
155
+ let e = await Xe(N).catch(() => null);
155
156
  if (await h({
156
- title: A("botlit.kb.delete.title", "Delete knowledge base?"),
157
- message: he(A, B.name, e),
158
- confirmLabel: A("botlit.common.delete", "Delete"),
159
- cancelLabel: A("botlit.common.cancel", "Cancel")
157
+ title: M("botlit.kb.delete.title", "Delete knowledge base?"),
158
+ message: ge(M, V.name, e),
159
+ confirmLabel: M("botlit.common.delete", "Delete"),
160
+ cancelLabel: M("botlit.common.cancel", "Cancel")
160
161
  })) try {
161
- if (!await Ke(M)) {
162
- E.error(A("botlit.kb.delete.notDeleted", "The knowledge base could not be deleted."));
162
+ if (!await qe(N)) {
163
+ E.error(M("botlit.kb.delete.notDeleted", "The knowledge base could not be deleted."));
163
164
  return;
164
165
  }
165
- E.success(A("botlit.kb.delete.success", "Knowledge base \"{{name}}\" deleted", { name: B.name })), P(N);
166
+ E.success(M("botlit.kb.delete.success", "Knowledge base \"{{name}}\" deleted", { name: V.name })), F(P);
166
167
  } catch (e) {
167
- E.error(e instanceof Error ? e.message : A("botlit.kb.delete.error", "Failed to delete the knowledge base"));
168
+ E.error(e instanceof Error ? e.message : M("botlit.kb.delete.error", "Failed to delete the knowledge base"));
168
169
  }
169
- }, it = async (e) => {
170
+ }, at = async (e) => {
170
171
  if (await h({
171
- title: A("botlit.kb.document.removeTitle", "Remove document?"),
172
- message: A("botlit.kb.document.removeMessage", "Remove \"{{title}}\" from this knowledge base? Agents stop answering from it. This cannot be undone.", { title: e.title }),
173
- confirmLabel: A("botlit.kb.document.remove", "Remove"),
174
- cancelLabel: A("botlit.common.cancel", "Cancel")
172
+ title: M("botlit.kb.document.removeTitle", "Remove document?"),
173
+ message: M("botlit.kb.document.removeMessage", "Remove \"{{title}}\" from this knowledge base? Agents stop answering from it. This cannot be undone.", { title: e.title }),
174
+ confirmLabel: M("botlit.kb.document.remove", "Remove"),
175
+ cancelLabel: M("botlit.common.cancel", "Cancel")
175
176
  })) try {
176
- if (!await Je(e.id)) {
177
- E.error(A("botlit.kb.document.notRemoved", "The document could not be removed."));
177
+ if (!await Ye(e.id)) {
178
+ E.error(M("botlit.kb.document.notRemoved", "The document could not be removed."));
178
179
  return;
179
180
  }
180
- E.success(A("botlit.kb.document.removed", "Document \"{{title}}\" removed", { title: e.title })), await U.refetch(), await H();
181
+ E.success(M("botlit.kb.document.removed", "Document \"{{title}}\" removed", { title: e.title })), await U.refetch(), await H();
181
182
  } catch (e) {
182
- E.error(e instanceof Error ? e.message : A("botlit.kb.document.removeFailed", "Failed to remove the document"));
183
+ E.error(e instanceof Error ? e.message : M("botlit.kb.document.removeFailed", "Failed to remove the document"));
183
184
  }
184
- }, $ = (e) => `kb-form-${e}`, at = (e) => /* @__PURE__ */ S(we, { children: [
185
- /* @__PURE__ */ x(p, {
186
- label: A("botlit.kb.form.name", "Name"),
185
+ }, $ = (e) => `kb-form-${e}`, ot = (e) => /* @__PURE__ */ C(x, { children: [
186
+ /* @__PURE__ */ S(p, {
187
+ label: M("botlit.kb.form.name", "Name"),
187
188
  required: !0,
188
189
  htmlFor: $("name"),
189
190
  error: Q("name"),
190
- children: /* @__PURE__ */ x(m, {
191
+ children: /* @__PURE__ */ S(m, {
191
192
  id: $("name"),
192
193
  required: !0,
193
194
  "aria-invalid": Q("name") ? !0 : void 0,
194
195
  "aria-describedby": Q("name") ? `${$("name")}-error` : void 0,
195
- placeholder: A("botlit.kb.form.namePlaceholder", "e.g., Product Documentation"),
196
+ placeholder: M("botlit.kb.form.namePlaceholder", "e.g., Product Documentation"),
196
197
  value: K.name,
197
198
  onChange: (e) => q({
198
199
  ...K,
@@ -200,12 +201,12 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
200
201
  })
201
202
  })
202
203
  }),
203
- /* @__PURE__ */ x(p, {
204
- label: A("botlit.kb.form.description", "Description"),
204
+ /* @__PURE__ */ S(p, {
205
+ label: M("botlit.kb.form.description", "Description"),
205
206
  htmlFor: $("description"),
206
- children: /* @__PURE__ */ x(ne, {
207
+ children: /* @__PURE__ */ S(re, {
207
208
  id: $("description"),
208
- placeholder: A("botlit.kb.form.descriptionPlaceholder", "What kind of knowledge will this store?"),
209
+ placeholder: M("botlit.kb.form.descriptionPlaceholder", "What kind of knowledge will this store?"),
209
210
  value: K.description,
210
211
  onChange: (e) => q({
211
212
  ...K,
@@ -214,33 +215,33 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
214
215
  rows: 3
215
216
  })
216
217
  }),
217
- e && /* @__PURE__ */ S(p, {
218
- label: A("botlit.kb.form.embeddingModel", "Embedding Model"),
218
+ e && /* @__PURE__ */ C(p, {
219
+ label: M("botlit.kb.form.embeddingModel", "Embedding Model"),
219
220
  required: !0,
220
221
  htmlFor: $("model"),
221
222
  error: Q("embeddingModel"),
222
223
  children: [
223
- /* @__PURE__ */ S("select", {
224
+ /* @__PURE__ */ C("select", {
224
225
  id: $("model"),
225
- className: Ie,
226
- "aria-label": A("botlit.kb.form.embeddingModel", "Embedding Model"),
226
+ className: A,
227
+ "aria-label": M("botlit.kb.form.embeddingModel", "Embedding Model"),
227
228
  required: !0,
228
229
  "aria-invalid": Q("embeddingModel") ? !0 : void 0,
229
230
  "aria-describedby": Q("embeddingModel") ? `${$("model")}-error` : void 0,
230
- disabled: L || !!R,
231
+ disabled: R || !!z,
231
232
  value: K.embeddingModel,
232
233
  onChange: (e) => {
233
- let t = z.find((t) => t.id === e.target.value);
234
+ let t = B.find((t) => t.id === e.target.value);
234
235
  q({
235
236
  ...K,
236
237
  embeddingModel: e.target.value,
237
238
  embeddingDimensions: t?.dimensions ?? K.embeddingDimensions
238
239
  });
239
240
  },
240
- children: [/* @__PURE__ */ x("option", {
241
+ children: [/* @__PURE__ */ S("option", {
241
242
  value: "",
242
- children: A("botlit.kb.form.chooseModel", "Choose a configured embedding model")
243
- }), z.map((e) => /* @__PURE__ */ S("option", {
243
+ children: M("botlit.kb.form.chooseModel", "Choose a configured embedding model")
244
+ }), B.map((e) => /* @__PURE__ */ C("option", {
244
245
  value: e.id,
245
246
  children: [
246
247
  e.label,
@@ -250,65 +251,65 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
250
251
  ]
251
252
  }, e.id))]
252
253
  }),
253
- L && /* @__PURE__ */ x("p", {
254
+ R && /* @__PURE__ */ S("p", {
254
255
  role: "status",
255
- children: A("botlit.kb.form.loadingModels", "Loading configured embedding models…")
256
+ children: M("botlit.kb.form.loadingModels", "Loading configured embedding models…")
256
257
  }),
257
- R && /* @__PURE__ */ S("div", {
258
+ z && /* @__PURE__ */ C("div", {
258
259
  role: "alert",
259
- children: [/* @__PURE__ */ x("p", { children: A("botlit.kb.form.modelsFailed", "Could not load configured models. Try loading the catalog again.") }), /* @__PURE__ */ x(f, {
260
+ children: [/* @__PURE__ */ S("p", { children: M("botlit.kb.form.modelsFailed", "Could not load configured models. Try loading the catalog again.") }), /* @__PURE__ */ S(f, {
260
261
  type: "button",
261
262
  variant: "secondary",
262
263
  onClick: () => {
263
- F.refetch(), I.refetch();
264
+ I.refetch(), L.refetch();
264
265
  },
265
- children: A("botlit.kb.form.retryModels", "Retry model catalog")
266
+ children: M("botlit.kb.form.retryModels", "Retry model catalog")
266
267
  })]
267
268
  }),
268
- !L && !R && z.length === 0 && /* @__PURE__ */ S("div", {
269
+ !R && !z && B.length === 0 && /* @__PURE__ */ C("div", {
269
270
  className: "text-sm text-text-secondary",
270
- children: [/* @__PURE__ */ x("p", { children: A("botlit.kb.form.noModels", "No embedding model is registered yet. Register one with an active provider in Settings first.") }), /* @__PURE__ */ x(f, {
271
+ children: [/* @__PURE__ */ S("p", { children: M("botlit.kb.form.noModels", "No embedding model is registered yet. Register one with an active provider in Settings first.") }), /* @__PURE__ */ S(f, {
271
272
  type: "button",
272
273
  variant: "ghost",
273
274
  className: "px-0",
274
- onClick: () => P("settings"),
275
- children: A("botlit.kb.form.openSettings", "Open Settings")
275
+ onClick: () => F("settings"),
276
+ children: M("botlit.kb.form.openSettings", "Open Settings")
276
277
  })]
277
278
  })
278
279
  ]
279
280
  }),
280
- /* @__PURE__ */ S("div", {
281
+ /* @__PURE__ */ C("div", {
281
282
  className: "grid grid-cols-1 gap-4 md:grid-cols-3",
282
283
  children: [
283
- /* @__PURE__ */ x(p, {
284
- label: A("botlit.kb.form.strategy", "Chunking Strategy"),
284
+ /* @__PURE__ */ S(p, {
285
+ label: M("botlit.kb.form.strategy", "Chunking Strategy"),
285
286
  htmlFor: $("strategy"),
286
- description: A(`botlit.kb.strategyHelp.${O[Le(K.chunkingStrategy)].key}`, O[Le(K.chunkingStrategy)].fallback),
287
- children: /* @__PURE__ */ x("select", {
287
+ description: M(`botlit.kb.strategyHelp.${O[Ie(K.chunkingStrategy)].key}`, O[Ie(K.chunkingStrategy)].fallback),
288
+ children: /* @__PURE__ */ S("select", {
288
289
  id: $("strategy"),
289
- className: Ie,
290
+ className: A,
290
291
  "aria-describedby": `${$("strategy")}-description`,
291
292
  value: K.chunkingStrategy,
292
293
  onChange: (e) => q({
293
294
  ...K,
294
295
  chunkingStrategy: e.target.value
295
296
  }),
296
- children: D.map((e) => /* @__PURE__ */ x("option", {
297
+ children: D.map((e) => /* @__PURE__ */ S("option", {
297
298
  value: e,
298
299
  children: e
299
300
  }, e))
300
301
  })
301
302
  }),
302
- /* @__PURE__ */ x(p, {
303
- label: A("botlit.kb.form.chunkSize", "Chunk Size"),
303
+ /* @__PURE__ */ S(p, {
304
+ label: M("botlit.kb.form.chunkSize", "Chunk Size"),
304
305
  htmlFor: $("chunk-size"),
305
306
  error: Q("chunkSize"),
306
- description: A("botlit.kb.form.chunkSizeHelp", "In approximate tokens, {{min}} to {{max}}. Empty uses {{default}} when creating.", {
307
+ description: M("botlit.kb.form.chunkSizeHelp", "In approximate tokens, {{min}} to {{max}}. Empty uses {{default}} when creating.", {
307
308
  min: _.min,
308
309
  max: _.max,
309
310
  default: 512
310
311
  }),
311
- children: /* @__PURE__ */ x(m, {
312
+ children: /* @__PURE__ */ S(m, {
312
313
  id: $("chunk-size"),
313
314
  type: "number",
314
315
  min: _.min,
@@ -323,12 +324,12 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
323
324
  })
324
325
  })
325
326
  }),
326
- /* @__PURE__ */ x(p, {
327
- label: A("botlit.kb.form.chunkOverlap", "Chunk Overlap"),
327
+ /* @__PURE__ */ S(p, {
328
+ label: M("botlit.kb.form.chunkOverlap", "Chunk Overlap"),
328
329
  htmlFor: $("chunk-overlap"),
329
330
  error: Q("chunkOverlap"),
330
- description: A("botlit.kb.form.chunkOverlapHelp", "Tokens shared between neighbouring chunks. 0 or more, and below the chunk size."),
331
- children: /* @__PURE__ */ x(m, {
331
+ description: M("botlit.kb.form.chunkOverlapHelp", "Tokens shared between neighbouring chunks. 0 or more, and below the chunk size."),
332
+ children: /* @__PURE__ */ S(m, {
332
333
  id: $("chunk-overlap"),
333
334
  type: "number",
334
335
  min: 0,
@@ -344,395 +345,399 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
344
345
  })
345
346
  ]
346
347
  })
347
- ] }), ot = Ze && Object.keys(Z).length > 0 ? /* @__PURE__ */ S("div", {
348
+ ] }), st = J && Object.keys(Z).length > 0 ? /* @__PURE__ */ C("div", {
348
349
  role: "alert",
349
350
  className: "flex items-start gap-2 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-text-primary",
350
- children: [/* @__PURE__ */ x(Ee, {
351
+ children: [/* @__PURE__ */ S(Ee, {
351
352
  size: 16,
352
353
  className: "mt-0.5 text-status-error-text",
353
354
  "aria-hidden": "true"
354
- }), /* @__PURE__ */ x("p", { children: A("botlit.kb.errors.summary", "Fix the highlighted fields before saving.") })]
355
+ }), /* @__PURE__ */ S("p", { children: M("botlit.kb.errors.summary", "Fix the highlighted fields before saving.") })]
355
356
  }) : null;
356
- if (k) return /* @__PURE__ */ x(r, {
357
- title: A("botlit.kb.createTitle", "Create Knowledge Base"),
358
- description: A("botlit.kb.createDescription", "Set up an embedding index your agents can retrieve from"),
359
- leading: /* @__PURE__ */ x(f, {
357
+ if (j) return /* @__PURE__ */ S(r, {
358
+ title: M("botlit.kb.createTitle", "Create Knowledge Base"),
359
+ description: M("botlit.kb.createDescription", "Set up an embedding index your agents can retrieve from"),
360
+ leading: /* @__PURE__ */ S(f, {
360
361
  variant: "ghost",
361
362
  size: "icon",
362
- "aria-label": A("botlit.kb.back", "Back to knowledge bases"),
363
- onClick: () => P(N),
364
- children: /* @__PURE__ */ x(De, {
363
+ "aria-label": M("botlit.kb.back", "Back to knowledge bases"),
364
+ onClick: () => F(P),
365
+ children: /* @__PURE__ */ S(De, {
365
366
  size: 20,
366
367
  "aria-hidden": "true"
367
368
  })
368
369
  }),
369
- actions: /* @__PURE__ */ S("div", {
370
+ actions: /* @__PURE__ */ C("div", {
370
371
  className: "flex gap-2",
371
- children: [/* @__PURE__ */ x(f, {
372
+ children: [/* @__PURE__ */ S(f, {
372
373
  variant: "outline",
373
- onClick: () => P(N),
374
- children: A("botlit.common.cancel", "Cancel")
375
- }), /* @__PURE__ */ x(f, {
374
+ onClick: () => F(P),
375
+ children: M("botlit.common.cancel", "Cancel")
376
+ }), /* @__PURE__ */ S(f, {
376
377
  type: "submit",
377
378
  form: "kb-create-form",
378
- leftIcon: /* @__PURE__ */ x(C, { size: 16 }),
379
- isLoading: Ve.loading,
380
- children: A("botlit.kb.create", "Create")
379
+ leftIcon: /* @__PURE__ */ S(Ne, { size: 16 }),
380
+ isLoading: He.loading,
381
+ children: M("botlit.kb.create", "Create")
381
382
  })]
382
383
  }),
383
- children: /* @__PURE__ */ S("form", {
384
+ children: /* @__PURE__ */ C("form", {
384
385
  id: "kb-create-form",
385
386
  noValidate: !0,
386
- onSubmit: (e) => void et(e),
387
+ onSubmit: (e) => void tt(e),
387
388
  className: "max-w-3xl space-y-6",
388
- children: [ot, /* @__PURE__ */ S(s, { children: [/* @__PURE__ */ S(u, { children: [/* @__PURE__ */ x(d, { children: A("botlit.kb.indexConfig", "Index Configuration") }), /* @__PURE__ */ x(l, { children: A("botlit.kb.indexConfigCreateHelp", "The embedding model and its vector width are fixed once documents are indexed.") })] }), /* @__PURE__ */ x(c, {
389
+ children: [st, /* @__PURE__ */ C(s, { children: [/* @__PURE__ */ C(u, { children: [/* @__PURE__ */ S(d, { children: M("botlit.kb.indexConfig", "Index Configuration") }), /* @__PURE__ */ S(l, { children: M("botlit.kb.indexConfigCreateHelp", "The embedding model and its vector width are fixed once documents are indexed.") })] }), /* @__PURE__ */ S(c, {
389
390
  className: "space-y-4",
390
- children: at(!0)
391
+ children: ot(!0)
391
392
  })] })]
392
393
  })
393
394
  });
394
- if (ze) return /* @__PURE__ */ x(r, {
395
- title: A("botlit.common.loading", "Loading..."),
396
- children: /* @__PURE__ */ x("div", {
395
+ if (ze) return /* @__PURE__ */ S(r, {
396
+ title: M("botlit.common.loading", "Loading..."),
397
+ children: /* @__PURE__ */ S("div", {
397
398
  role: "status",
398
399
  "aria-busy": "true",
399
- "aria-label": A("botlit.common.loading", "Loading..."),
400
+ "aria-label": M("botlit.common.loading", "Loading..."),
400
401
  className: "h-96 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer"
401
402
  })
402
403
  });
403
- if (V) return /* @__PURE__ */ x(r, {
404
- title: A("botlit.kb.errorTitle", "Knowledge Base"),
405
- children: /* @__PURE__ */ x(o, {
406
- resource: A("botlit.kb.thisResource", "this knowledge base"),
407
- error: V,
404
+ if (Be) return /* @__PURE__ */ S(r, {
405
+ title: M("botlit.kb.errorTitle", "Knowledge Base"),
406
+ children: /* @__PURE__ */ S(o, {
407
+ resource: M("botlit.kb.thisResource", "this knowledge base"),
408
+ error: Be,
408
409
  onRetry: () => void H()
409
410
  })
410
411
  });
411
- if (!B) return /* @__PURE__ */ x(r, {
412
- title: A("botlit.kb.notFound.title", "Knowledge Base Not Found"),
413
- children: /* @__PURE__ */ x(ee, {
412
+ if (!V) return /* @__PURE__ */ S(r, {
413
+ title: M("botlit.kb.notFound.title", "Knowledge Base Not Found"),
414
+ children: /* @__PURE__ */ S(ne, {
414
415
  illustration: "empty-files",
415
- title: A("botlit.kb.notFound.title", "Knowledge Base Not Found"),
416
- description: A("botlit.kb.notFound.description", "This knowledge base doesn't exist."),
417
- action: /* @__PURE__ */ x(f, {
418
- onClick: () => P(N),
419
- children: A("botlit.kb.notFound.back", "Back to Knowledge Bases")
416
+ title: M("botlit.kb.notFound.title", "Knowledge Base Not Found"),
417
+ description: M("botlit.kb.notFound.description", "This knowledge base doesn't exist."),
418
+ action: /* @__PURE__ */ S(f, {
419
+ onClick: () => F(P),
420
+ children: M("botlit.kb.notFound.back", "Back to Knowledge Bases")
420
421
  })
421
422
  })
422
423
  });
423
- let st = _e(B.indexStatus), ct = !L && !R && !z.some((e) => e.id === B.embeddingModel);
424
- return /* @__PURE__ */ x(r, {
425
- title: B.name,
426
- leading: /* @__PURE__ */ x(f, {
424
+ let ct = ve(V.indexStatus), lt = !R && !z && !B.some((e) => e.id === V.embeddingModel);
425
+ return /* @__PURE__ */ S(r, {
426
+ title: V.name,
427
+ leading: /* @__PURE__ */ S(f, {
427
428
  variant: "ghost",
428
429
  size: "icon",
429
- "aria-label": A("botlit.kb.back", "Back to knowledge bases"),
430
- onClick: () => P(N),
431
- children: /* @__PURE__ */ x(De, {
430
+ "aria-label": M("botlit.kb.back", "Back to knowledge bases"),
431
+ onClick: () => F(P),
432
+ children: /* @__PURE__ */ S(De, {
432
433
  size: 20,
433
434
  "aria-hidden": "true"
434
435
  })
435
436
  }),
436
- meta: /* @__PURE__ */ x(re, { status: B.indexStatus }),
437
- description: B.description,
438
- actions: /* @__PURE__ */ S("div", {
437
+ meta: /* @__PURE__ */ S(ie, { status: V.indexStatus }),
438
+ description: V.description,
439
+ actions: /* @__PURE__ */ C("div", {
439
440
  className: "flex gap-2",
440
441
  children: [
441
- /* @__PURE__ */ x(a, {
442
+ /* @__PURE__ */ S(a, {
442
443
  permission: i.KNOWLEDGE_MANAGE,
443
- children: /* @__PURE__ */ x(f, {
444
+ children: /* @__PURE__ */ S(f, {
444
445
  variant: "outline",
445
- leftIcon: /* @__PURE__ */ x(Me, { size: 16 }),
446
- onClick: () => void nt(),
447
- isLoading: Ge.loading,
448
- children: A("botlit.kb.rebuild", "Rebuild Index")
446
+ leftIcon: /* @__PURE__ */ S(Me, { size: 16 }),
447
+ onClick: () => void rt(),
448
+ isLoading: Ke.loading,
449
+ children: M("botlit.kb.rebuild", "Rebuild Index")
449
450
  })
450
451
  }),
451
- Xe ? /* @__PURE__ */ S(we, { children: [/* @__PURE__ */ x(f, {
452
+ Ze ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(f, {
452
453
  variant: "outline",
453
454
  onClick: () => {
454
- q(Fe(B)), G(!1), J(!1);
455
+ q(k(V)), G(!1), Y(!1);
455
456
  },
456
- children: A("botlit.common.cancel", "Cancel")
457
- }), /* @__PURE__ */ x(f, {
457
+ children: M("botlit.common.cancel", "Cancel")
458
+ }), /* @__PURE__ */ S(f, {
458
459
  type: "submit",
459
460
  form: "kb-edit-form",
460
- leftIcon: /* @__PURE__ */ x(C, { size: 16 }),
461
- isLoading: Ue.loading,
462
- children: A("botlit.kb.save", "Save")
463
- })] }) : /* @__PURE__ */ x(a, {
461
+ leftIcon: /* @__PURE__ */ S(Ne, { size: 16 }),
462
+ isLoading: We.loading,
463
+ children: M("botlit.kb.save", "Save")
464
+ })] }) : /* @__PURE__ */ S(a, {
464
465
  permission: i.KNOWLEDGE_UPDATE,
465
- children: /* @__PURE__ */ x(f, {
466
- leftIcon: /* @__PURE__ */ x(w, { size: 16 }),
466
+ children: /* @__PURE__ */ S(f, {
467
+ leftIcon: /* @__PURE__ */ S(w, { size: 16 }),
467
468
  onClick: () => G(!0),
468
- children: A("botlit.kb.configure", "Configure")
469
+ children: M("botlit.kb.configure", "Configure")
469
470
  })
470
471
  }),
471
- j(i.KNOWLEDGE_DELETE) && /* @__PURE__ */ x(f, {
472
+ Le(i.KNOWLEDGE_DELETE) && /* @__PURE__ */ S(f, {
472
473
  variant: "destructive",
473
- leftIcon: /* @__PURE__ */ x(T, { size: 16 }),
474
- isLoading: qe.loading,
475
- onClick: () => void rt(),
476
- children: A("botlit.common.delete", "Delete")
474
+ leftIcon: /* @__PURE__ */ S(T, { size: 16 }),
475
+ isLoading: Je.loading,
476
+ onClick: () => void it(),
477
+ children: M("botlit.common.delete", "Delete")
477
478
  })
478
479
  ]
479
480
  }),
480
- children: /* @__PURE__ */ S("div", {
481
+ children: /* @__PURE__ */ C("div", {
481
482
  className: "space-y-6",
482
483
  children: [
483
- /* @__PURE__ */ x(Ce, {
484
- icon: /* @__PURE__ */ x(ke, { size: 18 }),
485
- children: A("botlit.kb.purpose", "This knowledge base is one searchable library your agents can draw on. Review how its documents are chunked and indexed, rebuild the index when content changes, and confirm it is healthy, so agents retrieve accurate, up-to-date passages and can cite them in their answers.")
484
+ /* @__PURE__ */ S(we, {
485
+ icon: /* @__PURE__ */ S(ke, { size: 18 }),
486
+ children: M("botlit.kb.purpose", "This knowledge base is one searchable library your agents can draw on. Review how its documents are chunked and indexed, rebuild the index when content changes, and confirm it is healthy, so agents retrieve accurate, up-to-date passages and can cite them in their answers.")
486
487
  }),
487
- /* @__PURE__ */ S("p", {
488
+ /* @__PURE__ */ C("p", {
488
489
  role: "status",
489
490
  className: "text-sm text-text-secondary",
490
491
  "data-testid": "kb-status-help",
491
- children: [A(`botlit.kb.statusHelp.${st.key}`, st.fallback), X && ` ${A("botlit.kb.refreshing", "This page refreshes by itself while indexing runs.")}`]
492
+ children: [M(`botlit.kb.statusHelp.${ct.key}`, ct.fallback), X && ` ${M("botlit.kb.refreshing", "This page refreshes by itself while indexing runs.")}`]
492
493
  }),
493
- Ge.loading && /* @__PURE__ */ x("p", {
494
+ Ke.loading && /* @__PURE__ */ S("p", {
494
495
  role: "status",
495
496
  className: "text-sm text-text-secondary",
496
- children: A("botlit.kb.rebuilding", "Rebuilding the index. This can take a few minutes for a large library.")
497
+ children: M("botlit.kb.rebuilding", "Rebuilding the index. This can take a few minutes for a large library.")
497
498
  }),
498
- Qe && /* @__PURE__ */ x("p", {
499
+ Qe && /* @__PURE__ */ S("p", {
499
500
  role: "alert",
500
501
  className: "text-sm text-status-warning-text",
501
502
  children: Qe
502
503
  }),
503
- ct && /* @__PURE__ */ S("div", {
504
+ lt && /* @__PURE__ */ C("div", {
504
505
  role: "alert",
505
506
  "data-testid": "kb-model-warning",
506
507
  className: "flex items-start gap-2 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-3 text-sm",
507
- children: [/* @__PURE__ */ x(Ee, {
508
+ children: [/* @__PURE__ */ S(Ee, {
508
509
  size: 16,
509
510
  className: "mt-0.5 shrink-0 text-status-warning-text",
510
511
  "aria-hidden": "true"
511
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", { children: A("botlit.kb.modelWarning", "The embedding model of this knowledge base ({{model}}) is no longer available: it was deleted or turned off, or its provider was. Documents cannot be indexed and searches fail until a usable model is registered again in Settings.", { model: B.embeddingModel }) }), /* @__PURE__ */ x(f, {
512
+ }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", { children: M("botlit.kb.modelWarning", "The embedding model of this knowledge base ({{model}}) is no longer available: it was deleted or turned off, or its provider was. Documents cannot be indexed and searches fail until a usable model is registered again in Settings.", { model: V.embeddingModel }) }), /* @__PURE__ */ S(f, {
512
513
  type: "button",
513
514
  variant: "ghost",
514
515
  className: "px-0",
515
- onClick: () => P("settings"),
516
- children: A("botlit.kb.form.openSettings", "Open Settings")
516
+ onClick: () => F("settings"),
517
+ children: M("botlit.kb.form.openSettings", "Open Settings")
517
518
  })] })]
518
519
  }),
519
- /* @__PURE__ */ S("div", {
520
+ /* @__PURE__ */ C("div", {
520
521
  className: "grid grid-cols-2 gap-4 md:grid-cols-4",
521
522
  children: [
522
- /* @__PURE__ */ S(Se, {
523
+ /* @__PURE__ */ C(Ce, {
523
524
  treatment: "glass",
524
525
  glow: !0,
525
526
  className: "p-6 text-center",
526
527
  children: [
527
- /* @__PURE__ */ x("div", {
528
+ /* @__PURE__ */ S("div", {
528
529
  className: "mx-auto mb-2 w-fit rounded-full bg-action-primary-bg/10 p-3",
529
- children: /* @__PURE__ */ x(ke, {
530
+ children: /* @__PURE__ */ S(ke, {
530
531
  className: "h-5 w-5 text-primary",
531
532
  "aria-hidden": "true"
532
533
  })
533
534
  }),
534
- /* @__PURE__ */ x("p", {
535
+ /* @__PURE__ */ S("p", {
535
536
  className: "text-lg font-bold capitalize text-text-primary",
536
- children: B.indexStatus.toLowerCase()
537
+ children: V.indexStatus.toLowerCase()
537
538
  }),
538
- /* @__PURE__ */ x("p", {
539
+ /* @__PURE__ */ S("p", {
539
540
  className: "text-sm text-text-secondary",
540
- children: A("botlit.kb.indexStatus", "Index Status")
541
+ children: M("botlit.kb.indexStatus", "Index Status")
541
542
  })
542
543
  ]
543
544
  }),
544
- /* @__PURE__ */ x(s, { children: /* @__PURE__ */ S(c, {
545
+ /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(c, {
545
546
  className: "pt-6 text-center",
546
- children: [/* @__PURE__ */ x("p", {
547
+ children: [/* @__PURE__ */ S("p", {
547
548
  className: "text-3xl font-bold text-text-primary",
548
- children: B.totalDocuments
549
- }), /* @__PURE__ */ x("p", {
549
+ children: V.totalDocuments
550
+ }), /* @__PURE__ */ S("p", {
550
551
  className: "text-sm text-text-secondary",
551
- children: A("botlit.kb.documents", "Documents")
552
+ children: M("botlit.kb.documents", "Documents")
552
553
  })]
553
554
  }) }),
554
- /* @__PURE__ */ x(s, { children: /* @__PURE__ */ S(c, {
555
+ /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(c, {
555
556
  className: "pt-6 text-center",
556
- children: [/* @__PURE__ */ x("p", {
557
+ children: [/* @__PURE__ */ S("p", {
557
558
  className: "text-3xl font-bold text-text-primary",
558
- children: B.totalChunks
559
- }), /* @__PURE__ */ x("p", {
559
+ children: V.totalChunks
560
+ }), /* @__PURE__ */ S("p", {
560
561
  className: "text-sm text-text-secondary",
561
- children: A("botlit.kb.chunks", "Chunks")
562
+ children: M("botlit.kb.chunks", "Chunks")
562
563
  })]
563
564
  }) }),
564
- /* @__PURE__ */ x(s, { children: /* @__PURE__ */ S(c, {
565
+ /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(c, {
565
566
  className: "pt-6 text-center",
566
- children: [/* @__PURE__ */ x("p", {
567
+ children: [/* @__PURE__ */ S("p", {
567
568
  className: "text-3xl font-bold text-text-primary",
568
- children: B.vectorCount
569
- }), /* @__PURE__ */ x("p", {
569
+ children: V.vectorCount
570
+ }), /* @__PURE__ */ S("p", {
570
571
  className: "text-sm text-text-secondary",
571
- children: A("botlit.kb.vectors", "Vectors")
572
+ children: M("botlit.kb.vectors", "Vectors")
572
573
  })]
573
574
  }) })
574
575
  ]
575
576
  }),
576
- /* @__PURE__ */ S(s, { children: [/* @__PURE__ */ S(u, { children: [/* @__PURE__ */ S(d, {
577
+ /* @__PURE__ */ C(s, { children: [/* @__PURE__ */ C(u, { children: [/* @__PURE__ */ C(d, {
577
578
  className: "flex items-center gap-2",
578
- children: [/* @__PURE__ */ x(je, {
579
+ children: [/* @__PURE__ */ S(je, {
579
580
  size: 18,
580
581
  "aria-hidden": "true"
581
- }), A("botlit.kb.indexConfig", "Index Configuration")]
582
- }), /* @__PURE__ */ x(l, { children: A("botlit.kb.indexConfigHelp", "How documents are embedded and split before they are indexed") })] }), /* @__PURE__ */ x(c, {
582
+ }), M("botlit.kb.indexConfig", "Index Configuration")]
583
+ }), /* @__PURE__ */ S(l, { children: M("botlit.kb.indexConfigHelp", "How documents are embedded and split before they are indexed") })] }), /* @__PURE__ */ S(c, {
583
584
  className: "space-y-4",
584
- children: Xe ? /* @__PURE__ */ S("form", {
585
+ children: Ze ? /* @__PURE__ */ C("form", {
585
586
  id: "kb-edit-form",
586
587
  noValidate: !0,
587
- onSubmit: (e) => void tt(e),
588
+ onSubmit: (e) => void nt(e),
588
589
  className: "space-y-4",
589
- children: [ot, at(!1)]
590
- }) : /* @__PURE__ */ S("div", {
590
+ children: [st, ot(!1)]
591
+ }) : /* @__PURE__ */ C("div", {
591
592
  className: "grid grid-cols-2 gap-6 md:grid-cols-3",
592
593
  children: [
593
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
594
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
594
595
  className: "text-sm text-text-secondary",
595
- children: A("botlit.kb.embeddingModel", "Embedding Model")
596
- }), /* @__PURE__ */ x("p", {
596
+ children: M("botlit.kb.embeddingModel", "Embedding Model")
597
+ }), /* @__PURE__ */ S("p", {
597
598
  className: "font-mono text-sm font-medium",
598
- children: B.embeddingModel
599
+ children: V.embeddingModel
599
600
  })] }),
600
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
601
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
601
602
  className: "text-sm text-text-secondary",
602
- children: A("botlit.kb.dimensions", "Dimensions")
603
- }), /* @__PURE__ */ x("p", {
603
+ children: M("botlit.kb.dimensions", "Dimensions")
604
+ }), /* @__PURE__ */ S("p", {
604
605
  className: "font-medium",
605
- children: B.embeddingDimensions
606
+ children: V.embeddingDimensions
606
607
  })] }),
607
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
608
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
608
609
  className: "text-sm text-text-secondary",
609
- children: A("botlit.kb.form.strategy", "Chunking Strategy")
610
- }), /* @__PURE__ */ x("p", {
610
+ children: M("botlit.kb.form.strategy", "Chunking Strategy")
611
+ }), /* @__PURE__ */ S("p", {
611
612
  className: "font-medium",
612
- children: B.chunkingStrategy
613
+ children: V.chunkingStrategy
613
614
  })] }),
614
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
615
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
615
616
  className: "text-sm text-text-secondary",
616
- children: A("botlit.kb.form.chunkSize", "Chunk Size")
617
- }), /* @__PURE__ */ x("p", {
617
+ children: M("botlit.kb.form.chunkSize", "Chunk Size")
618
+ }), /* @__PURE__ */ S("p", {
618
619
  className: "font-medium",
619
- children: B.chunkSize
620
+ children: V.chunkSize
620
621
  })] }),
621
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
622
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
622
623
  className: "text-sm text-text-secondary",
623
- children: A("botlit.kb.form.chunkOverlap", "Chunk Overlap")
624
- }), /* @__PURE__ */ x("p", {
624
+ children: M("botlit.kb.form.chunkOverlap", "Chunk Overlap")
625
+ }), /* @__PURE__ */ S("p", {
625
626
  className: "font-medium",
626
- children: B.chunkOverlap
627
+ children: V.chunkOverlap
627
628
  })] }),
628
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
629
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
629
630
  className: "text-sm text-text-secondary",
630
- children: A("botlit.kb.lastIndexed", "Last Indexed")
631
- }), /* @__PURE__ */ x("p", {
631
+ children: M("botlit.kb.lastIndexed", "Last Indexed")
632
+ }), /* @__PURE__ */ S("p", {
632
633
  className: "font-medium",
633
- children: B.lastIndexedAt ? g(B.lastIndexedAt) : A("botlit.kb.never", "Never")
634
+ children: V.lastIndexedAt ? g(V.lastIndexedAt) : M("botlit.kb.never", "Never")
634
635
  })] })
635
636
  ]
636
637
  })
637
638
  })] }),
638
- M && /* @__PURE__ */ x(a, {
639
+ N && /* @__PURE__ */ S(a, {
639
640
  permission: i.KNOWLEDGE_MANAGE,
640
- children: /* @__PURE__ */ x(n, { knowledgeBaseId: M })
641
+ children: /* @__PURE__ */ S(n, { knowledgeBaseId: N })
642
+ }),
643
+ N && /* @__PURE__ */ S(ee, {
644
+ knowledgeBaseId: N,
645
+ documentTitles: new Map(W.map((e) => [e.id, e.title]))
641
646
  }),
642
- /* @__PURE__ */ S(s, { children: [/* @__PURE__ */ S(u, { children: [/* @__PURE__ */ S(d, {
647
+ /* @__PURE__ */ C(s, { children: [/* @__PURE__ */ C(u, { children: [/* @__PURE__ */ C(d, {
643
648
  className: "flex items-center gap-2",
644
- children: [/* @__PURE__ */ x(Ae, {
649
+ children: [/* @__PURE__ */ S(Ae, {
645
650
  size: 18,
646
651
  "aria-hidden": "true"
647
- }), A("botlit.kb.documentsTitle", "Documents ({{count}})", { count: B.totalDocuments })]
648
- }), /* @__PURE__ */ x(l, { children: A("botlit.kb.documentsHelp", "Source documents indexed into this knowledge base") })] }), /* @__PURE__ */ x(c, {
652
+ }), M("botlit.kb.documentsTitle", "Documents ({{count}})", { count: V.totalDocuments })]
653
+ }), /* @__PURE__ */ S(l, { children: M("botlit.kb.documentsHelp", "Source documents indexed into this knowledge base") })] }), /* @__PURE__ */ S(c, {
649
654
  className: "p-0",
650
- children: U.loading ? /* @__PURE__ */ x("p", {
655
+ children: U.loading ? /* @__PURE__ */ S("p", {
651
656
  role: "status",
652
657
  "aria-busy": "true",
653
658
  className: "p-8 text-center text-text-secondary",
654
- children: A("botlit.kb.documentsLoading", "Loading documents…")
655
- }) : U.error ? /* @__PURE__ */ x("div", {
659
+ children: M("botlit.kb.documentsLoading", "Loading documents…")
660
+ }) : U.error ? /* @__PURE__ */ S("div", {
656
661
  className: "p-4",
657
- children: /* @__PURE__ */ x(o, {
658
- resource: A("botlit.kb.documentsResource", "documents"),
662
+ children: /* @__PURE__ */ S(o, {
663
+ resource: M("botlit.kb.documentsResource", "documents"),
659
664
  error: U.error,
660
665
  onRetry: () => void U.refetch()
661
666
  })
662
- }) : W.length > 0 ? /* @__PURE__ */ x("ul", {
667
+ }) : W.length > 0 ? /* @__PURE__ */ S("ul", {
663
668
  className: "divide-y divide-border-subtle",
664
- children: W.map((e) => /* @__PURE__ */ S("li", {
669
+ children: W.map((e) => /* @__PURE__ */ C("li", {
665
670
  className: "flex items-center justify-between gap-4 p-4",
666
- children: [/* @__PURE__ */ S("div", {
671
+ children: [/* @__PURE__ */ C("div", {
667
672
  className: "min-w-0",
668
673
  children: [
669
- /* @__PURE__ */ x("p", {
674
+ /* @__PURE__ */ S("p", {
670
675
  className: "truncate font-medium",
671
676
  children: e.title
672
677
  }),
673
- /* @__PURE__ */ x("p", {
678
+ /* @__PURE__ */ S("p", {
674
679
  className: "text-sm text-text-secondary",
675
- children: A("botlit.kb.document.meta", "{{chunks}} chunks · added {{added}}", {
680
+ children: M("botlit.kb.document.meta", "{{chunks}} chunks · added {{added}}", {
676
681
  chunks: e.chunkCount,
677
682
  added: g(e.addedAt)
678
683
  })
679
684
  }),
680
- e.processingError && /* @__PURE__ */ x("p", {
685
+ e.processingError && /* @__PURE__ */ S("p", {
681
686
  className: "mt-1 text-sm text-status-error-text",
682
687
  children: e.processingError
683
688
  })
684
689
  ]
685
- }), /* @__PURE__ */ S("div", {
690
+ }), /* @__PURE__ */ C("div", {
686
691
  className: "flex items-center gap-3",
687
- children: [/* @__PURE__ */ x(re, { status: e.status }), j(i.KNOWLEDGE_DELETE) && /* @__PURE__ */ x(f, {
692
+ children: [/* @__PURE__ */ S(ie, { status: e.status }), Le(i.KNOWLEDGE_DELETE) && /* @__PURE__ */ S(f, {
688
693
  variant: "ghost",
689
694
  size: "icon",
690
- "aria-label": A("botlit.kb.document.removeFor", "Remove {{title}}", { title: e.title }),
691
- onClick: () => void it(e),
692
- children: /* @__PURE__ */ x(T, {
695
+ "aria-label": M("botlit.kb.document.removeFor", "Remove {{title}}", { title: e.title }),
696
+ onClick: () => void at(e),
697
+ children: /* @__PURE__ */ S(T, {
693
698
  size: 16,
694
699
  "aria-hidden": "true"
695
700
  })
696
701
  })]
697
702
  })]
698
703
  }, e.id))
699
- }) : /* @__PURE__ */ S("div", {
704
+ }) : /* @__PURE__ */ C("div", {
700
705
  className: "p-8 text-center text-text-secondary",
701
- children: [/* @__PURE__ */ x(Oe, {
706
+ children: [/* @__PURE__ */ S(Oe, {
702
707
  className: "mx-auto mb-2 h-8 w-8 opacity-50",
703
708
  "aria-hidden": "true"
704
- }), /* @__PURE__ */ x("p", { children: A("botlit.kb.noDocuments", "No documents indexed yet") })]
709
+ }), /* @__PURE__ */ S("p", { children: M("botlit.kb.noDocuments", "No documents indexed yet") })]
705
710
  })
706
711
  })] }),
707
- /* @__PURE__ */ S(s, { children: [/* @__PURE__ */ x(u, { children: /* @__PURE__ */ S(d, {
712
+ /* @__PURE__ */ C(s, { children: [/* @__PURE__ */ S(u, { children: /* @__PURE__ */ C(d, {
708
713
  className: "flex items-center gap-2",
709
- children: [/* @__PURE__ */ x(w, {
714
+ children: [/* @__PURE__ */ S(w, {
710
715
  size: 18,
711
716
  "aria-hidden": "true"
712
- }), A("botlit.kb.metadata", "Metadata")]
713
- }) }), /* @__PURE__ */ x(c, { children: /* @__PURE__ */ S("div", {
717
+ }), M("botlit.kb.metadata", "Metadata")]
718
+ }) }), /* @__PURE__ */ S(c, { children: /* @__PURE__ */ C("div", {
714
719
  className: "grid grid-cols-2 gap-6 text-sm md:grid-cols-3",
715
720
  children: [
716
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
721
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
717
722
  className: "text-text-secondary",
718
- children: A("botlit.kb.createdAt", "Created")
719
- }), /* @__PURE__ */ x("p", {
723
+ children: M("botlit.kb.createdAt", "Created")
724
+ }), /* @__PURE__ */ S("p", {
720
725
  className: "font-medium",
721
- children: g(B.createdAt)
726
+ children: g(V.createdAt)
722
727
  })] }),
723
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
728
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
724
729
  className: "text-text-secondary",
725
- children: A("botlit.kb.updatedLabel", "Updated")
726
- }), /* @__PURE__ */ x("p", {
730
+ children: M("botlit.kb.updatedLabel", "Updated")
731
+ }), /* @__PURE__ */ S("p", {
727
732
  className: "font-medium",
728
- children: g(B.updatedAt)
733
+ children: g(V.updatedAt)
729
734
  })] }),
730
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
735
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
731
736
  className: "text-text-secondary",
732
- children: A("botlit.kb.lastIndexed", "Last Indexed")
733
- }), /* @__PURE__ */ x("p", {
737
+ children: M("botlit.kb.lastIndexed", "Last Indexed")
738
+ }), /* @__PURE__ */ S("p", {
734
739
  className: "font-medium",
735
- children: B.lastIndexedAt ? g(B.lastIndexedAt) : "—"
740
+ children: V.lastIndexedAt ? g(V.lastIndexedAt) : "—"
736
741
  })] })
737
742
  ]
738
743
  }) })] })
@@ -740,9 +745,9 @@ var Ie = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface
740
745
  })
741
746
  });
742
747
  };
743
- function Le(e) {
748
+ function Ie(e) {
744
749
  return D.find((t) => t === e) ?? "RECURSIVE";
745
750
  }
746
- export { k as KnowledgeBaseDetailPage };
751
+ export { j as KnowledgeBaseDetailPage };
747
752
 
748
753
  //# sourceMappingURL=KnowledgeBaseDetailPage.js.map