@elevasis/ui 2.30.0 → 2.32.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 (130) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +38 -0
  3. package/dist/app/index.d.ts +190 -9
  4. package/dist/app/index.js +7 -6
  5. package/dist/charts/index.js +4 -5
  6. package/dist/{chunk-HXZQWMKE.js → chunk-2RJMVWFJ.js} +1 -6
  7. package/dist/{chunk-4VQ2PXMI.js → chunk-3FV6HBXS.js} +4 -4
  8. package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
  9. package/dist/{chunk-JKTPRYGV.js → chunk-4MFNGNHF.js} +123 -192
  10. package/dist/{chunk-HYLERWRO.js → chunk-4QK76KIF.js} +7 -7
  11. package/dist/chunk-5FJJ72HU.js +13 -0
  12. package/dist/chunk-5J4PDX26.js +112 -0
  13. package/dist/{chunk-4SY6BTVZ.js → chunk-6DWD423K.js} +12 -9
  14. package/dist/{chunk-3GV5NHSS.js → chunk-7KZINJLP.js} +78 -232
  15. package/dist/{chunk-6WXDE5LZ.js → chunk-EPTHX4VZ.js} +1 -1
  16. package/dist/{chunk-6EFVZV6X.js → chunk-GCOQ3TBG.js} +243 -254
  17. package/dist/{chunk-LRZFLK2F.js → chunk-IQHU7O5Y.js} +4 -4
  18. package/dist/{chunk-X2SUMO3P.js → chunk-IZWTVFJ2.js} +16 -3
  19. package/dist/{chunk-IKQ42WHU.js → chunk-JFL3GRD4.js} +1 -1
  20. package/dist/{chunk-4FZYEEPK.js → chunk-LLRXA7D7.js} +5 -6
  21. package/dist/chunk-MOY4VOHF.js +347 -0
  22. package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
  23. package/dist/{chunk-7E3FUTND.js → chunk-ND5TDV2J.js} +1 -1
  24. package/dist/{chunk-WF227UBV.js → chunk-QQHOKTJA.js} +4 -4
  25. package/dist/{chunk-A7B7HLDF.js → chunk-QTI3KC7D.js} +5884 -515
  26. package/dist/chunk-QXCDKE2O.js +486 -0
  27. package/dist/chunk-R2XR4FCV.js +48 -0
  28. package/dist/chunk-R66W5UDG.js +26 -0
  29. package/dist/{chunk-T5Z7G2J2.js → chunk-RQA2EVN3.js} +6 -16
  30. package/dist/{chunk-SKXXT3E2.js → chunk-RQTWIXJ5.js} +4 -4
  31. package/dist/chunk-T35FWDAB.js +4342 -0
  32. package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
  33. package/dist/{chunk-CN2HC4D4.js → chunk-UFTM5SZZ.js} +2 -2
  34. package/dist/{chunk-JCGD4GM6.js → chunk-UROTM5OR.js} +14 -1
  35. package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
  36. package/dist/{chunk-KVJ3LFH2.js → chunk-VNFR57DF.js} +4 -24
  37. package/dist/{chunk-SBCIB5TZ.js → chunk-VRNMNB3O.js} +6 -7
  38. package/dist/chunk-WQPX44YM.js +1626 -0
  39. package/dist/{chunk-T2PAD63Y.js → chunk-XZGSCABI.js} +1 -1
  40. package/dist/chunk-YLQEVSOR.js +299 -0
  41. package/dist/{chunk-P5WYW2GI.js → chunk-ZQOKIGZP.js} +152 -306
  42. package/dist/components/index.css +38 -0
  43. package/dist/components/index.d.ts +334 -38
  44. package/dist/components/index.js +42 -42
  45. package/dist/components/navigation/index.css +38 -0
  46. package/dist/components/navigation/index.js +3 -2
  47. package/dist/execution/index.d.ts +9 -3
  48. package/dist/features/auth/index.css +38 -0
  49. package/dist/features/auth/index.d.ts +212 -14
  50. package/dist/features/auth/index.js +41 -9
  51. package/dist/features/clients/index.css +649 -0
  52. package/dist/features/clients/index.d.ts +86 -0
  53. package/dist/features/clients/index.js +720 -0
  54. package/dist/features/crm/index.css +38 -0
  55. package/dist/features/crm/index.d.ts +228 -20
  56. package/dist/features/crm/index.js +20 -17
  57. package/dist/features/dashboard/index.css +38 -0
  58. package/dist/features/dashboard/index.d.ts +78 -3
  59. package/dist/features/dashboard/index.js +16 -16
  60. package/dist/features/delivery/index.css +38 -0
  61. package/dist/features/delivery/index.d.ts +201 -18
  62. package/dist/features/delivery/index.js +20 -18
  63. package/dist/features/knowledge/index.css +38 -0
  64. package/dist/features/knowledge/index.d.ts +20 -18
  65. package/dist/features/knowledge/index.js +116 -578
  66. package/dist/features/lead-gen/index.css +38 -0
  67. package/dist/features/lead-gen/index.d.ts +59 -51
  68. package/dist/features/lead-gen/index.js +20 -18
  69. package/dist/features/monitoring/index.css +38 -0
  70. package/dist/features/monitoring/index.d.ts +20 -18
  71. package/dist/features/monitoring/index.js +19 -18
  72. package/dist/features/monitoring/requests/index.css +38 -0
  73. package/dist/features/monitoring/requests/index.d.ts +21 -19
  74. package/dist/features/monitoring/requests/index.js +17 -15
  75. package/dist/features/operations/index.css +38 -0
  76. package/dist/features/operations/index.d.ts +945 -45
  77. package/dist/features/operations/index.js +24 -26
  78. package/dist/features/seo/index.d.ts +20 -18
  79. package/dist/features/seo/index.js +1 -1
  80. package/dist/features/settings/index.css +38 -0
  81. package/dist/features/settings/index.d.ts +201 -18
  82. package/dist/features/settings/index.js +18 -16
  83. package/dist/hooks/delivery/index.css +38 -0
  84. package/dist/hooks/delivery/index.d.ts +200 -0
  85. package/dist/hooks/delivery/index.js +2 -2
  86. package/dist/hooks/index.css +38 -0
  87. package/dist/hooks/index.d.ts +825 -47
  88. package/dist/hooks/index.js +14 -13
  89. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +194 -3
  90. package/dist/hooks/published.css +38 -0
  91. package/dist/hooks/published.d.ts +825 -47
  92. package/dist/hooks/published.js +14 -13
  93. package/dist/index.css +38 -0
  94. package/dist/index.d.ts +1506 -1212
  95. package/dist/index.js +15 -14
  96. package/dist/initialization/index.d.ts +181 -0
  97. package/dist/knowledge/index.d.ts +813 -1068
  98. package/dist/knowledge/index.js +7370 -2869
  99. package/dist/{chunk-CLUP5H3C.js → knowledge-search-index-5KYPO746.js} +441 -963
  100. package/dist/layout/index.d.ts +6 -0
  101. package/dist/layout/index.js +4 -5
  102. package/dist/organization/index.css +38 -0
  103. package/dist/profile/index.d.ts +181 -0
  104. package/dist/provider/index.css +38 -0
  105. package/dist/provider/index.d.ts +909 -1156
  106. package/dist/provider/index.js +11 -10
  107. package/dist/provider/published.css +38 -0
  108. package/dist/provider/published.d.ts +906 -1153
  109. package/dist/provider/published.js +7 -6
  110. package/dist/supabase/index.d.ts +349 -0
  111. package/dist/test-utils/index.d.ts +16 -9
  112. package/dist/test-utils/index.js +39 -32
  113. package/dist/test-utils/setup.js +1 -1
  114. package/dist/theme/index.js +3 -3
  115. package/dist/theme/presets/index.js +1 -1
  116. package/dist/types/index.d.ts +378 -5
  117. package/dist/utils/index.d.ts +78 -3
  118. package/dist/utils/index.js +1 -1
  119. package/dist/vite/index.js +2 -2
  120. package/dist/vite-plugin-knowledge/index.js +1 -1
  121. package/package.json +47 -37
  122. package/src/provider/README.md +5 -5
  123. package/dist/chunk-2DIYILF7.js +0 -413
  124. package/dist/chunk-3MDNBHVB.js +0 -3868
  125. package/dist/chunk-6IXOKUBC.js +0 -347
  126. package/dist/chunk-AKOD52HS.js +0 -739
  127. package/dist/chunk-ECNNI3NT.js +0 -6
  128. package/dist/chunk-JDNEWB5F.js +0 -10
  129. package/dist/chunk-NITGGYH2.js +0 -476
  130. package/dist/chunk-OAVTMITG.js +0 -13
@@ -1,10 +1,10 @@
1
- import { observabilityKeys } from './chunk-6YT4IKJ7.js';
2
- import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-T2PAD63Y.js';
1
+ import { observabilityKeys } from './chunk-VNAZTCHA.js';
2
+ import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-XZGSCABI.js';
3
3
  import { useSupabase } from './chunk-BRXELOHC.js';
4
- import { useNotificationAdapter, deriveActions } from './chunk-AKOD52HS.js';
5
- import { useOptionalElevasisFeatures } from './chunk-6IXOKUBC.js';
6
- import { HTTP_HEADERS } from './chunk-7E3FUTND.js';
7
- import { ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, UuidSchema, CredentialNameSchema, STALE_TIME_DEFAULT, REFETCH_INTERVAL_DASHBOARD, STALE_TIME_MONITORING, getTimeRangeDates, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_ADMIN, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-HXZQWMKE.js';
4
+ import { useNotificationAdapter, deriveActions } from './chunk-YLQEVSOR.js';
5
+ import { useOptionalElevasisSystems } from './chunk-QXCDKE2O.js';
6
+ import { HTTP_HEADERS } from './chunk-ND5TDV2J.js';
7
+ import { ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, UuidSchema, CredentialNameSchema, STALE_TIME_DEFAULT, REFETCH_INTERVAL_DASHBOARD, STALE_TIME_MONITORING, getTimeRangeDates, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_ADMIN, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-2RJMVWFJ.js';
8
8
  import { useStableAccessToken } from './chunk-VKIZUUPM.js';
9
9
  import { useInitialization } from './chunk-533DUEQY.js';
10
10
  import { useOrganization } from './chunk-DD3CCMCZ.js';
@@ -29,7 +29,8 @@ var PERMISSIONS = {
29
29
  OPERATIONS_READ: "operations.read",
30
30
  OPERATIONS_MANAGE: "operations.manage",
31
31
  ACQUISITION_MANAGE: "acquisition.manage",
32
- PROJECTS_MANAGE: "projects.manage"
32
+ PROJECTS_MANAGE: "projects.manage",
33
+ CLIENTS_MANAGE: "clients.manage"
33
34
  };
34
35
  var PERMISSION_CATALOG = [
35
36
  {
@@ -81,6 +82,11 @@ var PERMISSION_CATALOG = [
81
82
  key: "projects.manage",
82
83
  description: "Create, update, and delete project records (prj_projects, prj_milestones, prj_tasks, prj_notes)",
83
84
  isOrgGrantable: false
85
+ },
86
+ {
87
+ key: "clients.manage",
88
+ description: "Create, update, and delete client hub records (clients, clt_* satellites)",
89
+ isOrgGrantable: false
84
90
  }
85
91
  ];
86
92
  new Set(PERMISSION_CATALOG.map((p) => p.key));
@@ -2340,241 +2346,13 @@ function useResourceExecutions({
2340
2346
  staleTime: STALE_TIME_MONITORING
2341
2347
  });
2342
2348
  }
2343
-
2344
- // src/features/operations/organization-graph/commandViewVisualizationModes.ts
2345
- var COMMAND_VIEW_VISUALIZATION_MODES = [
2346
- { label: "Cluster", value: "cluster" },
2347
- { label: "Swimlane", value: "swimlane" },
2348
- { label: "Focus", value: "focus" },
2349
- { label: "Network", value: "network" }
2350
- ];
2351
- var DEFAULT_COMMAND_VIEW_VISUALIZATION_MODE = "network";
2352
- var DOMAIN_ORDER = [
2353
- "operations",
2354
- "runtime",
2355
- "business",
2356
- "delivery",
2357
- "admin",
2358
- "system",
2359
- "platform",
2360
- "other"
2361
- ];
2362
- var DOMAIN_KEYWORDS = {
2363
- operations: [
2364
- "operation",
2365
- "command",
2366
- "queue",
2367
- "scheduler",
2368
- "resource",
2369
- "agent",
2370
- "workflow",
2371
- "checkpoint",
2372
- "organization graph"
2373
- ],
2374
- runtime: ["execution", "runner", "log", "session", "deploy", "webhook", "api key", "credential", "activity"],
2375
- business: ["sales", "crm", "lead", "seo", "analytics", "cost", "account"],
2376
- delivery: ["project", "task", "submission", "request", "design"],
2377
- admin: ["admin", "user", "organization", "notification", "archive"],
2378
- system: ["setting", "appearance", "debug", "monitoring", "health"],
2379
- platform: ["surface", "capability", "entity", "feature"],
2380
- other: []
2381
- };
2382
- function spread(index, count, spacing) {
2383
- return (index - (count - 1) / 2) * spacing;
2384
- }
2385
- function getNodeSortValue(node) {
2386
- return `${node.kind}:${node.label}:${node.id}`;
2387
- }
2388
- function getNodeDomain(node) {
2389
- if (node.kind === "organization") {
2390
- return "platform";
2391
- }
2392
- if (node.kind !== "feature" && node.kind !== "resource") {
2393
- return "platform";
2394
- }
2395
- const searchable = `${node.id} ${node.sourceId ?? ""} ${node.featureId ?? ""} ${node.resourceType ?? ""} ${node.label}`.toLowerCase();
2396
- for (const domain of DOMAIN_ORDER) {
2397
- if (domain === "other") {
2398
- continue;
2399
- }
2400
- if (DOMAIN_KEYWORDS[domain].some((keyword) => searchable.includes(keyword))) {
2401
- return domain;
2402
- }
2403
- }
2404
- return "other";
2405
- }
2406
- function groupNodesByDomain(graph) {
2407
- const groups = /* @__PURE__ */ new Map();
2408
- for (const domain of DOMAIN_ORDER) {
2409
- groups.set(domain, []);
2410
- }
2411
- for (const node of graph.nodes) {
2412
- groups.get(getNodeDomain(node))?.push(node);
2413
- }
2414
- for (const nodes of groups.values()) {
2415
- nodes.sort((left, right) => getNodeSortValue(left).localeCompare(getNodeSortValue(right)));
2416
- }
2417
- return groups;
2418
- }
2419
- function getNodeDegree(graph, nodeId) {
2420
- return graph.edges.filter((edge) => edge.sourceId === nodeId || edge.targetId === nodeId).length;
2421
- }
2422
- function getNeighbors(graph, nodeId) {
2423
- const neighbors = /* @__PURE__ */ new Set();
2424
- for (const edge of graph.edges) {
2425
- if (edge.sourceId === nodeId) {
2426
- neighbors.add(edge.targetId);
2427
- } else if (edge.targetId === nodeId) {
2428
- neighbors.add(edge.sourceId);
2429
- }
2430
- }
2431
- return neighbors;
2432
- }
2433
- function getClusterGraphPositions(graph) {
2434
- const positions = /* @__PURE__ */ new Map();
2435
- const groups = groupNodesByDomain(graph);
2436
- const zoneConfig = {
2437
- operations: { x: -520, y: -270, columns: 3, xGap: 188, yGap: 86 },
2438
- runtime: { x: 130, y: -270, columns: 3, xGap: 188, yGap: 86 },
2439
- business: { x: -520, y: 95, columns: 3, xGap: 188, yGap: 86 },
2440
- delivery: { x: 130, y: 95, columns: 3, xGap: 188, yGap: 86 },
2441
- admin: { x: -520, y: 420, columns: 3, xGap: 188, yGap: 86 },
2442
- system: { x: 130, y: 420, columns: 3, xGap: 188, yGap: 86 },
2443
- platform: { x: 0, y: -520, columns: 4, xGap: 205, yGap: 90 },
2444
- other: { x: 0, y: 710, columns: 6, xGap: 176, yGap: 78 }
2445
- };
2446
- for (const domain of DOMAIN_ORDER) {
2447
- const nodes = groups.get(domain) ?? [];
2448
- const zone = zoneConfig[domain];
2449
- for (const [index, node] of nodes.entries()) {
2450
- const row = Math.floor(index / zone.columns);
2451
- const column = index % zone.columns;
2452
- const rowCount = Math.min(zone.columns, nodes.length - row * zone.columns);
2453
- positions.set(node.id, {
2454
- x: zone.x + spread(column, rowCount, zone.xGap),
2455
- y: zone.y + row * zone.yGap
2456
- });
2457
- }
2458
- }
2459
- return positions;
2460
- }
2461
- function getSwimlaneGraphPositions(graph) {
2462
- const positions = /* @__PURE__ */ new Map();
2463
- const groups = groupNodesByDomain(graph);
2464
- const laneY = {
2465
- platform: -360,
2466
- operations: -220,
2467
- runtime: -80,
2468
- business: 60,
2469
- delivery: 200,
2470
- admin: 340,
2471
- system: 480,
2472
- other: 620
2473
- };
2474
- for (const domain of DOMAIN_ORDER) {
2475
- const nodes = groups.get(domain) ?? [];
2476
- const columns = Math.min(8, Math.max(1, Math.ceil(Math.sqrt(nodes.length) * 1.6)));
2477
- for (const [index, node] of nodes.entries()) {
2478
- const column = index % columns;
2479
- const row = Math.floor(index / columns);
2480
- const rowCount = Math.min(columns, nodes.length - row * columns);
2481
- positions.set(node.id, {
2482
- x: spread(column, rowCount, 178),
2483
- y: laneY[domain] + row * 74
2484
- });
2485
- }
2486
- }
2487
- return positions;
2349
+ var NEW_SESSION_VISUALIZATION_MODE = "explore";
2350
+ var LEGACY_VISUALIZATION_MODES = /* @__PURE__ */ new Set(["overview", "cluster", "swimlane", "focus", "network", "force"]);
2351
+ function normalizePersistedVisualizationMode(value) {
2352
+ if (value === "explore") return "explore";
2353
+ if (LEGACY_VISUALIZATION_MODES.has(String(value))) return NEW_SESSION_VISUALIZATION_MODE;
2354
+ return NEW_SESSION_VISUALIZATION_MODE;
2488
2355
  }
2489
- function getFocusGraphPositions(graph, selectedNodeId) {
2490
- if (!selectedNodeId || !graph.nodes.some((node) => node.id === selectedNodeId)) {
2491
- return getNetworkGraphPositions(graph);
2492
- }
2493
- const positions = /* @__PURE__ */ new Map();
2494
- const firstDegree = getNeighbors(graph, selectedNodeId);
2495
- const secondDegree = /* @__PURE__ */ new Set();
2496
- for (const nodeId of firstDegree) {
2497
- for (const neighborId of getNeighbors(graph, nodeId)) {
2498
- if (neighborId !== selectedNodeId && !firstDegree.has(neighborId)) {
2499
- secondDegree.add(neighborId);
2500
- }
2501
- }
2502
- }
2503
- positions.set(selectedNodeId, { x: 0, y: 0 });
2504
- const placeRing = (ids, radiusX, radiusY, yOffset = 0) => {
2505
- ids.forEach((id, index) => {
2506
- const angle = -Math.PI / 2 + index / Math.max(1, ids.length) * Math.PI * 2;
2507
- positions.set(id, {
2508
- x: Math.cos(angle) * radiusX,
2509
- y: yOffset + Math.sin(angle) * radiusY
2510
- });
2511
- });
2512
- };
2513
- placeRing([...firstDegree].sort(), 390, 210);
2514
- placeRing([...secondDegree].sort(), 680, 360);
2515
- const remaining = graph.nodes.filter((node) => !positions.has(node.id)).sort((left, right) => left.label.localeCompare(right.label));
2516
- for (const [index, node] of remaining.entries()) {
2517
- const column = index % 8;
2518
- const row = Math.floor(index / 8);
2519
- positions.set(node.id, {
2520
- x: spread(column, Math.min(8, remaining.length - row * 8), 160),
2521
- y: 560 + row * 78
2522
- });
2523
- }
2524
- return positions;
2525
- }
2526
- function getNetworkGraphPositions(graph) {
2527
- const positions = /* @__PURE__ */ new Map();
2528
- const nodes = [...graph.nodes].sort((left, right) => {
2529
- const degreeDelta = getNodeDegree(graph, right.id) - getNodeDegree(graph, left.id);
2530
- return degreeDelta || left.label.localeCompare(right.label);
2531
- });
2532
- for (const [index, node] of nodes.entries()) {
2533
- if (index === 0) {
2534
- positions.set(node.id, { x: 0, y: 0 });
2535
- continue;
2536
- }
2537
- const radius = 150 + Math.sqrt(index) * 82;
2538
- const angle = index * 2.399963229728653;
2539
- positions.set(node.id, {
2540
- x: Math.cos(angle) * radius,
2541
- y: Math.sin(angle) * radius * 0.72
2542
- });
2543
- }
2544
- return positions;
2545
- }
2546
- function getSpatialGraphPositions(graph) {
2547
- const positions = getSwimlaneGraphPositions(graph);
2548
- for (const [nodeId, position] of positions.entries()) {
2549
- const degree = getNodeDegree(graph, nodeId);
2550
- positions.set(nodeId, {
2551
- x: position.x + degree * 12,
2552
- y: position.y - degree * 8
2553
- });
2554
- }
2555
- return positions;
2556
- }
2557
- function getCommandViewGraphPositions({
2558
- graph,
2559
- visualizationMode,
2560
- selectedNodeId
2561
- }) {
2562
- switch (visualizationMode) {
2563
- case "swimlane":
2564
- return getSwimlaneGraphPositions(graph);
2565
- case "focus":
2566
- return getFocusGraphPositions(graph, selectedNodeId);
2567
- case "network":
2568
- return getNetworkGraphPositions(graph);
2569
- case "spatial":
2570
- return getSpatialGraphPositions(graph);
2571
- case "cluster":
2572
- default:
2573
- return getClusterGraphPositions(graph);
2574
- }
2575
- }
2576
-
2577
- // src/hooks/operations/command-view/useCommandViewStore.ts
2578
2356
  var DEFAULT_DIAGNOSTIC_CATEGORIES = ["diagnostic", "testing"];
2579
2357
  var useCommandViewStore = create()(
2580
2358
  persist(
@@ -2585,8 +2363,12 @@ var useCommandViewStore = create()(
2585
2363
  setShowIntegrations: (showIntegrations) => set({ showIntegrations }),
2586
2364
  fitViewOnFilter: true,
2587
2365
  setFitViewOnFilter: (fitViewOnFilter) => set({ fitViewOnFilter }),
2588
- visualizationMode: DEFAULT_COMMAND_VIEW_VISUALIZATION_MODE,
2589
- setVisualizationMode: (visualizationMode) => set({ visualizationMode }),
2366
+ // New sessions default to 'explore'; returning sessions get their stored mode via persist.
2367
+ visualizationMode: NEW_SESSION_VISUALIZATION_MODE,
2368
+ setVisualizationMode: (visualizationMode) => set({ visualizationMode, lastUsedVisualizationMode: visualizationMode }),
2369
+ lastUsedVisualizationMode: null,
2370
+ lastOpenBottomTab: null,
2371
+ setLastOpenBottomTab: (lastOpenBottomTab) => set({ lastOpenBottomTab }),
2590
2372
  selectedNodeId: null,
2591
2373
  setSelectedNodeId: (selectedNodeId) => set({ selectedNodeId }),
2592
2374
  resourcesHidden: true,
@@ -2599,7 +2381,29 @@ var useCommandViewStore = create()(
2599
2381
  clearRevealedIds: () => set({ revealedIds: /* @__PURE__ */ new Set() }),
2600
2382
  hasVisibilityInteraction: false,
2601
2383
  markVisibilityInteraction: () => set({ hasVisibilityInteraction: true }),
2602
- resetVisibilityInteraction: () => set({ hasVisibilityInteraction: false })
2384
+ resetVisibilityInteraction: () => set({ hasVisibilityInteraction: false }),
2385
+ expandedClusterDomains: [],
2386
+ toggleClusterDomain: (domain) => set((s) => ({
2387
+ expandedClusterDomains: s.expandedClusterDomains.includes(domain) ? s.expandedClusterDomains.filter((d) => d !== domain) : [...s.expandedClusterDomains, domain]
2388
+ })),
2389
+ setExpandedClusterDomains: (expandedClusterDomains) => set({ expandedClusterDomains }),
2390
+ expandedNodeIdsArray: [],
2391
+ expandedNodeIds: /* @__PURE__ */ new Set(),
2392
+ toggleNodeExpansion: (nodeId) => set((s) => {
2393
+ const currentSet = s.expandedNodeIds;
2394
+ const isCurrentlyExpanded = currentSet.has(nodeId);
2395
+ if (isCurrentlyExpanded) {
2396
+ const next2 = new Set(currentSet);
2397
+ next2.delete(nodeId);
2398
+ const nextArray2 = [...next2];
2399
+ return { expandedNodeIdsArray: nextArray2, expandedNodeIds: next2 };
2400
+ }
2401
+ const next = new Set(currentSet);
2402
+ next.add(nodeId);
2403
+ const nextArray = [...next];
2404
+ return { expandedNodeIdsArray: nextArray, expandedNodeIds: next };
2405
+ }),
2406
+ clearExpandedNodes: () => set({ expandedNodeIdsArray: [], expandedNodeIds: /* @__PURE__ */ new Set() })
2603
2407
  }),
2604
2408
  {
2605
2409
  name: "command-view-store",
@@ -2607,9 +2411,25 @@ var useCommandViewStore = create()(
2607
2411
  showIntegrations: s.showIntegrations,
2608
2412
  fitViewOnFilter: s.fitViewOnFilter,
2609
2413
  visualizationMode: s.visualizationMode,
2414
+ lastUsedVisualizationMode: s.lastUsedVisualizationMode,
2610
2415
  resourcesHidden: s.resourcesHidden,
2611
- diagnosticsHidden: s.diagnosticsHidden
2612
- })
2416
+ diagnosticsHidden: s.diagnosticsHidden,
2417
+ lastOpenBottomTab: s.lastOpenBottomTab,
2418
+ expandedClusterDomains: s.expandedClusterDomains
2419
+ }),
2420
+ // Guard against stale localStorage with an invalid mode name (e.g. old 'overview' → 'explore' rename).
2421
+ merge: (persisted, current) => {
2422
+ const stored = persisted;
2423
+ const storedMode = stored.visualizationMode;
2424
+ const storedLastUsed = stored.lastUsedVisualizationMode;
2425
+ const { expandedZonesArray: _dropped, ...restStored } = stored;
2426
+ return {
2427
+ ...current,
2428
+ ...restStored,
2429
+ visualizationMode: normalizePersistedVisualizationMode(storedMode),
2430
+ lastUsedVisualizationMode: storedLastUsed === null || storedLastUsed === void 0 ? current.lastUsedVisualizationMode : normalizePersistedVisualizationMode(storedLastUsed)
2431
+ };
2432
+ }
2613
2433
  }
2614
2434
  )
2615
2435
  );
@@ -2978,6 +2798,65 @@ function useSortedData(data, defaultColumn, accessors, defaultDirection = "desc"
2978
2798
  const sorted = useMemo(() => sortData(data, sort, accessors), [data, sort, accessors]);
2979
2799
  return { sorted, sort, toggleSort };
2980
2800
  }
2801
+ function toDescriptor(resource) {
2802
+ return {
2803
+ id: resource.id,
2804
+ kind: resource.kind,
2805
+ systemPath: resource.systemPath,
2806
+ executable: resource.kind !== "integration"
2807
+ };
2808
+ }
2809
+ function buildResourceSetKey(directResources, descendantResources) {
2810
+ return [
2811
+ ...directResources.map((resource) => `d:${resource.kind}:${resource.id}:${resource.executable ? "x" : "p"}`),
2812
+ ...descendantResources.map((resource) => `c:${resource.kind}:${resource.id}:${resource.executable ? "x" : "p"}`)
2813
+ ].sort().join(",");
2814
+ }
2815
+ function useSystemHealth({
2816
+ systemPath,
2817
+ timeRange,
2818
+ includeDescendants = true,
2819
+ directResources,
2820
+ descendantResources
2821
+ }) {
2822
+ const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
2823
+ const { startDate, endDate } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
2824
+ const directDescriptors = useMemo(() => directResources.map(toDescriptor), [directResources]);
2825
+ const descendantDescriptors = useMemo(() => descendantResources.map(toDescriptor), [descendantResources]);
2826
+ const resourceSetKey = useMemo(
2827
+ () => buildResourceSetKey(directDescriptors, descendantDescriptors),
2828
+ [directDescriptors, descendantDescriptors]
2829
+ );
2830
+ return useQuery({
2831
+ queryKey: observabilityKeys.systemHealth(
2832
+ workOSOrganizationId,
2833
+ systemPath,
2834
+ timeRange,
2835
+ includeDescendants,
2836
+ includeDescendants ? "descendants" : "direct",
2837
+ resourceSetKey,
2838
+ startDate,
2839
+ endDate,
2840
+ directDescriptors,
2841
+ descendantDescriptors
2842
+ ),
2843
+ queryFn: async () => {
2844
+ return apiRequest("/observability/system-health", {
2845
+ method: "POST",
2846
+ body: JSON.stringify({
2847
+ systemPath,
2848
+ includeDescendants,
2849
+ startDate,
2850
+ endDate,
2851
+ directResources: directDescriptors,
2852
+ descendantResources: descendantDescriptors
2853
+ })
2854
+ });
2855
+ },
2856
+ enabled: isReady,
2857
+ staleTime: 3e4
2858
+ });
2859
+ }
2981
2860
  function useActivityTrend(params = {}) {
2982
2861
  const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
2983
2862
  return useQuery({
@@ -3611,7 +3490,7 @@ function createDisabledManager() {
3611
3490
  }
3612
3491
  function useExecutionSSE(resourceId, options = {}) {
3613
3492
  const queryClient = useQueryClient();
3614
- const features = useOptionalElevasisFeatures();
3493
+ const systems = useOptionalElevasisSystems();
3615
3494
  const { currentMembership } = useOrganization();
3616
3495
  const { isReady, workOSOrganizationId: serviceWorkOSOrganizationId } = useElevasisServices();
3617
3496
  const { enabled = true, apiUrl: apiUrlOverride, manager: managerOverride, listId, onEvent } = options;
@@ -3619,8 +3498,8 @@ function useExecutionSSE(resourceId, options = {}) {
3619
3498
  const [liveExecutions, setLiveExecutions] = useState(/* @__PURE__ */ new Set());
3620
3499
  const [streamingLogs, setStreamingLogs] = useState(/* @__PURE__ */ new Map());
3621
3500
  const disabledManager = useMemo(() => createDisabledManager(), []);
3622
- const apiUrl = apiUrlOverride ?? features?.operationsApiUrl;
3623
- const manager = managerOverride ?? features?.operationsSSEManager ?? disabledManager;
3501
+ const apiUrl = apiUrlOverride ?? systems?.operationsApiUrl;
3502
+ const manager = managerOverride ?? systems?.operationsSSEManager ?? disabledManager;
3624
3503
  const workOSOrganizationId = currentMembership?.organization?.workos_org_id ?? serviceWorkOSOrganizationId;
3625
3504
  const connectionKey = `execution-sse-${workOSOrganizationId ?? "unknown"}-${resourceId}`;
3626
3505
  const headers = useMemo(() => {
@@ -4479,6 +4358,116 @@ function useDeleteRequest() {
4479
4358
  }
4480
4359
  });
4481
4360
  }
4361
+
4362
+ // src/hooks/clients/queryKeys.ts
4363
+ var clientsKeys = {
4364
+ all: ["clients"],
4365
+ lists: () => [...clientsKeys.all, "list"],
4366
+ list: (organizationId, filters) => [...clientsKeys.lists(), organizationId, filters],
4367
+ statuses: () => [...clientsKeys.all, "status"],
4368
+ status: (organizationId) => [...clientsKeys.statuses(), organizationId],
4369
+ details: () => [...clientsKeys.all, "detail"],
4370
+ detail: (organizationId, id) => [...clientsKeys.details(), organizationId, id]
4371
+ };
4372
+ function useClients(filters = {}) {
4373
+ const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
4374
+ return useQuery({
4375
+ queryKey: clientsKeys.list(workOSOrganizationId ?? void 0, filters),
4376
+ queryFn: async () => {
4377
+ const { status, search, limit, offset } = filters;
4378
+ const params = new URLSearchParams();
4379
+ if (status) params.set("status", status);
4380
+ if (search) params.set("search", search);
4381
+ if (limit !== void 0) params.set("limit", String(limit));
4382
+ if (offset !== void 0) params.set("offset", String(offset));
4383
+ const query = params.toString();
4384
+ return apiRequest(`/clients${query ? "?" + query : ""}`);
4385
+ },
4386
+ enabled: isReady
4387
+ });
4388
+ }
4389
+ function useClientStatus() {
4390
+ const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
4391
+ return useQuery({
4392
+ queryKey: clientsKeys.status(workOSOrganizationId ?? void 0),
4393
+ queryFn: async () => {
4394
+ return apiRequest("/clients/status");
4395
+ },
4396
+ enabled: isReady
4397
+ });
4398
+ }
4399
+ function useClient(clientId) {
4400
+ const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
4401
+ return useQuery({
4402
+ queryKey: clientsKeys.detail(workOSOrganizationId ?? void 0, clientId),
4403
+ queryFn: async () => {
4404
+ return apiRequest(`/clients/${clientId}`);
4405
+ },
4406
+ enabled: isReady && !!clientId
4407
+ });
4408
+ }
4409
+ function useCreateClient() {
4410
+ const { apiRequest } = useElevasisServices();
4411
+ const queryClient = useQueryClient();
4412
+ return useMutation({
4413
+ mutationFn: async (data) => {
4414
+ return apiRequest("/clients", {
4415
+ method: "POST",
4416
+ body: JSON.stringify(data)
4417
+ });
4418
+ },
4419
+ onSuccess: () => {
4420
+ void queryClient.invalidateQueries({ queryKey: clientsKeys.lists() });
4421
+ void queryClient.invalidateQueries({ queryKey: clientsKeys.statuses() });
4422
+ },
4423
+ onError: (error) => {
4424
+ console.error("Failed to create client:", error);
4425
+ showApiErrorNotification(error);
4426
+ }
4427
+ });
4428
+ }
4429
+ function useUpdateClient() {
4430
+ const { apiRequest, workOSOrganizationId } = useElevasisServices();
4431
+ const queryClient = useQueryClient();
4432
+ return useMutation({
4433
+ mutationFn: async ({ clientId, updates }) => {
4434
+ return apiRequest(`/clients/${clientId}`, {
4435
+ method: "PATCH",
4436
+ body: JSON.stringify(updates)
4437
+ });
4438
+ },
4439
+ onSuccess: (_data, { clientId }) => {
4440
+ void queryClient.invalidateQueries({ queryKey: clientsKeys.lists() });
4441
+ void queryClient.invalidateQueries({
4442
+ queryKey: clientsKeys.detail(workOSOrganizationId ?? void 0, clientId)
4443
+ });
4444
+ void queryClient.invalidateQueries({ queryKey: clientsKeys.statuses() });
4445
+ },
4446
+ onError: (error) => {
4447
+ console.error("Failed to update client:", error);
4448
+ showApiErrorNotification(error);
4449
+ }
4450
+ });
4451
+ }
4452
+ function useDeleteClient() {
4453
+ const { apiRequest } = useElevasisServices();
4454
+ const queryClient = useQueryClient();
4455
+ return useMutation({
4456
+ mutationFn: async (clientId) => {
4457
+ await apiRequest(`/clients/${clientId}`, {
4458
+ method: "DELETE"
4459
+ });
4460
+ },
4461
+ onSuccess: () => {
4462
+ void queryClient.invalidateQueries({ queryKey: clientsKeys.lists() });
4463
+ void queryClient.invalidateQueries({ queryKey: clientsKeys.statuses() });
4464
+ },
4465
+ onError: (error) => {
4466
+ console.error("Failed to delete client:", error);
4467
+ showApiErrorNotification(error);
4468
+ }
4469
+ });
4470
+ }
4482
4471
  function useResourceErrors({ resourceId, timeRange, hasFailures }) {
4483
4472
  const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
4484
4473
  return useQuery({
@@ -5149,11 +5138,11 @@ var noopSSEManager = {
5149
5138
  };
5150
5139
  function useProjectRealtime(projectId) {
5151
5140
  const queryClient = useQueryClient();
5152
- const features = useOptionalElevasisFeatures();
5141
+ const systems = useOptionalElevasisSystems();
5153
5142
  const { isReady, workOSOrganizationId } = useElevasisServices();
5154
5143
  const { currentMembership } = useOrganization();
5155
- const deliveryApiUrl = features?.deliveryApiUrl;
5156
- const deliverySSEManager = features?.deliverySSEManager ?? noopSSEManager;
5144
+ const deliveryApiUrl = systems?.deliveryApiUrl;
5145
+ const deliverySSEManager = systems?.deliverySSEManager ?? noopSSEManager;
5157
5146
  const currentWorkOSOrganizationId = currentMembership?.organization?.workos_org_id;
5158
5147
  const headers = useMemo(() => {
5159
5148
  if (!currentWorkOSOrganizationId) {
@@ -5199,11 +5188,11 @@ function useProjectRealtime(projectId) {
5199
5188
  manager: deliverySSEManager,
5200
5189
  connectionKey: `delivery-${currentWorkOSOrganizationId ?? workOSOrganizationId ?? projectId ?? "unknown"}`,
5201
5190
  url: deliveryApiUrl ? `${deliveryApiUrl}/api/projects/sse` : "",
5202
- enabled: Boolean(deliveryApiUrl && features?.deliverySSEManager && currentWorkOSOrganizationId && isReady),
5191
+ enabled: Boolean(deliveryApiUrl && systems?.deliverySSEManager && currentWorkOSOrganizationId && isReady),
5203
5192
  headers,
5204
5193
  onmessage: handleMessage,
5205
5194
  onopen: (response) => response.status === 403 ? "Organization access denied" : void 0
5206
5195
  });
5207
5196
  }
5208
5197
 
5209
- export { ApiKeyService, COMMAND_VIEW_VISUALIZATION_MODES, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getCommandViewGraphPositions, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useAddCompaniesToList, useAddContactsToList, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutionSSE, useExecutions, useGetExecutionHistory, useGetSchedule, useHasPermission, useInFlightExecutions, useList, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListRecords, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useOrgRoles, useOrganizationMembers, useOrganizationPermissions, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRemoveCompaniesFromList, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useTransitionState, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateMemberConfig, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVerifyCredential, useVisibleResources, useWarningNotification, useWorkflowExecution };
5198
+ export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, clientsKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useAddCompaniesToList, useAddContactsToList, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useClient, useClientStatus, useClients, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateClient, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteClient, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutionSSE, useExecutions, useGetExecutionHistory, useGetSchedule, useHasPermission, useInFlightExecutions, useList, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListRecords, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useOrgRoles, useOrganizationMembers, useOrganizationPermissions, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRemoveCompaniesFromList, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useSystemHealth, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useTransitionState, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateClient, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateMemberConfig, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVerifyCredential, useVisibleResources, useWarningNotification, useWorkflowExecution };
@@ -1,7 +1,7 @@
1
- import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-CW3UNAF2.js';
2
- import { useResourcesHealth } from './chunk-6EFVZV6X.js';
3
- import { CardHeader, EmptyState } from './chunk-6WXDE5LZ.js';
4
- import { getTimeRangeDates, formatBucketTime } from './chunk-HXZQWMKE.js';
1
+ import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-4DYOXEH6.js';
2
+ import { useResourcesHealth } from './chunk-GCOQ3TBG.js';
3
+ import { CardHeader, EmptyState } from './chunk-EPTHX4VZ.js';
4
+ import { getTimeRangeDates, formatBucketTime } from './chunk-2RJMVWFJ.js';
5
5
  import { Paper, Center, Loader, Group } from '@mantine/core';
6
6
  import { IconActivity, IconChartBar } from '@tabler/icons-react';
7
7
  import { useMemo } from 'react';
@@ -378,10 +378,18 @@ var isPathActive = (linkPath, currentPath) => {
378
378
  var isOverviewLink = (label, link) => {
379
379
  return label === "Overview" && (link === "/admin" || link === "/operations" || link === "/monitoring" || link === "/settings" || link === "/execution-engine" || link === "/acquisition");
380
380
  };
381
+ var isLinkItemActive = (linkItem, currentPath) => {
382
+ const isKnowledgeBaseActive = linkItem.link === "/knowledge" && currentPath.startsWith("/knowledge") && !currentPath.startsWith("/knowledge/command-view");
383
+ const matchesExtraPath = linkItem.activeMatchPaths?.some((path) => isPathActive(path, currentPath)) ?? false;
384
+ if (isKnowledgeBaseActive) return true;
385
+ if (linkItem.exact || isOverviewLink(linkItem.label, linkItem.link)) {
386
+ return currentPath === linkItem.link || matchesExtraPath;
387
+ }
388
+ return isPathActive(linkItem.link, currentPath) || matchesExtraPath;
389
+ };
381
390
  var SubLinkItem = ({ linkItem, currentPath }) => {
382
391
  const { Link } = useRouterContext();
383
- const isKnowledgeBaseActive = linkItem.link === "/knowledge" && currentPath.startsWith("/knowledge") && !currentPath.startsWith("/knowledge/command-view");
384
- const isActive = isKnowledgeBaseActive ? true : linkItem.exact || isOverviewLink(linkItem.label, linkItem.link) ? currentPath === linkItem.link : isPathActive(linkItem.link, currentPath);
392
+ const isActive = isLinkItemActive(linkItem, currentPath);
385
393
  const activeColor2 = "var(--color-primary)";
386
394
  const activeColorBg = "color-mix(in srgb, var(--color-primary) 10%, transparent)";
387
395
  const defaultColor = "var(--color-text-subtle)";
@@ -564,10 +572,15 @@ var LinksGroup = memo(function LinksGroup2({
564
572
  onToggle();
565
573
  }
566
574
  }, [isCollapsed, opened, onToggle]);
567
- const hasActiveChild = hasLinks && links.some((item) => isPathActive(item.link, currentPath));
575
+ const hasActiveChild = hasLinks && links.some((item) => isLinkItemActive(item, currentPath));
568
576
  const isParentActive = !hasLinks && (link === "/" ? currentPath === "/" : isPathActive(link || "", currentPath));
569
577
  const isIconTextActive = isParentActive || hasActiveChild;
570
578
  const isBackgroundActive = isParentActive || hasActiveChild && !opened;
579
+ useEffect(() => {
580
+ if (!isCollapsed && hasActiveChild && !opened && onToggle) {
581
+ onToggle();
582
+ }
583
+ }, [hasActiveChild, isCollapsed, opened, onToggle]);
571
584
  const handleMainClick = () => {
572
585
  if (hasLinks && !isCollapsed) {
573
586
  onToggle?.();
@@ -1,4 +1,4 @@
1
- import { usePresetsContext } from './chunk-T5Z7G2J2.js';
1
+ import { usePresetsContext } from './chunk-RQA2EVN3.js';
2
2
  import { useMemo } from 'react';
3
3
 
4
4
  var BUILT_IN_NAMES = /* @__PURE__ */ new Set([