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