@elevasis/ui 2.32.0 → 2.33.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 (82) hide show
  1. package/dist/app/index.js +3 -3
  2. package/dist/{chunk-GCOQ3TBG.js → chunk-2GMF5IRF.js} +2 -2
  3. package/dist/{chunk-4MFNGNHF.js → chunk-52NLZN6Z.js} +2 -2
  4. package/dist/{chunk-5FJJ72HU.js → chunk-AHCKOU2M.js} +1 -1
  5. package/dist/chunk-CLDCYJQT.js +1 -0
  6. package/dist/chunk-DWXDNT7P.js +145 -0
  7. package/dist/{chunk-5J4PDX26.js → chunk-E4T2N7P7.js} +14 -2
  8. package/dist/{chunk-RQTWIXJ5.js → chunk-E7C4XEWH.js} +1 -1
  9. package/dist/{chunk-6DWD423K.js → chunk-FFPHJBJC.js} +1 -1
  10. package/dist/{chunk-T35FWDAB.js → chunk-GNRMB6DC.js} +940 -156
  11. package/dist/{chunk-LLRXA7D7.js → chunk-IUKFNASA.js} +1 -1
  12. package/dist/{chunk-QTI3KC7D.js → chunk-JHT5JIJ3.js} +106 -43
  13. package/dist/{chunk-IQHU7O5Y.js → chunk-MHLZ4F4N.js} +1 -1
  14. package/dist/{chunk-VRNMNB3O.js → chunk-NOIRGGW2.js} +1 -1
  15. package/dist/{chunk-MOY4VOHF.js → chunk-QNOVUCSV.js} +1 -1
  16. package/dist/{chunk-4QK76KIF.js → chunk-TKF5S4XP.js} +1 -1
  17. package/dist/{chunk-ZQOKIGZP.js → chunk-UVFOURXR.js} +4 -4
  18. package/dist/{chunk-YLQEVSOR.js → chunk-UW7IV2Y3.js} +202 -54
  19. package/dist/{chunk-IZWTVFJ2.js → chunk-V6SZ4ECN.js} +6 -3
  20. package/dist/{chunk-QQHOKTJA.js → chunk-XG57WXOL.js} +39 -2
  21. package/dist/{chunk-7KZINJLP.js → chunk-XOFSMJLF.js} +4 -4
  22. package/dist/{chunk-WQPX44YM.js → chunk-YAQ25UNM.js} +668 -168
  23. package/dist/{chunk-QXCDKE2O.js → chunk-ZGTDKH3P.js} +9 -28
  24. package/dist/components/index.d.ts +111 -2
  25. package/dist/components/index.js +24 -23
  26. package/dist/components/navigation/index.js +4 -3
  27. package/dist/execution/index.d.ts +5 -1
  28. package/dist/features/clients/index.js +8 -7
  29. package/dist/features/crm/index.js +10 -9
  30. package/dist/features/dashboard/index.d.ts +110 -1
  31. package/dist/features/dashboard/index.js +9 -8
  32. package/dist/features/delivery/index.js +9 -8
  33. package/dist/features/knowledge/index.js +8 -18
  34. package/dist/features/lead-gen/index.js +10 -9
  35. package/dist/features/monitoring/index.js +10 -9
  36. package/dist/features/monitoring/requests/index.d.ts +2 -2
  37. package/dist/features/monitoring/requests/index.js +8 -7
  38. package/dist/features/operations/index.d.ts +442 -73
  39. package/dist/features/operations/index.js +13 -12
  40. package/dist/features/settings/index.js +9 -8
  41. package/dist/hooks/index.d.ts +192 -3
  42. package/dist/hooks/index.js +8 -7
  43. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +190 -1
  44. package/dist/hooks/published.d.ts +192 -3
  45. package/dist/hooks/published.js +8 -7
  46. package/dist/index.d.ts +444 -75
  47. package/dist/index.js +8 -7
  48. package/dist/knowledge/index.d.ts +490 -214
  49. package/dist/knowledge/index.js +1179 -687
  50. package/dist/knowledge-search-index-P7PR626V.js +1514 -0
  51. package/dist/layout/index.js +1 -1
  52. package/dist/provider/index.d.ts +357 -72
  53. package/dist/provider/index.js +7 -6
  54. package/dist/provider/published.d.ts +357 -72
  55. package/dist/provider/published.js +5 -4
  56. package/dist/types/index.d.ts +190 -1
  57. package/dist/utils/index.d.ts +110 -1
  58. package/package.json +39 -39
  59. package/src/README.md +29 -29
  60. package/src/api/README.md +18 -18
  61. package/src/app/README.md +24 -24
  62. package/src/auth/README.md +18 -18
  63. package/src/components/README.md +24 -24
  64. package/src/execution/README.md +16 -16
  65. package/src/features/README.md +28 -28
  66. package/src/graph/README.md +16 -16
  67. package/src/hooks/README.md +23 -23
  68. package/src/initialization/README.md +19 -19
  69. package/src/knowledge/README.md +31 -31
  70. package/src/organization/README.md +18 -18
  71. package/src/profile/README.md +19 -19
  72. package/src/provider/README.md +32 -32
  73. package/src/router/README.md +18 -18
  74. package/src/sse/README.md +13 -13
  75. package/src/test-utils/README.md +7 -7
  76. package/src/theme/README.md +23 -23
  77. package/src/theme/presets/README.md +19 -19
  78. package/src/types/README.md +16 -16
  79. package/src/utils/README.md +18 -18
  80. package/src/zustand/README.md +18 -18
  81. package/dist/chunk-UROTM5OR.js +0 -172
  82. package/dist/knowledge-search-index-5KYPO746.js +0 -1479
@@ -4,7 +4,7 @@ import { useCyberColors, HeroStatsRow } from './chunk-4DYOXEH6.js';
4
4
  import { AppShellCenteredContainer, AppShellLoader } from './chunk-RYTEQBAO.js';
5
5
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, useFitViewTrigger } from './chunk-22UVE3RA.js';
6
6
  import { STATUS_COLORS, getStatusIcon, formatDuration, getStatusColors, AGENT_CONSTANTS, shouldAnimateEdge, TIMELINE_CONSTANTS, calculateBarPosition, CONTAINER_CONSTANTS, useExecutionPath, useUnifiedWorkflowLayout, WORKFLOW_CONSTANTS, useReactFlowAgent } from './chunk-E4WQGJNS.js';
7
- import { useExecuteResource, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, useCommandQueue, useScheduledTasks, useResourcesHealth } from './chunk-GCOQ3TBG.js';
7
+ import { useExecuteResource, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, useCommandQueue, useScheduledTasks, useResourcesHealth } from './chunk-2GMF5IRF.js';
8
8
  import { glassBase } from './chunk-RQA2EVN3.js';
9
9
  import { GlowDot, CardHeader, EmptyState, PageTitleCaption, TabCountBadge } from './chunk-EPTHX4VZ.js';
10
10
  import { formatTimeAgo, getTimeRangeDates, formatRelativeTime } from './chunk-2RJMVWFJ.js';
@@ -1,10 +1,9 @@
1
1
  import { ChatHeader, ChatSidebar } from './chunk-CXY7FMUM.js';
2
- import { DEFAULT_ORGANIZATION_GRAPH_FILTERS, ORGANIZATION_GRAPH_NODE_KIND_ORDER, ORGANIZATION_GRAPH_NODE_KIND_LABELS, ORGANIZATION_GRAPH_EDGE_KIND_LABELS, ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS, ORGANIZATION_GRAPH_NODE_KIND_MEANINGS, ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS } from './chunk-5J4PDX26.js';
2
+ import { DEFAULT_ORGANIZATION_GRAPH_FILTERS, ORGANIZATION_GRAPH_NODE_KIND_ORDER, ORGANIZATION_GRAPH_NODE_KIND_LABELS, ORGANIZATION_GRAPH_EDGE_KIND_LABELS, ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS, ORGANIZATION_GRAPH_NODE_KIND_MEANINGS, ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS } from './chunk-E4T2N7P7.js';
3
3
  import { SubshellSidebarLoader, SubshellLoader } from './chunk-N55DVMAG.js';
4
- import { resolveSemanticIconComponent, SemanticIcon } from './chunk-UROTM5OR.js';
5
- import { BaseNode, useGraphTheme, BaseEdge, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-LLRXA7D7.js';
4
+ import { BaseNode, useGraphTheme, BaseEdge, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-IUKFNASA.js';
6
5
  import { FormFieldRenderer } from './chunk-3MEXPLWT.js';
7
- import { ResourceHealthPanel } from './chunk-IQHU7O5Y.js';
6
+ import { ResourceHealthPanel } from './chunk-MHLZ4F4N.js';
8
7
  import { useCyberColors, CyberDonut } from './chunk-4DYOXEH6.js';
9
8
  import { ConfirmationModal } from './chunk-VNFR57DF.js';
10
9
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
@@ -13,14 +12,15 @@ import { PageContainer } from './chunk-BZZCNLT6.js';
13
12
  import { CustomModal } from './chunk-R66W5UDG.js';
14
13
  import { useGraphHighlighting, calculateGraphHeight, Graph_module_css_default, GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
15
14
  import { getResourceStatusColor, useTimelineData, useAgentIterationData, getStatusIcon } from './chunk-E4WQGJNS.js';
16
- import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, useSystemHealth } from './chunk-GCOQ3TBG.js';
15
+ import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, useSystemHealth } from './chunk-2GMF5IRF.js';
17
16
  import { showApiErrorNotification, showSuccessNotification } from './chunk-XZGSCABI.js';
18
17
  import { useMergedExecution } from './chunk-3ZMAGTWF.js';
19
18
  import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-EPTHX4VZ.js';
20
19
  import { StyledMarkdown } from './chunk-3KMDHCAR.js';
21
- import { useOptionalElevasisSystems, useElevasisSystems } from './chunk-QXCDKE2O.js';
20
+ import { useOptionalElevasisSystems, useElevasisSystems } from './chunk-ZGTDKH3P.js';
22
21
  import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
23
- import { buildOrganizationGraph, getResourcesForSystem, resolveOrganizationModel, listAllSystems, getSystem, getSystemAncestors } from './chunk-T35FWDAB.js';
22
+ import { resolveSemanticIconComponent, SemanticIcon } from './chunk-DWXDNT7P.js';
23
+ import { buildOrganizationGraph, getResourcesForSystem, resolveOrganizationModel, listAllSystems, getSystem, compileOrganizationOntology, getSystemAncestors } from './chunk-GNRMB6DC.js';
24
24
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
25
25
  import { useAppearance } from './chunk-E565XMTQ.js';
26
26
  import { topbarHeight } from './chunk-DT3QYZVU.js';
@@ -59,21 +59,21 @@ var iconMap = {
59
59
  IconMail
60
60
  };
61
61
  var semanticActionIconMap = {
62
- "action.approve": IconCheck,
63
- "action.reject": IconX,
64
- "action.retry": IconRefresh,
65
- "action.escalate": IconAlertTriangle,
66
- "action.edit": IconEdit,
67
- "action.view": IconEye,
68
- "action.launch": IconRocket,
69
- "action.message": IconMessageCircle,
70
- "action.promote": IconArrowUp,
71
- "action.submit": IconSend,
72
- "action.email": IconMail,
73
- "status.pending": IconClock,
74
- "status.success": IconCheck,
75
- "status.error": IconX,
76
- "status.warning": IconAlertTriangle
62
+ approve: IconCheck,
63
+ reject: IconX,
64
+ retry: IconRefresh,
65
+ escalate: IconAlertTriangle,
66
+ edit: IconEdit,
67
+ view: IconEye,
68
+ launch: IconRocket,
69
+ message: IconMessageCircle,
70
+ promote: IconArrowUp,
71
+ submit: IconSend,
72
+ email: IconMail,
73
+ pending: IconClock,
74
+ success: IconCheck,
75
+ error: IconX,
76
+ warning: IconAlertTriangle
77
77
  };
78
78
  function getIcon(iconName) {
79
79
  if (!iconName) return null;
@@ -4160,13 +4160,29 @@ function getNodeKindLabel2(kind) {
4160
4160
  return kind;
4161
4161
  }
4162
4162
  }
4163
- function getNodeIconFallbackKind(kind) {
4164
- if (kind === "knowledge") return "knowledge";
4165
- if (kind === "resource") return "resource";
4166
- if (kind === "entity") return "entity";
4167
- if (kind === "event") return "event";
4168
- if (kind === "policy") return "policy";
4169
- return "unknown";
4163
+ function getNodeIconToken(kind) {
4164
+ switch (kind) {
4165
+ case "knowledge":
4166
+ return "knowledge";
4167
+ case "resource":
4168
+ return "resources";
4169
+ case "entity":
4170
+ return "database";
4171
+ case "event":
4172
+ return "bolt";
4173
+ case "policy":
4174
+ return "shield";
4175
+ case "system":
4176
+ return "apps";
4177
+ case "role":
4178
+ return "users";
4179
+ case "action":
4180
+ return "approve";
4181
+ case "stage":
4182
+ return "pipeline";
4183
+ default:
4184
+ return "info";
4185
+ }
4170
4186
  }
4171
4187
  function titleCase2(value) {
4172
4188
  return value.charAt(0).toUpperCase() + value.slice(1);
@@ -4304,14 +4320,7 @@ function OrganizationGraphDetailPanel({
4304
4320
  /* @__PURE__ */ jsx(
4305
4321
  CardHeader,
4306
4322
  {
4307
- icon: state.state === "node" ? /* @__PURE__ */ jsx(
4308
- SemanticIcon,
4309
- {
4310
- token: state.node.icon,
4311
- fallbackKind: getNodeIconFallbackKind(state.node.kind),
4312
- size: 16
4313
- }
4314
- ) : void 0,
4323
+ icon: state.state === "node" ? /* @__PURE__ */ jsx(SemanticIcon, { token: state.node.icon ?? getNodeIconToken(state.node.kind), size: 16 }) : void 0,
4315
4324
  title: state.title,
4316
4325
  subtitle: state.operationalMeaning,
4317
4326
  titleOrder: 4,
@@ -6070,7 +6079,8 @@ var NODE_KIND_ORDER = {
6070
6079
  goal: 12,
6071
6080
  surface: 13,
6072
6081
  "navigation-group": 14,
6073
- "content-node": 15
6082
+ ontology: 15,
6083
+ "content-node": 16
6074
6084
  };
6075
6085
  function getNodeLabel(node) {
6076
6086
  return node.label || node.sourceId || node.id;
@@ -7488,6 +7498,7 @@ function getNodeThemeByKind(tokens) {
7488
7498
  goal: mixColors(tokens.primary, tokens.error, 0.5),
7489
7499
  surface: mixColors(tokens.primary, tokens.success, 0.55),
7490
7500
  "navigation-group": mixColors(tokens.primary, tokens.text, 0.45),
7501
+ ontology: mixColors(tokens.primary, tokens.warning, 0.44),
7491
7502
  "content-node": mixColors(tokens.primary, tokens.success, 0.3)
7492
7503
  };
7493
7504
  return Object.fromEntries(
@@ -7517,9 +7528,13 @@ function getEdgeColor(edge, tokens) {
7517
7528
  return mixColors(tokens.primary, tokens.text, 0.45);
7518
7529
  case "maps_to":
7519
7530
  case "originates_from":
7531
+ case "implements":
7520
7532
  return mixColors(tokens.primary, tokens.warning, 0.4);
7521
7533
  case "uses":
7522
7534
  case "links":
7535
+ case "reads":
7536
+ case "writes":
7537
+ case "uses_catalog":
7523
7538
  return mixColors(tokens.success, tokens.primary, 0.44);
7524
7539
  case "affects":
7525
7540
  case "effects":
@@ -11665,6 +11680,30 @@ var RESOURCE_KIND_ICONS = {
11665
11680
  integration: IconPlugConnected,
11666
11681
  script: IconScript
11667
11682
  };
11683
+ function childSystemsOf(system) {
11684
+ return system?.systems ?? system?.subsystems ?? {};
11685
+ }
11686
+ function ontologyCounts(model) {
11687
+ const compiled = compileOrganizationOntology(model);
11688
+ return {
11689
+ objects: Object.keys(compiled.ontology.objectTypes).length,
11690
+ actions: Object.keys(compiled.ontology.actionTypes).length,
11691
+ catalogs: Object.keys(compiled.ontology.catalogTypes).length,
11692
+ surfaces: Object.keys(compiled.ontology.surfaces).length,
11693
+ diagnostics: compiled.diagnostics.length
11694
+ };
11695
+ }
11696
+ function ontologyCountsForSystem(model, systemPath) {
11697
+ const compiled = compileOrganizationOntology(model);
11698
+ const belongsToSystem = (ownerSystemId) => systemPath === "" || ownerSystemId === systemPath || ownerSystemId?.startsWith(`${systemPath}.`);
11699
+ return {
11700
+ objects: Object.values(compiled.ontology.objectTypes).filter((record) => belongsToSystem(record.ownerSystemId)).length,
11701
+ actions: Object.values(compiled.ontology.actionTypes).filter((record) => belongsToSystem(record.ownerSystemId)).length,
11702
+ catalogs: Object.values(compiled.ontology.catalogTypes).filter((record) => belongsToSystem(record.ownerSystemId)).length,
11703
+ surfaces: Object.values(compiled.ontology.surfaces).filter((record) => belongsToSystem(record.ownerSystemId)).length,
11704
+ diagnostics: compiled.diagnostics.length
11705
+ };
11706
+ }
11668
11707
  function buildBreadcrumbs(model, systemPath) {
11669
11708
  const items = [{ label: "Systems", path: "" }];
11670
11709
  if (!systemPath) return items;
@@ -11691,7 +11730,7 @@ function commandViewPathForSystem(systemPath) {
11691
11730
  return `/knowledge/command-view${suffix}`;
11692
11731
  }
11693
11732
  function childEntries(systemPath, system, model) {
11694
- const systems = systemPath ? system?.subsystems ?? {} : model.systems;
11733
+ const systems = systemPath ? childSystemsOf(system) : model.systems;
11695
11734
  return Object.entries(systems).map(([localId, child]) => {
11696
11735
  const path = systemPath ? `${systemPath}.${localId}` : localId;
11697
11736
  return {
@@ -11767,7 +11806,7 @@ function SystemSummaryPaper({
11767
11806
  rollupMode,
11768
11807
  onNavigate
11769
11808
  }) {
11770
- const childCount = Object.keys(entry.system.subsystems ?? {}).length;
11809
+ const childCount = Object.keys(childSystemsOf(entry.system)).length;
11771
11810
  return /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
11772
11811
  /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", children: [
11773
11812
  /* @__PURE__ */ jsxs(Stack, { gap: 3, style: { minWidth: 0 }, children: [
@@ -11867,6 +11906,7 @@ function SystemsIndex({ model, onNavigate }) {
11867
11906
  (entry) => matchesFilters(entry, searchQuery, statusFilter, resourceKinds, rollupMode)
11868
11907
  );
11869
11908
  const rootMetrics = aggregateSystemMetrics(model, "");
11909
+ const rootOntologyCounts = ontologyCounts(model);
11870
11910
  return /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
11871
11911
  /* @__PURE__ */ jsx(PageTitleCaption, { title: "Systems", caption: "Semantic operating systems and resource rollups from the organization model." }),
11872
11912
  /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
@@ -11880,11 +11920,18 @@ function SystemsIndex({ model, onNavigate }) {
11880
11920
  /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 2, md: 4 }, spacing: "xs", children: [
11881
11921
  /* @__PURE__ */ jsx(MetricCard2, { label: "Systems", value: listAllSystems(model).length, detail: "semantic nodes" }),
11882
11922
  /* @__PURE__ */ jsx(MetricCard2, { label: "Resources", value: rootMetrics.resourceCount, detail: "all resource descriptors" }),
11883
- /* @__PURE__ */ jsx(MetricCard2, { label: "Health", value: "--", detail: "System endpoint pending" }),
11884
- /* @__PURE__ */ jsx(MetricCard2, { label: "Rollup", value: rollupMode === "descendants" ? "All" : "Direct", detail: "sidebar controlled" })
11923
+ /* @__PURE__ */ jsx(
11924
+ MetricCard2,
11925
+ {
11926
+ label: "Ontology",
11927
+ value: rootOntologyCounts.objects + rootOntologyCounts.actions + rootOntologyCounts.catalogs,
11928
+ detail: `${rootOntologyCounts.objects} objects / ${rootOntologyCounts.actions} actions / ${rootOntologyCounts.catalogs} catalogs`
11929
+ }
11930
+ ),
11931
+ /* @__PURE__ */ jsx(MetricCard2, { label: "Health", value: "--", detail: "System endpoint pending" })
11885
11932
  ] })
11886
11933
  ] }) }),
11887
- entries.length > 0 ? /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 1, lg: 2 }, spacing: "md", children: entries.map((entry) => /* @__PURE__ */ jsx(SystemSummaryPaper, { entry, rollupMode, onNavigate }, entry.path)) }) : /* @__PURE__ */ jsx(EmptyState, { icon: IconFolder, title: "No systems match", description: "Adjust search, status, resource type, or rollup filters." })
11934
+ entries.length > 0 ? /* @__PURE__ */ jsx(SimpleGrid, { cols: 1, spacing: "md", children: entries.map((entry) => /* @__PURE__ */ jsx(SystemSummaryPaper, { entry, rollupMode, onNavigate }, entry.path)) }) : /* @__PURE__ */ jsx(EmptyState, { icon: IconFolder, title: "No systems match", description: "Adjust search, status, resource type, or rollup filters." })
11888
11935
  ] });
11889
11936
  }
11890
11937
  function SystemDetail({
@@ -11912,6 +11959,7 @@ function SystemDetail({
11912
11959
  );
11913
11960
  const children = childEntries(systemPath, currentSystem, model);
11914
11961
  const breadcrumbs = buildBreadcrumbs(model, systemPath);
11962
+ const scopedOntologyCounts = ontologyCountsForSystem(model, systemPath);
11915
11963
  if (!currentSystem) {
11916
11964
  return /* @__PURE__ */ jsx(EmptyState, { icon: IconRoute, title: "System not found", description: `No semantic system exists at ${systemPath}.` });
11917
11965
  }
@@ -11952,6 +12000,21 @@ function SystemDetail({
11952
12000
  /* @__PURE__ */ jsx(MetricCard2, { label: "Failed", value: executionHealth?.statusCounts.failed ?? 0, detail: "Selected time range" })
11953
12001
  ] })
11954
12002
  ] }) }),
12003
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
12004
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
12005
+ /* @__PURE__ */ jsx(Title, { order: 2, size: "h5", children: "Ontology Projection" }),
12006
+ scopedOntologyCounts.diagnostics > 0 && /* @__PURE__ */ jsxs(Badge, { color: "red", variant: "light", children: [
12007
+ scopedOntologyCounts.diagnostics,
12008
+ " diagnostics"
12009
+ ] })
12010
+ ] }),
12011
+ /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 2, md: 4 }, spacing: "xs", children: [
12012
+ /* @__PURE__ */ jsx(MetricCard2, { label: "Objects", value: scopedOntologyCounts.objects, detail: "compiled object types" }),
12013
+ /* @__PURE__ */ jsx(MetricCard2, { label: "Actions", value: scopedOntologyCounts.actions, detail: "compiled action types" }),
12014
+ /* @__PURE__ */ jsx(MetricCard2, { label: "Catalogs", value: scopedOntologyCounts.catalogs, detail: "compiled catalog types" }),
12015
+ /* @__PURE__ */ jsx(MetricCard2, { label: "Surfaces", value: scopedOntologyCounts.surfaces, detail: "compiled surface types" })
12016
+ ] })
12017
+ ] }) }),
11955
12018
  /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
11956
12019
  /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
11957
12020
  /* @__PURE__ */ jsx(Title, { order: 2, size: "h5", children: "Execution Trend" }),
@@ -1,5 +1,5 @@
1
1
  import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-4DYOXEH6.js';
2
- import { useResourcesHealth } from './chunk-GCOQ3TBG.js';
2
+ import { useResourcesHealth } from './chunk-2GMF5IRF.js';
3
3
  import { CardHeader, EmptyState } from './chunk-EPTHX4VZ.js';
4
4
  import { getTimeRangeDates, formatBucketTime } from './chunk-2RJMVWFJ.js';
5
5
  import { Paper, Center, Loader, Group } from '@mantine/core';
@@ -3,7 +3,7 @@ import { AppShellLoader } from './chunk-RYTEQBAO.js';
3
3
  import { FilterBar } from './chunk-PDHTXPSF.js';
4
4
  import { CustomModal } from './chunk-R66W5UDG.js';
5
5
  import { formatDuration } from './chunk-E4WQGJNS.js';
6
- import { useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, useMarkAsRead, useExecutionLogsFilters, useExecutionLogs, useExecutionHealth, useErrorAnalysis, useTimeRangeDates, useErrorDetail, useResolveErrorsByExecution, useResources, useCostTrends, useCostSummary, useCostByModel, useCostBreakdown, useActivityFilters, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead } from './chunk-GCOQ3TBG.js';
6
+ import { useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, useMarkAsRead, useExecutionLogsFilters, useExecutionLogs, useExecutionHealth, useErrorAnalysis, useTimeRangeDates, useErrorDetail, useResolveErrorsByExecution, useResources, useCostTrends, useCostSummary, useCostByModel, useCostBreakdown, useActivityFilters, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead } from './chunk-2GMF5IRF.js';
7
7
  import { CenteredErrorState, CardHeader, StatsCardSkeleton, TrendIndicator, DetailCardSkeleton, EmptyState, PageTitleCaption, JsonViewer } from './chunk-EPTHX4VZ.js';
8
8
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
9
9
  import { formatBucketTime, PAGE_SIZE_DEFAULT, getTimeRangeDates } from './chunk-2RJMVWFJ.js';
@@ -1,6 +1,6 @@
1
1
  import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
2
2
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
3
- import { useDealsLookup, useCreateDealTask, useDealTasksDue } from './chunk-GCOQ3TBG.js';
3
+ import { useDealsLookup, useCreateDealTask, useDealTasksDue } from './chunk-2GMF5IRF.js';
4
4
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
5
5
  import { Box, Stack, Text, UnstyledButton, Group, Button, Modal, Title, Select, TextInput, Textarea, Badge, Center, Loader } from '@mantine/core';
6
6
  import { IconLayoutGrid, IconColumns, IconFileInvoice, IconList, IconBuilding, IconAddressBook, IconTrophy, IconClockExclamation, IconUser, IconPlus, IconChecklist, IconTarget, IconCheckbox, IconCalendar, IconMail, IconPhone } from '@tabler/icons-react';
@@ -2,7 +2,7 @@ import { AppShellLoader } from './chunk-RYTEQBAO.js';
2
2
  import { FilterBar } from './chunk-PDHTXPSF.js';
3
3
  import { CustomModal } from './chunk-R66W5UDG.js';
4
4
  import { useAvailablePresets } from './chunk-JFL3GRD4.js';
5
- import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-GCOQ3TBG.js';
5
+ import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-2GMF5IRF.js';
6
6
  import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-XZGSCABI.js';
7
7
  import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-EPTHX4VZ.js';
8
8
  import { RoleBadge } from './chunk-JA5ECJJB.js';
@@ -1,15 +1,15 @@
1
- import { SalesSidebar, CrmSidebarMiddle } from './chunk-MOY4VOHF.js';
1
+ import { SalesSidebar, CrmSidebarMiddle } from './chunk-QNOVUCSV.js';
2
2
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
3
3
  import { PageContainer } from './chunk-BZZCNLT6.js';
4
4
  import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
5
5
  import { FilterBar } from './chunk-PDHTXPSF.js';
6
6
  import { CustomModal } from './chunk-R66W5UDG.js';
7
- import { useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useContact, useExecuteAction } from './chunk-GCOQ3TBG.js';
7
+ import { useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useContact, useExecuteAction } from './chunk-2GMF5IRF.js';
8
8
  import { showApiErrorNotification, showSuccessNotification } from './chunk-XZGSCABI.js';
9
9
  import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-EPTHX4VZ.js';
10
- import { useCrmActions, deriveActions } from './chunk-YLQEVSOR.js';
10
+ import { useCrmActions, deriveActions } from './chunk-UW7IV2Y3.js';
11
11
  import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
12
- import { CRM_PIPELINE_DEFINITION, DEFAULT_CRM_PRIORITY_RULE_CONFIG, CRM_PRIORITY_BUCKETS } from './chunk-T35FWDAB.js';
12
+ import { CRM_PIPELINE_DEFINITION, DEFAULT_CRM_PRIORITY_RULE_CONFIG, CRM_PRIORITY_BUCKETS } from './chunk-GNRMB6DC.js';
13
13
  import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-2RJMVWFJ.js';
14
14
  import { useElevasisServices } from './chunk-KJ3QUBNU.js';
15
15
  import { Stack, Paper, Center, Loader, Group, Box, Text, Alert, Table, SimpleGrid, Button, Select, TextInput, Tabs, Checkbox, Badge, Tooltip, Pagination, Title, Code, Card, Switch, NumberInput, ColorSwatch, Popover, ActionIcon, Anchor, CopyButton, Divider, Textarea } from '@mantine/core';
@@ -1,4 +1,4 @@
1
- import { CRM_DISCOVERY_REPLIED_STATE, CRM_DISCOVERY_LINK_SENT_STATE, CRM_DISCOVERY_NUDGING_STATE, CRM_DISCOVERY_BOOKING_CANCELLED_STATE } from './chunk-T35FWDAB.js';
1
+ import { formatOntologyId, DEFAULT_ORGANIZATION_MODEL, CRM_DISCOVERY_NUDGING_STATE, compileOrganizationOntology, CRM_DISCOVERY_REPLIED_STATE, CRM_DISCOVERY_LINK_SENT_STATE, CRM_DISCOVERY_BOOKING_CANCELLED_STATE, CRM_PIPELINE_DEFINITION, LEAD_GEN_STAGE_CATALOG } from './chunk-GNRMB6DC.js';
2
2
  import { ApiClientProvider, useApiClient } from './chunk-ND5TDV2J.js';
3
3
  import { OrganizationProvider } from './chunk-HUJCU55S.js';
4
4
  import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-2RJMVWFJ.js';
@@ -40,6 +40,169 @@ function useNotificationAdapter() {
40
40
  return useContext(NotificationContext);
41
41
  }
42
42
 
43
+ // ../core/src/business/acquisition/ontology-validation.ts
44
+ var CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
45
+ scope: "sales.crm",
46
+ kind: "catalog",
47
+ localId: "crm.pipeline"
48
+ });
49
+ var LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
50
+ scope: "sales.lead-gen",
51
+ kind: "catalog",
52
+ localId: "lead-gen.stage-catalog"
53
+ });
54
+ var CRM_DEAL_OBJECT_ONTOLOGY_ID = formatOntologyId({
55
+ scope: "sales.crm",
56
+ kind: "object",
57
+ localId: "crm.deal"
58
+ });
59
+ function createCrmPipelineCatalog() {
60
+ return {
61
+ id: CRM_PIPELINE_CATALOG_ONTOLOGY_ID,
62
+ label: CRM_PIPELINE_DEFINITION.label,
63
+ ownerSystemId: "sales.crm",
64
+ kind: "pipeline",
65
+ appliesTo: CRM_DEAL_OBJECT_ONTOLOGY_ID,
66
+ entries: Object.fromEntries(
67
+ CRM_PIPELINE_DEFINITION.stages.map((stage, index) => [
68
+ stage.stageKey,
69
+ {
70
+ key: stage.stageKey,
71
+ label: stage.label,
72
+ order: (index + 1) * 10,
73
+ ...stage.color !== void 0 ? { color: stage.color } : {},
74
+ states: stage.states.map((state) => ({ ...state }))
75
+ }
76
+ ])
77
+ ),
78
+ legacyPipelineKey: CRM_PIPELINE_DEFINITION.pipelineKey,
79
+ legacyEntityKey: CRM_PIPELINE_DEFINITION.entityKey
80
+ };
81
+ }
82
+ function createLeadGenStageCatalog() {
83
+ return {
84
+ id: LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID,
85
+ label: "Lead Gen Processing Stages",
86
+ ownerSystemId: "sales.lead-gen",
87
+ kind: "processing-stage-catalog",
88
+ entries: Object.fromEntries(
89
+ Object.entries(LEAD_GEN_STAGE_CATALOG).map(([key, entry]) => [
90
+ key,
91
+ {
92
+ ...entry
93
+ }
94
+ ])
95
+ ),
96
+ legacyCatalogKey: "LEAD_GEN_STAGE_CATALOG"
97
+ };
98
+ }
99
+ function isPlainRecord(value) {
100
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
101
+ }
102
+ function mergeBridgeCatalogs(model) {
103
+ const baseCatalogTypes = model.ontology?.catalogTypes ?? {};
104
+ const bridgeCatalogTypes = {};
105
+ if (baseCatalogTypes[CRM_PIPELINE_CATALOG_ONTOLOGY_ID] === void 0) {
106
+ bridgeCatalogTypes[CRM_PIPELINE_CATALOG_ONTOLOGY_ID] = createCrmPipelineCatalog();
107
+ }
108
+ if (baseCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] === void 0) {
109
+ bridgeCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] = createLeadGenStageCatalog();
110
+ }
111
+ if (Object.keys(bridgeCatalogTypes).length === 0) return model;
112
+ return {
113
+ ...model,
114
+ ontology: {
115
+ ...model.ontology ?? {},
116
+ catalogTypes: {
117
+ ...baseCatalogTypes,
118
+ ...bridgeCatalogTypes
119
+ }
120
+ }
121
+ };
122
+ }
123
+ function compileBusinessOntologyValidationIndex(model = DEFAULT_ORGANIZATION_MODEL) {
124
+ const compilation = compileOrganizationOntology(mergeBridgeCatalogs(model));
125
+ if (compilation.diagnostics.length > 0) {
126
+ const summary = compilation.diagnostics.map((diagnostic) => diagnostic.message).join("; ");
127
+ throw new Error(`Business ontology validation index failed to compile: ${summary}`);
128
+ }
129
+ const crmPipelineCatalog = compilation.ontology.catalogTypes[CRM_PIPELINE_CATALOG_ONTOLOGY_ID];
130
+ const leadGenStageCatalog = compilation.ontology.catalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID];
131
+ if (crmPipelineCatalog === void 0 || leadGenStageCatalog === void 0) {
132
+ throw new Error("Business ontology validation index is missing CRM or lead-gen catalog bridge records");
133
+ }
134
+ return {
135
+ ontology: compilation.ontology,
136
+ crmPipelineCatalog,
137
+ leadGenStageCatalog,
138
+ actionTypesByLegacyId: indexActionTypesByLegacyId(compilation.ontology.actionTypes)
139
+ };
140
+ }
141
+ function indexActionTypesByLegacyId(actionTypes) {
142
+ const byLegacyId = {};
143
+ for (const actionType of Object.values(actionTypes)) {
144
+ const legacyActionId = actionType["legacyActionId"];
145
+ if (typeof legacyActionId === "string") {
146
+ byLegacyId[legacyActionId] = actionType;
147
+ }
148
+ }
149
+ return byLegacyId;
150
+ }
151
+ var BUSINESS_ONTOLOGY_VALIDATION_INDEX = compileBusinessOntologyValidationIndex();
152
+ function getCatalogEntries(catalog) {
153
+ return isPlainRecord(catalog.entries) ? catalog.entries : {};
154
+ }
155
+ function asCrmStageEntry(key, value) {
156
+ const record = isPlainRecord(value) ? value : {};
157
+ const label = typeof record.label === "string" ? record.label : key;
158
+ const order = typeof record.order === "number" ? record.order : 0;
159
+ const color = typeof record.color === "string" ? record.color : void 0;
160
+ const rawStates = Array.isArray(record.states) ? record.states : [];
161
+ const states = rawStates.flatMap((state) => {
162
+ if (!isPlainRecord(state) || typeof state.stateKey !== "string") return [];
163
+ return [
164
+ {
165
+ stateKey: state.stateKey,
166
+ label: typeof state.label === "string" ? state.label : state.stateKey
167
+ }
168
+ ];
169
+ });
170
+ return {
171
+ key,
172
+ label,
173
+ order,
174
+ ...color !== void 0 ? { color } : {},
175
+ states
176
+ };
177
+ }
178
+ var CRM_STAGE_KEYS_FROM_ONTOLOGY = Object.keys(
179
+ getCatalogEntries(BUSINESS_ONTOLOGY_VALIDATION_INDEX.crmPipelineCatalog)
180
+ );
181
+ Object.values(
182
+ getCatalogEntries(BUSINESS_ONTOLOGY_VALIDATION_INDEX.crmPipelineCatalog)
183
+ ).flatMap((entry, index) => {
184
+ const stageKey = CRM_STAGE_KEYS_FROM_ONTOLOGY[index];
185
+ if (stageKey === void 0) return [];
186
+ return asCrmStageEntry(stageKey, entry).states.map((state) => state.stateKey);
187
+ });
188
+ Object.keys(
189
+ getCatalogEntries(BUSINESS_ONTOLOGY_VALIDATION_INDEX.leadGenStageCatalog)
190
+ );
191
+ function getActionMetadata(actionKey) {
192
+ const actionType = BUSINESS_ONTOLOGY_VALIDATION_INDEX.actionTypesByLegacyId[actionKey];
193
+ if (actionType === void 0) return void 0;
194
+ const resourceId = actionType["resourceId"];
195
+ return {
196
+ id: actionKey,
197
+ label: actionType.label ?? actionKey,
198
+ ...typeof resourceId === "string" ? { resourceId } : {}
199
+ };
200
+ }
201
+ function getCrmActionMetadata(actionKey) {
202
+ const actionType = BUSINESS_ONTOLOGY_VALIDATION_INDEX.actionTypesByLegacyId[actionKey];
203
+ return actionType?.ownerSystemId === "sales.crm" ? getActionMetadata(actionKey) : void 0;
204
+ }
205
+
43
206
  // ../core/src/business/acquisition/deal-ownership.ts
44
207
  var INBOUND_EVENT_TYPES = ["reply_received"];
45
208
  var OUTBOUND_EVENT_TYPES = [
@@ -98,56 +261,44 @@ function parseMs(value) {
98
261
  var SendReplyActionPayloadSchema = z.object({
99
262
  replyBody: z.string().trim().min(1).max(1e4)
100
263
  }).strict();
264
+ function crmAction(actionId, runtime) {
265
+ const metadata = getCrmActionMetadata(actionId);
266
+ if (!metadata?.resourceId) {
267
+ throw new Error(`CRM action metadata for "${actionId}" must define resourceId`);
268
+ }
269
+ return {
270
+ key: metadata.id,
271
+ label: metadata.label,
272
+ workflowId: metadata.resourceId,
273
+ ...runtime
274
+ };
275
+ }
101
276
  var DEFAULT_CRM_ACTIONS = [
102
- {
103
- key: "move_to_proposal",
104
- label: "Move to Proposal",
105
- isAvailableFor: (deal) => deal.stage_key === "interested",
106
- workflowId: "move_to_proposal-workflow"
107
- },
108
- {
109
- key: "move_to_closing",
110
- label: "Move to Closing",
111
- isAvailableFor: (deal) => deal.stage_key === "proposal",
112
- workflowId: "move_to_closing-workflow"
113
- },
114
- {
115
- key: "move_to_closed_won",
116
- label: "Close Won",
117
- isAvailableFor: (deal) => deal.stage_key === "closing",
118
- workflowId: "move_to_closed_won-workflow"
119
- },
120
- {
121
- key: "move_to_closed_lost",
122
- label: "Close Lost",
123
- isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
124
- workflowId: "move_to_closed_lost-workflow"
125
- },
126
- {
127
- key: "move_to_nurturing",
128
- label: "Move to Nurturing",
129
- isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
130
- workflowId: "move_to_nurturing-workflow"
131
- },
132
- {
133
- key: "send_reply",
134
- label: "Send Reply",
277
+ crmAction("move_to_proposal", {
278
+ isAvailableFor: (deal) => deal.stage_key === "interested"
279
+ }),
280
+ crmAction("move_to_closing", {
281
+ isAvailableFor: (deal) => deal.stage_key === "proposal"
282
+ }),
283
+ crmAction("move_to_closed_won", {
284
+ isAvailableFor: (deal) => deal.stage_key === "closing"
285
+ }),
286
+ crmAction("move_to_closed_lost", {
287
+ isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing"
288
+ }),
289
+ crmAction("move_to_nurturing", {
290
+ isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing"
291
+ }),
292
+ crmAction("send_reply", {
135
293
  isAvailableFor: (deal) => deal.stage_key === "interested" && isOurReplyAction(deal) && (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey || deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
136
- workflowId: "crm-send-reply-workflow",
137
294
  payloadSchema: SendReplyActionPayloadSchema
138
- },
139
- {
140
- key: "send_link",
141
- label: "Send Booking Link",
142
- isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey,
143
- workflowId: "crm-send-booking-link-workflow"
144
- },
145
- {
146
- key: "send_nudge",
147
- label: "Send Nudge",
148
- isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
149
- workflowId: "crm-send-nudge-workflow"
150
- },
295
+ }),
296
+ crmAction("send_link", {
297
+ isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey
298
+ }),
299
+ crmAction("send_nudge", {
300
+ isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey)
301
+ }),
151
302
  {
152
303
  key: "mark_no_show",
153
304
  label: "Mark No-Show",
@@ -157,12 +308,9 @@ var DEFAULT_CRM_ACTIONS = [
157
308
  // event captures operator intent and distinguishes the manual variant from the timed one.
158
309
  workflowId: "mark_no_show-workflow"
159
310
  },
160
- {
161
- key: "rebook",
162
- label: "Rebook",
163
- isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey,
164
- workflowId: "crm-rebook-workflow"
165
- }
311
+ crmAction("rebook", {
312
+ isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey
313
+ })
166
314
  ];
167
315
  function deriveActions(deal, actions = DEFAULT_CRM_ACTIONS) {
168
316
  return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
@@ -4,7 +4,7 @@ import { useRouterContext } from './chunk-Q7DJKLEN.js';
4
4
  import { useAppearance } from './chunk-E565XMTQ.js';
5
5
  import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding, sidebarGroupChevronSize, sidebarIconInnerSize } from './chunk-DT3QYZVU.js';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import { createContext, memo, useEffect, createElement, useContext, useRef, useLayoutEffect, useState } from 'react';
7
+ import { createContext, memo, useEffect, useRef, createElement, useContext, useLayoutEffect, useState } from 'react';
8
8
  import { Collapse, HoverCard, Stack, Group, Text, UnstyledButton, Tooltip, ScrollArea, Menu, Avatar, Box, useMantineColorScheme, Switch, Code } from '@mantine/core';
9
9
  import { IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconUser, IconLogout, IconChevronDown, IconChevronRight, IconMoonStars, IconSun } from '@tabler/icons-react';
10
10
 
@@ -576,11 +576,14 @@ var LinksGroup = memo(function LinksGroup2({
576
576
  const isParentActive = !hasLinks && (link === "/" ? currentPath === "/" : isPathActive(link || "", currentPath));
577
577
  const isIconTextActive = isParentActive || hasActiveChild;
578
578
  const isBackgroundActive = isParentActive || hasActiveChild && !opened;
579
+ const prevPathRef = useRef(null);
579
580
  useEffect(() => {
580
- if (!isCollapsed && hasActiveChild && !opened && onToggle) {
581
+ const pathChanged = prevPathRef.current !== currentPath;
582
+ prevPathRef.current = currentPath;
583
+ if (pathChanged && !isCollapsed && hasActiveChild && !opened && onToggle) {
581
584
  onToggle();
582
585
  }
583
- }, [hasActiveChild, isCollapsed, opened, onToggle]);
586
+ }, [currentPath, hasActiveChild, isCollapsed, opened, onToggle]);
584
587
  const handleMainClick = () => {
585
588
  if (hasLinks && !isCollapsed) {
586
589
  onToggle?.();