@burdenoff/microfe-botmanor 2026.1203.3 → 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/BotmanorRootInner.js +38 -41
- package/dist/botlit/BotmanorRootInner.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/botlit/providers/WorkspaceFlagScope.d.ts +7 -0
- package/dist/botlit/providers/WorkspaceFlagScope.js +17 -0
- package/dist/botlit/providers/WorkspaceFlagScope.js.map +1 -0
- package/dist/botlit/providers/workspaceFlagKeys.d.ts +18 -0
- package/dist/botlit/providers/workspaceFlagKeys.js +8 -0
- package/dist/botlit/providers/workspaceFlagKeys.js.map +1 -0
- 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,35 +1,33 @@
|
|
|
1
1
|
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "../
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import "
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
24
|
-
import { useSearchParams as P } from "react-router";
|
|
2
|
+
import { PageLayout as t } from "../components/PageLayout.js";
|
|
3
|
+
import { Card as n, CardContent as r, CardDescription as i, CardHeader as a, CardTitle as o } from "../components/Card.js";
|
|
4
|
+
import { Button as s } from "../components/Button.js";
|
|
5
|
+
import { Badge as c } from "../components/Badge.js";
|
|
6
|
+
import { EmptyState as l } from "../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as u } from "../components/ErrorState.js";
|
|
8
|
+
import { Textarea as d } from "../components/Input.js";
|
|
9
|
+
import { isActiveHandoff as f, useAcceptHandoff as p, useAssignHandoff as m, useHandoffTranscript as h, useRejectHandoff as g, useReleaseHandoff as _, useReplyToHandoff as v, useResolveHandoff as y } from "../hooks/useHandoffs.js";
|
|
10
|
+
import { useAgents as b } from "../hooks/useAgents.js";
|
|
11
|
+
import { BotmanorHandoffMessageRole as x, BotmanorHandoffStatus as S } from "../../generated/wspace-types.js";
|
|
12
|
+
import { formatRelativeTime as C } from "../utils/formatters.js";
|
|
13
|
+
import { useHandoffInbox as w } from "../hooks/useHandoffInbox.js";
|
|
14
|
+
import { shortUserLabel as ee, useWorkspaceMemberDirectory as T } from "../hooks/useWorkspaceMemberDirectory.js";
|
|
15
|
+
import { isHandoffConflict as te } from "../utils/handoffInbox.js";
|
|
16
|
+
import { LoadMore as E } from "../components/LoadMore.js";
|
|
17
|
+
import { BOTMANOR_PERMISSIONS as D } from "../permissions/botmanorPermissions.js";
|
|
18
|
+
import { useBotmanorPermission as O } from "../permissions/useBotmanorPermissions.js";
|
|
19
|
+
import { useEffect as k, useMemo as A, useRef as ne, useState as j } from "react";
|
|
20
|
+
import { ThemedSelect as re } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
22
|
+
import { useSearchParams as F } from "react-router";
|
|
25
23
|
// src/botlit/pages/HandoffsPage.tsx
|
|
26
|
-
var
|
|
24
|
+
var I = "handoff", L = [
|
|
27
25
|
{
|
|
28
26
|
id: "active",
|
|
29
27
|
statuses: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
S.Requested,
|
|
29
|
+
S.Assigned,
|
|
30
|
+
S.Accepted
|
|
33
31
|
],
|
|
34
32
|
labelKey: "botlit.handoffs.filter.active",
|
|
35
33
|
label: "Active"
|
|
@@ -37,9 +35,9 @@ var F = "handoff", I = [
|
|
|
37
35
|
{
|
|
38
36
|
id: "resolved",
|
|
39
37
|
statuses: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
S.Resolved,
|
|
39
|
+
S.Released,
|
|
40
|
+
S.Rejected
|
|
43
41
|
],
|
|
44
42
|
labelKey: "botlit.handoffs.filter.resolved",
|
|
45
43
|
label: "Closed"
|
|
@@ -50,7 +48,7 @@ var F = "handoff", I = [
|
|
|
50
48
|
labelKey: "botlit.handoffs.filter.all",
|
|
51
49
|
label: "All"
|
|
52
50
|
}
|
|
53
|
-
],
|
|
51
|
+
], ie = ({ handoff: t }) => {
|
|
54
52
|
let n = e(), r = {
|
|
55
53
|
EXPLICIT_REQUEST: n("botlit.handoffs.trigger.explicitRequest", "Explicit request"),
|
|
56
54
|
CUSTOM_INTENT: n("botlit.handoffs.trigger.customIntent", "Custom intent"),
|
|
@@ -59,37 +57,37 @@ var F = "handoff", I = [
|
|
|
59
57
|
POLICY_REFUSAL: n("botlit.handoffs.trigger.policyRefusal", "Policy refusal"),
|
|
60
58
|
MANUAL: n("botlit.handoffs.trigger.manual", "Manual")
|
|
61
59
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ N(c, {
|
|
63
61
|
variant: "outline",
|
|
64
62
|
children: r[t.trigger] ?? t.trigger
|
|
65
63
|
});
|
|
66
|
-
},
|
|
64
|
+
}, ae = ({ status: t }) => {
|
|
67
65
|
let n = e(), r = {
|
|
68
|
-
[
|
|
66
|
+
[S.Requested]: {
|
|
69
67
|
text: n("botlit.handoffs.status.requested", "Requested"),
|
|
70
68
|
variant: "warning"
|
|
71
69
|
},
|
|
72
|
-
[
|
|
70
|
+
[S.Assigned]: {
|
|
73
71
|
text: n("botlit.handoffs.status.assigned", "Assigned"),
|
|
74
72
|
variant: "warning"
|
|
75
73
|
},
|
|
76
|
-
[
|
|
74
|
+
[S.Accepted]: {
|
|
77
75
|
text: n("botlit.handoffs.status.accepted", "Accepted"),
|
|
78
76
|
variant: "success"
|
|
79
77
|
},
|
|
80
|
-
[
|
|
78
|
+
[S.Resolved]: {
|
|
81
79
|
text: n("botlit.handoffs.status.resolved", "Resolved"),
|
|
82
80
|
variant: "outline"
|
|
83
81
|
},
|
|
84
|
-
[
|
|
82
|
+
[S.Released]: {
|
|
85
83
|
text: n("botlit.handoffs.status.released", "Released to bot"),
|
|
86
84
|
variant: "outline"
|
|
87
85
|
},
|
|
88
|
-
[
|
|
86
|
+
[S.Rejected]: {
|
|
89
87
|
text: n("botlit.handoffs.status.rejected", "Rejected"),
|
|
90
88
|
variant: "destructive"
|
|
91
89
|
},
|
|
92
|
-
[
|
|
90
|
+
[S.Expired]: {
|
|
93
91
|
text: n("botlit.handoffs.status.expired", "Expired"),
|
|
94
92
|
variant: "outline"
|
|
95
93
|
}
|
|
@@ -97,379 +95,379 @@ var F = "handoff", I = [
|
|
|
97
95
|
text: String(t),
|
|
98
96
|
variant: "outline"
|
|
99
97
|
};
|
|
100
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ N(c, {
|
|
101
99
|
variant: r.variant,
|
|
102
100
|
children: r.text
|
|
103
101
|
});
|
|
104
|
-
},
|
|
105
|
-
function
|
|
102
|
+
}, oe = 1e4;
|
|
103
|
+
function R(e, t) {
|
|
106
104
|
return Math.round((new Date(e).getTime() - t) / 6e4);
|
|
107
105
|
}
|
|
108
|
-
var
|
|
109
|
-
let n = e(), [r, i] =
|
|
110
|
-
if (
|
|
106
|
+
var se = ({ handoff: t }) => {
|
|
107
|
+
let n = e(), [r, i] = j(() => Date.now()), a = f(t.status) && !t.firstResponseAt;
|
|
108
|
+
if (k(() => {
|
|
111
109
|
if (!a) return;
|
|
112
110
|
let e = window.setInterval(() => i(Date.now()), 3e4);
|
|
113
111
|
return () => window.clearInterval(e);
|
|
114
112
|
}, [a]), !t.slaDueAt) return null;
|
|
115
|
-
if (t.slaBreached || a && new Date(t.slaDueAt).getTime() <= r) return /* @__PURE__ */
|
|
113
|
+
if (t.slaBreached || a && new Date(t.slaDueAt).getTime() <= r) return /* @__PURE__ */ N(c, {
|
|
116
114
|
variant: "destructive",
|
|
117
115
|
"data-testid": "handoff-sla",
|
|
118
116
|
children: n("botlit.handoffs.sla.breached", "SLA breached")
|
|
119
117
|
});
|
|
120
|
-
if (t.firstResponseAt) return /* @__PURE__ */
|
|
118
|
+
if (t.firstResponseAt) return /* @__PURE__ */ N(c, {
|
|
121
119
|
variant: "success",
|
|
122
120
|
"data-testid": "handoff-sla",
|
|
123
121
|
children: n("botlit.handoffs.sla.met", "SLA met")
|
|
124
122
|
});
|
|
125
123
|
if (!a) return null;
|
|
126
|
-
let o = Math.max(
|
|
127
|
-
return /* @__PURE__ */
|
|
124
|
+
let o = Math.max(R(t.slaDueAt, r), 0);
|
|
125
|
+
return /* @__PURE__ */ N(c, {
|
|
128
126
|
variant: "warning",
|
|
129
127
|
"data-testid": "handoff-sla",
|
|
130
128
|
children: n("botlit.handoffs.sla.due", "Reply due in {{minutes}} min", { minutes: o })
|
|
131
129
|
});
|
|
132
|
-
},
|
|
133
|
-
[
|
|
130
|
+
}, z = {
|
|
131
|
+
[x.Customer]: {
|
|
134
132
|
key: "botlit.handoffs.thread.customer",
|
|
135
133
|
label: "Customer"
|
|
136
134
|
},
|
|
137
|
-
[
|
|
135
|
+
[x.Bot]: {
|
|
138
136
|
key: "botlit.handoffs.thread.bot",
|
|
139
137
|
label: "Bot"
|
|
140
138
|
},
|
|
141
|
-
[
|
|
139
|
+
[x.Operator]: {
|
|
142
140
|
key: "botlit.handoffs.thread.operator",
|
|
143
141
|
label: "Operator"
|
|
144
142
|
}
|
|
145
|
-
},
|
|
143
|
+
}, ce = ({ handoffId: t, messages: n }) => {
|
|
146
144
|
let r = e();
|
|
147
|
-
return n.length === 0 ? /* @__PURE__ */
|
|
145
|
+
return n.length === 0 ? /* @__PURE__ */ N("p", {
|
|
148
146
|
className: "text-sm text-text-secondary",
|
|
149
147
|
children: r("botlit.handoffs.thread.empty", "No messages on this handoff yet.")
|
|
150
|
-
}) : /* @__PURE__ */
|
|
148
|
+
}) : /* @__PURE__ */ N("ol", {
|
|
151
149
|
className: "grid gap-2 rounded-card border border-border-seam p-3",
|
|
152
150
|
"aria-label": r("botlit.handoffs.thread.label", "Conversation"),
|
|
153
151
|
"data-testid": `handoff-thread-${t}`,
|
|
154
152
|
children: n.map((e) => {
|
|
155
|
-
let t =
|
|
153
|
+
let t = z[e.role] ?? {
|
|
156
154
|
key: "",
|
|
157
155
|
label: String(e.role)
|
|
158
156
|
};
|
|
159
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ P("li", {
|
|
160
158
|
className: "grid gap-0.5",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ P("span", {
|
|
162
160
|
className: "text-xs font-medium text-text-secondary",
|
|
163
161
|
children: [
|
|
164
162
|
t.key ? r(t.key, t.label) : t.label,
|
|
165
163
|
" ·",
|
|
166
164
|
" ",
|
|
167
|
-
|
|
165
|
+
C(e.createdAt)
|
|
168
166
|
]
|
|
169
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ N("span", {
|
|
170
168
|
className: "text-sm whitespace-pre-wrap text-text-primary",
|
|
171
169
|
children: e.text
|
|
172
170
|
})]
|
|
173
171
|
}, e.id);
|
|
174
172
|
})
|
|
175
173
|
});
|
|
176
|
-
},
|
|
177
|
-
let
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
}, B = ({ handoff: t, agents: n, members: r, isNew: i, canManage: a, onChanged: o, linked: l = !1 }) => {
|
|
175
|
+
let u = e(), [b, x] = p(), [w, T] = _(), [E, D] = y(), [O, A] = g(), [F, I] = m(), [L, R] = v(), z = f(t.status), B = t.status === S.Accepted, [V, H] = j(null), U = V && V.linked === l ? V.open : l, W = ne(null);
|
|
176
|
+
k(() => {
|
|
177
|
+
l && W.current?.scrollIntoView?.({
|
|
180
178
|
block: "center",
|
|
181
179
|
behavior: "smooth"
|
|
182
180
|
});
|
|
183
|
-
}, [
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
if (!
|
|
181
|
+
}, [l]);
|
|
182
|
+
let G = h(U ? t.id : void 0), K = G.refetch;
|
|
183
|
+
k(() => {
|
|
184
|
+
if (!U || !z) return;
|
|
187
185
|
let e = window.setInterval(() => {
|
|
188
|
-
|
|
189
|
-
},
|
|
186
|
+
K();
|
|
187
|
+
}, oe);
|
|
190
188
|
return () => window.clearInterval(e);
|
|
191
189
|
}, [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
U,
|
|
191
|
+
z,
|
|
192
|
+
K
|
|
195
193
|
]);
|
|
196
|
-
let [
|
|
194
|
+
let [q, J] = j(""), [Y, X] = j(""), Z = x.loading || T.loading || D.loading || A.loading || I.loading || R.loading, Q = x.error ?? T.error ?? D.error ?? A.error ?? I.error ?? R.error, le = Q ? te(Q) : !1, ue = (e) => r.find((t) => t.userId === e)?.displayName ?? ee(e), de = async (e) => {
|
|
197
195
|
e.preventDefault();
|
|
198
|
-
let n =
|
|
196
|
+
let n = q.trim();
|
|
199
197
|
if (n) try {
|
|
200
|
-
await
|
|
198
|
+
await L({
|
|
201
199
|
id: t.id,
|
|
202
200
|
message: n
|
|
203
|
-
}),
|
|
201
|
+
}), J(""), await G.refetch(), o();
|
|
204
202
|
} catch {}
|
|
205
203
|
}, fe = async (e) => {
|
|
206
204
|
e.preventDefault();
|
|
207
|
-
let n =
|
|
205
|
+
let n = Y.trim();
|
|
208
206
|
if (n) try {
|
|
209
|
-
await
|
|
207
|
+
await F({
|
|
210
208
|
id: t.id,
|
|
211
209
|
assigneeId: n
|
|
212
|
-
}),
|
|
210
|
+
}), X(""), o();
|
|
213
211
|
} catch {}
|
|
214
212
|
}, $ = async (e) => {
|
|
215
213
|
try {
|
|
216
214
|
await e(t.id), o();
|
|
217
215
|
} catch (e) {
|
|
218
|
-
|
|
216
|
+
te(e) && o();
|
|
219
217
|
}
|
|
220
218
|
};
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
-
ref:
|
|
219
|
+
return /* @__PURE__ */ P("li", {
|
|
220
|
+
ref: W,
|
|
223
221
|
"data-testid": `handoff-row-${t.id}`,
|
|
224
|
-
"aria-current":
|
|
225
|
-
className: `grid gap-3 rounded-card border bg-bg-surface p-4 ${
|
|
222
|
+
"aria-current": l ? "true" : void 0,
|
|
223
|
+
className: `grid gap-3 rounded-card border bg-bg-surface p-4 ${l ? "border-primary ring-2 ring-primary" : "border-border-seam"}`,
|
|
226
224
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ P("div", {
|
|
228
226
|
className: "flex flex-wrap items-center gap-2",
|
|
229
227
|
children: [
|
|
230
|
-
i ? /* @__PURE__ */
|
|
228
|
+
i ? /* @__PURE__ */ N(c, {
|
|
231
229
|
variant: "default",
|
|
232
|
-
children:
|
|
230
|
+
children: u("botlit.handoffs.new", "New")
|
|
233
231
|
}) : null,
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
t.replyChannel ? /* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ N(ae, { status: t.status }),
|
|
233
|
+
/* @__PURE__ */ N(ie, { handoff: t }),
|
|
234
|
+
/* @__PURE__ */ N(se, { handoff: t }),
|
|
235
|
+
t.replyChannel ? /* @__PURE__ */ N(c, {
|
|
238
236
|
variant: "outline",
|
|
239
237
|
children: t.replyChannel
|
|
240
238
|
}) : null,
|
|
241
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ N("span", {
|
|
242
240
|
className: "text-xs text-text-secondary",
|
|
243
|
-
children:
|
|
241
|
+
children: u("botlit.handoffs.opened", "Opened {{time}}", { time: C(t.createdAt) })
|
|
244
242
|
})
|
|
245
243
|
]
|
|
246
244
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ N("p", {
|
|
248
246
|
className: "text-sm text-text-primary",
|
|
249
247
|
children: t.reason
|
|
250
248
|
}),
|
|
251
|
-
t.userMessage ? /* @__PURE__ */
|
|
249
|
+
t.userMessage ? /* @__PURE__ */ N("blockquote", {
|
|
252
250
|
className: "border-l-2 border-border-seam pl-3 text-sm text-text-secondary italic",
|
|
253
251
|
children: t.userMessage
|
|
254
252
|
}) : null,
|
|
255
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ P("div", {
|
|
256
254
|
className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ N("span", { children: n.get(t.agentId) ? u("botlit.handoffs.agent", "Agent {{name}}", { name: n.get(t.agentId) }) : u("botlit.handoffs.conversation", "Conversation {{key}}", { key: t.conversationKey }) }), t.assignedToId ? /* @__PURE__ */ N("span", { children: u("botlit.handoffs.assignedTo", "· with {{who}}", { who: ue(t.assignedToId) }) }) : null]
|
|
258
256
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ N("div", { children: /* @__PURE__ */ N(s, {
|
|
260
258
|
size: "sm",
|
|
261
259
|
variant: "ghost",
|
|
262
|
-
"aria-expanded":
|
|
263
|
-
onClick: () =>
|
|
264
|
-
linked:
|
|
265
|
-
open: !
|
|
260
|
+
"aria-expanded": U,
|
|
261
|
+
onClick: () => H({
|
|
262
|
+
linked: l,
|
|
263
|
+
open: !U
|
|
266
264
|
}),
|
|
267
|
-
children:
|
|
265
|
+
children: U ? u("botlit.handoffs.thread.hide", "Hide conversation") : u("botlit.handoffs.thread.show", "Show conversation")
|
|
268
266
|
}) }),
|
|
269
|
-
|
|
267
|
+
U ? G.loading && G.data.length === 0 ? /* @__PURE__ */ N("p", {
|
|
270
268
|
role: "status",
|
|
271
269
|
className: "text-sm text-text-secondary",
|
|
272
|
-
children:
|
|
273
|
-
}) :
|
|
270
|
+
children: u("botlit.handoffs.thread.loading", "Loading conversation…")
|
|
271
|
+
}) : G.error ? /* @__PURE__ */ N("p", {
|
|
274
272
|
role: "alert",
|
|
275
273
|
className: "text-sm text-status-danger-text",
|
|
276
|
-
children:
|
|
277
|
-
}) : /* @__PURE__ */
|
|
274
|
+
children: G.error.message
|
|
275
|
+
}) : /* @__PURE__ */ N(ce, {
|
|
278
276
|
handoffId: t.id,
|
|
279
|
-
messages:
|
|
277
|
+
messages: G.data
|
|
280
278
|
}) : null,
|
|
281
|
-
a &&
|
|
279
|
+
a && B && t.replyChannel ? /* @__PURE__ */ P("form", {
|
|
282
280
|
className: "grid gap-2",
|
|
283
281
|
onSubmit: (e) => void de(e),
|
|
284
282
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ N("label", {
|
|
286
284
|
className: "text-sm font-medium text-text-primary",
|
|
287
285
|
htmlFor: `reply-${t.id}`,
|
|
288
|
-
children:
|
|
286
|
+
children: u("botlit.handoffs.reply.label", "Reply to the customer")
|
|
289
287
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ N(d, {
|
|
291
289
|
id: `reply-${t.id}`,
|
|
292
|
-
value:
|
|
290
|
+
value: q,
|
|
293
291
|
maxLength: 4e3,
|
|
294
292
|
rows: 3,
|
|
295
|
-
onChange: (e) =>
|
|
296
|
-
placeholder:
|
|
293
|
+
onChange: (e) => J(e.target.value),
|
|
294
|
+
placeholder: u("botlit.handoffs.reply.placeholder", "Sent in the same thread as the bot — the bot stays quiet until you hand back.")
|
|
297
295
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ N("div", { children: /* @__PURE__ */ N(s, {
|
|
299
297
|
size: "sm",
|
|
300
298
|
type: "submit",
|
|
301
|
-
disabled:
|
|
302
|
-
children:
|
|
299
|
+
disabled: Z || !q.trim(),
|
|
300
|
+
children: u("botlit.handoffs.reply.send", "Send reply")
|
|
303
301
|
}) })
|
|
304
302
|
]
|
|
305
303
|
}) : null,
|
|
306
|
-
|
|
304
|
+
B && !t.replyChannel ? /* @__PURE__ */ N("p", {
|
|
307
305
|
className: "text-sm text-text-secondary",
|
|
308
|
-
children:
|
|
306
|
+
children: u("botlit.handoffs.reply.webChat", "This conversation came from web chat, which has no channel to reply on.")
|
|
309
307
|
}) : null,
|
|
310
|
-
a &&
|
|
308
|
+
a && z ? /* @__PURE__ */ P("form", {
|
|
311
309
|
className: "flex flex-wrap items-center gap-2",
|
|
312
310
|
onSubmit: (e) => void fe(e),
|
|
313
311
|
children: [
|
|
314
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ N("label", {
|
|
315
313
|
className: "sr-only",
|
|
316
314
|
htmlFor: `assign-${t.id}`,
|
|
317
|
-
children:
|
|
315
|
+
children: u("botlit.handoffs.assign.label", "Assign to a teammate")
|
|
318
316
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ P(re, {
|
|
320
318
|
id: `assign-${t.id}`,
|
|
321
319
|
className: "h-9 max-w-xs rounded-md border border-border-default bg-bg-surface px-3 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
322
|
-
value:
|
|
323
|
-
onChange: (e) =>
|
|
324
|
-
children: [/* @__PURE__ */
|
|
320
|
+
value: Y,
|
|
321
|
+
onChange: (e) => X(e.target.value),
|
|
322
|
+
children: [/* @__PURE__ */ N("option", {
|
|
325
323
|
value: "",
|
|
326
|
-
children:
|
|
327
|
-
}), r.filter((e) => e.userId !== t.assignedToId).map((e) => /* @__PURE__ */
|
|
324
|
+
children: u("botlit.handoffs.assign.placeholder", "Choose a teammate")
|
|
325
|
+
}), r.filter((e) => e.userId !== t.assignedToId).map((e) => /* @__PURE__ */ N("option", {
|
|
328
326
|
value: e.userId,
|
|
329
327
|
children: e.email ? `${e.displayName} (${e.email})` : e.displayName
|
|
330
328
|
}, e.userId))]
|
|
331
329
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ N(s, {
|
|
333
331
|
size: "sm",
|
|
334
332
|
variant: "outline",
|
|
335
333
|
type: "submit",
|
|
336
|
-
disabled:
|
|
337
|
-
children:
|
|
334
|
+
disabled: Z || !Y.trim(),
|
|
335
|
+
children: u("botlit.handoffs.assign.submit", "Assign")
|
|
338
336
|
})
|
|
339
337
|
]
|
|
340
338
|
}) : null,
|
|
341
|
-
|
|
339
|
+
Q ? /* @__PURE__ */ N("div", {
|
|
342
340
|
role: "alert",
|
|
343
341
|
className: "flex flex-wrap items-center gap-2 text-sm text-status-danger-text",
|
|
344
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ N("span", { children: le ? u("botlit.handoffs.conflict", "A teammate changed this handoff first (for example, took it over). The inbox has been refreshed.") : Q.message })
|
|
345
343
|
}) : null,
|
|
346
|
-
a ? /* @__PURE__ */
|
|
344
|
+
a ? /* @__PURE__ */ P("div", {
|
|
347
345
|
className: "flex flex-wrap gap-2",
|
|
348
|
-
children: [t.status ===
|
|
346
|
+
children: [t.status === S.Requested || t.status === S.Assigned ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(s, {
|
|
349
347
|
size: "sm",
|
|
350
|
-
disabled:
|
|
351
|
-
onClick: () => void $(
|
|
352
|
-
children:
|
|
353
|
-
}), /* @__PURE__ */
|
|
348
|
+
disabled: Z,
|
|
349
|
+
onClick: () => void $(b),
|
|
350
|
+
children: u("botlit.handoffs.actions.takeOver", "Take over")
|
|
351
|
+
}), /* @__PURE__ */ N(s, {
|
|
354
352
|
size: "sm",
|
|
355
353
|
variant: "outline",
|
|
356
|
-
disabled:
|
|
357
|
-
onClick: () => void $(
|
|
358
|
-
children:
|
|
359
|
-
})] }) : null, t.status ===
|
|
354
|
+
disabled: Z,
|
|
355
|
+
onClick: () => void $(O),
|
|
356
|
+
children: u("botlit.handoffs.actions.reject", "Reject")
|
|
357
|
+
})] }) : null, t.status === S.Accepted ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(s, {
|
|
360
358
|
size: "sm",
|
|
361
359
|
variant: "outline",
|
|
362
|
-
disabled:
|
|
363
|
-
onClick: () => void $(
|
|
364
|
-
children:
|
|
365
|
-
}), /* @__PURE__ */
|
|
360
|
+
disabled: Z,
|
|
361
|
+
onClick: () => void $(w),
|
|
362
|
+
children: u("botlit.handoffs.actions.handBack", "Hand back to bot")
|
|
363
|
+
}), /* @__PURE__ */ N(s, {
|
|
366
364
|
size: "sm",
|
|
367
|
-
disabled:
|
|
368
|
-
onClick: () => void $(
|
|
369
|
-
children:
|
|
365
|
+
disabled: Z,
|
|
366
|
+
onClick: () => void $(E),
|
|
367
|
+
children: u("botlit.handoffs.actions.resolve", "Resolve")
|
|
370
368
|
})] }) : null]
|
|
371
369
|
}) : null
|
|
372
370
|
]
|
|
373
371
|
});
|
|
374
|
-
},
|
|
372
|
+
}, V = ({ linkedId: t, filter: n, items: r }) => {
|
|
375
373
|
let i = e();
|
|
376
|
-
return !t || !r || r.some((e) => e.id === t) ? null : /* @__PURE__ */
|
|
374
|
+
return !t || !r || r.some((e) => e.id === t) ? null : /* @__PURE__ */ N("p", {
|
|
377
375
|
role: "status",
|
|
378
376
|
className: "text-sm text-text-secondary",
|
|
379
377
|
"data-testid": "handoff-link-missing",
|
|
380
378
|
children: n === "all" ? i("botlit.handoffs.linkMissing", "The handoff from your notification could not be found. It may have been removed.") : i("botlit.handoffs.linkMissingFiltered", "The handoff from your notification is not in this list. Switch to All to see every status.")
|
|
381
379
|
});
|
|
382
380
|
};
|
|
383
|
-
function
|
|
384
|
-
let [t, n] =
|
|
381
|
+
function H(e) {
|
|
382
|
+
let [t, n] = j(null), r = e ? "all" : "active";
|
|
385
383
|
return [t && t.linkedId === e ? t.filter : r, (t) => n({
|
|
386
384
|
linkedId: e,
|
|
387
385
|
filter: t
|
|
388
386
|
})];
|
|
389
387
|
}
|
|
390
|
-
var
|
|
391
|
-
let
|
|
392
|
-
return /* @__PURE__ */
|
|
393
|
-
title:
|
|
394
|
-
description:
|
|
395
|
-
children: /* @__PURE__ */
|
|
388
|
+
var U = () => {
|
|
389
|
+
let c = e(), d = O(D.AGENT_UPDATE), [f] = F(), p = f.get("handoff")?.trim() || null, [m, h] = H(p), g = L.find((e) => e.id === m) ?? L[0], _ = w({ statuses: g.statuses ?? void 0 }), v = T(), y = b(), x = A(() => new Map((y.data ?? []).map((e) => [e.id, e.name])), [y.data]);
|
|
390
|
+
return /* @__PURE__ */ N(t, {
|
|
391
|
+
title: c("botlit.handoffs.title", "Human Handoffs"),
|
|
392
|
+
description: c("botlit.handoffs.description", "Conversations the runtime handed to your team. Taking one over stops the bot from replying until you hand it back."),
|
|
393
|
+
children: /* @__PURE__ */ P("div", {
|
|
396
394
|
className: "mx-auto flex w-full max-w-4xl flex-col gap-4 p-4",
|
|
397
395
|
children: [
|
|
398
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ P("div", {
|
|
399
397
|
className: "flex flex-wrap items-center gap-2",
|
|
400
398
|
children: [
|
|
401
|
-
|
|
399
|
+
L.map((e) => /* @__PURE__ */ N(s, {
|
|
402
400
|
size: "sm",
|
|
403
|
-
variant:
|
|
404
|
-
onClick: () =>
|
|
405
|
-
children:
|
|
401
|
+
variant: m === e.id ? "primary" : "outline",
|
|
402
|
+
onClick: () => h(e.id),
|
|
403
|
+
children: c(e.labelKey, e.label)
|
|
406
404
|
}, e.id)),
|
|
407
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ N(s, {
|
|
408
406
|
size: "sm",
|
|
409
407
|
variant: "outline",
|
|
410
|
-
isLoading:
|
|
411
|
-
onClick: () => void
|
|
412
|
-
children:
|
|
408
|
+
isLoading: _.refreshing,
|
|
409
|
+
onClick: () => void _.refresh(),
|
|
410
|
+
children: c("botlit.handoffs.refresh", "Refresh")
|
|
413
411
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ N("span", {
|
|
415
413
|
className: "text-xs text-text-secondary",
|
|
416
|
-
children:
|
|
414
|
+
children: c("botlit.handoffs.autoRefresh", "Updates automatically while this page is open.")
|
|
417
415
|
})
|
|
418
416
|
]
|
|
419
417
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
linkedId:
|
|
422
|
-
filter:
|
|
423
|
-
items:
|
|
418
|
+
/* @__PURE__ */ N(V, {
|
|
419
|
+
linkedId: p,
|
|
420
|
+
filter: m,
|
|
421
|
+
items: _.loading || _.error ? null : _.items
|
|
424
422
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ N("div", {
|
|
426
424
|
"aria-live": "polite",
|
|
427
|
-
children:
|
|
425
|
+
children: _.newIds.size > 0 ? /* @__PURE__ */ P("div", {
|
|
428
426
|
className: "flex flex-wrap items-center gap-2 rounded-card border border-status-info-border bg-status-info-bg-subtle p-3 text-sm text-text-primary",
|
|
429
|
-
children: [/* @__PURE__ */
|
|
427
|
+
children: [/* @__PURE__ */ N("span", { children: c("botlit.handoffs.newArrived", "{{count}} new handoff(s) arrived.", { count: _.newIds.size }) }), /* @__PURE__ */ N(s, {
|
|
430
428
|
size: "sm",
|
|
431
429
|
variant: "ghost",
|
|
432
|
-
onClick:
|
|
433
|
-
children:
|
|
430
|
+
onClick: _.acknowledgeNew,
|
|
431
|
+
children: c("botlit.handoffs.markSeen", "Mark as seen")
|
|
434
432
|
})]
|
|
435
433
|
}) : null
|
|
436
434
|
}),
|
|
437
|
-
|
|
435
|
+
_.loading && _.items.length === 0 ? /* @__PURE__ */ N("p", {
|
|
438
436
|
role: "status",
|
|
439
|
-
children:
|
|
440
|
-
}) :
|
|
441
|
-
resource:
|
|
442
|
-
error:
|
|
443
|
-
onRetry: () => void
|
|
444
|
-
}) :
|
|
437
|
+
children: c("botlit.handoffs.loading", "Loading handoffs…")
|
|
438
|
+
}) : _.error && _.items.length === 0 ? /* @__PURE__ */ N(u, {
|
|
439
|
+
resource: c("botlit.handoffs.errorResource", "handoffs"),
|
|
440
|
+
error: _.error,
|
|
441
|
+
onRetry: () => void _.refresh()
|
|
442
|
+
}) : _.items.length > 0 ? /* @__PURE__ */ P(n, { children: [/* @__PURE__ */ P(a, { children: [/* @__PURE__ */ N(o, { children: c("botlit.handoffs.queue", "Team inbox") }), /* @__PURE__ */ N(i, { children: c("botlit.handoffs.queueDescription", "Newest first — accept a conversation to take it over.") })] }), /* @__PURE__ */ P(r, { children: [_.error ? /* @__PURE__ */ N("p", {
|
|
445
443
|
role: "alert",
|
|
446
444
|
className: "mb-3 text-sm text-status-danger-text",
|
|
447
|
-
children:
|
|
448
|
-
}) : null, /* @__PURE__ */
|
|
445
|
+
children: c("botlit.handoffs.refreshFailed", "Could not refresh the inbox: {{message}}", { message: _.error.message })
|
|
446
|
+
}) : null, /* @__PURE__ */ N("ul", {
|
|
449
447
|
className: "grid gap-3",
|
|
450
|
-
children:
|
|
448
|
+
children: _.items.map((e) => /* @__PURE__ */ N(B, {
|
|
451
449
|
handoff: e,
|
|
452
|
-
agents:
|
|
453
|
-
members:
|
|
454
|
-
isNew:
|
|
455
|
-
canManage:
|
|
456
|
-
onChanged: () => void
|
|
457
|
-
linked: e.id ===
|
|
450
|
+
agents: x,
|
|
451
|
+
members: v.members,
|
|
452
|
+
isNew: _.newIds.has(e.id),
|
|
453
|
+
canManage: d,
|
|
454
|
+
onChanged: () => void _.refresh(),
|
|
455
|
+
linked: e.id === p
|
|
458
456
|
}, e.id))
|
|
459
|
-
})] })] }) : /* @__PURE__ */
|
|
460
|
-
title:
|
|
461
|
-
description:
|
|
457
|
+
})] })] }) : /* @__PURE__ */ N(l, {
|
|
458
|
+
title: c("botlit.handoffs.empty", "No handoffs"),
|
|
459
|
+
description: c("botlit.handoffs.emptyDescription", "Nothing needs a human right now. Triggered handoffs from your agents land here.")
|
|
462
460
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
hasMore:
|
|
465
|
-
loadingMore:
|
|
466
|
-
onLoadMore: () => void
|
|
467
|
-
loadedCount:
|
|
461
|
+
/* @__PURE__ */ N(E, {
|
|
462
|
+
hasMore: _.hasMore,
|
|
463
|
+
loadingMore: _.loadingMore,
|
|
464
|
+
onLoadMore: () => void _.loadMore(),
|
|
465
|
+
loadedCount: _.items.length
|
|
468
466
|
})
|
|
469
467
|
]
|
|
470
468
|
})
|
|
471
469
|
});
|
|
472
470
|
};
|
|
473
|
-
export {
|
|
471
|
+
export { I as HANDOFF_QUERY_PARAM, U as HandoffsPage };
|
|
474
472
|
|
|
475
473
|
//# sourceMappingURL=HandoffsPage.js.map
|