@burdenoff/microfe-botmanor 2026.1120.6 → 2026.1120.8

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.
Files changed (69) hide show
  1. package/dist/botlit/components/AssistantChannelPanel.js +3 -3
  2. package/dist/botlit/components/AssistantChannelPanel.js.map +1 -1
  3. package/dist/botlit/components/ChannelRoutesPanel.d.ts +9 -0
  4. package/dist/botlit/components/ChannelRoutesPanel.js +275 -0
  5. package/dist/botlit/components/ChannelRoutesPanel.js.map +1 -0
  6. package/dist/botlit/components/CreateChannelRouteDialog.d.ts +13 -0
  7. package/dist/botlit/components/CreateChannelRouteDialog.js +188 -0
  8. package/dist/botlit/components/CreateChannelRouteDialog.js.map +1 -0
  9. package/dist/botlit/components/DashboardUsagePanel.d.ts +8 -0
  10. package/dist/botlit/components/DashboardUsagePanel.js +277 -0
  11. package/dist/botlit/components/DashboardUsagePanel.js.map +1 -0
  12. package/dist/botlit/components/LiveIndicator.d.ts +9 -0
  13. package/dist/botlit/components/LiveIndicator.js +21 -0
  14. package/dist/botlit/components/LiveIndicator.js.map +1 -0
  15. package/dist/botlit/components/RunStatsCard.d.ts +9 -0
  16. package/dist/botlit/components/RunStatsCard.js +138 -0
  17. package/dist/botlit/components/RunStatsCard.js.map +1 -0
  18. package/dist/botlit/hooks/index.d.ts +3 -3
  19. package/dist/botlit/hooks/index.js +19 -19
  20. package/dist/botlit/hooks/useBots.d.ts +5 -0
  21. package/dist/botlit/hooks/useBots.js +63 -50
  22. package/dist/botlit/hooks/useBots.js.map +1 -1
  23. package/dist/botlit/hooks/useChannels.d.ts +49 -23
  24. package/dist/botlit/hooks/useChannels.js +141 -135
  25. package/dist/botlit/hooks/useChannels.js.map +1 -1
  26. package/dist/botlit/hooks/useExecutionLiveUpdates.d.ts +29 -0
  27. package/dist/botlit/hooks/useExecutionLiveUpdates.js +124 -0
  28. package/dist/botlit/hooks/useExecutionLiveUpdates.js.map +1 -0
  29. package/dist/botlit/hooks/useUsageStats.d.ts +71 -0
  30. package/dist/botlit/hooks/useUsageStats.js +115 -0
  31. package/dist/botlit/hooks/useUsageStats.js.map +1 -0
  32. package/dist/botlit/pages/AgentDetailPage.js +48 -43
  33. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  34. package/dist/botlit/pages/BotChannelsTab.js +12 -3
  35. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  36. package/dist/botlit/pages/BotDetailPage.js +317 -309
  37. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  38. package/dist/botlit/pages/ChannelDetailPage.js +642 -776
  39. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  40. package/dist/botlit/pages/ChannelRoutesPage.js +22 -208
  41. package/dist/botlit/pages/ChannelRoutesPage.js.map +1 -1
  42. package/dist/botlit/pages/ChannelsPage.js +314 -251
  43. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  44. package/dist/botlit/pages/DashboardPage.js +155 -153
  45. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  46. package/dist/botlit/pages/ExecutionDetailPage.js +142 -132
  47. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  48. package/dist/botlit/pages/ExecutionsPage.js +150 -141
  49. package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
  50. package/dist/botlit/pages/PromptStudioPage.js +172 -172
  51. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  52. package/dist/botlit/permissions/botmanorPermissions.d.ts +1 -0
  53. package/dist/botlit/permissions/botmanorPermissions.js +1 -0
  54. package/dist/botlit/permissions/botmanorPermissions.js.map +1 -1
  55. package/dist/botlit/utils/channelConnectors.d.ts +13 -0
  56. package/dist/botlit/utils/channelConnectors.js +21 -1
  57. package/dist/botlit/utils/channelConnectors.js.map +1 -1
  58. package/dist/botlit/utils/errors.d.ts +8 -0
  59. package/dist/botlit/utils/errors.js +21 -1
  60. package/dist/botlit/utils/errors.js.map +1 -1
  61. package/dist/botlit/utils/formatters.js +6 -2
  62. package/dist/botlit/utils/formatters.js.map +1 -1
  63. package/dist/generated/wspace-operations.d.ts +321 -12
  64. package/dist/generated/wspace-operations.js +188 -91
  65. package/dist/generated/wspace-operations.js.map +1 -1
  66. package/dist/generated/wspace-types.d.ts +130 -0
  67. package/dist/generated/wspace-types.js +8 -4
  68. package/dist/generated/wspace-types.js.map +1 -1
  69. package/package.json +1 -1
@@ -3,313 +3,376 @@ import { useTr as t } from "../../shared/hooks/useTr.js";
3
3
  import { PageLayout as n } from "../components/PageLayout.js";
4
4
  import { BOTMANOR_PERMISSIONS as r } from "../permissions/botmanorPermissions.js";
5
5
  import { BotmanorPermissionGate as i } from "../permissions/useBotmanorPermissions.js";
6
- import { Card as a, CardContent as o, CardDescription as s, CardHeader as c, CardTitle as l } from "../components/Card.js";
7
- import { Button as u } from "../components/Button.js";
8
- import { Input as d } from "../components/Input.js";
9
- import { Badge as f, StatusBadge as p } from "../components/Badge.js";
10
- import { EmptyState as m } from "../components/EmptyState.js";
11
- import { ErrorState as h } from "../components/ErrorState.js";
6
+ import { Card as ee, CardContent as te, CardDescription as a, CardHeader as o, CardTitle as s } from "../components/Card.js";
7
+ import { Button as c } from "../components/Button.js";
8
+ import { Input as l } from "../components/Input.js";
9
+ import { Badge as u, StatusBadge as ne } from "../components/Badge.js";
10
+ import { EmptyState as d } from "../components/EmptyState.js";
11
+ import { ErrorState as re } from "../components/ErrorState.js";
12
+ import { LoadMore as ie } from "../components/LoadMore.js";
13
+ import { ChannelRoutesPanel as ae } from "../components/ChannelRoutesPanel.js";
12
14
  import "../hooks/index.js";
13
- import { formatRelativeTime as g } from "../utils/formatters.js";
14
- import { routeMetadataString as _, useChannelConnectors as v, useChannelRoutes as y } from "../hooks/useChannels.js";
15
+ import { useAllChannelRoutes as oe, useChannelConnectors as se, useChannelOverview as f } from "../hooks/useChannels.js";
16
+ import { formatRelativeTime as p } from "../utils/formatters.js";
17
+ import { channelTypeLabel as m } from "../utils/channelConnectors.js";
15
18
  import "../permissions/index.js";
16
- import { useMemo as b, useState as x } from "react";
17
- import { GlassCard as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
18
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
19
- import { Link as D } from "react-router";
20
- import { ArrowRight as O, Filter as k, Globe as A, Hash as j, MessageSquare as M, Plus as N, Search as P, Settings as F, Slack as I, Webhook as L } from "lucide-react";
19
+ import { useMemo as h, useRef as g, useState as _ } from "react";
20
+ import { GlassCard as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
21
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
22
+ import { Link as S, useSearchParams as ce } from "react-router";
23
+ import { Filter as le, Globe as C, Hash as w, MessageSquare as T, Plus as ue, Search as de, Slack as E, Webhook as D } from "lucide-react";
21
24
  // src/botlit/pages/ChannelsPage.tsx
22
- var R = ({ type: e, className: t }) => {
25
+ var O = ({ type: e, className: t }) => {
23
26
  switch (e) {
24
- case "SLACK": return /* @__PURE__ */ T(I, { className: t });
25
- case "DISCORD": return /* @__PURE__ */ T(j, { className: t });
26
- case "TEAMS": return /* @__PURE__ */ T(M, { className: t });
27
- case "WEB_WIDGET": return /* @__PURE__ */ T(A, { className: t });
28
- case "WEBHOOK": return /* @__PURE__ */ T(L, { className: t });
29
- default: return /* @__PURE__ */ T(M, { className: t });
27
+ case "SLACK": return /* @__PURE__ */ b(E, { className: t });
28
+ case "DISCORD": return /* @__PURE__ */ b(w, { className: t });
29
+ case "TEAMS": return /* @__PURE__ */ b(T, { className: t });
30
+ case "WEB_WIDGET": return /* @__PURE__ */ b(C, { className: t });
31
+ case "WEBHOOK": return /* @__PURE__ */ b(D, { className: t });
32
+ default: return /* @__PURE__ */ b(T, { className: t });
30
33
  }
31
- }, z = () => {
32
- let A = t(), { getPath: j } = e(), [I, L] = x(""), [z, B] = x("connectors"), V = b(() => ({ search: I }), [I]), { data: H, loading: U, error: W, refetch: G } = v(V), { data: K, loading: q, error: J, refetch: Y } = y(), X = b(() => {
34
+ }, k = ["connectors", "routes"], A = [
35
+ "WEB_WIDGET",
36
+ "SLACK",
37
+ "TEAMS",
38
+ "DISCORD",
39
+ "WHATSAPP",
40
+ "WEBHOOK",
41
+ "CUSTOM"
42
+ ], j = [
43
+ "ACTIVE",
44
+ "DRAFT",
45
+ "DEPRECATED",
46
+ "ARCHIVED"
47
+ ], M = "h-10 rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", N = () => {
48
+ let C = t(), { getPath: w, navigateTo: E } = e(), [D, N] = ce(), P = D.get("tab") === "routes" ? "routes" : "connectors", F = g({
49
+ connectors: null,
50
+ routes: null
51
+ }), [I, L] = _(""), [R, z] = _(!1), [B, V] = _(""), [H, U] = _(""), fe = h(() => ({
52
+ search: I,
53
+ type: B ? [B] : void 0,
54
+ status: H ? [H] : void 0
55
+ }), [
56
+ I,
57
+ B,
58
+ H
59
+ ]), { data: W, loading: G, error: K, refetch: pe, hasMore: me, loadingMore: he, loadMore: ge } = se(fe), { data: q, error: _e, refetch: J } = f(), { data: Y, loading: ve, error: X, refetch: ye } = oe(), Z = !ve && !X, be = h(() => {
33
60
  let e = /* @__PURE__ */ new Map();
34
- for (let t of K) e.set(t.connectorId, (e.get(t.connectorId) ?? 0) + 1);
61
+ for (let t of Y) t.isActive && e.set(t.connectorId, (e.get(t.connectorId) ?? 0) + 1);
35
62
  return e;
36
- }, [K]);
37
- return /* @__PURE__ */ T(n, {
38
- title: A("botlit.channels.title", "Channels"),
39
- description: A("botlit.channels.description", "Connect agents to messaging platforms and configure routing"),
40
- actions: /* @__PURE__ */ E("div", {
63
+ }, [Y]), xe = !!(I.trim() || B || H), Se = q?.connectorCount === 0, Q = (e) => {
64
+ let t = new URLSearchParams(D);
65
+ e === "connectors" ? t.delete("tab") : t.set("tab", e), N(t, { replace: !0 });
66
+ }, Ce = (e, t) => {
67
+ let n = null;
68
+ if (e.key === "ArrowRight" ? n = (t + 1) % k.length : e.key === "ArrowLeft" ? n = (t - 1 + k.length) % k.length : e.key === "Home" ? n = 0 : e.key === "End" && (n = k.length - 1), n === null) return;
69
+ e.preventDefault();
70
+ let r = k[n];
71
+ Q(r), F.current[r]?.focus();
72
+ }, we = (e) => e === "connectors" ? q ? C("botlit.channels.tabs.connectorsCount", "Connectors ({{count}})", { count: q.connectorCount }) : C("botlit.channels.tabs.connectors", "Connectors") : q ? C("botlit.channels.tabs.routesCount", "Routes ({{active}} on of {{count}})", {
73
+ active: q.activeRouteCount,
74
+ count: q.routeCount
75
+ }) : C("botlit.channels.tabs.routes", "Routes"), $ = /* @__PURE__ */ b(i, {
76
+ permission: r.CHANNEL_CREATE,
77
+ children: /* @__PURE__ */ b(c, {
78
+ leftIcon: /* @__PURE__ */ b(ue, { size: 16 }),
79
+ onClick: () => E("channels/new"),
80
+ children: C("botlit.channels.actions.addChannel", "Add Channel")
81
+ })
82
+ });
83
+ return /* @__PURE__ */ b(n, {
84
+ title: C("botlit.channels.title", "Channels"),
85
+ description: C("botlit.channels.description", "Connect agents to messaging platforms and configure routing"),
86
+ actions: /* @__PURE__ */ x("div", {
41
87
  className: "flex gap-2",
42
- children: [/* @__PURE__ */ T(u, {
88
+ children: [/* @__PURE__ */ b(c, {
43
89
  variant: "outline",
44
- children: /* @__PURE__ */ T(D, {
45
- to: j("channels/routes"),
46
- children: A("botlit.channels.actions.viewRoutes", "View Routes")
47
- })
48
- }), /* @__PURE__ */ T(i, {
49
- permission: r.CHANNEL_CREATE,
50
- children: /* @__PURE__ */ T(u, {
51
- leftIcon: /* @__PURE__ */ T(N, { size: 16 }),
52
- children: /* @__PURE__ */ T(D, {
53
- to: j("channels/new"),
54
- children: A("botlit.channels.actions.addChannel", "Add Channel")
55
- })
56
- })
57
- })]
90
+ onClick: () => E("channels/routes"),
91
+ children: C("botlit.channels.actions.viewRoutes", "View Routes")
92
+ }), !(P === "connectors" && Se) && $]
58
93
  }),
59
- children: /* @__PURE__ */ E("div", {
94
+ children: /* @__PURE__ */ x("div", {
60
95
  className: "space-y-6",
61
96
  children: [
62
- /* @__PURE__ */ T(C, {
63
- icon: /* @__PURE__ */ T(M, { size: 18 }),
64
- children: A("botlit.channels.purpose", "Channels are where your bots actually talk to people. Connect a messaging platform — a website chat widget, Slack, Microsoft Teams, Discord, WhatsApp or a custom webhook — then add a route that points an incoming location at the bot that should answer. Use this page to manage those connectors and routing rules in one place.")
97
+ /* @__PURE__ */ b(y, {
98
+ icon: /* @__PURE__ */ b(T, { size: 18 }),
99
+ children: C("botlit.channels.purpose", "Channels are where your bots actually talk to people. Connect a messaging platform — a website chat widget, Slack, Microsoft Teams, Discord, WhatsApp or a custom webhook — then add a route that points an incoming location at the bot that should answer. Use this page to manage those connectors and routing rules in one place.")
65
100
  }),
66
- /* @__PURE__ */ E("div", {
67
- className: "flex gap-1 border-b border-border-subtle",
68
- children: [/* @__PURE__ */ E("button", {
69
- onClick: () => B("connectors"),
70
- className: `px-4 py-2 text-sm font-medium border-b-2 transition-colors ${z === "connectors" ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"}`,
71
- children: [
72
- A("botlit.channels.tabs.connectors", "Connectors"),
73
- " (",
74
- H.length,
75
- ")"
76
- ]
77
- }), /* @__PURE__ */ E("button", {
78
- onClick: () => B("routes"),
79
- className: `px-4 py-2 text-sm font-medium border-b-2 transition-colors ${z === "routes" ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"}`,
80
- children: [
81
- A("botlit.channels.tabs.routes", "Routes"),
82
- " (",
83
- K.length,
84
- ")"
85
- ]
86
- })]
87
- }),
88
- /* @__PURE__ */ E("div", {
89
- className: "flex items-center gap-4",
90
- children: [/* @__PURE__ */ E("div", {
91
- className: "relative flex-1 max-w-md",
92
- children: [/* @__PURE__ */ T(P, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ T(d, {
93
- placeholder: A("botlit.channels.searchPlaceholder", "Search {{tab}}...", { tab: z }),
94
- value: I,
95
- onChange: (e) => L(e.target.value),
96
- className: "pl-9"
97
- })]
98
- }), /* @__PURE__ */ T(u, {
101
+ _e && /* @__PURE__ */ x("div", {
102
+ role: "alert",
103
+ className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3 text-sm",
104
+ children: [/* @__PURE__ */ b("span", {
105
+ className: "text-text-primary",
106
+ children: C("botlit.channels.errors.overview", "Channel totals could not be loaded.")
107
+ }), /* @__PURE__ */ b(c, {
99
108
  variant: "outline",
100
- leftIcon: /* @__PURE__ */ T(k, { size: 16 }),
101
- children: A("botlit.channels.filters.filters", "Filters")
109
+ size: "sm",
110
+ onClick: () => void J(),
111
+ children: C("botlit.common.retry", "Retry")
102
112
  })]
103
113
  }),
104
- z === "connectors" && /* @__PURE__ */ T(w, { children: U ? /* @__PURE__ */ T("div", {
105
- className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
106
- children: [
107
- 1,
108
- 2,
109
- 3
110
- ].map((e) => /* @__PURE__ */ T("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
111
- }) : W ? /* @__PURE__ */ T(h, {
112
- resource: "channel connectors",
113
- error: W,
114
- onRetry: () => void G()
115
- }) : H.length > 0 ? /* @__PURE__ */ T("div", {
116
- className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
117
- children: H.map((e) => /* @__PURE__ */ T(D, {
118
- to: j(`channels/${e.id}`),
119
- children: /* @__PURE__ */ E(a, {
120
- className: "h-full hover:border-primary/50 transition-colors cursor-pointer",
121
- children: [/* @__PURE__ */ T(c, { children: /* @__PURE__ */ E("div", {
122
- className: "flex items-start justify-between",
123
- children: [/* @__PURE__ */ E("div", {
124
- className: "flex items-center gap-3",
125
- children: [/* @__PURE__ */ T("div", {
126
- className: "p-2 bg-action-primary-bg/10 rounded-lg",
127
- children: /* @__PURE__ */ T(R, {
128
- type: e.type,
129
- className: "h-5 w-5 text-primary"
130
- })
131
- }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(l, {
132
- className: "text-base",
133
- children: e.name
134
- }), /* @__PURE__ */ T(s, {
135
- className: "text-xs",
136
- children: e.description
137
- })] })]
138
- }), /* @__PURE__ */ T(p, { status: e.status })]
139
- }) }), /* @__PURE__ */ T(o, { children: /* @__PURE__ */ E("div", {
140
- className: "space-y-3",
141
- children: [
142
- /* @__PURE__ */ E("div", {
143
- className: "flex items-center justify-between",
144
- children: [/* @__PURE__ */ T("span", {
145
- className: "text-sm text-text-secondary",
146
- children: A("botlit.channels.list.type", "Type")
147
- }), /* @__PURE__ */ T(f, {
148
- variant: "outline",
149
- className: "capitalize",
150
- children: e.type.toLowerCase().replace("_", " ")
151
- })]
152
- }),
153
- /* @__PURE__ */ E("div", {
154
- className: "flex items-center justify-between",
155
- children: [/* @__PURE__ */ T("span", {
156
- className: "text-sm text-text-secondary",
157
- children: A("botlit.channels.list.activeRoutes", "Active Routes")
158
- }), /* @__PURE__ */ T(f, {
159
- variant: "secondary",
160
- children: X.get(e.id) ?? 0
161
- })]
162
- }),
163
- /* @__PURE__ */ E("div", {
164
- className: "pt-3 border-t border-border-subtle text-xs text-text-secondary",
165
- children: [
166
- A("botlit.botsList.createdLabel", "Created"),
167
- " ",
168
- g(e.createdAt)
169
- ]
170
- })
171
- ]
172
- }) })]
173
- })
174
- }, e.id))
175
- }) : /* @__PURE__ */ T(m, {
176
- illustration: "empty-notifications",
177
- title: A("botlit.channels.empty.connectors.title", "No channel connectors"),
178
- description: A("botlit.channels.empty.connectors.description", "Connect messaging platforms to deploy agents across multiple channels."),
179
- action: /* @__PURE__ */ T(i, {
180
- permission: r.CHANNEL_CREATE,
181
- children: /* @__PURE__ */ T(u, {
182
- leftIcon: /* @__PURE__ */ T(N, { size: 16 }),
183
- children: /* @__PURE__ */ T(D, {
184
- to: j("channels/new"),
185
- children: A("botlit.channels.actions.addChannel", "Add Channel")
186
- })
187
- })
114
+ /* @__PURE__ */ b("div", {
115
+ role: "tablist",
116
+ "aria-label": C("botlit.channels.tabs.label", "Channels sections"),
117
+ className: "flex gap-1 border-b border-border-subtle",
118
+ children: k.map((e, t) => {
119
+ let n = P === e;
120
+ return /* @__PURE__ */ b("button", {
121
+ ref: (t) => {
122
+ F.current[e] = t;
123
+ },
124
+ type: "button",
125
+ role: "tab",
126
+ id: `channels-tab-${e}`,
127
+ "aria-selected": n,
128
+ "aria-controls": `channels-panel-${e}`,
129
+ tabIndex: n ? 0 : -1,
130
+ onClick: () => Q(e),
131
+ onKeyDown: (e) => Ce(e, t),
132
+ className: `px-4 py-2 text-sm font-medium border-b-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${n ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"}`,
133
+ children: we(e)
134
+ }, e);
188
135
  })
189
- }) }),
190
- z === "routes" && /* @__PURE__ */ T(w, { children: q ? /* @__PURE__ */ T("div", {
191
- className: "space-y-4",
136
+ }),
137
+ P === "connectors" && /* @__PURE__ */ x("div", {
138
+ role: "tabpanel",
139
+ id: "channels-panel-connectors",
140
+ "aria-labelledby": "channels-tab-connectors",
141
+ className: "space-y-6",
192
142
  children: [
193
- 1,
194
- 2,
195
- 3
196
- ].map((e) => /* @__PURE__ */ T("div", { className: "h-20 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
197
- }) : J ? /* @__PURE__ */ T(h, {
198
- resource: "channel routes",
199
- error: J,
200
- onRetry: () => void Y()
201
- }) : K.length > 0 ? /* @__PURE__ */ T("div", {
202
- className: "space-y-4",
203
- children: K.map((e) => /* @__PURE__ */ T(a, { children: /* @__PURE__ */ T(o, {
204
- className: "py-4",
205
- children: /* @__PURE__ */ E("div", {
206
- className: "flex items-center justify-between",
207
- children: [/* @__PURE__ */ T("div", {
208
- className: "flex items-center gap-4",
209
- children: /* @__PURE__ */ E("div", {
210
- className: "flex items-center gap-2 text-sm",
211
- children: [
212
- /* @__PURE__ */ T(f, {
213
- variant: "outline",
214
- children: _(e, "locationName") ?? e.locationId
215
- }),
216
- /* @__PURE__ */ T(O, {
217
- size: 16,
218
- className: "text-text-secondary"
219
- }),
220
- /* @__PURE__ */ T(f, {
221
- variant: "secondary",
222
- children: _(e, "appName") ?? e.appId ?? "—"
223
- })
224
- ]
225
- })
226
- }), /* @__PURE__ */ E("div", {
227
- className: "flex items-center gap-2",
228
- children: [/* @__PURE__ */ T("span", {
229
- className: "text-xs text-text-secondary",
230
- children: g(e.createdAt)
231
- }), /* @__PURE__ */ T(i, {
232
- permission: r.CHANNEL_UPDATE,
233
- children: /* @__PURE__ */ T(u, {
234
- variant: "ghost",
235
- size: "icon",
236
- children: /* @__PURE__ */ T(F, { size: 16 })
237
- })
143
+ /* @__PURE__ */ x("div", {
144
+ className: "flex flex-wrap items-center gap-4",
145
+ children: [/* @__PURE__ */ x("div", {
146
+ className: "relative flex-1 max-w-md",
147
+ children: [/* @__PURE__ */ b(de, {
148
+ "aria-hidden": "true",
149
+ className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary"
150
+ }), /* @__PURE__ */ b(l, {
151
+ "aria-label": C("botlit.channels.searchConnectors", "Search connectors"),
152
+ placeholder: C("botlit.channels.searchConnectorsPlaceholder", "Search connectors..."),
153
+ value: I,
154
+ onChange: (e) => L(e.target.value),
155
+ className: "pl-9"
238
156
  })]
157
+ }), /* @__PURE__ */ b(c, {
158
+ variant: "outline",
159
+ leftIcon: /* @__PURE__ */ b(le, { size: 16 }),
160
+ "aria-expanded": R,
161
+ "aria-controls": "channels-connector-filters",
162
+ onClick: () => z((e) => !e),
163
+ children: C("botlit.channels.filters.filters", "Filters")
239
164
  })]
165
+ }),
166
+ R && /* @__PURE__ */ x("div", {
167
+ id: "channels-connector-filters",
168
+ className: "flex flex-wrap items-end gap-4",
169
+ children: [
170
+ /* @__PURE__ */ x("label", {
171
+ className: "grid gap-1 text-xs text-text-secondary",
172
+ children: [C("botlit.channels.filters.type", "Type"), /* @__PURE__ */ x("select", {
173
+ className: M,
174
+ value: B,
175
+ onChange: (e) => V(e.target.value),
176
+ children: [/* @__PURE__ */ b("option", {
177
+ value: "",
178
+ children: C("botlit.channels.filters.allTypes", "All types")
179
+ }), A.map((e) => /* @__PURE__ */ b("option", {
180
+ value: e,
181
+ children: m(e, C)
182
+ }, e))]
183
+ })]
184
+ }),
185
+ /* @__PURE__ */ x("label", {
186
+ className: "grid gap-1 text-xs text-text-secondary",
187
+ children: [C("botlit.channels.filters.status", "Status"), /* @__PURE__ */ x("select", {
188
+ className: M,
189
+ value: H,
190
+ onChange: (e) => U(e.target.value),
191
+ children: [/* @__PURE__ */ b("option", {
192
+ value: "",
193
+ children: C("botlit.channels.filters.allStatuses", "All statuses")
194
+ }), j.map((e) => /* @__PURE__ */ b("option", {
195
+ value: e,
196
+ children: C(`botlit.status.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase())
197
+ }, e))]
198
+ })]
199
+ }),
200
+ (B || H) && /* @__PURE__ */ b(c, {
201
+ variant: "ghost",
202
+ size: "sm",
203
+ onClick: () => {
204
+ V(""), U("");
205
+ },
206
+ children: C("botlit.channels.filters.clear", "Clear filters")
207
+ })
208
+ ]
209
+ }),
210
+ G ? /* @__PURE__ */ b("div", {
211
+ className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
212
+ children: [
213
+ 1,
214
+ 2,
215
+ 3
216
+ ].map((e) => /* @__PURE__ */ b("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
217
+ }) : K ? /* @__PURE__ */ b(re, {
218
+ resource: C("botlit.channels.resource", "channel connectors"),
219
+ error: K,
220
+ onRetry: () => void pe()
221
+ }) : W.length > 0 ? /* @__PURE__ */ b("div", {
222
+ className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
223
+ children: W.map((e) => /* @__PURE__ */ b(S, {
224
+ to: w(`channels/${e.id}`),
225
+ className: "rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",
226
+ children: /* @__PURE__ */ x(ee, {
227
+ className: "h-full hover:border-primary/50 transition-colors cursor-pointer",
228
+ children: [/* @__PURE__ */ b(o, { children: /* @__PURE__ */ x("div", {
229
+ className: "flex items-start justify-between",
230
+ children: [/* @__PURE__ */ x("div", {
231
+ className: "flex items-center gap-3",
232
+ children: [/* @__PURE__ */ b("div", {
233
+ className: "p-2 bg-action-primary-bg/10 rounded-lg",
234
+ children: /* @__PURE__ */ b(O, {
235
+ type: e.type,
236
+ className: "h-5 w-5 text-primary"
237
+ })
238
+ }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(s, {
239
+ className: "text-base",
240
+ children: e.name
241
+ }), /* @__PURE__ */ b(a, {
242
+ className: "text-xs",
243
+ children: e.description
244
+ })] })]
245
+ }), /* @__PURE__ */ b(ne, { status: e.status })]
246
+ }) }), /* @__PURE__ */ b(te, { children: /* @__PURE__ */ x("div", {
247
+ className: "space-y-3",
248
+ children: [
249
+ /* @__PURE__ */ x("div", {
250
+ className: "flex items-center justify-between",
251
+ children: [/* @__PURE__ */ b("span", {
252
+ className: "text-sm text-text-secondary",
253
+ children: C("botlit.channels.list.type", "Type")
254
+ }), /* @__PURE__ */ b(u, {
255
+ variant: "outline",
256
+ children: m(e.type, C)
257
+ })]
258
+ }),
259
+ /* @__PURE__ */ x("div", {
260
+ className: "flex items-center justify-between",
261
+ children: [/* @__PURE__ */ b("span", {
262
+ className: "text-sm text-text-secondary",
263
+ children: C("botlit.channels.list.activeRoutes", "Active Routes")
264
+ }), /* @__PURE__ */ b(u, {
265
+ variant: "secondary",
266
+ title: Z ? void 0 : X ? C("botlit.channels.list.routeCountUnavailable", "Routes could not be loaded") : C("botlit.common.loading", "Loading..."),
267
+ children: Z ? be.get(e.id) ?? 0 : "—"
268
+ })]
269
+ }),
270
+ e.unroutedMessageCount > 0 && /* @__PURE__ */ x("div", {
271
+ className: "flex items-center justify-between",
272
+ children: [/* @__PURE__ */ b("span", {
273
+ className: "text-sm text-text-secondary",
274
+ children: C("botlit.channels.list.unrouted", "Unanswered messages")
275
+ }), /* @__PURE__ */ b(u, {
276
+ variant: "warning",
277
+ children: e.unroutedMessageCount
278
+ })]
279
+ }),
280
+ /* @__PURE__ */ b("div", {
281
+ className: "pt-3 border-t border-border-subtle text-xs text-text-secondary",
282
+ children: C("botlit.channels.list.created", "Created {{when}}", { when: p(e.createdAt) })
283
+ })
284
+ ]
285
+ }) })]
286
+ })
287
+ }, e.id))
288
+ }) : xe ? /* @__PURE__ */ b(d, {
289
+ illustration: "empty-search",
290
+ title: C("botlit.channels.empty.filtered.title", "No connectors match"),
291
+ description: C("botlit.channels.empty.filtered.description", "No connector matches the search and filters. Change or clear them.")
292
+ }) : /* @__PURE__ */ b(d, {
293
+ illustration: "empty-notifications",
294
+ title: C("botlit.channels.empty.connectors.title", "No channel connectors"),
295
+ description: C("botlit.channels.empty.connectors.description", "Connect messaging platforms to deploy agents across multiple channels."),
296
+ action: $
297
+ }),
298
+ /* @__PURE__ */ b(ie, {
299
+ hasMore: me && !G,
300
+ loadingMore: he,
301
+ onLoadMore: () => void ge(),
302
+ loadedCount: W.length
240
303
  })
241
- }) }, e.id))
242
- }) : /* @__PURE__ */ T(m, {
243
- illustration: "empty-search",
244
- title: A("botlit.channels.empty.routes.title", "No routes configured"),
245
- description: A("botlit.channels.empty.routes.description", "Create routes to connect channel locations to specific bots."),
246
- action: /* @__PURE__ */ T(i, {
247
- permission: r.CHANNEL_CREATE,
248
- children: /* @__PURE__ */ T(u, {
249
- leftIcon: /* @__PURE__ */ T(N, { size: 16 }),
250
- children: A("botlit.channels.actions.createRoute", "Create Route")
251
- })
304
+ ]
305
+ }),
306
+ P === "routes" && /* @__PURE__ */ b("div", {
307
+ role: "tabpanel",
308
+ id: "channels-panel-routes",
309
+ "aria-labelledby": "channels-tab-routes",
310
+ children: /* @__PURE__ */ b(ae, {
311
+ showSummary: !1,
312
+ onRoutesChanged: () => {
313
+ J(), ye();
314
+ }
252
315
  })
253
- }) }),
254
- /* @__PURE__ */ E(S, {
316
+ }),
317
+ /* @__PURE__ */ x(v, {
255
318
  treatment: "glass",
256
319
  glow: !0,
257
320
  className: "p-6",
258
- children: [/* @__PURE__ */ E("div", {
321
+ children: [/* @__PURE__ */ x("div", {
259
322
  className: "mb-4",
260
- children: [/* @__PURE__ */ T("h2", {
323
+ children: [/* @__PURE__ */ b("h2", {
261
324
  className: "text-lg font-semibold tracking-tight text-text-primary",
262
- children: A("botlit.channels.integrations.title", "Available Integrations")
263
- }), /* @__PURE__ */ T("p", {
325
+ children: C("botlit.channels.integrations.title", "Available Integrations")
326
+ }), /* @__PURE__ */ b("p", {
264
327
  className: "text-sm text-text-secondary",
265
- children: A("botlit.channels.integrations.description", "Connect to popular messaging platforms")
328
+ children: C("botlit.channels.integrations.description", "Connect to popular messaging platforms")
266
329
  })]
267
- }), /* @__PURE__ */ T("div", {
330
+ }), /* @__PURE__ */ b("div", {
268
331
  className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",
269
332
  children: [
270
333
  {
271
334
  type: "WEB_WIDGET",
272
- name: A("botlit.channels.integrations.webWidget", "Web Widget"),
273
- desc: A("botlit.channels.integrations.webWidgetDesc", "Embed on websites")
335
+ name: C("botlit.channels.integrations.webWidget", "Web Widget"),
336
+ desc: C("botlit.channels.integrations.webWidgetDesc", "Embed on websites")
274
337
  },
275
338
  {
276
339
  type: "SLACK",
277
- name: A("botlit.channels.integrations.slack", "Slack"),
278
- desc: A("botlit.channels.integrations.slackDesc", "Workspace integration")
340
+ name: C("botlit.channels.integrations.slack", "Slack"),
341
+ desc: C("botlit.channels.integrations.slackDesc", "Workspace integration")
279
342
  },
280
343
  {
281
344
  type: "TEAMS",
282
- name: A("botlit.channels.integrations.teams", "MS Teams"),
283
- desc: A("botlit.channels.integrations.teamsDesc", "Teams app")
345
+ name: C("botlit.channels.integrations.teams", "MS Teams"),
346
+ desc: C("botlit.channels.integrations.teamsDesc", "Teams app")
284
347
  },
285
348
  {
286
349
  type: "DISCORD",
287
- name: A("botlit.channels.integrations.discord", "Discord"),
288
- desc: A("botlit.channels.integrations.discordDesc", "Bot integration")
350
+ name: C("botlit.channels.integrations.discord", "Discord"),
351
+ desc: C("botlit.channels.integrations.discordDesc", "Bot integration")
289
352
  },
290
353
  {
291
354
  type: "WHATSAPP",
292
- name: A("botlit.channels.integrations.whatsapp", "WhatsApp"),
293
- desc: A("botlit.channels.integrations.whatsappDesc", "Business API")
355
+ name: C("botlit.channels.integrations.whatsapp", "WhatsApp"),
356
+ desc: C("botlit.channels.integrations.whatsappDesc", "Business API")
294
357
  },
295
358
  {
296
359
  type: "WEBHOOK",
297
- name: A("botlit.channels.integrations.webhook", "Webhook"),
298
- desc: A("botlit.channels.integrations.webhookDesc", "Custom integration")
360
+ name: C("botlit.channels.integrations.webhook", "Webhook"),
361
+ desc: C("botlit.channels.integrations.webhookDesc", "Custom integration")
299
362
  }
300
- ].map((e) => /* @__PURE__ */ E(D, {
301
- to: j(`channels/new?type=${e.type}`),
363
+ ].map((e) => /* @__PURE__ */ x(S, {
364
+ to: w(`channels/new?type=${e.type}`),
302
365
  className: "p-4 text-center border border-border-subtle rounded-lg hover:bg-accent transition-colors",
303
366
  children: [
304
- /* @__PURE__ */ T(R, {
367
+ /* @__PURE__ */ b(O, {
305
368
  type: e.type,
306
369
  className: "h-8 w-8 mx-auto text-text-secondary"
307
370
  }),
308
- /* @__PURE__ */ T("p", {
371
+ /* @__PURE__ */ b("p", {
309
372
  className: "mt-2 font-medium text-sm",
310
373
  children: e.name
311
374
  }),
312
- /* @__PURE__ */ T("p", {
375
+ /* @__PURE__ */ b("p", {
313
376
  className: "text-xs text-text-secondary",
314
377
  children: e.desc
315
378
  })
@@ -321,6 +384,6 @@ var R = ({ type: e, className: t }) => {
321
384
  })
322
385
  });
323
386
  };
324
- export { z as ChannelsPage };
387
+ export { N as ChannelsPage };
325
388
 
326
389
  //# sourceMappingURL=ChannelsPage.js.map