@elevasis/ui 1.26.0 → 1.27.0

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 (53) hide show
  1. package/dist/charts/index.js +2 -2
  2. package/dist/{chunk-AWT255UH.js → chunk-2IJCM3VQ.js} +37 -37
  3. package/dist/chunk-5COLSYBE.js +199 -0
  4. package/dist/{chunk-RMPXGBNI.js → chunk-5JSR6TL5.js} +2 -2
  5. package/dist/chunk-BAGYETKM.js +635 -0
  6. package/dist/{chunk-L3GVDMCA.js → chunk-C27LLJM6.js} +3 -195
  7. package/dist/{chunk-O4UB5DQQ.js → chunk-F2J7675J.js} +1 -1
  8. package/dist/chunk-ITCEULI5.js +238 -0
  9. package/dist/{chunk-4WKWLFBZ.js → chunk-P5EWG45B.js} +1 -1
  10. package/dist/{chunk-BS4J2LAW.js → chunk-QTD5HPKD.js} +1 -1
  11. package/dist/{chunk-ZVJKIJFG.js → chunk-RCQPWA5X.js} +13 -42
  12. package/dist/chunk-TLAIQC7B.js +6382 -0
  13. package/dist/{chunk-FEZZ3IDU.js → chunk-TXPUIHX2.js} +10 -10
  14. package/dist/{chunk-L4XXM55J.js → chunk-W4VYXIN7.js} +142 -3
  15. package/dist/chunk-WJ7W7JU4.js +2115 -0
  16. package/dist/{chunk-YNGQ7U5H.js → chunk-WLNEJ6JJ.js} +2 -2
  17. package/dist/{chunk-4INR75ZS.js → chunk-Y2SYGFRF.js} +589 -65
  18. package/dist/components/index.d.ts +333 -73
  19. package/dist/components/index.js +838 -686
  20. package/dist/features/auth/index.d.ts +125 -0
  21. package/dist/features/auth/index.js +2 -2
  22. package/dist/features/dashboard/index.d.ts +28 -2
  23. package/dist/features/dashboard/index.js +21 -635
  24. package/dist/features/monitoring/index.d.ts +28 -1
  25. package/dist/features/monitoring/index.js +19 -529
  26. package/dist/features/operations/index.d.ts +51 -8
  27. package/dist/features/operations/index.js +25 -3760
  28. package/dist/features/settings/index.d.ts +153 -1
  29. package/dist/features/settings/index.js +19 -1438
  30. package/dist/hooks/index.d.ts +262 -25
  31. package/dist/hooks/index.js +12 -8
  32. package/dist/hooks/published.d.ts +137 -25
  33. package/dist/hooks/published.js +11 -7
  34. package/dist/index.d.ts +310 -28
  35. package/dist/index.js +12 -11
  36. package/dist/initialization/index.d.ts +125 -0
  37. package/dist/layout/index.d.ts +2 -0
  38. package/dist/layout/index.js +6 -5
  39. package/dist/organization/index.js +1 -2
  40. package/dist/profile/index.d.ts +125 -0
  41. package/dist/provider/index.d.ts +48 -3
  42. package/dist/provider/index.js +10 -4
  43. package/dist/provider/published.d.ts +48 -3
  44. package/dist/provider/published.js +8 -2
  45. package/dist/supabase/index.d.ts +242 -0
  46. package/dist/theme/index.js +2 -2
  47. package/dist/types/index.d.ts +126 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-LR4WVA7W.js +0 -682
  50. package/dist/chunk-R7WLWGPO.js +0 -126
  51. package/dist/chunk-TCKIAHDC.js +0 -2626
  52. package/dist/chunk-V7XHGJQZ.js +0 -145
  53. package/dist/{chunk-WWEMNIHW.js → chunk-YYBM5LNJ.js} +1 -1
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentType } from 'react';
2
3
 
3
4
  /**
4
5
  * Time range selector for dashboard metrics
@@ -117,5 +118,31 @@ interface NotificationCenterProps {
117
118
  }
118
119
  declare function NotificationCenter({ pageSize }: NotificationCenterProps): react_jsx_runtime.JSX.Element;
119
120
 
120
- export { ActivityFeed, ActivityLog, CostAnalytics, ErrorDetailsModal, ExecutionHealth, ExecutionLogsPage, NotificationCenter };
121
+ interface FeatureNavLink {
122
+ label: string;
123
+ link: string;
124
+ featureKey?: string;
125
+ onClick?: () => void;
126
+ }
127
+ interface FeatureNavEntry {
128
+ label: string;
129
+ icon: ComponentType;
130
+ link?: string;
131
+ featureKey?: string;
132
+ requiresAdmin?: boolean;
133
+ dataOnboardingTourId?: string;
134
+ links?: FeatureNavLink[];
135
+ }
136
+ type FeatureSidebarComponent = ComponentType;
137
+ interface FeatureModule {
138
+ key: string;
139
+ label?: string;
140
+ navEntry?: FeatureNavEntry;
141
+ sidebar?: FeatureSidebarComponent;
142
+ subshellRoutes?: string[];
143
+ }
144
+
145
+ declare const monitoringManifest: FeatureModule;
146
+
147
+ export { ActivityFeed, ActivityLog, CostAnalytics, ErrorDetailsModal, ExecutionHealth, ExecutionLogsPage, NotificationCenter, monitoringManifest };
121
148
  export type { ActivityFeedProps, ActivityLogProps, CostAnalyticsProps, ErrorDetailsModalProps, ExecutionHealthProps, ExecutionLogsPageProps, ExecutionLogsPageRenderTrendChartArgs, NotificationCenterProps };
@@ -1,32 +1,33 @@
1
- import { ExecutionLogsFilters, ExecutionLogsTable, ExecutionHealthCard, ErrorBreakdownTable, ErrorAnalysisCard, CostBreakdownCard, CostByModelTable, ActivityFilters, ActivityTable, ActivityCard, NotificationList } from '../../chunk-4INR75ZS.js';
1
+ export { ActivityFeed, ActivityLog, CostAnalytics, ErrorDetailsModal, ExecutionHealth, ExecutionLogsPage, NotificationCenter, monitoringManifest } from '../../chunk-Y2SYGFRF.js';
2
2
  import '../../chunk-PDHTXPSF.js';
3
3
  import '../../chunk-LGKLC5MG.js';
4
- import '../../chunk-4WKWLFBZ.js';
5
- import { CustomModal } from '../../chunk-GBMNCNHX.js';
6
- import { CostTrendChart, ActivityTrendChart } from '../../chunk-JHVKGZ2P.js';
7
- import { PageTitleCaption, JsonViewer, EmptyState } from '../../chunk-MCA6LOGM.js';
4
+ import '../../chunk-P5EWG45B.js';
5
+ import '../../chunk-GBMNCNHX.js';
6
+ import '../../chunk-JHVKGZ2P.js';
7
+ import '../../chunk-MCA6LOGM.js';
8
8
  import '../../chunk-3KMDHCAR.js';
9
9
  import '../../chunk-NNKKBSJN.js';
10
- import { AppShellLoader } from '../../chunk-WWEMNIHW.js';
11
- import '../../chunk-QJ2S46NI.js';
12
- import { useExecutionLogsFilters, useTimeRangeDates, useActivityFilters } from '../../chunk-YNGQ7U5H.js';
13
- import { usePaginationState, useExecutionLogs, useExecutionHealth, useErrorAnalysis, useErrorDetail, useResolveErrorsByExecution, useResources, useCostTrends, useCostSummary, useCostByModel, useCostBreakdown, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead, useTestNotification } from '../../chunk-ZVJKIJFG.js';
14
- import { getTimeRangeDates } from '../../chunk-LXHZYSMQ.js';
15
- import '../../chunk-MHW43EOH.js';
10
+ import '../../chunk-YYBM5LNJ.js';
11
+ import '../../chunk-WLNEJ6JJ.js';
12
+ import '../../chunk-RCQPWA5X.js';
13
+ import '../../chunk-LXHZYSMQ.js';
16
14
  import '../../chunk-F6RBK7NJ.js';
17
15
  import '../../chunk-XA34RETF.js';
18
16
  import '../../chunk-ELJIFLCB.js';
19
- import '../../chunk-L4XXM55J.js';
20
- import '../../chunk-RNP5R5I3.js';
21
- import '../../chunk-RMPXGBNI.js';
17
+ import '../../chunk-5JSR6TL5.js';
22
18
  import '../../chunk-SZHARWKU.js';
23
- import '../../chunk-FEZZ3IDU.js';
19
+ import '../../chunk-TXPUIHX2.js';
24
20
  import '../../chunk-CYXZHBP4.js';
25
- import '../../chunk-R7WLWGPO.js';
21
+ import '../../chunk-ITCEULI5.js';
22
+ import '../../chunk-5COLSYBE.js';
26
23
  import '../../chunk-NVOCKXUQ.js';
27
- import '../../chunk-V7XHGJQZ.js';
24
+ import '../../chunk-MHW43EOH.js';
25
+ import '../../chunk-W4VYXIN7.js';
28
26
  import '../../chunk-QJ2KCHKX.js';
29
- import { PAGE_SIZE_DEFAULT } from '../../chunk-IOKL7BKE.js';
27
+ import '../../chunk-QJ2S46NI.js';
28
+ import '../../chunk-SLVC5OJ2.js';
29
+ import '../../chunk-RNP5R5I3.js';
30
+ import '../../chunk-IOKL7BKE.js';
30
31
  import '../../chunk-RWQIFKMJ.js';
31
32
  import '../../chunk-ALA56RGZ.js';
32
33
  import '../../chunk-TUXTSEAF.js';
@@ -34,514 +35,3 @@ import '../../chunk-DD3CCMCZ.js';
34
35
  import '../../chunk-QEPXAWE2.js';
35
36
  import '../../chunk-BRJ3QZ4E.js';
36
37
  import '../../chunk-Q7DJKLEN.js';
37
- import { useMemo, useCallback, useState } from 'react';
38
- import { Stack, Paper, Group, Pagination, Center, Loader, Alert, Title, Text, Badge, Divider, Code, CopyButton, Tooltip, ActionIcon, Accordion, Button } from '@mantine/core';
39
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
40
- import { IconAlertCircle, IconBug, IconCheck, IconCopy, IconExternalLink, IconCircleCheck, IconCircleDashed, IconInfoCircle, IconActivity, IconPlus } from '@tabler/icons-react';
41
-
42
- function ExecutionLogsPage({
43
- timeRange,
44
- pageSize = 20,
45
- onNavigateToExecution,
46
- renderTrendChart
47
- }) {
48
- const { filters, updateFilter, resetFilters } = useExecutionLogsFilters(timeRange);
49
- const startDate = useMemo(() => {
50
- const { startDate: sd } = getTimeRangeDates(timeRange);
51
- return new Date(sd).getTime();
52
- }, [timeRange]);
53
- const { page, setPage, offset, totalPages } = usePaginationState(pageSize, [
54
- filters.resourceId,
55
- filters.status,
56
- filters.resourceStatus,
57
- timeRange
58
- ]);
59
- const { data, isLoading } = useExecutionLogs({
60
- resourceId: filters.resourceId,
61
- status: filters.status !== "all" ? filters.status : void 0,
62
- resourceStatus: filters.resourceStatus !== "all" ? filters.resourceStatus : void 0,
63
- startDate,
64
- limit: pageSize,
65
- offset
66
- });
67
- const total = data?.total ?? 0;
68
- return /* @__PURE__ */ jsxs(Stack, { children: [
69
- /* @__PURE__ */ jsx(PageTitleCaption, { title: "Execution Logs", caption: "View and filter execution history across all resources" }),
70
- renderTrendChart({ timeRange }),
71
- /* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
72
- /* @__PURE__ */ jsx(ExecutionLogsFilters, { filters, onFilterChange: updateFilter, onReset: resetFilters }),
73
- /* @__PURE__ */ jsx(
74
- ExecutionLogsTable,
75
- {
76
- executions: data?.executions || [],
77
- isLoading,
78
- onRowClick: onNavigateToExecution
79
- }
80
- ),
81
- totalPages(total) > 1 && /* @__PURE__ */ jsx(Group, { justify: "flex-start", children: /* @__PURE__ */ jsx(Pagination, { value: page, onChange: setPage, total: totalPages(total), size: "sm", boundaries: 1 }) })
82
- ] }) })
83
- ] });
84
- }
85
- function ExecutionHealth({ timeRange, onErrorClick }) {
86
- const { data, isLoading, error } = useExecutionHealth({ timeRange });
87
- const { data: errorData, isLoading: errorLoading, error: errorError } = useErrorAnalysis(timeRange);
88
- const { startDate, endDate } = useTimeRangeDates(timeRange);
89
- if (isLoading) return /* @__PURE__ */ jsx(AppShellLoader, {});
90
- return /* @__PURE__ */ jsxs(Stack, { children: [
91
- /* @__PURE__ */ jsx(
92
- PageTitleCaption,
93
- {
94
- title: "Execution Health",
95
- caption: "Detailed execution metrics, success rates, and performance trends"
96
- }
97
- ),
98
- /* @__PURE__ */ jsx(ExecutionHealthCard, { data: data?.executionHealth, isLoading, error }),
99
- /* @__PURE__ */ jsx(
100
- ErrorBreakdownTable,
101
- {
102
- startDate,
103
- endDate,
104
- onErrorClick: (executionId) => onErrorClick(executionId)
105
- }
106
- ),
107
- /* @__PURE__ */ jsx(ErrorAnalysisCard, { data: errorData, isLoading: errorLoading, error: errorError })
108
- ] });
109
- }
110
- function ErrorDetailsModal({ executionId, opened, onClose, organizationName }) {
111
- const { data: errors, isLoading, isError } = useErrorDetail(executionId);
112
- const resolveErrors = useResolveErrorsByExecution();
113
- const { data: resources } = useResources();
114
- const resourceNameMap = useMemo(() => {
115
- const map = /* @__PURE__ */ new Map();
116
- if (resources) {
117
- for (const r of [...resources.workflows, ...resources.agents]) {
118
- map.set(r.resourceId, r.name);
119
- }
120
- }
121
- return map;
122
- }, [resources]);
123
- const primaryError = errors?.[0];
124
- const resolvedResourceName = primaryError ? resourceNameMap.get(primaryError.resourceId) ?? primaryError.resourceId : void 0;
125
- const allResolved = errors?.every((e) => e.resolved) ?? false;
126
- const hasRetries = errors && errors.length > 1;
127
- const handleCopyDetails = () => {
128
- if (!primaryError) return;
129
- const detailsText = `
130
- Error ID: ${primaryError.id}
131
- Timestamp: ${primaryError.timestamp}
132
- Type: ${primaryError.errorType}
133
- Severity: ${primaryError.severity}
134
- Execution ID: ${primaryError.executionId}
135
- Resource: ${primaryError.resourceName}
136
-
137
- Message:
138
- ${primaryError.message}
139
-
140
- Stack Trace:
141
- ${primaryError.stackTrace || "No stack trace available"}
142
-
143
- Context:
144
- ${primaryError.errorContext ? JSON.stringify(primaryError.errorContext, null, 2) : "No context available"}
145
- `.trim();
146
- navigator.clipboard.writeText(detailsText);
147
- };
148
- return /* @__PURE__ */ jsx(CustomModal, { opened, onClose, size: "xl", children: /* @__PURE__ */ jsxs(Stack, { children: [
149
- isLoading && /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }),
150
- isError && /* @__PURE__ */ jsx(Alert, { color: "red", icon: /* @__PURE__ */ jsx(IconAlertCircle, {}), title: "Error Loading Details", children: "Failed to load error details. Please try again." }),
151
- !isLoading && !isError && !primaryError && /* @__PURE__ */ jsx(Alert, { color: "gray", icon: /* @__PURE__ */ jsx(IconBug, {}), children: "No error details found for this execution." }),
152
- !isLoading && !isError && primaryError && /* @__PURE__ */ jsxs(Fragment, { children: [
153
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
154
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
155
- /* @__PURE__ */ jsx(IconAlertCircle, { size: 24, color: "var(--color-error)" }),
156
- /* @__PURE__ */ jsxs("div", { children: [
157
- /* @__PURE__ */ jsx(Title, { order: 3, children: primaryError.errorType }),
158
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: new Date(primaryError.timestamp).toLocaleString("en-US", {
159
- month: "long",
160
- day: "numeric",
161
- year: "numeric",
162
- hour: "2-digit",
163
- minute: "2-digit",
164
- second: "2-digit"
165
- }) })
166
- ] })
167
- ] }),
168
- /* @__PURE__ */ jsx(
169
- Badge,
170
- {
171
- color: primaryError.severity === "critical" ? "red" : primaryError.severity === "warning" ? "orange" : "blue",
172
- variant: "light",
173
- children: primaryError.severity
174
- }
175
- )
176
- ] }),
177
- /* @__PURE__ */ jsx(Divider, {}),
178
- /* @__PURE__ */ jsxs("div", { children: [
179
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, mb: "xs", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Error Message" }),
180
- /* @__PURE__ */ jsx(Alert, { color: "red", icon: /* @__PURE__ */ jsx(IconBug, { size: 16 }), children: primaryError.message })
181
- ] }),
182
- hasRetries && /* @__PURE__ */ jsxs(Alert, { color: "yellow", icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), children: [
183
- "This execution has ",
184
- errors.length,
185
- " errors (including retries). Showing most recent error."
186
- ] }),
187
- /* @__PURE__ */ jsxs("div", { children: [
188
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, mb: "xs", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Execution Context" }),
189
- /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
190
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
191
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Execution ID" }),
192
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
193
- /* @__PURE__ */ jsx(Code, { children: primaryError.executionId }),
194
- /* @__PURE__ */ jsx(CopyButton, { value: `"${organizationName}/${primaryError.resourceId}" ${primaryError.executionId}`, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied" : "Copy Execution Ref", children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "sm", color: copied ? "teal" : "gray", onClick: copy, children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy, { size: 14 }) }) }) }),
195
- /* @__PURE__ */ jsx(
196
- ActionIcon,
197
- {
198
- variant: "subtle",
199
- size: "sm",
200
- component: "a",
201
- href: `/operations/resources/workflow/${primaryError.resourceId}`,
202
- target: "_blank",
203
- title: "View Execution Log",
204
- children: /* @__PURE__ */ jsx(IconExternalLink, { size: 14 })
205
- }
206
- )
207
- ] })
208
- ] }),
209
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
210
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Resource Name" }),
211
- /* @__PURE__ */ jsx(Text, { size: "sm", children: resolvedResourceName })
212
- ] }),
213
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
214
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Resource ID" }),
215
- /* @__PURE__ */ jsx(Code, { children: primaryError.resourceId })
216
- ] }),
217
- primaryError.retryAttempt && /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
218
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Retry Attempt" }),
219
- /* @__PURE__ */ jsx(Badge, { size: "sm", children: primaryError.retryAttempt })
220
- ] }),
221
- primaryError.stepName && /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
222
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Step Name" }),
223
- /* @__PURE__ */ jsx(Text, { size: "sm", children: primaryError.stepName })
224
- ] })
225
- ] })
226
- ] }),
227
- primaryError.stackTrace && /* @__PURE__ */ jsxs("div", { children: [
228
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: "xs", children: [
229
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Stack Trace" }),
230
- /* @__PURE__ */ jsx(CopyButton, { value: primaryError.stackTrace, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied" : "Copy stack trace", children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "sm", onClick: copy, children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy, { size: 14 }) }) }) })
231
- ] }),
232
- /* @__PURE__ */ jsx(
233
- Code,
234
- {
235
- block: true,
236
- style: {
237
- maxHeight: 300,
238
- overflow: "auto",
239
- fontSize: "12px",
240
- lineHeight: "1.5"
241
- },
242
- children: primaryError.stackTrace
243
- }
244
- )
245
- ] }),
246
- primaryError.errorContext && /* @__PURE__ */ jsxs("div", { children: [
247
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, mb: "xs", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Error Context" }),
248
- /* @__PURE__ */ jsx(JsonViewer, { data: primaryError.errorContext, maxHeight: 200, fontSize: "12px" })
249
- ] }),
250
- primaryError.executionContext && /* @__PURE__ */ jsxs("div", { children: [
251
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, mb: "xs", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Execution Context" }),
252
- /* @__PURE__ */ jsx(JsonViewer, { data: primaryError.executionContext, maxHeight: 200, fontSize: "12px" })
253
- ] }),
254
- hasRetries && /* @__PURE__ */ jsxs("div", { children: [
255
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, mb: "xs", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "All Errors (including retries)" }),
256
- /* @__PURE__ */ jsx(Accordion, { children: errors.map((error, index) => /* @__PURE__ */ jsxs(Accordion.Item, { value: error.id, children: [
257
- /* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
258
- /* @__PURE__ */ jsxs(Text, { size: "sm", children: [
259
- "Attempt ",
260
- error.retryAttempt || index + 1,
261
- " - ",
262
- error.errorType
263
- ] }),
264
- /* @__PURE__ */ jsx(
265
- Badge,
266
- {
267
- size: "sm",
268
- color: error.severity === "critical" ? "red" : error.severity === "warning" ? "orange" : "blue",
269
- children: error.severity
270
- }
271
- )
272
- ] }) }),
273
- /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
274
- /* @__PURE__ */ jsx(Text, { size: "sm", children: error.message }),
275
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: new Date(error.timestamp).toLocaleString() }),
276
- error.stackTrace && /* @__PURE__ */ jsx(Code, { block: true, style: { fontSize: "11px", maxHeight: 150, overflow: "auto" }, children: error.stackTrace })
277
- ] }) })
278
- ] }, error.id)) })
279
- ] }),
280
- /* @__PURE__ */ jsx(Divider, {}),
281
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
282
- /* @__PURE__ */ jsxs(Group, { children: [
283
- /* @__PURE__ */ jsx(Button, { variant: "light", leftSection: /* @__PURE__ */ jsx(IconCopy, { size: 16 }), onClick: handleCopyDetails, children: "Copy Error Details" }),
284
- allResolved ? /* @__PURE__ */ jsx(
285
- Badge,
286
- {
287
- size: "lg",
288
- color: "green",
289
- variant: "light",
290
- leftSection: /* @__PURE__ */ jsx(IconCircleCheck, { size: 14 }),
291
- style: { cursor: "default" },
292
- children: "Resolved"
293
- }
294
- ) : /* @__PURE__ */ jsx(
295
- Button,
296
- {
297
- variant: "light",
298
- color: "teal",
299
- leftSection: /* @__PURE__ */ jsx(IconCircleDashed, { size: 16 }),
300
- loading: resolveErrors.isPending,
301
- onClick: () => executionId && resolveErrors.mutate(executionId),
302
- children: "Resolve"
303
- }
304
- )
305
- ] }),
306
- /* @__PURE__ */ jsxs(Group, { children: [
307
- /* @__PURE__ */ jsx(Button, { variant: "default", onClick: onClose, children: "Close" }),
308
- /* @__PURE__ */ jsx(
309
- Button,
310
- {
311
- component: "a",
312
- href: `/operations/resources/workflow/${primaryError.resourceId}`,
313
- target: "_blank",
314
- leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 16 }),
315
- children: "View Execution Log"
316
- }
317
- )
318
- ] })
319
- ] })
320
- ] })
321
- ] }) });
322
- }
323
- function CostAnalytics({ timeRange }) {
324
- const { data: trendsData, isLoading: trendsLoading, error: trendsError } = useCostTrends(timeRange);
325
- const { data: summaryData } = useCostSummary(timeRange);
326
- const { data: modelData, isLoading: modelLoading, error: modelError } = useCostByModel(timeRange);
327
- const { data: breakdownData, isLoading: breakdownLoading, error: breakdownError } = useCostBreakdown(timeRange);
328
- if (trendsLoading) return /* @__PURE__ */ jsx(AppShellLoader, {});
329
- return /* @__PURE__ */ jsxs(Stack, { children: [
330
- /* @__PURE__ */ jsx(
331
- PageTitleCaption,
332
- {
333
- title: "Cost Analytics",
334
- caption: "Comprehensive cost tracking, budgets, ROI analysis, and labor savings"
335
- }
336
- ),
337
- /* @__PURE__ */ jsx(CostTrendChart, { data: trendsData, summaryData, isLoading: trendsLoading, error: trendsError }),
338
- /* @__PURE__ */ jsx(
339
- CostBreakdownCard,
340
- {
341
- breakdownData,
342
- summaryData,
343
- isLoading: breakdownLoading,
344
- error: breakdownError
345
- }
346
- ),
347
- /* @__PURE__ */ jsx(CostByModelTable, { data: modelData, isLoading: modelLoading, error: modelError })
348
- ] });
349
- }
350
- function getNavigationPath(activity) {
351
- switch (activity.activityType) {
352
- case "workflow_execution":
353
- return `/operations/resources/workflow/${activity.entityId}`;
354
- case "agent_run":
355
- return `/operations/resources/agent/${activity.entityId}`;
356
- case "hitl_action":
357
- return "/command-queue";
358
- case "credential_change":
359
- return "/settings/credentials";
360
- case "api_key_change":
361
- return "/settings/api-keys";
362
- case "deployment_change":
363
- return "/settings/deployments";
364
- case "membership_change":
365
- return "/settings/organization";
366
- default:
367
- return null;
368
- }
369
- }
370
- function ActivityLog({ timeRange, pageSize = PAGE_SIZE_DEFAULT, onNavigate }) {
371
- const { filters, updateFilter, resetFilters } = useActivityFilters(timeRange);
372
- const startDate = useMemo(() => {
373
- const { startDate: startDate2 } = getTimeRangeDates(timeRange);
374
- return startDate2;
375
- }, [timeRange]);
376
- const activityType = filters.activityType !== "all" ? filters.activityType : void 0;
377
- const { page, setPage, offset, totalPages } = usePaginationState(pageSize, [
378
- filters.activityType,
379
- filters.status,
380
- filters.search,
381
- timeRange
382
- ]);
383
- const { data: chartData, isLoading: isChartLoading } = useActivityTrend({
384
- activityType,
385
- startDate
386
- });
387
- const tableParams = useMemo(() => {
388
- const params = {
389
- limit: pageSize,
390
- offset,
391
- startDate
392
- };
393
- if (filters.activityType && filters.activityType !== "all") {
394
- params.activityType = filters.activityType;
395
- }
396
- if (filters.status && filters.status !== "all") {
397
- params.status = filters.status;
398
- }
399
- if (filters.search?.trim()) {
400
- params.search = filters.search.trim();
401
- }
402
- return params;
403
- }, [offset, startDate, filters.activityType, filters.status, filters.search, pageSize]);
404
- const { data: tableData, isLoading: isTableLoading } = useActivities(tableParams);
405
- const total = tableData?.total ?? 0;
406
- const handleRowClick = useCallback(
407
- (activity) => {
408
- const path = getNavigationPath(activity);
409
- if (path) {
410
- onNavigate(path);
411
- }
412
- },
413
- [onNavigate]
414
- );
415
- if (isChartLoading && isTableLoading) return /* @__PURE__ */ jsx(AppShellLoader, {});
416
- return /* @__PURE__ */ jsxs(Stack, { children: [
417
- /* @__PURE__ */ jsx(
418
- PageTitleCaption,
419
- {
420
- title: "Activity Log",
421
- caption: "Real-time activity feed with automatic updates every 30 seconds"
422
- }
423
- ),
424
- /* @__PURE__ */ jsx(
425
- ActivityTrendChart,
426
- {
427
- timestamps: chartData?.timestamps ?? [],
428
- total: chartData?.total ?? 0,
429
- isLoading: isChartLoading,
430
- timeRange
431
- }
432
- ),
433
- /* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
434
- /* @__PURE__ */ jsx(ActivityFilters, { filters, onFilterChange: updateFilter, onReset: resetFilters }),
435
- /* @__PURE__ */ jsx(
436
- ActivityTable,
437
- {
438
- activities: tableData?.activities ?? [],
439
- isLoading: isTableLoading,
440
- onRowClick: handleRowClick
441
- }
442
- ),
443
- totalPages(total) > 1 && /* @__PURE__ */ jsx(Group, { justify: "flex-start", children: /* @__PURE__ */ jsx(Pagination, { value: page, onChange: setPage, total: totalPages(total), size: "sm", boundaries: 1 }) })
444
- ] }) })
445
- ] });
446
- }
447
- function ActivityFeed({
448
- limit = 50,
449
- activityType,
450
- entityType,
451
- entityId,
452
- filters,
453
- clientFilters,
454
- overrideData,
455
- overrideLoading
456
- }) {
457
- const [currentLimit, setCurrentLimit] = useState(limit);
458
- const shouldFetch = !overrideData;
459
- const fetchResult = useActivities({
460
- limit: currentLimit,
461
- activityType: filters?.activityType || activityType,
462
- entityType,
463
- entityId,
464
- startDate: filters?.startDate
465
- });
466
- const data = overrideData ?? fetchResult.data;
467
- const error = shouldFetch ? fetchResult.error : null;
468
- const isLoading = overrideLoading ?? (shouldFetch ? fetchResult.isLoading : false);
469
- const handleLoadMore = () => {
470
- setCurrentLimit((prev) => prev + 50);
471
- };
472
- const filteredActivities = useMemo(() => {
473
- if (!data?.activities) return [];
474
- let filtered = data.activities;
475
- if (clientFilters?.status) {
476
- filtered = filtered.filter((activity) => activity.status === clientFilters.status);
477
- }
478
- if (clientFilters?.search) {
479
- const searchLower = clientFilters.search.toLowerCase();
480
- filtered = filtered.filter(
481
- (activity) => activity.title.toLowerCase().includes(searchLower) || activity.description?.toLowerCase().includes(searchLower) || activity.entityName?.toLowerCase().includes(searchLower)
482
- );
483
- }
484
- return filtered;
485
- }, [data?.activities, clientFilters]);
486
- if (isLoading) {
487
- return /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, { size: "md" }) });
488
- }
489
- if (error) {
490
- return /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconInfoCircle, { size: 16 }), title: "Error loading activities", color: "red", children: /* @__PURE__ */ jsx(Text, { size: "sm", children: error instanceof Error ? error.message : "Failed to load activities" }) });
491
- }
492
- if (!filteredActivities.length) {
493
- return /* @__PURE__ */ jsx(EmptyState, { icon: IconActivity, title: "No activities found" });
494
- }
495
- const hasMore = data ? data.total > currentLimit : false;
496
- const showingCount = filteredActivities.length;
497
- const totalCount = data?.total || 0;
498
- return /* @__PURE__ */ jsxs(Stack, { children: [
499
- /* @__PURE__ */ jsx(Group, { justify: "space-between", children: /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
500
- "Showing ",
501
- showingCount,
502
- " of ",
503
- totalCount,
504
- " activities"
505
- ] }) }),
506
- /* @__PURE__ */ jsx(Stack, { children: filteredActivities.map((activity) => /* @__PURE__ */ jsx(ActivityCard, { activity }, activity.id)) }),
507
- hasMore && /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleLoadMore, loading: isLoading, children: "Load More" }) })
508
- ] });
509
- }
510
- function NotificationCenter({ pageSize = 20 }) {
511
- const { page, setPage, offset, totalPages } = usePaginationState(pageSize);
512
- const { data, isLoading } = useNotifications({ limit: pageSize, offset });
513
- const notifications = data?.notifications ?? [];
514
- const markAllAsRead = useMarkAllAsRead();
515
- const testNotification = useTestNotification();
516
- const hasUnread = notifications.some((n) => !n.read);
517
- const handleMarkAllAsRead = async () => {
518
- await markAllAsRead.mutateAsync();
519
- };
520
- const handleCreateTest = async () => {
521
- await testNotification.mutateAsync();
522
- };
523
- const isDevelopment = process.env.NODE_ENV === "development";
524
- return /* @__PURE__ */ jsxs(Fragment, { children: [
525
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
526
- /* @__PURE__ */ jsx(Title, { order: 1, children: "Notifications" }),
527
- /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
528
- isDevelopment && /* @__PURE__ */ jsx(
529
- Button,
530
- {
531
- variant: "light",
532
- size: "sm",
533
- leftSection: /* @__PURE__ */ jsx(IconPlus, { size: 16 }),
534
- onClick: handleCreateTest,
535
- loading: testNotification.isPending,
536
- children: "Create Test Notification"
537
- }
538
- ),
539
- hasUnread && /* @__PURE__ */ jsx(Button, { variant: "light", size: "sm", onClick: handleMarkAllAsRead, loading: markAllAsRead.isPending, children: "Mark all as read" })
540
- ] })
541
- ] }),
542
- /* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsx(NotificationList, { notifications, isLoading }) }),
543
- totalPages(data?.total ?? 0) > 1 && /* @__PURE__ */ jsx(Group, { justify: "flex-start", children: /* @__PURE__ */ jsx(Pagination, { value: page, onChange: setPage, total: totalPages(data?.total ?? 0), size: "sm", boundaries: 1 }) })
544
- ] });
545
- }
546
-
547
- export { ActivityFeed, ActivityLog, CostAnalytics, ErrorDetailsModal, ExecutionHealth, ExecutionLogsPage, NotificationCenter };