@ultrst-armada/floks 1.13.20 → 1.14.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 (62) hide show
  1. package/.krusbl-release-attestation.json +3 -3
  2. package/package.json +8 -7
  3. package/packages/canvas-ui/dist/MovableSocketView.d.ts +1 -1
  4. package/packages/canvas-ui/dist/NodeCard.d.ts +1 -1
  5. package/packages/canvas-ui/dist/NodeDetailsPanel.d.ts +1 -1
  6. package/packages/canvas-ui/dist/NodeGraphCanvas.d.ts +1 -1
  7. package/packages/canvas-ui/dist/Viewer2DNodes.d.ts +1 -1
  8. package/packages/canvas-ui/dist/WireRenderer.d.ts +1 -1
  9. package/packages/canvas-ui/dist/authoring/UiAuthoringValidationPanel.d.ts +1 -1
  10. package/packages/canvas-ui/dist/{chunk-RH5NINIT.js → chunk-A7BSZ5QO.js} +28 -103
  11. package/packages/canvas-ui/dist/chunk-FPRATI44.js +45 -0
  12. package/packages/canvas-ui/dist/{chunk-ZJXRL74D.js → chunk-KAKAFGVH.js} +22 -16
  13. package/packages/canvas-ui/dist/{chunk-YHEIL67R.js → chunk-SRGVIYC5.js} +6 -6
  14. package/packages/canvas-ui/dist/{chunk-7CYX3B6O.js → chunk-TKOMIUCU.js} +1 -1
  15. package/packages/canvas-ui/dist/{chunk-XVAHT5WE.js → chunk-ZDADZVQ2.js} +363 -59
  16. package/packages/canvas-ui/dist/{chunk-QRYNQ36L.js → chunk-ZSVXR3HU.js} +1 -1
  17. package/packages/canvas-ui/dist/editor/MonacoEditor.d.ts +1 -1
  18. package/packages/canvas-ui/dist/editor/index.js +1 -1
  19. package/packages/canvas-ui/dist/fod/index.js +3 -3
  20. package/packages/canvas-ui/dist/frnl-editable-node-graph/FrnlEditableNodeGraph.d.ts +1 -1
  21. package/packages/canvas-ui/dist/frnl-editable-node-graph/index.js +2 -2
  22. package/packages/canvas-ui/dist/graph-2d/CanvasBackground2D.d.ts +1 -1
  23. package/packages/canvas-ui/dist/graph-2d/MagneticTraces2D.d.ts +2 -2
  24. package/packages/canvas-ui/dist/graph-2d/Node2DBase.d.ts +3 -3
  25. package/packages/canvas-ui/dist/graph-2d/NodeRenderer2D.d.ts +3 -3
  26. package/packages/canvas-ui/dist/graph-2d/RecorderWaveformDisplay.d.ts +1 -1
  27. package/packages/canvas-ui/dist/graph-2d/Socket2D.d.ts +1 -1
  28. package/packages/canvas-ui/dist/graph-2d/Wire2D.d.ts +1 -1
  29. package/packages/canvas-ui/dist/graph-2d/index.js +9 -9
  30. package/packages/canvas-ui/dist/graph-2d/socketCoordinates.d.ts +1 -1
  31. package/packages/canvas-ui/dist/graph-2d/types.d.ts +1 -1
  32. package/packages/canvas-ui/dist/graph-2d/useCanvas2DMagnetic.d.ts +4 -4
  33. package/packages/canvas-ui/dist/index.js +38 -38
  34. package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostNodeCard.d.ts +1 -1
  35. package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostSolidifyBar.d.ts +1 -1
  36. package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostTraceLayer.d.ts +1 -1
  37. package/packages/canvas-ui/dist/node-graph-ui/react-flow/ReactFlowAdapter.d.ts +4 -4
  38. package/packages/canvas-ui/dist/node-graph-ui/toolbar/GraphToolbar.d.ts +1 -1
  39. package/packages/canvas-ui/dist/node-graph-ui/widgets/CanvasContextMenu.d.ts +1 -1
  40. package/packages/canvas-ui/dist/node-graph-ui/widgets/CompatibleNodePicker.d.ts +1 -1
  41. package/packages/canvas-ui/dist/node-graph-ui/widgets/MagneticTraceLayer.d.ts +1 -1
  42. package/packages/canvas-ui/dist/node-graph-ui/widgets/NodeSearchPalette.d.ts +1 -1
  43. package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/PredictiveGhostNodeCard.d.ts +2 -2
  44. package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/types.d.ts +1 -1
  45. package/packages/canvas-ui/dist/predictive/PredictiveLayer2D.d.ts +1 -2
  46. package/packages/canvas-ui/dist/predictive/index.js +3 -3
  47. package/packages/canvas-ui/dist/predictive/usePredictiveGraph2D.d.ts +4 -5
  48. package/packages/canvas-ui/dist/useGhostRouting.d.ts +1 -1
  49. package/packages/canvas-ui/dist/useNodeGraph.d.ts +1 -1
  50. package/packages/canvas-ui/package.json +5 -6
  51. package/packages/contracts/dist/index.d.ts +396 -1
  52. package/packages/contracts/dist/index.js +201 -1
  53. package/packages/contracts/dist/state-graph.d.ts +456 -0
  54. package/packages/contracts/dist/state-graph.js +282 -0
  55. package/packages/contracts/package.json +6 -1
  56. package/packages/ui/dist/{chunk-3YYPBZS2.js → chunk-W6ENIFEW.js} +3 -3
  57. package/packages/ui/dist/components/auth/LuthAuthClient.d.ts +4 -4
  58. package/packages/ui/dist/components/auth/index.js +1 -1
  59. package/packages/ui/dist/components/auth/luthAuthTypes.d.ts +2 -2
  60. package/packages/ui/dist/index.js +1 -1
  61. package/packages/ui/package.json +3 -3
  62. package/packages/canvas-ui/dist/chunk-U2SC3RMJ.js +0 -391
@@ -1,7 +1,6 @@
1
1
  import {
2
- Node2DBase,
3
2
  getSocketScreenPosition
4
- } from "./chunk-U2SC3RMJ.js";
3
+ } from "./chunk-FPRATI44.js";
5
4
 
6
5
  // src/graph-2d/types.ts
7
6
  var COORD_SCALE = 40;
@@ -75,7 +74,7 @@ function useCanvas2DCoordinates() {
75
74
 
76
75
  // src/graph-2d/useCanvas2DMagnetic.ts
77
76
  import { useState as useState2, useMemo, useEffect as useEffect2, useCallback as useCallback2, useRef as useRef2 } from "react";
78
- import { MagneticGraphManager } from "@ultrst-armada/kloks/state-graph";
77
+ import { MagneticGraphManager } from "@ultrst-armada/floks/contracts";
79
78
  function useCanvas2DMagnetic({
80
79
  nodes,
81
80
  connections,
@@ -152,16 +151,315 @@ function useCanvas2DMagnetic({
152
151
  };
153
152
  }
154
153
 
155
- // src/graph-2d/NodeRenderer2D.tsx
154
+ // src/graph-2d/Socket2D.tsx
155
+ import { SIGNAL_TYPES } from "@ultrst-armada/floks/contracts";
156
156
  import { jsx, jsxs } from "react/jsx-runtime";
157
+ var Socket2D = ({
158
+ nodeId,
159
+ socket,
160
+ direction,
161
+ isConnected = false,
162
+ onSocketHover,
163
+ onSocketMouseDown,
164
+ onSocketMouseUp,
165
+ onHover,
166
+ onMouseDown,
167
+ onMouseUp
168
+ }) => {
169
+ const sigDef = SIGNAL_TYPES[socket.signalType] || SIGNAL_TYPES.trigger;
170
+ const colorStr = sigDef.colorStr;
171
+ const resolvedDirection = direction || (socket.polarity === "input" ? "in" : "out");
172
+ const isInput = resolvedDirection === "in";
173
+ const portKey = socket.portId || socket.socketId;
174
+ const hoverCb = onSocketHover || onHover;
175
+ const downCb = onSocketMouseDown || onMouseDown;
176
+ const upCb = onSocketMouseUp || onMouseUp;
177
+ return /* @__PURE__ */ jsxs(
178
+ "div",
179
+ {
180
+ id: `socket-2d-${nodeId}-${resolvedDirection}-${portKey}`,
181
+ className: `flex items-center gap-1.5 cursor-pointer group/sock select-none ${isInput ? "justify-start" : "justify-end ml-auto"}`,
182
+ onMouseEnter: (e) => {
183
+ const rect = e.currentTarget.getBoundingClientRect();
184
+ hoverCb?.({
185
+ nodeId,
186
+ socket,
187
+ screenX: isInput ? rect.left : rect.right,
188
+ screenY: rect.top
189
+ });
190
+ },
191
+ onMouseLeave: () => hoverCb?.(null),
192
+ onMouseDown: (e) => {
193
+ e.stopPropagation();
194
+ downCb?.(nodeId, socket, e);
195
+ },
196
+ onMouseUp: (e) => {
197
+ e.stopPropagation();
198
+ upCb?.(nodeId, socket, e);
199
+ },
200
+ children: [
201
+ isInput && /* @__PURE__ */ jsx(
202
+ "div",
203
+ {
204
+ style: { backgroundColor: colorStr },
205
+ className: `w-2.5 h-2.5 rounded-full border border-black group-hover/sock:scale-130 transition-transform ${isConnected ? "ring-1 ring-white/60" : "opacity-85"}`
206
+ }
207
+ ),
208
+ /* @__PURE__ */ jsx("span", { className: "font-mono font-bold text-[9px] text-neutral-300 group-hover/sock:text-amber-300 tracking-tight", children: socket.label }),
209
+ !isInput && /* @__PURE__ */ jsx(
210
+ "div",
211
+ {
212
+ style: { backgroundColor: colorStr },
213
+ className: `w-2.5 h-2.5 rotate-45 border border-black group-hover/sock:scale-130 transition-transform ${isConnected ? "ring-1 ring-white/60" : "opacity-85"}`
214
+ }
215
+ )
216
+ ]
217
+ }
218
+ );
219
+ };
220
+
221
+ // src/graph-2d/RecorderWaveformDisplay.tsx
222
+ import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
223
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
224
+ function buildWaveformPath(peaks, width, height) {
225
+ if (peaks.length === 0) return `M 0 ${height / 2} L ${width} ${height / 2}`;
226
+ const step = width / Math.max(1, peaks.length - 1);
227
+ const mid = height / 2;
228
+ const top = [];
229
+ const bottom = [];
230
+ peaks.forEach((peak, index) => {
231
+ const x = Math.round(index * step * 10) / 10;
232
+ const amp = Math.max(0.08, Math.min(1, peak)) * (mid - 2);
233
+ top.push(`${index === 0 ? "M" : "L"} ${x} ${mid - amp}`);
234
+ bottom.unshift(`L ${x} ${mid + amp}`);
235
+ });
236
+ return `${top.join(" ")} ${bottom.join(" ")} Z`;
237
+ }
238
+ var RecorderWaveformDisplay = ({ node, width = 150 }) => {
239
+ const [currentBeat, setCurrentBeat] = useState3(0);
240
+ const [phase, setPhase] = useState3(0);
241
+ const isArmed = !!node.isArmed;
242
+ const isRetrospective = node.recordingMode === "retrospective";
243
+ const isRecording = !isRetrospective && !!node.isRecording;
244
+ const isStereo = node.recorderType !== "audio_mono";
245
+ const lastTime = useRef3(null);
246
+ useEffect3(() => {
247
+ if (!isArmed) return;
248
+ let frame = 0;
249
+ const tick = (time) => {
250
+ const previous = lastTime.current ?? time;
251
+ const deltaSeconds = Math.min(0.1, (time - previous) / 1e3);
252
+ lastTime.current = time;
253
+ setCurrentBeat((beat) => beat + deltaSeconds * 2);
254
+ setPhase((value) => value + deltaSeconds * 5);
255
+ frame = requestAnimationFrame(tick);
256
+ };
257
+ frame = requestAnimationFrame(tick);
258
+ return () => {
259
+ cancelAnimationFrame(frame);
260
+ lastTime.current = null;
261
+ };
262
+ }, [isArmed]);
263
+ if (!isArmed) return null;
264
+ const elapsedBeats = isRecording ? Math.max(0, currentBeat - (node.recordingStartBeat || 0)) : 0;
265
+ const bars = Math.floor(elapsedBeats / 4);
266
+ const beatsInBar = (elapsedBeats % 4).toFixed(1);
267
+ const timeText = isRecording ? `${bars} BAR${bars === 1 ? "" : "S"} ${beatsInBar} BEATS` : isRetrospective ? `${node.bufferLengthBars ?? 4} BARS BUFFER` : "1 BAR PREVIEW";
268
+ const red = isRecording;
269
+ const stroke = red ? "#f43f5e" : "#94a3b8";
270
+ const fill = red ? "rgba(244, 63, 94, 0.25)" : "rgba(148, 163, 184, 0.15)";
271
+ const sample = (offset) => Array.from({ length: 32 }, (_, i) => {
272
+ const base = 0.18 + 0.22 * Math.abs(Math.sin(i * 0.65 + phase + offset));
273
+ const accent = 0.12 * Math.abs(Math.sin(i * 1.7 + phase * 0.7));
274
+ return Math.min(1, base + accent);
275
+ });
276
+ const left = sample(0);
277
+ const right = sample(1.4);
278
+ const trackHeight = isStereo ? 18 : 36;
279
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center justify-center w-full px-1 py-1 rounded bg-black/60 border border-slate-800 select-none overflow-hidden", children: [
280
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between w-full px-1 mb-0.5 text-[8px] font-mono font-bold tracking-tight", children: [
281
+ /* @__PURE__ */ jsx2("span", { className: red ? "text-rose-400 animate-pulse" : "text-slate-400", children: red ? "\u25CF REC" : isRetrospective ? "\u25CF BUFFER" : "ARMED" }),
282
+ /* @__PURE__ */ jsx2("span", { className: red ? "text-rose-300 font-extrabold" : "text-slate-400", children: timeText })
283
+ ] }),
284
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-0.5 w-full", children: [
285
+ /* @__PURE__ */ jsxs2("div", { className: `relative w-full ${isStereo ? "h-[18px]" : "h-[36px]"} bg-slate-950/80 rounded border border-slate-800/80 overflow-hidden`, children: [
286
+ isStereo && /* @__PURE__ */ jsx2("span", { className: "absolute top-0.5 left-1 text-[7px] font-mono font-bold text-slate-500 z-10", children: "L" }),
287
+ /* @__PURE__ */ jsx2("svg", { className: "w-full h-full", viewBox: `0 0 ${width} ${trackHeight}`, preserveAspectRatio: "none", children: /* @__PURE__ */ jsx2("path", { d: buildWaveformPath(left, width, trackHeight), fill, stroke, strokeWidth: "1.2" }) })
288
+ ] }),
289
+ isStereo && /* @__PURE__ */ jsxs2("div", { className: "relative w-full h-[18px] bg-slate-950/80 rounded border border-slate-800/80 overflow-hidden", children: [
290
+ /* @__PURE__ */ jsx2("span", { className: "absolute top-0.5 left-1 text-[7px] font-mono font-bold text-slate-500 z-10", children: "R" }),
291
+ /* @__PURE__ */ jsx2("svg", { className: "w-full h-full", viewBox: `0 0 ${width} ${trackHeight}`, preserveAspectRatio: "none", children: /* @__PURE__ */ jsx2("path", { d: buildWaveformPath(right, width, trackHeight), fill, stroke, strokeWidth: "1.2" }) })
292
+ ] })
293
+ ] })
294
+ ] });
295
+ };
296
+
297
+ // src/graph-2d/Node2DBase.tsx
298
+ import {
299
+ Castle,
300
+ Sparkles,
301
+ Flame,
302
+ FileAudio,
303
+ Activity,
304
+ Layers,
305
+ Music,
306
+ Clock,
307
+ RotateCw,
308
+ Volume2,
309
+ Zap,
310
+ Radio,
311
+ LogIn,
312
+ LogOut,
313
+ GitMerge,
314
+ Split,
315
+ Cpu,
316
+ Repeat,
317
+ Type,
318
+ Hash,
319
+ ToggleLeft,
320
+ Braces,
321
+ Folder,
322
+ FileText
323
+ } from "lucide-react";
324
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
325
+ var NODE_CARD_WIDTH = 210;
326
+ var SOCKET_ROW_HEIGHT = 24;
327
+ var renderSpriteIcon = (iconName, color, className = "w-4 h-4 shrink-0") => {
328
+ const props = { className, style: { color } };
329
+ switch (iconName) {
330
+ case "Castle":
331
+ return /* @__PURE__ */ jsx3(Castle, { ...props });
332
+ case "Sparkles":
333
+ return /* @__PURE__ */ jsx3(Sparkles, { ...props });
334
+ case "Flame":
335
+ return /* @__PURE__ */ jsx3(Flame, { ...props });
336
+ case "FileAudio":
337
+ return /* @__PURE__ */ jsx3(FileAudio, { ...props });
338
+ case "Activity":
339
+ return /* @__PURE__ */ jsx3(Activity, { ...props });
340
+ case "Layers":
341
+ return /* @__PURE__ */ jsx3(Layers, { ...props });
342
+ case "Music":
343
+ return /* @__PURE__ */ jsx3(Music, { ...props });
344
+ case "Clock":
345
+ return /* @__PURE__ */ jsx3(Clock, { ...props });
346
+ case "RotateCw":
347
+ return /* @__PURE__ */ jsx3(RotateCw, { ...props });
348
+ case "Volume2":
349
+ return /* @__PURE__ */ jsx3(Volume2, { ...props });
350
+ case "Zap":
351
+ return /* @__PURE__ */ jsx3(Zap, { ...props });
352
+ case "Radio":
353
+ return /* @__PURE__ */ jsx3(Radio, { ...props });
354
+ case "LogIn":
355
+ return /* @__PURE__ */ jsx3(LogIn, { ...props });
356
+ case "LogOut":
357
+ return /* @__PURE__ */ jsx3(LogOut, { ...props });
358
+ case "GitMerge":
359
+ return /* @__PURE__ */ jsx3(GitMerge, { ...props });
360
+ case "Split":
361
+ return /* @__PURE__ */ jsx3(Split, { ...props });
362
+ case "Cpu":
363
+ return /* @__PURE__ */ jsx3(Cpu, { ...props });
364
+ case "Repeat":
365
+ return /* @__PURE__ */ jsx3(Repeat, { ...props });
366
+ case "Type":
367
+ return /* @__PURE__ */ jsx3(Type, { ...props });
368
+ case "Hash":
369
+ return /* @__PURE__ */ jsx3(Hash, { ...props });
370
+ case "ToggleLeft":
371
+ return /* @__PURE__ */ jsx3(ToggleLeft, { ...props });
372
+ case "Braces":
373
+ return /* @__PURE__ */ jsx3(Braces, { ...props });
374
+ case "Folder":
375
+ return /* @__PURE__ */ jsx3(Folder, { ...props });
376
+ case "FileText":
377
+ return /* @__PURE__ */ jsx3(FileText, { ...props });
378
+ default:
379
+ return /* @__PURE__ */ jsx3(Castle, { ...props });
380
+ }
381
+ };
382
+ var Node2DBase = ({
383
+ node,
384
+ sprite,
385
+ sockets,
386
+ screenPos,
387
+ zoom,
388
+ isSelected,
389
+ isHovered,
390
+ children,
391
+ onNodeMouseDown,
392
+ onNodeDoubleClick,
393
+ onNodeMouseEnter,
394
+ onNodeMouseLeave,
395
+ onSocketHover,
396
+ onSocketMouseDown,
397
+ onSocketMouseUp
398
+ }) => {
399
+ const totalRows = Math.max(sockets.inputs.length, sockets.outputs.length, 1);
400
+ const cardHeight = Math.max(70, 36 + totalRows * SOCKET_ROW_HEIGHT);
401
+ const nodeInspectionText = `NODE: ${node.name || sprite.spriteName || node.type} (${(node.type || "NODE").toUpperCase()})`;
402
+ return /* @__PURE__ */ jsxs3(
403
+ "div",
404
+ {
405
+ id: `floks-node-2d-${node.id}`,
406
+ "data-skipo-tip": nodeInspectionText,
407
+ title: nodeInspectionText,
408
+ onMouseEnter: onNodeMouseEnter,
409
+ onMouseLeave: onNodeMouseLeave,
410
+ onMouseDown: onNodeMouseDown,
411
+ onDoubleClick: onNodeDoubleClick,
412
+ style: {
413
+ transform: `translate(${screenPos.x}px, ${screenPos.y}px) translate(-50%, -50%) scale(${zoom})`,
414
+ width: NODE_CARD_WIDTH,
415
+ minHeight: cardHeight,
416
+ boxShadow: isSelected ? `0 0 0 2px #38bdf8, 4px 4px 0px #000000, 0 0 16px ${sprite.glowColor}` : `4px 4px 0px #000000, 0 0 10px ${isHovered ? sprite.glowColor : "rgba(0,0,0,0.5)"}`
417
+ },
418
+ className: `absolute flex flex-col bg-[#0b0e17]/95 border-2 rounded-none transition-transform select-none cursor-move z-20 ${isSelected ? "border-sky-400 bg-[#0f172a]" : isHovered ? "border-amber-400" : "border-[#334155]"}`,
419
+ children: [
420
+ node.type === "recorder" && node.isArmed ? /* @__PURE__ */ jsx3("div", { className: "w-full px-2 py-1 my-auto", children: /* @__PURE__ */ jsx3(RecorderWaveformDisplay, { node, width: 180 }) }) : /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-center p-3 flex-1 my-auto", children: renderSpriteIcon(sprite.iconName, sprite.accentColor, "w-7 h-7 shrink-0") }),
421
+ children,
422
+ /* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-1 px-1.5 py-1.5 mt-auto border-t border-[#1e293b] bg-black/40", children: Array.from({ length: totalRows }).map((_, rowIdx) => {
423
+ const inSock = sockets.inputs[rowIdx];
424
+ const outSock = sockets.outputs[rowIdx];
425
+ return /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between gap-1 text-[9px] h-5", children: [
426
+ inSock ? /* @__PURE__ */ jsx3(
427
+ Socket2D,
428
+ {
429
+ nodeId: node.id,
430
+ socket: inSock,
431
+ onHover: (info) => onSocketHover?.(info),
432
+ onMouseDown: (nodeId, sock, e) => onSocketMouseDown?.(nodeId, sock, e),
433
+ onMouseUp: (nodeId, sock, e) => onSocketMouseUp?.(nodeId, sock, e)
434
+ }
435
+ ) : /* @__PURE__ */ jsx3("div", {}),
436
+ outSock ? /* @__PURE__ */ jsx3(
437
+ Socket2D,
438
+ {
439
+ nodeId: node.id,
440
+ socket: outSock,
441
+ onHover: (info) => onSocketHover?.(info),
442
+ onMouseDown: (nodeId, sock, e) => onSocketMouseDown?.(nodeId, sock, e),
443
+ onMouseUp: (nodeId, sock, e) => onSocketMouseUp?.(nodeId, sock, e)
444
+ }
445
+ ) : /* @__PURE__ */ jsx3("div", {})
446
+ ] }, `socket-row-${rowIdx}`);
447
+ }) })
448
+ ]
449
+ }
450
+ );
451
+ };
452
+
453
+ // src/graph-2d/NodeRenderer2D.tsx
454
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
157
455
  var TriggerNode2D = (props) => {
158
456
  const trigNode = props.node;
159
457
  const interval = trigNode.intervalBeats || 1;
160
- return /* @__PURE__ */ jsx(
458
+ return /* @__PURE__ */ jsx4(
161
459
  Node2DBase,
162
460
  {
163
461
  ...props,
164
- extraHeaderBadge: /* @__PURE__ */ jsxs("span", { className: "text-[8px] bg-amber-950 border border-amber-500/50 text-amber-300 px-1 py-0.2 rounded font-mono font-bold", children: [
462
+ extraHeaderBadge: /* @__PURE__ */ jsxs4("span", { className: "text-[8px] bg-amber-950 border border-amber-500/50 text-amber-300 px-1 py-0.2 rounded font-mono font-bold", children: [
165
463
  interval,
166
464
  " BEATS"
167
465
  ] })
@@ -175,21 +473,21 @@ var ContainerNode2D = (props) => {
175
473
  if (cType === "audio") {
176
474
  badge = containerNode.audioFormat === "stereo" ? "STEREO" : "MONO";
177
475
  }
178
- return /* @__PURE__ */ jsx(
476
+ return /* @__PURE__ */ jsx4(
179
477
  Node2DBase,
180
478
  {
181
479
  ...props,
182
- extraHeaderBadge: /* @__PURE__ */ jsx("span", { className: "text-[8px] bg-sky-950 border border-sky-500/50 text-sky-300 px-1 py-0.2 rounded font-mono font-bold", children: badge })
480
+ extraHeaderBadge: /* @__PURE__ */ jsx4("span", { className: "text-[8px] bg-sky-950 border border-sky-500/50 text-sky-300 px-1 py-0.2 rounded font-mono font-bold", children: badge })
183
481
  }
184
482
  );
185
483
  };
186
484
  var ModuleNode2D = (props) => {
187
485
  const modNode = props.node;
188
- return /* @__PURE__ */ jsx(
486
+ return /* @__PURE__ */ jsx4(
189
487
  Node2DBase,
190
488
  {
191
489
  ...props,
192
- extraHeaderBadge: /* @__PURE__ */ jsxs("span", { className: "text-[8px] bg-purple-950 border border-purple-600/60 text-purple-300 px-1 py-0.2 rounded font-bold", children: [
490
+ extraHeaderBadge: /* @__PURE__ */ jsxs4("span", { className: "text-[8px] bg-purple-950 border border-purple-600/60 text-purple-300 px-1 py-0.2 rounded font-bold", children: [
193
491
  modNode.innerNodes?.length || 0,
194
492
  " NODES"
195
493
  ] })
@@ -224,32 +522,32 @@ var EffectNode2D = (props) => {
224
522
  badgeText = (effectNode.saturationConfig?.saturationType || "tape").toUpperCase();
225
523
  badgeColor = "bg-rose-950 border-rose-500/50 text-rose-300";
226
524
  }
227
- return /* @__PURE__ */ jsx(
525
+ return /* @__PURE__ */ jsx4(
228
526
  Node2DBase,
229
527
  {
230
528
  ...props,
231
- extraHeaderBadge: /* @__PURE__ */ jsx("span", { className: `text-[8px] ${badgeColor} border px-1 py-0.2 rounded font-mono font-bold uppercase`, children: badgeText })
529
+ extraHeaderBadge: /* @__PURE__ */ jsx4("span", { className: `text-[8px] ${badgeColor} border px-1 py-0.2 rounded font-mono font-bold uppercase`, children: badgeText })
232
530
  }
233
531
  );
234
532
  };
235
533
  var NodeRenderer2D = (props) => {
236
534
  switch (props.node.type) {
237
535
  case "trigger":
238
- return /* @__PURE__ */ jsx(TriggerNode2D, { ...props });
536
+ return /* @__PURE__ */ jsx4(TriggerNode2D, { ...props });
239
537
  case "container":
240
- return /* @__PURE__ */ jsx(ContainerNode2D, { ...props });
538
+ return /* @__PURE__ */ jsx4(ContainerNode2D, { ...props });
241
539
  case "module":
242
- return /* @__PURE__ */ jsx(ModuleNode2D, { ...props });
540
+ return /* @__PURE__ */ jsx4(ModuleNode2D, { ...props });
243
541
  case "effect":
244
- return /* @__PURE__ */ jsx(EffectNode2D, { ...props });
542
+ return /* @__PURE__ */ jsx4(EffectNode2D, { ...props });
245
543
  default:
246
- return /* @__PURE__ */ jsx(Node2DBase, { ...props });
544
+ return /* @__PURE__ */ jsx4(Node2DBase, { ...props });
247
545
  }
248
546
  };
249
547
 
250
548
  // src/graph-2d/Wire2D.tsx
251
- import { SIGNAL_TYPES } from "@ultrst-armada/kloks/state-graph";
252
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
549
+ import { SIGNAL_TYPES as SIGNAL_TYPES2 } from "@ultrst-armada/floks/contracts";
550
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
253
551
  var Wire2D = ({
254
552
  wire,
255
553
  p1,
@@ -263,12 +561,12 @@ var Wire2D = ({
263
561
  onSelect
264
562
  }) => {
265
563
  const { pathD, cp1, cp2 } = wire.calculateCubicBezier2D(p1, p2);
266
- const sigDef = SIGNAL_TYPES[wire.signalType] || SIGNAL_TYPES.trigger;
564
+ const sigDef = SIGNAL_TYPES2[wire.signalType] || SIGNAL_TYPES2.trigger;
267
565
  const wireColor = isSelected ? "#38bdf8" : sigDef.colorStr;
268
566
  const speed = bpm / 60 * 0.4 * wire.flowSpeedMultiplier;
269
567
  const pulseT = pulseAnimTick * 1e-3 * speed % 1;
270
568
  const pulsePoint = wire.calculatePulsePoint2D(pulseT, p1, p2, cp1, cp2);
271
- return /* @__PURE__ */ jsxs2(
569
+ return /* @__PURE__ */ jsxs5(
272
570
  "g",
273
571
  {
274
572
  id: `wire-2d-${wire.id}`,
@@ -278,7 +576,7 @@ var Wire2D = ({
278
576
  onSelect?.(wire.id);
279
577
  },
280
578
  children: [
281
- isEnveloped && /* @__PURE__ */ jsx2(
579
+ isEnveloped && /* @__PURE__ */ jsx5(
282
580
  "path",
283
581
  {
284
582
  d: pathD,
@@ -289,7 +587,7 @@ var Wire2D = ({
289
587
  strokeLinecap: "round"
290
588
  }
291
589
  ),
292
- /* @__PURE__ */ jsx2(
590
+ /* @__PURE__ */ jsx5(
293
591
  "path",
294
592
  {
295
593
  d: pathD,
@@ -298,7 +596,7 @@ var Wire2D = ({
298
596
  strokeWidth: 16 * zoom
299
597
  }
300
598
  ),
301
- /* @__PURE__ */ jsx2(
599
+ /* @__PURE__ */ jsx5(
302
600
  "path",
303
601
  {
304
602
  d: pathD,
@@ -310,7 +608,7 @@ var Wire2D = ({
310
608
  className: "transition-all duration-150 group-hover:stroke-sky-300"
311
609
  }
312
610
  ),
313
- isPlaying && /* @__PURE__ */ jsx2(
611
+ isPlaying && /* @__PURE__ */ jsx5(
314
612
  "circle",
315
613
  {
316
614
  cx: pulsePoint.x,
@@ -327,7 +625,7 @@ var Wire2D = ({
327
625
 
328
626
  // src/graph-2d/CanvasBackground2D.tsx
329
627
  import { useMemo as useMemo2 } from "react";
330
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
628
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
331
629
  var CanvasBackground2D = ({
332
630
  currentBiome = "default",
333
631
  camera,
@@ -361,19 +659,19 @@ var CanvasBackground2D = ({
361
659
  return true;
362
660
  });
363
661
  }, [nodes]);
364
- return /* @__PURE__ */ jsxs3(
662
+ return /* @__PURE__ */ jsxs6(
365
663
  "svg",
366
664
  {
367
665
  className: "absolute inset-0 w-full h-full pointer-events-none",
368
666
  style: { backgroundColor: biome.bg },
369
667
  children: [
370
- /* @__PURE__ */ jsx3("path", { d: gridLines, stroke: biome.gridColor, strokeWidth: 1, fill: "none" }),
668
+ /* @__PURE__ */ jsx6("path", { d: gridLines, stroke: biome.gridColor, strokeWidth: 1, fill: "none" }),
371
669
  uniqueNodes.map((node) => {
372
670
  const screenPos = worldToScreen(node.position[0], node.position[2]);
373
671
  const nodeRadius = node.aoeRadius || node.radius;
374
672
  const radius = (nodeRadius !== void 0 ? nodeRadius * COORD_SCALE : 120) * camera.zoom;
375
673
  if (radius <= 5) return null;
376
- return /* @__PURE__ */ jsx3("g", { opacity: 0.6, children: /* @__PURE__ */ jsx3(
674
+ return /* @__PURE__ */ jsx6("g", { opacity: 0.6, children: /* @__PURE__ */ jsx6(
377
675
  "circle",
378
676
  {
379
677
  cx: screenPos.x,
@@ -393,7 +691,7 @@ var CanvasBackground2D = ({
393
691
 
394
692
  // src/graph-2d/CanvasErrorBoundary.tsx
395
693
  import { Component } from "react";
396
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
694
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
397
695
  var CanvasErrorBoundary = class extends Component {
398
696
  props;
399
697
  state = { hasError: false, errorMessage: "" };
@@ -409,10 +707,10 @@ var CanvasErrorBoundary = class extends Component {
409
707
  }
410
708
  render() {
411
709
  if (this.state.hasError) {
412
- return /* @__PURE__ */ jsx4("div", { className: "w-full h-full flex flex-col items-center justify-center bg-slate-950 p-6 text-center text-slate-300", children: /* @__PURE__ */ jsxs4("div", { className: "max-w-md p-5 rounded-xl border border-red-500/30 bg-red-950/20 backdrop-blur-md", children: [
413
- /* @__PURE__ */ jsx4("h3", { className: "text-sm font-semibold text-red-400 mb-2", children: "2D Graph View Recovered" }),
414
- /* @__PURE__ */ jsx4("p", { className: "text-xs text-slate-400 mb-4 font-mono", children: this.state.errorMessage }),
415
- /* @__PURE__ */ jsx4(
710
+ return /* @__PURE__ */ jsx7("div", { className: "w-full h-full flex flex-col items-center justify-center bg-slate-950 p-6 text-center text-slate-300", children: /* @__PURE__ */ jsxs7("div", { className: "max-w-md p-5 rounded-xl border border-red-500/30 bg-red-950/20 backdrop-blur-md", children: [
711
+ /* @__PURE__ */ jsx7("h3", { className: "text-sm font-semibold text-red-400 mb-2", children: "2D Graph View Recovered" }),
712
+ /* @__PURE__ */ jsx7("p", { className: "text-xs text-slate-400 mb-4 font-mono", children: this.state.errorMessage }),
713
+ /* @__PURE__ */ jsx7(
416
714
  "button",
417
715
  {
418
716
  onClick: () => this.setState({ hasError: false, errorMessage: "" }),
@@ -428,7 +726,7 @@ var CanvasErrorBoundary = class extends Component {
428
726
 
429
727
  // src/graph-2d/MagneticTraces2D.tsx
430
728
  import { Link2 } from "lucide-react";
431
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
729
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
432
730
  var TRACE_COLORS = {
433
731
  AUDIO_STEREO: "#00ffff",
434
732
  AUDIO_MONO: "#38bdf8",
@@ -472,8 +770,8 @@ var MagneticTraces2D = ({
472
770
  return true;
473
771
  });
474
772
  if (visibleTraces.length === 0) return null;
475
- return /* @__PURE__ */ jsxs5("div", { className: "absolute inset-0 pointer-events-none", children: [
476
- /* @__PURE__ */ jsx5("svg", { className: "w-full h-full", children: visibleTraces.map((trace) => {
773
+ return /* @__PURE__ */ jsxs8("div", { className: "absolute inset-0 pointer-events-none", children: [
774
+ /* @__PURE__ */ jsx8("svg", { className: "w-full h-full", children: visibleTraces.map((trace) => {
477
775
  const source = nodeMap.get(trace.sourceNodeId);
478
776
  const target = nodeMap.get(trace.targetNodeId);
479
777
  if (!source || !target) return null;
@@ -481,7 +779,7 @@ var MagneticTraces2D = ({
481
779
  const p2 = getSocketScreenPosition(target, trace.targetHandleId, false, worldToScreen, camera);
482
780
  const color = TRACE_COLORS[trace.wireType] || TRACE_COLORS.DEFAULT;
483
781
  const proximityOpacity = Math.max(0.35, Math.min(0.9, 1 - trace.spatialScore / 360));
484
- return /* @__PURE__ */ jsx5("g", { children: /* @__PURE__ */ jsx5(
782
+ return /* @__PURE__ */ jsx8("g", { children: /* @__PURE__ */ jsx8(
485
783
  "line",
486
784
  {
487
785
  x1: p1.x,
@@ -502,7 +800,7 @@ var MagneticTraces2D = ({
502
800
  const p2 = getSocketScreenPosition(target, trace.targetHandleId, false, worldToScreen, camera);
503
801
  const midX = (p1.x + p2.x) / 2;
504
802
  const midY = (p1.y + p2.y) / 2;
505
- return /* @__PURE__ */ jsx5(
803
+ return /* @__PURE__ */ jsx8(
506
804
  "div",
507
805
  {
508
806
  style: {
@@ -512,7 +810,7 @@ var MagneticTraces2D = ({
512
810
  transform: "translate(-50%, -50%)"
513
811
  },
514
812
  className: "pointer-events-auto z-20 group",
515
- children: /* @__PURE__ */ jsx5(
813
+ children: /* @__PURE__ */ jsx8(
516
814
  "button",
517
815
  {
518
816
  onMouseDown: (e) => {
@@ -529,7 +827,7 @@ var MagneticTraces2D = ({
529
827
  },
530
828
  className: "w-7 h-7 rounded-full bg-slate-950 border-2 border-cyan-400/80 text-cyan-300 hover:text-white hover:bg-cyan-950 hover:border-cyan-200 hover:scale-125 shadow-[0_0_12px_rgba(6,182,212,0.6)] flex items-center justify-center transition-all cursor-pointer group/btn",
531
829
  title: `Solidify magnetic connection: ${trace.sourceHandleId} -> ${trace.targetHandleId}`,
532
- children: /* @__PURE__ */ jsx5(Link2, { className: "w-3.5 h-3.5 text-cyan-400 group-hover/btn:scale-110" })
830
+ children: /* @__PURE__ */ jsx8(Link2, { className: "w-3.5 h-3.5 text-cyan-400 group-hover/btn:scale-110" })
533
831
  }
534
832
  )
535
833
  },
@@ -540,10 +838,10 @@ var MagneticTraces2D = ({
540
838
  };
541
839
 
542
840
  // src/graph-2d/RotaryKnob.tsx
543
- import { useRef as useRef3, useCallback as useCallback3, useState as useState3 } from "react";
544
- import { describeSvgArc } from "@ultrst-armada/kloks/state-graph";
841
+ import { useRef as useRef4, useCallback as useCallback3, useState as useState4 } from "react";
842
+ import { describeSvgArc } from "@ultrst-armada/floks/contracts";
545
843
  import { usePalette } from "@ultrst-armada/floks/ui";
546
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
844
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
547
845
  function RotaryKnob({
548
846
  value,
549
847
  min = 0,
@@ -564,12 +862,12 @@ function RotaryKnob({
564
862
  const palette = usePalette();
565
863
  const effectiveColor = color || palette.accentPrimary;
566
864
  const effectiveTrackColor = trackColor || palette.borderSubtle;
567
- const knobRef = useRef3(null);
568
- const isDraggingRef = useRef3(false);
569
- const startYRef = useRef3(0);
570
- const startValRef = useRef3(value);
571
- const [isHovered, setIsHovered] = useState3(false);
572
- const [isEngaged, setIsEngaged] = useState3(false);
865
+ const knobRef = useRef4(null);
866
+ const isDraggingRef = useRef4(false);
867
+ const startYRef = useRef4(0);
868
+ const startValRef = useRef4(value);
869
+ const [isHovered, setIsHovered] = useState4(false);
870
+ const [isEngaged, setIsEngaged] = useState4(false);
573
871
  const clampedVal = Math.min(max, Math.max(min, value));
574
872
  const range = max - min || 1;
575
873
  const normalized = (clampedVal - min) / range;
@@ -624,7 +922,7 @@ function RotaryKnob({
624
922
  if (newVal !== clampedVal) onChange(newVal);
625
923
  };
626
924
  const formattedDisplay = formatValue ? formatValue(clampedVal) : unit === "%" ? `${Math.round(clampedVal * 100)}%` : unit ? `${clampedVal.toFixed(step && step < 0.1 ? 2 : 1)}${unit}` : typeof clampedVal === "number" && Number.isInteger(clampedVal) ? `${clampedVal}` : `${clampedVal.toFixed(2)}`;
627
- return /* @__PURE__ */ jsxs6(
925
+ return /* @__PURE__ */ jsxs9(
628
926
  "div",
629
927
  {
630
928
  className: `inline-flex flex-col items-center select-none font-mono ${disabled ? "opacity-40 cursor-not-allowed" : "cursor-ns-resize"} ${className}`,
@@ -632,8 +930,8 @@ function RotaryKnob({
632
930
  onMouseEnter: () => setIsHovered(true),
633
931
  onMouseLeave: () => setIsHovered(false),
634
932
  children: [
635
- label && /* @__PURE__ */ jsx6("span", { style: { color: palette.textMuted }, className: "text-[9px] uppercase font-bold tracking-wider mb-1 text-center truncate max-w-[80px]", children: label }),
636
- /* @__PURE__ */ jsxs6(
933
+ label && /* @__PURE__ */ jsx9("span", { style: { color: palette.textMuted }, className: "text-[9px] uppercase font-bold tracking-wider mb-1 text-center truncate max-w-[80px]", children: label }),
934
+ /* @__PURE__ */ jsxs9(
637
935
  "div",
638
936
  {
639
937
  ref: knobRef,
@@ -651,9 +949,9 @@ function RotaryKnob({
651
949
  style: { width: size, height: size },
652
950
  className: "relative flex items-center justify-center touch-none group",
653
951
  children: [
654
- /* @__PURE__ */ jsxs6("svg", { width: size, height: size, className: "overflow-visible", children: [
655
- /* @__PURE__ */ jsx6("path", { d: bgArc, fill: "none", stroke: effectiveTrackColor, strokeWidth, strokeLinecap: "round" }),
656
- normalized > 5e-3 && /* @__PURE__ */ jsx6(
952
+ /* @__PURE__ */ jsxs9("svg", { width: size, height: size, className: "overflow-visible", children: [
953
+ /* @__PURE__ */ jsx9("path", { d: bgArc, fill: "none", stroke: effectiveTrackColor, strokeWidth, strokeLinecap: "round" }),
954
+ normalized > 5e-3 && /* @__PURE__ */ jsx9(
657
955
  "path",
658
956
  {
659
957
  d: valArc,
@@ -666,7 +964,7 @@ function RotaryKnob({
666
964
  }
667
965
  )
668
966
  ] }),
669
- /* @__PURE__ */ jsx6(
967
+ /* @__PURE__ */ jsx9(
670
968
  "div",
671
969
  {
672
970
  style: {
@@ -677,7 +975,7 @@ function RotaryKnob({
677
975
  backgroundColor: palette.bgSurface
678
976
  },
679
977
  className: "absolute rounded-full border flex items-start justify-center transition-colors duration-150",
680
- children: /* @__PURE__ */ jsx6(
978
+ children: /* @__PURE__ */ jsx9(
681
979
  "div",
682
980
  {
683
981
  style: {
@@ -694,7 +992,7 @@ function RotaryKnob({
694
992
  ]
695
993
  }
696
994
  ),
697
- /* @__PURE__ */ jsx6("span", { style: { color: isEngaged ? effectiveColor : palette.textSecondary }, className: "text-[10px] font-bold mt-1 text-center transition-colors", children: formattedDisplay })
995
+ /* @__PURE__ */ jsx9("span", { style: { color: isEngaged ? effectiveColor : palette.textSecondary }, className: "text-[10px] font-bold mt-1 text-center transition-colors", children: formattedDisplay })
698
996
  ]
699
997
  }
700
998
  );
@@ -705,6 +1003,12 @@ export {
705
1003
  BIOME_CONFIGS,
706
1004
  useCanvas2DCoordinates,
707
1005
  useCanvas2DMagnetic,
1006
+ Socket2D,
1007
+ RecorderWaveformDisplay,
1008
+ NODE_CARD_WIDTH,
1009
+ SOCKET_ROW_HEIGHT,
1010
+ renderSpriteIcon,
1011
+ Node2DBase,
708
1012
  TriggerNode2D,
709
1013
  ContainerNode2D,
710
1014
  ModuleNode2D,
@@ -1,6 +1,6 @@
1
1
  // src/predictive/usePredictiveGraph2D.ts
2
2
  import { useState, useEffect, useMemo, useCallback } from "react";
3
- import { computePredictiveGraph } from "@ultrst-armada/kloks/state-graph";
3
+ import { computePredictiveGraph } from "@ultrst-armada/floks/contracts";
4
4
  function usePredictiveGraph2D({
5
5
  nodes,
6
6
  connections,