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