@burdenoff/microfe-botmanor 2026.1027.2 → 2026.1027.3
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 +142 -132
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/components/AgentApprovalPanel.js +144 -126
- package/dist/botlit/components/AgentApprovalPanel.js.map +1 -1
- package/dist/botlit/components/ModelRegistrationPanel.js +4 -4
- package/dist/botlit/components/VersionHistoryPanel.js +92 -83
- package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
- package/dist/botlit/pages/A2AAgentDetailPage.js +212 -203
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/A2ARegistryPage.js +129 -117
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
- package/dist/botlit/pages/AgentApprovalsPage.js +122 -110
- package/dist/botlit/pages/AgentApprovalsPage.js.map +1 -1
- package/dist/botlit/pages/AgentBuilderPage.js +18 -18
- package/dist/botlit/pages/AgentDetailPage.js +298 -273
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/AgentsListPage.js +145 -121
- package/dist/botlit/pages/AgentsListPage.js.map +1 -1
- package/dist/botlit/pages/BotChannelsTab.js +238 -226
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
- package/dist/botlit/pages/BotDetailPage.js +307 -288
- package/dist/botlit/pages/BotDetailPage.js.map +1 -1
- package/dist/botlit/pages/BotWorkflowTab.js +125 -116
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
- package/dist/botlit/pages/BotsListPage.js +159 -144
- package/dist/botlit/pages/BotsListPage.js.map +1 -1
- package/dist/botlit/pages/BucketsPage.js +279 -258
- package/dist/botlit/pages/BucketsPage.js.map +1 -1
- package/dist/botlit/pages/ChannelDetailPage.js +346 -328
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
- package/dist/botlit/pages/ChannelRoutesPage.js +10 -10
- package/dist/botlit/pages/ChannelsPage.js +163 -148
- package/dist/botlit/pages/ChannelsPage.js.map +1 -1
- package/dist/botlit/pages/DashboardPage.js +129 -114
- package/dist/botlit/pages/DashboardPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionDetailPage.js +145 -139
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionsPage.js +14 -14
- package/dist/botlit/pages/InstalledPackagesPage.js +245 -227
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js +168 -156
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBasesPage.js +91 -79
- package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
- package/dist/botlit/pages/MCPServerDetailPage.js +200 -188
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
- package/dist/botlit/pages/MCPServersPage.js +170 -155
- package/dist/botlit/pages/MCPServersPage.js.map +1 -1
- package/dist/botlit/pages/PoliciesPage.js +113 -104
- package/dist/botlit/pages/PoliciesPage.js.map +1 -1
- package/dist/botlit/pages/PolicyDetailPage.js +145 -133
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptStudioPage.js +106 -97
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplateDetailPage.js +359 -347
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplatesPage.js +127 -112
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +219 -210
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfilesPage.js +112 -103
- package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
- package/dist/botlit/pages/SettingsPage.js +264 -252
- package/dist/botlit/pages/SettingsPage.js.map +1 -1
- package/dist/botlit/pages/SkillDetailPage.js +235 -226
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
- package/dist/botlit/pages/SkillsPage.js +115 -106
- package/dist/botlit/pages/SkillsPage.js.map +1 -1
- package/dist/botlit/pages/StorePackageDetailPage.js +194 -188
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
- package/dist/botlit/pages/StorePage.js +161 -155
- package/dist/botlit/pages/StorePage.js.map +1 -1
- package/dist/botlit/permissions/PermissionRequired.js +45 -0
- package/dist/botlit/permissions/PermissionRequired.js.map +1 -0
- package/dist/botlit/permissions/botmanorPermissions.js +72 -0
- package/dist/botlit/permissions/botmanorPermissions.js.map +1 -0
- package/dist/botlit/permissions/index.js +3 -0
- package/dist/botlit/permissions/useBotmanorPermissions.js +19 -0
- package/dist/botlit/permissions/useBotmanorPermissions.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { BOTMANOR_PERMISSIONS as t } from "../permissions/botmanorPermissions.js";
|
|
3
|
+
import { BotmanorPermissionGate as n } from "../permissions/useBotmanorPermissions.js";
|
|
4
|
+
import { Button as r } from "../components/Button.js";
|
|
5
|
+
import "../permissions/index.js";
|
|
6
|
+
import { Card as i, CardContent as a, CardHeader as o, CardTitle as s } from "../components/Card.js";
|
|
7
|
+
import { Badge as c } from "../components/Badge.js";
|
|
8
|
+
import { isNative as l, nativeCopyText as u, nativeNotify as d, nativeOpenUrl as f, nativeToast as p } from "../../utils/nativeBridge.js";
|
|
9
|
+
import { EmptyState as m } from "../components/EmptyState.js";
|
|
10
|
+
import { Input as h } from "../components/Input.js";
|
|
11
|
+
import { useBotChannelRoutes as g, useChannelConnector as _, useCreateChannelRoute as v, useDeleteChannelRoute as y } from "../hooks/useChannels.js";
|
|
12
|
+
import { useGlobalChannels as b, useLinkIntegrationConnection as x, useMyUserPlatformConnection as S, useRevokeSlackConnection as C, useToggleSlackNotifications as w } from "../hooks/useUserPlatformConnection.js";
|
|
10
13
|
import "../hooks/index.js";
|
|
11
|
-
import { ChannelSelectorSheet as
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { Bell as
|
|
15
|
-
import { toast as
|
|
14
|
+
import { ChannelSelectorSheet as T } from "../components/ChannelSelectorSheet.js";
|
|
15
|
+
import { useCallback as E, useState as D } from "react";
|
|
16
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
17
|
+
import { Bell as j, BellOff as M, CheckCircle2 as N, Loader2 as P, Mail as F, MessageCircle as I, MessageSquare as L, Plus as R, Radio as z, Slack as B, Trash2 as V, Unlink as H, Users as U } from "lucide-react";
|
|
18
|
+
import { toast as W } from "sonner";
|
|
16
19
|
//#region src/botlit/pages/BotChannelsTab.tsx
|
|
17
|
-
var
|
|
20
|
+
var G = {
|
|
18
21
|
SLACK: "slack-user",
|
|
19
22
|
TEAMS: "teams-user",
|
|
20
23
|
DISCORD: "discord-user",
|
|
21
24
|
WHATSAPP: "whatsapp-user"
|
|
22
|
-
},
|
|
25
|
+
}, K = new Set([
|
|
23
26
|
"SLACK",
|
|
24
27
|
"TEAMS",
|
|
25
28
|
"DISCORD"
|
|
26
29
|
]);
|
|
27
|
-
function
|
|
30
|
+
function q(e) {
|
|
28
31
|
return e ? {
|
|
29
32
|
SLACK_BOT: "Slack Bot",
|
|
30
33
|
SLACK_WEBHOOK: "Slack Webhook",
|
|
@@ -50,481 +53,490 @@ function G(e) {
|
|
|
50
53
|
WEBHOOK_HTTP: "HTTP Webhook"
|
|
51
54
|
}[e] ?? e.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase()) : null;
|
|
52
55
|
}
|
|
53
|
-
function
|
|
56
|
+
function J(e) {
|
|
54
57
|
switch (e) {
|
|
55
58
|
case "SLACK": return {
|
|
56
59
|
label: "Slack",
|
|
57
60
|
badgeClass: "bg-pink-100 text-pink-700",
|
|
58
|
-
icon: /* @__PURE__ */
|
|
61
|
+
icon: /* @__PURE__ */ k(B, { size: 18 }),
|
|
59
62
|
accentBg: "bg-[#611f69]/10",
|
|
60
63
|
accentText: "text-[#611f69]"
|
|
61
64
|
};
|
|
62
65
|
case "TEAMS": return {
|
|
63
66
|
label: "Teams",
|
|
64
67
|
badgeClass: "bg-indigo-100 text-indigo-700",
|
|
65
|
-
icon: /* @__PURE__ */
|
|
68
|
+
icon: /* @__PURE__ */ k(U, { size: 18 }),
|
|
66
69
|
accentBg: "bg-indigo-500/10",
|
|
67
70
|
accentText: "text-indigo-600"
|
|
68
71
|
};
|
|
69
72
|
case "DISCORD": return {
|
|
70
73
|
label: "Discord",
|
|
71
74
|
badgeClass: "bg-violet-100 text-violet-700",
|
|
72
|
-
icon: /* @__PURE__ */
|
|
75
|
+
icon: /* @__PURE__ */ k(I, { size: 18 }),
|
|
73
76
|
accentBg: "bg-violet-500/10",
|
|
74
77
|
accentText: "text-violet-600"
|
|
75
78
|
};
|
|
76
79
|
case "WHATSAPP": return {
|
|
77
80
|
label: "WhatsApp",
|
|
78
81
|
badgeClass: "bg-green-100 text-green-700",
|
|
79
|
-
icon: /* @__PURE__ */
|
|
82
|
+
icon: /* @__PURE__ */ k(L, { size: 18 }),
|
|
80
83
|
accentBg: "bg-green-500/10",
|
|
81
84
|
accentText: "text-green-700"
|
|
82
85
|
};
|
|
83
86
|
case "EMAIL": return {
|
|
84
87
|
label: "Email",
|
|
85
88
|
badgeClass: "bg-blue-100 text-blue-700",
|
|
86
|
-
icon: /* @__PURE__ */
|
|
89
|
+
icon: /* @__PURE__ */ k(F, { size: 18 }),
|
|
87
90
|
accentBg: "bg-blue-500/10",
|
|
88
91
|
accentText: "text-blue-600"
|
|
89
92
|
};
|
|
90
93
|
case "SMS": return {
|
|
91
94
|
label: "SMS",
|
|
92
95
|
badgeClass: "bg-green-100 text-green-700",
|
|
93
|
-
icon: /* @__PURE__ */
|
|
96
|
+
icon: /* @__PURE__ */ k(L, { size: 18 }),
|
|
94
97
|
accentBg: "bg-green-500/10",
|
|
95
98
|
accentText: "text-green-600"
|
|
96
99
|
};
|
|
97
100
|
default: return {
|
|
98
101
|
label: e,
|
|
99
102
|
badgeClass: "bg-gray-100 text-gray-700",
|
|
100
|
-
icon: /* @__PURE__ */
|
|
103
|
+
icon: /* @__PURE__ */ k(z, { size: 18 }),
|
|
101
104
|
accentBg: "bg-gray-500/10",
|
|
102
105
|
accentText: "text-gray-600"
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
var
|
|
107
|
-
let { data:
|
|
108
|
-
return
|
|
109
|
+
var Y = ({ routeId: e, connectorId: i, channelId: a, platform: o, onRemoved: s, onReconnect: f }) => {
|
|
110
|
+
let { data: m, loading: g } = _(i), v = m?.credentialsRefId ?? a, { data: b, loading: T, refetch: E } = S(v), { toggle: O, loading: F } = w(), { revoke: I, loading: L } = C(), { link: R } = x(), [z] = y(), [B, U] = D(""), [G, K] = D(!1), q = J(o);
|
|
111
|
+
return g ? /* @__PURE__ */ k("div", { className: "h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }) : /* @__PURE__ */ A("div", {
|
|
109
112
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4 space-y-3",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ A("div", {
|
|
111
114
|
className: "flex items-center justify-between",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ k("span", {
|
|
113
116
|
className: "text-xs text-text-secondary font-medium uppercase tracking-wide",
|
|
114
117
|
children: "Connected workspace"
|
|
115
|
-
}), /* @__PURE__ */
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
}), /* @__PURE__ */ k(n, {
|
|
119
|
+
permission: t.CHANNEL_DELETE,
|
|
120
|
+
children: /* @__PURE__ */ k(r, {
|
|
121
|
+
variant: "ghost",
|
|
122
|
+
size: "icon",
|
|
123
|
+
onClick: async () => {
|
|
124
|
+
if (confirm(`Remove this ${q.label} channel from the bot?`)) try {
|
|
125
|
+
await z(e), s(), W.success(`${q.label} channel removed`), l() && d("success");
|
|
126
|
+
} catch (e) {
|
|
127
|
+
W.error(e instanceof Error ? e.message : "Failed to remove"), l() && d("error");
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
className: "h-7 w-7 text-text-secondary hover:text-status-error-text",
|
|
131
|
+
title: "Remove channel",
|
|
132
|
+
children: /* @__PURE__ */ k(V, { size: 13 })
|
|
133
|
+
})
|
|
128
134
|
})]
|
|
129
|
-
}),
|
|
135
|
+
}), T ? /* @__PURE__ */ A("div", {
|
|
130
136
|
className: "flex items-center gap-2 py-2 text-text-secondary",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ k(P, {
|
|
132
138
|
size: 14,
|
|
133
139
|
className: "animate-spin"
|
|
134
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ A("span", {
|
|
135
141
|
className: "text-xs",
|
|
136
142
|
children: [
|
|
137
143
|
"Checking ",
|
|
138
|
-
|
|
144
|
+
q.label,
|
|
139
145
|
" connection…"
|
|
140
146
|
]
|
|
141
147
|
})]
|
|
142
|
-
}) :
|
|
148
|
+
}) : b?.dmAllowed ? /* @__PURE__ */ A("div", {
|
|
143
149
|
className: "space-y-2",
|
|
144
150
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ A("div", {
|
|
146
152
|
className: "flex items-center gap-3 p-3 rounded-lg bg-bg-surface border border-border-subtle",
|
|
147
153
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ k(N, {
|
|
149
155
|
size: 16,
|
|
150
156
|
className: "text-green-600 shrink-0"
|
|
151
157
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ A("div", {
|
|
153
159
|
className: "min-w-0 flex-1",
|
|
154
160
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ k("p", {
|
|
156
162
|
className: "font-medium text-sm",
|
|
157
|
-
children:
|
|
163
|
+
children: b.externalDisplayName || b.externalUsername || b.externalUserId
|
|
158
164
|
}),
|
|
159
|
-
|
|
165
|
+
b.externalUsername && /* @__PURE__ */ A("p", {
|
|
160
166
|
className: "text-xs text-text-secondary",
|
|
161
|
-
children: ["@",
|
|
167
|
+
children: ["@", b.externalUsername]
|
|
162
168
|
}),
|
|
163
|
-
|
|
169
|
+
b.connectedAt && /* @__PURE__ */ A("p", {
|
|
164
170
|
className: "text-xs text-text-secondary",
|
|
165
|
-
children: ["Connected ", new Date(
|
|
171
|
+
children: ["Connected ", new Date(b.connectedAt).toLocaleDateString()]
|
|
166
172
|
})
|
|
167
173
|
]
|
|
168
174
|
}),
|
|
169
|
-
|
|
175
|
+
b.isTokenExpired && /* @__PURE__ */ k(c, {
|
|
170
176
|
variant: "outline",
|
|
171
177
|
className: "text-xs text-amber-600 border-amber-400",
|
|
172
178
|
children: "Token expired"
|
|
173
179
|
})
|
|
174
180
|
]
|
|
175
181
|
}),
|
|
176
|
-
|
|
182
|
+
b.integrationConnectionId && /* @__PURE__ */ A("div", {
|
|
177
183
|
className: "space-y-1.5",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ k("label", {
|
|
179
185
|
className: "text-xs font-medium text-text-secondary",
|
|
180
186
|
children: "Integration Connection ID"
|
|
181
|
-
}), /* @__PURE__ */
|
|
182
|
-
value:
|
|
187
|
+
}), /* @__PURE__ */ k(h, {
|
|
188
|
+
value: b.integrationConnectionId,
|
|
183
189
|
readOnly: !0,
|
|
184
190
|
className: "text-xs font-mono bg-bg-sunken/50 cursor-default",
|
|
185
191
|
onClick: (e) => {
|
|
186
|
-
e.currentTarget.select(),
|
|
192
|
+
e.currentTarget.select(), u(b.integrationConnectionId), W.success("Connection ID copied to clipboard"), l() && p("Copied");
|
|
187
193
|
},
|
|
188
194
|
title: "Click to copy"
|
|
189
195
|
})]
|
|
190
196
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ A("div", {
|
|
192
198
|
className: "flex items-center justify-between p-3 border border-border-subtle rounded-lg bg-bg-surface",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ A("div", {
|
|
194
200
|
className: "flex items-center gap-2",
|
|
195
|
-
children: [
|
|
201
|
+
children: [b.notificationsEnabled ? /* @__PURE__ */ k(j, {
|
|
196
202
|
size: 14,
|
|
197
203
|
className: "text-primary"
|
|
198
|
-
}) : /* @__PURE__ */
|
|
204
|
+
}) : /* @__PURE__ */ k(M, {
|
|
199
205
|
size: 14,
|
|
200
206
|
className: "text-text-secondary"
|
|
201
|
-
}), /* @__PURE__ */
|
|
207
|
+
}), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
202
208
|
className: "text-sm font-medium",
|
|
203
209
|
children: "DM Notifications"
|
|
204
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ k("p", {
|
|
205
211
|
className: "text-xs text-text-secondary",
|
|
206
|
-
children:
|
|
212
|
+
children: b.notificationsEnabled ? `Bot will DM you on ${q.label}` : "DM notifications paused"
|
|
207
213
|
})] })]
|
|
208
|
-
}), /* @__PURE__ */
|
|
214
|
+
}), /* @__PURE__ */ k(r, {
|
|
209
215
|
variant: "outline",
|
|
210
216
|
size: "sm",
|
|
211
|
-
isLoading:
|
|
217
|
+
isLoading: F,
|
|
212
218
|
onClick: async () => {
|
|
213
|
-
await
|
|
219
|
+
await O(b.id, !b.notificationsEnabled) && await E();
|
|
214
220
|
},
|
|
215
|
-
children:
|
|
221
|
+
children: b.notificationsEnabled ? "Disable" : "Enable"
|
|
216
222
|
})]
|
|
217
223
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ A("div", {
|
|
219
225
|
className: "flex gap-2 justify-end pt-1",
|
|
220
|
-
children: [
|
|
226
|
+
children: [b.isTokenExpired && /* @__PURE__ */ k(r, {
|
|
221
227
|
variant: "outline",
|
|
222
228
|
size: "sm",
|
|
223
|
-
leftIcon:
|
|
224
|
-
onClick:
|
|
229
|
+
leftIcon: q.icon,
|
|
230
|
+
onClick: f,
|
|
225
231
|
children: "Reconnect"
|
|
226
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ k(r, {
|
|
227
233
|
variant: "destructive",
|
|
228
234
|
size: "sm",
|
|
229
|
-
leftIcon: /* @__PURE__ */
|
|
230
|
-
isLoading:
|
|
235
|
+
leftIcon: /* @__PURE__ */ k(H, { size: 13 }),
|
|
236
|
+
isLoading: L,
|
|
231
237
|
onClick: async () => {
|
|
232
|
-
await
|
|
238
|
+
await I(b.id) && await E();
|
|
233
239
|
},
|
|
234
240
|
children: "Disconnect"
|
|
235
241
|
})]
|
|
236
242
|
})
|
|
237
243
|
]
|
|
238
|
-
}) : /* @__PURE__ */
|
|
244
|
+
}) : /* @__PURE__ */ A("div", {
|
|
239
245
|
className: "space-y-3 py-2",
|
|
240
246
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ A("div", {
|
|
242
248
|
className: "flex items-center gap-2 p-3 rounded-lg bg-bg-surface border border-border-subtle",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
249
|
+
children: [/* @__PURE__ */ k("div", {
|
|
244
250
|
className: "p-2 rounded-full bg-bg-sunken shrink-0",
|
|
245
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ k("span", {
|
|
246
252
|
className: "text-text-secondary",
|
|
247
|
-
children:
|
|
253
|
+
children: q.icon
|
|
248
254
|
})
|
|
249
|
-
}), /* @__PURE__ */
|
|
255
|
+
}), /* @__PURE__ */ A("div", {
|
|
250
256
|
className: "flex-1 min-w-0",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ k("p", {
|
|
252
258
|
className: "font-medium text-sm",
|
|
253
259
|
children: "No personal account connected"
|
|
254
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ A("p", {
|
|
255
261
|
className: "text-xs text-text-secondary mt-0.5",
|
|
256
262
|
children: [
|
|
257
263
|
"Connect your ",
|
|
258
|
-
|
|
264
|
+
q.label,
|
|
259
265
|
" account to receive bot DMs"
|
|
260
266
|
]
|
|
261
267
|
})]
|
|
262
268
|
})]
|
|
263
269
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ A("div", {
|
|
265
271
|
className: "p-3 rounded-lg bg-bg-sunken/50 space-y-2",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ k("p", {
|
|
267
273
|
className: "text-xs font-medium text-text-secondary",
|
|
268
274
|
children: "Connect your account:"
|
|
269
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ A("ol", {
|
|
270
276
|
className: "list-decimal list-inside space-y-1 text-xs text-text-secondary",
|
|
271
277
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ k("li", { children: "Click \"Open Integrations\" below (opens in new tab)" }),
|
|
279
|
+
/* @__PURE__ */ A("li", { children: [
|
|
274
280
|
"Connect your ",
|
|
275
|
-
|
|
281
|
+
q.label,
|
|
276
282
|
" account via OAuth"
|
|
277
283
|
] }),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ k("li", { children: "Copy the Connection ID from the integrations page" }),
|
|
285
|
+
/* @__PURE__ */ k("li", { children: "Paste it below and click \"Link Connection\"" })
|
|
280
286
|
]
|
|
281
287
|
})]
|
|
282
288
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ k(r, {
|
|
284
290
|
variant: "outline",
|
|
285
291
|
size: "sm",
|
|
286
|
-
leftIcon:
|
|
287
|
-
onClick:
|
|
292
|
+
leftIcon: q.icon,
|
|
293
|
+
onClick: f,
|
|
288
294
|
className: "w-full",
|
|
289
295
|
children: "Open Integrations →"
|
|
290
296
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ A("div", {
|
|
292
298
|
className: "flex gap-2",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ k(h, {
|
|
294
300
|
placeholder: "Paste integration connection ID...",
|
|
295
|
-
value:
|
|
296
|
-
onChange: (e) =>
|
|
301
|
+
value: B,
|
|
302
|
+
onChange: (e) => U(e.target.value),
|
|
297
303
|
className: "flex-1 text-sm"
|
|
298
|
-
}), /* @__PURE__ */
|
|
304
|
+
}), /* @__PURE__ */ k(r, {
|
|
299
305
|
size: "sm",
|
|
300
306
|
onClick: async () => {
|
|
301
|
-
if (!
|
|
302
|
-
|
|
307
|
+
if (!B.trim()) {
|
|
308
|
+
W.error("Please enter an integration connection ID");
|
|
303
309
|
return;
|
|
304
310
|
}
|
|
305
|
-
|
|
311
|
+
K(!0);
|
|
306
312
|
try {
|
|
307
|
-
let e = await
|
|
308
|
-
e ? (
|
|
313
|
+
let e = await R(B.trim(), v);
|
|
314
|
+
e ? (W.success(`${e.externalDisplayName ?? e.externalUsername ?? "Account"} connected! The bot can now send you direct messages.`), await E(), U("")) : W.error("Failed to link connection. Please verify the ID and try again.");
|
|
309
315
|
} catch (e) {
|
|
310
|
-
|
|
316
|
+
W.error(e instanceof Error ? e.message : "Failed to link connection");
|
|
311
317
|
} finally {
|
|
312
|
-
|
|
318
|
+
K(!1);
|
|
313
319
|
}
|
|
314
320
|
},
|
|
315
|
-
isLoading:
|
|
316
|
-
disabled: !
|
|
321
|
+
isLoading: G,
|
|
322
|
+
disabled: !B.trim() || G,
|
|
317
323
|
children: "Link Connection"
|
|
318
324
|
})]
|
|
319
325
|
})
|
|
320
326
|
]
|
|
321
327
|
})]
|
|
322
328
|
});
|
|
323
|
-
},
|
|
324
|
-
let { basePath:
|
|
325
|
-
let t =
|
|
329
|
+
}, X = ({ channel: u, routes: d, botId: p, botName: m, onRoutesChanged: h }) => {
|
|
330
|
+
let { basePath: g } = e(), [_] = v(), [y, b] = D(!1), x = u.platform, S = J(x), C = q(u.adapterType), w = y, T = E((e) => {
|
|
331
|
+
let t = G[x];
|
|
326
332
|
if (!t) return;
|
|
327
|
-
let n = window.location.origin + window.location.pathname + window.location.search, r = `${
|
|
333
|
+
let n = window.location.origin + window.location.pathname + window.location.search, r = `${g ? g.replace(/\/(botmanor|botlit)(\/.*)?$/, "/integrations") : "/integrations"}/connections/add?${new URLSearchParams({
|
|
328
334
|
providerKey: t,
|
|
329
335
|
returnTo: n,
|
|
330
336
|
channelId: e
|
|
331
337
|
}).toString()}`;
|
|
332
|
-
|
|
333
|
-
}, [
|
|
334
|
-
|
|
338
|
+
l() && /^https?:\/\//.test(r) ? f(r) : window.open(r, "_blank");
|
|
339
|
+
}, [x, g]), O = E(async () => {
|
|
340
|
+
b(!0);
|
|
335
341
|
try {
|
|
336
|
-
await
|
|
337
|
-
connectorId:
|
|
338
|
-
appId:
|
|
342
|
+
await _({
|
|
343
|
+
connectorId: u.id,
|
|
344
|
+
appId: p,
|
|
339
345
|
locationId: "*",
|
|
340
346
|
metadata: {
|
|
341
347
|
locationName: "All channels & DMs",
|
|
342
|
-
appName:
|
|
348
|
+
appName: m
|
|
343
349
|
}
|
|
344
|
-
}), await
|
|
350
|
+
}), await h(), T(u.id);
|
|
345
351
|
} catch (e) {
|
|
346
|
-
|
|
352
|
+
W.error(e instanceof Error ? e.message : `Failed to connect ${S.label}`), b(!1);
|
|
347
353
|
}
|
|
348
354
|
}, [
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
]),
|
|
357
|
-
|
|
358
|
-
}, [
|
|
359
|
-
return /* @__PURE__ */
|
|
355
|
+
p,
|
|
356
|
+
m,
|
|
357
|
+
u.id,
|
|
358
|
+
_,
|
|
359
|
+
S.label,
|
|
360
|
+
T,
|
|
361
|
+
h
|
|
362
|
+
]), j = E(() => {
|
|
363
|
+
T(u.id);
|
|
364
|
+
}, [u.id, T]);
|
|
365
|
+
return /* @__PURE__ */ A(i, { children: [/* @__PURE__ */ A(o, {
|
|
360
366
|
className: "flex flex-row items-center justify-between pb-3",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ A("div", {
|
|
362
368
|
className: "flex items-center gap-2.5",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
364
|
-
className: `p-1.5 rounded-md ${
|
|
365
|
-
children: /* @__PURE__ */
|
|
366
|
-
className:
|
|
367
|
-
children:
|
|
369
|
+
children: [/* @__PURE__ */ k("div", {
|
|
370
|
+
className: `p-1.5 rounded-md ${S.accentBg}`,
|
|
371
|
+
children: /* @__PURE__ */ k("span", {
|
|
372
|
+
className: S.accentText,
|
|
373
|
+
children: S.icon
|
|
368
374
|
})
|
|
369
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k(s, {
|
|
370
376
|
className: "text-base",
|
|
371
|
-
children:
|
|
372
|
-
}),
|
|
377
|
+
children: u.name
|
|
378
|
+
}), C && /* @__PURE__ */ k("p", {
|
|
373
379
|
className: "text-xs text-text-secondary mt-0.5",
|
|
374
|
-
children:
|
|
380
|
+
children: C
|
|
375
381
|
})] })]
|
|
376
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ A("div", {
|
|
377
383
|
className: "flex items-center gap-1.5",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
379
|
-
className: `px-2 py-0.5 text-xs font-semibold rounded-full ${
|
|
380
|
-
children:
|
|
381
|
-
}),
|
|
384
|
+
children: [/* @__PURE__ */ k("span", {
|
|
385
|
+
className: `px-2 py-0.5 text-xs font-semibold rounded-full ${S.badgeClass}`,
|
|
386
|
+
children: S.label
|
|
387
|
+
}), d.length > 0 && /* @__PURE__ */ k(c, {
|
|
382
388
|
variant: "outline",
|
|
383
389
|
className: "text-xs text-green-600 border-green-400 bg-green-50",
|
|
384
390
|
children: "Active"
|
|
385
391
|
})]
|
|
386
392
|
})]
|
|
387
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ k(a, { children: d.length > 0 ? /* @__PURE__ */ k("div", {
|
|
388
394
|
className: "space-y-3",
|
|
389
|
-
children:
|
|
395
|
+
children: d.map((e) => /* @__PURE__ */ k(Y, {
|
|
390
396
|
routeId: e.id,
|
|
391
397
|
connectorId: e.connectorId,
|
|
392
|
-
channelId:
|
|
393
|
-
platform:
|
|
394
|
-
onRemoved:
|
|
395
|
-
onReconnect:
|
|
398
|
+
channelId: u.id,
|
|
399
|
+
platform: x,
|
|
400
|
+
onRemoved: h,
|
|
401
|
+
onReconnect: j
|
|
396
402
|
}, e.id))
|
|
397
|
-
}) : /* @__PURE__ */
|
|
403
|
+
}) : /* @__PURE__ */ A("div", {
|
|
398
404
|
className: "flex flex-col items-center gap-4 py-8 text-center",
|
|
399
405
|
children: [
|
|
400
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ k("div", {
|
|
401
407
|
className: "p-4 rounded-full bg-bg-sunken",
|
|
402
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ k("span", {
|
|
403
409
|
className: "text-text-secondary",
|
|
404
|
-
children:
|
|
410
|
+
children: S.icon
|
|
405
411
|
})
|
|
406
412
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
408
414
|
className: "font-medium text-sm",
|
|
409
415
|
children: "Not connected to this bot"
|
|
410
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ A("p", {
|
|
411
417
|
className: "text-xs text-text-secondary mt-1",
|
|
412
418
|
children: [
|
|
413
419
|
"Enable ",
|
|
414
|
-
|
|
420
|
+
S.label,
|
|
415
421
|
" for this bot. Users will connect their personal accounts separately."
|
|
416
422
|
]
|
|
417
423
|
})] }),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
/* @__PURE__ */ k(n, {
|
|
425
|
+
permission: t.CHANNEL_CREATE,
|
|
426
|
+
children: /* @__PURE__ */ A(r, {
|
|
427
|
+
leftIcon: S.icon,
|
|
428
|
+
onClick: O,
|
|
429
|
+
isLoading: w,
|
|
430
|
+
children: [
|
|
431
|
+
"Set up ",
|
|
432
|
+
S.label,
|
|
433
|
+
" channel"
|
|
434
|
+
]
|
|
435
|
+
})
|
|
427
436
|
})
|
|
428
437
|
]
|
|
429
438
|
}) })] });
|
|
430
|
-
},
|
|
431
|
-
let { data: a } =
|
|
432
|
-
return !a || !o || !
|
|
439
|
+
}, Z = ({ route: e, oauthChannels: t, botId: n, botName: r, onRoutesChanged: i }) => {
|
|
440
|
+
let { data: a } = _(e.connectorId), o = t.find((e) => e.id === a?.credentialsRefId);
|
|
441
|
+
return !a || !o || !K.has(o.platform) ? null : /* @__PURE__ */ k(X, {
|
|
433
442
|
channel: o,
|
|
434
443
|
routes: [e],
|
|
435
444
|
botId: n,
|
|
436
445
|
botName: r,
|
|
437
446
|
onRoutesChanged: i
|
|
438
447
|
});
|
|
439
|
-
},
|
|
440
|
-
let { data:
|
|
441
|
-
await
|
|
442
|
-
}, [
|
|
443
|
-
SLACK: /* @__PURE__ */
|
|
444
|
-
TEAMS: /* @__PURE__ */
|
|
445
|
-
DISCORD: /* @__PURE__ */
|
|
446
|
-
},
|
|
447
|
-
|
|
448
|
+
}, Q = ({ botId: e, botName: o }) => {
|
|
449
|
+
let { data: s, loading: c, error: l } = b(), { data: u, loading: d, refetch: f } = g(e), [p, h] = D(!1), [_, v] = D(null), y = E(async () => {
|
|
450
|
+
await f();
|
|
451
|
+
}, [f]), x = s.filter((e) => K.has(e.platform)), S = new Set(u.map((e) => x.find((e) => u.some((e) => e.connectorId))?.platform).filter(Boolean)), C = x.filter((e) => !S.has(e.platform)), w = {
|
|
452
|
+
SLACK: /* @__PURE__ */ k(B, { size: 18 }),
|
|
453
|
+
TEAMS: /* @__PURE__ */ k(U, { size: 18 }),
|
|
454
|
+
DISCORD: /* @__PURE__ */ k(I, { size: 18 })
|
|
455
|
+
}, j = {};
|
|
456
|
+
x.forEach((e) => {
|
|
448
457
|
let t = e.platform;
|
|
449
|
-
|
|
458
|
+
j[t] = J(t);
|
|
450
459
|
});
|
|
451
|
-
let
|
|
452
|
-
|
|
460
|
+
let M = E((e, t) => {
|
|
461
|
+
v(e);
|
|
453
462
|
}, []);
|
|
454
|
-
if (
|
|
463
|
+
if (c || d) return /* @__PURE__ */ A("div", {
|
|
455
464
|
className: "space-y-4",
|
|
456
465
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ k("div", { className: "h-10 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg w-52" }),
|
|
467
|
+
/* @__PURE__ */ k("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }),
|
|
468
|
+
/* @__PURE__ */ k("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
|
|
460
469
|
]
|
|
461
470
|
});
|
|
462
|
-
let
|
|
463
|
-
return /* @__PURE__ */
|
|
471
|
+
let N = u.length > 0;
|
|
472
|
+
return /* @__PURE__ */ A("div", {
|
|
464
473
|
className: "space-y-4",
|
|
465
474
|
children: [
|
|
466
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", {
|
|
467
476
|
className: "font-semibold text-base",
|
|
468
477
|
children: "Channel Connections"
|
|
469
|
-
}), /* @__PURE__ */
|
|
478
|
+
}), /* @__PURE__ */ k("p", {
|
|
470
479
|
className: "text-sm text-text-secondary mt-0.5",
|
|
471
480
|
children: "Communication platforms available for this bot"
|
|
472
481
|
})] }),
|
|
473
|
-
|
|
482
|
+
l && /* @__PURE__ */ k("div", {
|
|
474
483
|
className: "flex items-start gap-2 rounded-lg border border-status-error-border/40 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
475
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ A("span", { children: ["Failed to load channels: ", l.message] })
|
|
476
485
|
}),
|
|
477
|
-
!
|
|
486
|
+
!l && x.length === 0 && /* @__PURE__ */ k(i, { children: /* @__PURE__ */ k(a, {
|
|
478
487
|
className: "py-12",
|
|
479
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ k(m, {
|
|
480
489
|
illustration: "empty-notifications",
|
|
481
490
|
title: "No channels available",
|
|
482
491
|
description: "No active communication channels have been configured yet. Contact your administrator to set up channels."
|
|
483
492
|
})
|
|
484
493
|
}) }),
|
|
485
|
-
!
|
|
494
|
+
!l && x.length > 0 && !N && !_ && /* @__PURE__ */ k(i, { children: /* @__PURE__ */ k(a, {
|
|
486
495
|
className: "py-12",
|
|
487
|
-
children: /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ k(m, {
|
|
488
497
|
illustration: "empty-notifications",
|
|
489
498
|
title: "No channels connected",
|
|
490
499
|
description: "Connect a communication channel to enable bot conversations on platforms like Slack, Teams, or Discord.",
|
|
491
|
-
action: /* @__PURE__ */
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
500
|
+
action: /* @__PURE__ */ k(n, {
|
|
501
|
+
permission: t.CHANNEL_CREATE,
|
|
502
|
+
children: /* @__PURE__ */ k(r, {
|
|
503
|
+
leftIcon: /* @__PURE__ */ k(R, { size: 16 }),
|
|
504
|
+
onClick: () => h(!0),
|
|
505
|
+
children: "Connect Channel"
|
|
506
|
+
})
|
|
495
507
|
})
|
|
496
508
|
})
|
|
497
509
|
}) }),
|
|
498
|
-
|
|
510
|
+
x.length > 0 && (N || _) && /* @__PURE__ */ A("div", {
|
|
499
511
|
className: "space-y-4",
|
|
500
|
-
children: [
|
|
512
|
+
children: [u.map((t) => /* @__PURE__ */ k(Z, {
|
|
501
513
|
route: t,
|
|
502
|
-
oauthChannels:
|
|
514
|
+
oauthChannels: x,
|
|
503
515
|
botId: e,
|
|
504
|
-
botName:
|
|
505
|
-
onRoutesChanged:
|
|
506
|
-
}, t.id)),
|
|
516
|
+
botName: o,
|
|
517
|
+
onRoutesChanged: y
|
|
518
|
+
}, t.id)), _ && /* @__PURE__ */ k(O, { children: x.filter((e) => e.id === _).map((t) => /* @__PURE__ */ k(X, {
|
|
507
519
|
channel: t,
|
|
508
|
-
routes:
|
|
520
|
+
routes: u.filter((e) => !1),
|
|
509
521
|
botId: e,
|
|
510
|
-
botName:
|
|
522
|
+
botName: o,
|
|
511
523
|
onRoutesChanged: async () => {
|
|
512
|
-
await
|
|
524
|
+
await y(), v(null);
|
|
513
525
|
}
|
|
514
526
|
}, t.id)) })]
|
|
515
527
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
open:
|
|
518
|
-
onClose: () =>
|
|
519
|
-
onSelectChannel:
|
|
520
|
-
availableChannels:
|
|
521
|
-
platformIcons:
|
|
522
|
-
platformMeta:
|
|
528
|
+
/* @__PURE__ */ k(T, {
|
|
529
|
+
open: p,
|
|
530
|
+
onClose: () => h(!1),
|
|
531
|
+
onSelectChannel: M,
|
|
532
|
+
availableChannels: C,
|
|
533
|
+
platformIcons: w,
|
|
534
|
+
platformMeta: j
|
|
523
535
|
})
|
|
524
536
|
]
|
|
525
537
|
});
|
|
526
538
|
};
|
|
527
539
|
//#endregion
|
|
528
|
-
export {
|
|
540
|
+
export { Q as BotChannelsTab };
|
|
529
541
|
|
|
530
542
|
//# sourceMappingURL=BotChannelsTab.js.map
|