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