@almadar/ui 4.47.9 → 4.48.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.
@@ -56165,7 +56165,7 @@ function findCrossLinks(orbitals) {
56165
56165
  }
56166
56166
  return links;
56167
56167
  }
56168
- function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint) {
56168
+ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus) {
56169
56169
  const orbitals = getOrbitals(schema);
56170
56170
  const nodes = [];
56171
56171
  const edges = [];
@@ -56243,6 +56243,7 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint) {
56243
56243
  fieldCount: entityInfo.fieldCount,
56244
56244
  traitCount: traits2.length,
56245
56245
  pageRoutes,
56246
+ status: orbitalStatus?.[orb.name] ?? "idle",
56246
56247
  _fullSchema: schema,
56247
56248
  _mockData: mockData
56248
56249
  }
@@ -58775,6 +58776,10 @@ var OrbPreviewNodeInner = (props) => {
58775
58776
  const eventSources = data.eventSources ?? [];
58776
58777
  const layerColor = data.layer ? LAYER_COLORS[data.layer] : void 0;
58777
58778
  const isExpanded = Boolean(data.traitName);
58779
+ const status = data.status ?? "idle";
58780
+ const isRunning = status === "running";
58781
+ const isSuccess = status === "success";
58782
+ const isError = status === "error";
58778
58783
  const label = isExpanded ? `${data.transitionEvent ?? ""}` : data.orbitalName;
58779
58784
  const sublabel = isExpanded ? `${data.fromState ?? ""} \u2192 ${data.toState ?? ""}` : data.entityName ?? "";
58780
58785
  const orbitalSchema = React147.useMemo(() => {
@@ -58909,19 +58914,54 @@ var OrbPreviewNodeInner = (props) => {
58909
58914
  const handlePreviewDragLeave = React147.useCallback((e) => {
58910
58915
  contentRef.current?.querySelectorAll(".drag-hover").forEach((c) => c.classList.remove("drag-hover"));
58911
58916
  }, []);
58917
+ const statusBorder = isRunning ? "var(--color-primary)" : isError ? "var(--color-danger)" : isSuccess ? "var(--color-success)" : null;
58918
+ const borderWidth = isRunning || isError || isSuccess ? "2px" : "1.5px";
58919
+ const borderColor = statusBorder ?? (hovered ? "var(--color-primary)" : colors.border);
58912
58920
  return /* @__PURE__ */ jsxRuntime.jsxs(
58913
58921
  Box,
58914
58922
  {
58915
- className: "rounded-lg border shadow-sm bg-card transition-all duration-200 overflow-hidden",
58923
+ className: `rounded-lg border shadow-sm bg-card transition-all duration-200 overflow-hidden relative${isRunning ? " orb-preview-running" : ""}`,
58916
58924
  style: {
58917
- borderColor: hovered ? "var(--color-primary)" : colors.border,
58918
- borderWidth: "1.5px",
58925
+ borderColor,
58926
+ borderWidth,
58919
58927
  width: preset.width
58920
58928
  },
58921
58929
  onMouseEnter: handleMouseEnter,
58922
58930
  onMouseLeave: handleMouseLeave,
58923
58931
  children: [
58924
58932
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: SELECTION_STYLES }),
58933
+ isRunning && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
58934
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
58935
+ @keyframes orb-preview-running-pulse {
58936
+ 0%, 100% { box-shadow: 0 0 0 0 var(--color-primary); opacity: 0.6; }
58937
+ 50% { box-shadow: 0 0 0 4px var(--color-primary); opacity: 0.15; }
58938
+ }
58939
+ .orb-preview-running {
58940
+ animation: orb-preview-running-pulse 1.8s ease-in-out infinite;
58941
+ }
58942
+ @keyframes orb-preview-spinner {
58943
+ from { transform: rotate(0deg); }
58944
+ to { transform: rotate(360deg); }
58945
+ }
58946
+ .orb-preview-spinner {
58947
+ animation: orb-preview-spinner 0.9s linear infinite;
58948
+ }
58949
+ ` }),
58950
+ /* @__PURE__ */ jsxRuntime.jsx(
58951
+ Box,
58952
+ {
58953
+ className: "orb-preview-spinner absolute top-2 right-2 rounded-full pointer-events-none",
58954
+ style: {
58955
+ width: 14,
58956
+ height: 14,
58957
+ border: "2px solid var(--color-primary)",
58958
+ borderTopColor: "transparent",
58959
+ zIndex: 2
58960
+ },
58961
+ title: "Coordinator is dispatching to this orbital"
58962
+ }
58963
+ )
58964
+ ] }),
58925
58965
  layerColor && /* @__PURE__ */ jsxRuntime.jsx(
58926
58966
  Box,
58927
58967
  {
@@ -59857,6 +59897,8 @@ function FlowCanvasInner({
59857
59897
  onPatternDelete,
59858
59898
  onEventWire,
59859
59899
  behaviorMeta,
59900
+ orbitalStatus,
59901
+ onOrbitalHover,
59860
59902
  layoutHint,
59861
59903
  onNodeSelect,
59862
59904
  composeLevel,
@@ -59899,7 +59941,7 @@ function FlowCanvasInner({
59899
59941
  const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges } = React147.useMemo(() => {
59900
59942
  const t = perfStart("compose-graph");
59901
59943
  const compose = composeLevel === "behavior" && behaviorEntries?.length ? behaviorsToComposeGraph(behaviorEntries, behaviorWires ?? [], layoutHint) : { nodes: [], edges: [] };
59902
- const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint);
59944
+ const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus);
59903
59945
  const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData) : { nodes: [], edges: [] };
59904
59946
  perfEnd("compose-graph", t, {
59905
59947
  composeNodes: compose.nodes.length,
@@ -59915,7 +59957,7 @@ function FlowCanvasInner({
59915
59957
  expandedNodes: expanded.nodes,
59916
59958
  expandedEdges: expanded.edges
59917
59959
  };
59918
- }, [parsedSchema, expandedOrbital, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData]);
59960
+ }, [parsedSchema, expandedOrbital, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus]);
59919
59961
  const activeNodes = atBehaviorLevel && composeNodes.length > 0 ? composeNodes : level === "overview" ? overviewNodes : expandedNodes;
59920
59962
  const activeEdges = atBehaviorLevel && composeEdges.length > 0 ? composeEdges : level === "overview" ? overviewEdges : expandedEdges;
59921
59963
  const [nodes, setNodes, onNodesChange] = react.useNodesState(activeNodes);
@@ -901,6 +901,18 @@ interface PreviewNodeData extends Record<string, unknown> {
901
901
  fieldCount?: number;
902
902
  traitCount?: number;
903
903
  pageRoutes?: string[];
904
+ /**
905
+ * Generation status for this orbital. When `'running'`, the overview node
906
+ * renders a spinner overlay + accent border so the user can see which
907
+ * orbital the coordinator is currently dispatching to. Other states are
908
+ * available so consumers can also paint success/error treatments
909
+ * (e.g. green border on completion, red on failure). Default is `'idle'`.
910
+ *
911
+ * Set by FlowCanvasProps.orbitalStatus and threaded through the converter.
912
+ * Future expansion: hover over a `'running'` node to surface the subagent
913
+ * trace inline.
914
+ */
915
+ status?: 'idle' | 'running' | 'success' | 'error';
904
916
  }
905
917
  /** Data for event flow edges. */
906
918
  interface EventEdgeData extends Record<string, unknown> {
@@ -948,7 +960,7 @@ interface EventEdgeData extends Record<string, unknown> {
948
960
  */
949
961
  declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<string, unknown[]>, behaviorMeta?: Record<string, {
950
962
  layer: string;
951
- }>, layoutHint?: 'pipeline' | 'grid'): {
963
+ }>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>): {
952
964
  nodes: Node<PreviewNodeData>[];
953
965
  edges: Edge<EventEdgeData>[];
954
966
  };
@@ -1260,6 +1272,20 @@ interface FlowCanvasProps {
1260
1272
  behaviorMeta?: Record<string, {
1261
1273
  layer: string;
1262
1274
  }>;
1275
+ /**
1276
+ * Per-orbital generation status. Keyed by orbital name. Drives the spinner
1277
+ * + accent border treatment on the overview node and (future) the hover
1278
+ * trace surface. Defaults to `'idle'` for missing entries. Consumers
1279
+ * derive this from agent subagent_start/complete SSE events.
1280
+ */
1281
+ orbitalStatus?: Record<string, PreviewNodeData['status']>;
1282
+ /**
1283
+ * Hover handler for overview-level orbital nodes. Fires with the orbital
1284
+ * name on enter and `null` on leave. Reserved for the upcoming trace
1285
+ * tooltip: consumers will use it to anchor a popover that shows the
1286
+ * subagent's live trace + reasoning for the hovered orbital.
1287
+ */
1288
+ onOrbitalHover?: (orbitalName: string | null) => void;
1263
1289
  /** Layout hint: 'pipeline' renders nodes left-to-right, 'grid' (default) uses sqrt-based grid. */
1264
1290
  layoutHint?: 'pipeline' | 'grid';
1265
1291
  /** Called when the user clicks a node in overview level (for composition hints). */
package/dist/avl/index.js CHANGED
@@ -56119,7 +56119,7 @@ function findCrossLinks(orbitals) {
56119
56119
  }
56120
56120
  return links;
56121
56121
  }
56122
- function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint) {
56122
+ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus) {
56123
56123
  const orbitals = getOrbitals(schema);
56124
56124
  const nodes = [];
56125
56125
  const edges = [];
@@ -56197,6 +56197,7 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint) {
56197
56197
  fieldCount: entityInfo.fieldCount,
56198
56198
  traitCount: traits2.length,
56199
56199
  pageRoutes,
56200
+ status: orbitalStatus?.[orb.name] ?? "idle",
56200
56201
  _fullSchema: schema,
56201
56202
  _mockData: mockData
56202
56203
  }
@@ -58729,6 +58730,10 @@ var OrbPreviewNodeInner = (props) => {
58729
58730
  const eventSources = data.eventSources ?? [];
58730
58731
  const layerColor = data.layer ? LAYER_COLORS[data.layer] : void 0;
58731
58732
  const isExpanded = Boolean(data.traitName);
58733
+ const status = data.status ?? "idle";
58734
+ const isRunning = status === "running";
58735
+ const isSuccess = status === "success";
58736
+ const isError = status === "error";
58732
58737
  const label = isExpanded ? `${data.transitionEvent ?? ""}` : data.orbitalName;
58733
58738
  const sublabel = isExpanded ? `${data.fromState ?? ""} \u2192 ${data.toState ?? ""}` : data.entityName ?? "";
58734
58739
  const orbitalSchema = useMemo(() => {
@@ -58863,19 +58868,54 @@ var OrbPreviewNodeInner = (props) => {
58863
58868
  const handlePreviewDragLeave = useCallback((e) => {
58864
58869
  contentRef.current?.querySelectorAll(".drag-hover").forEach((c) => c.classList.remove("drag-hover"));
58865
58870
  }, []);
58871
+ const statusBorder = isRunning ? "var(--color-primary)" : isError ? "var(--color-danger)" : isSuccess ? "var(--color-success)" : null;
58872
+ const borderWidth = isRunning || isError || isSuccess ? "2px" : "1.5px";
58873
+ const borderColor = statusBorder ?? (hovered ? "var(--color-primary)" : colors.border);
58866
58874
  return /* @__PURE__ */ jsxs(
58867
58875
  Box,
58868
58876
  {
58869
- className: "rounded-lg border shadow-sm bg-card transition-all duration-200 overflow-hidden",
58877
+ className: `rounded-lg border shadow-sm bg-card transition-all duration-200 overflow-hidden relative${isRunning ? " orb-preview-running" : ""}`,
58870
58878
  style: {
58871
- borderColor: hovered ? "var(--color-primary)" : colors.border,
58872
- borderWidth: "1.5px",
58879
+ borderColor,
58880
+ borderWidth,
58873
58881
  width: preset.width
58874
58882
  },
58875
58883
  onMouseEnter: handleMouseEnter,
58876
58884
  onMouseLeave: handleMouseLeave,
58877
58885
  children: [
58878
58886
  /* @__PURE__ */ jsx("style", { children: SELECTION_STYLES }),
58887
+ isRunning && /* @__PURE__ */ jsxs(Fragment, { children: [
58888
+ /* @__PURE__ */ jsx("style", { children: `
58889
+ @keyframes orb-preview-running-pulse {
58890
+ 0%, 100% { box-shadow: 0 0 0 0 var(--color-primary); opacity: 0.6; }
58891
+ 50% { box-shadow: 0 0 0 4px var(--color-primary); opacity: 0.15; }
58892
+ }
58893
+ .orb-preview-running {
58894
+ animation: orb-preview-running-pulse 1.8s ease-in-out infinite;
58895
+ }
58896
+ @keyframes orb-preview-spinner {
58897
+ from { transform: rotate(0deg); }
58898
+ to { transform: rotate(360deg); }
58899
+ }
58900
+ .orb-preview-spinner {
58901
+ animation: orb-preview-spinner 0.9s linear infinite;
58902
+ }
58903
+ ` }),
58904
+ /* @__PURE__ */ jsx(
58905
+ Box,
58906
+ {
58907
+ className: "orb-preview-spinner absolute top-2 right-2 rounded-full pointer-events-none",
58908
+ style: {
58909
+ width: 14,
58910
+ height: 14,
58911
+ border: "2px solid var(--color-primary)",
58912
+ borderTopColor: "transparent",
58913
+ zIndex: 2
58914
+ },
58915
+ title: "Coordinator is dispatching to this orbital"
58916
+ }
58917
+ )
58918
+ ] }),
58879
58919
  layerColor && /* @__PURE__ */ jsx(
58880
58920
  Box,
58881
58921
  {
@@ -59811,6 +59851,8 @@ function FlowCanvasInner({
59811
59851
  onPatternDelete,
59812
59852
  onEventWire,
59813
59853
  behaviorMeta,
59854
+ orbitalStatus,
59855
+ onOrbitalHover,
59814
59856
  layoutHint,
59815
59857
  onNodeSelect,
59816
59858
  composeLevel,
@@ -59853,7 +59895,7 @@ function FlowCanvasInner({
59853
59895
  const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges } = useMemo(() => {
59854
59896
  const t = perfStart("compose-graph");
59855
59897
  const compose = composeLevel === "behavior" && behaviorEntries?.length ? behaviorsToComposeGraph(behaviorEntries, behaviorWires ?? [], layoutHint) : { nodes: [], edges: [] };
59856
- const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint);
59898
+ const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus);
59857
59899
  const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData) : { nodes: [], edges: [] };
59858
59900
  perfEnd("compose-graph", t, {
59859
59901
  composeNodes: compose.nodes.length,
@@ -59869,7 +59911,7 @@ function FlowCanvasInner({
59869
59911
  expandedNodes: expanded.nodes,
59870
59912
  expandedEdges: expanded.edges
59871
59913
  };
59872
- }, [parsedSchema, expandedOrbital, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData]);
59914
+ }, [parsedSchema, expandedOrbital, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus]);
59873
59915
  const activeNodes = atBehaviorLevel && composeNodes.length > 0 ? composeNodes : level === "overview" ? overviewNodes : expandedNodes;
59874
59916
  const activeEdges = atBehaviorLevel && composeEdges.length > 0 ? composeEdges : level === "overview" ? overviewEdges : expandedEdges;
59875
59917
  const [nodes, setNodes, onNodesChange] = useNodesState(activeNodes);
@@ -21,7 +21,7 @@ import type { PreviewNodeData, EventEdgeData } from './avl-preview-types';
21
21
  */
22
22
  export declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<string, unknown[]>, behaviorMeta?: Record<string, {
23
23
  layer: string;
24
- }>, layoutHint?: 'pipeline' | 'grid'): {
24
+ }>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>): {
25
25
  nodes: Node<PreviewNodeData>[];
26
26
  edges: Edge<EventEdgeData>[];
27
27
  };
@@ -89,6 +89,18 @@ export interface PreviewNodeData extends Record<string, unknown> {
89
89
  fieldCount?: number;
90
90
  traitCount?: number;
91
91
  pageRoutes?: string[];
92
+ /**
93
+ * Generation status for this orbital. When `'running'`, the overview node
94
+ * renders a spinner overlay + accent border so the user can see which
95
+ * orbital the coordinator is currently dispatching to. Other states are
96
+ * available so consumers can also paint success/error treatments
97
+ * (e.g. green border on completion, red on failure). Default is `'idle'`.
98
+ *
99
+ * Set by FlowCanvasProps.orbitalStatus and threaded through the converter.
100
+ * Future expansion: hover over a `'running'` node to surface the subagent
101
+ * trace inline.
102
+ */
103
+ status?: 'idle' | 'running' | 'success' | 'error';
92
104
  }
93
105
  /** Data for event flow edges. */
94
106
  export interface EventEdgeData extends Record<string, unknown> {
@@ -78,6 +78,20 @@ export interface FlowCanvasProps {
78
78
  behaviorMeta?: Record<string, {
79
79
  layer: string;
80
80
  }>;
81
+ /**
82
+ * Per-orbital generation status. Keyed by orbital name. Drives the spinner
83
+ * + accent border treatment on the overview node and (future) the hover
84
+ * trace surface. Defaults to `'idle'` for missing entries. Consumers
85
+ * derive this from agent subagent_start/complete SSE events.
86
+ */
87
+ orbitalStatus?: Record<string, PreviewNodeData['status']>;
88
+ /**
89
+ * Hover handler for overview-level orbital nodes. Fires with the orbital
90
+ * name on enter and `null` on leave. Reserved for the upcoming trace
91
+ * tooltip: consumers will use it to anchor a popover that shows the
92
+ * subagent's live trace + reasoning for the hovered orbital.
93
+ */
94
+ onOrbitalHover?: (orbitalName: string | null) => void;
81
95
  /** Layout hint: 'pipeline' renders nodes left-to-right, 'grid' (default) uses sqrt-based grid. */
82
96
  layoutHint?: 'pipeline' | 'grid';
83
97
  /** Called when the user clicks a node in overview level (for composition hints). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.47.9",
3
+ "version": "4.48.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [