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