@elevasis/ui 2.21.0 → 2.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 (81) hide show
  1. package/dist/app/index.js +2 -2
  2. package/dist/{chunk-DMYELNGA.js → chunk-3HEUGBOT.js} +1 -1
  3. package/dist/{chunk-KVW56ERD.js → chunk-AXXTN44Z.js} +5 -3
  4. package/dist/{chunk-7GG6OSD7.js → chunk-B4FHWKEF.js} +3354 -2918
  5. package/dist/{chunk-XLZZOFGM.js → chunk-BSZRKBAW.js} +275 -76
  6. package/dist/{chunk-CZK67OHH.js → chunk-COG4ABRI.js} +3 -3
  7. package/dist/{chunk-S7RL77QS.js → chunk-DDZOHLHB.js} +1 -1
  8. package/dist/{chunk-I5WRKH25.js → chunk-GJ7EIABJ.js} +1 -1
  9. package/dist/{chunk-LQU62KHD.js → chunk-IBUYJXA3.js} +1209 -705
  10. package/dist/{chunk-EDX6WIN3.js → chunk-IOTLB6ND.js} +3 -3
  11. package/dist/{chunk-GBMNCNHX.js → chunk-KVJ3LFH2.js} +3 -1
  12. package/dist/{chunk-VQESMHQV.js → chunk-LJWV4TWV.js} +1 -2
  13. package/dist/{chunk-EGKNRM6P.js → chunk-LKVBEE63.js} +2 -2
  14. package/dist/{chunk-BJWIKEQG.js → chunk-LVJGPE6H.js} +6 -14
  15. package/dist/{chunk-TIIPYB2Z.js → chunk-QZJM3RYI.js} +1 -1
  16. package/dist/{chunk-7YQKVWSD.js → chunk-SQ5JGELM.js} +25 -5
  17. package/dist/{chunk-RX4UWZZR.js → chunk-TKAYX2SP.js} +8 -3
  18. package/dist/{chunk-ATEHYDL3.js → chunk-WWJ6S2HQ.js} +6 -2
  19. package/dist/{chunk-Q5HC6ENG.js → chunk-XOTJNW4Q.js} +1 -1
  20. package/dist/{chunk-ULZ2B3NC.js → chunk-ZBCTB5CA.js} +1 -1
  21. package/dist/components/index.css +85 -85
  22. package/dist/components/index.d.ts +1646 -1381
  23. package/dist/components/index.js +236 -30
  24. package/dist/components/navigation/index.css +589 -0
  25. package/dist/components/navigation/index.js +3 -3
  26. package/dist/features/auth/index.css +2 -2
  27. package/dist/features/auth/index.d.ts +184 -3
  28. package/dist/features/crm/index.css +2 -2
  29. package/dist/features/crm/index.d.ts +189 -3
  30. package/dist/features/crm/index.js +10 -10
  31. package/dist/features/dashboard/index.css +2 -2
  32. package/dist/features/dashboard/index.js +9 -9
  33. package/dist/features/delivery/index.css +85 -85
  34. package/dist/features/delivery/index.d.ts +189 -3
  35. package/dist/features/delivery/index.js +10 -10
  36. package/dist/features/lead-gen/index.css +2 -2
  37. package/dist/features/lead-gen/index.d.ts +5 -0
  38. package/dist/features/lead-gen/index.js +10 -10
  39. package/dist/features/monitoring/index.css +85 -85
  40. package/dist/features/monitoring/index.d.ts +6 -1
  41. package/dist/features/monitoring/index.js +11 -11
  42. package/dist/features/monitoring/requests/index.css +2 -2
  43. package/dist/features/monitoring/requests/index.d.ts +5 -0
  44. package/dist/features/monitoring/requests/index.js +9 -9
  45. package/dist/features/operations/index.css +2 -2
  46. package/dist/features/operations/index.d.ts +7 -4
  47. package/dist/features/operations/index.js +12 -12
  48. package/dist/features/seo/index.d.ts +5 -0
  49. package/dist/features/settings/index.css +2 -2
  50. package/dist/features/settings/index.d.ts +210 -9
  51. package/dist/features/settings/index.js +11 -11
  52. package/dist/graph/index.css +2 -2
  53. package/dist/hooks/delivery/index.css +2 -2
  54. package/dist/hooks/delivery/index.d.ts +184 -3
  55. package/dist/hooks/index.css +85 -85
  56. package/dist/hooks/index.d.ts +1815 -1515
  57. package/dist/hooks/index.js +8 -8
  58. package/dist/hooks/published.css +85 -85
  59. package/dist/hooks/published.d.ts +1815 -1515
  60. package/dist/hooks/published.js +8 -8
  61. package/dist/index.css +12 -12
  62. package/dist/index.d.ts +322 -16
  63. package/dist/index.js +9 -9
  64. package/dist/initialization/index.d.ts +184 -3
  65. package/dist/layout/index.js +2 -2
  66. package/dist/organization/index.css +589 -0
  67. package/dist/organization/index.js +1 -1
  68. package/dist/profile/index.d.ts +184 -3
  69. package/dist/provider/index.css +384 -0
  70. package/dist/provider/index.d.ts +6 -0
  71. package/dist/provider/index.js +7 -7
  72. package/dist/provider/published.css +463 -0
  73. package/dist/provider/published.d.ts +6 -0
  74. package/dist/provider/published.js +4 -4
  75. package/dist/supabase/index.d.ts +359 -6
  76. package/dist/test-utils/index.d.ts +46 -2
  77. package/dist/test-utils/index.js +102 -1
  78. package/dist/theme/index.js +2 -2
  79. package/dist/types/index.d.ts +195 -6
  80. package/package.json +2 -2
  81. /package/dist/{chunk-6GUW5GGF.js → chunk-6Z3G4U2R.js} +0 -0
@@ -1,19 +1,19 @@
1
1
  import { ChatHeader, ChatSidebar } from './chunk-ROSMICXG.js';
2
2
  import { SubshellSidebarLoader, SubshellLoader } from './chunk-3JCMO7SD.js';
3
- import { BaseNode, useGraphTheme, BaseEdge, FormFieldRenderer, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-EGKNRM6P.js';
4
- import { ResourceHealthPanel } from './chunk-I5WRKH25.js';
3
+ import { BaseNode, useGraphTheme, BaseEdge, FormFieldRenderer, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-LKVBEE63.js';
4
+ import { ResourceHealthPanel } from './chunk-GJ7EIABJ.js';
5
5
  import { useCyberColors, CyberDonut } from './chunk-TSSKOQBX.js';
6
6
  import { AppShellLoader } from './chunk-M25JL54Z.js';
7
7
  import { PageContainer } from './chunk-BZZCNLT6.js';
8
8
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
9
- import { CustomModal, ConfirmationModal } from './chunk-GBMNCNHX.js';
9
+ import { CustomModal, ConfirmationModal } from './chunk-KVJ3LFH2.js';
10
10
  import { getResourceStatusColor, useTimelineData, useAgentIterationData, getStatusIcon } from './chunk-E4WQGJNS.js';
11
- import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions } from './chunk-7GG6OSD7.js';
11
+ import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, COMMAND_VIEW_VISUALIZATION_MODES, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, getCommandViewGraphPositions } from './chunk-B4FHWKEF.js';
12
12
  import { showApiErrorNotification, showSuccessNotification } from './chunk-Z6FAH4XV.js';
13
13
  import { useGraphHighlighting, calculateGraphHeight, Graph_module_css_default, GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
14
14
  import { useMergedExecution } from './chunk-3ZMAGTWF.js';
15
- import { useOptionalElevasisFeatures, useElevasisFeatures } from './chunk-VQESMHQV.js';
16
- import { SubshellContentContainer } from './chunk-RX4UWZZR.js';
15
+ import { useOptionalElevasisFeatures, useElevasisFeatures } from './chunk-LJWV4TWV.js';
16
+ import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
17
17
  import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-XUYBOO32.js';
18
18
  import { StyledMarkdown } from './chunk-3KMDHCAR.js';
19
19
  import { NavigationButton } from './chunk-NYBEU5TE.js';
@@ -25,7 +25,7 @@ import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-KRWALB24.js
25
25
  import { useInitialization } from './chunk-DK2HVHCY.js';
26
26
  import { useOrganization } from './chunk-DD3CCMCZ.js';
27
27
  import { z } from 'zod';
28
- import { Stack, Group, Text, Badge, Title, Textarea, Alert, Button, ActionIcon, Collapse, Card, ThemeIcon, SimpleGrid, Divider, Paper, Space, CopyButton, Center, Tooltip, Code, Menu, useMantineTheme, UnstyledButton, Select, RangeSlider, Box, Progress, Tabs, Pagination, TextInput, Modal, LoadingOverlay, Loader, SegmentedControl, Switch, ScrollArea, MultiSelect } from '@mantine/core';
28
+ import { Stack, Group, Text, Badge, Title, Textarea, Alert, Button, ActionIcon, Collapse, Card, ThemeIcon, SimpleGrid, Divider, Paper, Space, CopyButton, Center, Tooltip, Code, Menu, useMantineTheme, UnstyledButton, Select, RangeSlider, Box, Progress, Tabs, Pagination, TextInput, Modal, LoadingOverlay, Loader, SegmentedControl, ScrollArea, Checkbox, MultiSelect, Switch } from '@mantine/core';
29
29
  import { IconBrain, IconFileText, IconMail, IconSend, IconClock, IconArrowUp, IconMessageCircle, IconRocket, IconEye, IconEdit, IconAlertTriangle, IconRefresh, IconX, IconCheck, IconCode, IconAlertCircle, IconChevronRight, IconTool, IconSettings, IconCpu, IconClockHour4, IconVersions, IconPlayerPlay, IconNetwork, IconSitemap, IconCopy, IconPlayerStop, IconReload, IconTrash, IconTerminal2, IconBug, IconChevronDown, IconMessage, IconArrowLeft, IconRobot, IconGitBranch, IconDotsVertical, IconFilter, IconCircleCheck, IconCategory, IconDatabase, IconApps, IconRoute, IconAdjustmentsHorizontal, IconSearch, IconCircleX, IconCircleDashed, IconExternalLink, IconFolders, IconBraces, IconBolt, IconTopologyStar3, IconInfoCircle, IconPlus, IconLayoutSidebarRightExpand, IconNote, IconArchive, IconDownload, IconTimeline, IconActivityHeartbeat, IconClockPause, IconArrowsMaximize, IconShare2, IconHistory } from '@tabler/icons-react';
30
30
  import { useForm } from '@mantine/form';
31
31
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -84,7 +84,22 @@ DisplayMetadataSchema.extend({
84
84
  techStack: TechStackEntrySchema.optional()
85
85
  });
86
86
 
87
- // ../core/src/organization-model/domains/branding.ts
87
+ // ../core/src/organization-model/domains/features.ts
88
+ var NodeIdPathSchema = z.string().trim().min(1).max(100).regex(/^([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node IDs must be lowercase dotted paths");
89
+ z.string().trim().min(1).max(200).regex(/^[a-z]+:([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node references must use kind:dotted-path");
90
+ var UiPositionSchema = z.enum(["sidebar-primary", "sidebar-bottom"]);
91
+ var FeatureSchema = z.object({
92
+ id: NodeIdPathSchema,
93
+ label: LabelSchema,
94
+ description: DescriptionSchema.optional(),
95
+ enabled: z.boolean().default(true),
96
+ path: PathSchema.optional(),
97
+ icon: IconNameSchema.optional(),
98
+ color: ColorTokenSchema.optional(),
99
+ uiPosition: UiPositionSchema.optional(),
100
+ requiresAdmin: z.boolean().optional(),
101
+ devOnly: z.boolean().optional()
102
+ });
88
103
  var OrganizationModelBrandingSchema = z.object({
89
104
  organizationName: LabelSchema,
90
105
  productName: LabelSchema,
@@ -127,21 +142,6 @@ var OrganizationModelProjectsSchema = z.object({
127
142
  milestoneStatuses: z.array(ProjectsDomainStateSchema).min(1),
128
143
  taskStatuses: z.array(ProjectsDomainStateSchema).min(1)
129
144
  });
130
- var NodeIdPathSchema = z.string().trim().min(1).max(100).regex(/^([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node IDs must be lowercase dotted paths");
131
- z.string().trim().min(1).max(200).regex(/^[a-z]+:([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node references must use kind:dotted-path");
132
- var UiPositionSchema = z.enum(["sidebar-primary", "sidebar-bottom"]);
133
- var FeatureSchema = z.object({
134
- id: NodeIdPathSchema,
135
- label: LabelSchema,
136
- description: DescriptionSchema.optional(),
137
- enabled: z.boolean().default(true),
138
- path: PathSchema.optional(),
139
- icon: IconNameSchema.optional(),
140
- color: ColorTokenSchema.optional(),
141
- uiPosition: UiPositionSchema.optional(),
142
- requiresAdmin: z.boolean().optional(),
143
- devOnly: z.boolean().optional()
144
- });
145
145
  var ProspectingLifecycleStageSchema = DisplayMetadataSchema.extend({
146
146
  id: ModelIdSchema,
147
147
  order: z.number().int().min(0)
@@ -162,6 +162,7 @@ var SurfaceDefinitionSchema = z.object({
162
162
  surfaceType: SurfaceTypeSchema,
163
163
  description: DescriptionSchema.optional(),
164
164
  enabled: z.boolean().default(true),
165
+ devOnly: z.boolean().optional(),
165
166
  icon: IconNameSchema.optional(),
166
167
  featureId: ModelIdSchema.optional(),
167
168
  featureIds: ReferenceIdsSchema,
@@ -562,6 +563,8 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
562
563
  }
563
564
  });
564
565
  });
566
+
567
+ // ../core/src/organization-model/graph/schema.ts
565
568
  var OrganizationGraphNodeKindSchema = z.enum([
566
569
  "organization",
567
570
  "feature",
@@ -5211,6 +5214,83 @@ function filterOrganizationGraph(graph, filters, options) {
5211
5214
  edges: visibleEdges
5212
5215
  };
5213
5216
  }
5217
+ function getCommandViewResourceCategory(node, commandViewData) {
5218
+ return getCommandViewNodeForGraphNode(node, commandViewData)?.category ?? null;
5219
+ }
5220
+ function getConnectedHiddenResourceIds(graph, nodeId2, hiddenIds) {
5221
+ if (!nodeId2) {
5222
+ return /* @__PURE__ */ new Set();
5223
+ }
5224
+ const nodesById = new Map(graph.nodes.map((node) => [node.id, node]));
5225
+ const connectedIds = /* @__PURE__ */ new Set();
5226
+ for (const edge of graph.edges) {
5227
+ const neighborId = edge.sourceId === nodeId2 ? edge.targetId : edge.targetId === nodeId2 ? edge.sourceId : null;
5228
+ if (!neighborId || !hiddenIds.has(neighborId)) {
5229
+ continue;
5230
+ }
5231
+ if (nodesById.get(neighborId)?.kind === "resource") {
5232
+ connectedIds.add(neighborId);
5233
+ }
5234
+ }
5235
+ return connectedIds;
5236
+ }
5237
+ function getCommandViewVisibilityProjection({
5238
+ graph,
5239
+ commandViewData,
5240
+ resourcesHidden,
5241
+ diagnosticsHidden,
5242
+ diagnosticCategories,
5243
+ revealedIds = /* @__PURE__ */ new Set(),
5244
+ mode
5245
+ }) {
5246
+ const hiddenIds = /* @__PURE__ */ new Set();
5247
+ const hiddenEdgeIds = /* @__PURE__ */ new Set();
5248
+ const diagnosticCategorySet = new Set(diagnosticCategories);
5249
+ let totalResourceCount = 0;
5250
+ let hiddenDiagnosticResourceCount = 0;
5251
+ if (mode === "trace" || mode === "impact") {
5252
+ const resourceCount = graph.nodes.filter((node) => node.kind === "resource").length;
5253
+ return {
5254
+ hiddenIds,
5255
+ hiddenEdgeIds,
5256
+ totalResourceCount: resourceCount,
5257
+ visibleResourceCount: resourceCount,
5258
+ hiddenResourceCount: 0,
5259
+ hiddenDiagnosticResourceCount: 0
5260
+ };
5261
+ }
5262
+ for (const node of graph.nodes) {
5263
+ if (node.kind !== "resource") {
5264
+ continue;
5265
+ }
5266
+ totalResourceCount += 1;
5267
+ const category = getCommandViewResourceCategory(node, commandViewData);
5268
+ const isDiagnostic = Boolean(category && diagnosticCategorySet.has(category));
5269
+ if (isDiagnostic && diagnosticsHidden) {
5270
+ hiddenDiagnosticResourceCount += 1;
5271
+ }
5272
+ if (revealedIds.has(node.id)) {
5273
+ continue;
5274
+ }
5275
+ if (resourcesHidden || diagnosticsHidden && isDiagnostic) {
5276
+ hiddenIds.add(node.id);
5277
+ }
5278
+ }
5279
+ for (const edge of graph.edges) {
5280
+ if (hiddenIds.has(edge.sourceId) || hiddenIds.has(edge.targetId)) {
5281
+ hiddenEdgeIds.add(edge.id);
5282
+ }
5283
+ }
5284
+ const hiddenResourceCount = hiddenIds.size;
5285
+ return {
5286
+ hiddenIds,
5287
+ hiddenEdgeIds,
5288
+ totalResourceCount,
5289
+ visibleResourceCount: totalResourceCount - hiddenResourceCount,
5290
+ hiddenResourceCount,
5291
+ hiddenDiagnosticResourceCount
5292
+ };
5293
+ }
5214
5294
  function isOrganizationGraphFilterPristine(filters) {
5215
5295
  return normalizeOrganizationGraphSearch(filters.search) === "" && filters.nodeKinds.length === 0 && filters.topologyPresence === DEFAULT_ORGANIZATION_GRAPH_FILTERS.topologyPresence && filters.environmentStatus === DEFAULT_ORGANIZATION_GRAPH_FILTERS.environmentStatus && filters.resourceTypes.length === 0 && filters.showIntegrations === DEFAULT_ORGANIZATION_GRAPH_FILTERS.showIntegrations && !hasActiveDomainFilters(filters.domainFilters);
5216
5296
  }
@@ -5418,7 +5498,14 @@ function useOrganizationGraphFilters(initialFilters) {
5418
5498
  }
5419
5499
 
5420
5500
  // src/features/operations/organization-graph/lenses.ts
5421
- var COMMAND_VIEW_NODE_KINDS = ["resource"];
5501
+ var COMMAND_VIEW_NODE_KINDS = [
5502
+ "organization",
5503
+ "feature",
5504
+ "surface",
5505
+ "entity",
5506
+ "capability",
5507
+ "resource"
5508
+ ];
5422
5509
  function getOrganizationGraphLensConfig(lens) {
5423
5510
  if (lens === "command-view") {
5424
5511
  return {
@@ -5427,9 +5514,9 @@ function getOrganizationGraphLensConfig(lens) {
5427
5514
  initialMode: "map",
5428
5515
  initialFilters: {
5429
5516
  nodeKinds: COMMAND_VIEW_NODE_KINDS,
5430
- topologyPresence: "topology-only"
5517
+ topologyPresence: "all"
5431
5518
  },
5432
- filterSummary: "Command View lens starts from topology-focused resource nodes so operational traces stay readable inside the broader organization graph."
5519
+ filterSummary: "Command View lens keeps the organization structure visible while resource visibility is controlled progressively."
5433
5520
  };
5434
5521
  }
5435
5522
  return {
@@ -5748,77 +5835,263 @@ function buildCommandViewDrillDownSections({
5748
5835
  }
5749
5836
  var cellStyle = {
5750
5837
  padding: "var(--mantine-spacing-sm) var(--mantine-spacing-md)",
5751
- borderRight: "1px solid var(--color-border)",
5752
5838
  display: "flex",
5753
5839
  alignItems: "center",
5754
5840
  gap: "var(--mantine-spacing-sm)",
5755
5841
  minWidth: 0
5756
5842
  };
5757
- var lastCellStyle = {
5758
- ...cellStyle,
5759
- borderRight: "none"
5760
- };
5761
5843
  function CommandViewHealthStrip({
5762
5844
  overview,
5763
5845
  hotspots,
5764
5846
  visibleResources,
5847
+ hiddenResources = 0,
5848
+ resourcesHidden,
5765
5849
  selectedLabel,
5766
5850
  onFocusHotspot,
5851
+ onResourcesHiddenChange,
5767
5852
  onResetFocus
5768
5853
  }) {
5769
- return /* @__PURE__ */ jsxs(
5770
- Paper,
5854
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
5855
+ /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5856
+ /* @__PURE__ */ jsx(IconActivityHeartbeat, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5857
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, style: { flexShrink: 0 }, children: overview?.successRate == null ? "N/A" : `${Math.round(overview.successRate)}%` }),
5858
+ /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", children: [
5859
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "green", size: "xs", children: overview?.successCount ?? 0 }),
5860
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "red", size: "xs", children: overview?.failureCount ?? 0 }),
5861
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "yellow", size: "xs", children: overview?.warningCount ?? 0 })
5862
+ ] }),
5863
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", truncate: true, style: { flexShrink: 1, minWidth: 0 }, children: overview ? `${overview.totalRuns} runs / ${overview.trackedResources} resources` : "" })
5864
+ ] }),
5865
+ /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5866
+ /* @__PURE__ */ jsx(IconAlertTriangle, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5867
+ hotspots.length > 0 ? /* @__PURE__ */ jsx(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0, overflow: "hidden" }, children: hotspots.map((hotspot) => /* @__PURE__ */ jsx(Group, { gap: 4, wrap: "nowrap", children: /* @__PURE__ */ jsx(
5868
+ Badge,
5869
+ {
5870
+ variant: "light",
5871
+ color: "red",
5872
+ size: "xs",
5873
+ style: { cursor: "pointer", flexShrink: 0 },
5874
+ onClick: () => onFocusHotspot(hotspot.resourceId),
5875
+ children: hotspot.label
5876
+ }
5877
+ ) }, hotspot.nodeId)) }) : /* @__PURE__ */ jsx(Badge, { variant: "light", color: "green", size: "xs", leftSection: /* @__PURE__ */ jsx(IconCircleCheck, { size: 10 }), children: "No hotspots" })
5878
+ ] }),
5879
+ /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5880
+ /* @__PURE__ */ jsx(IconClockPause, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5881
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, style: { flexShrink: 0 }, children: overview?.pendingApprovals ?? 0 }),
5882
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", truncate: true, children: [
5883
+ "pending / ",
5884
+ overview?.activeHumanCheckpoints ?? 0,
5885
+ " queues"
5886
+ ] })
5887
+ ] }),
5888
+ /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5889
+ /* @__PURE__ */ jsx(IconTopologyStar3, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5890
+ /* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, truncate: true, style: { minWidth: 0 }, children: selectedLabel ?? `${visibleResources} visible / ${hiddenResources} hidden` }),
5891
+ /* @__PURE__ */ jsx(
5892
+ Button,
5893
+ {
5894
+ size: "compact-xs",
5895
+ variant: resourcesHidden ? "light" : "subtle",
5896
+ onClick: () => onResourcesHiddenChange(!resourcesHidden),
5897
+ style: { flexShrink: 0 },
5898
+ children: resourcesHidden ? "Show resources" : "Hide resources"
5899
+ }
5900
+ ),
5901
+ /* @__PURE__ */ jsx(Button, { size: "compact-xs", variant: "subtle", onClick: onResetFocus, style: { flexShrink: 0 }, children: "Reset" })
5902
+ ] })
5903
+ ] });
5904
+ }
5905
+ var FILTER_STATE_ICONS2 = {
5906
+ neutral: IconCircleDashed,
5907
+ include: IconCircleCheck,
5908
+ exclude: IconCircleX
5909
+ };
5910
+ var FILTER_STATE_COLORS2 = {
5911
+ neutral: "var(--color-text-dimmed)",
5912
+ include: "var(--mantine-color-green-6)",
5913
+ exclude: "var(--mantine-color-red-6)"
5914
+ };
5915
+ var FILTER_STATE_LABELS2 = {
5916
+ neutral: "Not filtered",
5917
+ include: "Include only",
5918
+ exclude: "Exclude"
5919
+ };
5920
+ function getCommandViewResources(commandViewData) {
5921
+ if (!commandViewData) {
5922
+ return [];
5923
+ }
5924
+ return [
5925
+ ...commandViewData.agents,
5926
+ ...commandViewData.workflows,
5927
+ ...commandViewData.triggers,
5928
+ ...commandViewData.integrations,
5929
+ ...commandViewData.externalResources,
5930
+ ...commandViewData.humanCheckpoints
5931
+ ];
5932
+ }
5933
+ function nextDomainFilterState(current) {
5934
+ if (current === "neutral") return "include";
5935
+ if (current === "include") return "exclude";
5936
+ return "neutral";
5937
+ }
5938
+ function FilterPanel({
5939
+ filters,
5940
+ onChangeFilters,
5941
+ resetValue,
5942
+ disabled = false,
5943
+ commandViewData,
5944
+ lens,
5945
+ resourcesHidden,
5946
+ diagnosticsHidden,
5947
+ onResourcesHiddenChange,
5948
+ onDiagnosticsHiddenChange,
5949
+ onRevealResources,
5950
+ onResetFilters,
5951
+ visibilityCounts,
5952
+ graph,
5953
+ baseGraph,
5954
+ layout = "grid"
5955
+ }) {
5956
+ const resourceFacets = collectResourceFilterFacets(getCommandViewResources(commandViewData));
5957
+ const Section = ({ children }) => layout === "stack" ? /* @__PURE__ */ jsx(
5958
+ Stack,
5771
5959
  {
5772
- withBorder: true,
5960
+ gap: "sm",
5961
+ pb: "sm",
5773
5962
  style: {
5774
- display: "grid",
5775
- gridTemplateColumns: "auto 1fr auto auto",
5776
- background: "var(--color-surface)",
5777
- boxShadow: "var(--card-shadow)",
5778
- overflow: "hidden"
5963
+ borderBottom: "1px solid var(--color-border)"
5779
5964
  },
5780
- children: [
5781
- /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5782
- /* @__PURE__ */ jsx(IconActivityHeartbeat, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5783
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, style: { flexShrink: 0 }, children: overview?.successRate == null ? "N/A" : `${Math.round(overview.successRate)}%` }),
5784
- /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", children: [
5785
- /* @__PURE__ */ jsx(Badge, { variant: "light", color: "green", size: "xs", children: overview?.successCount ?? 0 }),
5786
- /* @__PURE__ */ jsx(Badge, { variant: "light", color: "red", size: "xs", children: overview?.failureCount ?? 0 }),
5787
- /* @__PURE__ */ jsx(Badge, { variant: "light", color: "yellow", size: "xs", children: overview?.warningCount ?? 0 })
5965
+ children
5966
+ }
5967
+ ) : /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", radius: "md", style: { background: "var(--color-surface)" }, children });
5968
+ const updateDomainFilter = (domainId) => {
5969
+ const current = filters.domainFilters[domainId] ?? "neutral";
5970
+ onChangeFilters({
5971
+ ...filters,
5972
+ domainFilters: {
5973
+ ...filters.domainFilters,
5974
+ [domainId]: nextDomainFilterState(current)
5975
+ }
5976
+ });
5977
+ };
5978
+ const handleResourceVisibilityAction = () => {
5979
+ if (resourcesHidden) {
5980
+ onRevealResources();
5981
+ return;
5982
+ }
5983
+ onResourcesHiddenChange(true);
5984
+ };
5985
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
5986
+ /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
5987
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, children: "Filters" }),
5988
+ /* @__PURE__ */ jsx(
5989
+ OrganizationGraphFilterToolbar,
5990
+ {
5991
+ value: filters,
5992
+ onChange: onChangeFilters,
5993
+ disabled,
5994
+ resetValue
5995
+ }
5996
+ )
5997
+ ] }) }),
5998
+ /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
5999
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "center", children: [
6000
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, children: "Visibility" }),
6001
+ /* @__PURE__ */ jsxs(Badge, { variant: "light", children: [
6002
+ visibilityCounts.visibleResourceCount,
6003
+ "/",
6004
+ visibilityCounts.totalResourceCount,
6005
+ " resources"
6006
+ ] })
6007
+ ] }),
6008
+ lens === "command-view" ? /* @__PURE__ */ jsxs(Fragment, { children: [
6009
+ /* @__PURE__ */ jsx(
6010
+ Checkbox,
6011
+ {
6012
+ label: "Hide resource nodes",
6013
+ description: "Keep the organization structure readable and reveal resource nodes as needed.",
6014
+ checked: resourcesHidden,
6015
+ onChange: (event) => onResourcesHiddenChange(event.currentTarget.checked),
6016
+ disabled
6017
+ }
6018
+ ),
6019
+ /* @__PURE__ */ jsx(
6020
+ Checkbox,
6021
+ {
6022
+ label: "Hide diagnostic and testing resources",
6023
+ description: "Diagnostics stay available through filters, trace, impact, and contextual reveal.",
6024
+ checked: diagnosticsHidden,
6025
+ onChange: (event) => onDiagnosticsHiddenChange(event.currentTarget.checked),
6026
+ disabled
6027
+ }
6028
+ ),
6029
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "wrap", children: [
6030
+ /* @__PURE__ */ jsxs(Badge, { variant: "light", color: visibilityCounts.hiddenResourceCount > 0 ? "yellow" : "green", children: [
6031
+ visibilityCounts.hiddenResourceCount,
6032
+ " hidden"
5788
6033
  ] }),
5789
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", truncate: true, style: { flexShrink: 1, minWidth: 0 }, children: overview ? `${overview.totalRuns} runs / ${overview.trackedResources} resources` : "" })
6034
+ /* @__PURE__ */ jsxs(Badge, { variant: "light", color: visibilityCounts.hiddenDiagnosticResourceCount > 0 ? "yellow" : "gray", children: [
6035
+ visibilityCounts.hiddenDiagnosticResourceCount,
6036
+ " diagnostic/testing"
6037
+ ] })
5790
6038
  ] }),
5791
- /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5792
- /* @__PURE__ */ jsx(IconAlertTriangle, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5793
- hotspots.length > 0 ? /* @__PURE__ */ jsx(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0, overflow: "hidden" }, children: hotspots.map((hotspot) => /* @__PURE__ */ jsx(Group, { gap: 4, wrap: "nowrap", children: /* @__PURE__ */ jsx(
5794
- Badge,
6039
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
6040
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", onClick: handleResourceVisibilityAction, disabled, children: resourcesHidden ? "Reveal resources" : "Hide resources" }),
6041
+ /* @__PURE__ */ jsx(
6042
+ Button,
5795
6043
  {
5796
- variant: "light",
5797
- color: "red",
5798
6044
  size: "xs",
5799
- style: { cursor: "pointer", flexShrink: 0 },
5800
- onClick: () => onFocusHotspot(hotspot.resourceId),
5801
- children: hotspot.label
6045
+ variant: "subtle",
6046
+ leftSection: /* @__PURE__ */ jsx(IconRefresh, { size: 14 }),
6047
+ onClick: onResetFilters,
6048
+ disabled,
6049
+ children: "Reset filters"
5802
6050
  }
5803
- ) }, hotspot.nodeId)) }) : /* @__PURE__ */ jsx(Badge, { variant: "light", color: "green", size: "xs", leftSection: /* @__PURE__ */ jsx(IconCircleCheck, { size: 10 }), children: "No hotspots" })
5804
- ] }),
5805
- /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
5806
- /* @__PURE__ */ jsx(IconClockPause, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5807
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, style: { flexShrink: 0 }, children: overview?.pendingApprovals ?? 0 }),
5808
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", truncate: true, children: [
5809
- "pending / ",
5810
- overview?.activeHumanCheckpoints ?? 0,
5811
- " queues"
5812
- ] })
5813
- ] }),
5814
- /* @__PURE__ */ jsxs("div", { style: lastCellStyle, children: [
5815
- /* @__PURE__ */ jsx(IconTopologyStar3, { size: 16, style: { flexShrink: 0, color: "var(--color-text-dimmed)" } }),
5816
- /* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, truncate: true, style: { minWidth: 0 }, children: selectedLabel ?? `${visibleResources} resources` }),
5817
- /* @__PURE__ */ jsx(Button, { size: "compact-xs", variant: "subtle", onClick: onResetFocus, style: { flexShrink: 0 }, children: "Reset" })
6051
+ )
5818
6052
  ] })
5819
- ]
5820
- }
5821
- );
6053
+ ] }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Visibility controls are available in the Command View lens." })
6054
+ ] }) }),
6055
+ /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
6056
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, children: "Resource Facets" }),
6057
+ resourceFacets.length > 0 ? /* @__PURE__ */ jsx(Stack, { gap: 4, children: resourceFacets.map((facet) => {
6058
+ const filterState = filters.domainFilters[facet.id] ?? "neutral";
6059
+ const StateIcon = FILTER_STATE_ICONS2[filterState];
6060
+ return /* @__PURE__ */ jsx(
6061
+ UnstyledButton,
6062
+ {
6063
+ title: FILTER_STATE_LABELS2[filterState],
6064
+ onClick: () => updateDomainFilter(facet.id),
6065
+ disabled,
6066
+ style: {
6067
+ border: "1px solid var(--color-border)",
6068
+ borderRadius: "var(--mantine-radius-sm)",
6069
+ padding: "6px 8px"
6070
+ },
6071
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
6072
+ /* @__PURE__ */ jsx(StateIcon, { size: 16, style: { color: FILTER_STATE_COLORS2[filterState], flexShrink: 0 } }),
6073
+ /* @__PURE__ */ jsx(Text, { size: "sm", truncate: true, c: filterState === "neutral" ? "dimmed" : void 0, children: facet.label })
6074
+ ] })
6075
+ },
6076
+ facet.id
6077
+ );
6078
+ }) }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No resource facets are available for the current topology." }),
6079
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
6080
+ "Showing ",
6081
+ graph?.nodes.length ?? 0,
6082
+ " nodes and ",
6083
+ graph?.edges.length ?? 0,
6084
+ " edges from",
6085
+ " ",
6086
+ baseGraph?.nodes.length ?? 0,
6087
+ " total nodes."
6088
+ ] })
6089
+ ] }) })
6090
+ ] });
6091
+ if (layout === "stack") {
6092
+ return /* @__PURE__ */ jsx(Stack, { gap: "sm", children: content });
6093
+ }
6094
+ return /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 1, lg: 3 }, spacing: "md", children: content });
5822
6095
  }
5823
6096
 
5824
6097
  // src/features/operations/organization-graph/commandViewGraphHealth.ts
@@ -6312,6 +6585,8 @@ var EMPTY_TRACE_SELECTION = {
6312
6585
  sourceId: null,
6313
6586
  targetId: null
6314
6587
  };
6588
+ var EMPTY_GRAPH_HIDDEN_IDS = /* @__PURE__ */ new Set();
6589
+ var EMPTY_GRAPH_HIDDEN_EDGE_IDS = /* @__PURE__ */ new Set();
6315
6590
  var FALLBACK_GRAPH_THEME = {
6316
6591
  primary: "#4a6e8e",
6317
6592
  background: "#030507",
@@ -6324,6 +6599,12 @@ var FALLBACK_GRAPH_THEME = {
6324
6599
  warning: "#ffb74d",
6325
6600
  error: "#ff5252"
6326
6601
  };
6602
+ function truncateGraphLabel(value, maxLength) {
6603
+ if (value.length <= maxLength) {
6604
+ return value;
6605
+ }
6606
+ return `${value.slice(0, Math.max(0, maxLength - 3))}...`;
6607
+ }
6327
6608
  function parseColor(input) {
6328
6609
  const value = input.trim();
6329
6610
  if (value.startsWith("#")) {
@@ -6455,12 +6736,12 @@ function getEdgeColor(edge, tokens) {
6455
6736
  }
6456
6737
  function getNodeSize(kind) {
6457
6738
  if (kind === "organization") {
6458
- return { width: 280, height: 112 };
6739
+ return { width: 230, height: 88 };
6459
6740
  }
6460
6741
  if (kind === "resource") {
6461
- return { width: 208, height: 84 };
6742
+ return { width: 154, height: 54 };
6462
6743
  }
6463
- return { width: 220, height: 92 };
6744
+ return { width: 174, height: 66 };
6464
6745
  }
6465
6746
  function getNodeScore(node, graph) {
6466
6747
  const relationshipCount = graph.edges.filter((edge) => edge.sourceId === node.id || edge.targetId === node.id).length;
@@ -6479,8 +6760,13 @@ function getCommandViewRingColor(level, tokens) {
6479
6760
  return mixColors(tokens.textDimmed, tokens.border, 0.6);
6480
6761
  }
6481
6762
  }
6482
- function toCytoscapeElementsWithHealth(graph, tokens, commandViewHealthByNodeId) {
6763
+ function toCytoscapeElementsWithHealth(graph, tokens, commandViewHealthByNodeId, visualizationMode, selectedElement) {
6483
6764
  const nodeThemeByKind = getNodeThemeByKind(tokens);
6765
+ const presetPositions = getCommandViewGraphPositions({
6766
+ graph,
6767
+ visualizationMode,
6768
+ selectedNodeId: selectedElement?.type === "node" ? selectedElement.id : null
6769
+ });
6484
6770
  return [
6485
6771
  ...graph.nodes.map((node) => {
6486
6772
  const size = getNodeSize(node.kind);
@@ -6488,19 +6774,22 @@ function toCytoscapeElementsWithHealth(graph, tokens, commandViewHealthByNodeId)
6488
6774
  const health = commandViewHealthByNodeId?.get(node.id) ?? null;
6489
6775
  const fillColor = health && node.kind === "resource" ? mixColors(tokens.surfaceHover, tokens.background, 0.76) : theme.background;
6490
6776
  const borderColor = health ? getCommandViewRingColor(health.healthLevel, tokens) : theme.border;
6491
- const label = health ? `${node.label}
6492
- ${health.summaryLabel}` : node.label;
6777
+ const maxLabelLength = node.kind === "resource" ? 22 : 30;
6778
+ const label = truncateGraphLabel(node.label, maxLabelLength);
6779
+ const displayLabel = health ? `${label}
6780
+ ${health.summaryLabel}` : label;
6493
6781
  return {
6494
6782
  data: {
6495
6783
  ...node,
6496
6784
  width: size.width,
6497
6785
  height: size.height,
6498
6786
  score: getNodeScore(node, graph),
6499
- label,
6787
+ label: displayLabel,
6500
6788
  fillColor,
6501
6789
  borderColor,
6502
6790
  textColor: health ? tokens.text : theme.color
6503
- }
6791
+ },
6792
+ position: presetPositions.get(node.id)
6504
6793
  };
6505
6794
  }),
6506
6795
  ...graph.edges.map((edge) => ({
@@ -6526,9 +6815,9 @@ function getLayoutOptions(mode, selectedElement, traceResult) {
6526
6815
  name: "concentric",
6527
6816
  fit: true,
6528
6817
  animate: true,
6529
- animationDuration: 280,
6530
- padding: 56,
6531
- spacingFactor: 1.1,
6818
+ animationDuration: 220,
6819
+ padding: 48,
6820
+ spacingFactor: 1,
6532
6821
  concentric: (node) => {
6533
6822
  if (node.id() === impactRootId) {
6534
6823
  return 20;
@@ -6543,24 +6832,19 @@ function getLayoutOptions(mode, selectedElement, traceResult) {
6543
6832
  name: "breadthfirst",
6544
6833
  fit: true,
6545
6834
  animate: true,
6546
- animationDuration: 280,
6835
+ animationDuration: 220,
6547
6836
  directed: true,
6548
6837
  circle: false,
6549
- spacingFactor: 1.25,
6550
- padding: 56,
6838
+ spacingFactor: 1.08,
6839
+ padding: 48,
6551
6840
  roots
6552
6841
  };
6553
6842
  }
6554
6843
  return {
6555
- name: "cose",
6844
+ name: "preset",
6556
6845
  fit: true,
6557
- animate: true,
6558
- animationDuration: 280,
6559
- padding: 56,
6560
- nodeRepulsion: 72e4,
6561
- idealEdgeLength: 160,
6562
- edgeElasticity: 120,
6563
- gravity: 0.3
6846
+ animate: false,
6847
+ padding: 48
6564
6848
  };
6565
6849
  }
6566
6850
  function createCytoscapeStyle(tokens) {
@@ -6580,13 +6864,13 @@ function createCytoscapeStyle(tokens) {
6580
6864
  "border-style": "solid",
6581
6865
  "border-color": "data(borderColor)",
6582
6866
  color: "data(textColor)",
6583
- "font-size": 12,
6867
+ "font-size": 10,
6584
6868
  "font-weight": 700,
6585
6869
  "text-wrap": "wrap",
6586
- "text-max-width": "150px",
6870
+ "text-max-width": "120px",
6587
6871
  "text-valign": "center",
6588
6872
  "text-halign": "center",
6589
- padding: "14px",
6873
+ padding: "10px",
6590
6874
  "overlay-opacity": 0,
6591
6875
  "text-outline-width": 0
6592
6876
  }
@@ -6596,14 +6880,25 @@ function createCytoscapeStyle(tokens) {
6596
6880
  style: {
6597
6881
  shape: "cut-rectangle",
6598
6882
  "border-width": 3,
6599
- "font-size": 15
6883
+ "font-size": 13
6884
+ }
6885
+ },
6886
+ {
6887
+ selector: 'node[kind = "resource"]',
6888
+ style: {
6889
+ "border-width": 1.5,
6890
+ "font-size": 8,
6891
+ "font-weight": 650,
6892
+ "text-max-width": "104px",
6893
+ "background-opacity": 0.82,
6894
+ "min-zoomed-font-size": 7
6600
6895
  }
6601
6896
  },
6602
6897
  {
6603
6898
  selector: "edge",
6604
6899
  style: {
6605
- width: 2,
6606
- label: "data(label)",
6900
+ width: 1.25,
6901
+ label: "",
6607
6902
  color: tokens.text,
6608
6903
  "font-size": 10,
6609
6904
  "font-weight": 700,
@@ -6618,20 +6913,26 @@ function createCytoscapeStyle(tokens) {
6618
6913
  "text-border-opacity": 0,
6619
6914
  "text-rotation": "autorotate",
6620
6915
  "overlay-opacity": 0,
6621
- "line-opacity": 0.9
6916
+ "line-opacity": 0.38
6917
+ }
6918
+ },
6919
+ {
6920
+ selector: ".is-hidden",
6921
+ style: {
6922
+ display: "none"
6622
6923
  }
6623
6924
  },
6624
6925
  {
6625
6926
  selector: 'edge[relationshipType = "triggers"]',
6626
6927
  style: {
6627
- width: 2.8,
6928
+ width: 1.9,
6628
6929
  "line-style": "dashed"
6629
6930
  }
6630
6931
  },
6631
6932
  {
6632
6933
  selector: ".is-faded",
6633
6934
  style: {
6634
- opacity: 0.18
6935
+ opacity: 0.1
6635
6936
  }
6636
6937
  },
6637
6938
  {
@@ -6644,7 +6945,8 @@ function createCytoscapeStyle(tokens) {
6644
6945
  selector: "edge.is-connected",
6645
6946
  style: {
6646
6947
  opacity: 1,
6647
- width: 3.4
6948
+ width: 2.9,
6949
+ "line-opacity": 0.9
6648
6950
  }
6649
6951
  },
6650
6952
  {
@@ -6652,7 +6954,8 @@ function createCytoscapeStyle(tokens) {
6652
6954
  style: {
6653
6955
  opacity: 1,
6654
6956
  "border-color": selectedBorder,
6655
- "border-width": 3
6957
+ "border-width": 3.5,
6958
+ "background-opacity": 1
6656
6959
  }
6657
6960
  },
6658
6961
  {
@@ -6675,7 +6978,9 @@ function createCytoscapeStyle(tokens) {
6675
6978
  selector: "edge.is-selected",
6676
6979
  style: {
6677
6980
  opacity: 1,
6678
- width: 4.2
6981
+ width: 4.2,
6982
+ "line-opacity": 1,
6983
+ label: "data(label)"
6679
6984
  }
6680
6985
  },
6681
6986
  {
@@ -6683,6 +6988,8 @@ function createCytoscapeStyle(tokens) {
6683
6988
  style: {
6684
6989
  opacity: 1,
6685
6990
  width: 4.6,
6991
+ "line-opacity": 1,
6992
+ label: "data(label)",
6686
6993
  "line-color": traceBorder,
6687
6994
  "target-arrow-color": traceBorder,
6688
6995
  "line-style": "solid"
@@ -6690,11 +6997,23 @@ function createCytoscapeStyle(tokens) {
6690
6997
  }
6691
6998
  ];
6692
6999
  }
6693
- function syncGraphClasses(cy, selectedElement, traceResult) {
7000
+ function syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdgeIds) {
6694
7001
  cy.batch(() => {
6695
7002
  cy.elements().removeClass(
6696
- "is-faded is-context is-selected is-connected is-trace-node is-trace-edge is-trace-endpoint"
7003
+ "is-hidden is-faded is-context is-selected is-connected is-trace-node is-trace-edge is-trace-endpoint"
6697
7004
  );
7005
+ for (const nodeId2 of hiddenIds) {
7006
+ const node = cy.getElementById(nodeId2);
7007
+ if (!node.empty()) {
7008
+ node.addClass("is-hidden");
7009
+ }
7010
+ }
7011
+ for (const edgeId2 of hiddenEdgeIds) {
7012
+ const edge2 = cy.getElementById(edgeId2);
7013
+ if (!edge2.empty()) {
7014
+ edge2.addClass("is-hidden");
7015
+ }
7016
+ }
6698
7017
  const hasTrace = Boolean(
6699
7018
  traceResult && (traceResult.highlightNodeIds.length > 0 || traceResult.highlightEdgeIds.length > 0)
6700
7019
  );
@@ -6748,24 +7067,56 @@ function syncGraphClasses(cy, selectedElement, traceResult) {
6748
7067
  edge.connectedNodes().addClass("is-selected");
6749
7068
  });
6750
7069
  }
7070
+ function syncCytoscapeElements(cy, elements) {
7071
+ const nextIds = new Set(elements.map((element) => element.data.id));
7072
+ cy.batch(() => {
7073
+ cy.elements().forEach((element) => {
7074
+ if (!nextIds.has(element.id())) {
7075
+ element.remove();
7076
+ }
7077
+ });
7078
+ for (const element of elements) {
7079
+ const id = element.data.id;
7080
+ const existing = cy.getElementById(id);
7081
+ if (existing.empty()) {
7082
+ cy.add(element);
7083
+ continue;
7084
+ }
7085
+ existing.data(element.data);
7086
+ if ("position" in element && element.position && existing.isNode()) {
7087
+ existing.position(element.position);
7088
+ }
7089
+ }
7090
+ });
7091
+ }
6751
7092
  function OrganizationGraphCanvas({
6752
7093
  graph,
6753
7094
  mode,
7095
+ visualizationMode,
6754
7096
  selectedElement,
6755
7097
  traceResult,
7098
+ hiddenIds,
7099
+ hiddenEdgeIds,
6756
7100
  themeTokens,
6757
7101
  commandViewHealthByNodeId,
6758
7102
  focusRequest,
7103
+ toolbar,
6759
7104
  onSelectElement
6760
7105
  }) {
6761
7106
  const containerRef = useRef(null);
6762
7107
  const cytoscapeRef = useRef(null);
6763
7108
  const previousModeRef = useRef(mode);
7109
+ const onSelectElementRef = useRef(onSelectElement);
7110
+ const lastSizeRef = useRef(null);
7111
+ const layoutSelectedElement = visualizationMode === "focus" ? selectedElement : null;
6764
7112
  const elements = useMemo(
6765
- () => toCytoscapeElementsWithHealth(graph, themeTokens, commandViewHealthByNodeId),
6766
- [commandViewHealthByNodeId, graph, themeTokens]
7113
+ () => toCytoscapeElementsWithHealth(graph, themeTokens, commandViewHealthByNodeId, visualizationMode, layoutSelectedElement),
7114
+ [commandViewHealthByNodeId, graph, layoutSelectedElement, themeTokens, visualizationMode]
6767
7115
  );
6768
7116
  const cytoscapeStyle = useMemo(() => createCytoscapeStyle(themeTokens), [themeTokens]);
7117
+ useEffect(() => {
7118
+ onSelectElementRef.current = onSelectElement;
7119
+ }, [onSelectElement]);
6769
7120
  useEffect(() => {
6770
7121
  if (!containerRef.current) {
6771
7122
  return;
@@ -6777,32 +7128,52 @@ function OrganizationGraphCanvas({
6777
7128
  layout: getLayoutOptions(mode, null, traceResult),
6778
7129
  minZoom: 0.22,
6779
7130
  maxZoom: 1.6,
6780
- wheelSensitivity: 0.45
7131
+ wheelSensitivity: 1.35
6781
7132
  });
6782
7133
  cytoscapeRef.current = cy;
6783
7134
  cy.on("tap", "node", (event) => {
6784
- onSelectElement({ type: "node", id: event.target.id() });
7135
+ onSelectElementRef.current({ type: "node", id: event.target.id() });
6785
7136
  });
6786
7137
  cy.on("tap", "edge", (event) => {
6787
- onSelectElement({ type: "edge", id: event.target.id() });
7138
+ onSelectElementRef.current({ type: "edge", id: event.target.id() });
6788
7139
  });
6789
7140
  cy.on("tap", (event) => {
6790
7141
  if (event.target === cy) {
6791
- onSelectElement(null);
7142
+ onSelectElementRef.current(null);
6792
7143
  }
6793
7144
  });
6794
- const resizeObserver = new ResizeObserver(() => {
6795
- cy.resize();
6796
- cy.fit(void 0, 56);
7145
+ const resizeObserver = new ResizeObserver(([entry]) => {
7146
+ const { width, height } = entry.contentRect;
7147
+ const lastSize = lastSizeRef.current;
7148
+ if (lastSize && Math.abs(lastSize.width - width) < 1 && Math.abs(lastSize.height - height) < 1) {
7149
+ return;
7150
+ }
7151
+ lastSizeRef.current = { width, height };
7152
+ window.requestAnimationFrame(() => {
7153
+ if (cy.destroyed()) {
7154
+ return;
7155
+ }
7156
+ cy.resize();
7157
+ cy.fit(void 0, 44);
7158
+ });
6797
7159
  });
6798
7160
  resizeObserver.observe(containerRef.current);
6799
- syncGraphClasses(cy, selectedElement, traceResult);
7161
+ syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdgeIds);
6800
7162
  return () => {
6801
7163
  resizeObserver.disconnect();
6802
7164
  cy.destroy();
6803
7165
  cytoscapeRef.current = null;
6804
7166
  };
6805
- }, [cytoscapeStyle, elements, onSelectElement]);
7167
+ }, [cytoscapeStyle]);
7168
+ useEffect(() => {
7169
+ const cy = cytoscapeRef.current;
7170
+ if (!cy) {
7171
+ return;
7172
+ }
7173
+ syncCytoscapeElements(cy, elements);
7174
+ cy.layout(getLayoutOptions(mode, selectedElement, traceResult)).run();
7175
+ syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdgeIds);
7176
+ }, [elements]);
6806
7177
  useEffect(() => {
6807
7178
  const cy = cytoscapeRef.current;
6808
7179
  if (!cy) {
@@ -6810,7 +7181,7 @@ function OrganizationGraphCanvas({
6810
7181
  }
6811
7182
  const modeChanged = previousModeRef.current !== mode;
6812
7183
  previousModeRef.current = mode;
6813
- if (!modeChanged && mode === "map" && selectedElement) {
7184
+ if (!modeChanged && mode === "map") {
6814
7185
  return;
6815
7186
  }
6816
7187
  cy.layout(getLayoutOptions(mode, selectedElement, traceResult)).run();
@@ -6820,8 +7191,27 @@ function OrganizationGraphCanvas({
6820
7191
  if (!cy) {
6821
7192
  return;
6822
7193
  }
6823
- syncGraphClasses(cy, selectedElement, traceResult);
6824
- }, [selectedElement, traceResult]);
7194
+ syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdgeIds);
7195
+ if (mode === "map" && selectedElement?.type === "node") {
7196
+ const node = cy.getElementById(selectedElement.id);
7197
+ if (!node.empty()) {
7198
+ const visibleNeighborhood = node.closedNeighborhood().not(".is-hidden");
7199
+ cy.stop();
7200
+ cy.animate(
7201
+ {
7202
+ fit: {
7203
+ eles: visibleNeighborhood.empty() ? node : visibleNeighborhood,
7204
+ padding: 72
7205
+ },
7206
+ duration: 220
7207
+ },
7208
+ {
7209
+ easing: "ease-out-cubic"
7210
+ }
7211
+ );
7212
+ }
7213
+ }
7214
+ }, [hiddenEdgeIds, hiddenIds, mode, selectedElement, traceResult]);
6825
7215
  useEffect(() => {
6826
7216
  const cy = cytoscapeRef.current;
6827
7217
  if (!cy || !focusRequest) {
@@ -6831,13 +7221,15 @@ function OrganizationGraphCanvas({
6831
7221
  if (node.empty()) {
6832
7222
  return;
6833
7223
  }
7224
+ const visibleNeighborhood = node.closedNeighborhood().not(".is-hidden");
7225
+ cy.stop();
6834
7226
  cy.animate(
6835
7227
  {
6836
7228
  fit: {
6837
- eles: node.closedNeighborhood(),
6838
- padding: 96
7229
+ eles: visibleNeighborhood.empty() ? node : visibleNeighborhood,
7230
+ padding: 72
6839
7231
  },
6840
- duration: 280
7232
+ duration: 220
6841
7233
  },
6842
7234
  {
6843
7235
  easing: "ease-out-cubic"
@@ -6858,25 +7250,39 @@ function OrganizationGraphCanvas({
6858
7250
  },
6859
7251
  children: [
6860
7252
  /* @__PURE__ */ jsx(Box, { ref: containerRef, style: { width: "100%", height: "100%" } }),
6861
- /* @__PURE__ */ jsx(Tooltip, { label: "Fit graph to view", children: /* @__PURE__ */ jsx(
6862
- ActionIcon,
7253
+ /* @__PURE__ */ jsxs(
7254
+ Group,
6863
7255
  {
6864
- variant: "light",
6865
- radius: "xl",
6866
- size: "lg",
7256
+ gap: "xs",
7257
+ wrap: "nowrap",
6867
7258
  style: {
6868
7259
  position: "absolute",
6869
7260
  top: 12,
6870
7261
  right: 12,
6871
7262
  zIndex: 2,
6872
- background: "var(--glass-background)",
6873
- backdropFilter: "var(--glass-blur)",
6874
- color: "var(--color-text)"
7263
+ maxWidth: "calc(100% - 24px)"
6875
7264
  },
6876
- onClick: () => cytoscapeRef.current?.fit(void 0, 56),
6877
- children: /* @__PURE__ */ jsx(IconArrowsMaximize, { size: 18 })
7265
+ children: [
7266
+ toolbar,
7267
+ /* @__PURE__ */ jsx(Tooltip, { label: "Fit graph to view", children: /* @__PURE__ */ jsx(
7268
+ ActionIcon,
7269
+ {
7270
+ variant: "light",
7271
+ radius: "xl",
7272
+ size: "lg",
7273
+ style: {
7274
+ background: "var(--glass-background)",
7275
+ backdropFilter: "var(--glass-blur)",
7276
+ color: "var(--color-text)",
7277
+ flexShrink: 0
7278
+ },
7279
+ onClick: () => cytoscapeRef.current?.fit(void 0, 44),
7280
+ children: /* @__PURE__ */ jsx(IconArrowsMaximize, { size: 18 })
7281
+ }
7282
+ ) })
7283
+ ]
6878
7284
  }
6879
- ) })
7285
+ )
6880
7286
  ]
6881
7287
  }
6882
7288
  );
@@ -6884,23 +7290,67 @@ function OrganizationGraphCanvas({
6884
7290
  function getGraphCountByKind(graph, kind) {
6885
7291
  return graph?.nodes.filter((node) => node.kind === kind).length ?? 0;
6886
7292
  }
6887
- function formatGeneratedTimestamp(value) {
6888
- if (!value) return "unavailable";
6889
- return new Intl.DateTimeFormat("en-US", {
6890
- month: "short",
6891
- day: "numeric",
6892
- hour: "numeric",
6893
- minute: "2-digit"
6894
- }).format(new Date(value));
6895
- }
6896
- function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6897
- const { organizationModel, organizationGraph } = useElevasisFeatures();
6898
- const { data: commandViewData, isLoading, error } = useCommandViewData();
7293
+ function getCommandViewRenderableGraph(graph) {
7294
+ if (!graph) {
7295
+ return null;
7296
+ }
7297
+ const hasSpecificParentByNodeId = /* @__PURE__ */ new Set();
7298
+ const hasOperationalEdgeByResourceId = /* @__PURE__ */ new Set();
7299
+ for (const edge of graph.edges) {
7300
+ if (edge.kind === "contains" && edge.sourceId !== ORGANIZATION_NODE_ID) {
7301
+ hasSpecificParentByNodeId.add(edge.targetId);
7302
+ }
7303
+ if (edge.kind !== "contains") {
7304
+ hasOperationalEdgeByResourceId.add(edge.sourceId);
7305
+ hasOperationalEdgeByResourceId.add(edge.targetId);
7306
+ }
7307
+ }
7308
+ return {
7309
+ ...graph,
7310
+ edges: graph.edges.filter((edge) => {
7311
+ if (edge.kind !== "contains" || edge.sourceId !== ORGANIZATION_NODE_ID) {
7312
+ return true;
7313
+ }
7314
+ const targetNode = graph.nodes.find((node) => node.id === edge.targetId);
7315
+ if (!targetNode) {
7316
+ return false;
7317
+ }
7318
+ if (targetNode.kind === "resource") {
7319
+ return !hasOperationalEdgeByResourceId.has(targetNode.id);
7320
+ }
7321
+ return !hasSpecificParentByNodeId.has(targetNode.id);
7322
+ })
7323
+ };
7324
+ }
7325
+ function formatGeneratedTimestamp(value) {
7326
+ if (!value) return "unavailable";
7327
+ return new Intl.DateTimeFormat("en-US", {
7328
+ month: "short",
7329
+ day: "numeric",
7330
+ hour: "numeric",
7331
+ minute: "2-digit"
7332
+ }).format(new Date(value));
7333
+ }
7334
+ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
7335
+ const { organizationModel } = useElevasisFeatures();
7336
+ const { data: commandViewData, isLoading, error } = useCommandViewData();
6899
7337
  const { data: commandViewStats } = useCommandViewStats(timeRange, { enabled: lens === "command-view" });
6900
7338
  const setSelectedNodeId = useCommandViewStore((state) => state.setSelectedNodeId);
7339
+ const visualizationMode = useCommandViewStore((state) => state.visualizationMode);
7340
+ const setVisualizationMode = useCommandViewStore((state) => state.setVisualizationMode);
7341
+ const effectiveVisualizationMode = visualizationMode === "spatial" ? "network" : visualizationMode;
7342
+ const resourcesHidden = useCommandViewStore((state) => state.resourcesHidden);
7343
+ const setResourcesHidden = useCommandViewStore((state) => state.setResourcesHidden);
7344
+ const diagnosticsHidden = useCommandViewStore((state) => state.diagnosticsHidden);
7345
+ const setDiagnosticsHidden = useCommandViewStore((state) => state.setDiagnosticsHidden);
7346
+ const diagnosticCategories = useCommandViewStore((state) => state.diagnosticCategories);
7347
+ const revealedIds = useCommandViewStore((state) => state.revealedIds);
7348
+ const setRevealedIds = useCommandViewStore((state) => state.setRevealedIds);
7349
+ const clearRevealedIds = useCommandViewStore((state) => state.clearRevealedIds);
7350
+ const markVisibilityInteraction = useCommandViewStore((state) => state.markVisibilityInteraction);
6901
7351
  const lensConfig = useMemo(() => getOrganizationGraphLensConfig(lens), [lens]);
6902
7352
  const [mode, setMode] = useState(lensConfig.initialMode);
6903
- const [activePanelTab, setActivePanelTab] = useState("controls");
7353
+ const [activePanelTab, setActivePanelTab] = useState(lens === "command-view" ? "details" : "controls");
6904
7354
  const [selectedElement, setSelectedElement] = useState(null);
6905
7355
  const [focusRequest, setFocusRequest] = useState(null);
6906
7356
  const [pathTraceSelection, setPathTraceSelection] = useState(EMPTY_TRACE_SELECTION);
@@ -6913,6 +7363,11 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6913
7363
  const rawThemeTokens = readGraphThemeTokens();
6914
7364
  const themeSignature = Object.values(rawThemeTokens).join("|");
6915
7365
  const themeTokens = useMemo(() => rawThemeTokens, [themeSignature]);
7366
+ useEffect(() => {
7367
+ if (visualizationMode === "spatial") {
7368
+ setVisualizationMode("network");
7369
+ }
7370
+ }, [setVisualizationMode, visualizationMode]);
6916
7371
  const baseGraph = useMemo(() => {
6917
7372
  if (!organizationModel) {
6918
7373
  return null;
@@ -6930,12 +7385,48 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6930
7385
  commandViewData
6931
7386
  });
6932
7387
  }, [baseGraph, commandViewData, deferredFilters]);
7388
+ const visibilityProjection = useMemo(() => {
7389
+ if (!graph || lens !== "command-view") {
7390
+ const resourceCount = getGraphCountByKind(graph, "resource");
7391
+ return {
7392
+ hiddenIds: /* @__PURE__ */ new Set(),
7393
+ hiddenEdgeIds: /* @__PURE__ */ new Set(),
7394
+ totalResourceCount: resourceCount,
7395
+ visibleResourceCount: resourceCount,
7396
+ hiddenResourceCount: 0,
7397
+ hiddenDiagnosticResourceCount: 0
7398
+ };
7399
+ }
7400
+ return getCommandViewVisibilityProjection({
7401
+ graph,
7402
+ commandViewData,
7403
+ resourcesHidden,
7404
+ diagnosticsHidden,
7405
+ diagnosticCategories,
7406
+ revealedIds,
7407
+ mode
7408
+ });
7409
+ }, [commandViewData, diagnosticCategories, diagnosticsHidden, graph, lens, mode, resourcesHidden, revealedIds]);
7410
+ const visibleGraph = useMemo(() => {
7411
+ if (!graph || visibilityProjection.hiddenIds.size === 0) {
7412
+ return graph;
7413
+ }
7414
+ return {
7415
+ ...graph,
7416
+ nodes: graph.nodes.filter((node) => !visibilityProjection.hiddenIds.has(node.id)),
7417
+ edges: graph.edges.filter((edge) => !visibilityProjection.hiddenEdgeIds.has(edge.id))
7418
+ };
7419
+ }, [graph, visibilityProjection]);
7420
+ const renderGraph = useMemo(
7421
+ () => lens === "command-view" ? getCommandViewRenderableGraph(visibleGraph) : visibleGraph,
7422
+ [lens, visibleGraph]
7423
+ );
6933
7424
  const selectedGraphNode = useMemo(() => {
6934
- if (!graph || !selectedElement || selectedElement.type !== "node") {
7425
+ if (!visibleGraph || !selectedElement || selectedElement.type !== "node") {
6935
7426
  return null;
6936
7427
  }
6937
- return graph.nodes.find((node) => node.id === selectedElement.id) ?? null;
6938
- }, [graph, selectedElement]);
7428
+ return visibleGraph.nodes.find((node) => node.id === selectedElement.id) ?? null;
7429
+ }, [selectedElement, visibleGraph]);
6939
7430
  const selectedCommandViewResourceId = selectedGraphNode?.kind === "resource" ? selectedGraphNode.sourceId ?? null : null;
6940
7431
  const isExecutableSelection = lens === "command-view" && selectedGraphNode?.kind === "resource" && (selectedGraphNode.resourceType === "agent" || selectedGraphNode.resourceType === "workflow") && Boolean(selectedCommandViewResourceId);
6941
7432
  const isCheckpointSelection = lens === "command-view" && selectedGraphNode?.kind === "resource" && selectedGraphNode.resourceType === "human_checkpoint" && Boolean(selectedCommandViewResourceId);
@@ -6949,11 +7440,11 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6949
7440
  enabled: isCheckpointSelection
6950
7441
  });
6951
7442
  const traceResult = useMemo(() => {
6952
- if (!graph) {
7443
+ if (!visibleGraph) {
6953
7444
  return null;
6954
7445
  }
6955
- return resolveOrganizationGraphPathTrace(graph, pathTraceSelection);
6956
- }, [graph, pathTraceSelection]);
7446
+ return resolveOrganizationGraphPathTrace(visibleGraph, pathTraceSelection);
7447
+ }, [pathTraceSelection, visibleGraph]);
6957
7448
  const activeTraceResult = mode === "trace" ? traceResult : null;
6958
7449
  const operationalOverview = useMemo(
6959
7450
  () => lens === "command-view" ? getCommandViewOperationalOverview(commandViewData, commandViewStats) : null,
@@ -6977,8 +7468,8 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6977
7468
  [baseGraph, commandViewStats, lens]
6978
7469
  );
6979
7470
  const visibleCommandViewHealth = useMemo(
6980
- () => graph && commandViewHealthByNodeId ? graph.nodes.map((node) => commandViewHealthByNodeId.get(node.id) ?? null).filter((entry) => entry !== null) : [],
6981
- [commandViewHealthByNodeId, graph]
7471
+ () => visibleGraph && commandViewHealthByNodeId ? visibleGraph.nodes.map((node) => commandViewHealthByNodeId.get(node.id) ?? null).filter((entry) => entry !== null) : [],
7472
+ [commandViewHealthByNodeId, visibleGraph]
6982
7473
  );
6983
7474
  const visibleHotspots = useMemo(() => rankCommandViewHotspots(visibleCommandViewHealth), [visibleCommandViewHealth]);
6984
7475
  const pendingCheckpointHotspot = useMemo(
@@ -6986,11 +7477,11 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6986
7477
  [visibleCommandViewHealth]
6987
7478
  );
6988
7479
  const jumpToResourceOptions = useMemo(
6989
- () => (graph?.nodes ?? []).filter((node) => node.kind === "resource").map((node) => ({
7480
+ () => (visibleGraph?.nodes ?? []).filter((node) => node.kind === "resource").map((node) => ({
6990
7481
  value: node.id,
6991
7482
  label: node.label
6992
7483
  })).sort((left, right) => left.label.localeCompare(right.label)),
6993
- [graph]
7484
+ [visibleGraph]
6994
7485
  );
6995
7486
  const focusGraphNode = useEffectEvent((nodeId2) => {
6996
7487
  setFocusRequest({
@@ -6999,7 +7490,7 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
6999
7490
  });
7000
7491
  });
7001
7492
  const focusCommandViewResource = useEffectEvent((resourceId) => {
7002
- const focusNode = graph?.nodes.find((node) => node.kind === "resource" && node.sourceId === resourceId);
7493
+ const focusNode = visibleGraph?.nodes.find((node) => node.kind === "resource" && node.sourceId === resourceId);
7003
7494
  if (!focusNode) {
7004
7495
  return;
7005
7496
  }
@@ -7007,26 +7498,64 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
7007
7498
  setSelectedElement({ type: "node", id: focusNode.id });
7008
7499
  focusGraphNode(focusNode.id);
7009
7500
  });
7501
+ const handleResetFilters = useEffectEvent(() => {
7502
+ resetFilters();
7503
+ clearRevealedIds();
7504
+ setSelectedElement(null);
7505
+ setPathTraceSelection(EMPTY_TRACE_SELECTION);
7506
+ });
7507
+ const handleResourcesHiddenChange = useEffectEvent((value) => {
7508
+ setResourcesHidden(value);
7509
+ if (value) {
7510
+ clearRevealedIds();
7511
+ setSelectedElement(null);
7512
+ }
7513
+ });
7514
+ const handleDiagnosticsHiddenChange = useEffectEvent((value) => {
7515
+ setDiagnosticsHidden(value);
7516
+ if (value) {
7517
+ clearRevealedIds();
7518
+ }
7519
+ });
7520
+ const revealAllResources = useEffectEvent(() => {
7521
+ setResourcesHidden(false);
7522
+ setDiagnosticsHidden(false);
7523
+ clearRevealedIds();
7524
+ });
7010
7525
  const handleSelectElement = useEffectEvent((element) => {
7011
7526
  if (!element) {
7527
+ if (!selectedElement && revealedIds.size === 0) {
7528
+ return;
7529
+ }
7012
7530
  setSelectedElement(null);
7531
+ clearRevealedIds();
7013
7532
  return;
7014
7533
  }
7015
7534
  if (mode === "map" && element.type === "node" && selectedElement?.type === "node" && selectedElement.id === element.id) {
7016
7535
  setActivePanelTab("details");
7017
7536
  return;
7018
7537
  }
7538
+ if (lens === "command-view" && element.type === "node" && graph) {
7539
+ const connectedHiddenIds = getConnectedHiddenResourceIds(graph, element.id, visibilityProjection.hiddenIds);
7540
+ setRevealedIds(connectedHiddenIds);
7541
+ if (connectedHiddenIds.size > 0) {
7542
+ markVisibilityInteraction();
7543
+ }
7544
+ } else {
7545
+ clearRevealedIds();
7546
+ }
7019
7547
  setSelectedElement(element);
7020
7548
  });
7021
7549
  useEffect(() => {
7022
7550
  if (!graph || !selectedElement) {
7023
7551
  return;
7024
7552
  }
7025
- const elementExists = selectedElement.type === "node" ? graph.nodes.some((node) => node.id === selectedElement.id) : graph.edges.some((edge) => edge.id === selectedElement.id);
7553
+ const elementExists = selectedElement.type === "node" ? Boolean(visibleGraph?.nodes.some((node) => node.id === selectedElement.id)) : Boolean(visibleGraph?.edges.some((edge) => edge.id === selectedElement.id));
7026
7554
  if (!elementExists) {
7027
7555
  setSelectedElement(null);
7556
+ clearRevealedIds();
7028
7557
  }
7029
- }, [graph, selectedElement]);
7558
+ }, [clearRevealedIds, selectedElement, visibleGraph]);
7030
7559
  useEffect(() => {
7031
7560
  if (lens !== "command-view") {
7032
7561
  return;
@@ -7049,7 +7578,7 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
7049
7578
  });
7050
7579
  return;
7051
7580
  }
7052
- const visibleNodeIds = new Set(graph.nodes.map((node) => node.id));
7581
+ const visibleNodeIds = new Set(visibleGraph?.nodes.map((node) => node.id) ?? []);
7053
7582
  setPathTraceSelection((current) => {
7054
7583
  const sourceId = current.sourceId && visibleNodeIds.has(current.sourceId) ? current.sourceId : null;
7055
7584
  const targetId = current.targetId && visibleNodeIds.has(current.targetId) ? current.targetId : null;
@@ -7058,14 +7587,14 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
7058
7587
  }
7059
7588
  return { sourceId, targetId };
7060
7589
  });
7061
- }, [graph]);
7590
+ }, [graph, visibleGraph]);
7062
7591
  if (!organizationModel) {
7063
7592
  return /* @__PURE__ */ jsxs(Stack, { children: [
7064
7593
  /* @__PURE__ */ jsx(
7065
7594
  PageTitleCaption,
7066
7595
  {
7067
- title: "Organization Graph",
7068
- caption: "The shared graph surface needs an organization model before it can render."
7596
+ title: lens === "command-view" ? "Command View" : "Operations Graph",
7597
+ caption: "This surface needs an organization model before it can render."
7069
7598
  }
7070
7599
  ),
7071
7600
  /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "xl", children: /* @__PURE__ */ jsx(
@@ -7078,363 +7607,357 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
7078
7607
  ) })
7079
7608
  ] });
7080
7609
  }
7081
- return /* @__PURE__ */ jsx(Stack, { gap: "lg", style: { flex: 1, minHeight: 0, overflowX: "hidden", overflowY: "auto" }, children: /* @__PURE__ */ jsxs(Tabs, { value: activePanelTab, onChange: setActivePanelTab, keepMounted: false, children: [
7082
- lens === "command-view" ? /* @__PURE__ */ jsx(Box, { mb: "sm", children: /* @__PURE__ */ jsx(
7083
- CommandViewHealthStrip,
7084
- {
7085
- overview: operationalOverview,
7086
- hotspots: visibleHotspots,
7087
- visibleResources: getGraphCountByKind(graph, "resource"),
7088
- selectedLabel: selectedGraphNode?.label ?? null,
7089
- onFocusHotspot: focusCommandViewResource,
7090
- onResetFocus: () => {
7091
- setMode("map");
7092
- setSelectedElement(null);
7093
- }
7094
- }
7095
- ) }) : null,
7096
- /* @__PURE__ */ jsxs(
7097
- Paper,
7098
- {
7099
- withBorder: true,
7100
- style: {
7101
- display: "flex",
7102
- flexDirection: "column",
7103
- background: "var(--glass-background)",
7104
- backdropFilter: "var(--glass-blur)",
7105
- boxShadow: "var(--card-shadow)"
7106
- },
7107
- children: [
7108
- /* @__PURE__ */ jsx(Box, { style: { height: "65vh", minHeight: 560, position: "relative" }, children: graph && graph.nodes.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
7109
- /* @__PURE__ */ jsx(
7610
+ return /* @__PURE__ */ jsx(Stack, { gap: "lg", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsx(Tabs, { value: activePanelTab, onChange: setActivePanelTab, keepMounted: false, children: /* @__PURE__ */ jsxs(
7611
+ Paper,
7612
+ {
7613
+ withBorder: true,
7614
+ radius: "md",
7615
+ style: {
7616
+ display: "flex",
7617
+ flexDirection: "column",
7618
+ minHeight: 0,
7619
+ background: "var(--color-surface)",
7620
+ boxShadow: "var(--card-shadow)",
7621
+ overflow: "hidden"
7622
+ },
7623
+ children: [
7624
+ lens === "command-view" ? /* @__PURE__ */ jsx(
7625
+ CommandViewHealthStrip,
7626
+ {
7627
+ overview: operationalOverview,
7628
+ hotspots: visibleHotspots,
7629
+ visibleResources: visibilityProjection.visibleResourceCount,
7630
+ hiddenResources: visibilityProjection.hiddenResourceCount,
7631
+ resourcesHidden,
7632
+ selectedLabel: selectedGraphNode?.label ?? null,
7633
+ onFocusHotspot: focusCommandViewResource,
7634
+ onResourcesHiddenChange: handleResourcesHiddenChange,
7635
+ onResetFocus: () => {
7636
+ setMode("map");
7637
+ setSelectedElement(null);
7638
+ clearRevealedIds();
7639
+ }
7640
+ }
7641
+ ) : null,
7642
+ /* @__PURE__ */ jsx(
7643
+ Box,
7644
+ {
7645
+ style: {
7646
+ height: lens === "command-view" ? "54vh" : "62vh",
7647
+ minHeight: lens === "command-view" ? 420 : 520,
7648
+ maxHeight: lens === "command-view" ? 620 : void 0,
7649
+ position: "relative"
7650
+ },
7651
+ children: renderGraph && renderGraph.nodes.length > 0 ? /* @__PURE__ */ jsx(
7110
7652
  OrganizationGraphCanvas,
7111
7653
  {
7112
- graph,
7654
+ graph: renderGraph,
7113
7655
  mode,
7656
+ visualizationMode: lens === "command-view" ? effectiveVisualizationMode : "network",
7114
7657
  selectedElement,
7115
7658
  traceResult: activeTraceResult,
7659
+ hiddenIds: EMPTY_GRAPH_HIDDEN_IDS,
7660
+ hiddenEdgeIds: EMPTY_GRAPH_HIDDEN_EDGE_IDS,
7116
7661
  themeTokens,
7117
7662
  commandViewHealthByNodeId,
7118
7663
  focusRequest,
7664
+ toolbar: /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", children: [
7665
+ lens === "command-view" ? /* @__PURE__ */ jsx(
7666
+ SegmentedControl,
7667
+ {
7668
+ value: effectiveVisualizationMode,
7669
+ onChange: (value) => setVisualizationMode(value),
7670
+ size: "xs",
7671
+ data: COMMAND_VIEW_VISUALIZATION_MODES
7672
+ }
7673
+ ) : null,
7674
+ /* @__PURE__ */ jsx(
7675
+ SegmentedControl,
7676
+ {
7677
+ value: mode,
7678
+ onChange: (value) => setMode(value),
7679
+ size: "xs",
7680
+ data: [
7681
+ { label: "Map", value: "map" },
7682
+ { label: "Trace", value: "trace" },
7683
+ { label: "Impact", value: "impact" }
7684
+ ]
7685
+ }
7686
+ )
7687
+ ] }),
7119
7688
  onSelectElement: handleSelectElement
7120
7689
  }
7690
+ ) : /* @__PURE__ */ jsx(
7691
+ EmptyState,
7692
+ {
7693
+ icon: IconTopologyStar3,
7694
+ title: "No graph elements match the current filters",
7695
+ description: lens === "command-view" && visibilityProjection.hiddenResourceCount > 0 ? "Reveal resources or adjust filters to bring graph elements back into view." : "Adjust the graph controls to bring semantic nodes, topology nodes, or relationship matches back into view."
7696
+ }
7697
+ )
7698
+ }
7699
+ ),
7700
+ /* @__PURE__ */ jsx(Box, { p: "xs", children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "center", wrap: "wrap", children: [
7701
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "wrap", children: [
7702
+ /* @__PURE__ */ jsx(Text, { fw: 700, size: "sm", children: lens === "command-view" ? "Command View" : lensConfig.title }),
7703
+ /* @__PURE__ */ jsxs(Tabs.List, { children: [
7704
+ lens === "command-view" ? null : /* @__PURE__ */ jsx(Tabs.Tab, { value: "controls", children: "Controls" }),
7705
+ /* @__PURE__ */ jsx(Tabs.Tab, { value: "trace", children: "Trace" }),
7706
+ /* @__PURE__ */ jsx(Tabs.Tab, { value: "details", children: "Details" }),
7707
+ /* @__PURE__ */ jsx(Tabs.Tab, { value: "runtime", children: "Runtime" })
7708
+ ] })
7709
+ ] }),
7710
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "wrap", children: [
7711
+ /* @__PURE__ */ jsx(
7712
+ Select,
7713
+ {
7714
+ placeholder: "Jump to resource",
7715
+ searchable: true,
7716
+ clearable: true,
7717
+ size: "xs",
7718
+ data: jumpToResourceOptions,
7719
+ value: selectedElement?.type === "node" ? selectedElement.id : null,
7720
+ onChange: (value) => {
7721
+ if (!value) {
7722
+ return;
7723
+ }
7724
+ setMode("map");
7725
+ setSelectedElement({ type: "node", id: value });
7726
+ focusGraphNode(value);
7727
+ },
7728
+ styles: {
7729
+ root: { minWidth: 220 }
7730
+ },
7731
+ nothingFoundMessage: "No matching resource"
7732
+ }
7121
7733
  ),
7122
7734
  /* @__PURE__ */ jsx(
7123
- Box,
7735
+ Button,
7124
7736
  {
7125
- style: {
7126
- position: "absolute",
7127
- top: 16,
7128
- right: 16,
7129
- zIndex: 3,
7130
- maxWidth: "calc(100% - 320px)"
7737
+ size: "xs",
7738
+ variant: "subtle",
7739
+ onClick: () => {
7740
+ setSelectedElement(null);
7741
+ clearRevealedIds();
7131
7742
  },
7132
- children: /* @__PURE__ */ jsx(
7133
- SegmentedControl,
7134
- {
7135
- value: mode,
7136
- onChange: (value) => setMode(value),
7137
- size: "xs",
7138
- data: [
7139
- { label: "Map", value: "map" },
7140
- { label: "Trace", value: "trace" },
7141
- { label: "Impact", value: "impact" }
7142
- ]
7143
- }
7144
- )
7743
+ disabled: !selectedElement,
7744
+ children: "Clear selection"
7145
7745
  }
7146
- )
7147
- ] }) : /* @__PURE__ */ jsx(
7148
- EmptyState,
7149
- {
7150
- icon: IconTopologyStar3,
7151
- title: "No graph elements match the current filters",
7152
- description: "Adjust the graph controls to bring semantic nodes, topology nodes, or relationship matches back into view."
7153
- }
7154
- ) }),
7155
- /* @__PURE__ */ jsxs(
7156
- Box,
7157
- {
7158
- style: {
7159
- marginLeft: "calc(var(--mantine-spacing-md) * -1)",
7160
- marginRight: "calc(var(--mantine-spacing-md) * -1)",
7161
- marginBottom: "calc(var(--mantine-spacing-md) * -1)",
7162
- marginTop: "var(--mantine-spacing-md)",
7163
- borderTop: "1px solid var(--color-border)"
7164
- },
7165
- children: [
7166
- /* @__PURE__ */ jsx(Box, { p: "sm", children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "center", wrap: "wrap", children: [
7167
- /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "wrap", children: [
7168
- /* @__PURE__ */ jsx(Text, { fw: 700, size: "sm", children: lens === "command-view" ? "Command View" : lensConfig.title }),
7169
- /* @__PURE__ */ jsxs(Tabs.List, { children: [
7170
- /* @__PURE__ */ jsx(Tabs.Tab, { value: "controls", children: "Controls" }),
7171
- /* @__PURE__ */ jsx(Tabs.Tab, { value: "trace", children: "Trace" }),
7172
- /* @__PURE__ */ jsx(Tabs.Tab, { value: "details", children: "Details" }),
7173
- /* @__PURE__ */ jsx(Tabs.Tab, { value: "runtime", children: "Runtime" })
7174
- ] })
7175
- ] }),
7176
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "wrap", children: [
7177
- /* @__PURE__ */ jsx(
7178
- Select,
7179
- {
7180
- placeholder: "Jump to resource",
7181
- searchable: true,
7182
- clearable: true,
7183
- size: "xs",
7184
- data: jumpToResourceOptions,
7185
- value: selectedElement?.type === "node" ? selectedElement.id : null,
7186
- onChange: (value) => {
7187
- if (!value) {
7188
- return;
7189
- }
7190
- setMode("map");
7191
- setSelectedElement({ type: "node", id: value });
7192
- focusGraphNode(value);
7193
- },
7194
- styles: {
7195
- root: { minWidth: 220 }
7196
- },
7197
- nothingFoundMessage: "No matching resource"
7198
- }
7199
- ),
7200
- /* @__PURE__ */ jsx(
7201
- Button,
7202
- {
7203
- size: "xs",
7204
- variant: "subtle",
7205
- onClick: () => setSelectedElement(null),
7206
- disabled: !selectedElement,
7207
- children: "Clear selection"
7208
- }
7209
- ),
7210
- /* @__PURE__ */ jsx(
7211
- Button,
7212
- {
7213
- size: "xs",
7214
- variant: "subtle",
7215
- onClick: () => setPathTraceSelection(EMPTY_TRACE_SELECTION),
7216
- disabled: !pathTraceSelection.sourceId && !pathTraceSelection.targetId,
7217
- children: "Clear trace"
7218
- }
7219
- ),
7220
- /* @__PURE__ */ jsx(Button, { size: "xs", variant: "subtle", onClick: resetFilters, children: "Reset filters" })
7221
- ] })
7222
- ] }) }),
7223
- /* @__PURE__ */ jsxs(
7224
- Box,
7746
+ ),
7747
+ /* @__PURE__ */ jsx(
7748
+ Button,
7749
+ {
7750
+ size: "xs",
7751
+ variant: "subtle",
7752
+ onClick: () => setPathTraceSelection(EMPTY_TRACE_SELECTION),
7753
+ disabled: !pathTraceSelection.sourceId && !pathTraceSelection.targetId,
7754
+ children: "Clear trace"
7755
+ }
7756
+ ),
7757
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "subtle", onClick: handleResetFilters, children: "Reset filters" })
7758
+ ] })
7759
+ ] }) }),
7760
+ /* @__PURE__ */ jsxs(
7761
+ Box,
7762
+ {
7763
+ p: "xs",
7764
+ className: HIDE_SCROLLBAR_CLASS_NAME,
7765
+ style: {
7766
+ padding: "var(--mantine-spacing-md)",
7767
+ paddingTop: 0
7768
+ },
7769
+ children: [
7770
+ lens === "command-view" ? null : /* @__PURE__ */ jsx(Tabs.Panel, { value: "controls", pt: 0, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
7771
+ /* @__PURE__ */ jsx(
7772
+ FilterPanel,
7225
7773
  {
7226
- className: HIDE_SCROLLBAR_CLASS_NAME,
7227
- style: {
7228
- padding: "var(--mantine-spacing-md)",
7229
- paddingTop: 0
7230
- },
7231
- children: [
7232
- /* @__PURE__ */ jsx(Tabs.Panel, { value: "controls", pt: 0, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
7233
- /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, lg: 3 }, spacing: "md", children: [
7234
- /* @__PURE__ */ jsx(
7235
- Paper,
7236
- {
7237
- withBorder: true,
7238
- p: "md",
7239
- radius: "lg",
7240
- style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7241
- children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
7242
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 700, children: "Filters" }),
7243
- /* @__PURE__ */ jsx(
7244
- OrganizationGraphFilterToolbar,
7245
- {
7246
- value: filters,
7247
- onChange: updateFilters,
7248
- disabled: !baseGraph,
7249
- resetValue: toolbarResetValue
7250
- }
7251
- )
7252
- ] })
7253
- }
7254
- ),
7255
- /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "md", style: { gridColumn: "span 2" }, children: [
7256
- /* @__PURE__ */ jsxs(
7257
- Card,
7258
- {
7259
- withBorder: true,
7260
- radius: "lg",
7261
- style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7262
- children: [
7263
- /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: lens === "command-view" ? "Tracked runs" : "Visible nodes" }),
7264
- /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: lens === "command-view" ? operationalOverview?.totalRuns ?? 0 : graph?.nodes.length ?? 0 }),
7265
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: lens === "command-view" ? `${timeRange} execution window` : `of ${baseGraph?.nodes.length ?? 0} total` })
7266
- ]
7267
- }
7268
- ),
7269
- /* @__PURE__ */ jsxs(
7270
- Card,
7271
- {
7272
- withBorder: true,
7273
- radius: "lg",
7274
- style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7275
- children: [
7276
- /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: lens === "command-view" ? "Success rate" : "Visible edges" }),
7277
- /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: lens === "command-view" ? `${Math.round(operationalOverview?.successRate ?? 0)}%` : graph?.edges.length ?? 0 }),
7278
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: lens === "command-view" ? `${operationalOverview?.successCount ?? 0} successful runs` : `of ${baseGraph?.edges.length ?? 0} total` })
7279
- ]
7280
- }
7281
- ),
7282
- /* @__PURE__ */ jsxs(
7283
- Card,
7284
- {
7285
- withBorder: true,
7286
- radius: "lg",
7287
- style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7288
- children: [
7289
- /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: lens === "command-view" ? "Failing resources" : "Visible features" }),
7290
- /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: lens === "command-view" ? operationalOverview?.topFailingResources.length ?? 0 : getGraphCountByKind(graph, "feature") }),
7291
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: lens === "command-view" ? operationalOverview?.topFailingResources.length ? operationalOverview.topFailingResources.map((resource) => `${resource.label} (${resource.failureCount})`).join(", ") : "No failing resources in the current window" : `of ${getGraphCountByKind(baseGraph, "feature")} total` })
7292
- ]
7293
- }
7294
- ),
7295
- /* @__PURE__ */ jsxs(
7296
- Card,
7297
- {
7298
- withBorder: true,
7299
- radius: "lg",
7300
- style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7301
- children: [
7302
- /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: lens === "command-view" ? "Pending approvals" : "Visible resources" }),
7303
- /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: lens === "command-view" ? operationalOverview?.pendingApprovals ?? 0 : getGraphCountByKind(graph, "resource") }),
7304
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: lens === "command-view" ? `${operationalOverview?.activeHumanCheckpoints ?? 0} active checkpoint queues` : `of ${getGraphCountByKind(baseGraph, "resource")} total` })
7305
- ]
7306
- }
7307
- )
7308
- ] })
7309
- ] }),
7310
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
7311
- /* @__PURE__ */ jsx(Badge, { variant: "light", children: lens === "command-view" ? "Operations lens" : "Shared graph" }),
7312
- /* @__PURE__ */ jsx(
7313
- Badge,
7314
- {
7315
- variant: "light",
7316
- color: organizationGraph.available ? "var(--color-success)" : "var(--color-text-subtle)",
7317
- children: organizationGraph.available ? "Provider graph surface ready" : "Provider graph surface missing"
7318
- }
7319
- ),
7320
- /* @__PURE__ */ jsx(
7321
- Badge,
7322
- {
7323
- variant: "light",
7324
- color: commandViewData ? "var(--color-primary)" : "var(--color-text-subtle)",
7325
- children: commandViewData ? "Topology bridged" : isLoading ? "Topology loading" : "Semantic only"
7326
- }
7327
- ),
7328
- error ? /* @__PURE__ */ jsx(Badge, { variant: "light", color: "var(--color-error)", children: "Topology unavailable" }) : null
7329
- ] }),
7774
+ filters,
7775
+ onChangeFilters: updateFilters,
7776
+ resetValue: toolbarResetValue,
7777
+ disabled: !baseGraph,
7778
+ commandViewData,
7779
+ lens,
7780
+ resourcesHidden,
7781
+ diagnosticsHidden,
7782
+ onResourcesHiddenChange: handleResourcesHiddenChange,
7783
+ onDiagnosticsHiddenChange: handleDiagnosticsHiddenChange,
7784
+ onRevealResources: revealAllResources,
7785
+ onResetFilters: handleResetFilters,
7786
+ visibilityCounts: visibilityProjection,
7787
+ graph: visibleGraph,
7788
+ baseGraph
7789
+ }
7790
+ ),
7791
+ /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "md", children: [
7792
+ /* @__PURE__ */ jsxs(
7793
+ Card,
7794
+ {
7795
+ withBorder: true,
7796
+ radius: "lg",
7797
+ style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7798
+ children: [
7799
+ /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: "Visible nodes" }),
7800
+ /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: visibleGraph?.nodes.length ?? 0 }),
7330
7801
  /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7331
- "Showing ",
7332
- graph?.nodes.length ?? 0,
7333
- " nodes and ",
7334
- graph?.edges.length ?? 0,
7335
- " edges in the current projection. In map mode, single-click isolates a node neighborhood and clicking another node pivots the focus."
7802
+ "of ",
7803
+ baseGraph?.nodes.length ?? 0,
7804
+ " total"
7336
7805
  ] })
7337
- ] }) }),
7338
- /* @__PURE__ */ jsx(Tabs.Panel, { value: "trace", pt: 0, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
7339
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Trace mode resolves shortest directed paths inside the current filtered graph." }),
7340
- graph ? /* @__PURE__ */ jsx(
7341
- OrganizationGraphPathTraceControls,
7342
- {
7343
- graph,
7344
- value: pathTraceSelection,
7345
- onChange: setPathTraceSelection,
7346
- disabled: graph.nodes.length === 0
7347
- }
7348
- ) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Graph data is not available yet." })
7349
- ] }) }),
7350
- /* @__PURE__ */ jsx(Tabs.Panel, { value: "details", pt: 0, children: /* @__PURE__ */ jsx(
7351
- OrganizationGraphDetailPanel,
7352
- {
7353
- graph,
7354
- selectedElement,
7355
- supplementalSummary: selectionOperationalSummary,
7356
- followUpSections,
7357
- onClearSelection: () => setSelectedElement(null)
7358
- }
7359
- ) }),
7360
- /* @__PURE__ */ jsx(Tabs.Panel, { value: "runtime", pt: 0, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
7361
- /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7362
- "Active Lens: ",
7363
- lens
7364
- ] }),
7365
- /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7366
- "Feature ID: ",
7367
- organizationGraph.featureId ?? "unresolved"
7368
- ] }),
7806
+ ]
7807
+ }
7808
+ ),
7809
+ /* @__PURE__ */ jsxs(
7810
+ Card,
7811
+ {
7812
+ withBorder: true,
7813
+ radius: "lg",
7814
+ style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7815
+ children: [
7816
+ /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: "Visible edges" }),
7817
+ /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: visibleGraph?.edges.length ?? 0 }),
7369
7818
  /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7370
- "Feature Path: ",
7371
- organizationGraph.featurePath ?? "unresolved"
7372
- ] }),
7819
+ "of ",
7820
+ baseGraph?.edges.length ?? 0,
7821
+ " total"
7822
+ ] })
7823
+ ]
7824
+ }
7825
+ ),
7826
+ /* @__PURE__ */ jsxs(
7827
+ Card,
7828
+ {
7829
+ withBorder: true,
7830
+ radius: "lg",
7831
+ style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7832
+ children: [
7833
+ /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: "Visible features" }),
7834
+ /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: getGraphCountByKind(visibleGraph, "feature") }),
7373
7835
  /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7374
- "Active Mode: ",
7375
- mode
7376
- ] }),
7377
- operationalOverview ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7378
- "Operational Snapshot: ",
7379
- operationalOverview.trackedResources,
7380
- " resources,",
7381
- " ",
7382
- operationalOverview.pendingApprovals,
7383
- " pending approvals, generated",
7384
- " ",
7385
- formatGeneratedTimestamp(operationalOverview.generatedAt)
7386
- ] }) : null,
7387
- pendingCheckpointHotspot ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7388
- "Active queue hotspot: ",
7389
- pendingCheckpointHotspot.resourceId,
7390
- " with",
7391
- " ",
7392
- pendingCheckpointHotspot.pendingCount,
7393
- " pending approvals."
7394
- ] }) : null,
7395
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Graph Build: semantic derivation plus bridged Command View topology" }),
7836
+ "of ",
7837
+ getGraphCountByKind(baseGraph, "feature"),
7838
+ " total"
7839
+ ] })
7840
+ ]
7841
+ }
7842
+ ),
7843
+ /* @__PURE__ */ jsxs(
7844
+ Card,
7845
+ {
7846
+ withBorder: true,
7847
+ radius: "lg",
7848
+ style: { background: "var(--color-surface)", boxShadow: "var(--card-shadow)" },
7849
+ children: [
7850
+ /* @__PURE__ */ jsx(Text, { size: "xs", tt: "uppercase", fw: 700, c: "dimmed", children: "Visible resources" }),
7851
+ /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: getGraphCountByKind(visibleGraph, "resource") }),
7396
7852
  /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7397
- "Projection: ",
7398
- graph?.nodes.length ?? 0,
7399
- " visible nodes, ",
7400
- graph?.edges.length ?? 0,
7401
- " visible edges"
7402
- ] }),
7403
- isLoading ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Topology bridge is still loading; semantic nodes remain available." }) : null,
7404
- error ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "red", children: [
7405
- "Topology bridge error: ",
7406
- error.message
7407
- ] }) : null
7408
- ] }) })
7409
- ]
7853
+ "of ",
7854
+ getGraphCountByKind(baseGraph, "resource"),
7855
+ " total"
7856
+ ] })
7857
+ ]
7858
+ }
7859
+ )
7860
+ ] }),
7861
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
7862
+ /* @__PURE__ */ jsx(Badge, { variant: "light", children: "Command View graph" }),
7863
+ /* @__PURE__ */ jsx(
7864
+ Badge,
7865
+ {
7866
+ variant: "light",
7867
+ color: commandViewData ? "var(--color-primary)" : "var(--color-text-subtle)",
7868
+ children: commandViewData ? "Topology bridged" : isLoading ? "Topology loading" : "Semantic only"
7869
+ }
7870
+ ),
7871
+ error ? /* @__PURE__ */ jsx(Badge, { variant: "light", color: "var(--color-error)", children: "Topology unavailable" }) : null
7872
+ ] }),
7873
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7874
+ "Showing ",
7875
+ visibleGraph?.nodes.length ?? 0,
7876
+ " nodes and ",
7877
+ visibleGraph?.edges.length ?? 0,
7878
+ " edges in the current projection. In map mode, single-click isolates a node neighborhood and clicking another node pivots the focus."
7879
+ ] })
7880
+ ] }) }),
7881
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "trace", pt: 0, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
7882
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Trace mode resolves shortest directed paths inside the current filtered graph." }),
7883
+ visibleGraph ? /* @__PURE__ */ jsx(
7884
+ OrganizationGraphPathTraceControls,
7885
+ {
7886
+ graph: visibleGraph,
7887
+ value: pathTraceSelection,
7888
+ onChange: setPathTraceSelection,
7889
+ disabled: visibleGraph.nodes.length === 0
7410
7890
  }
7411
- )
7412
- ]
7413
- }
7414
- )
7415
- ]
7416
- }
7417
- )
7418
- ] }) });
7891
+ ) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Graph data is not available yet." })
7892
+ ] }) }),
7893
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "details", pt: 0, children: /* @__PURE__ */ jsx(
7894
+ OrganizationGraphDetailPanel,
7895
+ {
7896
+ graph: visibleGraph,
7897
+ selectedElement,
7898
+ supplementalSummary: selectionOperationalSummary,
7899
+ followUpSections,
7900
+ onClearSelection: () => {
7901
+ setSelectedElement(null);
7902
+ clearRevealedIds();
7903
+ }
7904
+ }
7905
+ ) }),
7906
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "runtime", pt: 0, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
7907
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7908
+ "Active Lens: ",
7909
+ lens
7910
+ ] }),
7911
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7912
+ "Active Mode: ",
7913
+ mode
7914
+ ] }),
7915
+ lens === "command-view" ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7916
+ "Visualization: ",
7917
+ effectiveVisualizationMode
7918
+ ] }) : null,
7919
+ operationalOverview ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7920
+ "Operational Snapshot: ",
7921
+ operationalOverview.trackedResources,
7922
+ " resources,",
7923
+ " ",
7924
+ operationalOverview.pendingApprovals,
7925
+ " pending approvals, generated",
7926
+ " ",
7927
+ formatGeneratedTimestamp(operationalOverview.generatedAt)
7928
+ ] }) : null,
7929
+ pendingCheckpointHotspot ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7930
+ "Active queue hotspot: ",
7931
+ pendingCheckpointHotspot.resourceId,
7932
+ " with",
7933
+ " ",
7934
+ pendingCheckpointHotspot.pendingCount,
7935
+ " pending approvals."
7936
+ ] }) : null,
7937
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Graph Build: semantic derivation plus bridged Command View topology" }),
7938
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
7939
+ "Projection: ",
7940
+ visibleGraph?.nodes.length ?? 0,
7941
+ " visible nodes, ",
7942
+ visibleGraph?.edges.length ?? 0,
7943
+ " visible edges"
7944
+ ] }),
7945
+ isLoading ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Topology bridge is still loading; semantic nodes remain available." }) : null,
7946
+ error ? /* @__PURE__ */ jsxs(Text, { size: "sm", c: "red", children: [
7947
+ "Topology bridge error: ",
7948
+ error.message
7949
+ ] }) : null
7950
+ ] }) })
7951
+ ]
7952
+ }
7953
+ )
7954
+ ]
7955
+ }
7956
+ ) }) });
7419
7957
  }
7420
7958
  function CommandViewPage({ timeRange }) {
7421
7959
  return /* @__PURE__ */ jsx(OrganizationGraphPage, { lens: "command-view", timeRange });
7422
7960
  }
7423
- var FILTER_STATE_ICONS2 = {
7424
- neutral: IconCircleDashed,
7425
- include: IconCircleCheck,
7426
- exclude: IconCircleX
7427
- };
7428
- var FILTER_STATE_COLORS2 = {
7429
- neutral: "var(--color-surface-hover)",
7430
- include: "var(--mantine-color-green-6)",
7431
- exclude: "var(--mantine-color-red-6)"
7432
- };
7433
- var FILTER_STATE_LABELS2 = {
7434
- neutral: "Not filtered",
7435
- include: "Include only",
7436
- exclude: "Exclude"
7437
- };
7438
7961
  var EXECUTION_SECTIONS = [
7439
7962
  { status: "failed", title: "Failed Executions", badgeColor: "red" },
7440
7963
  { status: "warning", title: "Warning Executions", badgeColor: "yellow" },
@@ -7488,22 +8011,21 @@ function ExecutionStatusSection({ executions, status, title, badgeColor, resourc
7488
8011
  function CommandViewSidebarContent({ timeRange }) {
7489
8012
  const theme = useMantineTheme();
7490
8013
  const colors = useCyberColors();
7491
- const lensConfig = getOrganizationGraphLensConfig("command-view");
8014
+ const { organizationModel } = useElevasisFeatures();
8015
+ const lensConfig = useMemo(() => getOrganizationGraphLensConfig("command-view"), []);
8016
+ const { filters, resetFilters, updateFilters } = useOrganizationGraphFilters(lensConfig.initialFilters);
8017
+ const toolbarResetValue = useMemo(
8018
+ () => createOrganizationGraphFilters(lensConfig.initialFilters),
8019
+ [lensConfig.initialFilters]
8020
+ );
7492
8021
  const selectedNodeId = useCommandViewStore((s) => s.selectedNodeId);
7493
- const { filters, updateFilters } = useOrganizationGraphFilters(lensConfig.initialFilters);
7494
- const statusFilter = filters.environmentStatus;
7495
- const showIntegrations = filters.showIntegrations;
7496
- const domainFilters = filters.domainFilters;
7497
- const cycleDomainFilter = (domainId) => {
7498
- const current = domainFilters[domainId] ?? "neutral";
7499
- const nextState = current === "neutral" ? "include" : current === "include" ? "exclude" : "neutral";
7500
- updateFilters({
7501
- domainFilters: {
7502
- ...domainFilters,
7503
- [domainId]: nextState
7504
- }
7505
- });
7506
- };
8022
+ const resourcesHidden = useCommandViewStore((s) => s.resourcesHidden);
8023
+ const setResourcesHidden = useCommandViewStore((s) => s.setResourcesHidden);
8024
+ const diagnosticsHidden = useCommandViewStore((s) => s.diagnosticsHidden);
8025
+ const setDiagnosticsHidden = useCommandViewStore((s) => s.setDiagnosticsHidden);
8026
+ const diagnosticCategories = useCommandViewStore((s) => s.diagnosticCategories);
8027
+ const revealedIds = useCommandViewStore((s) => s.revealedIds);
8028
+ const clearRevealedIds = useCommandViewStore((s) => s.clearRevealedIds);
7507
8029
  const { data, isLoading } = useCommandViewData();
7508
8030
  const { data: statsData } = useCommandViewStats(timeRange);
7509
8031
  const cleanData = data ?? null;
@@ -7512,33 +8034,85 @@ function CommandViewSidebarContent({ timeRange }) {
7512
8034
  if (!statsData) return cleanData;
7513
8035
  return mergeStatsWithTopology(cleanData, statsData);
7514
8036
  }, [cleanData, statsData]);
8037
+ const baseGraph = useMemo(() => {
8038
+ if (!organizationModel) {
8039
+ return null;
8040
+ }
8041
+ return buildOrganizationGraph({
8042
+ organizationModel,
8043
+ commandViewData: cleanData ?? void 0
8044
+ });
8045
+ }, [cleanData, organizationModel]);
8046
+ const graph = useMemo(() => {
8047
+ if (!baseGraph) {
8048
+ return null;
8049
+ }
8050
+ return filterOrganizationGraph(baseGraph, filters, {
8051
+ commandViewData: cleanData
8052
+ });
8053
+ }, [baseGraph, cleanData, filters]);
8054
+ const visibilityProjection = useMemo(() => {
8055
+ if (!graph) {
8056
+ return {
8057
+ hiddenIds: /* @__PURE__ */ new Set(),
8058
+ hiddenEdgeIds: /* @__PURE__ */ new Set(),
8059
+ totalResourceCount: 0,
8060
+ visibleResourceCount: 0,
8061
+ hiddenResourceCount: 0,
8062
+ hiddenDiagnosticResourceCount: 0
8063
+ };
8064
+ }
8065
+ return getCommandViewVisibilityProjection({
8066
+ graph,
8067
+ commandViewData: cleanData,
8068
+ resourcesHidden,
8069
+ diagnosticsHidden,
8070
+ diagnosticCategories,
8071
+ revealedIds,
8072
+ mode: "map"
8073
+ });
8074
+ }, [cleanData, diagnosticCategories, diagnosticsHidden, graph, resourcesHidden, revealedIds]);
8075
+ const visibleGraph = useMemo(() => {
8076
+ if (!graph || visibilityProjection.hiddenIds.size === 0) {
8077
+ return graph;
8078
+ }
8079
+ return {
8080
+ ...graph,
8081
+ nodes: graph.nodes.filter((node) => !visibilityProjection.hiddenIds.has(node.id)),
8082
+ edges: graph.edges.filter((edge) => !visibilityProjection.hiddenEdgeIds.has(edge.id))
8083
+ };
8084
+ }, [graph, visibilityProjection]);
8085
+ const handleResetFilters = () => {
8086
+ resetFilters();
8087
+ clearRevealedIds();
8088
+ };
8089
+ const handleResourcesHiddenChange = (value) => {
8090
+ setResourcesHidden(value);
8091
+ if (value) {
8092
+ clearRevealedIds();
8093
+ }
8094
+ };
8095
+ const handleDiagnosticsHiddenChange = (value) => {
8096
+ setDiagnosticsHidden(value);
8097
+ if (value) {
8098
+ clearRevealedIds();
8099
+ }
8100
+ };
8101
+ const revealAllResources = () => {
8102
+ setResourcesHidden(false);
8103
+ setDiagnosticsHidden(false);
8104
+ clearRevealedIds();
8105
+ };
7515
8106
  const { donutSuccessCount, donutFailedCount } = useMemo(() => {
7516
8107
  if (!cleanData || !statsData) return { donutSuccessCount: 0, donutFailedCount: 0 };
7517
- const includes = Object.entries(domainFilters).filter(([, v]) => v === "include").map(([k]) => k);
7518
- const excludes = Object.entries(domainFilters).filter(([, v]) => v === "exclude").map(([k]) => k);
7519
8108
  const allResources = [
7520
8109
  ...cleanData.agents,
7521
8110
  ...cleanData.workflows,
7522
8111
  ...cleanData.triggers,
7523
- ...showIntegrations ? cleanData.integrations : [],
8112
+ ...cleanData.integrations,
7524
8113
  ...cleanData.externalResources ?? [],
7525
8114
  ...cleanData.humanCheckpoints ?? []
7526
- ].filter((resource) => {
7527
- const facets = [
7528
- ...resource.category ? [`category:${resource.category}`] : [],
7529
- ...resource.links?.map((link) => link.nodeId) ?? []
7530
- ];
7531
- if (excludes.length > 0 && facets.some((d) => excludes.includes(d))) return false;
7532
- if (includes.length > 0 && !facets.some((d) => includes.includes(d))) return false;
7533
- if (statusFilter !== "all" && resource.status !== statusFilter) return false;
7534
- if (filters.resourceTypes.length > 0) {
7535
- const normalizedResourceType = resource.type === "human" ? "human_checkpoint" : resource.type;
7536
- if (!filters.resourceTypes.includes(normalizedResourceType)) {
7537
- return false;
7538
- }
7539
- }
7540
- return true;
7541
- });
8115
+ ];
7542
8116
  const filteredIds = new Set(allResources.map((resource) => resource.resourceId));
7543
8117
  let success = 0;
7544
8118
  let failed = 0;
@@ -7549,18 +8123,7 @@ function CommandViewSidebarContent({ timeRange }) {
7549
8123
  }
7550
8124
  }
7551
8125
  return { donutSuccessCount: success, donutFailedCount: failed };
7552
- }, [cleanData, domainFilters, filters.resourceTypes, showIntegrations, statsData, statusFilter]);
7553
- const resourceFacets = useMemo(() => {
7554
- if (!cleanData) return [];
7555
- return collectResourceFilterFacets([
7556
- ...cleanData.agents,
7557
- ...cleanData.workflows,
7558
- ...cleanData.triggers,
7559
- ...cleanData.integrations,
7560
- ...cleanData.externalResources ?? [],
7561
- ...cleanData.humanCheckpoints ?? []
7562
- ]);
7563
- }, [cleanData]);
8126
+ }, [cleanData, statsData]);
7564
8127
  const selectedNode = useMemo(() => {
7565
8128
  if (!selectedNodeId || !dataWithStats) return null;
7566
8129
  const allNodes = [
@@ -7624,17 +8187,18 @@ function CommandViewSidebarContent({ timeRange }) {
7624
8187
  if (isLoading && !data) {
7625
8188
  return /* @__PURE__ */ jsx(SubshellSidebarLoader, {});
7626
8189
  }
7627
- return /* @__PURE__ */ jsxs(
8190
+ return /* @__PURE__ */ jsx(
7628
8191
  Box,
7629
8192
  {
7630
8193
  style: {
7631
8194
  flex: 1,
8195
+ height: "100%",
7632
8196
  minHeight: 0,
7633
8197
  display: "flex",
7634
8198
  flexDirection: "column",
7635
8199
  overflow: "hidden"
7636
8200
  },
7637
- children: [
8201
+ children: /* @__PURE__ */ jsxs("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", overflowX: "hidden" }, children: [
7638
8202
  /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconSitemap, label: "Command View" }),
7639
8203
  /* @__PURE__ */ jsx(Box, { style: { padding: theme.spacing.sm, paddingBottom: 0 }, children: /* @__PURE__ */ jsx(Box, { pb: "xs", mb: 4, children: /* @__PURE__ */ jsx(
7640
8204
  CyberDonut,
@@ -7648,165 +8212,105 @@ function CommandViewSidebarContent({ timeRange }) {
7648
8212
  colors
7649
8213
  }
7650
8214
  ) }) }),
7651
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflow: "auto" }, children: [
7652
- /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconAdjustmentsHorizontal, label: "Node Filters", withTopBorder: true }),
7653
- /* @__PURE__ */ jsxs(Stack, { gap: "sm", p: "sm", children: [
7654
- /* @__PURE__ */ jsxs("div", { children: [
7655
- /* @__PURE__ */ jsx(Text, { size: "sm", mb: 8, children: "Environment" }),
7656
- /* @__PURE__ */ jsx(
7657
- SegmentedControl,
7658
- {
7659
- value: statusFilter,
7660
- onChange: (value) => updateFilters({
7661
- environmentStatus: value
7662
- }),
7663
- data: [
7664
- { label: "All", value: "all" },
7665
- { label: "Prod", value: "prod" },
7666
- { label: "Dev", value: "dev" }
7667
- ],
7668
- size: "xs",
7669
- fullWidth: true,
7670
- color: "var(--color-primary)"
7671
- }
7672
- )
7673
- ] }),
7674
- /* @__PURE__ */ jsx(
7675
- Switch,
7676
- {
7677
- label: "Show Integrations",
7678
- description: "Toggle integration resources in the graph projection",
7679
- checked: showIntegrations,
7680
- onChange: (event) => updateFilters({
7681
- showIntegrations: event.currentTarget.checked
7682
- }),
7683
- size: "sm"
7684
- }
7685
- ),
7686
- resourceFacets.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
7687
- /* @__PURE__ */ jsx(Text, { size: "sm", mb: 8, children: "Resource Facet" }),
7688
- /* @__PURE__ */ jsx(Stack, { gap: 2, children: resourceFacets.map((facet) => {
7689
- const filterState = domainFilters[facet.id] || "neutral";
7690
- const StateIcon = FILTER_STATE_ICONS2[filterState];
7691
- return /* @__PURE__ */ jsx(
7692
- UnstyledButton,
7693
- {
7694
- title: FILTER_STATE_LABELS2[filterState],
7695
- onClick: () => cycleDomainFilter(facet.id),
7696
- py: 5,
7697
- px: 6,
7698
- style: {
7699
- transition: "background-color var(--duration-fast) var(--easing)",
7700
- "&:hover": { backgroundColor: "var(--color-surface-hover)" }
7701
- },
7702
- children: /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", children: [
7703
- /* @__PURE__ */ jsx(
7704
- StateIcon,
7705
- {
7706
- size: 16,
7707
- style: {
7708
- color: FILTER_STATE_COLORS2[filterState],
7709
- flexShrink: 0,
7710
- transition: "color var(--duration-fast) var(--easing)"
7711
- }
7712
- }
7713
- ),
7714
- /* @__PURE__ */ jsx(
7715
- Text,
7716
- {
7717
- size: "sm",
7718
- truncate: true,
7719
- fw: filterState !== "neutral" ? 500 : 400,
7720
- c: filterState !== "neutral" ? void 0 : "dimmed",
7721
- children: facet.label
7722
- }
7723
- )
7724
- ] })
7725
- },
7726
- facet.id
7727
- );
7728
- }) })
7729
- ] })
7730
- ] }),
7731
- selectedNode && /* @__PURE__ */ jsxs(Fragment, { children: [
7732
- /* @__PURE__ */ jsx(Divider, {}),
7733
- /* @__PURE__ */ jsxs(Stack, { gap: "xs", p: "sm", mt: 8, children: [
7734
- /* @__PURE__ */ jsx(Title, { order: 4, children: selectedNode.name }),
7735
- selectedNode.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: selectedNode.description }),
7736
- (isNavigable || isHumanCheckpoint) && /* @__PURE__ */ jsxs(
7737
- Button,
7738
- {
7739
- component: "a",
7740
- href: getNavigationUrl() || "#",
7741
- target: "_blank",
7742
- rel: "noopener noreferrer",
7743
- variant: "light",
7744
- size: "xs",
7745
- leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 14 }),
7746
- mt: 4,
7747
- children: [
7748
- "Go to",
7749
- " ",
7750
- selectedNode.type === "agent" ? "Agent" : selectedNode.type === "workflow" ? "Workflow" : "Queue"
7751
- ]
7752
- }
7753
- ),
7754
- /* @__PURE__ */ jsx(Space, { h: "sm" })
7755
- ] })
7756
- ] }),
7757
- selectedNode && isNavigable && /* @__PURE__ */ jsx(Stack, { p: "sm", children: executionsLoading ? /* @__PURE__ */ jsx(Center, { py: "md", children: /* @__PURE__ */ jsx(Loader, { size: "sm" }) }) : executionsError ? /* @__PURE__ */ jsx(APIErrorAlert, { error: executionsError, title: "Failed to load executions" }) : executionsData && executionsData.executions.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
7758
- EXECUTION_SECTIONS.map((section) => /* @__PURE__ */ jsx(
7759
- ExecutionStatusSection,
7760
- {
7761
- executions: executionsData.executions,
7762
- status: section.status,
7763
- title: section.title,
7764
- badgeColor: section.badgeColor,
7765
- resourceUrl
7766
- },
7767
- section.status
7768
- )),
7769
- totalExecutionPages(executionsData.totalExecutions) > 1 && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
7770
- Pagination,
7771
- {
7772
- size: "sm",
7773
- total: totalExecutionPages(executionsData.totalExecutions),
7774
- value: executionPage,
7775
- onChange: setExecutionPage,
7776
- boundaries: 1
7777
- }
7778
- ) })
7779
- ] }) : executionsData ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No executions in the selected time range" }) : null }),
7780
- selectedNode && isHumanCheckpoint && /* @__PURE__ */ jsx(Stack, { p: "sm", children: checkpointTasksLoading ? /* @__PURE__ */ jsx(Center, { py: "md", children: /* @__PURE__ */ jsx(Loader, { size: "sm" }) }) : checkpointTasksError ? /* @__PURE__ */ jsx(APIErrorAlert, { error: checkpointTasksError, title: "Failed to load pending tasks" }) : checkpointTasksData && checkpointTasksData.tasks.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
7781
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: 8, children: [
7782
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", fw: 600, tt: "uppercase", children: "Pending Tasks" }),
7783
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: checkpointTasksData.tasks.length })
7784
- ] }),
7785
- /* @__PURE__ */ jsx(Stack, { gap: "xs", children: checkpointTasksData.tasks.map((task) => /* @__PURE__ */ jsxs(
7786
- Card,
8215
+ /* @__PURE__ */ jsx(Box, { p: "sm", children: /* @__PURE__ */ jsx(
8216
+ FilterPanel,
8217
+ {
8218
+ filters,
8219
+ onChangeFilters: updateFilters,
8220
+ resetValue: toolbarResetValue,
8221
+ disabled: !baseGraph,
8222
+ commandViewData: cleanData,
8223
+ lens: "command-view",
8224
+ resourcesHidden,
8225
+ diagnosticsHidden,
8226
+ onResourcesHiddenChange: handleResourcesHiddenChange,
8227
+ onDiagnosticsHiddenChange: handleDiagnosticsHiddenChange,
8228
+ onRevealResources: revealAllResources,
8229
+ onResetFilters: handleResetFilters,
8230
+ visibilityCounts: visibilityProjection,
8231
+ graph: visibleGraph,
8232
+ baseGraph,
8233
+ layout: "stack"
8234
+ }
8235
+ ) }),
8236
+ selectedNode && /* @__PURE__ */ jsxs(Fragment, { children: [
8237
+ /* @__PURE__ */ jsx(Divider, {}),
8238
+ /* @__PURE__ */ jsxs(Stack, { gap: "xs", p: "sm", mt: 8, children: [
8239
+ /* @__PURE__ */ jsx(Title, { order: 4, children: selectedNode.name }),
8240
+ selectedNode.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: selectedNode.description }),
8241
+ (isNavigable || isHumanCheckpoint) && /* @__PURE__ */ jsxs(
8242
+ Button,
7787
8243
  {
7788
- padding: "xs",
7789
- withBorder: true,
7790
8244
  component: "a",
7791
- href: `/operations/command-queue?task=${task.id}`,
8245
+ href: getNavigationUrl() || "#",
7792
8246
  target: "_blank",
7793
8247
  rel: "noopener noreferrer",
7794
- style: HOVER_CARD_STYLE,
7795
- onMouseEnter: handleHoverEnter,
7796
- onMouseLeave: handleHoverLeave,
8248
+ variant: "light",
8249
+ size: "xs",
8250
+ leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 14 }),
8251
+ mt: 4,
7797
8252
  children: [
7798
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: task.description ? 4 : 0, children: [
7799
- /* @__PURE__ */ jsx(Badge, { size: "xs", color: "orange", variant: "light", children: "pending" }),
7800
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatRelativeTime3(task.createdAt) })
7801
- ] }),
7802
- task.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 2, children: task.description })
8253
+ "Go to",
8254
+ " ",
8255
+ selectedNode.type === "agent" ? "Agent" : selectedNode.type === "workflow" ? "Workflow" : "Queue"
7803
8256
  ]
7804
- },
7805
- task.id
7806
- )) })
7807
- ] }) : checkpointTasksData ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No pending tasks" }) : null })
7808
- ] })
7809
- ]
8257
+ }
8258
+ ),
8259
+ /* @__PURE__ */ jsx(Space, { h: "sm" })
8260
+ ] })
8261
+ ] }),
8262
+ selectedNode && isNavigable && /* @__PURE__ */ jsx(Stack, { p: "sm", children: executionsLoading ? /* @__PURE__ */ jsx(Center, { py: "md", children: /* @__PURE__ */ jsx(Loader, { size: "sm" }) }) : executionsError ? /* @__PURE__ */ jsx(APIErrorAlert, { error: executionsError, title: "Failed to load executions" }) : executionsData && executionsData.executions.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
8263
+ EXECUTION_SECTIONS.map((section) => /* @__PURE__ */ jsx(
8264
+ ExecutionStatusSection,
8265
+ {
8266
+ executions: executionsData.executions,
8267
+ status: section.status,
8268
+ title: section.title,
8269
+ badgeColor: section.badgeColor,
8270
+ resourceUrl
8271
+ },
8272
+ section.status
8273
+ )),
8274
+ totalExecutionPages(executionsData.totalExecutions) > 1 && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
8275
+ Pagination,
8276
+ {
8277
+ size: "sm",
8278
+ total: totalExecutionPages(executionsData.totalExecutions),
8279
+ value: executionPage,
8280
+ onChange: setExecutionPage,
8281
+ boundaries: 1
8282
+ }
8283
+ ) })
8284
+ ] }) : executionsData ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No executions in the selected time range" }) : null }),
8285
+ selectedNode && isHumanCheckpoint && /* @__PURE__ */ jsx(Stack, { p: "sm", children: checkpointTasksLoading ? /* @__PURE__ */ jsx(Center, { py: "md", children: /* @__PURE__ */ jsx(Loader, { size: "sm" }) }) : checkpointTasksError ? /* @__PURE__ */ jsx(APIErrorAlert, { error: checkpointTasksError, title: "Failed to load pending tasks" }) : checkpointTasksData && checkpointTasksData.tasks.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
8286
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: 8, children: [
8287
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", fw: 600, tt: "uppercase", children: "Pending Tasks" }),
8288
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: checkpointTasksData.tasks.length })
8289
+ ] }),
8290
+ /* @__PURE__ */ jsx(Stack, { gap: "xs", children: checkpointTasksData.tasks.map((task) => /* @__PURE__ */ jsxs(
8291
+ Card,
8292
+ {
8293
+ padding: "xs",
8294
+ withBorder: true,
8295
+ component: "a",
8296
+ href: `/operations/command-queue?task=${task.id}`,
8297
+ target: "_blank",
8298
+ rel: "noopener noreferrer",
8299
+ style: HOVER_CARD_STYLE,
8300
+ onMouseEnter: handleHoverEnter,
8301
+ onMouseLeave: handleHoverLeave,
8302
+ children: [
8303
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: task.description ? 4 : 0, children: [
8304
+ /* @__PURE__ */ jsx(Badge, { size: "xs", color: "orange", variant: "light", children: "pending" }),
8305
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatRelativeTime3(task.createdAt) })
8306
+ ] }),
8307
+ task.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 2, children: task.description })
8308
+ ]
8309
+ },
8310
+ task.id
8311
+ )) })
8312
+ ] }) : checkpointTasksData ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No pending tasks" }) : null })
8313
+ ] })
7810
8314
  }
7811
8315
  );
7812
8316
  }
@@ -9116,15 +9620,15 @@ var OperationsSidebar = () => {
9116
9620
  function CommandQueueShell({ children }) {
9117
9621
  return /* @__PURE__ */ jsx(SubshellContentContainer, { children });
9118
9622
  }
9623
+ var commandViewSidebarWidth = 320;
9624
+ var defaultOperationsSidebarWidth = 250;
9119
9625
  var operationsManifest = {
9120
9626
  key: "operations",
9121
9627
  featureId: "operations",
9122
- capabilityIds: ["operations.organization-graph", "operations.command-view"],
9628
+ capabilityIds: ["operations.command-view"],
9123
9629
  icon: IconCode,
9124
9630
  sidebar: OperationsSidebar,
9125
- organizationGraph: {
9126
- featureId: "operations.graph"
9127
- }
9631
+ sidebarWidth: ({ currentPath }) => currentPath.startsWith("/operations/command-view") ? commandViewSidebarWidth : defaultOperationsSidebarWidth
9128
9632
  };
9129
9633
 
9130
9634
  export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, AgentExecutionPanel, AgentSessionGroup, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueDetailPage, CommandQueuePage, CommandQueueShell, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewPage, CommandViewSidebarContent, ConfigCard, ContentSections, ContextUsageBadge, ContractDisplay, ExecuteWorkflowModal, ExecutionErrorSection, ExecutionPanel, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationGraphPage, ResourceDefinitionSection, ResourceDetailPage, ResourceErrorState, ResourceExecuteDialog, ResourceExecuteForm, ResourceFilter, ResourceHeader, ResourceNotFoundState, ResourcesPage, ResourcesSidebar, SessionChatArea, SessionChatInterface, SessionChatPage, SessionDetailsSidebar, SessionExecutionLogs, SessionHeader, SessionListItem, SessionMemory, SessionsPage, SessionsSidebar, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, WorkflowExecutionPanel, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, operationsManifest, useNewKnowledgeMapLayout };