@elevasis/ui 1.24.2 → 1.25.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 (42) hide show
  1. package/dist/charts/index.js +2 -2
  2. package/dist/{chunk-HOYZWSNV.js → chunk-3EVTCVKR.js} +2 -2
  3. package/dist/{chunk-7TLPKXC2.js → chunk-7RS6VTAV.js} +57 -58
  4. package/dist/{chunk-TQBM3OEW.js → chunk-BS4J2LAW.js} +1 -1
  5. package/dist/{chunk-JR2C4XAN.js → chunk-CYXZHBP4.js} +202 -295
  6. package/dist/{chunk-OH74INP2.js → chunk-FEZZ3IDU.js} +434 -314
  7. package/dist/{chunk-IAZT3VO6.js → chunk-G25YWGUL.js} +4 -1
  8. package/dist/{chunk-KLZB3MNC.js → chunk-HYYI4ZFT.js} +6 -252
  9. package/dist/{chunk-CTF6FS2M.js → chunk-L3GVDMCA.js} +211 -1
  10. package/dist/{chunk-EDAYKRPJ.js → chunk-QDO6NF2I.js} +28 -1
  11. package/dist/{chunk-RNL2IC2Y.js → chunk-QNABH7YG.js} +3 -3
  12. package/dist/{chunk-FATKFO7X.js → chunk-R565P6XC.js} +691 -2
  13. package/dist/{chunk-5266RV46.js → chunk-RIL2CDFE.js} +3 -3
  14. package/dist/{chunk-TML32XBW.js → chunk-RMPXGBNI.js} +2 -2
  15. package/dist/{chunk-N5SDJP44.js → chunk-US4JUSI3.js} +4 -4
  16. package/dist/components/index.d.ts +3006 -193
  17. package/dist/components/index.js +1541 -26
  18. package/dist/features/auth/index.d.ts +108 -9
  19. package/dist/features/dashboard/index.js +8 -8
  20. package/dist/features/monitoring/index.js +19 -9
  21. package/dist/features/operations/index.d.ts +74 -10
  22. package/dist/features/operations/index.js +236 -53
  23. package/dist/features/settings/index.d.ts +108 -9
  24. package/dist/features/settings/index.js +28 -11
  25. package/dist/hooks/index.d.ts +3303 -193
  26. package/dist/hooks/index.js +5 -5
  27. package/dist/hooks/published.d.ts +134 -19
  28. package/dist/hooks/published.js +4 -4
  29. package/dist/index.d.ts +3309 -195
  30. package/dist/index.js +6 -6
  31. package/dist/initialization/index.d.ts +108 -9
  32. package/dist/layout/index.d.ts +60 -3
  33. package/dist/layout/index.js +2 -2
  34. package/dist/profile/index.d.ts +108 -9
  35. package/dist/provider/index.d.ts +6 -2
  36. package/dist/provider/index.js +3 -3
  37. package/dist/provider/published.d.ts +6 -2
  38. package/dist/supabase/index.d.ts +210 -18
  39. package/dist/theme/index.d.ts +6 -2
  40. package/dist/theme/index.js +3 -3
  41. package/dist/types/index.d.ts +108 -9
  42. package/package.json +3 -3
@@ -1,17 +1,17 @@
1
1
  import { ChatHeader, ChatSidebar } from '../../chunk-ROSMICXG.js';
2
- import { ResourceDefinitionSection, CommandQueueTaskRow, getIcon, ActionModal, CommandViewGraph, WorkflowExecutionLogs, AgentExecutionLogs, ResourceFilter, getExecutionStatusConfig, SessionMemory } from '../../chunk-KLZB3MNC.js';
2
+ import { FormFieldRenderer, ResourceDefinitionSection, CommandQueueTaskRow, getIcon, ActionModal, CommandViewGraph, WorkflowExecutionLogs, AgentExecutionLogs, ResourceFilter, getExecutionStatusConfig, SessionMemory } from '../../chunk-HYYI4ZFT.js';
3
3
  import { SubshellLoader, SubshellSidebarSection, PageContainer, CollapsibleSidebarGroup, SidebarListItem } from '../../chunk-AWT255UH.js';
4
- import { ResourceHealthPanel } from '../../chunk-5266RV46.js';
4
+ import { ResourceHealthPanel } from '../../chunk-RIL2CDFE.js';
5
5
  import { ConfirmationModal, CustomModal } from '../../chunk-GBMNCNHX.js';
6
- import { ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline } from '../../chunk-RNL2IC2Y.js';
7
- import { useCyberColors, CyberDonut } from '../../chunk-N5SDJP44.js';
8
- import { PageTitleCaption, TabCountBadge, ResourceCard, ContextViewer, JsonViewer, APIErrorAlert, EmptyState, CardHeader } from '../../chunk-IAZT3VO6.js';
6
+ import { ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline } from '../../chunk-QNABH7YG.js';
7
+ import { useCyberColors, CyberDonut } from '../../chunk-US4JUSI3.js';
8
+ import { PageTitleCaption, TabCountBadge, ResourceCard, ContextViewer, JsonViewer, APIErrorAlert, EmptyState, CardHeader } from '../../chunk-G25YWGUL.js';
9
9
  import '../../chunk-3KMDHCAR.js';
10
10
  import '../../chunk-NNKKBSJN.js';
11
11
  import { AppShellLoader } from '../../chunk-WWEMNIHW.js';
12
12
  import { topbarHeight } from '../../chunk-QJ2S46NI.js';
13
- import { useStatusFilter, useResourceSearch, useResourcesDomainFilters, filterByDomainFilters, useCommandViewDomainFilters } from '../../chunk-FATKFO7X.js';
14
- import { usePaginationState, useResources, useRecentExecutionsByResource, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueueTotals, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStore, useCommandViewStats, useCalibrationProjects, useCalibrationProject, useAllCalibrationProjects, useResourceExecutions, useCheckpointTasks, useCalibrationSSE, useCalibrationRunFull, useExecuteRun, useGradeRun, useCalibrationRuns, useExecutionPanelState, useExecution, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, calibrationKeys, useDeleteProject, useCreateProject } from '../../chunk-EDAYKRPJ.js';
13
+ import { useStatusFilter, useResourceSearch, useResourcesDomainFilters, filterByDomainFilters, useCommandViewDomainFilters } from '../../chunk-R565P6XC.js';
14
+ import { usePaginationState, useResources, useRecentExecutionsByResource, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueueTotals, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStore, useCommandViewStats, useCalibrationProjects, useCalibrationProject, useAllCalibrationProjects, useResourceExecutions, useCheckpointTasks, useCalibrationSSE, useCalibrationRunFull, useExecuteRun, useGradeRun, useCalibrationRuns, useExecutionPanelState, useExecution, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, calibrationKeys, useDeleteProject, useCreateProject } from '../../chunk-QDO6NF2I.js';
15
15
  import '../../chunk-NJJ3NQ7B.js';
16
16
  import '../../chunk-LXHZYSMQ.js';
17
17
  import '../../chunk-MHW43EOH.js';
@@ -21,10 +21,10 @@ import { ResourceStatusColors } from '../../chunk-ELJIFLCB.js';
21
21
  import '../../chunk-L4XXM55J.js';
22
22
  import '../../chunk-SLVC5OJ2.js';
23
23
  import '../../chunk-RNP5R5I3.js';
24
- import '../../chunk-TML32XBW.js';
24
+ import '../../chunk-RMPXGBNI.js';
25
25
  import '../../chunk-SZHARWKU.js';
26
- import '../../chunk-OH74INP2.js';
27
- import '../../chunk-JR2C4XAN.js';
26
+ import '../../chunk-FEZZ3IDU.js';
27
+ import '../../chunk-CYXZHBP4.js';
28
28
  import '../../chunk-R7WLWGPO.js';
29
29
  import '../../chunk-NVOCKXUQ.js';
30
30
  import '../../chunk-V7XHGJQZ.js';
@@ -37,8 +37,8 @@ import { useOrganization } from '../../chunk-DD3CCMCZ.js';
37
37
  import '../../chunk-QEPXAWE2.js';
38
38
  import '../../chunk-BRJ3QZ4E.js';
39
39
  import '../../chunk-Q7DJKLEN.js';
40
- import { Stack, Card, Text, Button, Tabs, Group, Pagination, useMantineTheme, Box, Center, Loader, UnstyledButton, TextInput, Divider, Paper, Badge, ActionIcon, Title, SimpleGrid, CopyButton, SegmentedControl, ThemeIcon, Alert, Switch, Space, Progress, Timeline, Collapse, ScrollArea, Tooltip, Textarea, Menu, Modal, Table } from '@mantine/core';
41
- import { IconApps, IconRoute, IconBrain, IconRefresh, IconAdjustmentsHorizontal, IconSearch, IconChevronDown, IconCircleX, IconCircleCheck, IconCircleDashed, IconTrash, IconArrowLeft, IconClock, IconCheck, IconCopy, IconExternalLink, IconPlayerPlay, IconAlertCircle, IconPlus, IconAdjustments, IconSitemap, IconSettings, IconX, IconChartBar, IconReportAnalytics, IconCoin, IconChevronRight, IconFlask, IconInfoCircle, IconMessage, IconAlertTriangle, IconRobot, IconLayoutSidebarRightExpand, IconNote, IconArchive, IconDownload, IconTimeline, IconDotsVertical } from '@tabler/icons-react';
40
+ import { Stack, Card, Text, Button, Tabs, Group, Pagination, useMantineTheme, Box, Center, Loader, UnstyledButton, TextInput, Divider, Modal, Code, Alert, LoadingOverlay, Badge, Paper, ActionIcon, Title, SimpleGrid, CopyButton, SegmentedControl, ThemeIcon, Switch, Space, Progress, Timeline, Collapse, ScrollArea, Tooltip, Textarea, Menu, Table } from '@mantine/core';
41
+ import { IconApps, IconRoute, IconBrain, IconRefresh, IconAdjustmentsHorizontal, IconSearch, IconChevronDown, IconCircleX, IconCircleCheck, IconCircleDashed, IconCheck, IconExternalLink, IconAlertCircle, IconTrash, IconArrowLeft, IconClock, IconCopy, IconPlayerPlay, IconPlus, IconAdjustments, IconSitemap, IconSettings, IconX, IconChartBar, IconReportAnalytics, IconCoin, IconChevronRight, IconFlask, IconInfoCircle, IconMessage, IconAlertTriangle, IconRobot, IconLayoutSidebarRightExpand, IconNote, IconArchive, IconDownload, IconTimeline, IconDotsVertical } from '@tabler/icons-react';
42
42
  import { useState, useEffect, useMemo, useRef, useCallback } from 'react';
43
43
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
44
44
  import { useClipboard } from '@mantine/hooks';
@@ -246,7 +246,7 @@ function ResourcesPage({
246
246
  compact: true
247
247
  }
248
248
  ),
249
- style: isDormant ? { opacity: 0.7 } : void 0
249
+ style: isDormant ? { opacity: 0.4 } : void 0
250
250
  },
251
251
  resource.resourceId
252
252
  );
@@ -556,7 +556,16 @@ function ResourcesSidebar({ timeRange }) {
556
556
  ] })
557
557
  ] });
558
558
  }
559
- function ResourceHeader({ resource, type, connected, runningCount, sessionCapable }) {
559
+ function ResourceHeader({
560
+ resource,
561
+ type,
562
+ connected,
563
+ runningCount,
564
+ sessionCapable,
565
+ onRun,
566
+ onNavigateToResources,
567
+ onNavigateToSessions
568
+ }) {
560
569
  const { currentMembership } = useOrganization();
561
570
  const organizationName = currentMembership?.organization?.name;
562
571
  const navigate = useNavigate();
@@ -569,12 +578,11 @@ function ResourceHeader({ resource, type, connected, runningCount, sessionCapabl
569
578
  color: "teal"
570
579
  });
571
580
  };
572
- const handleGoToSessions = () => {
573
- navigate({
574
- to: "/operations/sessions",
575
- search: { agent: resource.resourceId }
576
- });
577
- };
581
+ const handleGoToSessions = onNavigateToSessions ?? (() => navigate({
582
+ to: "/operations/sessions",
583
+ search: { agent: resource.resourceId }
584
+ }));
585
+ const handleGoToResources = onNavigateToResources ?? (() => navigate({ to: "/operations/resources" }));
578
586
  return /* @__PURE__ */ jsxs(Fragment, { children: [
579
587
  /* @__PURE__ */ jsx(
580
588
  PageTitleCaption,
@@ -610,17 +618,9 @@ function ResourceHeader({ resource, type, connected, runningCount, sessionCapabl
610
618
  runningCount,
611
619
  " running"
612
620
  ] }),
621
+ onRun && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "filled", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 16 }), onClick: onRun, children: "Run" }),
613
622
  type === "agent" && sessionCapable && /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconMessage, { size: 16 }), onClick: handleGoToSessions, children: "Go to Sessions" }),
614
- /* @__PURE__ */ jsx(
615
- Button,
616
- {
617
- size: "sm",
618
- variant: "light",
619
- leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
620
- onClick: () => navigate({ to: "/operations/resources" }),
621
- children: "Resources"
622
- }
623
- )
623
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }), onClick: handleGoToResources, children: "Resources" })
624
624
  ] })
625
625
  ] })
626
626
  ] });
@@ -631,10 +631,11 @@ function ResourceErrorState({ error }) {
631
631
  /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: error.message })
632
632
  ] }) }) });
633
633
  }
634
- function ResourceNotFoundState({ type, resourceId }) {
634
+ function ResourceNotFoundState({ type, resourceId, onNavigateBack }) {
635
635
  const navigate = useNavigate();
636
636
  const { currentMembership } = useOrganization();
637
637
  const orgName = currentMembership?.organization?.name || "current organization";
638
+ const handleBack = onNavigateBack ?? (() => navigate({ to: "/operations", search: { type: void 0 } }));
638
639
  return /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", children: [
639
640
  /* @__PURE__ */ jsx(Text, { size: "lg", c: "dimmed", fw: 500, children: "Resource not found" }),
640
641
  /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", ta: "center", children: [
@@ -647,22 +648,186 @@ function ResourceNotFoundState({ type, resourceId }) {
647
648
  "."
648
649
  ] }),
649
650
  /* @__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." }),
650
- /* @__PURE__ */ jsx(
651
- Button,
652
- {
653
- variant: "light",
654
- leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
655
- onClick: () => navigate({ to: "/operations", search: { type: void 0 } }),
656
- children: "Back to Operations"
657
- }
658
- )
651
+ /* @__PURE__ */ jsx(Button, { variant: "light", leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }), onClick: handleBack, children: "Back to Operations" })
659
652
  ] }) }) });
660
653
  }
661
- function ResourceDetailPage({ type, resourceId, timeRange, renderExecutionPanel }) {
654
+ function ExecuteWorkflowModal({
655
+ opened,
656
+ onClose,
657
+ resource,
658
+ isPending = false,
659
+ error,
660
+ result,
661
+ onViewExecution,
662
+ onReset,
663
+ children
664
+ }) {
665
+ const canClose = !isPending;
666
+ const title = resource.name ?? resource.resourceId;
667
+ return /* @__PURE__ */ jsx(
668
+ Modal,
669
+ {
670
+ opened,
671
+ onClose: canClose ? onClose : () => void 0,
672
+ centered: true,
673
+ size: "lg",
674
+ closeOnClickOutside: canClose,
675
+ closeOnEscape: canClose,
676
+ withCloseButton: canClose,
677
+ title: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
678
+ /* @__PURE__ */ jsxs(Text, { fw: 600, children: [
679
+ "Run ",
680
+ resource.resourceType
681
+ ] }),
682
+ /* @__PURE__ */ jsx(Badge, { color: "blue", variant: "light", size: "sm", children: resource.resourceType })
683
+ ] }),
684
+ children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
685
+ /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", children: [
686
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Target:" }),
687
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: title }),
688
+ /* @__PURE__ */ jsx(Code, { children: resource.resourceId })
689
+ ] }),
690
+ /* @__PURE__ */ jsx(Divider, {}),
691
+ result ? /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
692
+ /* @__PURE__ */ jsx(Alert, { variant: "light", color: "teal", title: "Execution started", icon: /* @__PURE__ */ jsx(IconCheck, { size: 16 }), children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
693
+ /* @__PURE__ */ jsxs(Text, { size: "sm", children: [
694
+ "The ",
695
+ resource.resourceType,
696
+ " is now running."
697
+ ] }),
698
+ /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
699
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Execution ID:" }),
700
+ /* @__PURE__ */ jsx(Code, { children: result.executionId })
701
+ ] })
702
+ ] }) }),
703
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "xs", children: [
704
+ onReset && /* @__PURE__ */ jsx(Button, { variant: "default", onClick: onReset, children: "Run again" }),
705
+ onViewExecution && /* @__PURE__ */ jsx(
706
+ Button,
707
+ {
708
+ leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 16 }),
709
+ onClick: () => onViewExecution(result.executionId),
710
+ children: "View execution"
711
+ }
712
+ ),
713
+ /* @__PURE__ */ jsx(Button, { variant: "light", onClick: onClose, children: "Close" })
714
+ ] })
715
+ ] }) : error ? /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
716
+ /* @__PURE__ */ jsx(Alert, { variant: "light", color: "red", title: "Execution failed to start", icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), children: /* @__PURE__ */ jsx(Text, { size: "sm", children: error.message || "An unknown error occurred." }) }),
717
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "xs", children: [
718
+ onReset && /* @__PURE__ */ jsx(Button, { variant: "default", onClick: onReset, children: "Try again" }),
719
+ /* @__PURE__ */ jsx(Button, { variant: "light", onClick: onClose, children: "Close" })
720
+ ] })
721
+ ] }) : /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
722
+ /* @__PURE__ */ jsx(LoadingOverlay, { visible: isPending, zIndex: 1e3, overlayProps: { blur: 2 } }),
723
+ children ?? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No input form provided." })
724
+ ] })
725
+ ] })
726
+ }
727
+ );
728
+ }
729
+ function getInitialValues(fields) {
730
+ const values = {};
731
+ for (const field of fields) {
732
+ values[field.name] = field.defaultValue ?? (field.type === "checkbox" ? false : "");
733
+ }
734
+ return values;
735
+ }
736
+ function applyFieldMappings(values, mappings) {
737
+ if (!mappings) return values;
738
+ const mapped = {};
739
+ for (const [key, value] of Object.entries(values)) {
740
+ const targetKey = mappings[key] ?? key;
741
+ mapped[targetKey] = value;
742
+ }
743
+ return mapped;
744
+ }
745
+ function ResourceExecuteForm({
746
+ formSchema,
747
+ onSubmit,
748
+ isPending = false,
749
+ disabled = false,
750
+ submitLabel = "Run"
751
+ }) {
752
+ const hasFields = formSchema?.fields?.length > 0;
753
+ const form = useForm({
754
+ initialValues: hasFields ? getInitialValues(formSchema.fields) : {},
755
+ validate: hasFields ? Object.fromEntries(
756
+ formSchema.fields.filter((f) => f.required).map((f) => [
757
+ f.name,
758
+ (value) => !value && value !== false ? `${f.label} is required` : null
759
+ ])
760
+ ) : {}
761
+ });
762
+ const handleSubmit = (values) => {
763
+ const input = applyFieldMappings(values, formSchema?.fieldMappings);
764
+ void onSubmit(input);
765
+ };
766
+ if (!hasFields) {
767
+ return /* @__PURE__ */ jsxs(Stack, { children: [
768
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This workflow takes no input." }),
769
+ /* @__PURE__ */ jsx(Button, { onClick: () => void onSubmit({}), loading: isPending, disabled, fullWidth: true, children: isPending ? formSchema?.submitButton?.loadingLabel ?? "Running..." : submitLabel })
770
+ ] });
771
+ }
772
+ return /* @__PURE__ */ jsx("form", { onSubmit: form.onSubmit(handleSubmit), children: /* @__PURE__ */ jsxs(Stack, { children: [
773
+ formSchema.fields.map((field) => /* @__PURE__ */ jsx(FormFieldRenderer, { field, form }, field.name)),
774
+ /* @__PURE__ */ jsx(Button, { type: "submit", loading: isPending, disabled, fullWidth: true, children: isPending ? formSchema.submitButton?.loadingLabel ?? "Running..." : submitLabel })
775
+ ] }) });
776
+ }
777
+ function ResourceExecuteDialog({ opened, onClose, resource, onViewExecution }) {
778
+ const mutation = useExecuteAsync();
779
+ const handleSubmit = async (input) => {
780
+ await mutation.mutateAsync({
781
+ resourceId: resource.resourceId,
782
+ resourceType: resource.resourceType,
783
+ input
784
+ });
785
+ };
786
+ const handleReset = () => {
787
+ mutation.reset();
788
+ };
789
+ const modalResource = {
790
+ resourceId: resource.resourceId,
791
+ resourceType: resource.resourceType,
792
+ name: resource.name
793
+ };
794
+ return /* @__PURE__ */ jsx(
795
+ ExecuteWorkflowModal,
796
+ {
797
+ opened,
798
+ onClose,
799
+ resource: modalResource,
800
+ isPending: mutation.isPending,
801
+ error: mutation.error,
802
+ result: mutation.data ?? null,
803
+ onViewExecution,
804
+ onReset: handleReset,
805
+ children: /* @__PURE__ */ jsx(
806
+ ResourceExecuteForm,
807
+ {
808
+ formSchema: resource.formSchema ?? { fields: [] },
809
+ onSubmit: handleSubmit,
810
+ isPending: mutation.isPending,
811
+ disabled: mutation.isPending
812
+ }
813
+ )
814
+ }
815
+ );
816
+ }
817
+ function ResourceDetailPage({
818
+ type,
819
+ resourceId,
820
+ timeRange,
821
+ renderExecutionPanel,
822
+ onNavigateToResources,
823
+ onNavigateToSessions,
824
+ onNavigateBack
825
+ }) {
662
826
  const { organizationReady } = useInitialization();
663
827
  const { data, isLoading, error } = useResources();
664
828
  const [connected, setConnected] = useState(false);
665
829
  const [runningCount, setRunningCount] = useState(0);
830
+ const [runOpened, setRunOpened] = useState(false);
666
831
  const resource = data ? (() => {
667
832
  const resources = [...data.workflows, ...data.agents];
668
833
  const found = resources.find((r) => r.resourceId === resourceId && r.type === type);
@@ -684,23 +849,41 @@ function ResourceDetailPage({ type, resourceId, timeRange, renderExecutionPanel
684
849
  return /* @__PURE__ */ jsx(ResourceErrorState, { error });
685
850
  }
686
851
  if (!resource) {
687
- return /* @__PURE__ */ jsx(ResourceNotFoundState, { type, resourceId });
852
+ return /* @__PURE__ */ jsx(ResourceNotFoundState, { type, resourceId, onNavigateBack });
688
853
  }
689
854
  const validResource = resource;
690
855
  const sessionCapable = isSessionCapable(type, resourceDefinition);
691
- return /* @__PURE__ */ jsxs(Stack, { children: [
856
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
692
857
  /* @__PURE__ */ jsx(
693
- ResourceHeader,
858
+ ResourceExecuteDialog,
694
859
  {
695
- resource: validResource,
696
- type,
697
- connected,
698
- runningCount,
699
- sessionCapable
860
+ opened: runOpened,
861
+ onClose: () => setRunOpened(false),
862
+ resource: {
863
+ resourceId,
864
+ resourceType: type,
865
+ name: validResource.name,
866
+ formSchema: resourceDefinition?.interface?.form
867
+ }
700
868
  }
701
869
  ),
702
- /* @__PURE__ */ jsx(ResourceHealthPanel, { resourceId, resourceType: type, timeRange }),
703
- resourceDefinition && /* @__PURE__ */ jsx(ResourceDefinitionSection, { resourceDefinition }),
870
+ /* @__PURE__ */ jsxs(Stack, { children: [
871
+ /* @__PURE__ */ jsx(
872
+ ResourceHeader,
873
+ {
874
+ resource: validResource,
875
+ type,
876
+ connected,
877
+ runningCount,
878
+ sessionCapable,
879
+ onRun: () => setRunOpened(true),
880
+ onNavigateToResources,
881
+ onNavigateToSessions
882
+ }
883
+ ),
884
+ /* @__PURE__ */ jsx(ResourceHealthPanel, { resourceId, resourceType: type, timeRange }),
885
+ resourceDefinition && /* @__PURE__ */ jsx(ResourceDefinitionSection, { resourceDefinition })
886
+ ] }),
704
887
  /* @__PURE__ */ jsx(
705
888
  Paper,
706
889
  {
@@ -762,7 +945,7 @@ function CommandQueuePage({
762
945
  }, [tasks.length, isLoadingTasks]);
763
946
  if (isLoadingCheckpoints || !organizationReady) return /* @__PURE__ */ jsx(AppShellLoader, {});
764
947
  const totalTasks = checkpointData?.total ?? 0;
765
- return /* @__PURE__ */ jsxs(Fragment, { children: [
948
+ return /* @__PURE__ */ jsxs(Stack, { children: [
766
949
  /* @__PURE__ */ jsx(PageTitleCaption, { title: "Command Queue", caption: "Human-in-the-loop approval system for agent/workflow actions" }),
767
950
  /* @__PURE__ */ jsx(Stack, { gap: "xs", children: isLoadingTasks ? /* @__PURE__ */ jsx(AppShellLoader, {}) : tasks.length === 0 ? /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsx(Text, { ta: "center", c: "dimmed", children: "No tasks found" }) }) : tasks.map((task) => /* @__PURE__ */ jsx(
768
951
  CommandQueueTaskRow,
@@ -3588,4 +3771,4 @@ function AgentListItem({ agent, isSelected, onAgentClick }) {
3588
3771
  );
3589
3772
  }
3590
3773
 
3591
- export { AgentExecutionPanel, AgentSessionGroup, CalibrationPage, CalibrationProgress, CalibrationProjectDetailPage, CalibrationProjectsPage, CalibrationRunDetailPage, CalibrationSidebar, CommandQueueDetailPage, CommandQueuePage, CommandViewPage, CommandViewSidebarContent, ExecutionPanel, ResourceDetailPage, ResourcesPage, ResourcesSidebar, SessionChatArea, SessionChatInterface, SessionChatPage, SessionDetailsSidebar, SessionExecutionLogs, SessionHeader, SessionListItem, SessionsPage, SessionsSidebar, WorkflowExecutionPanel };
3774
+ export { AgentExecutionPanel, AgentSessionGroup, CalibrationPage, CalibrationProgress, CalibrationProjectDetailPage, CalibrationProjectsPage, CalibrationRunDetailPage, CalibrationSidebar, CommandQueueDetailPage, CommandQueuePage, CommandViewPage, CommandViewSidebarContent, ExecuteWorkflowModal, ExecutionPanel, ResourceDetailPage, ResourceExecuteDialog, ResourceExecuteForm, ResourcesPage, ResourcesSidebar, SessionChatArea, SessionChatInterface, SessionChatPage, SessionDetailsSidebar, SessionExecutionLogs, SessionHeader, SessionListItem, SessionsPage, SessionsSidebar, WorkflowExecutionPanel };
@@ -12,7 +12,6 @@ type Database = {
12
12
  Tables: {
13
13
  acq_companies: {
14
14
  Row: {
15
- attio_company_id: string | null;
16
15
  batch_id: string | null;
17
16
  category: string | null;
18
17
  category_pain: string | null;
@@ -36,7 +35,6 @@ type Database = {
36
35
  website: string | null;
37
36
  };
38
37
  Insert: {
39
- attio_company_id?: string | null;
40
38
  batch_id?: string | null;
41
39
  category?: string | null;
42
40
  category_pain?: string | null;
@@ -60,7 +58,6 @@ type Database = {
60
58
  website?: string | null;
61
59
  };
62
60
  Update: {
63
- attio_company_id?: string | null;
64
61
  batch_id?: string | null;
65
62
  category?: string | null;
66
63
  category_pain?: string | null;
@@ -95,7 +92,6 @@ type Database = {
95
92
  };
96
93
  acq_contacts: {
97
94
  Row: {
98
- attio_person_id: string | null;
99
95
  batch_id: string | null;
100
96
  brochure_first_viewed_at: string | null;
101
97
  brochure_view_count: number;
@@ -121,7 +117,6 @@ type Database = {
121
117
  updated_at: string;
122
118
  };
123
119
  Insert: {
124
- attio_person_id?: string | null;
125
120
  batch_id?: string | null;
126
121
  brochure_first_viewed_at?: string | null;
127
122
  brochure_view_count?: number;
@@ -147,7 +142,6 @@ type Database = {
147
142
  updated_at?: string;
148
143
  };
149
144
  Update: {
150
- attio_person_id?: string | null;
151
145
  batch_id?: string | null;
152
146
  brochure_first_viewed_at?: string | null;
153
147
  brochure_view_count?: number;
@@ -305,10 +299,117 @@ type Database = {
305
299
  }
306
300
  ];
307
301
  };
302
+ acq_deal_notes: {
303
+ Row: {
304
+ author_user_id: string | null;
305
+ body: string;
306
+ created_at: string;
307
+ deal_id: string;
308
+ id: string;
309
+ organization_id: string;
310
+ updated_at: string;
311
+ };
312
+ Insert: {
313
+ author_user_id?: string | null;
314
+ body: string;
315
+ created_at?: string;
316
+ deal_id: string;
317
+ id?: string;
318
+ organization_id: string;
319
+ updated_at?: string;
320
+ };
321
+ Update: {
322
+ author_user_id?: string | null;
323
+ body?: string;
324
+ created_at?: string;
325
+ deal_id?: string;
326
+ id?: string;
327
+ organization_id?: string;
328
+ updated_at?: string;
329
+ };
330
+ Relationships: [
331
+ {
332
+ foreignKeyName: "acq_deal_notes_deal_id_fkey";
333
+ columns: ["deal_id"];
334
+ isOneToOne: false;
335
+ referencedRelation: "acq_deals";
336
+ referencedColumns: ["id"];
337
+ },
338
+ {
339
+ foreignKeyName: "acq_deal_notes_organization_id_fkey";
340
+ columns: ["organization_id"];
341
+ isOneToOne: false;
342
+ referencedRelation: "organizations";
343
+ referencedColumns: ["id"];
344
+ }
345
+ ];
346
+ };
347
+ acq_deal_tasks: {
348
+ Row: {
349
+ assignee_user_id: string | null;
350
+ completed_at: string | null;
351
+ completed_by_user_id: string | null;
352
+ created_at: string;
353
+ created_by_user_id: string | null;
354
+ deal_id: string;
355
+ description: string | null;
356
+ due_at: string | null;
357
+ id: string;
358
+ kind: string;
359
+ organization_id: string;
360
+ title: string;
361
+ updated_at: string;
362
+ };
363
+ Insert: {
364
+ assignee_user_id?: string | null;
365
+ completed_at?: string | null;
366
+ completed_by_user_id?: string | null;
367
+ created_at?: string;
368
+ created_by_user_id?: string | null;
369
+ deal_id: string;
370
+ description?: string | null;
371
+ due_at?: string | null;
372
+ id?: string;
373
+ kind?: string;
374
+ organization_id: string;
375
+ title: string;
376
+ updated_at?: string;
377
+ };
378
+ Update: {
379
+ assignee_user_id?: string | null;
380
+ completed_at?: string | null;
381
+ completed_by_user_id?: string | null;
382
+ created_at?: string;
383
+ created_by_user_id?: string | null;
384
+ deal_id?: string;
385
+ description?: string | null;
386
+ due_at?: string | null;
387
+ id?: string;
388
+ kind?: string;
389
+ organization_id?: string;
390
+ title?: string;
391
+ updated_at?: string;
392
+ };
393
+ Relationships: [
394
+ {
395
+ foreignKeyName: "acq_deal_tasks_deal_id_fkey";
396
+ columns: ["deal_id"];
397
+ isOneToOne: false;
398
+ referencedRelation: "acq_deals";
399
+ referencedColumns: ["id"];
400
+ },
401
+ {
402
+ foreignKeyName: "acq_deal_tasks_organization_id_fkey";
403
+ columns: ["organization_id"];
404
+ isOneToOne: false;
405
+ referencedRelation: "organizations";
406
+ referencedColumns: ["id"];
407
+ }
408
+ ];
409
+ };
308
410
  acq_deals: {
309
411
  Row: {
310
412
  activity_log: Json;
311
- attio_deal_id: string;
312
413
  cached_stage: string | null;
313
414
  closed_lost_at: string | null;
314
415
  closed_lost_reason: string | null;
@@ -343,7 +444,6 @@ type Database = {
343
444
  };
344
445
  Insert: {
345
446
  activity_log?: Json;
346
- attio_deal_id: string;
347
447
  cached_stage?: string | null;
348
448
  closed_lost_at?: string | null;
349
449
  closed_lost_reason?: string | null;
@@ -378,7 +478,6 @@ type Database = {
378
478
  };
379
479
  Update: {
380
480
  activity_log?: Json;
381
- attio_deal_id?: string;
382
481
  cached_stage?: string | null;
383
482
  closed_lost_at?: string | null;
384
483
  closed_lost_reason?: string | null;
@@ -1,14 +1,14 @@
1
- import { useAvailablePresets } from '../../chunk-TQBM3OEW.js';
2
- import { OrganizationMembershipsList, WebhookUrlDisplayModal, MembershipFeaturePanel, MembershipStatusBadge, getCredentialSchema, OAuthConnectModal, buildCredentialValue } from '../../chunk-HOYZWSNV.js';
1
+ import { useAvailablePresets } from '../../chunk-BS4J2LAW.js';
2
+ import { OrganizationMembershipsList, WebhookUrlDisplayModal, MembershipFeaturePanel, MembershipStatusBadge, getCredentialSchema, OAuthConnectModal, buildCredentialValue } from '../../chunk-3EVTCVKR.js';
3
3
  import '../../chunk-PDHTXPSF.js';
4
4
  import { CustomModal } from '../../chunk-GBMNCNHX.js';
5
- import { PageTitleCaption, EmptyState, CardHeader, ListSkeleton, StatCard } from '../../chunk-IAZT3VO6.js';
5
+ import { PageTitleCaption, EmptyState, CardHeader, ListSkeleton, StatCard } from '../../chunk-G25YWGUL.js';
6
6
  import '../../chunk-3KMDHCAR.js';
7
7
  import '../../chunk-NNKKBSJN.js';
8
8
  import { AppShellLoader } from '../../chunk-WWEMNIHW.js';
9
9
  import '../../chunk-QJ2S46NI.js';
10
- import { useUserMemberships, useUpdateWebhookEndpoint, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from '../../chunk-FATKFO7X.js';
11
- import { useResources, showErrorNotification } from '../../chunk-EDAYKRPJ.js';
10
+ import { useUserMemberships, useUpdateWebhookEndpoint, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from '../../chunk-R565P6XC.js';
11
+ import { useResources, showErrorNotification } from '../../chunk-QDO6NF2I.js';
12
12
  import '../../chunk-NJJ3NQ7B.js';
13
13
  import '../../chunk-LXHZYSMQ.js';
14
14
  import '../../chunk-MHW43EOH.js';
@@ -17,10 +17,10 @@ import '../../chunk-ELJIFLCB.js';
17
17
  import '../../chunk-L4XXM55J.js';
18
18
  import '../../chunk-SLVC5OJ2.js';
19
19
  import '../../chunk-RNP5R5I3.js';
20
- import '../../chunk-TML32XBW.js';
20
+ import '../../chunk-RMPXGBNI.js';
21
21
  import '../../chunk-SZHARWKU.js';
22
- import '../../chunk-OH74INP2.js';
23
- import '../../chunk-JR2C4XAN.js';
22
+ import '../../chunk-FEZZ3IDU.js';
23
+ import '../../chunk-CYXZHBP4.js';
24
24
  import '../../chunk-R7WLWGPO.js';
25
25
  import '../../chunk-NVOCKXUQ.js';
26
26
  import '../../chunk-V7XHGJQZ.js';
@@ -38,7 +38,7 @@ import { IconUser, IconCheck, IconCopy, IconMail, IconRefresh, IconAlertCircle,
38
38
  import { notifications } from '@mantine/notifications';
39
39
  import { useMutation, useQueryClient } from '@tanstack/react-query';
40
40
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
41
- import { useRef, useEffect, useMemo, useState, useCallback } from 'react';
41
+ import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
42
42
  import { create } from 'zustand';
43
43
  import { useForm } from '@mantine/form';
44
44
 
@@ -262,6 +262,7 @@ function AppearanceSettings({ initialTheme, onThemeChange }) {
262
262
  const { updateTheme } = useUpdateThemePreference();
263
263
  const { setColorScheme: setMantineColorScheme } = useMantineColorScheme();
264
264
  const availablePresets = useAvailablePresets();
265
+ const [modalOpen, setModalOpen] = useState(false);
265
266
  const hydratedRef = useRef(false);
266
267
  if (!hydratedRef.current) {
267
268
  setInternalTheme(initialTheme);
@@ -390,7 +391,8 @@ function AppearanceSettings({ initialTheme, onThemeChange }) {
390
391
  ] }),
391
392
  /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
392
393
  /* @__PURE__ */ jsx(Button, { variant: "default", size: "xs", children: "Export" }),
393
- /* @__PURE__ */ jsx(Button, { size: "xs", leftSection: /* @__PURE__ */ jsx(IconSparkles, { size: 14 }), children: "New Workflow" })
394
+ /* @__PURE__ */ jsx(Button, { size: "xs", leftSection: /* @__PURE__ */ jsx(IconSparkles, { size: 14 }), children: "New Workflow" }),
395
+ /* @__PURE__ */ jsx(Button, { variant: "light", size: "xs", onClick: () => setModalOpen(true), children: "Open Modal Preview" })
394
396
  ] })
395
397
  ] }),
396
398
  /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 1, sm: 3 }, spacing: "sm", children: [
@@ -488,7 +490,22 @@ function AppearanceSettings({ initialTheme, onThemeChange }) {
488
490
  /* @__PURE__ */ jsx(Alert, { variant: "light", color: "green", icon: /* @__PURE__ */ jsx(IconCheck, { size: 16 }), title: "Success", children: "Operation completed successfully." })
489
491
  ] })
490
492
  ] })
491
- ] })
493
+ ] }),
494
+ /* @__PURE__ */ jsx(CustomModal, { opened: modalOpen, onClose: () => setModalOpen(false), size: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", p: "md", children: [
495
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Modal Preview" }),
496
+ /* @__PURE__ */ jsxs(Text, { size: "sm", children: [
497
+ "Modals should sit visibly above the page background. Elevation comes from the",
498
+ " ",
499
+ /* @__PURE__ */ jsx(Text, { span: true, ff: "monospace", size: "sm", children: "--color-elevated" }),
500
+ " ",
501
+ "token, which every preset defines as an opaque surface."
502
+ ] }),
503
+ /* @__PURE__ */ jsx(TextInput, { label: "Example field", placeholder: "Type something...", size: "xs" }),
504
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
505
+ /* @__PURE__ */ jsx(Button, { variant: "default", size: "xs", onClick: () => setModalOpen(false), children: "Cancel" }),
506
+ /* @__PURE__ */ jsx(Button, { size: "xs", onClick: () => setModalOpen(false), children: "Confirm" })
507
+ ] })
508
+ ] }) })
492
509
  ] });
493
510
  }
494
511
  function EditWebhookEndpointModal({ opened, endpoint, onClose }) {