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