@ultrst-armada/kloks 1.1.0 → 1.2.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 (43) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +1 -0
  3. package/package.json +6 -1
  4. package/packages/audio-midi/dist/chunk-3GRGELA4.js +6 -6
  5. package/packages/audio-midi/dist/index.d.ts +3 -3
  6. package/packages/audio-midi/dist/index.js +10 -10
  7. package/packages/backend/dist/BaseAccountProvider-DduKf5HG.d.ts +1 -1
  8. package/packages/backend/dist/BaseStorageAdapter-tosOoSUg.d.ts +1 -1
  9. package/packages/backend/dist/api/index.d.ts +1 -1
  10. package/packages/backend/dist/auth/index.d.ts +1 -1
  11. package/packages/backend/dist/chunk-4ZFXEFOE.js +2 -2
  12. package/packages/backend/dist/chunk-J2J24JVC.js +1 -1
  13. package/packages/backend/dist/chunk-KTLD7Z4L.js +3 -3
  14. package/packages/backend/dist/chunk-RCCQ7IRM.js +3 -3
  15. package/packages/backend/dist/chunk-TWCEVES2.js +1 -1
  16. package/packages/backend/dist/control-plane/index.d.ts +1 -1
  17. package/packages/backend/dist/index.d.ts +822 -31
  18. package/packages/backend/dist/index.js +2741 -513
  19. package/packages/backend/dist/krnl-services.js +2 -2
  20. package/packages/backend/dist/storage/index.d.ts +1 -1
  21. package/packages/backend/dist/workspace/index.d.ts +1 -1
  22. package/packages/orchestrations/dist/index.d.ts +3 -3
  23. package/packages/orchestrations/dist/index.js +3 -3
  24. package/packages/services/dist/index.d.ts +3 -3
  25. package/packages/state-graph/dist/{BaseGraph-Bl2f7Pqx.d.ts → BaseGraph-BvkSYOTw.d.ts} +1 -1
  26. package/packages/state-graph/dist/{BaseNode-1HCEqmap.d.ts → BaseNode-DTcd3K1B.d.ts} +1 -1
  27. package/packages/state-graph/dist/{CompatibilityMatrix-DX307_vS.d.ts → CompatibilityMatrix-Dj-tCWUA.d.ts} +1 -1
  28. package/packages/state-graph/dist/chunk-JXDJZSFW.js +459 -0
  29. package/packages/state-graph/dist/chunk-RHRXPY2U.js +0 -0
  30. package/packages/state-graph/dist/domain/index.d.ts +3 -3
  31. package/packages/state-graph/dist/index.d.ts +8 -9
  32. package/packages/state-graph/dist/index.js +25 -16
  33. package/packages/state-graph/dist/rules/index.d.ts +3 -3
  34. package/packages/state-graph/dist/rules/index.js +2 -1
  35. package/packages/state-graph/dist/spatial/index.d.ts +53 -5
  36. package/packages/state-graph/dist/spatial/index.js +12 -3
  37. package/packages/state-graph/dist/store/index.d.ts +159 -6
  38. package/packages/state-graph/dist/types-VDoc4FIc.d.ts +150 -0
  39. package/packages/state-graph/dist/TraceEngine-CJVpUb80.d.ts +0 -18
  40. package/packages/state-graph/dist/chunk-YTWCH6P2.js +0 -109
  41. package/packages/state-graph/dist/index-CiekWEH3.d.ts +0 -272
  42. package/packages/backend/dist/{chunk-CU7RZBMF.js → chunk-OYQKQAEF.js} +4 -4
  43. /package/packages/state-graph/dist/{chunk-QN74PLMF.js → chunk-TZOL3RN7.js} +0 -0
@@ -13,27 +13,22 @@ import {
13
13
  SkipoExecutionEngine,
14
14
  useCommand
15
15
  } from "./chunk-ZTHBPV24.js";
16
+ import "./chunk-RHRXPY2U.js";
17
+ import {
18
+ AttractionEngine,
19
+ GhostInferenceEngine,
20
+ GhostLayoutResolver,
21
+ GhostTracePathBuilder,
22
+ calculateSocketCoordinates,
23
+ getBeamPoints,
24
+ useMagneticTraces
25
+ } from "./chunk-JXDJZSFW.js";
16
26
  import {
17
27
  ConnectionRuleStore,
18
28
  HandleTypeRegistry,
19
29
  WireTypeRegistry,
20
30
  initializeDefaultGraphRules
21
- } from "./chunk-QN74PLMF.js";
22
- import "./chunk-Q5I42UX7.js";
23
- import {
24
- LifecycleCycleError,
25
- LifecycleGraph,
26
- SKIPO_STATE,
27
- SkipoStateEngine,
28
- useLifecycleScope,
29
- useSkipoBind,
30
- useSkipoState
31
- } from "./chunk-SHIBCPGQ.js";
32
- import {
33
- AttractionEngine,
34
- calculateSocketCoordinates,
35
- getBeamPoints
36
- } from "./chunk-YTWCH6P2.js";
31
+ } from "./chunk-TZOL3RN7.js";
37
32
  import {
38
33
  CommandApi,
39
34
  GhostStore,
@@ -61,6 +56,16 @@ import {
61
56
  import {
62
57
  CompatibilityMatrix
63
58
  } from "./chunk-ISFNY7EZ.js";
59
+ import "./chunk-Q5I42UX7.js";
60
+ import {
61
+ LifecycleCycleError,
62
+ LifecycleGraph,
63
+ SKIPO_STATE,
64
+ SkipoStateEngine,
65
+ useLifecycleScope,
66
+ useSkipoBind,
67
+ useSkipoState
68
+ } from "./chunk-SHIBCPGQ.js";
64
69
  import "./chunk-3RG5ZIWI.js";
65
70
 
66
71
  // ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.0/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
@@ -9561,7 +9566,10 @@ export {
9561
9566
  EffectNodeModel,
9562
9567
  GM_DRUM_NOTES,
9563
9568
  GRAPH_TYPE_DEFINITIONS,
9569
+ GhostInferenceEngine,
9570
+ GhostLayoutResolver,
9564
9571
  GhostStore,
9572
+ GhostTracePathBuilder,
9565
9573
  GraphBridgeNode,
9566
9574
  GraphConcepts,
9567
9575
  GraphDataService,
@@ -9804,6 +9812,7 @@ export {
9804
9812
  updateNamedMidiProfile,
9805
9813
  useCommand,
9806
9814
  useLifecycleScope,
9815
+ useMagneticTraces,
9807
9816
  useSkipoBind,
9808
9817
  useSkipoState,
9809
9818
  validateComponentSocketConnection,
@@ -1,6 +1,6 @@
1
- import { c as CompatibilityRule, C as CompatibilityResolution } from '../CompatibilityMatrix-DX307_vS.js';
2
- export { a as CompatibilityMatrix, b as CompatibilityResolverDelegate } from '../CompatibilityMatrix-DX307_vS.js';
3
- import { j as NodeDefinition, a as BaseHandle, g as HandleDirection, H as HandleCategory, f as HandleDefinition } from '../BaseNode-1HCEqmap.js';
1
+ import { c as CompatibilityRule, C as CompatibilityResolution } from '../CompatibilityMatrix-Dj-tCWUA.js';
2
+ export { a as CompatibilityMatrix, b as CompatibilityResolverDelegate } from '../CompatibilityMatrix-Dj-tCWUA.js';
3
+ import { j as NodeDefinition, B as BaseHandle, c as HandleDirection, H as HandleCategory, g as HandleDefinition } from '../BaseNode-DTcd3K1B.js';
4
4
 
5
5
  interface HandleTypeDefinition {
6
6
  dataType: string;
@@ -1,9 +1,10 @@
1
+ import "../chunk-RHRXPY2U.js";
1
2
  import {
2
3
  ConnectionRuleStore,
3
4
  HandleTypeRegistry,
4
5
  WireTypeRegistry,
5
6
  initializeDefaultGraphRules
6
- } from "../chunk-QN74PLMF.js";
7
+ } from "../chunk-TZOL3RN7.js";
7
8
  import {
8
9
  CompatibilityMatrix
9
10
  } from "../chunk-ISFNY7EZ.js";
@@ -1,8 +1,8 @@
1
- import { B as BaseNode, a as BaseHandle, i as HandlePosition, N as NodePosition } from '../BaseNode-1HCEqmap.js';
2
- import { T as Trace } from '../TraceEngine-CJVpUb80.js';
3
- export { a as TraceEngine } from '../TraceEngine-CJVpUb80.js';
1
+ import { b as BaseNode, B as BaseHandle, i as HandlePosition, N as NodePosition, j as NodeDefinition } from '../BaseNode-DTcd3K1B.js';
2
+ import { T as Trace, G as GraphNode, f as GraphEdge, N as NodeGraphConfig, b as GhostInferenceOptions, a as GhostCandidate, c as GhostNodeRecord, e as GhostTraceRecord } from '../types-VDoc4FIc.js';
3
+ export { d as GhostSocketMapping, i as TraceEngine } from '../types-VDoc4FIc.js';
4
4
  import { S as SolidConnection } from '../BaseConnection-CMRrL6Fe.js';
5
- import '../CompatibilityMatrix-DX307_vS.js';
5
+ import '../CompatibilityMatrix-Dj-tCWUA.js';
6
6
 
7
7
  declare class SpatialEngine {
8
8
  static calculateEffectiveHandlePosition(node: BaseNode, handle: BaseHandle): HandlePosition;
@@ -52,4 +52,52 @@ declare const getBeamPoints: (nudge: {
52
52
  y: number;
53
53
  }, baseW?: number, headW?: number) => string;
54
54
 
55
- export { AttractionEngine, AutoSolidify, type SocketCoordOptions, type SocketCoordResult, SpatialEngine, Trace, calculateSocketCoordinates, getBeamPoints };
55
+ interface MagneticTraceRecord {
56
+ id: string;
57
+ sourceNodeId: string;
58
+ sourceSocketId: string;
59
+ targetNodeId: string;
60
+ targetSocketId: string;
61
+ wireType: string;
62
+ color: string;
63
+ pathD: string;
64
+ midpoint: {
65
+ x: number;
66
+ y: number;
67
+ };
68
+ distance: number;
69
+ }
70
+
71
+ interface UseMagneticTracesParams {
72
+ nodes: GraphNode[];
73
+ edges: GraphEdge[];
74
+ config?: NodeGraphConfig;
75
+ onEdgesChange?: (edges: GraphEdge[]) => void;
76
+ }
77
+ declare function useMagneticTraces({ nodes, edges, config, onEdgesChange }: UseMagneticTracesParams): {
78
+ traces: MagneticTraceRecord[];
79
+ isEnabled: boolean;
80
+ solidifyTrace: (traceId: string) => void;
81
+ solidifyAll: () => void;
82
+ };
83
+
84
+ declare class GhostInferenceEngine {
85
+ static inferNextNodes(selectedNodes: GraphNode[], allNodeDefs: NodeDefinition[], options?: GhostInferenceOptions): GhostCandidate[];
86
+ private static resolveSocketMappings;
87
+ private static computeAffinityScore;
88
+ }
89
+
90
+ declare class GhostLayoutResolver {
91
+ static resolveLayout(candidates: GhostCandidate[], existingNodes: GraphNode[], allNodeDefs: NodeDefinition[]): GhostNodeRecord[];
92
+ private static findNonOverlappingPosition;
93
+ private static intersects;
94
+ }
95
+
96
+ declare class GhostTracePathBuilder {
97
+ static buildGhostTraces(ghostNodes: GhostNodeRecord[], existingNodes: GraphNode[]): GhostTraceRecord[];
98
+ private static getRealSocketPosition;
99
+ private static getGhostSocketPosition;
100
+ static renderBezier(startX: number, startY: number, endX: number, endY: number): string;
101
+ }
102
+
103
+ export { AttractionEngine, AutoSolidify, GhostCandidate, GhostInferenceEngine, GhostInferenceOptions, GhostLayoutResolver, GhostNodeRecord, GhostTracePathBuilder, GhostTraceRecord, type MagneticTraceRecord, type SocketCoordOptions, type SocketCoordResult, SpatialEngine, Trace, type UseMagneticTracesParams, calculateSocketCoordinates, getBeamPoints, useMagneticTraces };
@@ -1,8 +1,13 @@
1
1
  import {
2
2
  AttractionEngine,
3
+ GhostInferenceEngine,
4
+ GhostLayoutResolver,
5
+ GhostTracePathBuilder,
3
6
  calculateSocketCoordinates,
4
- getBeamPoints
5
- } from "../chunk-YTWCH6P2.js";
7
+ getBeamPoints,
8
+ useMagneticTraces
9
+ } from "../chunk-JXDJZSFW.js";
10
+ import "../chunk-TZOL3RN7.js";
6
11
  import {
7
12
  AutoSolidify,
8
13
  SpatialEngine,
@@ -14,8 +19,12 @@ import "../chunk-3RG5ZIWI.js";
14
19
  export {
15
20
  AttractionEngine,
16
21
  AutoSolidify,
22
+ GhostInferenceEngine,
23
+ GhostLayoutResolver,
24
+ GhostTracePathBuilder,
17
25
  SpatialEngine,
18
26
  TraceEngine,
19
27
  calculateSocketCoordinates,
20
- getBeamPoints
28
+ getBeamPoints,
29
+ useMagneticTraces
21
30
  };
@@ -1,6 +1,159 @@
1
- export { C as CommandApi, a as GhostStore, b as GhostStoreListener, d as GraphListener, e as GraphStore } from '../index-CiekWEH3.js';
2
- import '../BaseNode-1HCEqmap.js';
3
- import '../BaseConnection-CMRrL6Fe.js';
4
- import '../BaseGraph-Bl2f7Pqx.js';
5
- import '../TraceEngine-CJVpUb80.js';
6
- import '../CompatibilityMatrix-DX307_vS.js';
1
+ import { N as NodePosition, a as NodeSize, b as BaseNode, e as BaseNodeProps, h as HandleOffset } from '../BaseNode-DTcd3K1B.js';
2
+ import { V as ViewLink, S as SolidConnection } from '../BaseConnection-CMRrL6Fe.js';
3
+ import { a as BaseViewWindow, L as Landmark, e as GraphView, G as GraphSettings, f as Group } from '../BaseGraph-BvkSYOTw.js';
4
+ import { T as Trace, c as GhostNodeRecord, e as GhostTraceRecord } from '../types-VDoc4FIc.js';
5
+ import '../CompatibilityMatrix-Dj-tCWUA.js';
6
+
7
+ interface CreateViewWindowParams {
8
+ id?: string;
9
+ viewType: string;
10
+ sourceNodeId: string;
11
+ sourceViewHandleId: string;
12
+ position: NodePosition;
13
+ size?: NodeSize;
14
+ }
15
+ declare class ViewWindowManager {
16
+ private windows;
17
+ private links;
18
+ createWindow(params: CreateViewWindowParams): {
19
+ window: BaseViewWindow;
20
+ link: ViewLink;
21
+ };
22
+ selectWindow(id: string): void;
23
+ pinLive(id: string, pinned: boolean): void;
24
+ removeWindow(id: string): boolean;
25
+ getProcessingWindows(): BaseViewWindow[];
26
+ getWindow(id: string): BaseViewWindow | undefined;
27
+ getLink(windowId: string): ViewLink | undefined;
28
+ listWindows(): BaseViewWindow[];
29
+ listLinks(): ViewLink[];
30
+ }
31
+
32
+ declare class LandmarkManager {
33
+ private landmarks;
34
+ constructor(initialLandmarks?: Landmark[]);
35
+ createLandmark(number: number, name: string, cameraPosition: {
36
+ x: number;
37
+ y: number;
38
+ }, zoom: number): Landmark;
39
+ getByNumber(number: number): Landmark | undefined;
40
+ getById(id: string): Landmark | undefined;
41
+ updateLandmark(id: string, updates: Partial<Omit<Landmark, 'id'>>): Landmark | undefined;
42
+ deleteLandmark(id: string): boolean;
43
+ list(): Landmark[];
44
+ clear(): void;
45
+ }
46
+
47
+ interface CaptureGraphSnapshotParams {
48
+ id?: string;
49
+ name: string;
50
+ nodes: BaseNode[];
51
+ viewWindows: BaseViewWindow[];
52
+ camera: {
53
+ x: number;
54
+ y: number;
55
+ };
56
+ zoom: number;
57
+ selectedNodeIds: string[];
58
+ settingsOverrides?: Partial<GraphSettings>;
59
+ }
60
+ declare class ViewEngine {
61
+ private views;
62
+ constructor(initialViews?: GraphView[]);
63
+ captureView(params: CaptureGraphSnapshotParams): GraphView;
64
+ getView(id: string): GraphView | undefined;
65
+ listViews(): GraphView[];
66
+ deleteView(id: string): boolean;
67
+ }
68
+
69
+ type GraphListener = () => void;
70
+ declare class GraphStore {
71
+ nodes: BaseNode[];
72
+ connections: SolidConnection[];
73
+ traces: Trace[];
74
+ groups: Group[];
75
+ settings: GraphSettings;
76
+ selectedNodeIds: Set<string>;
77
+ readonly viewWindows: ViewWindowManager;
78
+ readonly landmarks: LandmarkManager;
79
+ readonly views: ViewEngine;
80
+ private listeners;
81
+ subscribe(listener: GraphListener): () => void;
82
+ notify(): void;
83
+ refreshTraces(): void;
84
+ solidifyTrace(traceId: string): SolidConnection | undefined;
85
+ lockAllConnections(): void;
86
+ }
87
+
88
+ declare class CommandApi {
89
+ private store;
90
+ constructor(store: GraphStore);
91
+ get nodes(): {
92
+ create: (props: BaseNodeProps) => BaseNode;
93
+ delete: (nodeId: string) => void;
94
+ move: (nodeId: string, x: number, y: number) => void;
95
+ lockPosition: (nodeId: string) => void;
96
+ unlockPosition: (nodeId: string) => void;
97
+ };
98
+ get handles(): {
99
+ move: (nodeId: string, handleId: string, offset: HandleOffset) => void;
100
+ resetOffset: (nodeId: string, handleId: string) => void;
101
+ };
102
+ get traces(): {
103
+ refresh: () => void;
104
+ enable: () => void;
105
+ disable: () => void;
106
+ solidify: (traceId: string) => SolidConnection;
107
+ };
108
+ get connections(): {
109
+ create: (sourceNodeId: string, sourceHandleId: string, targetNodeId: string, targetHandleId: string, wireType?: string) => SolidConnection;
110
+ delete: (connectionId: string) => void;
111
+ lock: (connectionId: string) => void;
112
+ unlock: (connectionId: string) => void;
113
+ lockAll: () => void;
114
+ };
115
+ get groups(): {
116
+ create: (group: Group) => void;
117
+ delete: (groupId: string) => void;
118
+ };
119
+ get landmarks(): {
120
+ create: (num: number, name: string, camera: {
121
+ x: number;
122
+ y: number;
123
+ }, zoom: number) => Landmark;
124
+ delete: (id: string) => boolean;
125
+ list: () => Landmark[];
126
+ };
127
+ get viewWindows(): {
128
+ create: (params: Parameters<typeof this$1.store.viewWindows.createWindow>[0]) => {
129
+ window: BaseViewWindow;
130
+ link: ViewLink;
131
+ };
132
+ close: (id: string) => boolean;
133
+ select: (id: string) => void;
134
+ pinLive: (id: string, pinned: boolean) => void;
135
+ };
136
+ }
137
+
138
+ type GhostStoreListener = () => void;
139
+ declare class GhostStore {
140
+ private static instance;
141
+ isActive: boolean;
142
+ ghostNodes: GhostNodeRecord[];
143
+ ghostTraces: GhostTraceRecord[];
144
+ scenarioIndex: number;
145
+ hoveredGhostId: string | null;
146
+ sourceNodeIds: string[];
147
+ private listeners;
148
+ static getInstance(): GhostStore;
149
+ subscribe(listener: GhostStoreListener): () => void;
150
+ notify(): void;
151
+ setPredictions(nodes: GhostNodeRecord[], traces: GhostTraceRecord[], sourceNodeIds: string[]): void;
152
+ cycleScenario(maxScenarios?: number): void;
153
+ setHoveredGhostId(id: string | null): void;
154
+ getActiveGhostNodes(): GhostNodeRecord[];
155
+ getActiveGhostTraces(): GhostTraceRecord[];
156
+ clear(): void;
157
+ }
158
+
159
+ export { CommandApi, GhostStore, type GhostStoreListener, type GraphListener, GraphStore };
@@ -0,0 +1,150 @@
1
+ import { b as BaseNode, c as HandleDirection, B as BaseHandle } from './BaseNode-DTcd3K1B.js';
2
+ import { C as CompatibilityResolution } from './CompatibilityMatrix-Dj-tCWUA.js';
3
+
4
+ interface Trace {
5
+ id: string;
6
+ sourceNodeId: string;
7
+ sourceHandleId: string;
8
+ targetNodeId: string;
9
+ targetHandleId: string;
10
+ wireType: string;
11
+ compatibility: CompatibilityResolution;
12
+ spatialScore: number;
13
+ }
14
+ declare class TraceEngine {
15
+ static computeTraces(nodes: BaseNode[], cutoffDistance: number): Trace[];
16
+ }
17
+
18
+ type SocketType = 'input' | 'output';
19
+ interface Socket {
20
+ id: string;
21
+ label: string;
22
+ type: SocketType;
23
+ dataType?: string;
24
+ direction?: HandleDirection;
25
+ offset?: {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ basePosition?: {
30
+ x: number;
31
+ y: number;
32
+ };
33
+ connectionMode?: 'SINGLE' | 'MULTI';
34
+ }
35
+ interface GraphNode {
36
+ id: string;
37
+ type: string;
38
+ label: string;
39
+ position: {
40
+ x: number;
41
+ y: number;
42
+ };
43
+ size?: {
44
+ width: number;
45
+ height: number;
46
+ };
47
+ data?: Record<string, unknown>;
48
+ inputs?: Socket[];
49
+ outputs?: Socket[];
50
+ width?: number;
51
+ height?: number;
52
+ positionLocked?: boolean;
53
+ minimized?: boolean;
54
+ handles?: BaseHandle[];
55
+ }
56
+ interface GraphEdge {
57
+ id: string;
58
+ source: string;
59
+ sourceSocket: string;
60
+ target: string;
61
+ targetSocket: string;
62
+ label?: string;
63
+ color?: string;
64
+ wireType?: string;
65
+ locked?: boolean;
66
+ deletable?: boolean;
67
+ }
68
+ interface ViewportState {
69
+ panX: number;
70
+ panY: number;
71
+ zoom: number;
72
+ }
73
+ interface NodeGraphConfig {
74
+ minZoom?: number;
75
+ maxZoom?: number;
76
+ gridSize?: number;
77
+ snapToGrid?: boolean;
78
+ wireStyle?: 'bezier' | 'straight' | 'step';
79
+ tracingEnabled?: boolean;
80
+ magneticTracesEnabled?: boolean;
81
+ autoSolidify?: boolean;
82
+ traceCutoffDistance?: number;
83
+ ghostRoutingEnabled?: boolean;
84
+ ghostScenarioCount?: number;
85
+ ghostDecayMs?: number;
86
+ }
87
+ interface NodeGraphPlugin {
88
+ registerNodeDefinition?: (def: unknown) => void;
89
+ registerHandleType?: (type: string) => void;
90
+ registerWireType?: (wire: unknown) => void;
91
+ registerCompatibilityRule?: (rule: unknown) => void;
92
+ registerViewType?: (view: unknown) => void;
93
+ registerTheme?: (theme: unknown) => void;
94
+ registerContextMenuAction?: (action: unknown) => void;
95
+ registerSpawnMenuItem?: (item: unknown) => void;
96
+ }
97
+
98
+ interface GhostSocketMapping {
99
+ sourceSocketId: string;
100
+ targetSocketId: string;
101
+ wireType: string;
102
+ }
103
+ interface GhostCandidate {
104
+ id: string;
105
+ nodeType: string;
106
+ label: string;
107
+ scenarioIndex: number;
108
+ score: number;
109
+ sourceNodeId: string;
110
+ socketMappings: GhostSocketMapping[];
111
+ relativeOffset: {
112
+ x: number;
113
+ y: number;
114
+ };
115
+ }
116
+ interface GhostNodeRecord {
117
+ id: string;
118
+ nodeType: string;
119
+ label: string;
120
+ position: {
121
+ x: number;
122
+ y: number;
123
+ };
124
+ size: {
125
+ width: number;
126
+ height: number;
127
+ };
128
+ scenarioIndex: number;
129
+ sourceNodeId: string;
130
+ socketMappings: GhostSocketMapping[];
131
+ inputs?: Socket[];
132
+ outputs?: Socket[];
133
+ }
134
+ interface GhostTraceRecord {
135
+ id: string;
136
+ sourceNodeId: string;
137
+ sourceSocketId: string;
138
+ targetGhostNodeId: string;
139
+ targetSocketId: string;
140
+ wireType: string;
141
+ pathD: string;
142
+ scenarioIndex: number;
143
+ }
144
+ interface GhostInferenceOptions {
145
+ scenarioCount?: number;
146
+ maxSuggestionsPerNode?: number;
147
+ customScorer?: (sourceType: string, candidateType: string) => number;
148
+ }
149
+
150
+ export { type GraphNode as G, type NodeGraphConfig as N, type Socket as S, type Trace as T, type ViewportState as V, type GhostCandidate as a, type GhostInferenceOptions as b, type GhostNodeRecord as c, type GhostSocketMapping as d, type GhostTraceRecord as e, type GraphEdge as f, type NodeGraphPlugin as g, type SocketType as h, TraceEngine as i };
@@ -1,18 +0,0 @@
1
- import { B as BaseNode } from './BaseNode-1HCEqmap.js';
2
- import { C as CompatibilityResolution } from './CompatibilityMatrix-DX307_vS.js';
3
-
4
- interface Trace {
5
- id: string;
6
- sourceNodeId: string;
7
- sourceHandleId: string;
8
- targetNodeId: string;
9
- targetHandleId: string;
10
- wireType: string;
11
- compatibility: CompatibilityResolution;
12
- spatialScore: number;
13
- }
14
- declare class TraceEngine {
15
- static computeTraces(nodes: BaseNode[], cutoffDistance: number): Trace[];
16
- }
17
-
18
- export { type Trace as T, TraceEngine as a };
@@ -1,109 +0,0 @@
1
- // src/spatial/AttractionEngine.ts
2
- var AttractionEngine = class {
3
- static computeSimilarity(nodeA, nodeB) {
4
- if (nodeA.id === nodeB.id) return 1;
5
- let score = 0;
6
- let factors = 0;
7
- factors += 1;
8
- if (nodeA.type === nodeB.type) {
9
- score += 1;
10
- }
11
- factors += 1;
12
- const inTypesA = new Set(nodeA.handles.filter((h) => h.direction === "INPUT").map((h) => h.dataType));
13
- const inTypesB = new Set(nodeB.handles.filter((h) => h.direction === "INPUT").map((h) => h.dataType));
14
- const sharedIn = [...inTypesA].filter((t) => inTypesB.has(t)).length;
15
- const totalIn = Math.max(1, (/* @__PURE__ */ new Set([...inTypesA, ...inTypesB])).size);
16
- score += sharedIn / totalIn;
17
- factors += 1;
18
- const outTypesA = new Set(nodeA.handles.filter((h) => h.direction === "OUTPUT").map((h) => h.dataType));
19
- const outTypesB = new Set(nodeB.handles.filter((h) => h.direction === "OUTPUT").map((h) => h.dataType));
20
- const sharedOut = [...outTypesA].filter((t) => outTypesB.has(t)).length;
21
- const totalOut = Math.max(1, (/* @__PURE__ */ new Set([...outTypesA, ...outTypesB])).size);
22
- score += sharedOut / totalOut;
23
- return factors > 0 ? score / factors : 0;
24
- }
25
- static calculateStep(nodes, strength = 1, speed = 1) {
26
- const updatedPositions = /* @__PURE__ */ new Map();
27
- for (let i = 0; i < nodes.length; i++) {
28
- const nodeA = nodes[i];
29
- if (nodeA.positionLocked) {
30
- updatedPositions.set(nodeA.id, { ...nodeA.position });
31
- continue;
32
- }
33
- let forceX = 0;
34
- let forceY = 0;
35
- for (let j = 0; j < nodes.length; j++) {
36
- if (i === j) continue;
37
- const nodeB = nodes[j];
38
- const similarity = this.computeSimilarity(nodeA, nodeB);
39
- if (similarity <= 0.1) continue;
40
- const dx = nodeB.position.x - nodeA.position.x;
41
- const dy = nodeB.position.y - nodeA.position.y;
42
- const dist = Math.max(20, Math.sqrt(dx * dx + dy * dy));
43
- const f = similarity * strength * speed;
44
- forceX += dx / dist * f;
45
- forceY += dy / dist * f;
46
- }
47
- updatedPositions.set(nodeA.id, {
48
- x: nodeA.position.x + forceX,
49
- y: nodeA.position.y + forceY
50
- });
51
- }
52
- return updatedPositions;
53
- }
54
- };
55
-
56
- // src/spatial/socketCoordinates.ts
57
- function calculateSocketCoordinates(baseY, options) {
58
- const clearance = Math.max(12, options.clearance ?? 14);
59
- const nudge = options.nudge ?? { x: 0, y: 0 };
60
- const halfWidth = options.cardWidth / 2;
61
- const halfHeight = (options.cardHeight ?? 80) / 2;
62
- const baseX = options.isOutput ? halfWidth + clearance : -halfWidth - clearance;
63
- let effectiveX = baseX + nudge.x;
64
- let effectiveY = baseY + nudge.y;
65
- const minMargin = 4;
66
- const bodyLeft = -halfWidth;
67
- const bodyRight = halfWidth;
68
- const bodyTop = -halfHeight;
69
- const bodyBottom = halfHeight;
70
- if (effectiveX > bodyLeft - minMargin && effectiveX < bodyRight + minMargin && effectiveY > bodyTop - minMargin && effectiveY < bodyBottom + minMargin) {
71
- if (options.isOutput) {
72
- effectiveX = bodyRight + Math.max(minMargin, clearance / 2);
73
- } else {
74
- effectiveX = bodyLeft - Math.max(minMargin, clearance / 2);
75
- }
76
- }
77
- return {
78
- baseX,
79
- effectiveX,
80
- effectiveY,
81
- nudge: {
82
- x: effectiveX - baseX,
83
- y: effectiveY - baseY
84
- }
85
- };
86
- }
87
- var getBeamPoints = (nudge, baseW = 5, headW = 1.2) => {
88
- const vx = -nudge.x;
89
- const vy = -nudge.y;
90
- const d = Math.sqrt(vx * vx + vy * vy);
91
- if (d < 1) return "";
92
- const px = -vy / d;
93
- const py = vx / d;
94
- const hL_x = -px * headW;
95
- const hL_y = -py * headW;
96
- const hR_x = px * headW;
97
- const hR_y = py * headW;
98
- const bR_x = vx + px * baseW;
99
- const bR_y = vy + py * baseW;
100
- const bL_x = vx - px * baseW;
101
- const bL_y = vy - py * baseW;
102
- return `${hL_x},${hL_y} ${hR_x},${hR_y} ${bR_x},${bR_y} ${bL_x},${bL_y}`;
103
- };
104
-
105
- export {
106
- AttractionEngine,
107
- calculateSocketCoordinates,
108
- getBeamPoints
109
- };