@burdenoff/microfe-botmanor 2026.1120.1 → 2026.1120.2

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