@elevasis/ui 2.73.0 → 2.74.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 (97) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/app/index.d.ts +58 -0
  3. package/dist/app/index.js +9 -10
  4. package/dist/auth/index.js +5 -6
  5. package/dist/charts/index.js +5 -6
  6. package/dist/chunk-2GIJBHZT.js +60 -0
  7. package/dist/{chunk-ETN3TTRT.js → chunk-2MRRDF32.js} +115 -8
  8. package/dist/chunk-3LOKYZJC.js +231 -0
  9. package/dist/chunk-3QHX4ZKV.js +224 -0
  10. package/dist/chunk-43LC6XAX.js +69 -0
  11. package/dist/chunk-4M2BSHVT.js +116 -0
  12. package/dist/{chunk-SWKAH2YM.js → chunk-4MXNHJTA.js} +63 -30
  13. package/dist/{chunk-LZT2H2MA.js → chunk-5A6KCFS5.js} +36 -43
  14. package/dist/{chunk-OCVSPAKM.js → chunk-6JN2TLV2.js} +1150 -4346
  15. package/dist/{chunk-JYBJMVNY.js → chunk-7ARBBELS.js} +1 -1
  16. package/dist/{chunk-AJOVWB47.js → chunk-7RJ7P6S6.js} +6 -3
  17. package/dist/chunk-ARAFQBNI.js +515 -0
  18. package/dist/{chunk-Z4ICFQXG.js → chunk-BA3AZJUR.js} +1 -1
  19. package/dist/chunk-BRTGCFBH.js +305 -0
  20. package/dist/{chunk-IGBPWD6S.js → chunk-CQPULKKL.js} +5 -3
  21. package/dist/chunk-CRA7WQZH.js +49 -0
  22. package/dist/{chunk-U2H3TIHD.js → chunk-DCQKTDIG.js} +2 -52
  23. package/dist/{chunk-3TS5U5BL.js → chunk-E6YGA5WH.js} +1 -1
  24. package/dist/chunk-FA7LMNQO.js +439 -0
  25. package/dist/chunk-FZSG6M6W.js +45 -0
  26. package/dist/chunk-GDOR57D7.js +165 -0
  27. package/dist/{chunk-CJ2232PQ.js → chunk-GO4XJ5D4.js} +1 -1
  28. package/dist/chunk-GPQQGQGT.js +645 -0
  29. package/dist/chunk-HYQOGRWG.js +54 -0
  30. package/dist/{chunk-LEPYXLJ2.js → chunk-LN4UW6S4.js} +1 -1
  31. package/dist/chunk-N6K2Q5BM.js +393 -0
  32. package/dist/{chunk-NHNTX6ZL.js → chunk-O32UQ26A.js} +3 -2
  33. package/dist/{chunk-M7WWRZ5Z.js → chunk-QFGNRKIE.js} +1 -78
  34. package/dist/{chunk-IBCEAVB2.js → chunk-R5UGIFYU.js} +41 -5
  35. package/dist/{chunk-5B2ZFO44.js → chunk-RFNJ2PTO.js} +1 -1
  36. package/dist/chunk-VM2OWOXL.js +24 -0
  37. package/dist/{chunk-ZDKPHFTH.js → chunk-W2QRBQQA.js} +5 -3
  38. package/dist/chunk-WDBNW44Z.js +49 -0
  39. package/dist/{chunk-4CW2C5BD.js → chunk-WZU3MCKI.js} +1 -1
  40. package/dist/chunk-YQQ5GRUR.js +21 -0
  41. package/dist/{chunk-PQ4B62HH.js → chunk-ZFA56VSR.js} +2 -2
  42. package/dist/{chunk-NI37YNRP.js → chunk-ZWI62BQ6.js} +7 -4
  43. package/dist/chunk-ZYNVCWDZ.js +286 -0
  44. package/dist/components/index.d.ts +187 -2
  45. package/dist/components/index.js +44 -34
  46. package/dist/components/navigation/index.js +6 -7
  47. package/dist/features/auth/index.d.ts +78 -2
  48. package/dist/features/auth/index.js +18 -9
  49. package/dist/features/clients/index.js +7 -7
  50. package/dist/features/content/index.d.ts +226 -5
  51. package/dist/features/content/index.js +263 -15
  52. package/dist/features/crm/index.d.ts +58 -0
  53. package/dist/features/crm/index.js +10 -8
  54. package/dist/features/dashboard/index.js +9 -8
  55. package/dist/features/delivery/index.d.ts +58 -0
  56. package/dist/features/delivery/index.js +23 -7
  57. package/dist/features/knowledge/index.js +5 -6
  58. package/dist/features/lead-gen/index.d.ts +9 -15
  59. package/dist/features/lead-gen/index.js +12 -8
  60. package/dist/features/monitoring/index.js +11 -9
  61. package/dist/features/monitoring/requests/index.js +8 -7
  62. package/dist/features/operations/index.js +15 -11
  63. package/dist/features/public-agent-chat/index.js +3 -1
  64. package/dist/features/settings/index.d.ts +58 -0
  65. package/dist/features/settings/index.js +9 -8
  66. package/dist/hooks/access/index.js +5 -6
  67. package/dist/hooks/delivery/index.d.ts +58 -0
  68. package/dist/hooks/delivery/index.js +3 -2
  69. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +1 -1
  70. package/dist/hooks/published.d.ts +175 -3
  71. package/dist/hooks/published.js +22 -6
  72. package/dist/initialization/index.d.ts +58 -0
  73. package/dist/knowledge/index.js +167 -11
  74. package/dist/{knowledge-search-index-RZLIVWPJ.js → knowledge-search-index-6GQK55IQ.js} +1 -1
  75. package/dist/layout/index.js +8 -9
  76. package/dist/profile/index.d.ts +58 -0
  77. package/dist/provider/index.d.ts +77 -1
  78. package/dist/provider/index.js +5 -6
  79. package/dist/provider/published.d.ts +105 -1
  80. package/dist/provider/published.js +5 -6
  81. package/dist/test-utils/index.d.ts +16 -5
  82. package/dist/test-utils/index.js +17 -18
  83. package/dist/types/index.d.ts +59 -1
  84. package/dist/utils/index.d.ts +83 -3
  85. package/dist/utils/index.js +1 -1
  86. package/package.json +6 -5
  87. package/dist/chunk-6M6OLGQY.js +0 -36
  88. package/dist/chunk-MKH2KOAO.js +0 -39
  89. package/dist/hooks/index.css +0 -659
  90. package/dist/hooks/index.d.ts +0 -14073
  91. package/dist/hooks/index.js +0 -27
  92. package/dist/supabase/index.d.ts +0 -7118
  93. package/dist/supabase/index.js +0 -3
  94. package/dist/typeform/index.d.ts +0 -462
  95. package/dist/typeform/index.js +0 -2051
  96. package/dist/typeform/schemas.d.ts +0 -67
  97. package/dist/typeform/schemas.js +0 -2
@@ -0,0 +1,393 @@
1
+ import { REFETCH_INTERVAL_DASHBOARD } from './chunk-Y6I3IC45.js';
2
+ import { useElevasisServices } from './chunk-BI5VDO2K.js';
3
+ import { ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, UuidSchema } from './chunk-TVTSASST.js';
4
+ import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
5
+ import { z } from 'zod';
6
+
7
+ var RelativeScheduleItemSchema = z.object({
8
+ offset: z.string().regex(/^[+-]\d+[dhm]$/, "Invalid offset format. Use +3d, -2h, +30m, etc."),
9
+ payload: z.record(z.string(), z.unknown()),
10
+ label: z.string().optional()
11
+ });
12
+ var AbsoluteScheduleItemSchema = z.object({
13
+ runAt: z.string().datetime({ message: "Invalid datetime format" }),
14
+ payload: z.record(z.string(), z.unknown()),
15
+ label: z.string().optional()
16
+ });
17
+ var RecurringScheduleConfigSchema = z.object({
18
+ type: z.literal("recurring"),
19
+ cron: z.string().optional(),
20
+ interval: z.enum(["daily", "weekly", "monthly"]).optional(),
21
+ time: z.string().regex(/^\d{2}:\d{2}$/, "Time must be in HH:MM format").optional(),
22
+ timezone: z.string().min(1, "Timezone is required"),
23
+ payload: z.record(z.string(), z.unknown()),
24
+ endAt: z.string().datetime().nullable().optional(),
25
+ overduePolicy: z.enum(["skip", "execute"]).optional()
26
+ }).refine((data) => data.cron || data.interval, { message: "Either cron or interval must be provided" });
27
+ var RelativeScheduleConfigSchema = z.object({
28
+ type: z.literal("relative"),
29
+ anchorAt: z.string().datetime({ message: "Invalid anchor datetime" }),
30
+ anchorLabel: z.string().optional(),
31
+ items: z.array(RelativeScheduleItemSchema).min(1, "At least one item required"),
32
+ overduePolicy: z.enum(["skip", "execute"]).optional()
33
+ });
34
+ var AbsoluteScheduleConfigSchema = z.object({
35
+ type: z.literal("absolute"),
36
+ items: z.array(AbsoluteScheduleItemSchema).min(1, "At least one item required"),
37
+ overduePolicy: z.enum(["skip", "execute"]).optional()
38
+ });
39
+ var TaskScheduleConfigSchema = z.discriminatedUnion("type", [
40
+ RecurringScheduleConfigSchema,
41
+ RelativeScheduleConfigSchema,
42
+ AbsoluteScheduleConfigSchema
43
+ ]);
44
+ var ScheduleTargetSchema = z.object({
45
+ resourceType: ResourceTypeSchema,
46
+ resourceId: NonEmptyStringSchema.max(255)
47
+ });
48
+ var OptionalOriginTrackingSchema = z.object({
49
+ originExecutionId: UuidSchema.optional(),
50
+ originResourceType: OriginResourceTypeSchema.optional(),
51
+ originResourceId: z.string().max(100).optional()
52
+ });
53
+ z.object({
54
+ organizationId: UuidSchema,
55
+ name: NonEmptyStringSchema.max(255),
56
+ description: z.string().max(1e3).optional(),
57
+ target: ScheduleTargetSchema,
58
+ scheduleConfig: TaskScheduleConfigSchema,
59
+ maxRetries: z.number().int().min(0).max(10).optional().default(3),
60
+ idempotencyKey: z.string().max(255).optional(),
61
+ metadata: z.record(z.string(), z.unknown()).optional()
62
+ }).merge(OptionalOriginTrackingSchema);
63
+ var CreateScheduleRequestSchema = z.object({
64
+ name: z.string().min(1, "Name is required").max(255),
65
+ description: z.string().max(1e3).optional(),
66
+ target: z.object({
67
+ resourceType: ResourceTypeSchema,
68
+ resourceId: z.string().min(1, "Resource ID is required").max(255)
69
+ }),
70
+ scheduleConfig: TaskScheduleConfigSchema,
71
+ maxRetries: z.number().int().min(0).max(10).optional(),
72
+ idempotencyKey: z.string().max(255).optional(),
73
+ // Origin tracking (optional)
74
+ originExecutionId: z.string().uuid().optional(),
75
+ originResourceType: OriginResourceTypeSchema.optional(),
76
+ originResourceId: z.string().max(255).optional()
77
+ });
78
+ z.object({
79
+ status: z.enum(["active", "paused", "completed", "cancelled"]).optional(),
80
+ targetResourceType: ResourceTypeSchema.optional(),
81
+ targetResourceId: z.string().optional(),
82
+ limit: z.coerce.number().int().min(1).max(100).optional().default(50),
83
+ offset: z.coerce.number().int().min(0).optional().default(0)
84
+ });
85
+ var GetScheduleParamsSchema = z.object({
86
+ id: z.string().uuid("Invalid schedule ID")
87
+ });
88
+ var UpdateAnchorRequestSchema = z.object({
89
+ anchorAt: z.string().datetime({ message: "Invalid anchor datetime format" })
90
+ });
91
+ var UpdateScheduleRequestSchema = z.object({
92
+ name: z.string().min(1, "Name cannot be empty").max(255).optional(),
93
+ description: z.string().max(1e3).nullable().optional(),
94
+ scheduleConfig: TaskScheduleConfigSchema.optional(),
95
+ maxRetries: z.number().int().min(0).max(10).optional()
96
+ }).strict().refine(
97
+ (data) => data.name !== void 0 || data.description !== void 0 || data.scheduleConfig !== void 0 || data.maxRetries !== void 0,
98
+ { message: "At least one field (name, description, scheduleConfig, maxRetries) must be provided" }
99
+ );
100
+ z.object({
101
+ schedules: z.array(
102
+ z.object({
103
+ // Required identifiers
104
+ id: z.string().uuid(),
105
+ organization_id: z.string().uuid(),
106
+ name: z.string(),
107
+ // Target
108
+ target_resource_type: z.string(),
109
+ target_resource_id: z.string(),
110
+ // Schedule definition
111
+ schedule_config: z.record(z.string(), z.unknown()),
112
+ // JSONB from database
113
+ current_step: z.number().int(),
114
+ status: z.string(),
115
+ // Scheduling state
116
+ next_run_at: z.string().nullable(),
117
+ last_run_at: z.string().nullable(),
118
+ last_execution_id: z.string().uuid().nullable(),
119
+ // Config
120
+ max_retries: z.number().int(),
121
+ retry_count: z.number().int(),
122
+ idempotency_key: z.string().nullable(),
123
+ description: z.string().nullable(),
124
+ // Origin tracking
125
+ origin_execution_id: z.string().uuid().nullable(),
126
+ origin_resource_type: z.string().nullable(),
127
+ origin_resource_id: z.string().nullable(),
128
+ // Timestamps (PostgreSQL format with microseconds)
129
+ created_at: z.string(),
130
+ updated_at: z.string()
131
+ })
132
+ ).min(1).max(100)
133
+ });
134
+ z.object({
135
+ id: z.string().uuid("Invalid schedule ID")
136
+ });
137
+ z.object({
138
+ limit: z.coerce.number().int().min(1).max(100).optional().default(20),
139
+ offset: z.coerce.number().int().min(0).optional().default(0)
140
+ });
141
+ var ScheduleResponseSchema = z.object({
142
+ id: z.string().uuid(),
143
+ organizationId: z.string().uuid(),
144
+ name: z.string(),
145
+ description: z.string().nullable(),
146
+ target: z.object({
147
+ resourceType: ResourceTypeSchema,
148
+ resourceId: z.string()
149
+ }),
150
+ scheduleConfig: TaskScheduleConfigSchema,
151
+ nextRunAt: z.string().datetime().nullable(),
152
+ currentStep: z.number().int(),
153
+ status: z.enum(["active", "paused", "completed", "cancelled"]),
154
+ lastRunAt: z.string().datetime().nullable(),
155
+ lastExecutionId: z.string().uuid().nullable(),
156
+ maxRetries: z.number().int(),
157
+ idempotencyKey: z.string().nullable(),
158
+ createdAt: z.string().datetime(),
159
+ updatedAt: z.string().datetime()
160
+ });
161
+ z.object({
162
+ schedules: z.array(ScheduleResponseSchema),
163
+ total: z.number().int(),
164
+ limit: z.number().int(),
165
+ offset: z.number().int()
166
+ });
167
+ var ExecutionHistoryItemSchema = z.object({
168
+ id: z.string().uuid(),
169
+ createdAt: z.string().datetime(),
170
+ status: z.enum(["running", "completed", "failed", "cancelled"]),
171
+ step: z.number().int().nullable(),
172
+ itemLabel: z.string().nullable(),
173
+ duration: z.number().nullable(),
174
+ // milliseconds
175
+ error: z.string().nullable()
176
+ });
177
+ z.object({
178
+ executions: z.array(ExecutionHistoryItemSchema),
179
+ total: z.number().int(),
180
+ limit: z.number().int(),
181
+ offset: z.number().int()
182
+ });
183
+ z.object({
184
+ processed: z.number().int(),
185
+ succeeded: z.number().int(),
186
+ failed: z.number().int(),
187
+ errors: z.array(
188
+ z.object({
189
+ scheduleId: z.string().uuid(),
190
+ error: z.string()
191
+ })
192
+ ).optional()
193
+ });
194
+
195
+ // src/hooks/scheduling/useScheduledTasks.ts
196
+ function useScheduledTasks(options = {}) {
197
+ const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
198
+ return useQuery({
199
+ queryKey: ["schedules", "dashboard", workOSOrganizationId, options.status, options.targetResourceType],
200
+ queryFn: async () => {
201
+ const params = new URLSearchParams();
202
+ if (options.status) params.append("status", options.status);
203
+ if (options.targetResourceType) params.append("targetResourceType", options.targetResourceType);
204
+ const queryString = params.toString();
205
+ const response = await apiRequest(
206
+ `/task-scheduler/schedules${queryString ? `?${queryString}` : ""}`
207
+ );
208
+ return response.schedules;
209
+ },
210
+ enabled: isReady,
211
+ refetchInterval: REFETCH_INTERVAL_DASHBOARD
212
+ });
213
+ }
214
+
215
+ // src/hooks/scheduling/queryKeys.ts
216
+ var scheduleKeys = {
217
+ all: (orgId) => ["schedules", orgId],
218
+ lists: (orgId) => [...scheduleKeys.all(orgId), "list"],
219
+ list: (orgId, filters) => [...scheduleKeys.lists(orgId), filters],
220
+ details: (orgId) => [...scheduleKeys.all(orgId), "detail"],
221
+ detail: (orgId, id) => [...scheduleKeys.details(orgId), id],
222
+ executions: (orgId, id) => [...scheduleKeys.detail(orgId, id), "executions"]
223
+ };
224
+ function useListSchedules(filters) {
225
+ const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
226
+ return useQuery({
227
+ queryKey: scheduleKeys.list(workOSOrganizationId, filters),
228
+ queryFn: async () => {
229
+ const params = new URLSearchParams();
230
+ if (filters?.status) params.set("status", filters.status);
231
+ if (filters?.targetResourceType) params.set("targetResourceType", filters.targetResourceType);
232
+ if (filters?.targetResourceId) params.set("targetResourceId", filters.targetResourceId);
233
+ if (filters?.limit) params.set("limit", String(filters.limit));
234
+ if (filters?.offset) params.set("offset", String(filters.offset));
235
+ const queryString = params.toString();
236
+ const endpoint = `/task-scheduler/schedules${queryString ? `?${queryString}` : ""}`;
237
+ return apiRequest(endpoint);
238
+ },
239
+ enabled: isReady
240
+ });
241
+ }
242
+ function useGetSchedule(id) {
243
+ const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
244
+ return useQuery({
245
+ queryKey: scheduleKeys.detail(workOSOrganizationId, id),
246
+ queryFn: async () => {
247
+ const data = await apiRequest(`/task-scheduler/schedules/${id}`);
248
+ return data.schedule;
249
+ },
250
+ enabled: isReady && !!id
251
+ });
252
+ }
253
+ function useGetExecutionHistory(scheduleId, options) {
254
+ const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
255
+ return useQuery({
256
+ queryKey: [...scheduleKeys.executions(workOSOrganizationId, scheduleId), options?.limit, options?.offset],
257
+ queryFn: async () => {
258
+ const params = new URLSearchParams();
259
+ if (options?.limit) params.set("limit", String(options.limit));
260
+ if (options?.offset) params.set("offset", String(options.offset));
261
+ const queryString = params.toString();
262
+ const endpoint = `/task-scheduler/schedules/${scheduleId}/executions${queryString ? `?${queryString}` : ""}`;
263
+ return apiRequest(endpoint);
264
+ },
265
+ enabled: isReady && !!scheduleId
266
+ });
267
+ }
268
+ function useCreateSchedule() {
269
+ const queryClient = useQueryClient();
270
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
271
+ return useMutation({
272
+ mutationFn: async (input) => {
273
+ const validated = CreateScheduleRequestSchema.parse(input);
274
+ const data = await apiRequest("/task-scheduler/schedules", {
275
+ method: "POST",
276
+ body: JSON.stringify(validated)
277
+ });
278
+ return data.schedule;
279
+ },
280
+ onSuccess: () => {
281
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
282
+ }
283
+ });
284
+ }
285
+ function useUpdateSchedule() {
286
+ const queryClient = useQueryClient();
287
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
288
+ return useMutation({
289
+ mutationFn: async ({ id, ...fields }) => {
290
+ GetScheduleParamsSchema.parse({ id });
291
+ const validated = UpdateScheduleRequestSchema.parse(fields);
292
+ const data = await apiRequest(`/task-scheduler/schedules/${id}`, {
293
+ method: "PATCH",
294
+ body: JSON.stringify(validated)
295
+ });
296
+ return data.schedule;
297
+ },
298
+ onSuccess: (_, variables) => {
299
+ queryClient.invalidateQueries({
300
+ queryKey: scheduleKeys.detail(workOSOrganizationId, variables.id)
301
+ });
302
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
303
+ }
304
+ });
305
+ }
306
+ function useUpdateAnchor() {
307
+ const queryClient = useQueryClient();
308
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
309
+ return useMutation({
310
+ mutationFn: async ({ id, anchorAt }) => {
311
+ GetScheduleParamsSchema.parse({ id });
312
+ UpdateAnchorRequestSchema.parse({ anchorAt });
313
+ const data = await apiRequest(`/task-scheduler/schedules/${id}/anchor`, {
314
+ method: "PATCH",
315
+ body: JSON.stringify({ anchorAt })
316
+ });
317
+ return data.schedule;
318
+ },
319
+ onSuccess: (_, variables) => {
320
+ queryClient.invalidateQueries({
321
+ queryKey: scheduleKeys.detail(workOSOrganizationId, variables.id)
322
+ });
323
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
324
+ }
325
+ });
326
+ }
327
+ function usePauseSchedule() {
328
+ const queryClient = useQueryClient();
329
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
330
+ return useMutation({
331
+ mutationFn: async (id) => {
332
+ GetScheduleParamsSchema.parse({ id });
333
+ const data = await apiRequest(`/task-scheduler/schedules/${id}/pause`, {
334
+ method: "POST"
335
+ });
336
+ return data.schedule;
337
+ },
338
+ onSuccess: (_, id) => {
339
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.detail(workOSOrganizationId, id) });
340
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
341
+ }
342
+ });
343
+ }
344
+ function useResumeSchedule() {
345
+ const queryClient = useQueryClient();
346
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
347
+ return useMutation({
348
+ mutationFn: async (id) => {
349
+ GetScheduleParamsSchema.parse({ id });
350
+ const data = await apiRequest(`/task-scheduler/schedules/${id}/resume`, {
351
+ method: "POST"
352
+ });
353
+ return data.schedule;
354
+ },
355
+ onSuccess: (_, id) => {
356
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.detail(workOSOrganizationId, id) });
357
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
358
+ }
359
+ });
360
+ }
361
+ function useCancelSchedule() {
362
+ const queryClient = useQueryClient();
363
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
364
+ return useMutation({
365
+ mutationFn: async (id) => {
366
+ GetScheduleParamsSchema.parse({ id });
367
+ const data = await apiRequest(`/task-scheduler/schedules/${id}/cancel`, {
368
+ method: "POST"
369
+ });
370
+ return data.schedule;
371
+ },
372
+ onSuccess: (_, id) => {
373
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.detail(workOSOrganizationId, id) });
374
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
375
+ }
376
+ });
377
+ }
378
+ function useDeleteSchedule() {
379
+ const queryClient = useQueryClient();
380
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
381
+ return useMutation({
382
+ mutationFn: async (id) => {
383
+ GetScheduleParamsSchema.parse({ id });
384
+ await apiRequest(`/task-scheduler/schedules/${id}`, { method: "DELETE" });
385
+ },
386
+ onSuccess: (_, id) => {
387
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.detail(workOSOrganizationId, id) });
388
+ queryClient.invalidateQueries({ queryKey: scheduleKeys.lists(workOSOrganizationId) });
389
+ }
390
+ });
391
+ }
392
+
393
+ export { scheduleKeys, useCancelSchedule, useCreateSchedule, useDeleteSchedule, useGetExecutionHistory, useGetSchedule, useListSchedules, usePauseSchedule, useResumeSchedule, useScheduledTasks, useUpdateAnchor, useUpdateSchedule };
@@ -1,5 +1,5 @@
1
1
  import { OrganizationContext } from './chunk-DD3CCMCZ.js';
2
- import { APIClientError } from './chunk-IBCEAVB2.js';
2
+ import { APIClientError } from './chunk-R5UGIFYU.js';
3
3
  import { createContext, useContext, useMemo, useCallback } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -124,7 +124,8 @@ function useApiClient(apiUrl) {
124
124
  response.status,
125
125
  errorData.requestId,
126
126
  errorData.fields,
127
- errorData.retryAfter
127
+ errorData.retryAfter,
128
+ errorData.details
128
129
  );
129
130
  },
130
131
  [onError]
@@ -1,6 +1,3 @@
1
- import { UuidSchema } from './chunk-TVTSASST.js';
2
- import { z } from 'zod';
3
-
4
1
  // src/hooks/sessions/mergeSessionMessages.ts
5
2
  function canonicalize(value) {
6
3
  if (Array.isArray(value)) {
@@ -45,80 +42,6 @@ function mergeSessionMessages(historyMessages, liveMessages) {
45
42
  return (a.messageIndex ?? 0) - (b.messageIndex ?? 0);
46
43
  });
47
44
  }
48
- var SessionIdParamSchema = z.object({
49
- sessionId: UuidSchema
50
- }).strict();
51
- var ExecutionIdParamsSchema = z.object({
52
- sessionId: UuidSchema,
53
- executionId: UuidSchema
54
- }).strict();
55
- var CreateSessionSchema = z.object({
56
- resourceId: z.string().min(1).max(100),
57
- userId: UuidSchema.optional(),
58
- metadata: z.any().optional()
59
- }).strict();
60
- z.object({
61
- input: z.unknown().refine(
62
- (val) => {
63
- let text;
64
- if (typeof val === "string") {
65
- text = val;
66
- } else if (val && typeof val === "object" && "message" in val) {
67
- text = String(val.message);
68
- } else {
69
- text = JSON.stringify(val);
70
- }
71
- return text.length > 0 && text.length <= 1e5;
72
- },
73
- { message: "Input must be between 1 and 100,000 characters" }
74
- ),
75
- metadata: z.any().optional()
76
- }).strict();
77
- z.object({
78
- userId: UuidSchema.optional(),
79
- resourceId: z.string().optional(),
80
- limit: z.coerce.number().int().min(1).max(100).default(20)
81
- }).strict();
82
- z.object({
83
- limit: z.coerce.number().int().min(1).max(100).default(100),
84
- cursor: z.coerce.number().int().min(0).optional()
85
- }).strict();
86
- var WebSocketSessionTurnSchema = z.object({
87
- type: z.literal("session:turn"),
88
- input: z.unknown().refine(
89
- (val) => {
90
- let text;
91
- if (typeof val === "string") {
92
- text = val;
93
- } else if (val && typeof val === "object" && "message" in val) {
94
- text = String(val.message);
95
- } else {
96
- text = JSON.stringify(val) || "";
97
- }
98
- return text && text.length > 0 && text.length <= 1e5;
99
- },
100
- { message: "Input must be between 1 and 100,000 characters" }
101
- )
102
- }).strict();
103
- var NotificationCategorySchema = z.enum(["info", "queue", "alert", "error", "system"]);
104
- var GetNotificationsQuerySchema = z.object({
105
- limit: z.coerce.number().int().min(1).max(100).default(50),
106
- offset: z.coerce.number().int().min(0).default(0)
107
- });
108
- var MarkAsReadParamsSchema = z.object({
109
- id: UuidSchema
110
- });
111
- z.object({
112
- userId: UuidSchema,
113
- organizationId: UuidSchema,
114
- category: NotificationCategorySchema,
115
- title: z.string().trim().min(1).max(200),
116
- message: z.string().trim().min(1).max(1e3),
117
- actionUrl: z.string().url().optional()
118
- }).strict();
119
- z.object({
120
- ids: z.array(UuidSchema).min(1).max(500)
121
- }).strict();
122
45
 
123
46
  // src/hooks/sessions/sessionWebSocketUtils.ts
124
47
  var liveTempMessageCounter = 0;
@@ -156,4 +79,4 @@ function getWebSocketBaseUrl(apiUrl) {
156
79
  return `${protocol}//${url.host}`;
157
80
  }
158
81
 
159
- export { CreateSessionSchema, ExecutionIdParamsSchema, GetNotificationsQuerySchema, MarkAsReadParamsSchema, SessionIdParamSchema, WebSocketSessionTurnSchema, createLiveTempMessageIdentity, formatMessageEvent, getWebSocketBaseUrl, mergeSessionMessages };
82
+ export { createLiveTempMessageIdentity, formatMessageEvent, getWebSocketBaseUrl, mergeSessionMessages };
@@ -64,7 +64,16 @@ var APIClientError = class extends Error {
64
64
  requestId;
65
65
  fields;
66
66
  retryAfter;
67
- constructor(message, code, statusCode, requestId, fields, retryAfter) {
67
+ /**
68
+ * Structured detail payload carried on `APIErrorResponse.details`
69
+ * (`packages/core/src/platform/api/types.ts`). Deliberately typed as a
70
+ * general bag rather than narrowed to any one error family — CONFLICT
71
+ * linked-row counts, SERVICE_UNAVAILABLE readiness payloads, and future
72
+ * error shapes all flow through the same field. Use a shape-specific
73
+ * accessor (e.g. `getSystemReadinessServerErrorDetails`) to narrow it.
74
+ */
75
+ details;
76
+ constructor(message, code, statusCode, requestId, fields, retryAfter, details) {
68
77
  super(message);
69
78
  this.name = "APIClientError";
70
79
  this.code = code;
@@ -72,11 +81,21 @@ var APIClientError = class extends Error {
72
81
  this.requestId = requestId;
73
82
  this.fields = fields;
74
83
  this.retryAfter = retryAfter;
84
+ this.details = details;
75
85
  }
76
86
  };
77
87
  function isAPIClientError(error) {
78
88
  return error instanceof APIClientError;
79
89
  }
90
+ function isSystemReadinessErrorDetails(details) {
91
+ if (!details || typeof details !== "object") return false;
92
+ const candidate = details;
93
+ return typeof candidate.systemPath === "string" && typeof candidate.interfaceKey === "string" && typeof candidate.readinessCode === "string" && Array.isArray(candidate.issues);
94
+ }
95
+ function getSystemReadinessServerErrorDetails(error) {
96
+ if (!isAPIClientError(error)) return void 0;
97
+ return isSystemReadinessErrorDetails(error.details) ? error.details : void 0;
98
+ }
80
99
  function getErrorInfo(error) {
81
100
  if (isAPIClientError(error)) {
82
101
  return {
@@ -862,7 +881,19 @@ function resolveReadinessInterfaceMarker(model, systemPath, interfaceKey) {
862
881
 
863
882
  // ../core/src/organization-model/domains/systems.ts
864
883
  var SystemKindSchema = z.enum(["product", "operational", "platform", "diagnostic"]).meta({ label: "System kind", color: "blue" });
865
- var SystemLifecycleSchema = z.enum(["draft", "beta", "active", "deprecated", "archived"]).meta({ label: "Lifecycle", color: "teal" });
884
+ var SystemLifecycleSchema = z.enum(["draft", "beta", "active", "deprecated", "archived"]).meta({
885
+ label: "Lifecycle",
886
+ color: "teal"
887
+ });
888
+ function systemLifecycleAllowsAccess(lifecycle, ctx) {
889
+ if (lifecycle === "active") return true;
890
+ if (lifecycle === "beta") return ctx.betaAccessEnabled === true || ctx.isDevelopment === true;
891
+ return false;
892
+ }
893
+ function isSystemLifecycleVisible(lifecycle, enabled) {
894
+ if (enabled === false) return false;
895
+ return lifecycle !== "draft" && lifecycle !== "deprecated" && lifecycle !== "archived";
896
+ }
866
897
  var SystemIdSchema = ModelIdSchema;
867
898
  var SystemPathSchema = z.string().trim().min(1).regex(
868
899
  /^[a-z0-9][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*)*$/,
@@ -988,8 +1019,13 @@ var SystemEntrySchema = z.object({
988
1019
  parentSystemId: SystemIdSchema.optional(),
989
1020
  /** Optional UI presence. Systems without UI omit this. */
990
1021
  ui: SystemUiSchema.optional(),
991
- /** Canonical lifecycle state. `beta` is what gates a System to dev-mode viewers. */
992
- lifecycle: SystemLifecycleSchema.optional(),
1022
+ /**
1023
+ * Canonical lifecycle state. `beta` is what gates a System to dev-mode
1024
+ * viewers. Defaults to `active` (not `.optional()`) so an omitted field
1025
+ * never reaches a consumer as `undefined` -- see `isSystemLifecycleVisible`
1026
+ * and `systemLifecycleAllowsAccess` above.
1027
+ */
1028
+ lifecycle: SystemLifecycleSchema.default("active"),
993
1029
  /** Optional role responsible for this system. */
994
1030
  responsibleRoleId: ModelIdSchema.meta({ ref: "role" }).optional(),
995
1031
  /** Optional knowledge nodes that govern this system. */
@@ -1468,4 +1504,4 @@ function setupBrowserMocks() {
1468
1504
  setupResizeObserver();
1469
1505
  }
1470
1506
 
1471
- export { APIClientError, API_URL, ActionInvocationSchema, ActionSchema, ActionsDomainSchema, DEBOUNCE_FILTER, DEBOUNCE_SLIDER, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DescriptionSchema, EntitiesDomainSchema, EntitySchema, GC_TIME_LONG, GC_TIME_MEDIUM, GC_TIME_SHORT, IconNameSchema, JsonValueSchema, LIMIT_ACTIVITY_FEED, LabelSchema, ModelIdSchema, NodeIdStringSchema, OAUTH_FLOW_TIMEOUT, OntologyIdSchema, OntologyScopeSchema, PAGE_SIZE_DEFAULT, PathSchema, STALE_TIME_ADMIN, STALE_TIME_DEFAULT, STALE_TIME_MONITORING, SYSTEM_INTERFACE_PROFILES, SystemEntrySchema, SystemIdSchema, SystemInterfaceRefSchema, SystemLifecycleSchema, SystemPathSchema, SystemsDomainSchema, addReadinessIssue, ancestorsOf, childrenOf, compileOrganizationOntology, computeInterfaceReadiness, defaultPathFor, devOnlyFor, findById, findByPath, formatChartAxisDate, formatDate, formatDateTime, formatErrorMessage, formatInterfaceIdentity, formatOntologyId, formatRelativeTime, formatTimeAgo, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, getResourcesForSystem, getSystem, getSystemAncestors, isAPIClientError, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, parentOf, parseOntologyId, registerBuiltInReadinessProfile, registerReadinessInterfaceMarker, requireCatalogReadiness, requireContractReadiness, requireScopedBinding, resolveSystemConfig, resourceBindingIds, restoreConsole, setupBrowserMocks, suppressKnownWarnings, topLevel, validateEmail };
1507
+ export { APIClientError, API_URL, ActionInvocationSchema, ActionSchema, ActionsDomainSchema, DEBOUNCE_FILTER, DEBOUNCE_SLIDER, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DescriptionSchema, EntitiesDomainSchema, EntitySchema, GC_TIME_LONG, GC_TIME_MEDIUM, GC_TIME_SHORT, IconNameSchema, JsonValueSchema, LIMIT_ACTIVITY_FEED, LabelSchema, ModelIdSchema, NodeIdStringSchema, OAUTH_FLOW_TIMEOUT, OntologyIdSchema, OntologyScopeSchema, PAGE_SIZE_DEFAULT, PathSchema, STALE_TIME_ADMIN, STALE_TIME_DEFAULT, STALE_TIME_MONITORING, SYSTEM_INTERFACE_PROFILES, SystemEntrySchema, SystemIdSchema, SystemInterfaceRefSchema, SystemLifecycleSchema, SystemPathSchema, SystemsDomainSchema, addReadinessIssue, ancestorsOf, childrenOf, compileOrganizationOntology, computeInterfaceReadiness, defaultPathFor, devOnlyFor, findById, findByPath, formatChartAxisDate, formatDate, formatDateTime, formatErrorMessage, formatInterfaceIdentity, formatOntologyId, formatRelativeTime, formatTimeAgo, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, getResourcesForSystem, getSystem, getSystemAncestors, getSystemReadinessServerErrorDetails, isAPIClientError, isSystemLifecycleVisible, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, parentOf, parseOntologyId, registerBuiltInReadinessProfile, registerReadinessInterfaceMarker, requireCatalogReadiness, requireContractReadiness, requireScopedBinding, resolveSystemConfig, resourceBindingIds, restoreConsole, setupBrowserMocks, suppressKnownWarnings, systemLifecycleAllowsAccess, topLevel, validateEmail };
@@ -1,4 +1,4 @@
1
- import { GC_TIME_LONG, STALE_TIME_DEFAULT } from './chunk-IBCEAVB2.js';
1
+ import { GC_TIME_LONG, STALE_TIME_DEFAULT } from './chunk-R5UGIFYU.js';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
3
 
4
4
  function createElevasisQueryClient(options = {}) {
@@ -0,0 +1,24 @@
1
+ import { UuidSchema } from './chunk-TVTSASST.js';
2
+ import { z } from 'zod';
3
+
4
+ var NotificationCategorySchema = z.enum(["info", "queue", "alert", "error", "system"]);
5
+ var GetNotificationsQuerySchema = z.object({
6
+ limit: z.coerce.number().int().min(1).max(100).default(50),
7
+ offset: z.coerce.number().int().min(0).default(0)
8
+ });
9
+ var MarkAsReadParamsSchema = z.object({
10
+ id: UuidSchema
11
+ });
12
+ z.object({
13
+ userId: UuidSchema,
14
+ organizationId: UuidSchema,
15
+ category: NotificationCategorySchema,
16
+ title: z.string().trim().min(1).max(200),
17
+ message: z.string().trim().min(1).max(1e3),
18
+ actionUrl: z.string().url().optional()
19
+ }).strict();
20
+ z.object({
21
+ ids: z.array(UuidSchema).min(1).max(500)
22
+ }).strict();
23
+
24
+ export { GetNotificationsQuerySchema, MarkAsReadParamsSchema };
@@ -1,13 +1,15 @@
1
+ import { useScheduledTasks } from './chunk-N6K2Q5BM.js';
1
2
  import { ZodFormRenderer } from './chunk-3MEXPLWT.js';
2
3
  import { ResourceHealthChart } from './chunk-LGKLC5MG.js';
4
+ import { useTimeRangeDates } from './chunk-YQQ5GRUR.js';
3
5
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, useFitViewTrigger } from './chunk-HENXLGVD.js';
4
- import { AppShellCenteredContainer, AppShellLoader } from './chunk-3TS5U5BL.js';
5
- import { useCyberColors, GlowDot, JsonViewer, useExecuteResource, EmptyState, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, PageTitleCaption, HeroStatsRow, useCommandQueue, useScheduledTasks, TabCountBadge, useResourcesHealth } from './chunk-OCVSPAKM.js';
6
+ import { AppShellCenteredContainer, AppShellLoader } from './chunk-E6YGA5WH.js';
7
+ import { useCyberColors, GlowDot, JsonViewer, useExecuteResource, EmptyState, useDashboardMetrics, useResources, useUnresolvedErrors, useRecentExecutionsByResource, PageTitleCaption, HeroStatsRow, useCommandQueue, TabCountBadge, useResourcesHealth } from './chunk-6JN2TLV2.js';
6
8
  import { glassBase } from './chunk-R6NMRXNO.js';
7
9
  import { CardHeader } from './chunk-62GVNH5U.js';
8
10
  import { useInitialization } from './chunk-P45GQ3ZW.js';
9
11
  import { STATUS_COLORS, getStatusIcon, formatDuration, getStatusColors, AGENT_CONSTANTS, shouldAnimateEdge, TIMELINE_CONSTANTS, calculateBarPosition, CONTAINER_CONSTANTS, useExecutionPath, useUnifiedWorkflowLayout, WORKFLOW_CONSTANTS, useReactFlowAgent } from './chunk-BLXJEIQS.js';
10
- import { formatTimeAgo, formatRelativeTime } from './chunk-IBCEAVB2.js';
12
+ import { formatTimeAgo, formatRelativeTime } from './chunk-R5UGIFYU.js';
11
13
  import { getTimeRangeDates } from './chunk-Y6I3IC45.js';
12
14
  import { ResourceStatusColors } from './chunk-6SSQGWK7.js';
13
15
  import { memo, useMemo, useEffect, useState, useCallback, Fragment } from 'react';