@elevasis/ui 1.20.1 → 1.22.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 (66) hide show
  1. package/dist/charts/index.js +3 -2
  2. package/dist/chunk-3KMDHCAR.js +52 -0
  3. package/dist/{chunk-4SY4EQSK.js → chunk-5266RV46.js} +3 -3
  4. package/dist/{chunk-UMFPUM7Q.js → chunk-7TLPKXC2.js} +12 -12
  5. package/dist/{chunk-OFAXUZPZ.js → chunk-AJPFSMEH.js} +528 -336
  6. package/dist/chunk-AWT255UH.js +255 -0
  7. package/dist/{chunk-EMN755L5.js → chunk-CTF6FS2M.js} +10 -216
  8. package/dist/{chunk-C7AD6N23.js → chunk-DLI3F5IV.js} +364 -364
  9. package/dist/{chunk-AQ5MQDSS.js → chunk-EDAYKRPJ.js} +404 -2
  10. package/dist/{chunk-XOTN3X3Z.js → chunk-FATKFO7X.js} +3 -54
  11. package/dist/{chunk-JZEXFQ6N.js → chunk-HOYZWSNV.js} +91 -80
  12. package/dist/{chunk-AWMZCYKH.js → chunk-IAZT3VO6.js} +158 -82
  13. package/dist/{chunk-ERVB3QJQ.js → chunk-N5SDJP44.js} +1 -1
  14. package/dist/{chunk-3DIU726S.js → chunk-NVSKJG3L.js} +25 -4
  15. package/dist/{chunk-VLTVZXP6.js → chunk-QZS5FOIR.js} +2 -2
  16. package/dist/chunk-ROSMICXG.js +668 -0
  17. package/dist/{chunk-JIABC3AE.js → chunk-WAEKXBP3.js} +516 -266
  18. package/dist/{chunk-COTI2QPO.js → chunk-ZHJGTOXP.js} +4 -3
  19. package/dist/components/chat/index.d.ts +202 -0
  20. package/dist/components/chat/index.js +2 -0
  21. package/dist/components/index.css +0 -3
  22. package/dist/components/index.d.ts +37 -37
  23. package/dist/components/index.js +2652 -2902
  24. package/dist/features/auth/index.css +0 -3
  25. package/dist/features/dashboard/index.css +0 -3
  26. package/dist/features/dashboard/index.js +9 -9
  27. package/dist/features/monitoring/index.css +0 -3
  28. package/dist/features/monitoring/index.js +10 -10
  29. package/dist/features/operations/index.css +0 -3
  30. package/dist/features/operations/index.d.ts +245 -10
  31. package/dist/features/operations/index.js +1115 -170
  32. package/dist/features/settings/index.css +0 -3
  33. package/dist/features/settings/index.js +9 -9
  34. package/dist/hooks/index.css +68 -3
  35. package/dist/hooks/index.d.ts +1165 -4
  36. package/dist/hooks/index.js +5 -6
  37. package/dist/hooks/published.css +68 -3
  38. package/dist/hooks/published.d.ts +1165 -4
  39. package/dist/hooks/published.js +4 -5
  40. package/dist/index.css +68 -3
  41. package/dist/index.d.ts +1166 -5
  42. package/dist/index.js +6 -7
  43. package/dist/layout/index.d.ts +4 -4
  44. package/dist/layout/index.js +3 -4
  45. package/dist/provider/index.css +0 -3
  46. package/dist/provider/index.d.ts +1 -1
  47. package/dist/provider/index.js +3 -4
  48. package/dist/provider/published.d.ts +1 -1
  49. package/dist/theme/index.d.ts +1 -1
  50. package/dist/theme/index.js +3 -3
  51. package/dist/types/index.d.ts +1 -1
  52. package/package.json +7 -2
  53. package/dist/chunk-JFRG2JJE.js +0 -47
  54. package/dist/chunk-R3R367QY.js +0 -14
  55. package/dist/theme/presets/__tests__/getPreset.test.d.ts +0 -2
  56. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +0 -1
  57. package/dist/theme/presets/__tests__/getPreset.test.js +0 -92
  58. package/dist/theme/presets/cyber-volt.d.ts +0 -12
  59. package/dist/theme/presets/cyber-volt.d.ts.map +0 -1
  60. package/dist/theme/presets/cyber-volt.js +0 -70
  61. package/dist/theme/presets/regal.d.ts +0 -8
  62. package/dist/theme/presets/regal.d.ts.map +0 -1
  63. package/dist/theme/presets/regal.js +0 -69
  64. package/dist/theme/presets/rose-gold.d.ts +0 -12
  65. package/dist/theme/presets/rose-gold.d.ts.map +0 -1
  66. package/dist/theme/presets/rose-gold.js +0 -76
@@ -1,24 +1,27 @@
1
- import { SubshellSidebarSection } from './chunk-JFRG2JJE.js';
1
+ import { SubshellSidebarSection } from './chunk-AWT255UH.js';
2
2
  import { CustomModal, ConfirmationModal } from './chunk-GBMNCNHX.js';
3
- import { BaseNode, useGraphTheme, BaseEdge, GraphBackground, GraphLegend, GraphFitViewButton, GraphFitViewHandler } from './chunk-C7AD6N23.js';
4
- import { useCyberColors, CyberDonut } from './chunk-ERVB3QJQ.js';
5
- import { ContextViewer, JsonViewer, StyledMarkdown, CardHeader } from './chunk-AWMZCYKH.js';
6
- import { showApiErrorNotification, showSuccessNotification } from './chunk-XOTN3X3Z.js';
7
- import { useCommandViewLayout, useSubmitAction, useDeleteTask, useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals } from './chunk-AQ5MQDSS.js';
3
+ import { BaseNode, useGraphTheme, BaseEdge, GraphBackground, GraphLegend, GraphFitViewButton, GraphFitViewHandler } from './chunk-DLI3F5IV.js';
4
+ import { useCyberColors, CyberDonut } from './chunk-N5SDJP44.js';
5
+ import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, ContextViewer } from './chunk-IAZT3VO6.js';
6
+ import { StyledMarkdown } from './chunk-3KMDHCAR.js';
7
+ import { useCommandViewLayout, useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useSubmitAction, useDeleteTask, showApiErrorNotification, showSuccessNotification } from './chunk-EDAYKRPJ.js';
8
8
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, GRAPH_CONSTANTS, useGraphHighlighting, calculateGraphHeight } from './chunk-F6RBK7NJ.js';
9
9
  import { getResourceStatusColor } from './chunk-XA34RETF.js';
10
- import { toWorkflowLogMessages } from './chunk-ELJIFLCB.js';
10
+ import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-ELJIFLCB.js';
11
11
  import { useAppearance } from './chunk-QJ2KCHKX.js';
12
12
  import { getResourceIcon, getResourceColor, getErrorInfo, formatErrorMessage } from './chunk-IOKL7BKE.js';
13
13
  import { useOrganization } from './chunk-DD3CCMCZ.js';
14
- import { Stack, Group, Text, Badge, ThemeIcon, Box, TextInput, Textarea, Radio, Checkbox, Select, NumberInput, Title, Alert, Button, Card, Loader, Menu, ActionIcon, Accordion, Collapse, SimpleGrid, Divider, Paper, Space, CopyButton, Center, Tooltip, Code, useMantineTheme, UnstyledButton, RangeSlider, ScrollArea } from '@mantine/core';
14
+ import { Stack, Group, Text, Badge, ThemeIcon, Box, TextInput, Textarea, Radio, Checkbox, Select, NumberInput, Title, Alert, Button, ActionIcon, Collapse, Card, SimpleGrid, Divider, Paper, Space, CopyButton, Center, Tooltip, Code, Menu, useMantineTheme, UnstyledButton, RangeSlider, Loader, Progress, Accordion, ScrollArea } from '@mantine/core';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
- import { IconBrain, IconFileText, IconDatabase, IconMessage, IconAlertCircle, IconCircleX, IconCircleCheck, IconBolt, IconHandClick, IconClock, IconWebhook, IconExternalLink, IconMail, IconSend, IconArrowUp, IconMessageCircle, IconRocket, IconEye, IconEdit, IconAlertTriangle, IconRefresh, IconX, IconCheck, IconRobot, IconGitBranch, IconDotsVertical, IconTrash, IconPlayerPlay, IconChevronRight, IconTool, IconSettings, IconCpu, IconClockHour4, IconVersions, IconNetwork, IconSitemap, IconCopy, IconPlayerStop, IconReload, IconTerminal2, IconBug, IconChevronDown, IconFilter, IconCategory, IconArchive, IconDownload } from '@tabler/icons-react';
16
+ import { IconBrain, IconFileText, IconDatabase, IconMessage, IconAlertCircle, IconCircleX, IconCircleCheck, IconBolt, IconHandClick, IconClock, IconWebhook, IconExternalLink, IconMail, IconSend, IconArrowUp, IconMessageCircle, IconRocket, IconEye, IconEdit, IconAlertTriangle, IconRefresh, IconX, IconCheck, IconChevronRight, IconTool, IconSettings, IconCpu, IconClockHour4, IconVersions, IconPlayerPlay, IconNetwork, IconSitemap, IconCopy, IconPlayerStop, IconReload, IconTrash, IconTerminal2, IconBug, IconChevronDown, IconArrowLeft, IconRobot, IconGitBranch, IconDotsVertical, IconFilter, IconCategory, IconArchive, IconDownload } from '@tabler/icons-react';
17
17
  import { useForm } from '@mantine/form';
18
18
  import { memo, forwardRef, useMemo, useImperativeHandle, useState, useRef, useCallback, useEffect } from 'react';
19
- import dagre from '@dagrejs/dagre';
20
19
  import { useReactFlow, ReactFlow, ReactFlowProvider } from '@xyflow/react';
20
+ import dagre from '@dagrejs/dagre';
21
21
  import '@xyflow/react/dist/style.css';
22
+ import { useClipboard } from '@mantine/hooks';
23
+ import { notifications } from '@mantine/notifications';
24
+ import { useNavigate } from '@tanstack/react-router';
22
25
 
23
26
  function FormFieldRenderer({ field, form, richTextRenderer }) {
24
27
  const commonProps = {
@@ -169,251 +172,6 @@ function ActionModal({
169
172
  ] })
170
173
  ] }) }) });
171
174
  }
172
- function TaskCard({ task, onViewExecution, richTextRenderer }) {
173
- const [isExpanded, setIsExpanded] = useState(false);
174
- const { mutate: submitAction, isPending } = useSubmitAction();
175
- const { mutate: deleteTask, isPending: isDeleting } = useDeleteTask();
176
- const [actionModalOpened, setActionModalOpened] = useState(false);
177
- const [selectedAction, setSelectedAction] = useState(null);
178
- const [confirmAction, setConfirmAction] = useState(null);
179
- const [deleteConfirmOpened, setDeleteConfirmOpened] = useState(false);
180
- const handleActionClick = (action) => {
181
- if (action.requiresConfirmation) {
182
- setConfirmAction(action);
183
- } else if (action.form) {
184
- setSelectedAction(action);
185
- setActionModalOpened(true);
186
- } else {
187
- submitAction({
188
- taskId: task.id,
189
- actionId: action.id
190
- });
191
- }
192
- };
193
- const handleConfirm = () => {
194
- if (!confirmAction) return;
195
- if (confirmAction.form) {
196
- setSelectedAction(confirmAction);
197
- setActionModalOpened(true);
198
- } else {
199
- submitAction({
200
- taskId: task.id,
201
- actionId: confirmAction.id
202
- });
203
- }
204
- setConfirmAction(null);
205
- };
206
- const getPriorityColor2 = (priority) => {
207
- if (priority >= 8) return "red";
208
- if (priority >= 5) return "yellow";
209
- return "gray";
210
- };
211
- const getStatusColor2 = (status) => {
212
- switch (status) {
213
- case "pending":
214
- return "blue";
215
- case "processing":
216
- return "blue";
217
- case "completed":
218
- return "green";
219
- case "failed":
220
- return "red";
221
- case "expired":
222
- return "orange";
223
- default:
224
- return "gray";
225
- }
226
- };
227
- const handleRetry = () => {
228
- if (task.selectedAction) {
229
- submitAction({
230
- taskId: task.id,
231
- actionId: task.selectedAction,
232
- payload: task.actionPayload
233
- });
234
- }
235
- };
236
- const formatDate = (date) => {
237
- const now = /* @__PURE__ */ new Date();
238
- const diffMs = now.getTime() - date.getTime();
239
- const diffMins = Math.floor(diffMs / 6e4);
240
- const diffHours = Math.floor(diffMins / 60);
241
- const diffDays = Math.floor(diffHours / 24);
242
- if (diffMins < 60) return `${diffMins}m ago`;
243
- if (diffHours < 24) return `${diffHours}h ago`;
244
- return `${diffDays}d ago`;
245
- };
246
- return /* @__PURE__ */ jsx(
247
- Card,
248
- {
249
- withBorder: true,
250
- style: { transition: "box-shadow var(--duration-fast) var(--easing)" },
251
- onMouseEnter: (e) => {
252
- e.currentTarget.style.boxShadow = "var(--standard-box-shadow)";
253
- },
254
- onMouseLeave: (e) => {
255
- e.currentTarget.style.boxShadow = "";
256
- },
257
- children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
258
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
259
- /* @__PURE__ */ jsxs(Group, { gap: "sm", style: { flex: 1 }, children: [
260
- /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: task.originResourceType === "agent" ? "blue" : "grape", children: task.originResourceType === "agent" ? /* @__PURE__ */ jsx(IconRobot, { size: 20 }) : /* @__PURE__ */ jsx(IconGitBranch, { size: 20 }) }),
261
- /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
262
- /* @__PURE__ */ jsxs(Group, { gap: "xs", mb: 4, children: [
263
- /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: task.description || "Task approval required" }),
264
- /* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: getPriorityColor2(task.priority), radius: "sm", children: [
265
- "P",
266
- task.priority
267
- ] })
268
- ] }),
269
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
270
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
271
- task.originResourceType === "agent" ? "Agent" : "Workflow",
272
- ": ",
273
- task.originResourceId
274
- ] }),
275
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "\u2022" }),
276
- /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
277
- /* @__PURE__ */ jsx(IconClock, { size: 12 }),
278
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDate(task.createdAt) })
279
- ] })
280
- ] })
281
- ] })
282
- ] }),
283
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
284
- /* @__PURE__ */ jsx(
285
- Badge,
286
- {
287
- size: "sm",
288
- variant: "light",
289
- color: getStatusColor2(task.status),
290
- radius: "sm",
291
- leftSection: task.status === "processing" ? /* @__PURE__ */ jsx(Loader, { size: 6 }) : void 0,
292
- children: task.status.charAt(0).toUpperCase() + task.status.slice(1)
293
- }
294
- ),
295
- task.status === "failed" && /* @__PURE__ */ jsx(Button, { variant: "light", color: "red", size: "xs", loading: isPending, onClick: handleRetry, children: "Retry" }),
296
- /* @__PURE__ */ jsxs(Menu, { shadow: "md", position: "bottom-end", offset: 8, children: [
297
- /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", size: "sm", children: /* @__PURE__ */ jsx(IconDotsVertical, { size: 16 }) }) }),
298
- /* @__PURE__ */ jsx(Menu.Dropdown, { children: /* @__PURE__ */ jsx(
299
- Menu.Item,
300
- {
301
- leftSection: /* @__PURE__ */ jsx(IconTrash, { size: 14 }),
302
- disabled: task.status === "processing",
303
- onClick: () => setDeleteConfirmOpened(true),
304
- children: "Delete"
305
- }
306
- ) })
307
- ] })
308
- ] })
309
- ] }),
310
- /* @__PURE__ */ jsx(Accordion, { value: isExpanded ? "details" : null, onChange: (value) => setIsExpanded(!!value), children: /* @__PURE__ */ jsxs(Accordion.Item, { value: "details", children: [
311
- /* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: "View Context" }) }),
312
- /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsx(ContextViewer, { data: task.context }) })
313
- ] }) }),
314
- task.status === "pending" && /* @__PURE__ */ jsx(Group, { gap: "xs", children: task.actions.map((action) => {
315
- const Icon = getIcon(action.icon);
316
- const variant = "light";
317
- return /* @__PURE__ */ jsx(
318
- Button,
319
- {
320
- variant,
321
- color: action.color || (action.type === "danger" ? "red" : "blue"),
322
- leftSection: Icon ? /* @__PURE__ */ jsx(Icon, { size: 16 }) : null,
323
- loading: isPending,
324
- onClick: () => handleActionClick(action),
325
- title: action.description,
326
- size: "xs",
327
- radius: "xs",
328
- children: action.label
329
- },
330
- action.id
331
- );
332
- }) }),
333
- task.selectedAction && /* @__PURE__ */ jsx(Accordion, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: "submitted", children: [
334
- /* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
335
- /* @__PURE__ */ jsx(ThemeIcon, { size: "sm", variant: "light", color: "green", radius: "xl", children: /* @__PURE__ */ jsx(IconCheck, { size: 12 }) }),
336
- /* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
337
- "Submitted: ",
338
- task.actions.find((a) => a.id === task.selectedAction)?.label || task.selectedAction
339
- ] }),
340
- task.targetExecutionId && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "cyan", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 10 }), children: "Executed" })
341
- ] }) }),
342
- /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
343
- task.actionPayload !== void 0 && task.actionPayload !== null && /* @__PURE__ */ jsx(JsonViewer, { data: task.actionPayload, maxHeight: 200 }),
344
- task.completedAt && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
345
- "Completed ",
346
- formatDate(task.completedAt),
347
- task.completedBy ? ` by ${task.completedBy}` : ""
348
- ] }),
349
- task.targetExecutionId && /* @__PURE__ */ jsx(
350
- Button,
351
- {
352
- variant: "light",
353
- size: "xs",
354
- leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 14 }),
355
- onClick: () => {
356
- onViewExecution?.({
357
- resourceType: task.originResourceType,
358
- resourceId: task.originResourceId,
359
- executionId: task.targetExecutionId
360
- });
361
- },
362
- children: "View Execution"
363
- }
364
- )
365
- ] }) })
366
- ] }) }),
367
- /* @__PURE__ */ jsx(CustomModal, { opened: !!confirmAction, onClose: () => setConfirmAction(null), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
368
- /* @__PURE__ */ jsx(Text, { fw: 600, children: "Confirm Action" }),
369
- /* @__PURE__ */ jsx(Text, { size: "sm", children: confirmAction?.confirmationMessage || `Are you sure you want to ${confirmAction?.label.toLowerCase()}?` }),
370
- /* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
371
- /* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setConfirmAction(null), children: "Cancel" }),
372
- /* @__PURE__ */ jsx(Button, { onClick: handleConfirm, children: confirmAction?.label })
373
- ] })
374
- ] }) }),
375
- selectedAction && /* @__PURE__ */ jsx(
376
- ActionModal,
377
- {
378
- action: selectedAction,
379
- task,
380
- opened: actionModalOpened,
381
- onClose: () => setActionModalOpened(false),
382
- onSubmit: (payload, notes) => {
383
- submitAction({
384
- taskId: task.id,
385
- actionId: selectedAction.id,
386
- payload,
387
- notes
388
- });
389
- setActionModalOpened(false);
390
- },
391
- richTextRenderer
392
- }
393
- ),
394
- /* @__PURE__ */ jsx(CustomModal, { opened: deleteConfirmOpened, onClose: () => setDeleteConfirmOpened(false), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
395
- /* @__PURE__ */ jsx(Text, { fw: 600, children: "Delete Task" }),
396
- /* @__PURE__ */ jsx(Text, { size: "sm", children: "Are you sure you want to delete this task? This action cannot be undone." }),
397
- /* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
398
- /* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setDeleteConfirmOpened(false), children: "Cancel" }),
399
- /* @__PURE__ */ jsx(
400
- Button,
401
- {
402
- color: "red",
403
- loading: isDeleting,
404
- onClick: () => {
405
- deleteTask(task.id);
406
- setDeleteConfirmOpened(false);
407
- },
408
- children: "Delete"
409
- }
410
- )
411
- ] })
412
- ] }) })
413
- ] })
414
- }
415
- );
416
- }
417
175
  function ContentSections({ context, sections, titles }) {
418
176
  const sectionKeys = sections || Object.keys(context).filter((key) => key !== "contentDisplay" && typeof context[key] === "string");
419
177
  const formatTitle = (key) => key.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
@@ -1597,15 +1355,155 @@ function LogGroup({ title, logs, statusBadge }) {
1597
1355
  }
1598
1356
  );
1599
1357
  }
1600
- function AgentExecutionLogs({
1601
- resourceId,
1602
- executionId,
1603
- execution: externalExecution,
1604
- selectedIterationId,
1605
- iterationData,
1606
- onExecutionDeleted
1607
- }) {
1608
- const isIterationSelected = selectedIterationId !== null;
1358
+ var ResourceFilter = ({ value, onChange, fullWidth }) => {
1359
+ const buttonStyles = fullWidth ? { padding: "2px 8px", height: "28px", fontSize: "12px", flex: 1 } : { padding: "2px 8px", height: "24px", fontSize: "12px" };
1360
+ return /* @__PURE__ */ jsxs(Button.Group, { style: fullWidth ? { width: "100%" } : void 0, children: [
1361
+ /* @__PURE__ */ jsx(
1362
+ Button,
1363
+ {
1364
+ variant: value === "all" ? "filled" : "default",
1365
+ size: "xs",
1366
+ onClick: () => onChange("all"),
1367
+ bg: value === "all" ? void 0 : "var(--color-background)",
1368
+ styles: { root: buttonStyles },
1369
+ children: "All"
1370
+ }
1371
+ ),
1372
+ /* @__PURE__ */ jsx(
1373
+ Button,
1374
+ {
1375
+ variant: value === "dev" ? "filled" : "default",
1376
+ size: "xs",
1377
+ onClick: () => onChange("dev"),
1378
+ bg: value === "dev" ? void 0 : "var(--color-background)",
1379
+ styles: { root: buttonStyles },
1380
+ children: "Dev"
1381
+ }
1382
+ ),
1383
+ /* @__PURE__ */ jsx(
1384
+ Button,
1385
+ {
1386
+ variant: value === "prod" ? "filled" : "default",
1387
+ size: "xs",
1388
+ onClick: () => onChange("prod"),
1389
+ bg: value === "prod" ? void 0 : "var(--color-background)",
1390
+ styles: { root: buttonStyles },
1391
+ children: "Prod"
1392
+ }
1393
+ )
1394
+ ] });
1395
+ };
1396
+ function ResourceHeader({ resource, type, connected, runningCount, sessionCapable }) {
1397
+ const { currentMembership } = useOrganization();
1398
+ const organizationName = currentMembership?.organization?.name;
1399
+ const navigate = useNavigate();
1400
+ const Icon = getResourceIcon(type);
1401
+ const clipboard = useClipboard({ timeout: 2e3 });
1402
+ const handleCopyId = () => {
1403
+ clipboard.copy(`"${organizationName}/${resource.resourceId}"`);
1404
+ notifications.show({
1405
+ message: "Resource ID copied to clipboard",
1406
+ color: "teal"
1407
+ });
1408
+ };
1409
+ const handleGoToSessions = () => {
1410
+ navigate({
1411
+ to: "/operations/sessions",
1412
+ search: { agent: resource.resourceId }
1413
+ });
1414
+ };
1415
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1416
+ /* @__PURE__ */ jsx(
1417
+ PageTitleCaption,
1418
+ {
1419
+ title: resource.name,
1420
+ caption: resource.description || `${type.charAt(0).toUpperCase()}${type.slice(1)} details`
1421
+ }
1422
+ ),
1423
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
1424
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1425
+ /* @__PURE__ */ jsx(Icon, { size: 20, color: "var(--color-primary)" }),
1426
+ /* @__PURE__ */ jsxs(Badge, { color: "blue", variant: "light", children: [
1427
+ type.charAt(0).toUpperCase(),
1428
+ type.slice(1)
1429
+ ] }),
1430
+ /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resource.status], variant: "outline", size: "sm", children: resource.status.toUpperCase() }),
1431
+ resource.version && /* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "sm", children: [
1432
+ "v",
1433
+ resource.version
1434
+ ] }),
1435
+ /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
1436
+ /* @__PURE__ */ jsxs(Text, { size: "sm", ff: "monospace", c: "dimmed", children: [
1437
+ organizationName,
1438
+ "/",
1439
+ resource.resourceId
1440
+ ] }),
1441
+ /* @__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" }) }) })
1442
+ ] })
1443
+ ] }),
1444
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1445
+ connected && /* @__PURE__ */ jsx(Badge, { color: "green", variant: "dot", children: "CONNECTED" }),
1446
+ runningCount && runningCount > 0 && /* @__PURE__ */ jsxs(Badge, { color: "blue", variant: "filled", children: [
1447
+ runningCount,
1448
+ " running"
1449
+ ] }),
1450
+ type === "agent" && sessionCapable && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconMessage, { size: 16 }), onClick: handleGoToSessions, children: "Go to Sessions" }),
1451
+ /* @__PURE__ */ jsx(
1452
+ Button,
1453
+ {
1454
+ size: "sm",
1455
+ variant: "light",
1456
+ leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
1457
+ onClick: () => navigate({ to: "/operations/resources" }),
1458
+ children: "Resources"
1459
+ }
1460
+ )
1461
+ ] })
1462
+ ] })
1463
+ ] });
1464
+ }
1465
+ function ResourceErrorState({ error }) {
1466
+ return /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", children: [
1467
+ /* @__PURE__ */ jsx(Text, { c: "red", children: "Failed to load resource" }),
1468
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: error.message })
1469
+ ] }) }) });
1470
+ }
1471
+ function ResourceNotFoundState({ type, resourceId }) {
1472
+ const navigate = useNavigate();
1473
+ const { currentMembership } = useOrganization();
1474
+ const orgName = currentMembership?.organization?.name || "current organization";
1475
+ return /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", children: [
1476
+ /* @__PURE__ */ jsx(Text, { size: "lg", c: "dimmed", fw: 500, children: "Resource not found" }),
1477
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", ta: "center", children: [
1478
+ "The ",
1479
+ type,
1480
+ ' "',
1481
+ resourceId,
1482
+ '" could not be found in ',
1483
+ orgName,
1484
+ "."
1485
+ ] }),
1486
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", ta: "center", children: "This resource may exist in a different organization. Try switching organizations or returning to the overview." }),
1487
+ /* @__PURE__ */ jsx(
1488
+ Button,
1489
+ {
1490
+ variant: "light",
1491
+ leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
1492
+ onClick: () => navigate({ to: "/operations", search: { type: void 0 } }),
1493
+ children: "Back to Operations"
1494
+ }
1495
+ )
1496
+ ] }) }) });
1497
+ }
1498
+ function AgentExecutionLogs({
1499
+ resourceId,
1500
+ executionId,
1501
+ execution: externalExecution,
1502
+ selectedIterationId,
1503
+ iterationData,
1504
+ onExecutionDeleted
1505
+ }) {
1506
+ const isIterationSelected = selectedIterationId !== null;
1609
1507
  const logGroups = useMemo(() => {
1610
1508
  if (!iterationData) {
1611
1509
  return [];
@@ -1952,7 +1850,7 @@ function CommandQueueTaskRow({ task, onClick, onDelete }) {
1952
1850
  cursor: "pointer",
1953
1851
  border: "1px solid var(--color-border)",
1954
1852
  transition: "background var(--duration-fast) var(--easing)",
1955
- background: hovered ? "var(--active-background)" : "var(--glass-background)"
1853
+ background: hovered ? "var(--active-background)" : "var(--color-surface)"
1956
1854
  },
1957
1855
  onClick: (e) => {
1958
1856
  if (e.target.closest("[data-menu-dropdown]") || e.target.closest("button")) {
@@ -2232,6 +2130,113 @@ var CommandQueueSidebar = ({
2232
2130
  )
2233
2131
  ] });
2234
2132
  };
2133
+ function ContextUsageBadge({ currentTokens, maxTokens }) {
2134
+ const percentage = currentTokens / maxTokens * 100;
2135
+ const color = percentage > 90 ? "red" : percentage > 70 ? "yellow" : "green";
2136
+ return /* @__PURE__ */ jsx(
2137
+ Tooltip,
2138
+ {
2139
+ label: `${currentTokens.toLocaleString()} of ${maxTokens.toLocaleString()} tokens used (${percentage.toFixed(1)}%)`,
2140
+ position: "bottom",
2141
+ children: /* @__PURE__ */ jsxs(Group, { gap: 6, style: { cursor: "help" }, children: [
2142
+ /* @__PURE__ */ jsx(IconBrain, { size: 16, color: `var(--mantine-color-${color}-6)` }),
2143
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: color, fw: 500, children: [
2144
+ currentTokens.toLocaleString(),
2145
+ " / ",
2146
+ maxTokens.toLocaleString()
2147
+ ] }),
2148
+ /* @__PURE__ */ jsx(Progress, { value: percentage, color, size: "sm", w: 80, radius: "xl" })
2149
+ ] })
2150
+ }
2151
+ );
2152
+ }
2153
+ function parseMemoryContent(memory) {
2154
+ const parsedSessionMemory = {};
2155
+ for (const [key, entry] of Object.entries(memory.sessionMemory || {})) {
2156
+ try {
2157
+ if (typeof entry.content === "string") {
2158
+ parsedSessionMemory[key] = {
2159
+ ...entry,
2160
+ content: JSON.parse(entry.content)
2161
+ };
2162
+ } else {
2163
+ parsedSessionMemory[key] = entry;
2164
+ }
2165
+ } catch {
2166
+ parsedSessionMemory[key] = entry;
2167
+ }
2168
+ }
2169
+ const parsedHistory = (memory.history || []).map((entry) => {
2170
+ try {
2171
+ if (typeof entry.content === "string") {
2172
+ return {
2173
+ ...entry,
2174
+ content: JSON.parse(entry.content)
2175
+ };
2176
+ }
2177
+ return entry;
2178
+ } catch {
2179
+ return entry;
2180
+ }
2181
+ });
2182
+ return {
2183
+ sessionMemory: parsedSessionMemory,
2184
+ history: parsedHistory
2185
+ };
2186
+ }
2187
+ function SessionMemory({ memory }) {
2188
+ if (!memory) {
2189
+ return /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2190
+ /* @__PURE__ */ jsx(IconDatabase, { size: 18 }),
2191
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No memory data available" })
2192
+ ] });
2193
+ }
2194
+ const sessionMemoryKeys = Object.keys(memory.sessionMemory || {});
2195
+ const historyCount = memory.history?.length || 0;
2196
+ const parsedMemory = parseMemoryContent(memory);
2197
+ return /* @__PURE__ */ jsxs(Stack, { children: [
2198
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
2199
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2200
+ /* @__PURE__ */ jsx(IconDatabase, { size: 20 }),
2201
+ /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Session Memory" })
2202
+ ] }),
2203
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2204
+ /* @__PURE__ */ jsxs(Badge, { size: "sm", variant: "light", children: [
2205
+ sessionMemoryKeys.length,
2206
+ " keys"
2207
+ ] }),
2208
+ /* @__PURE__ */ jsxs(Badge, { size: "sm", variant: "light", children: [
2209
+ historyCount,
2210
+ " history items"
2211
+ ] })
2212
+ ] })
2213
+ ] }),
2214
+ /* @__PURE__ */ jsxs(Stack, { children: [
2215
+ /* @__PURE__ */ jsx(
2216
+ CollapsibleSection,
2217
+ {
2218
+ title: "Session Memory",
2219
+ count: sessionMemoryKeys.length,
2220
+ countLabel: "keys",
2221
+ emptyMessage: "No session memory stored",
2222
+ defaultExpanded: false,
2223
+ children: /* @__PURE__ */ jsx(JsonViewer, { data: parsedMemory.sessionMemory, maxHeight: 300 })
2224
+ }
2225
+ ),
2226
+ /* @__PURE__ */ jsx(
2227
+ CollapsibleSection,
2228
+ {
2229
+ title: "Conversation History",
2230
+ count: historyCount,
2231
+ countLabel: "items",
2232
+ emptyMessage: "No history available",
2233
+ defaultExpanded: false,
2234
+ children: /* @__PURE__ */ jsx(JsonViewer, { data: parsedMemory.history, maxHeight: 300 })
2235
+ }
2236
+ )
2237
+ ] })
2238
+ ] });
2239
+ }
2235
2240
  var triggerTypeIcons = {
2236
2241
  webhook: IconWebhook,
2237
2242
  schedule: IconClock,
@@ -2618,5 +2623,250 @@ var CommandViewGraph = forwardRef(
2618
2623
  return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(CommandViewGraphInner, { ref, ...props }) });
2619
2624
  }
2620
2625
  );
2626
+ function TaskCard({ task, onViewExecution, richTextRenderer }) {
2627
+ const [isExpanded, setIsExpanded] = useState(false);
2628
+ const { mutate: submitAction, isPending } = useSubmitAction();
2629
+ const { mutate: deleteTask, isPending: isDeleting } = useDeleteTask();
2630
+ const [actionModalOpened, setActionModalOpened] = useState(false);
2631
+ const [selectedAction, setSelectedAction] = useState(null);
2632
+ const [confirmAction, setConfirmAction] = useState(null);
2633
+ const [deleteConfirmOpened, setDeleteConfirmOpened] = useState(false);
2634
+ const handleActionClick = (action) => {
2635
+ if (action.requiresConfirmation) {
2636
+ setConfirmAction(action);
2637
+ } else if (action.form) {
2638
+ setSelectedAction(action);
2639
+ setActionModalOpened(true);
2640
+ } else {
2641
+ submitAction({
2642
+ taskId: task.id,
2643
+ actionId: action.id
2644
+ });
2645
+ }
2646
+ };
2647
+ const handleConfirm = () => {
2648
+ if (!confirmAction) return;
2649
+ if (confirmAction.form) {
2650
+ setSelectedAction(confirmAction);
2651
+ setActionModalOpened(true);
2652
+ } else {
2653
+ submitAction({
2654
+ taskId: task.id,
2655
+ actionId: confirmAction.id
2656
+ });
2657
+ }
2658
+ setConfirmAction(null);
2659
+ };
2660
+ const getPriorityColor2 = (priority) => {
2661
+ if (priority >= 8) return "red";
2662
+ if (priority >= 5) return "yellow";
2663
+ return "gray";
2664
+ };
2665
+ const getStatusColor2 = (status) => {
2666
+ switch (status) {
2667
+ case "pending":
2668
+ return "blue";
2669
+ case "processing":
2670
+ return "blue";
2671
+ case "completed":
2672
+ return "green";
2673
+ case "failed":
2674
+ return "red";
2675
+ case "expired":
2676
+ return "orange";
2677
+ default:
2678
+ return "gray";
2679
+ }
2680
+ };
2681
+ const handleRetry = () => {
2682
+ if (task.selectedAction) {
2683
+ submitAction({
2684
+ taskId: task.id,
2685
+ actionId: task.selectedAction,
2686
+ payload: task.actionPayload
2687
+ });
2688
+ }
2689
+ };
2690
+ const formatDate = (date) => {
2691
+ const now = /* @__PURE__ */ new Date();
2692
+ const diffMs = now.getTime() - date.getTime();
2693
+ const diffMins = Math.floor(diffMs / 6e4);
2694
+ const diffHours = Math.floor(diffMins / 60);
2695
+ const diffDays = Math.floor(diffHours / 24);
2696
+ if (diffMins < 60) return `${diffMins}m ago`;
2697
+ if (diffHours < 24) return `${diffHours}h ago`;
2698
+ return `${diffDays}d ago`;
2699
+ };
2700
+ return /* @__PURE__ */ jsx(
2701
+ Card,
2702
+ {
2703
+ withBorder: true,
2704
+ style: { transition: "box-shadow var(--duration-fast) var(--easing)" },
2705
+ onMouseEnter: (e) => {
2706
+ e.currentTarget.style.boxShadow = "var(--standard-box-shadow)";
2707
+ },
2708
+ onMouseLeave: (e) => {
2709
+ e.currentTarget.style.boxShadow = "";
2710
+ },
2711
+ children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
2712
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
2713
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", style: { flex: 1 }, children: [
2714
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: task.originResourceType === "agent" ? "blue" : "grape", children: task.originResourceType === "agent" ? /* @__PURE__ */ jsx(IconRobot, { size: 20 }) : /* @__PURE__ */ jsx(IconGitBranch, { size: 20 }) }),
2715
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
2716
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", mb: 4, children: [
2717
+ /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: task.description || "Task approval required" }),
2718
+ /* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: getPriorityColor2(task.priority), radius: "sm", children: [
2719
+ "P",
2720
+ task.priority
2721
+ ] })
2722
+ ] }),
2723
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2724
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
2725
+ task.originResourceType === "agent" ? "Agent" : "Workflow",
2726
+ ": ",
2727
+ task.originResourceId
2728
+ ] }),
2729
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "\u2022" }),
2730
+ /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
2731
+ /* @__PURE__ */ jsx(IconClock, { size: 12 }),
2732
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDate(task.createdAt) })
2733
+ ] })
2734
+ ] })
2735
+ ] })
2736
+ ] }),
2737
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2738
+ /* @__PURE__ */ jsx(
2739
+ Badge,
2740
+ {
2741
+ size: "sm",
2742
+ variant: "light",
2743
+ color: getStatusColor2(task.status),
2744
+ radius: "sm",
2745
+ leftSection: task.status === "processing" ? /* @__PURE__ */ jsx(Loader, { size: 6 }) : void 0,
2746
+ children: task.status.charAt(0).toUpperCase() + task.status.slice(1)
2747
+ }
2748
+ ),
2749
+ task.status === "failed" && /* @__PURE__ */ jsx(Button, { variant: "light", color: "red", size: "xs", loading: isPending, onClick: handleRetry, children: "Retry" }),
2750
+ /* @__PURE__ */ jsxs(Menu, { shadow: "md", position: "bottom-end", offset: 8, children: [
2751
+ /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", size: "sm", children: /* @__PURE__ */ jsx(IconDotsVertical, { size: 16 }) }) }),
2752
+ /* @__PURE__ */ jsx(Menu.Dropdown, { children: /* @__PURE__ */ jsx(
2753
+ Menu.Item,
2754
+ {
2755
+ leftSection: /* @__PURE__ */ jsx(IconTrash, { size: 14 }),
2756
+ disabled: task.status === "processing",
2757
+ onClick: () => setDeleteConfirmOpened(true),
2758
+ children: "Delete"
2759
+ }
2760
+ ) })
2761
+ ] })
2762
+ ] })
2763
+ ] }),
2764
+ /* @__PURE__ */ jsx(Accordion, { value: isExpanded ? "details" : null, onChange: (value) => setIsExpanded(!!value), children: /* @__PURE__ */ jsxs(Accordion.Item, { value: "details", children: [
2765
+ /* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: "View Context" }) }),
2766
+ /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsx(ContextViewer, { data: task.context }) })
2767
+ ] }) }),
2768
+ task.status === "pending" && /* @__PURE__ */ jsx(Group, { gap: "xs", children: task.actions.map((action) => {
2769
+ const Icon = getIcon(action.icon);
2770
+ const variant = "light";
2771
+ return /* @__PURE__ */ jsx(
2772
+ Button,
2773
+ {
2774
+ variant,
2775
+ color: action.color || (action.type === "danger" ? "red" : "blue"),
2776
+ leftSection: Icon ? /* @__PURE__ */ jsx(Icon, { size: 16 }) : null,
2777
+ loading: isPending,
2778
+ onClick: () => handleActionClick(action),
2779
+ title: action.description,
2780
+ size: "xs",
2781
+ radius: "xs",
2782
+ children: action.label
2783
+ },
2784
+ action.id
2785
+ );
2786
+ }) }),
2787
+ task.selectedAction && /* @__PURE__ */ jsx(Accordion, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: "submitted", children: [
2788
+ /* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2789
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "sm", variant: "light", color: "green", radius: "xl", children: /* @__PURE__ */ jsx(IconCheck, { size: 12 }) }),
2790
+ /* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
2791
+ "Submitted: ",
2792
+ task.actions.find((a) => a.id === task.selectedAction)?.label || task.selectedAction
2793
+ ] }),
2794
+ task.targetExecutionId && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "cyan", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 10 }), children: "Executed" })
2795
+ ] }) }),
2796
+ /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
2797
+ task.actionPayload !== void 0 && task.actionPayload !== null && /* @__PURE__ */ jsx(JsonViewer, { data: task.actionPayload, maxHeight: 200 }),
2798
+ task.completedAt && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
2799
+ "Completed ",
2800
+ formatDate(task.completedAt),
2801
+ task.completedBy ? ` by ${task.completedBy}` : ""
2802
+ ] }),
2803
+ task.targetExecutionId && /* @__PURE__ */ jsx(
2804
+ Button,
2805
+ {
2806
+ variant: "light",
2807
+ size: "xs",
2808
+ leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 14 }),
2809
+ onClick: () => {
2810
+ onViewExecution?.({
2811
+ resourceType: task.originResourceType,
2812
+ resourceId: task.originResourceId,
2813
+ executionId: task.targetExecutionId
2814
+ });
2815
+ },
2816
+ children: "View Execution"
2817
+ }
2818
+ )
2819
+ ] }) })
2820
+ ] }) }),
2821
+ /* @__PURE__ */ jsx(CustomModal, { opened: !!confirmAction, onClose: () => setConfirmAction(null), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
2822
+ /* @__PURE__ */ jsx(Text, { fw: 600, children: "Confirm Action" }),
2823
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: confirmAction?.confirmationMessage || `Are you sure you want to ${confirmAction?.label.toLowerCase()}?` }),
2824
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
2825
+ /* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setConfirmAction(null), children: "Cancel" }),
2826
+ /* @__PURE__ */ jsx(Button, { onClick: handleConfirm, children: confirmAction?.label })
2827
+ ] })
2828
+ ] }) }),
2829
+ selectedAction && /* @__PURE__ */ jsx(
2830
+ ActionModal,
2831
+ {
2832
+ action: selectedAction,
2833
+ task,
2834
+ opened: actionModalOpened,
2835
+ onClose: () => setActionModalOpened(false),
2836
+ onSubmit: (payload, notes) => {
2837
+ submitAction({
2838
+ taskId: task.id,
2839
+ actionId: selectedAction.id,
2840
+ payload,
2841
+ notes
2842
+ });
2843
+ setActionModalOpened(false);
2844
+ },
2845
+ richTextRenderer
2846
+ }
2847
+ ),
2848
+ /* @__PURE__ */ jsx(CustomModal, { opened: deleteConfirmOpened, onClose: () => setDeleteConfirmOpened(false), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
2849
+ /* @__PURE__ */ jsx(Text, { fw: 600, children: "Delete Task" }),
2850
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: "Are you sure you want to delete this task? This action cannot be undone." }),
2851
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
2852
+ /* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setDeleteConfirmOpened(false), children: "Cancel" }),
2853
+ /* @__PURE__ */ jsx(
2854
+ Button,
2855
+ {
2856
+ color: "red",
2857
+ loading: isDeleting,
2858
+ onClick: () => {
2859
+ deleteTask(task.id);
2860
+ setDeleteConfirmOpened(false);
2861
+ },
2862
+ children: "Delete"
2863
+ }
2864
+ )
2865
+ ] })
2866
+ ] }) })
2867
+ ] })
2868
+ }
2869
+ );
2870
+ }
2621
2871
 
2622
- export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewEdge, CommandViewGraph, CommandViewNode, ConfigCard, ContentSections, ContractDisplay, ExecutionErrorSection, FormFieldRenderer, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, ResourceDefinitionSection, TaskCard, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, useNewKnowledgeMapLayout };
2872
+ export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewEdge, CommandViewGraph, CommandViewNode, ConfigCard, ContentSections, ContextUsageBadge, ContractDisplay, ExecutionErrorSection, FormFieldRenderer, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, ResourceDefinitionSection, ResourceErrorState, ResourceFilter, ResourceHeader, ResourceNotFoundState, SessionMemory, TaskCard, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, useNewKnowledgeMapLayout };