@ultrst-armada/floks 1.13.21 → 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.
- package/.krusbl-release-attestation.json +3 -3
- package/package.json +8 -7
- package/packages/canvas-ui/dist/MovableSocketView.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeCard.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeDetailsPanel.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeGraphCanvas.d.ts +1 -1
- package/packages/canvas-ui/dist/Viewer2DNodes.d.ts +1 -1
- package/packages/canvas-ui/dist/WireRenderer.d.ts +1 -1
- package/packages/canvas-ui/dist/authoring/UiAuthoringValidationPanel.d.ts +1 -1
- package/packages/canvas-ui/dist/{chunk-RH5NINIT.js → chunk-A7BSZ5QO.js} +28 -103
- package/packages/canvas-ui/dist/chunk-FPRATI44.js +45 -0
- package/packages/canvas-ui/dist/{chunk-ZJXRL74D.js → chunk-KAKAFGVH.js} +22 -16
- package/packages/canvas-ui/dist/{chunk-YHEIL67R.js → chunk-SRGVIYC5.js} +6 -6
- package/packages/canvas-ui/dist/{chunk-7CYX3B6O.js → chunk-TKOMIUCU.js} +1 -1
- package/packages/canvas-ui/dist/{chunk-XVAHT5WE.js → chunk-ZDADZVQ2.js} +363 -59
- package/packages/canvas-ui/dist/{chunk-QRYNQ36L.js → chunk-ZSVXR3HU.js} +1 -1
- package/packages/canvas-ui/dist/editor/MonacoEditor.d.ts +1 -1
- package/packages/canvas-ui/dist/editor/index.js +1 -1
- package/packages/canvas-ui/dist/fod/index.js +3 -3
- package/packages/canvas-ui/dist/frnl-editable-node-graph/FrnlEditableNodeGraph.d.ts +1 -1
- package/packages/canvas-ui/dist/frnl-editable-node-graph/index.js +2 -2
- package/packages/canvas-ui/dist/graph-2d/CanvasBackground2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/MagneticTraces2D.d.ts +2 -2
- package/packages/canvas-ui/dist/graph-2d/Node2DBase.d.ts +3 -3
- package/packages/canvas-ui/dist/graph-2d/NodeRenderer2D.d.ts +3 -3
- package/packages/canvas-ui/dist/graph-2d/RecorderWaveformDisplay.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/Socket2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/Wire2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/index.js +9 -9
- package/packages/canvas-ui/dist/graph-2d/socketCoordinates.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/types.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/useCanvas2DMagnetic.d.ts +4 -4
- package/packages/canvas-ui/dist/index.js +38 -38
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostNodeCard.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostSolidifyBar.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostTraceLayer.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/react-flow/ReactFlowAdapter.d.ts +4 -4
- package/packages/canvas-ui/dist/node-graph-ui/toolbar/GraphToolbar.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/CanvasContextMenu.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/CompatibleNodePicker.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/MagneticTraceLayer.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/NodeSearchPalette.d.ts +1 -1
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/PredictiveGhostNodeCard.d.ts +2 -2
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/types.d.ts +1 -1
- package/packages/canvas-ui/dist/predictive/PredictiveLayer2D.d.ts +1 -2
- package/packages/canvas-ui/dist/predictive/index.js +3 -3
- package/packages/canvas-ui/dist/predictive/usePredictiveGraph2D.d.ts +4 -5
- package/packages/canvas-ui/dist/useGhostRouting.d.ts +1 -1
- package/packages/canvas-ui/dist/useNodeGraph.d.ts +1 -1
- package/packages/canvas-ui/package.json +5 -6
- package/packages/contracts/dist/index.d.ts +396 -1
- package/packages/contracts/dist/index.js +201 -1
- package/packages/contracts/dist/state-graph.d.ts +456 -0
- package/packages/contracts/dist/state-graph.js +282 -0
- package/packages/contracts/package.json +6 -1
- package/packages/ui/dist/{chunk-3YYPBZS2.js → chunk-W6ENIFEW.js} +3 -3
- package/packages/ui/dist/components/auth/LuthAuthClient.d.ts +4 -4
- package/packages/ui/dist/components/auth/index.js +1 -1
- package/packages/ui/dist/components/auth/luthAuthTypes.d.ts +2 -2
- package/packages/ui/dist/index.js +1 -1
- package/packages/ui/package.json +3 -3
- package/packages/canvas-ui/dist/chunk-U2SC3RMJ.js +0 -391
|
@@ -541,4 +541,399 @@ declare const floksPromotionContract: {
|
|
|
541
541
|
readonly requiredEvidence: readonly ["sourceRepository", "sourceCommit", "verificationId"];
|
|
542
542
|
};
|
|
543
543
|
|
|
544
|
-
|
|
544
|
+
type MonacoDiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
545
|
+
interface MonacoDiagnostic {
|
|
546
|
+
message: string;
|
|
547
|
+
severity: MonacoDiagnosticSeverity;
|
|
548
|
+
startLineNumber: number;
|
|
549
|
+
startColumn: number;
|
|
550
|
+
endLineNumber: number;
|
|
551
|
+
endColumn: number;
|
|
552
|
+
code?: string;
|
|
553
|
+
}
|
|
554
|
+
interface MonacoDocument {
|
|
555
|
+
uri: string;
|
|
556
|
+
language: string;
|
|
557
|
+
value: string;
|
|
558
|
+
version: number;
|
|
559
|
+
diagnostics: MonacoDiagnostic[];
|
|
560
|
+
}
|
|
561
|
+
interface MonacoCompletionItem {
|
|
562
|
+
label: string;
|
|
563
|
+
insertText?: string;
|
|
564
|
+
detail?: string;
|
|
565
|
+
documentation?: string;
|
|
566
|
+
kind?: string;
|
|
567
|
+
sortText?: string;
|
|
568
|
+
}
|
|
569
|
+
interface MonacoCompletionRequest {
|
|
570
|
+
sessionId: string;
|
|
571
|
+
uri: string;
|
|
572
|
+
language: string;
|
|
573
|
+
value: string;
|
|
574
|
+
position: {
|
|
575
|
+
lineNumber: number;
|
|
576
|
+
column: number;
|
|
577
|
+
offset: number;
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
type MonacoCompletionProvider = (request: MonacoCompletionRequest) => Promise<MonacoCompletionItem[]>;
|
|
581
|
+
|
|
582
|
+
type SocketType = 'input' | 'output';
|
|
583
|
+
interface Socket {
|
|
584
|
+
id: string;
|
|
585
|
+
label: string;
|
|
586
|
+
type: SocketType;
|
|
587
|
+
dataType?: string;
|
|
588
|
+
direction?: string;
|
|
589
|
+
offset?: {
|
|
590
|
+
x: number;
|
|
591
|
+
y: number;
|
|
592
|
+
};
|
|
593
|
+
[key: string]: any;
|
|
594
|
+
}
|
|
595
|
+
interface GraphNode {
|
|
596
|
+
id: string;
|
|
597
|
+
type: string;
|
|
598
|
+
label?: string;
|
|
599
|
+
name?: string;
|
|
600
|
+
position: {
|
|
601
|
+
x: number;
|
|
602
|
+
y: number;
|
|
603
|
+
};
|
|
604
|
+
width?: number;
|
|
605
|
+
height?: number;
|
|
606
|
+
inputs?: Socket[];
|
|
607
|
+
outputs?: Socket[];
|
|
608
|
+
[key: string]: any;
|
|
609
|
+
}
|
|
610
|
+
interface GraphEdge {
|
|
611
|
+
id: string;
|
|
612
|
+
source: string;
|
|
613
|
+
sourceSocket: string;
|
|
614
|
+
target: string;
|
|
615
|
+
targetSocket: string;
|
|
616
|
+
label?: string;
|
|
617
|
+
color?: string;
|
|
618
|
+
wireType?: string;
|
|
619
|
+
locked?: boolean;
|
|
620
|
+
[key: string]: any;
|
|
621
|
+
}
|
|
622
|
+
interface ViewportState {
|
|
623
|
+
panX: number;
|
|
624
|
+
panY: number;
|
|
625
|
+
zoom: number;
|
|
626
|
+
}
|
|
627
|
+
interface NodeGraphConfig {
|
|
628
|
+
minZoom?: number;
|
|
629
|
+
maxZoom?: number;
|
|
630
|
+
gridSize?: number;
|
|
631
|
+
snapToGrid?: boolean;
|
|
632
|
+
wireStyle?: 'bezier' | 'straight' | 'step';
|
|
633
|
+
tracingEnabled?: boolean;
|
|
634
|
+
magneticTracesEnabled?: boolean;
|
|
635
|
+
autoSolidify?: boolean;
|
|
636
|
+
traceCutoffDistance?: number;
|
|
637
|
+
ghostRoutingEnabled?: boolean;
|
|
638
|
+
ghostScenarioCount?: number;
|
|
639
|
+
ghostDecayMs?: number;
|
|
640
|
+
}
|
|
641
|
+
interface NodeDefinition {
|
|
642
|
+
type: string;
|
|
643
|
+
label: string;
|
|
644
|
+
description?: string;
|
|
645
|
+
category?: string;
|
|
646
|
+
inputs?: Array<{
|
|
647
|
+
id: string;
|
|
648
|
+
label?: string;
|
|
649
|
+
dataType?: string;
|
|
650
|
+
[key: string]: any;
|
|
651
|
+
}>;
|
|
652
|
+
outputs?: Array<{
|
|
653
|
+
id: string;
|
|
654
|
+
label?: string;
|
|
655
|
+
dataType?: string;
|
|
656
|
+
[key: string]: any;
|
|
657
|
+
}>;
|
|
658
|
+
[key: string]: any;
|
|
659
|
+
}
|
|
660
|
+
interface NodeSocketDescriptor extends Socket {
|
|
661
|
+
socketId?: string;
|
|
662
|
+
handleCategory?: string;
|
|
663
|
+
signalType?: string;
|
|
664
|
+
polarity?: string;
|
|
665
|
+
[key: string]: any;
|
|
666
|
+
}
|
|
667
|
+
interface NodeSocketsResult {
|
|
668
|
+
inputs: NodeSocketDescriptor[];
|
|
669
|
+
outputs: NodeSocketDescriptor[];
|
|
670
|
+
[key: string]: any;
|
|
671
|
+
}
|
|
672
|
+
interface SpaceNode extends GraphNode {
|
|
673
|
+
position: any;
|
|
674
|
+
}
|
|
675
|
+
interface ContainerNode extends SpaceNode {
|
|
676
|
+
containerType?: string;
|
|
677
|
+
audioFormat?: string;
|
|
678
|
+
}
|
|
679
|
+
interface ModuleNode extends SpaceNode {
|
|
680
|
+
innerNodes?: SpaceNode[];
|
|
681
|
+
}
|
|
682
|
+
interface TriggerNode extends SpaceNode {
|
|
683
|
+
intervalBeats?: number;
|
|
684
|
+
}
|
|
685
|
+
interface EffectNode extends SpaceNode {
|
|
686
|
+
radius?: number;
|
|
687
|
+
effectType?: string;
|
|
688
|
+
compressorConfig?: any;
|
|
689
|
+
multibandCompressorConfig?: any;
|
|
690
|
+
limiterConfig?: any;
|
|
691
|
+
reverbConfig?: any;
|
|
692
|
+
delayConfig?: any;
|
|
693
|
+
saturationConfig?: any;
|
|
694
|
+
}
|
|
695
|
+
interface RecorderNode extends SpaceNode {
|
|
696
|
+
isArmed?: boolean;
|
|
697
|
+
recordingMode?: string;
|
|
698
|
+
isRecording?: boolean;
|
|
699
|
+
peaks?: number[];
|
|
700
|
+
}
|
|
701
|
+
interface Node2DSpriteSetting {
|
|
702
|
+
spriteName: string;
|
|
703
|
+
iconName: string;
|
|
704
|
+
accentColor: string;
|
|
705
|
+
glowColor: string;
|
|
706
|
+
[key: string]: any;
|
|
707
|
+
}
|
|
708
|
+
interface NodeConnection {
|
|
709
|
+
id?: string;
|
|
710
|
+
fromNodeId: string;
|
|
711
|
+
toNodeId: string;
|
|
712
|
+
fromSocketId?: string;
|
|
713
|
+
toSocketId?: string;
|
|
714
|
+
fromPort?: string;
|
|
715
|
+
toPort?: string;
|
|
716
|
+
[key: string]: any;
|
|
717
|
+
}
|
|
718
|
+
interface SolidConnection extends NodeConnection {
|
|
719
|
+
}
|
|
720
|
+
interface ViewLink {
|
|
721
|
+
[key: string]: any;
|
|
722
|
+
}
|
|
723
|
+
interface Trace {
|
|
724
|
+
id: string;
|
|
725
|
+
sourceNodeId: string;
|
|
726
|
+
targetNodeId: string;
|
|
727
|
+
sourceHandleId: string;
|
|
728
|
+
targetHandleId: string;
|
|
729
|
+
wireType: string;
|
|
730
|
+
spatialScore: number;
|
|
731
|
+
[key: string]: any;
|
|
732
|
+
}
|
|
733
|
+
interface Landmark {
|
|
734
|
+
id: string;
|
|
735
|
+
name?: string;
|
|
736
|
+
camera?: any;
|
|
737
|
+
[key: string]: any;
|
|
738
|
+
}
|
|
739
|
+
interface MagneticTraceRecord {
|
|
740
|
+
id: string;
|
|
741
|
+
sourceNodeId: string;
|
|
742
|
+
sourceSocketId: string;
|
|
743
|
+
targetNodeId: string;
|
|
744
|
+
targetSocketId: string;
|
|
745
|
+
wireType: string;
|
|
746
|
+
color: string;
|
|
747
|
+
pathD: string;
|
|
748
|
+
midpoint: {
|
|
749
|
+
x: number;
|
|
750
|
+
y: number;
|
|
751
|
+
};
|
|
752
|
+
distance: number;
|
|
753
|
+
}
|
|
754
|
+
interface GhostNodeRecord {
|
|
755
|
+
[key: string]: any;
|
|
756
|
+
}
|
|
757
|
+
interface GhostTraceRecord {
|
|
758
|
+
[key: string]: any;
|
|
759
|
+
}
|
|
760
|
+
interface PredictiveGhostNode {
|
|
761
|
+
[key: string]: any;
|
|
762
|
+
}
|
|
763
|
+
interface PredictiveTrace {
|
|
764
|
+
[key: string]: any;
|
|
765
|
+
}
|
|
766
|
+
interface GraphSettings {
|
|
767
|
+
[key: string]: any;
|
|
768
|
+
}
|
|
769
|
+
interface UniversalSocketDefinition {
|
|
770
|
+
[key: string]: any;
|
|
771
|
+
}
|
|
772
|
+
interface BaseViewWindow {
|
|
773
|
+
[key: string]: any;
|
|
774
|
+
}
|
|
775
|
+
interface UIAuthoringValidation {
|
|
776
|
+
[key: string]: any;
|
|
777
|
+
}
|
|
778
|
+
declare class BaseNode {
|
|
779
|
+
[key: string]: any;
|
|
780
|
+
constructor(props?: Record<string, any>);
|
|
781
|
+
}
|
|
782
|
+
declare class GraphNodeParent extends BaseNode {
|
|
783
|
+
static calculateConstrainedSocketOffset(node: any, _socketId: string, isOutput: boolean, index: number, total: number, clearance?: number): {
|
|
784
|
+
x: number;
|
|
785
|
+
y: number;
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
declare class GraphWireParent {
|
|
789
|
+
[key: string]: any;
|
|
790
|
+
constructor(props?: Record<string, any>);
|
|
791
|
+
}
|
|
792
|
+
declare const SIGNAL_TYPES: {
|
|
793
|
+
readonly AUDIO_STEREO: {
|
|
794
|
+
readonly colorStr: "#00ffff";
|
|
795
|
+
};
|
|
796
|
+
readonly AUDIO_MONO: {
|
|
797
|
+
readonly colorStr: "#38bdf8";
|
|
798
|
+
};
|
|
799
|
+
readonly AUDIO_PACKET: {
|
|
800
|
+
readonly colorStr: "#818cf8";
|
|
801
|
+
};
|
|
802
|
+
readonly TRIGGER: {
|
|
803
|
+
readonly colorStr: "#eab308";
|
|
804
|
+
};
|
|
805
|
+
readonly MIDI_STREAM: {
|
|
806
|
+
readonly colorStr: "#ec4899";
|
|
807
|
+
};
|
|
808
|
+
readonly MIDI_PACKET: {
|
|
809
|
+
readonly colorStr: "#f43f5e";
|
|
810
|
+
};
|
|
811
|
+
readonly CURVE_STREAM: {
|
|
812
|
+
readonly colorStr: "#10b981";
|
|
813
|
+
};
|
|
814
|
+
readonly CURVE_PACKET: {
|
|
815
|
+
readonly colorStr: "#34d399";
|
|
816
|
+
};
|
|
817
|
+
readonly COMPONENT: {
|
|
818
|
+
readonly colorStr: "#a855f7";
|
|
819
|
+
};
|
|
820
|
+
readonly trigger: {
|
|
821
|
+
readonly colorStr: "#eab308";
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
declare function canvasToScreen(x: number, y: number, v: ViewportState): {
|
|
825
|
+
x: number;
|
|
826
|
+
y: number;
|
|
827
|
+
};
|
|
828
|
+
declare function zoomAtPoint(mx: number, my: number, d: number, v: ViewportState, c?: NodeGraphConfig): {
|
|
829
|
+
zoom: number;
|
|
830
|
+
panX: number;
|
|
831
|
+
panY: number;
|
|
832
|
+
};
|
|
833
|
+
declare function isNodeInCenterDeadZone(n: GraphNode, v: ViewportState, w: number, h: number, r?: number): boolean;
|
|
834
|
+
declare function getCenterPanForNode(n: GraphNode, v: ViewportState, w: number, h: number): {
|
|
835
|
+
panX: number;
|
|
836
|
+
panY: number;
|
|
837
|
+
};
|
|
838
|
+
declare function getNodesInSelection(sx: number, sy: number, ex: number, ey: number, nodes: GraphNode[], v: ViewportState): string[];
|
|
839
|
+
declare function calculateSocketCoordinates(baseY: number, o: {
|
|
840
|
+
cardWidth: number;
|
|
841
|
+
cardHeight?: number;
|
|
842
|
+
isOutput: boolean;
|
|
843
|
+
clearance?: number;
|
|
844
|
+
nudge?: {
|
|
845
|
+
x: number;
|
|
846
|
+
y: number;
|
|
847
|
+
};
|
|
848
|
+
}): {
|
|
849
|
+
baseX: number;
|
|
850
|
+
effectiveX: number;
|
|
851
|
+
effectiveY: number;
|
|
852
|
+
nudge: {
|
|
853
|
+
x: number;
|
|
854
|
+
y: number;
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
declare const getBeamPoints: (n: {
|
|
858
|
+
x: number;
|
|
859
|
+
y: number;
|
|
860
|
+
}, bw?: number, hw?: number) => string;
|
|
861
|
+
declare function describeSvgArc(x1: number, y1: number, x2: number, y2: number, r: number): string;
|
|
862
|
+
declare function getNodeSockets(n: SpaceNode): NodeSocketsResult;
|
|
863
|
+
declare class ConnectionRuleStore {
|
|
864
|
+
private static ready;
|
|
865
|
+
private static defs;
|
|
866
|
+
static isInitialized(): boolean;
|
|
867
|
+
static initializeDefaults(): void;
|
|
868
|
+
static registerNodeType(d: NodeDefinition): void;
|
|
869
|
+
static getNodeType(t: string): NodeDefinition;
|
|
870
|
+
static listNodeTypes(): NodeDefinition[];
|
|
871
|
+
static getCompatibleNodeTypes(source: any, defs?: NodeDefinition[]): NodeDefinition[];
|
|
872
|
+
static canConnect(a: any, b: any): boolean;
|
|
873
|
+
}
|
|
874
|
+
declare class MagneticGraphManager {
|
|
875
|
+
cutoffDistance: number;
|
|
876
|
+
private landmarks;
|
|
877
|
+
constructor(cutoffDistance?: number);
|
|
878
|
+
computeTraces(nodes: SpaceNode[]): Trace[];
|
|
879
|
+
resolveAutoSolidification(nodes: SpaceNode[], traces: Trace[], connections: NodeConnection[]): Trace[];
|
|
880
|
+
saveLandmark(name: string, camera: any): any;
|
|
881
|
+
getLandmarks(): Landmark[];
|
|
882
|
+
}
|
|
883
|
+
declare class GhostStore {
|
|
884
|
+
private static instance;
|
|
885
|
+
ghostNodes: any[];
|
|
886
|
+
ghostTraces: any[];
|
|
887
|
+
selectedNodeIds: string[];
|
|
888
|
+
scenarioIndex: number;
|
|
889
|
+
hoveredGhostId: string | null;
|
|
890
|
+
isActive: boolean;
|
|
891
|
+
private listeners;
|
|
892
|
+
static getInstance(): GhostStore;
|
|
893
|
+
subscribe(cb: () => void): () => void;
|
|
894
|
+
private emit;
|
|
895
|
+
setPredictions(nodes: any[], traces: any[], selected: string[]): void;
|
|
896
|
+
getActiveGhostNodes(): any[];
|
|
897
|
+
getActiveGhostTraces(): any[];
|
|
898
|
+
setHoveredGhostId(id: string | null): void;
|
|
899
|
+
cycleScenario(count?: number): void;
|
|
900
|
+
clear(): void;
|
|
901
|
+
}
|
|
902
|
+
declare function inferGhostNodes(nodes: GraphNode[], defs: NodeDefinition[], options: {
|
|
903
|
+
scenarioCount: number;
|
|
904
|
+
}): {
|
|
905
|
+
id: string;
|
|
906
|
+
nodeType: string;
|
|
907
|
+
label: string;
|
|
908
|
+
position: {
|
|
909
|
+
x: number;
|
|
910
|
+
y: number;
|
|
911
|
+
};
|
|
912
|
+
size: {
|
|
913
|
+
width: number;
|
|
914
|
+
height: number;
|
|
915
|
+
};
|
|
916
|
+
inputs: {
|
|
917
|
+
[key: string]: any;
|
|
918
|
+
id: string;
|
|
919
|
+
label?: string;
|
|
920
|
+
dataType?: string;
|
|
921
|
+
}[];
|
|
922
|
+
outputs: {
|
|
923
|
+
[key: string]: any;
|
|
924
|
+
id: string;
|
|
925
|
+
label?: string;
|
|
926
|
+
dataType?: string;
|
|
927
|
+
}[];
|
|
928
|
+
sourceNodeId: string;
|
|
929
|
+
socketMappings: any[];
|
|
930
|
+
}[];
|
|
931
|
+
declare function resolveGhostLayout(ghosts: any[], _nodes: GraphNode[], _defs: NodeDefinition[]): any[];
|
|
932
|
+
declare function buildGhostTraces(_ghosts: any[], _nodes: GraphNode[]): any[];
|
|
933
|
+
declare function computePredictiveGraph(nodes: SpaceNode[], _connections: NodeConnection[], scenarioIndex?: number): {
|
|
934
|
+
ghostNodes: any[];
|
|
935
|
+
traces: any[];
|
|
936
|
+
selectedNodesWithGhosts: Map<string, any[]>;
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
export { BaseNode, type BaseViewWindow, type ComponentThemeContract, ComponentThemeContractSchema, ConnectionRuleStore, type ContainerNode, type ContractDiffResult, type EffectNode, FLOKS_CANONICAL_CONTRACT, FLOKS_COMPONENT_REGISTRY, FLOKS_PUBLIC_SYMBOLS, type FloksContractSnapshot, FloksContractSnapshotSchema, type FloksPromotionKind, type FloksPromotionRequest, type FloksPromotionResult, type FrnlThemeDefinition, type FrnlThemeState, type GhostNodeRecord, GhostStore, type GhostTraceRecord, type GraphEdge, type GraphNode, GraphNodeParent, type GraphSettings, GraphWireParent, type Landmark, MagneticGraphManager, type MagneticTraceRecord, type ModuleNode, type MonacoCompletionItem, type MonacoCompletionProvider, type MonacoCompletionRequest, type MonacoDiagnostic, type MonacoDiagnosticSeverity, type MonacoDocument, type Node2DSpriteSetting, type NodeConnection, type NodeDefinition, type NodeGraphConfig, type NodeSocketDescriptor, type NodeSocketsResult, type PredictiveGhostNode, type PredictiveTrace, type RecorderNode, SIGNAL_TYPES, type Socket, type SocketType, type SolidConnection, type SpaceNode, type ThemePack, ThemePackSchema, type ThemePackSlotBinding, ThemePackSlotBindingSchema, type ThemePackStateMapping, ThemePackStateMappingSchema, type ThemeTarget, ThemeTargetSchema, type ThemeValidationResult, type Trace, type TriggerNode, type UIAuthoringValidation, type UniversalSocketDefinition, type ViewLink, type ViewportState, type VisualParameter, VisualParameterSchema, type VisualSlot, VisualSlotSchema, type VisualState, VisualStateSchema, buildGhostTraces, calculateSocketCoordinates, canvasToScreen, computePredictiveGraph, createFloksSnapshot, describeSvgArc, diffContractSnapshots, floksPromotionContract, getBeamPoints, getCenterPanForNode, getComponentContract, getNodeSockets, getNodesInSelection, inferGhostNodes, isNodeInCenterDeadZone, listComponentContracts, loadThemePack, resolveGhostLayout, themePackToFrnlTheme, validateThemePackAgainstContract, zoomAtPoint };
|
|
@@ -496,12 +496,199 @@ var floksPromotionContract = {
|
|
|
496
496
|
id: "floks.krusbl-promotion",
|
|
497
497
|
requiredEvidence: ["sourceRepository", "sourceCommit", "verificationId"]
|
|
498
498
|
};
|
|
499
|
+
|
|
500
|
+
// src/graph.ts
|
|
501
|
+
var BaseNode = class {
|
|
502
|
+
constructor(props = {}) {
|
|
503
|
+
Object.assign(this, props);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
var GraphNodeParent = class extends BaseNode {
|
|
507
|
+
static calculateConstrainedSocketOffset(node, _socketId, isOutput, index, total, clearance = 14) {
|
|
508
|
+
const w = Number(node.width ?? node.size?.width ?? 150) / 2;
|
|
509
|
+
const h = Number(node.height ?? node.size?.height ?? 100);
|
|
510
|
+
const pitch = Math.min(40, Math.max(60, h * 2 - 40) / Math.max(1, total));
|
|
511
|
+
return { x: isOutput ? w + clearance : -w - clearance, y: (index - (Math.max(1, total) - 1) / 2) * pitch };
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
var GraphWireParent = class {
|
|
515
|
+
constructor(props = {}) {
|
|
516
|
+
Object.assign(this, props);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
var SIGNAL_TYPES = { AUDIO_STEREO: { colorStr: "#00ffff" }, AUDIO_MONO: { colorStr: "#38bdf8" }, AUDIO_PACKET: { colorStr: "#818cf8" }, TRIGGER: { colorStr: "#eab308" }, MIDI_STREAM: { colorStr: "#ec4899" }, MIDI_PACKET: { colorStr: "#f43f5e" }, CURVE_STREAM: { colorStr: "#10b981" }, CURVE_PACKET: { colorStr: "#34d399" }, COMPONENT: { colorStr: "#a855f7" }, trigger: { colorStr: "#eab308" } };
|
|
520
|
+
function canvasToScreen(x, y, v) {
|
|
521
|
+
return { x: x * v.zoom + v.panX, y: y * v.zoom + v.panY };
|
|
522
|
+
}
|
|
523
|
+
function zoomAtPoint(mx, my, d, v, c = {}) {
|
|
524
|
+
const z3 = Math.max(c.minZoom ?? 0.25, Math.min(c.maxZoom ?? 2.5, v.zoom + d));
|
|
525
|
+
const gx = (mx - v.panX) / v.zoom, gy = (my - v.panY) / v.zoom;
|
|
526
|
+
return { zoom: z3, panX: mx - gx * z3, panY: my - gy * z3 };
|
|
527
|
+
}
|
|
528
|
+
function isNodeInCenterDeadZone(n, v, w, h, r = 0.35) {
|
|
529
|
+
const x = (n.position.x + (n.width ?? 130) / 2) * v.zoom + v.panX, y = (n.position.y + (n.height ?? 130) / 2) * v.zoom + v.panY;
|
|
530
|
+
return Math.hypot(x - w / 2, y - h / 2) <= Math.min(w, h) * r;
|
|
531
|
+
}
|
|
532
|
+
function getCenterPanForNode(n, v, w, h) {
|
|
533
|
+
return { panX: Math.round(w / 2 - (n.position.x + (n.width ?? 130) / 2) * v.zoom), panY: Math.round(h / 2 - (n.position.y + (n.height ?? 130) / 2) * v.zoom) };
|
|
534
|
+
}
|
|
535
|
+
function getNodesInSelection(sx, sy, ex, ey, nodes, v) {
|
|
536
|
+
const a = (sx - v.panX) / v.zoom, b = (sy - v.panY) / v.zoom, c = (ex - v.panX) / v.zoom, d = (ey - v.panY) / v.zoom, minX = Math.min(a, c), maxX = Math.max(a, c), minY = Math.min(b, d), maxY = Math.max(b, d);
|
|
537
|
+
return nodes.filter((n) => n.position.x < maxX && n.position.x + (n.width ?? 150) > minX && n.position.y < maxY && n.position.y + (n.height ?? 100) > minY).map((n) => n.id);
|
|
538
|
+
}
|
|
539
|
+
function calculateSocketCoordinates(baseY, o) {
|
|
540
|
+
const q = Math.max(12, o.clearance ?? 14), n = o.nudge ?? { x: 0, y: 0 }, h = o.cardWidth / 2, b = o.isOutput ? h + q : -h - q;
|
|
541
|
+
let x = b + n.x, y = baseY + n.y;
|
|
542
|
+
const hh = (o.cardHeight ?? 80) / 2;
|
|
543
|
+
if (x > -h - 4 && x < h + 4 && y > -hh - 4 && y < hh + 4) x = o.isOutput ? h + Math.max(4, q / 2) : -h - Math.max(4, q / 2);
|
|
544
|
+
return { baseX: b, effectiveX: x, effectiveY: y, nudge: { x: x - b, y: y - baseY } };
|
|
545
|
+
}
|
|
546
|
+
var getBeamPoints = (n, bw = 5, hw = 1.2) => {
|
|
547
|
+
const vx = -n.x, vy = -n.y, d = Math.hypot(vx, vy);
|
|
548
|
+
if (d < 1) return "";
|
|
549
|
+
const px = -vy / d, py = vx / d;
|
|
550
|
+
return -px * hw + "," + -py * hw + " " + px * hw + "," + py * hw + " " + (vx + px * bw) + "," + (vy + py * bw) + " " + (vx - px * bw) + "," + (vy - py * bw);
|
|
551
|
+
};
|
|
552
|
+
function describeSvgArc(x1, y1, x2, y2, r) {
|
|
553
|
+
return "M " + x1 + " " + y1 + " A " + r + " " + r + " 0 0 1 " + x2 + " " + y2;
|
|
554
|
+
}
|
|
555
|
+
function getNodeSockets(n) {
|
|
556
|
+
return { inputs: (n.inputs ?? []).map((s) => ({ ...s, socketId: s.socketId ?? s.id })), outputs: (n.outputs ?? []).map((s) => ({ ...s, socketId: s.socketId ?? s.id })) };
|
|
557
|
+
}
|
|
558
|
+
var ConnectionRuleStore = class {
|
|
559
|
+
static ready = false;
|
|
560
|
+
static defs = /* @__PURE__ */ new Map();
|
|
561
|
+
static isInitialized() {
|
|
562
|
+
return this.ready;
|
|
563
|
+
}
|
|
564
|
+
static initializeDefaults() {
|
|
565
|
+
this.ready = true;
|
|
566
|
+
}
|
|
567
|
+
static registerNodeType(d) {
|
|
568
|
+
this.defs.set(d.type, d);
|
|
569
|
+
}
|
|
570
|
+
static getNodeType(t) {
|
|
571
|
+
return this.defs.get(t);
|
|
572
|
+
}
|
|
573
|
+
static listNodeTypes() {
|
|
574
|
+
return [...this.defs.values()];
|
|
575
|
+
}
|
|
576
|
+
static getCompatibleNodeTypes(source, defs) {
|
|
577
|
+
const all = defs ?? [...this.defs.values()];
|
|
578
|
+
return all.filter((d) => (source.direction === "OUTPUT" ? d.inputs : d.outputs)?.some((s) => !source.dataType || source.dataType === "ANY" || !s.dataType || s.dataType === "ANY" || s.dataType === source.dataType));
|
|
579
|
+
}
|
|
580
|
+
static canConnect(a, b) {
|
|
581
|
+
if (a.direction === b.direction) return false;
|
|
582
|
+
if (a.dataType === "ANY" || b.dataType === "ANY") return true;
|
|
583
|
+
return !a.dataType || !b.dataType || a.dataType === b.dataType;
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
var MagneticGraphManager = class {
|
|
587
|
+
constructor(cutoffDistance = 320) {
|
|
588
|
+
this.cutoffDistance = cutoffDistance;
|
|
589
|
+
}
|
|
590
|
+
cutoffDistance;
|
|
591
|
+
landmarks = [];
|
|
592
|
+
computeTraces(nodes) {
|
|
593
|
+
const out = [];
|
|
594
|
+
for (let i = 0; i < nodes.length; i++) for (let j = 0; j < nodes.length; j++) {
|
|
595
|
+
if (i === j) continue;
|
|
596
|
+
const a = nodes[i], b = nodes[j], ap = a.position, bp = b.position;
|
|
597
|
+
const ax = Array.isArray(ap) ? Number(ap[0]) : Number(ap.x), ay = Array.isArray(ap) ? Number(ap[2] ?? ap[1]) : Number(ap.y), bx = Array.isArray(bp) ? Number(bp[0]) : Number(bp.x), by = Array.isArray(bp) ? Number(bp[2] ?? bp[1]) : Number(bp.y), d = Math.hypot(ax - bx, ay - by);
|
|
598
|
+
if (d > this.cutoffDistance) continue;
|
|
599
|
+
const ao = (a.outputs ?? [])[0], bi = (b.inputs ?? [])[0];
|
|
600
|
+
if (!ao || !bi) continue;
|
|
601
|
+
out.push({ id: "trace-" + a.id + "-" + b.id, sourceNodeId: a.id, targetNodeId: b.id, sourceHandleId: ao.socketId ?? ao.id, targetHandleId: bi.socketId ?? bi.id, wireType: ao.signalType ?? "DEFAULT", spatialScore: d });
|
|
602
|
+
}
|
|
603
|
+
return out;
|
|
604
|
+
}
|
|
605
|
+
resolveAutoSolidification(nodes, traces, connections) {
|
|
606
|
+
return traces.filter((t) => !connections.some((c) => c.fromNodeId === t.sourceNodeId && c.toNodeId === t.targetNodeId));
|
|
607
|
+
}
|
|
608
|
+
saveLandmark(name, camera) {
|
|
609
|
+
const lm = { id: "landmark-" + Date.now(), name, camera: { ...camera } };
|
|
610
|
+
this.landmarks.push(lm);
|
|
611
|
+
return lm;
|
|
612
|
+
}
|
|
613
|
+
getLandmarks() {
|
|
614
|
+
return [...this.landmarks];
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
var GhostStore = class _GhostStore {
|
|
618
|
+
static instance = new _GhostStore();
|
|
619
|
+
ghostNodes = [];
|
|
620
|
+
ghostTraces = [];
|
|
621
|
+
selectedNodeIds = [];
|
|
622
|
+
scenarioIndex = 0;
|
|
623
|
+
hoveredGhostId = null;
|
|
624
|
+
isActive = false;
|
|
625
|
+
listeners = /* @__PURE__ */ new Set();
|
|
626
|
+
static getInstance() {
|
|
627
|
+
return this.instance;
|
|
628
|
+
}
|
|
629
|
+
subscribe(cb) {
|
|
630
|
+
this.listeners.add(cb);
|
|
631
|
+
return () => {
|
|
632
|
+
this.listeners.delete(cb);
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
emit() {
|
|
636
|
+
this.listeners.forEach((cb) => cb());
|
|
637
|
+
}
|
|
638
|
+
setPredictions(nodes, traces, selected) {
|
|
639
|
+
this.ghostNodes = nodes;
|
|
640
|
+
this.ghostTraces = traces;
|
|
641
|
+
this.selectedNodeIds = selected;
|
|
642
|
+
this.isActive = nodes.length > 0;
|
|
643
|
+
this.emit();
|
|
644
|
+
}
|
|
645
|
+
getActiveGhostNodes() {
|
|
646
|
+
return this.ghostNodes;
|
|
647
|
+
}
|
|
648
|
+
getActiveGhostTraces() {
|
|
649
|
+
return this.ghostTraces;
|
|
650
|
+
}
|
|
651
|
+
setHoveredGhostId(id) {
|
|
652
|
+
this.hoveredGhostId = id;
|
|
653
|
+
this.emit();
|
|
654
|
+
}
|
|
655
|
+
cycleScenario(count = 3) {
|
|
656
|
+
this.scenarioIndex = (this.scenarioIndex + 1) % Math.max(1, count);
|
|
657
|
+
this.emit();
|
|
658
|
+
}
|
|
659
|
+
clear() {
|
|
660
|
+
this.ghostNodes = [];
|
|
661
|
+
this.ghostTraces = [];
|
|
662
|
+
this.isActive = false;
|
|
663
|
+
this.emit();
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
function inferGhostNodes(nodes, defs, options) {
|
|
667
|
+
return defs.slice(0, Math.max(1, options.scenarioCount)).map((d, i) => ({ id: "ghost-" + d.type + "-" + i, nodeType: d.type, label: d.label, position: { x: (nodes[0]?.position?.x ?? 0) + (i + 1) * 220, y: nodes[0]?.position?.y ?? 0 }, size: { width: 150, height: 100 }, inputs: d.inputs ?? [], outputs: d.outputs ?? [], sourceNodeId: nodes[0]?.id ?? "", socketMappings: [] }));
|
|
668
|
+
}
|
|
669
|
+
function resolveGhostLayout(ghosts, _nodes, _defs) {
|
|
670
|
+
return ghosts;
|
|
671
|
+
}
|
|
672
|
+
function buildGhostTraces(_ghosts, _nodes) {
|
|
673
|
+
return [];
|
|
674
|
+
}
|
|
675
|
+
function computePredictiveGraph(nodes, _connections, scenarioIndex = 0) {
|
|
676
|
+
const ghostNodes = nodes.slice(0, 1).map((n) => ({ id: "predictive-" + n.id + "-" + scenarioIndex, nodeType: n.type, label: n.label ?? n.name ?? n.type, prototypeNode: n, worldPosition: [(n.position?.x ?? n.position?.[0] ?? 0) + 220, 0, n.position?.y ?? n.position?.[2] ?? 0], inputs: n.inputs ?? [], outputs: n.outputs ?? [], socketMappings: [] }));
|
|
677
|
+
return { ghostNodes, traces: [], selectedNodesWithGhosts: new Map(nodes.slice(0, 1).map((n) => [n.id, ghostNodes])) };
|
|
678
|
+
}
|
|
499
679
|
export {
|
|
680
|
+
BaseNode,
|
|
500
681
|
ComponentThemeContractSchema,
|
|
682
|
+
ConnectionRuleStore,
|
|
501
683
|
FLOKS_CANONICAL_CONTRACT,
|
|
502
684
|
FLOKS_COMPONENT_REGISTRY,
|
|
503
685
|
FLOKS_PUBLIC_SYMBOLS,
|
|
504
686
|
FloksContractSnapshotSchema,
|
|
687
|
+
GhostStore,
|
|
688
|
+
GraphNodeParent,
|
|
689
|
+
GraphWireParent,
|
|
690
|
+
MagneticGraphManager,
|
|
691
|
+
SIGNAL_TYPES,
|
|
505
692
|
ThemePackSchema,
|
|
506
693
|
ThemePackSlotBindingSchema,
|
|
507
694
|
ThemePackStateMappingSchema,
|
|
@@ -509,12 +696,25 @@ export {
|
|
|
509
696
|
VisualParameterSchema,
|
|
510
697
|
VisualSlotSchema,
|
|
511
698
|
VisualStateSchema,
|
|
699
|
+
buildGhostTraces,
|
|
700
|
+
calculateSocketCoordinates,
|
|
701
|
+
canvasToScreen,
|
|
702
|
+
computePredictiveGraph,
|
|
512
703
|
createFloksSnapshot,
|
|
704
|
+
describeSvgArc,
|
|
513
705
|
diffContractSnapshots,
|
|
514
706
|
floksPromotionContract,
|
|
707
|
+
getBeamPoints,
|
|
708
|
+
getCenterPanForNode,
|
|
515
709
|
getComponentContract,
|
|
710
|
+
getNodeSockets,
|
|
711
|
+
getNodesInSelection,
|
|
712
|
+
inferGhostNodes,
|
|
713
|
+
isNodeInCenterDeadZone,
|
|
516
714
|
listComponentContracts,
|
|
517
715
|
loadThemePack,
|
|
716
|
+
resolveGhostLayout,
|
|
518
717
|
themePackToFrnlTheme,
|
|
519
|
-
validateThemePackAgainstContract
|
|
718
|
+
validateThemePackAgainstContract,
|
|
719
|
+
zoomAtPoint
|
|
520
720
|
};
|