@burdenoff/microfe-eventfullymanaged 2026.1124.3 → 2026.1124.4
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/eventfullymanaged/components/AiOperationsPanel.d.ts +10 -0
- package/dist/eventfullymanaged/components/AiOperationsPanel.js +560 -0
- package/dist/eventfullymanaged/components/AiOperationsPanel.js.map +1 -0
- package/dist/eventfullymanaged/components/AttendanceForecast.js +62 -39
- package/dist/eventfullymanaged/components/AttendanceForecast.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js +109 -107
- package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +493 -0
- package/dist/generated/wspace-operations.js +316 -44
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventGql } from '../api/eventApi';
|
|
2
|
+
/**
|
|
3
|
+
* BOFF-3785 — AI Operations surface embedded on `/eventfullymanaged/analytics`.
|
|
4
|
+
* Renders decision cards (no-show prediction, capacity right-sizing, agenda
|
|
5
|
+
* conflicts with confirmed Apply), AI credit visibility, and recent V2 ledger
|
|
6
|
+
* activity with graceful fallback when the AI runtime is unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare function AiOperationsPanel({ events }: {
|
|
9
|
+
events: readonly EventGql[];
|
|
10
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import { useApolloClient as e } from "../../node_modules/@apollo/client/react/hooks/useApolloClient.js";
|
|
2
|
+
import { useEventfullymanagedAiCreditStatusQuery as t, useEventfullymanagedAiInvocationHistoryQuery as n, useEventfullymanagedApplyAgendaFixMutation as r, useEventfullymanagedPredictNoShowsMutation as i, useEventfullymanagedResolveAgendaConflictsMutation as a, useEventfullymanagedRightSizeSessionsMutation as o, useEventfullymanagedSavedAgendaConflictsQuery as s, useEventfullymanagedSavedCapacityRightSizingQuery as c, useEventfullymanagedSavedNoShowPredictionQuery as l } from "../../generated/wspace-operations.js";
|
|
3
|
+
import { describeError as u } from "../lib/mutationResult.js";
|
|
4
|
+
import { notify as d } from "../lib/toast.js";
|
|
5
|
+
import { useMemo as f, useState as p } from "react";
|
|
6
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
|
+
import { Badge as _, Button as v, GlassCard as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { Activity as T, AlertTriangle as E, CheckCircle2 as D, Coins as O, ExternalLink as k, Scale as A, Sparkles as j, UserX as M } from "lucide-react";
|
|
9
|
+
// src/eventfullymanaged/components/AiOperationsPanel.tsx
|
|
10
|
+
function N(e) {
|
|
11
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : null;
|
|
12
|
+
}
|
|
13
|
+
function P(e) {
|
|
14
|
+
let t = N(e);
|
|
15
|
+
return !t || typeof t.text != "string" || !t.text.trim() || typeof t.provider != "string" || typeof t.model != "string" ? null : {
|
|
16
|
+
text: t.text,
|
|
17
|
+
provider: t.provider,
|
|
18
|
+
model: t.model
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function F(e) {
|
|
22
|
+
let t = N(e), n = N(t?.result) ?? t;
|
|
23
|
+
if (!n || typeof n.eventId != "string" || typeof n.eventNoShowRate != "number") return null;
|
|
24
|
+
let r = Array.isArray(n.sessions) ? n.sessions : [];
|
|
25
|
+
return {
|
|
26
|
+
eventId: n.eventId,
|
|
27
|
+
confidence: typeof n.confidence == "string" ? n.confidence : "LOW",
|
|
28
|
+
coldStart: !!n.coldStart,
|
|
29
|
+
coldStartReason: typeof n.coldStartReason == "string" ? n.coldStartReason : null,
|
|
30
|
+
eventNoShowRate: n.eventNoShowRate,
|
|
31
|
+
sessions: r,
|
|
32
|
+
narrative: P(n.narrative) ?? P(t?.narrative)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function I(e) {
|
|
36
|
+
let t = N(e), n = N(t?.result) ?? t;
|
|
37
|
+
return !n || typeof n.eventId != "string" || !Array.isArray(n.recommendations) ? null : {
|
|
38
|
+
eventId: n.eventId,
|
|
39
|
+
confidence: typeof n.confidence == "string" ? n.confidence : "LOW",
|
|
40
|
+
coldStart: !!n.coldStart,
|
|
41
|
+
recommendations: n.recommendations,
|
|
42
|
+
narrative: P(n.narrative) ?? P(t?.narrative)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function L(e) {
|
|
46
|
+
let t = N(e), n = N(t?.result) ?? t;
|
|
47
|
+
return !n || typeof n.eventId != "string" || !Array.isArray(n.conflicts) ? null : {
|
|
48
|
+
eventId: n.eventId,
|
|
49
|
+
conflicts: n.conflicts,
|
|
50
|
+
narrative: P(n.narrative) ?? P(t?.narrative)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function R(e) {
|
|
54
|
+
if (!e) return null;
|
|
55
|
+
let t = new Date(e);
|
|
56
|
+
return Number.isNaN(t.getTime()) ? null : t.toLocaleString();
|
|
57
|
+
}
|
|
58
|
+
function z(e) {
|
|
59
|
+
if (!e) return "—";
|
|
60
|
+
let t = Number(e);
|
|
61
|
+
if (!Number.isFinite(t)) return "—";
|
|
62
|
+
let n = t / 1e6;
|
|
63
|
+
return n < .01 && n > 0 ? `$${n.toFixed(6)}` : `$${n.toFixed(4)}`;
|
|
64
|
+
}
|
|
65
|
+
function B({ provider: e, model: t, generatedAt: n, narrative: r }) {
|
|
66
|
+
let i = R(n), a = r?.model ?? t, o = r?.provider ?? e, s = a && o && !a.includes("/") ? `${o}/${a}` : a ?? o;
|
|
67
|
+
return /* @__PURE__ */ g("p", {
|
|
68
|
+
className: "text-xs text-text-muted",
|
|
69
|
+
children: [
|
|
70
|
+
s ? /* @__PURE__ */ g(m, { children: ["Model: ", s] }) : null,
|
|
71
|
+
s && i ? " · " : null,
|
|
72
|
+
i ? /* @__PURE__ */ g(m, { children: ["Generated ", i] }) : null
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function V({ pending: e, applying: t, onConfirm: n, onCancel: r }) {
|
|
77
|
+
return /* @__PURE__ */ g("div", {
|
|
78
|
+
role: "dialog",
|
|
79
|
+
"aria-label": "Confirm session change",
|
|
80
|
+
className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken p-3",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ g("p", {
|
|
83
|
+
className: "text-sm font-semibold text-text-primary",
|
|
84
|
+
children: ["Confirm change to ", e.sessionTitle]
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ h("p", {
|
|
87
|
+
className: "text-sm text-text-secondary",
|
|
88
|
+
children: e.summary
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ h("p", {
|
|
91
|
+
className: "text-xs text-text-muted",
|
|
92
|
+
children: "Reversible: this updates only this session and can be reverted anytime from the session editor."
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ g("div", {
|
|
95
|
+
className: "flex flex-wrap gap-2",
|
|
96
|
+
children: [/* @__PURE__ */ h(v, {
|
|
97
|
+
type: "button",
|
|
98
|
+
size: "sm",
|
|
99
|
+
disabled: t,
|
|
100
|
+
onClick: n,
|
|
101
|
+
children: t ? "Applying…" : "Confirm & apply"
|
|
102
|
+
}), /* @__PURE__ */ h(v, {
|
|
103
|
+
type: "button",
|
|
104
|
+
size: "sm",
|
|
105
|
+
variant: "ghost",
|
|
106
|
+
disabled: t,
|
|
107
|
+
onClick: r,
|
|
108
|
+
children: "Cancel"
|
|
109
|
+
})]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function H({ eventId: t }) {
|
|
115
|
+
let n = e(), [f, m] = p(null), [y, b] = p(null), x = l({
|
|
116
|
+
variables: { eventId: t },
|
|
117
|
+
fetchPolicy: "network-only"
|
|
118
|
+
}), S = c({
|
|
119
|
+
variables: { eventId: t },
|
|
120
|
+
fetchPolicy: "network-only"
|
|
121
|
+
}), C = s({
|
|
122
|
+
variables: { eventId: t },
|
|
123
|
+
fetchPolicy: "network-only"
|
|
124
|
+
}), [w, T] = i(), [O, k] = o(), [N, P] = a(), [R, z] = r(), H = T.data?.eventfullyManagedPredictNoShows ?? F(x.data?.eventfullyManagedAiDecision?.data), U = k.data?.eventfullyManagedRightSizeSessions ?? I(S.data?.eventfullyManagedAiDecision?.data), W = P.data?.eventfullyManagedResolveAgendaConflicts ?? L(C.data?.eventfullyManagedAiDecision?.data), G = async () => {
|
|
125
|
+
b(null);
|
|
126
|
+
try {
|
|
127
|
+
await Promise.all([
|
|
128
|
+
w({ variables: { eventId: t } }),
|
|
129
|
+
O({ variables: { eventId: t } }),
|
|
130
|
+
N({ variables: { eventId: t } })
|
|
131
|
+
]), d.success("AI decisions refreshed");
|
|
132
|
+
} catch (e) {
|
|
133
|
+
b(u(e) ?? "AI decision analysis failed. Live analytics remain available.");
|
|
134
|
+
}
|
|
135
|
+
}, K = async () => {
|
|
136
|
+
if (f) {
|
|
137
|
+
b(null);
|
|
138
|
+
try {
|
|
139
|
+
let e = await R({ variables: {
|
|
140
|
+
eventId: t,
|
|
141
|
+
input: {
|
|
142
|
+
sessionId: f.sessionId,
|
|
143
|
+
venueId: f.venueId ?? void 0,
|
|
144
|
+
startsAt: f.startsAt ?? void 0,
|
|
145
|
+
endsAt: f.endsAt ?? void 0,
|
|
146
|
+
capacity: f.capacity ?? void 0,
|
|
147
|
+
confirm: !0
|
|
148
|
+
}
|
|
149
|
+
} });
|
|
150
|
+
if (e.error || !e.data?.eventfullyManagedApplyAgendaFix) {
|
|
151
|
+
b(e.error ? u(e.error) ?? "Could not apply change." : "Could not apply change.");
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
d.success("Session updated", `Applied recommended change to ${f.sessionTitle}.`), m(null), n.cache.evict({ fieldName: "eventfullyManagedAiDecision" }), n.cache.gc(), await Promise.all([O({ variables: { eventId: t } }), N({ variables: { eventId: t } })]);
|
|
155
|
+
} catch (e) {
|
|
156
|
+
b(u(e) ?? "Could not apply session fix.");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, q = T.loading || k.loading || P.loading;
|
|
160
|
+
return /* @__PURE__ */ g("div", {
|
|
161
|
+
className: "mt-4 space-y-4",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ g("div", {
|
|
164
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
165
|
+
children: [/* @__PURE__ */ h("p", {
|
|
166
|
+
className: "text-xs text-text-muted",
|
|
167
|
+
children: "Forecasts and recommendations are planning estimates; nothing changes until you explicitly confirm an action."
|
|
168
|
+
}), /* @__PURE__ */ g(v, {
|
|
169
|
+
type: "button",
|
|
170
|
+
size: "sm",
|
|
171
|
+
variant: "secondary",
|
|
172
|
+
disabled: q,
|
|
173
|
+
onClick: () => void G(),
|
|
174
|
+
children: [/* @__PURE__ */ h(j, { className: "h-4 w-4" }), q ? "Analyzing…" : "Run all AI checks"]
|
|
175
|
+
})]
|
|
176
|
+
}),
|
|
177
|
+
y && /* @__PURE__ */ h("p", {
|
|
178
|
+
role: "alert",
|
|
179
|
+
className: "text-sm text-status-error-text",
|
|
180
|
+
children: y
|
|
181
|
+
}),
|
|
182
|
+
f && /* @__PURE__ */ h(V, {
|
|
183
|
+
pending: f,
|
|
184
|
+
applying: z.loading,
|
|
185
|
+
onConfirm: () => void K(),
|
|
186
|
+
onCancel: () => m(null)
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ g("div", {
|
|
189
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ h("div", {
|
|
192
|
+
className: "flex flex-col justify-between space-y-3 rounded-card border border-border-seam bg-bg-surface p-4",
|
|
193
|
+
children: /* @__PURE__ */ g("div", {
|
|
194
|
+
className: "space-y-2",
|
|
195
|
+
children: [/* @__PURE__ */ g("div", {
|
|
196
|
+
className: "flex items-center justify-between gap-2",
|
|
197
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
198
|
+
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
199
|
+
children: [/* @__PURE__ */ h(M, { className: "h-4 w-4 text-accent-primary" }), "No-show prediction"]
|
|
200
|
+
}), /* @__PURE__ */ h(v, {
|
|
201
|
+
type: "button",
|
|
202
|
+
size: "sm",
|
|
203
|
+
variant: "ghost",
|
|
204
|
+
disabled: T.loading,
|
|
205
|
+
onClick: () => void w({ variables: { eventId: t } }),
|
|
206
|
+
children: T.loading ? "Running…" : H ? "Refresh" : "Predict"
|
|
207
|
+
})]
|
|
208
|
+
}), H ? /* @__PURE__ */ g("div", {
|
|
209
|
+
className: "space-y-2",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ g("div", {
|
|
212
|
+
className: "flex items-center gap-2",
|
|
213
|
+
children: [/* @__PURE__ */ g("span", {
|
|
214
|
+
className: "text-xl font-semibold tabular-nums text-text-primary",
|
|
215
|
+
children: [Math.round(H.eventNoShowRate * 100), "%"]
|
|
216
|
+
}), /* @__PURE__ */ g(_, {
|
|
217
|
+
variant: H.confidence === "LOW" ? "warning" : "info",
|
|
218
|
+
children: [H.confidence.toLowerCase(), " confidence"]
|
|
219
|
+
})]
|
|
220
|
+
}),
|
|
221
|
+
H.narrative && /* @__PURE__ */ h("p", {
|
|
222
|
+
className: "rounded-md bg-bg-sunken p-2 text-xs text-text-primary",
|
|
223
|
+
children: H.narrative.text
|
|
224
|
+
}),
|
|
225
|
+
H.sessions.slice(0, 3).map((e) => /* @__PURE__ */ g("div", {
|
|
226
|
+
className: "rounded-md border border-border-seam p-2 text-xs",
|
|
227
|
+
children: [/* @__PURE__ */ g("div", {
|
|
228
|
+
className: "flex items-center justify-between gap-2",
|
|
229
|
+
children: [/* @__PURE__ */ h("span", {
|
|
230
|
+
className: "truncate font-medium text-text-primary",
|
|
231
|
+
children: e.title
|
|
232
|
+
}), /* @__PURE__ */ g("span", {
|
|
233
|
+
className: "shrink-0 tabular-nums text-text-secondary",
|
|
234
|
+
children: [Math.round(e.predictedNoShowRate * 100), "% no-show"]
|
|
235
|
+
})]
|
|
236
|
+
}), e.drivers[0] && /* @__PURE__ */ h("p", {
|
|
237
|
+
className: "mt-1 text-text-muted",
|
|
238
|
+
children: e.drivers[0]
|
|
239
|
+
})]
|
|
240
|
+
}, e.sessionId)),
|
|
241
|
+
/* @__PURE__ */ h(B, {
|
|
242
|
+
provider: T.data?.eventfullyManagedPredictNoShows?.engine.provider ?? x.data?.eventfullyManagedAiDecision?.provider,
|
|
243
|
+
model: T.data?.eventfullyManagedPredictNoShows?.engine.model ?? x.data?.eventfullyManagedAiDecision?.model,
|
|
244
|
+
generatedAt: T.data?.eventfullyManagedPredictNoShows?.engine.generatedAt ?? x.data?.eventfullyManagedAiDecision?.generatedAt,
|
|
245
|
+
narrative: H.narrative
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
}) : /* @__PURE__ */ h("p", {
|
|
249
|
+
className: "text-xs text-text-secondary",
|
|
250
|
+
children: "No no-show prediction saved yet. Run prediction to identify sessions with higher drop-off risk."
|
|
251
|
+
})]
|
|
252
|
+
})
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ h("div", {
|
|
255
|
+
className: "flex flex-col justify-between space-y-3 rounded-card border border-border-seam bg-bg-surface p-4",
|
|
256
|
+
children: /* @__PURE__ */ g("div", {
|
|
257
|
+
className: "space-y-2",
|
|
258
|
+
children: [/* @__PURE__ */ g("div", {
|
|
259
|
+
className: "flex items-center justify-between gap-2",
|
|
260
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
261
|
+
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
262
|
+
children: [/* @__PURE__ */ h(A, { className: "h-4 w-4 text-accent-primary" }), "Capacity right-sizing"]
|
|
263
|
+
}), /* @__PURE__ */ h(v, {
|
|
264
|
+
type: "button",
|
|
265
|
+
size: "sm",
|
|
266
|
+
variant: "ghost",
|
|
267
|
+
disabled: k.loading,
|
|
268
|
+
onClick: () => void O({ variables: { eventId: t } }),
|
|
269
|
+
children: k.loading ? "Running…" : U ? "Refresh" : "Check"
|
|
270
|
+
})]
|
|
271
|
+
}), U ? /* @__PURE__ */ g("div", {
|
|
272
|
+
className: "space-y-2",
|
|
273
|
+
children: [
|
|
274
|
+
U.narrative && /* @__PURE__ */ h("p", {
|
|
275
|
+
className: "rounded-md bg-bg-sunken p-2 text-xs text-text-primary",
|
|
276
|
+
children: U.narrative.text
|
|
277
|
+
}),
|
|
278
|
+
U.recommendations.length === 0 ? /* @__PURE__ */ h("p", {
|
|
279
|
+
className: "text-xs text-text-secondary",
|
|
280
|
+
children: "No scheduled sessions to right-size for this event."
|
|
281
|
+
}) : U.recommendations.slice(0, 4).map((e) => /* @__PURE__ */ g("div", {
|
|
282
|
+
className: "space-y-1.5 rounded-md border border-border-seam p-2 text-xs",
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ g("div", {
|
|
285
|
+
className: "flex items-center justify-between gap-2",
|
|
286
|
+
children: [/* @__PURE__ */ h("span", {
|
|
287
|
+
className: "truncate font-medium text-text-primary",
|
|
288
|
+
children: e.title
|
|
289
|
+
}), /* @__PURE__ */ h(_, {
|
|
290
|
+
variant: e.action === "KEEP" ? "secondary" : "warning",
|
|
291
|
+
children: e.action
|
|
292
|
+
})]
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ h("p", {
|
|
295
|
+
className: "text-text-secondary",
|
|
296
|
+
children: e.rationale
|
|
297
|
+
}),
|
|
298
|
+
e.applyable && /* @__PURE__ */ h(v, {
|
|
299
|
+
type: "button",
|
|
300
|
+
size: "sm",
|
|
301
|
+
variant: "outline",
|
|
302
|
+
onClick: () => m({
|
|
303
|
+
sessionId: e.sessionId,
|
|
304
|
+
sessionTitle: e.title,
|
|
305
|
+
venueId: e.targetVenueId,
|
|
306
|
+
capacity: e.targetCapacity,
|
|
307
|
+
summary: e.targetVenueName ? `Move "${e.title}" to ${e.targetVenueName}${e.targetCapacity ? ` (capacity ${e.targetCapacity})` : ""}. ${e.rationale}` : `Set "${e.title}" capacity to ${e.targetCapacity ?? e.high}. ${e.rationale}`
|
|
308
|
+
}),
|
|
309
|
+
children: "Apply"
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
}, e.sessionId)),
|
|
313
|
+
/* @__PURE__ */ h(B, {
|
|
314
|
+
provider: k.data?.eventfullyManagedRightSizeSessions?.engine.provider ?? S.data?.eventfullyManagedAiDecision?.provider,
|
|
315
|
+
model: k.data?.eventfullyManagedRightSizeSessions?.engine.model ?? S.data?.eventfullyManagedAiDecision?.model,
|
|
316
|
+
generatedAt: k.data?.eventfullyManagedRightSizeSessions?.engine.generatedAt ?? S.data?.eventfullyManagedAiDecision?.generatedAt,
|
|
317
|
+
narrative: U.narrative
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
}) : /* @__PURE__ */ h("p", {
|
|
321
|
+
className: "text-xs text-text-secondary",
|
|
322
|
+
children: "Compare predicted session turnout against room capacities to catch overflows early."
|
|
323
|
+
})]
|
|
324
|
+
})
|
|
325
|
+
}),
|
|
326
|
+
/* @__PURE__ */ h("div", {
|
|
327
|
+
className: "flex flex-col justify-between space-y-3 rounded-card border border-border-seam bg-bg-surface p-4",
|
|
328
|
+
children: /* @__PURE__ */ g("div", {
|
|
329
|
+
className: "space-y-2",
|
|
330
|
+
children: [/* @__PURE__ */ g("div", {
|
|
331
|
+
className: "flex items-center justify-between gap-2",
|
|
332
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
333
|
+
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
334
|
+
children: [/* @__PURE__ */ h(E, { className: "h-4 w-4 text-accent-primary" }), "Agenda conflicts"]
|
|
335
|
+
}), /* @__PURE__ */ h(v, {
|
|
336
|
+
type: "button",
|
|
337
|
+
size: "sm",
|
|
338
|
+
variant: "ghost",
|
|
339
|
+
disabled: P.loading,
|
|
340
|
+
onClick: () => void N({ variables: { eventId: t } }),
|
|
341
|
+
children: P.loading ? "Running…" : W ? "Refresh" : "Scan"
|
|
342
|
+
})]
|
|
343
|
+
}), W ? /* @__PURE__ */ g("div", {
|
|
344
|
+
className: "space-y-2",
|
|
345
|
+
children: [
|
|
346
|
+
W.narrative && /* @__PURE__ */ h("p", {
|
|
347
|
+
className: "rounded-md bg-bg-sunken p-2 text-xs text-text-primary",
|
|
348
|
+
children: W.narrative.text
|
|
349
|
+
}),
|
|
350
|
+
W.conflicts.length === 0 ? /* @__PURE__ */ g("p", {
|
|
351
|
+
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
352
|
+
children: [/* @__PURE__ */ h(D, { className: "h-4 w-4 text-accent-primary" }), "No room clashes, double-booked speakers, or over-capacity sessions detected."]
|
|
353
|
+
}) : W.conflicts.slice(0, 4).map((e, t) => /* @__PURE__ */ g("div", {
|
|
354
|
+
className: "space-y-1.5 rounded-md border border-border-seam p-2 text-xs",
|
|
355
|
+
children: [
|
|
356
|
+
/* @__PURE__ */ g("div", {
|
|
357
|
+
className: "flex items-center justify-between gap-2",
|
|
358
|
+
children: [/* @__PURE__ */ h("span", {
|
|
359
|
+
className: "truncate font-medium text-text-primary",
|
|
360
|
+
children: e.sessionATitle
|
|
361
|
+
}), /* @__PURE__ */ h(_, {
|
|
362
|
+
variant: "warning",
|
|
363
|
+
children: e.type
|
|
364
|
+
})]
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ h("p", {
|
|
367
|
+
className: "text-text-secondary",
|
|
368
|
+
children: e.message
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ h("p", {
|
|
371
|
+
className: "text-text-muted",
|
|
372
|
+
children: e.suggestedFix.rationale
|
|
373
|
+
}),
|
|
374
|
+
e.suggestedFix.applyable && /* @__PURE__ */ h(v, {
|
|
375
|
+
type: "button",
|
|
376
|
+
size: "sm",
|
|
377
|
+
variant: "outline",
|
|
378
|
+
onClick: () => m({
|
|
379
|
+
sessionId: e.suggestedFix.sessionId,
|
|
380
|
+
sessionTitle: e.sessionATitle,
|
|
381
|
+
venueId: e.suggestedFix.targetVenueId,
|
|
382
|
+
startsAt: e.suggestedFix.targetStartsAt,
|
|
383
|
+
endsAt: e.suggestedFix.targetEndsAt,
|
|
384
|
+
capacity: e.suggestedFix.targetCapacity,
|
|
385
|
+
summary: e.suggestedFix.rationale
|
|
386
|
+
}),
|
|
387
|
+
children: "Apply fix"
|
|
388
|
+
})
|
|
389
|
+
]
|
|
390
|
+
}, `${e.sessionAId}-${e.type}-${t}`)),
|
|
391
|
+
/* @__PURE__ */ h(B, {
|
|
392
|
+
provider: P.data?.eventfullyManagedResolveAgendaConflicts?.engine.provider ?? C.data?.eventfullyManagedAiDecision?.provider,
|
|
393
|
+
model: P.data?.eventfullyManagedResolveAgendaConflicts?.engine.model ?? C.data?.eventfullyManagedAiDecision?.model,
|
|
394
|
+
generatedAt: P.data?.eventfullyManagedResolveAgendaConflicts?.engine.generatedAt ?? C.data?.eventfullyManagedAiDecision?.generatedAt,
|
|
395
|
+
narrative: W.narrative
|
|
396
|
+
})
|
|
397
|
+
]
|
|
398
|
+
}) : /* @__PURE__ */ h("p", {
|
|
399
|
+
className: "text-xs text-text-secondary",
|
|
400
|
+
children: "Scan the event schedule for room overlaps, speaker double-bookings, and capacity clashes."
|
|
401
|
+
})]
|
|
402
|
+
})
|
|
403
|
+
})
|
|
404
|
+
]
|
|
405
|
+
})
|
|
406
|
+
]
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
function U() {
|
|
410
|
+
let [e] = p(() => {
|
|
411
|
+
let e = /* @__PURE__ */ new Date();
|
|
412
|
+
return {
|
|
413
|
+
from: (/* @__PURE__ */ new Date(e.getTime() - 6048e5)).toISOString(),
|
|
414
|
+
to: e.toISOString()
|
|
415
|
+
};
|
|
416
|
+
}), r = t({
|
|
417
|
+
variables: { productKey: "eventfullymanaged" },
|
|
418
|
+
fetchPolicy: "network-only"
|
|
419
|
+
}), i = n({
|
|
420
|
+
variables: {
|
|
421
|
+
from: e.from,
|
|
422
|
+
to: e.to,
|
|
423
|
+
productKey: "eventfullymanaged",
|
|
424
|
+
first: 5
|
|
425
|
+
},
|
|
426
|
+
fetchPolicy: "network-only"
|
|
427
|
+
}), a = r.data?.aiCreditStatus, o = f(() => i.data?.promptInvocationAttemptsV2?.nodes ?? [], [i.data]), s = !!(r.error && i.error);
|
|
428
|
+
return /* @__PURE__ */ g("div", {
|
|
429
|
+
className: "mt-5 grid grid-cols-1 gap-4 border-t border-border-seam pt-4 lg:grid-cols-2",
|
|
430
|
+
children: [/* @__PURE__ */ g("div", {
|
|
431
|
+
className: "space-y-2 rounded-card border border-border-seam bg-bg-surface p-4",
|
|
432
|
+
children: [/* @__PURE__ */ g("div", {
|
|
433
|
+
className: "flex items-center justify-between gap-2",
|
|
434
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
435
|
+
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
436
|
+
children: [/* @__PURE__ */ h(O, { className: "h-4 w-4 text-accent-primary" }), "AI credit allowance"]
|
|
437
|
+
}), /* @__PURE__ */ g("a", {
|
|
438
|
+
href: "/ai",
|
|
439
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-accent-primary hover:underline",
|
|
440
|
+
children: ["Full AI Operations", /* @__PURE__ */ h(k, { className: "h-3.5 w-3.5" })]
|
|
441
|
+
})]
|
|
442
|
+
}), r.error ? /* @__PURE__ */ h("p", {
|
|
443
|
+
className: "text-xs text-text-secondary",
|
|
444
|
+
children: "AI credit visibility is currently unavailable. Live event analytics continue normally."
|
|
445
|
+
}) : a ? /* @__PURE__ */ g("div", {
|
|
446
|
+
className: "space-y-1 text-xs text-text-secondary",
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ h("p", {
|
|
449
|
+
className: "text-sm font-semibold tabular-nums text-text-primary",
|
|
450
|
+
children: a.noLimit ? "Unlimited AI credits" : a.provisioned ? `${Math.round(a.remaining ?? 0).toLocaleString()} / ${Math.round(a.limit ?? 0).toLocaleString()} credits remaining` : "Metering not provisioned on this workspace"
|
|
451
|
+
}),
|
|
452
|
+
a.provisioned && !a.noLimit && /* @__PURE__ */ g("p", { children: [
|
|
453
|
+
"Used this cycle: ",
|
|
454
|
+
Math.round(a.used ?? 0).toLocaleString(),
|
|
455
|
+
" credits (",
|
|
456
|
+
a.quotaName,
|
|
457
|
+
")"
|
|
458
|
+
] }),
|
|
459
|
+
a.exhausted && /* @__PURE__ */ h("p", {
|
|
460
|
+
role: "alert",
|
|
461
|
+
className: "text-status-warning-text",
|
|
462
|
+
children: "AI credits exhausted for this billing cycle. Deterministic forecasts still run without LLM narratives."
|
|
463
|
+
})
|
|
464
|
+
]
|
|
465
|
+
}) : /* @__PURE__ */ h("p", {
|
|
466
|
+
className: "text-xs text-text-muted",
|
|
467
|
+
children: "Loading AI credit status…"
|
|
468
|
+
})]
|
|
469
|
+
}), /* @__PURE__ */ g("div", {
|
|
470
|
+
className: "space-y-2 rounded-card border border-border-seam bg-bg-surface p-4",
|
|
471
|
+
children: [/* @__PURE__ */ g("div", {
|
|
472
|
+
className: "flex items-center justify-between gap-2",
|
|
473
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
474
|
+
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
475
|
+
children: [/* @__PURE__ */ h(T, { className: "h-4 w-4 text-accent-primary" }), "Recent AI activity (7 days)"]
|
|
476
|
+
}), /* @__PURE__ */ h("span", {
|
|
477
|
+
className: "text-xs text-text-muted",
|
|
478
|
+
children: "Shared ledger"
|
|
479
|
+
})]
|
|
480
|
+
}), s || i.error ? /* @__PURE__ */ h("p", {
|
|
481
|
+
className: "text-xs text-text-secondary",
|
|
482
|
+
children: "AI activity ledger is unavailable for this role or runtime. Non-AI analytics are unaffected."
|
|
483
|
+
}) : i.loading && o.length === 0 ? /* @__PURE__ */ h("p", {
|
|
484
|
+
className: "text-xs text-text-muted",
|
|
485
|
+
children: "Loading recorded AI invocations…"
|
|
486
|
+
}) : o.length === 0 ? /* @__PURE__ */ h("p", {
|
|
487
|
+
className: "text-xs text-text-secondary",
|
|
488
|
+
children: "No hosted model calls recorded in the last 7 days for EventfullyManaged."
|
|
489
|
+
}) : /* @__PURE__ */ h("ul", {
|
|
490
|
+
className: "divide-y divide-border-seam text-xs",
|
|
491
|
+
children: o.map((e) => /* @__PURE__ */ g("li", {
|
|
492
|
+
className: "flex flex-wrap items-center justify-between gap-2 py-1.5",
|
|
493
|
+
children: [/* @__PURE__ */ g("div", {
|
|
494
|
+
className: "min-w-0",
|
|
495
|
+
children: [/* @__PURE__ */ h("p", {
|
|
496
|
+
className: "truncate font-medium text-text-primary",
|
|
497
|
+
children: e.operationKey
|
|
498
|
+
}), /* @__PURE__ */ g("p", {
|
|
499
|
+
className: "truncate text-text-muted",
|
|
500
|
+
children: [
|
|
501
|
+
e.providerKey,
|
|
502
|
+
"/",
|
|
503
|
+
e.modelKey,
|
|
504
|
+
" · ",
|
|
505
|
+
e.trigger ?? "interactive"
|
|
506
|
+
]
|
|
507
|
+
})]
|
|
508
|
+
}), /* @__PURE__ */ g("div", {
|
|
509
|
+
className: "flex shrink-0 items-center gap-2 tabular-nums",
|
|
510
|
+
children: [/* @__PURE__ */ h("span", {
|
|
511
|
+
className: "text-text-secondary",
|
|
512
|
+
children: z(e.costMicroUsd)
|
|
513
|
+
}), /* @__PURE__ */ h(_, {
|
|
514
|
+
variant: e.status === "succeeded" ? "success" : "warning",
|
|
515
|
+
children: e.status
|
|
516
|
+
})]
|
|
517
|
+
})]
|
|
518
|
+
}, e.id))
|
|
519
|
+
})]
|
|
520
|
+
})]
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
function W({ events: e }) {
|
|
524
|
+
let [t, n] = p(""), r = e.some((e) => e.id === t) ? t : e[0]?.id ?? "";
|
|
525
|
+
return /* @__PURE__ */ g(y, {
|
|
526
|
+
treatment: "insight",
|
|
527
|
+
className: "p-5",
|
|
528
|
+
children: [
|
|
529
|
+
/* @__PURE__ */ g("div", {
|
|
530
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
531
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h2", {
|
|
532
|
+
className: "text-base font-semibold text-text-primary",
|
|
533
|
+
children: "AI Operations & Decision Cards"
|
|
534
|
+
}), /* @__PURE__ */ h("p", {
|
|
535
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
536
|
+
children: "Review no-show risk, room right-sizing, agenda conflict fixes, AI credit usage, and recorded model activity."
|
|
537
|
+
})] }), e.length > 0 && /* @__PURE__ */ g(b, {
|
|
538
|
+
value: r,
|
|
539
|
+
onValueChange: n,
|
|
540
|
+
children: [/* @__PURE__ */ h(C, {
|
|
541
|
+
"aria-label": "AI operations event",
|
|
542
|
+
className: "min-h-11 w-full sm:w-64",
|
|
543
|
+
children: /* @__PURE__ */ h(w, {})
|
|
544
|
+
}), /* @__PURE__ */ h(x, { children: e.map((e) => /* @__PURE__ */ h(S, {
|
|
545
|
+
value: e.id,
|
|
546
|
+
children: e.name
|
|
547
|
+
}, e.id)) })]
|
|
548
|
+
})]
|
|
549
|
+
}),
|
|
550
|
+
r ? /* @__PURE__ */ h(H, { eventId: r }, r) : /* @__PURE__ */ h("p", {
|
|
551
|
+
className: "mt-4 text-sm text-text-secondary",
|
|
552
|
+
children: "Create an event to run AI decision checks."
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ h(U, {})
|
|
555
|
+
]
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
export { W as AiOperationsPanel };
|
|
559
|
+
|
|
560
|
+
//# sourceMappingURL=AiOperationsPanel.js.map
|