@elevasis/ui 2.16.0 → 2.17.2

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 (78) hide show
  1. package/dist/api/index.js +3 -2
  2. package/dist/app/index.js +9 -7
  3. package/dist/auth/index.js +4 -3
  4. package/dist/charts/index.js +11 -10
  5. package/dist/{chunk-DT7ETYBT.js → chunk-2TDZBYXI.js} +3 -3
  6. package/dist/{chunk-5IBTTMWX.js → chunk-34NQLV2W.js} +2 -2
  7. package/dist/{chunk-FL67C3WY.js → chunk-6IA2OMAE.js} +1 -1
  8. package/dist/{chunk-5UQKR27N.js → chunk-7GCWOUFT.js} +32 -9
  9. package/dist/{chunk-LKU4JCPR.js → chunk-7L42RRHZ.js} +5 -4
  10. package/dist/{chunk-L4XXM55J.js → chunk-7YQKVWSD.js} +1 -1
  11. package/dist/{chunk-7MBONWZZ.js → chunk-ABUDMATM.js} +7 -8
  12. package/dist/{chunk-TUXTSEAF.js → chunk-DK2HVHCY.js} +1 -1
  13. package/dist/{chunk-GHIPBT5V.js → chunk-E4WQGJNS.js} +1 -1
  14. package/dist/{chunk-6SHOLCSV.js → chunk-FNWWVX5N.js} +5 -4
  15. package/dist/{chunk-IOKL7BKE.js → chunk-GCBWGGI6.js} +133 -1
  16. package/dist/chunk-GRGRBWIO.js +383 -0
  17. package/dist/{chunk-XNEYUG4B.js → chunk-HH3RNG2O.js} +33 -120
  18. package/dist/{chunk-SLVC5OJ2.js → chunk-HQ7M6PBW.js} +1 -1
  19. package/dist/chunk-IRW7JMQ4.js +28 -0
  20. package/dist/{chunk-C3INGWGK.js → chunk-JU6UB4YA.js} +4 -4
  21. package/dist/{chunk-M2RM3CC4.js → chunk-MDO4UCEJ.js} +4 -4
  22. package/dist/{chunk-STZJ7SY5.js → chunk-MJ6YV2B5.js} +3 -2
  23. package/dist/{chunk-BKSSVQM6.js → chunk-OCCZRPER.js} +1 -1
  24. package/dist/{chunk-ZB5GAV7J.js → chunk-P3TFNFZS.js} +6 -5
  25. package/dist/{chunk-QEPXAWE2.js → chunk-QHSW4WHM.js} +3 -26
  26. package/dist/{chunk-LXHZYSMQ.js → chunk-QSTH6T77.js} +2 -52
  27. package/dist/{chunk-F4VHHW4O.js → chunk-R7GKX4HW.js} +9 -409
  28. package/dist/{chunk-MTJ43R2E.js → chunk-SLH2QLKV.js} +1 -1
  29. package/dist/{chunk-RWFT46RK.js → chunk-TP5NMF6K.js} +6 -7
  30. package/dist/{chunk-SQQGLGHW.js → chunk-TTP62HWW.js} +3 -3
  31. package/dist/{chunk-NVOCKXUQ.js → chunk-VDM6DQES.js} +1 -1
  32. package/dist/chunk-ZTWA5H77.js +94 -0
  33. package/dist/components/index.d.ts +2648 -2642
  34. package/dist/components/index.js +38 -35
  35. package/dist/execution/index.js +2 -2
  36. package/dist/features/auth/index.js +5 -4
  37. package/dist/features/crm/index.d.ts +51 -51
  38. package/dist/features/crm/index.js +21 -19
  39. package/dist/features/dashboard/index.js +23 -21
  40. package/dist/features/delivery/index.d.ts +2604 -2604
  41. package/dist/features/delivery/index.js +21 -19
  42. package/dist/features/lead-gen/index.js +29 -26
  43. package/dist/features/monitoring/index.js +26 -24
  44. package/dist/features/monitoring/requests/index.d.ts +26 -26
  45. package/dist/features/monitoring/requests/index.js +20 -18
  46. package/dist/features/operations/index.d.ts +10 -10
  47. package/dist/features/operations/index.js +28 -25
  48. package/dist/features/seo/index.js +1 -1
  49. package/dist/features/settings/index.d.ts +34 -34
  50. package/dist/features/settings/index.js +22 -20
  51. package/dist/hooks/delivery/index.css +589 -0
  52. package/dist/hooks/delivery/index.d.ts +3044 -0
  53. package/dist/hooks/delivery/index.js +4 -0
  54. package/dist/hooks/index.d.ts +3095 -3095
  55. package/dist/hooks/index.js +20 -18
  56. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +506 -0
  57. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -0
  58. package/dist/hooks/published.d.ts +3095 -3095
  59. package/dist/hooks/published.js +20 -18
  60. package/dist/index.d.ts +3396 -3335
  61. package/dist/index.js +21 -19
  62. package/dist/initialization/index.js +4 -3
  63. package/dist/layout/index.js +3 -3
  64. package/dist/organization/index.js +4 -3
  65. package/dist/profile/index.js +2 -1
  66. package/dist/provider/ElevasisServiceContext.d.ts +54 -0
  67. package/dist/provider/ElevasisServiceContext.js +1 -0
  68. package/dist/provider/index.d.ts +239 -239
  69. package/dist/provider/index.js +17 -16
  70. package/dist/provider/published.d.ts +239 -239
  71. package/dist/provider/published.js +15 -14
  72. package/dist/types/index.d.ts +2349 -2332
  73. package/dist/utils/index.d.ts +73 -1
  74. package/dist/utils/index.js +2 -1
  75. package/dist/zustand/index.d.ts +7 -7
  76. package/package.json +2 -2
  77. package/dist/{chunk-4BF74JVD.js → chunk-6GUW5GGF.js} +1 -1
  78. package/dist/{chunk-ELJIFLCB.js → chunk-KRWALB24.js} +6 -6
@@ -0,0 +1,383 @@
1
+ import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-GCBWGGI6.js';
2
+ import { useElevasisServices } from './chunk-IRW7JMQ4.js';
3
+ import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
4
+ import { notifications } from '@mantine/notifications';
5
+
6
+ var showInfoNotification = (message) => {
7
+ notifications.show({
8
+ title: "Info",
9
+ message,
10
+ autoClose: 5e3,
11
+ color: "blue",
12
+ position: "top-right"
13
+ });
14
+ };
15
+ var showSuccessNotification = (message) => {
16
+ notifications.show({
17
+ title: "Action Successful",
18
+ message,
19
+ autoClose: 5e3,
20
+ color: "green",
21
+ position: "top-right"
22
+ });
23
+ };
24
+ var showErrorNotification = (error) => {
25
+ if (error instanceof Error) {
26
+ error = error.message;
27
+ }
28
+ notifications.show({
29
+ title: "Action Failed",
30
+ message: error,
31
+ autoClose: 5e3,
32
+ color: "red",
33
+ position: "top-right"
34
+ });
35
+ };
36
+ var showWarningNotification = (message) => {
37
+ notifications.show({
38
+ title: "Warning",
39
+ message,
40
+ autoClose: 5e3,
41
+ color: "orange",
42
+ position: "top-right"
43
+ });
44
+ };
45
+ var showApiErrorNotification = (error) => {
46
+ const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
47
+ notifications.show({
48
+ title: getErrorTitle(code),
49
+ message: formatErrorMessage(message, requestId, fields, retryAfter),
50
+ autoClose: retryAfter ? retryAfter * 1e3 : 5e3,
51
+ color: "red",
52
+ position: "top-right"
53
+ });
54
+ };
55
+ var milestoneKeys = {
56
+ all: ["project-milestones"],
57
+ lists: () => [...milestoneKeys.all, "list"],
58
+ list: (orgId, filters) => [...milestoneKeys.all, "list", orgId, filters],
59
+ details: () => [...milestoneKeys.all, "detail"],
60
+ detail: (id) => [...milestoneKeys.all, "detail", id]
61
+ };
62
+ function useMilestones(filters = {}) {
63
+ const { apiRequest, isReady, organizationId } = useElevasisServices();
64
+ return useQuery({
65
+ queryKey: milestoneKeys.list(organizationId, filters),
66
+ queryFn: async () => {
67
+ const res = await apiRequest(`/projects/${filters.projectId}/milestones`);
68
+ return res.milestones;
69
+ },
70
+ enabled: isReady && !!filters.projectId
71
+ });
72
+ }
73
+ function useCreateMilestone() {
74
+ const { apiRequest } = useElevasisServices();
75
+ const queryClient = useQueryClient();
76
+ return useMutation({
77
+ mutationFn: async (params) => {
78
+ const { project_id, ...body } = params;
79
+ if (!project_id) throw new Error("project_id is required to create a milestone");
80
+ const res = await apiRequest(`/projects/${project_id}/milestones`, {
81
+ method: "POST",
82
+ body: JSON.stringify(body)
83
+ });
84
+ return res.milestone;
85
+ },
86
+ onSuccess: (data) => {
87
+ queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
88
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
89
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
90
+ },
91
+ onError: (error) => {
92
+ showApiErrorNotification(error);
93
+ }
94
+ });
95
+ }
96
+ function useUpdateMilestone() {
97
+ const { apiRequest } = useElevasisServices();
98
+ const queryClient = useQueryClient();
99
+ return useMutation({
100
+ mutationFn: async (params) => {
101
+ const res = await apiRequest(`/milestones/${params.id}`, {
102
+ method: "PATCH",
103
+ body: JSON.stringify(params.updates)
104
+ });
105
+ return res.milestone;
106
+ },
107
+ onSuccess: (data) => {
108
+ queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
109
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
110
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
111
+ },
112
+ onError: (error) => {
113
+ showApiErrorNotification(error);
114
+ }
115
+ });
116
+ }
117
+ function useDeleteMilestone() {
118
+ const { apiRequest } = useElevasisServices();
119
+ const queryClient = useQueryClient();
120
+ return useMutation({
121
+ mutationFn: async (params) => {
122
+ await apiRequest(`/milestones/${params.id}`, {
123
+ method: "DELETE"
124
+ });
125
+ },
126
+ onSuccess: (_, params) => {
127
+ queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
128
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
129
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
130
+ },
131
+ onError: (error) => {
132
+ showApiErrorNotification(error);
133
+ }
134
+ });
135
+ }
136
+ var taskKeys = {
137
+ all: ["project-tasks"],
138
+ lists: () => [...taskKeys.all, "list"],
139
+ list: (orgId, filters) => [...taskKeys.all, "list", orgId, filters],
140
+ details: () => [...taskKeys.all, "detail"],
141
+ detail: (id) => [...taskKeys.all, "detail", id]
142
+ };
143
+ function useTasks(filters = {}) {
144
+ const { apiRequest, isReady, organizationId } = useElevasisServices();
145
+ return useQuery({
146
+ queryKey: taskKeys.list(organizationId, filters),
147
+ queryFn: async () => {
148
+ const params = new URLSearchParams();
149
+ if (filters.status) params.set("status", filters.status);
150
+ if (filters.milestoneId) params.set("milestone_id", filters.milestoneId);
151
+ const qs = params.toString();
152
+ const base = `/projects/${filters.projectId}/tasks`;
153
+ const path = qs ? `${base}?${qs}` : base;
154
+ const res = await apiRequest(path);
155
+ return res.tasks;
156
+ },
157
+ enabled: isReady && !!filters.projectId
158
+ });
159
+ }
160
+ function useCreateTask() {
161
+ const { apiRequest } = useElevasisServices();
162
+ const queryClient = useQueryClient();
163
+ return useMutation({
164
+ mutationFn: async (params) => {
165
+ const res = await apiRequest("/project-tasks", {
166
+ method: "POST",
167
+ body: JSON.stringify(params)
168
+ });
169
+ return res.task;
170
+ },
171
+ onSuccess: (data) => {
172
+ queryClient.invalidateQueries({ queryKey: taskKeys.all });
173
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
174
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
175
+ },
176
+ onError: (error) => {
177
+ showApiErrorNotification(error);
178
+ }
179
+ });
180
+ }
181
+ function useUpdateTask() {
182
+ const { apiRequest } = useElevasisServices();
183
+ const queryClient = useQueryClient();
184
+ return useMutation({
185
+ mutationFn: async (params) => {
186
+ const res = await apiRequest(`/project-tasks/${params.id}`, {
187
+ method: "PATCH",
188
+ body: JSON.stringify(params.updates)
189
+ });
190
+ return res.task;
191
+ },
192
+ onSuccess: (data) => {
193
+ queryClient.invalidateQueries({ queryKey: taskKeys.all });
194
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
195
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
196
+ },
197
+ onError: (error) => {
198
+ showApiErrorNotification(error);
199
+ }
200
+ });
201
+ }
202
+ function useDeleteTask() {
203
+ const { apiRequest } = useElevasisServices();
204
+ const queryClient = useQueryClient();
205
+ return useMutation({
206
+ mutationFn: async (params) => {
207
+ await apiRequest(`/project-tasks/${params.id}`, {
208
+ method: "DELETE"
209
+ });
210
+ },
211
+ onSuccess: (_, params) => {
212
+ queryClient.invalidateQueries({ queryKey: taskKeys.all });
213
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
214
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
215
+ },
216
+ onError: (error) => {
217
+ showApiErrorNotification(error);
218
+ }
219
+ });
220
+ }
221
+ var noteKeys = {
222
+ all: ["project-notes"],
223
+ lists: () => [...noteKeys.all, "list"],
224
+ list: (orgId, filters) => [...noteKeys.all, "list", orgId, filters],
225
+ details: () => [...noteKeys.all, "detail"],
226
+ detail: (id) => [...noteKeys.all, "detail", id]
227
+ };
228
+ function useProjectNotes(filters = {}) {
229
+ const { apiRequest, isReady, organizationId } = useElevasisServices();
230
+ return useQuery({
231
+ queryKey: noteKeys.list(organizationId, filters),
232
+ queryFn: async () => {
233
+ const res = await apiRequest(`/projects/${filters.projectId}/notes`);
234
+ return res.notes;
235
+ },
236
+ enabled: isReady && !!filters.projectId
237
+ });
238
+ }
239
+ function useCreateNote() {
240
+ const { apiRequest } = useElevasisServices();
241
+ const queryClient = useQueryClient();
242
+ return useMutation({
243
+ mutationFn: async (params) => {
244
+ const res = await apiRequest("/project-notes", {
245
+ method: "POST",
246
+ body: JSON.stringify(params)
247
+ });
248
+ return res.note;
249
+ },
250
+ onSuccess: (data) => {
251
+ queryClient.invalidateQueries({ queryKey: noteKeys.all });
252
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
253
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
254
+ },
255
+ onError: (error) => {
256
+ showApiErrorNotification(error);
257
+ }
258
+ });
259
+ }
260
+
261
+ // src/hooks/delivery/useProjects.ts
262
+ var projectKeys = {
263
+ all: ["projects"],
264
+ lists: () => [...projectKeys.all, "list"],
265
+ list: (orgId, filters) => [...projectKeys.all, "list", orgId, filters],
266
+ details: () => [...projectKeys.all, "detail"],
267
+ detail: (id) => [...projectKeys.all, "detail", id],
268
+ milestones: (id) => [...projectKeys.all, id, "milestones"],
269
+ tasks: (id) => [...projectKeys.all, id, "tasks"]
270
+ };
271
+ function useProjects(filters = {}) {
272
+ const { apiRequest, isReady, organizationId } = useElevasisServices();
273
+ return useQuery({
274
+ queryKey: projectKeys.list(organizationId, filters),
275
+ queryFn: async () => {
276
+ const params = new URLSearchParams();
277
+ if (filters.kind) params.set("kind", filters.kind);
278
+ const qs = params.toString();
279
+ const path = qs ? `/projects?${qs}` : "/projects";
280
+ const res = await apiRequest(path);
281
+ return res.projects;
282
+ },
283
+ enabled: isReady
284
+ });
285
+ }
286
+ function useProject(id) {
287
+ const { apiRequest, isReady, organizationId } = useElevasisServices();
288
+ return useQuery({
289
+ queryKey: [...projectKeys.detail(id), organizationId],
290
+ queryFn: async () => {
291
+ try {
292
+ const res = await apiRequest(`/projects/${id}`);
293
+ return res.project;
294
+ } catch (err) {
295
+ if (err && typeof err === "object" && "statusCode" in err && err.statusCode === 404) {
296
+ return null;
297
+ }
298
+ throw err;
299
+ }
300
+ },
301
+ enabled: isReady && !!id
302
+ });
303
+ }
304
+ function useProjectMilestones(projectId) {
305
+ const { apiRequest, isReady } = useElevasisServices();
306
+ return useQuery({
307
+ queryKey: projectKeys.milestones(projectId),
308
+ queryFn: async () => {
309
+ const res = await apiRequest(`/projects/${projectId}/milestones`);
310
+ return res.milestones;
311
+ },
312
+ enabled: isReady && !!projectId
313
+ });
314
+ }
315
+ function useProjectTasks(projectId) {
316
+ const { apiRequest, isReady } = useElevasisServices();
317
+ return useQuery({
318
+ queryKey: projectKeys.tasks(projectId),
319
+ queryFn: async () => {
320
+ const res = await apiRequest(`/projects/${projectId}/tasks`);
321
+ return res.tasks;
322
+ },
323
+ enabled: isReady && !!projectId
324
+ });
325
+ }
326
+ function useCreateProject() {
327
+ const { apiRequest } = useElevasisServices();
328
+ const queryClient = useQueryClient();
329
+ return useMutation({
330
+ mutationFn: async (params) => {
331
+ const res = await apiRequest("/projects", {
332
+ method: "POST",
333
+ body: JSON.stringify(params)
334
+ });
335
+ return res.project;
336
+ },
337
+ onSuccess: () => {
338
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
339
+ },
340
+ onError: (error) => {
341
+ showApiErrorNotification(error);
342
+ }
343
+ });
344
+ }
345
+ function useUpdateProject() {
346
+ const { apiRequest } = useElevasisServices();
347
+ const queryClient = useQueryClient();
348
+ return useMutation({
349
+ mutationFn: async (params) => {
350
+ const res = await apiRequest(`/projects/${params.id}`, {
351
+ method: "PATCH",
352
+ body: JSON.stringify(params.updates)
353
+ });
354
+ return res.project;
355
+ },
356
+ onSuccess: (data) => {
357
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
358
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.id) });
359
+ },
360
+ onError: (error) => {
361
+ showApiErrorNotification(error);
362
+ }
363
+ });
364
+ }
365
+ function useDeleteProject() {
366
+ const { apiRequest } = useElevasisServices();
367
+ const queryClient = useQueryClient();
368
+ return useMutation({
369
+ mutationFn: async (id) => {
370
+ await apiRequest(`/projects/${id}`, {
371
+ method: "DELETE"
372
+ });
373
+ },
374
+ onSuccess: () => {
375
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
376
+ },
377
+ onError: (error) => {
378
+ showApiErrorNotification(error);
379
+ }
380
+ });
381
+ }
382
+
383
+ export { milestoneKeys, noteKeys, projectKeys, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, taskKeys, useCreateMilestone, useCreateNote, useCreateProject, useCreateTask, useDeleteMilestone, useDeleteProject, useDeleteTask, useMilestones, useProject, useProjectMilestones, useProjectNotes, useProjectTasks, useProjects, useTasks, useUpdateMilestone, useUpdateProject, useUpdateTask };
@@ -1,28 +1,29 @@
1
1
  import { ChatHeader, ChatSidebar } from './chunk-ROSMICXG.js';
2
2
  import { SubshellLoader } from './chunk-ADSSLKKP.js';
3
- import { ResourceHealthPanel } from './chunk-C3INGWGK.js';
3
+ import { BaseNode, useGraphTheme, BaseEdge, FormFieldRenderer, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-ABUDMATM.js';
4
+ import { ResourceHealthPanel } from './chunk-JU6UB4YA.js';
5
+ import { useCyberColors, CyberDonut } from './chunk-MJ6YV2B5.js';
6
+ import { AppShellLoader } from './chunk-M25JL54Z.js';
4
7
  import { PageContainer } from './chunk-BZZCNLT6.js';
5
8
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
6
9
  import { CustomModal, ConfirmationModal } from './chunk-GBMNCNHX.js';
7
- import { BaseNode, useGraphTheme, BaseEdge, FormFieldRenderer, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-7MBONWZZ.js';
8
- import { useCyberColors, CyberDonut } from './chunk-STZJ7SY5.js';
9
- import { AppShellLoader } from './chunk-M25JL54Z.js';
10
- import { getResourceStatusColor, useTimelineData, useAgentIterationData, getStatusIcon } from './chunk-GHIPBT5V.js';
11
- import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, showApiErrorNotification, showSuccessNotification, useBulkDeleteExecutions } from './chunk-F4VHHW4O.js';
10
+ import { getResourceStatusColor, useTimelineData, useAgentIterationData, getStatusIcon } from './chunk-E4WQGJNS.js';
11
+ import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions } from './chunk-R7GKX4HW.js';
12
+ import { showApiErrorNotification, showSuccessNotification } from './chunk-GRGRBWIO.js';
12
13
  import { useGraphHighlighting, calculateGraphHeight, Graph_module_css_default, GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
13
14
  import { useMergedExecution } from './chunk-3ZMAGTWF.js';
14
- import { useOptionalElevasisFeatures, useElevasisFeatures } from './chunk-DT7ETYBT.js';
15
+ import { useOptionalElevasisFeatures, useElevasisFeatures } from './chunk-2TDZBYXI.js';
15
16
  import { SubshellContentContainer } from './chunk-RX4UWZZR.js';
16
- import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-SQQGLGHW.js';
17
+ import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-TTP62HWW.js';
17
18
  import { StyledMarkdown } from './chunk-3KMDHCAR.js';
18
19
  import { NavigationButton } from './chunk-NYBEU5TE.js';
19
- import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-ELJIFLCB.js';
20
+ import { useRouterContext } from './chunk-Q7DJKLEN.js';
20
21
  import { useAppearance } from './chunk-QJ2KCHKX.js';
21
22
  import { topbarHeight } from './chunk-DT3QYZVU.js';
22
- import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime, DOMAIN_MAP, getNodeId, PAGE_SIZE_DEFAULT } from './chunk-IOKL7BKE.js';
23
- import { useInitialization } from './chunk-TUXTSEAF.js';
23
+ import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime, DOMAIN_MAP, getNodeId, PAGE_SIZE_DEFAULT, debounce } from './chunk-GCBWGGI6.js';
24
+ import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-KRWALB24.js';
25
+ import { useInitialization } from './chunk-DK2HVHCY.js';
24
26
  import { useOrganization } from './chunk-DD3CCMCZ.js';
25
- import { useRouterContext } from './chunk-Q7DJKLEN.js';
26
27
  import { z } from 'zod';
27
28
  import { Stack, Group, Text, Badge, Title, Textarea, Alert, Button, ActionIcon, Collapse, Card, ThemeIcon, SimpleGrid, Divider, Paper, Space, CopyButton, Center, Tooltip, Code, Menu, useMantineTheme, UnstyledButton, Select, RangeSlider, Loader, Box, Progress, Tabs, Pagination, TextInput, Modal, LoadingOverlay, SegmentedControl, Switch, ScrollArea, MultiSelect } from '@mantine/core';
28
29
  import { IconBrain, IconFileText, IconMail, IconSend, IconClock, IconArrowUp, IconMessageCircle, IconRocket, IconEye, IconEdit, IconAlertTriangle, IconRefresh, IconX, IconCheck, IconCode, IconAlertCircle, IconChevronRight, IconTool, IconSettings, IconCpu, IconClockHour4, IconVersions, IconPlayerPlay, IconNetwork, IconSitemap, IconCopy, IconPlayerStop, IconReload, IconTrash, IconTerminal2, IconBug, IconChevronDown, IconMessage, IconArrowLeft, IconRobot, IconGitBranch, IconDotsVertical, IconFilter, IconCircleCheck, IconCategory, IconDatabase, IconApps, IconRoute, IconAdjustmentsHorizontal, IconSearch, IconCircleX, IconCircleDashed, IconExternalLink, IconTopologyStar3, IconInfoCircle, IconPlus, IconLayoutSidebarRightExpand, IconNote, IconArchive, IconDownload, IconTimeline, IconActivityHeartbeat, IconClockPause, IconArrowsMaximize, IconShare2, IconHistory } from '@tabler/icons-react';
@@ -39,26 +40,6 @@ import cytoscape from 'cytoscape';
39
40
  import { create } from 'zustand';
40
41
  import { formatDistanceToNow } from 'date-fns';
41
42
 
42
- // ../core/src/platform/utils/debounce.ts
43
- function debounce(fn, wait) {
44
- let timeoutId = null;
45
- const debounced = (...args) => {
46
- if (timeoutId !== null) {
47
- clearTimeout(timeoutId);
48
- }
49
- timeoutId = setTimeout(() => {
50
- fn(...args);
51
- timeoutId = null;
52
- }, wait);
53
- };
54
- debounced.cancel = () => {
55
- if (timeoutId !== null) {
56
- clearTimeout(timeoutId);
57
- timeoutId = null;
58
- }
59
- };
60
- return debounced;
61
- }
62
43
  var ModelIdSchema = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "IDs must be lowercase and use -, _, or . separators");
63
44
  var LabelSchema = z.string().trim().min(1).max(120);
64
45
  var DescriptionSchema = z.string().trim().min(1).max(2e3);
@@ -2394,9 +2375,19 @@ var ResourceFilter = ({ value, onChange, fullWidth }) => {
2394
2375
  )
2395
2376
  ] });
2396
2377
  };
2397
- function ResourceHeader({ resource, type, connected, runningCount, sessionCapable }) {
2378
+ function ResourceHeader({
2379
+ resource,
2380
+ type,
2381
+ connected,
2382
+ runningCount,
2383
+ sessionCapable,
2384
+ organizationName: organizationNameProp,
2385
+ onRun,
2386
+ onNavigateToResources,
2387
+ onNavigateToSessions
2388
+ }) {
2398
2389
  const { currentMembership } = useOrganization();
2399
- const organizationName = currentMembership?.organization?.name;
2390
+ const organizationName = organizationNameProp ?? currentMembership?.organization?.name;
2400
2391
  const navigate = useNavigate();
2401
2392
  const Icon = getResourceIcon(type);
2402
2393
  const clipboard = useClipboard({ timeout: 2e3 });
@@ -2407,12 +2398,11 @@ function ResourceHeader({ resource, type, connected, runningCount, sessionCapabl
2407
2398
  color: "teal"
2408
2399
  });
2409
2400
  };
2410
- const handleGoToSessions = () => {
2411
- navigate({
2412
- to: "/operations/sessions",
2413
- search: { agent: resource.resourceId }
2414
- });
2415
- };
2401
+ const handleGoToSessions = onNavigateToSessions ?? (() => navigate({
2402
+ to: "/operations/sessions",
2403
+ search: { agent: resource.resourceId }
2404
+ }));
2405
+ const handleGoToResources = onNavigateToResources ?? (() => navigate({ to: "/operations/resources" }));
2416
2406
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2417
2407
  /* @__PURE__ */ jsx(
2418
2408
  PageTitleCaption,
@@ -2448,17 +2438,9 @@ function ResourceHeader({ resource, type, connected, runningCount, sessionCapabl
2448
2438
  runningCount,
2449
2439
  " running"
2450
2440
  ] }),
2441
+ onRun && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "filled", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 16 }), onClick: onRun, children: "Run" }),
2451
2442
  type === "agent" && sessionCapable && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconMessage, { size: 16 }), onClick: handleGoToSessions, children: "Go to Sessions" }),
2452
- /* @__PURE__ */ jsx(
2453
- Button,
2454
- {
2455
- size: "sm",
2456
- variant: "light",
2457
- leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
2458
- onClick: () => navigate({ to: "/operations/resources" }),
2459
- children: "Resources"
2460
- }
2461
- )
2443
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }), onClick: handleGoToResources, children: "Resources" })
2462
2444
  ] })
2463
2445
  ] })
2464
2446
  ] });
@@ -3728,75 +3710,6 @@ function ResourcesSidebar({ timeRange }) {
3728
3710
  ] })
3729
3711
  ] });
3730
3712
  }
3731
- function ResourceHeader2({
3732
- resource,
3733
- type,
3734
- connected,
3735
- runningCount,
3736
- sessionCapable,
3737
- onRun,
3738
- onNavigateToResources,
3739
- onNavigateToSessions
3740
- }) {
3741
- const { currentMembership } = useOrganization();
3742
- const organizationName = currentMembership?.organization?.name;
3743
- const navigate = useNavigate();
3744
- const Icon = getResourceIcon(type);
3745
- const clipboard = useClipboard({ timeout: 2e3 });
3746
- const handleCopyId = () => {
3747
- clipboard.copy(`"${organizationName}/${resource.resourceId}"`);
3748
- notifications.show({
3749
- message: "Resource ID copied to clipboard",
3750
- color: "teal"
3751
- });
3752
- };
3753
- const handleGoToSessions = onNavigateToSessions ?? (() => navigate({
3754
- to: "/operations/sessions",
3755
- search: { agent: resource.resourceId }
3756
- }));
3757
- const handleGoToResources = onNavigateToResources ?? (() => navigate({ to: "/operations/resources" }));
3758
- return /* @__PURE__ */ jsxs(Fragment, { children: [
3759
- /* @__PURE__ */ jsx(
3760
- PageTitleCaption,
3761
- {
3762
- title: resource.name,
3763
- caption: resource.description || `${type.charAt(0).toUpperCase()}${type.slice(1)} details`
3764
- }
3765
- ),
3766
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
3767
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
3768
- /* @__PURE__ */ jsx(Icon, { size: 20, color: "var(--color-primary)" }),
3769
- /* @__PURE__ */ jsxs(Badge, { color: "blue", variant: "light", children: [
3770
- type.charAt(0).toUpperCase(),
3771
- type.slice(1)
3772
- ] }),
3773
- /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resource.status], variant: "outline", size: "sm", children: resource.status.toUpperCase() }),
3774
- resource.version && /* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "sm", children: [
3775
- "v",
3776
- resource.version
3777
- ] }),
3778
- /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
3779
- /* @__PURE__ */ jsxs(Text, { size: "sm", ff: "monospace", c: "dimmed", children: [
3780
- organizationName,
3781
- "/",
3782
- resource.resourceId
3783
- ] }),
3784
- /* @__PURE__ */ jsx(Tooltip, { label: clipboard.copied ? "Copied!" : "Copy ID", children: /* @__PURE__ */ jsx(ActionIcon, { size: "sm", variant: "subtle", onClick: handleCopyId, color: clipboard.copied ? "teal" : "gray", children: /* @__PURE__ */ jsx(IconCopy, { size: 14, color: clipboard.copied ? "teal" : "gray" }) }) })
3785
- ] })
3786
- ] }),
3787
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
3788
- connected && /* @__PURE__ */ jsx(Badge, { color: "green", variant: "dot", children: "CONNECTED" }),
3789
- runningCount && runningCount > 0 && /* @__PURE__ */ jsxs(Badge, { color: "blue", variant: "filled", children: [
3790
- runningCount,
3791
- " running"
3792
- ] }),
3793
- onRun && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "filled", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 16 }), onClick: onRun, children: "Run" }),
3794
- type === "agent" && sessionCapable && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconMessage, { size: 16 }), onClick: handleGoToSessions, children: "Go to Sessions" }),
3795
- /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }), onClick: handleGoToResources, children: "Resources" })
3796
- ] })
3797
- ] })
3798
- ] });
3799
- }
3800
3713
  function ResourceErrorState2({ error }) {
3801
3714
  return /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", children: [
3802
3715
  /* @__PURE__ */ jsx(Text, { c: "red", children: "Failed to load resource" }),
@@ -4041,7 +3954,7 @@ function ResourceDetailPage({
4041
3954
  ),
4042
3955
  /* @__PURE__ */ jsxs(Stack, { children: [
4043
3956
  /* @__PURE__ */ jsx(
4044
- ResourceHeader2,
3957
+ ResourceHeader,
4045
3958
  {
4046
3959
  resource: validResource,
4047
3960
  type,
@@ -1,4 +1,4 @@
1
- import { useUserProfile } from './chunk-QEPXAWE2.js';
1
+ import { useUserProfile } from './chunk-QHSW4WHM.js';
2
2
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
3
3
  import { useMemo, useCallback } from 'react';
4
4
 
@@ -0,0 +1,28 @@
1
+ import { createContext, useContext, useMemo } from 'react';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ // src/provider/ElevasisServiceContext.tsx
5
+ var ElevasisServiceContext = createContext(null);
6
+ function useElevasisServices() {
7
+ const ctx = useContext(ElevasisServiceContext);
8
+ if (!ctx) {
9
+ throw new Error(
10
+ "useElevasisServices must be used within an ElevasisServiceProvider or an ElevasisUIProvider with apiUrl configured."
11
+ );
12
+ }
13
+ return ctx;
14
+ }
15
+ function ElevasisServiceProvider({
16
+ apiRequest,
17
+ organizationId,
18
+ isReady,
19
+ children
20
+ }) {
21
+ const value = useMemo(
22
+ () => ({ apiRequest, organizationId, isReady }),
23
+ [apiRequest, organizationId, isReady]
24
+ );
25
+ return /* @__PURE__ */ jsx(ElevasisServiceContext.Provider, { value, children });
26
+ }
27
+
28
+ export { ElevasisServiceContext, ElevasisServiceProvider, useElevasisServices };
@@ -1,7 +1,7 @@
1
- import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-STZJ7SY5.js';
2
- import { useResourcesHealth } from './chunk-F4VHHW4O.js';
3
- import { getTimeRangeDates, formatBucketTime } from './chunk-LXHZYSMQ.js';
4
- import { CardHeader, EmptyState } from './chunk-SQQGLGHW.js';
1
+ import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-MJ6YV2B5.js';
2
+ import { useResourcesHealth } from './chunk-R7GKX4HW.js';
3
+ import { CardHeader, EmptyState } from './chunk-TTP62HWW.js';
4
+ import { getTimeRangeDates, formatBucketTime } from './chunk-GCBWGGI6.js';
5
5
  import { Paper, Center, Loader, Group } from '@mantine/core';
6
6
  import { IconActivity, IconChartBar } from '@tabler/icons-react';
7
7
  import { useMemo } from 'react';
@@ -4,12 +4,12 @@ import { SubshellNavItem } from './chunk-CEWTOKE7.js';
4
4
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
5
5
  import { FilterBar } from './chunk-PDHTXPSF.js';
6
6
  import { CustomModal } from './chunk-GBMNCNHX.js';
7
- import { useDealTasksDue, useDeals, useCreateDealTask, useDeleteDeal, useTableSort, sortData, usePaginationState, useTableSelection, useDealDetail, useCompany } from './chunk-F4VHHW4O.js';
7
+ import { useDealTasksDue, useDeals, useCreateDealTask, useDeleteDeal, useTableSort, sortData, usePaginationState, useTableSelection, useDealDetail, useCompany } from './chunk-R7GKX4HW.js';
8
8
  import { SubshellContentContainer } from './chunk-RX4UWZZR.js';
9
- import { CenteredErrorState, CardHeader, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-SQQGLGHW.js';
10
- import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-IOKL7BKE.js';
11
- import { useElevasisServices } from './chunk-QEPXAWE2.js';
9
+ import { CenteredErrorState, CardHeader, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-TTP62HWW.js';
12
10
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
11
+ import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-GCBWGGI6.js';
12
+ import { useElevasisServices } from './chunk-IRW7JMQ4.js';
13
13
  import { Box, Stack, Group, Text, Badge, Center, Loader, UnstyledButton, Button, Modal, Title, Select, TextInput, Textarea, Paper, Alert, SimpleGrid, Table, Checkbox, Pagination, ActionIcon, Tabs, Card, Code, Divider, Anchor } from '@mantine/core';
14
14
  import { IconLayoutGrid, IconColumns, IconFileInvoice, IconAddressBook, IconTrophy, IconClockExclamation, IconUser, IconPlus, IconChecklist, IconAlertCircle, IconHistory, IconSearch, IconTargetArrow, IconAlertTriangle, IconArrowLeft, IconFileText, IconTrash, IconX, IconBuilding, IconCheckbox, IconCalendar, IconMail, IconPhone, IconArrowRight, IconNote } from '@tabler/icons-react';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,5 +1,6 @@
1
- import { getTimeRangeLabel, getTimeRangeDates, useErrorTrends, formatBucketTime } from './chunk-LXHZYSMQ.js';
2
- import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-SQQGLGHW.js';
1
+ import { useErrorTrends } from './chunk-QSTH6T77.js';
2
+ import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-TTP62HWW.js';
3
+ import { getTimeRangeLabel, getTimeRangeDates, formatBucketTime } from './chunk-GCBWGGI6.js';
3
4
  import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback } from 'react';
4
5
  import { jsx, jsxs } from 'react/jsx-runtime';
5
6
  import { useComputedColorScheme, Group, Text, Box, Stack, Center, Loader, Paper, Button, NumberFormatter, Badge, Space, Tooltip as Tooltip$1, SimpleGrid, Alert, SegmentedControl } from '@mantine/core';