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