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