@theclearsky/react-blender-nodes 0.0.8 → 0.0.9
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/README.md +84 -4
- package/dist/index.d.ts +1281 -18
- package/dist/react-blender-nodes.css +1 -1
- package/dist/react-blender-nodes.es.js +22425 -13475
- package/dist/react-blender-nodes.es.js.map +1 -1
- package/dist/react-blender-nodes.umd.js +214 -97
- package/dist/react-blender-nodes.umd.js.map +1 -1
- package/package.json +8 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,38 +1,65 @@
|
|
|
1
|
+
import { Accordion as Accordion_2 } from 'radix-ui';
|
|
2
|
+
import { Action as Action_2 } from '../../../utils';
|
|
1
3
|
import { ActionDispatch } from 'react';
|
|
2
4
|
import { ClassProp } from 'class-variance-authority/types';
|
|
3
5
|
import { ClassValue } from 'clsx';
|
|
4
6
|
import { ComponentProps } from 'react';
|
|
7
|
+
import { ComponentType } from 'react';
|
|
5
8
|
import { Connection } from '@xyflow/react';
|
|
6
9
|
import { Context } from 'react';
|
|
10
|
+
import { ContextData } from '@floating-ui/react';
|
|
7
11
|
import { ControlLinePosition } from '@xyflow/react';
|
|
8
12
|
import { ControlPosition } from '@xyflow/react';
|
|
13
|
+
import { CSSProperties } from 'react';
|
|
14
|
+
import { default as default_2 } from 'zod';
|
|
15
|
+
import { Dispatch } from 'react';
|
|
9
16
|
import { Edge } from '@xyflow/react';
|
|
10
17
|
import { EdgeChange } from '@xyflow/react';
|
|
11
18
|
import { EdgeLabelOptions } from '@xyflow/react';
|
|
12
19
|
import { EdgePosition } from '@xyflow/system';
|
|
13
20
|
import { EdgeProps } from '@xyflow/react';
|
|
21
|
+
import { ExtendedElements } from '@floating-ui/react';
|
|
22
|
+
import { ExtendedRefs } from '@floating-ui/react';
|
|
14
23
|
import { FC } from 'react';
|
|
24
|
+
import { FloatingEvents } from '@floating-ui/react';
|
|
15
25
|
import { ForwardRefExoticComponent } from 'react';
|
|
16
26
|
import { HandleShape as HandleShape_2 } from '../..';
|
|
17
27
|
import { HandleType } from '@xyflow/react';
|
|
18
28
|
import { HTMLAttributes } from 'react';
|
|
19
29
|
import { JSX } from 'react/jsx-runtime';
|
|
30
|
+
import { MiddlewareData } from '@floating-ui/core';
|
|
31
|
+
import { MutableRefObject } from 'react';
|
|
20
32
|
import { Node as Node_2 } from '@xyflow/react';
|
|
21
33
|
import { NodeChange } from '@xyflow/react';
|
|
22
34
|
import { NodeProps } from '@xyflow/react';
|
|
23
35
|
import { NodeResizerProps } from '@xyflow/react';
|
|
36
|
+
import { OpenChangeReason } from '@floating-ui/react';
|
|
37
|
+
import { Placement } from '@floating-ui/react';
|
|
24
38
|
import { Position } from '@xyflow/react';
|
|
39
|
+
import * as React_2 from 'react';
|
|
25
40
|
import { ReactNode } from 'react';
|
|
26
41
|
import { RefAttributes } from 'react';
|
|
42
|
+
import { ReferenceType } from '@floating-ui/react';
|
|
43
|
+
import { ReferenceType as ReferenceType_2 } from '@floating-ui/react-dom';
|
|
27
44
|
import { RefObject } from 'react';
|
|
28
45
|
import { ResizeControlDirection } from '@xyflow/system';
|
|
29
46
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
47
|
+
import { SetStateAction } from 'react';
|
|
48
|
+
import { Strategy } from '@floating-ui/utils';
|
|
30
49
|
import { TypeOfNode as TypeOfNode_2 } from './types';
|
|
31
50
|
import { VariantProps } from 'class-variance-authority';
|
|
32
51
|
import { Viewport } from '@xyflow/react';
|
|
33
52
|
import { XYPosition } from '@xyflow/react';
|
|
34
53
|
import { z } from 'zod';
|
|
35
54
|
|
|
55
|
+
export declare function Accordion({ ...props }: React_2.ComponentProps<typeof Accordion_2.Root>): JSX.Element;
|
|
56
|
+
|
|
57
|
+
export declare function AccordionContent({ className, children, ...props }: React_2.ComponentProps<typeof Accordion_2.Content>): JSX.Element;
|
|
58
|
+
|
|
59
|
+
export declare function AccordionItem({ className, ...props }: React_2.ComponentProps<typeof Accordion_2.Item>): JSX.Element;
|
|
60
|
+
|
|
61
|
+
export declare function AccordionTrigger({ className, children, ...props }: React_2.ComponentProps<typeof Accordion_2.Trigger>): JSX.Element;
|
|
62
|
+
|
|
36
63
|
/**
|
|
37
64
|
* Union type of all possible actions for the graph state reducer
|
|
38
65
|
*
|
|
@@ -114,6 +141,13 @@ export declare type Action<DataTypeUniqueId extends string = string, NodeTypeUni
|
|
|
114
141
|
/** Current viewport of the graph */
|
|
115
142
|
viewport: Viewport;
|
|
116
143
|
};
|
|
144
|
+
} | {
|
|
145
|
+
/** Replace the entire graph state (used by import) */
|
|
146
|
+
type: typeof actionTypesMap.REPLACE_STATE;
|
|
147
|
+
payload: {
|
|
148
|
+
/** The new state to replace the current state with */
|
|
149
|
+
state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>;
|
|
150
|
+
};
|
|
117
151
|
};
|
|
118
152
|
|
|
119
153
|
/** Map of action types for type-safe action dispatching */
|
|
@@ -128,6 +162,7 @@ export declare const actionTypesMap: {
|
|
|
128
162
|
readonly CLOSE_NODE_GROUP: "CLOSE_NODE_GROUP";
|
|
129
163
|
readonly ADD_NODE_GROUP: "ADD_NODE_GROUP";
|
|
130
164
|
readonly SET_VIEWPORT: "SET_VIEWPORT";
|
|
165
|
+
readonly REPLACE_STATE: "REPLACE_STATE";
|
|
131
166
|
};
|
|
132
167
|
|
|
133
168
|
export declare function addAnInputOrOutputToAllNodesOfANodeTypeAcrossStateIncludingSubtrees<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, nodeType: NodeTypeUniqueId, typeOfInputOrOutput: TypeOfInput<DataTypeUniqueId>, addAtIndex: HandleIndices, beforeOrAfterIndex?: 'before' | 'after'): Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes' | 'nodes' | 'edges'>;
|
|
@@ -232,6 +267,23 @@ export declare type ButtonProps = ComponentProps<'button'> & VariantProps<typeof
|
|
|
232
267
|
asChild?: boolean;
|
|
233
268
|
};
|
|
234
269
|
|
|
270
|
+
export declare function ButtonToggle<T extends string>({ options, value, onChange, disabled, size, className, }: ButtonToggleProps<T>): JSX.Element;
|
|
271
|
+
|
|
272
|
+
export declare type ButtonToggleOption<T extends string> = {
|
|
273
|
+
value: T;
|
|
274
|
+
label: string;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export declare type ButtonToggleProps<T extends string> = {
|
|
278
|
+
options: readonly ButtonToggleOption<T>[];
|
|
279
|
+
value: T;
|
|
280
|
+
onChange: (value: T) => void;
|
|
281
|
+
disabled?: boolean;
|
|
282
|
+
/** @default 'normal' */
|
|
283
|
+
size?: 'small' | 'normal';
|
|
284
|
+
className?: string;
|
|
285
|
+
};
|
|
286
|
+
|
|
235
287
|
declare const buttonVariants: (props?: ({
|
|
236
288
|
color?: "dark" | "lightNonPriority" | "lightPriority" | "lightParentGroupBasedHover" | null | undefined;
|
|
237
289
|
applyHoverStyles?: boolean | null | undefined;
|
|
@@ -270,6 +322,17 @@ declare const buttonVariants: (props?: ({
|
|
|
270
322
|
*/
|
|
271
323
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
272
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Recording of a single concurrency level's execution.
|
|
327
|
+
*/
|
|
328
|
+
declare type ConcurrencyLevelRecord = {
|
|
329
|
+
level: number;
|
|
330
|
+
startTime: number;
|
|
331
|
+
endTime: number;
|
|
332
|
+
duration: number;
|
|
333
|
+
nodeIds: ReadonlyArray<string>;
|
|
334
|
+
};
|
|
335
|
+
|
|
273
336
|
/**
|
|
274
337
|
* A configurable edge component with gradient colors and viewport optimization
|
|
275
338
|
*
|
|
@@ -396,14 +459,16 @@ export declare type ConfigurableEdgeState = Edge<{}, 'configurableEdge'>;
|
|
|
396
459
|
* ```
|
|
397
460
|
*/
|
|
398
461
|
export declare const ConfigurableNode: ForwardRefExoticComponent< {
|
|
462
|
+
/** Unique identifier for the node, for debugging when enableDebugMode is true and inside react flow */
|
|
463
|
+
id?: string;
|
|
399
464
|
/** Display name of the node */
|
|
400
465
|
name?: string;
|
|
401
466
|
/** Background color of the node header */
|
|
402
467
|
headerColor?: string;
|
|
403
468
|
/** Array of inputs and input panels */
|
|
404
|
-
inputs?: (ConfigurableNodeInput<"string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", never, string> | ConfigurableNodeInputPanel<"string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", never, string>)[] | undefined;
|
|
469
|
+
inputs?: (ConfigurableNodeInput<"string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never, string> | ConfigurableNodeInputPanel<"string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never, string>)[] | undefined;
|
|
405
470
|
/** Array of output sockets */
|
|
406
|
-
outputs?: ConfigurableNodeOutput<"string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", never, string>[] | undefined;
|
|
471
|
+
outputs?: ConfigurableNodeOutput<"string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never, string>[] | undefined;
|
|
407
472
|
/** Whether the node is currently inside a ReactFlow context */
|
|
408
473
|
isCurrentlyInsideReactFlow?: boolean;
|
|
409
474
|
/** Props for the node resizer component */
|
|
@@ -416,6 +481,12 @@ nodeTypeUniqueId?: string | undefined;
|
|
|
416
481
|
* @default false
|
|
417
482
|
*/
|
|
418
483
|
showNodeOpenButton?: boolean;
|
|
484
|
+
/** Runner visual state for this node (undefined = no runner overlay) */
|
|
485
|
+
runnerVisualState?: NodeVisualState;
|
|
486
|
+
/** Errors from the runner for this node */
|
|
487
|
+
runnerErrors?: ReadonlyArray<GraphError>;
|
|
488
|
+
/** Warnings from the runner for this node (e.g., missing implementation) */
|
|
489
|
+
runnerWarnings?: ReadonlyArray<string>;
|
|
419
490
|
} & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
|
|
420
491
|
|
|
421
492
|
/**
|
|
@@ -435,6 +506,8 @@ export declare type ConfigurableNodeInput<UnderlyingType extends SupportedUnderl
|
|
|
435
506
|
handleShape?: HandleShape;
|
|
436
507
|
/** Whether to show an interactive input component when not connected */
|
|
437
508
|
allowInput?: boolean;
|
|
509
|
+
/** Maximum number of connections for this input */
|
|
510
|
+
maxConnections?: number;
|
|
438
511
|
/** Data type of the input, used by full graph */
|
|
439
512
|
dataType?: {
|
|
440
513
|
dataTypeObject: DataType<UnderlyingType, ComplexSchemaType>;
|
|
@@ -459,6 +532,20 @@ export declare type ConfigurableNodeInput<UnderlyingType extends SupportedUnderl
|
|
|
459
532
|
value?: number;
|
|
460
533
|
/** Callback when the input value changes */
|
|
461
534
|
onChange?: (value: number) => void;
|
|
535
|
+
} | {
|
|
536
|
+
/** */
|
|
537
|
+
type: 'boolean';
|
|
538
|
+
/** Current value of the input */
|
|
539
|
+
value?: boolean;
|
|
540
|
+
/** Callback when the input value changes */
|
|
541
|
+
onChange?: (value: boolean) => void;
|
|
542
|
+
} | {
|
|
543
|
+
/** Unsupported input type */
|
|
544
|
+
type: 'unsupportedDirectly';
|
|
545
|
+
/** Current value of the input */
|
|
546
|
+
value?: unknown;
|
|
547
|
+
/** Callback when the input value changes */
|
|
548
|
+
onChange?: (value: unknown) => void;
|
|
462
549
|
});
|
|
463
550
|
|
|
464
551
|
/**
|
|
@@ -489,6 +576,8 @@ export declare type ConfigurableNodeOutput<UnderlyingType extends SupportedUnder
|
|
|
489
576
|
handleColor?: string;
|
|
490
577
|
/** Shape of the output handle (circle, square, diamond, etc.) */
|
|
491
578
|
handleShape?: HandleShape;
|
|
579
|
+
/** Maximum number of connections for this output */
|
|
580
|
+
maxConnections?: number;
|
|
492
581
|
/** Data type of the output, used by full graph */
|
|
493
582
|
dataType?: {
|
|
494
583
|
dataTypeObject: DataType<UnderlyingType, ComplexSchemaType>;
|
|
@@ -505,6 +594,12 @@ export declare type ConfigurableNodeOutput<UnderlyingType extends SupportedUnder
|
|
|
505
594
|
} | {
|
|
506
595
|
/** Number output type */
|
|
507
596
|
type: 'number';
|
|
597
|
+
} | {
|
|
598
|
+
/** Boolean output type */
|
|
599
|
+
type: 'boolean';
|
|
600
|
+
} | {
|
|
601
|
+
/** Unsupported output type */
|
|
602
|
+
type: 'unsupportedDirectly';
|
|
508
603
|
});
|
|
509
604
|
|
|
510
605
|
/**
|
|
@@ -514,6 +609,8 @@ export declare type ConfigurableNodeOutput<UnderlyingType extends SupportedUnder
|
|
|
514
609
|
* and optional panels. Supports both standalone usage and ReactFlow integration.
|
|
515
610
|
*/
|
|
516
611
|
export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = {
|
|
612
|
+
/** Unique identifier for the node, for debugging when enableDebugMode is true and inside react flow */
|
|
613
|
+
id?: string;
|
|
517
614
|
/** Display name of the node */
|
|
518
615
|
name?: string;
|
|
519
616
|
/** Background color of the node header */
|
|
@@ -534,6 +631,12 @@ export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderl
|
|
|
534
631
|
* @default false
|
|
535
632
|
*/
|
|
536
633
|
showNodeOpenButton?: boolean;
|
|
634
|
+
/** Runner visual state for this node (undefined = no runner overlay) */
|
|
635
|
+
runnerVisualState?: NodeVisualState;
|
|
636
|
+
/** Errors from the runner for this node */
|
|
637
|
+
runnerErrors?: ReadonlyArray<GraphError>;
|
|
638
|
+
/** Warnings from the runner for this node (e.g., missing implementation) */
|
|
639
|
+
runnerWarnings?: ReadonlyArray<string>;
|
|
537
640
|
} & HTMLAttributes<HTMLDivElement>;
|
|
538
641
|
|
|
539
642
|
/**
|
|
@@ -579,7 +682,7 @@ export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderl
|
|
|
579
682
|
* />
|
|
580
683
|
* ```
|
|
581
684
|
*/
|
|
582
|
-
export declare const ConfigurableNodeReactFlowWrapper: ForwardRefExoticComponent<Omit<ConfigurableNodeReactFlowWrapperProps<"string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", string, never, string>, "position"> & RefAttributes<HTMLDivElement>>;
|
|
685
|
+
export declare const ConfigurableNodeReactFlowWrapper: ForwardRefExoticComponent<Omit<ConfigurableNodeReactFlowWrapperProps<"string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", string, never, string>, "position"> & RefAttributes<HTMLDivElement>>;
|
|
583
686
|
|
|
584
687
|
/** Props for the ConfigurableNodeReactFlowWrapper component */
|
|
585
688
|
export declare type ConfigurableNodeReactFlowWrapperProps<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = NodeProps<ConfigurableNodeState<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>> & {
|
|
@@ -823,6 +926,8 @@ id: string;
|
|
|
823
926
|
color?: string;
|
|
824
927
|
/** Shape of the handle */
|
|
825
928
|
shape?: HandleShape;
|
|
929
|
+
/** Maximum number of connections for this handle */
|
|
930
|
+
maxConnections?: number;
|
|
826
931
|
/** Whether the handle is currently inside a ReactFlow context */
|
|
827
932
|
isCurrentlyInsideReactFlow?: boolean;
|
|
828
933
|
} & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
|
|
@@ -841,6 +946,8 @@ export declare type ContextAwareHandleProps = {
|
|
|
841
946
|
color?: string;
|
|
842
947
|
/** Shape of the handle */
|
|
843
948
|
shape?: HandleShape;
|
|
949
|
+
/** Maximum number of connections for this handle */
|
|
950
|
+
maxConnections?: number;
|
|
844
951
|
/** Whether the handle is currently inside a ReactFlow context */
|
|
845
952
|
isCurrentlyInsideReactFlow?: boolean;
|
|
846
953
|
} & HTMLAttributes<HTMLDivElement>;
|
|
@@ -876,7 +983,7 @@ export declare type ContextAwareHandleProps = {
|
|
|
876
983
|
* />
|
|
877
984
|
* ```
|
|
878
985
|
*/
|
|
879
|
-
export declare const ContextAwareInput: ({ input, isCurrentlyInsideReactFlow, }: ContextAwareInputProps) => JSX.Element;
|
|
986
|
+
export declare const ContextAwareInput: ({ input, isCurrentlyInsideReactFlow, }: ContextAwareInputProps) => JSX.Element | null;
|
|
880
987
|
|
|
881
988
|
/**
|
|
882
989
|
* Props for the ContextAwareInput component
|
|
@@ -1054,6 +1161,25 @@ export declare type Coordinate = {
|
|
|
1054
1161
|
y: number;
|
|
1055
1162
|
};
|
|
1056
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* Create a type-safe context value from concrete generic params.
|
|
1166
|
+
*
|
|
1167
|
+
* This is the single centralized point where generic variance on dispatch
|
|
1168
|
+
* is bridged. React's createContext doesn't support generic type parameters,
|
|
1169
|
+
* so providing a concrete FullGraphProps<'andGate', ...> to a context typed
|
|
1170
|
+
* as FullGraphProps<string, ...> requires a variance bridge.
|
|
1171
|
+
*
|
|
1172
|
+
* Safety justification: context consumers dispatch actions using
|
|
1173
|
+
* actionTypesMap constants which produce valid payloads regardless of
|
|
1174
|
+
* the concrete generic params. The contravariance on dispatch is safe
|
|
1175
|
+
* because all consumer dispatches originate from user interactions
|
|
1176
|
+
* (right-click menu, group selector) that use the correct node type IDs.
|
|
1177
|
+
*/
|
|
1178
|
+
export declare function createContextValue(props: {
|
|
1179
|
+
state: unknown;
|
|
1180
|
+
dispatch: unknown;
|
|
1181
|
+
}, nodeRunnerStates?: ReadonlyMap<string, NodeRunnerState>, selectedStepRecord?: ExecutionStepRecord | null, edgeValuesAnimated?: boolean): React.ContextType<typeof FullGraphContext>;
|
|
1182
|
+
|
|
1057
1183
|
/**
|
|
1058
1184
|
* Creates a context menu tree for adding nodes
|
|
1059
1185
|
* @param typeOfNodes - The available node types
|
|
@@ -1105,6 +1231,8 @@ export declare type DataType<UnderlyingType extends SupportedUnderlyingTypes = S
|
|
|
1105
1231
|
shape?: HandleShape;
|
|
1106
1232
|
/** Whether this input allows direct user input */
|
|
1107
1233
|
allowInput?: boolean;
|
|
1234
|
+
/** Maximum number of connections for this data type */
|
|
1235
|
+
maxConnections?: number;
|
|
1108
1236
|
} : {
|
|
1109
1237
|
/** Display name of the data type */
|
|
1110
1238
|
name: string;
|
|
@@ -1118,8 +1246,23 @@ export declare type DataType<UnderlyingType extends SupportedUnderlyingTypes = S
|
|
|
1118
1246
|
shape?: HandleShape;
|
|
1119
1247
|
/** Whether this input allows direct user input */
|
|
1120
1248
|
allowInput?: boolean;
|
|
1249
|
+
/** Maximum number of connections for this data type */
|
|
1250
|
+
maxConnections?: number;
|
|
1121
1251
|
};
|
|
1122
1252
|
|
|
1253
|
+
/**
|
|
1254
|
+
* Deserialize a serialized ExecutionRecord back to the original type.
|
|
1255
|
+
* Converts all Record fields back to ReadonlyMaps and deserializes errors.
|
|
1256
|
+
*/
|
|
1257
|
+
export declare function deserializeExecutionRecord(obj: SerializedExecutionRecord): ExecutionRecord;
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Deserialize a serialized GraphError back to the original type.
|
|
1261
|
+
* The `originalError` remains in its serialized form since the
|
|
1262
|
+
* original Error instance cannot be reconstructed.
|
|
1263
|
+
*/
|
|
1264
|
+
export declare function deserializeGraphError(obj: SerializedGraphError): GraphError;
|
|
1265
|
+
|
|
1123
1266
|
/**
|
|
1124
1267
|
* Array of edge changes for ReactFlow
|
|
1125
1268
|
*/
|
|
@@ -1130,6 +1273,245 @@ export declare type EdgeChanges = EdgeChange<ConfigurableEdgeState>[];
|
|
|
1130
1273
|
*/
|
|
1131
1274
|
export declare type Edges = ConfigurableEdgeState[];
|
|
1132
1275
|
|
|
1276
|
+
/**
|
|
1277
|
+
* Runtime context provided to every function implementation call.
|
|
1278
|
+
* Contains node identity, graph state reference, and control signals.
|
|
1279
|
+
*/
|
|
1280
|
+
/**
|
|
1281
|
+
* Runtime context passed to each function implementation.
|
|
1282
|
+
*
|
|
1283
|
+
* Non-generic to avoid contravariance: since FunctionImplementation takes
|
|
1284
|
+
* context as a parameter (contravariant position), generic params here would
|
|
1285
|
+
* make FunctionImplementations<ConcreteType> invariant — breaking assignment
|
|
1286
|
+
* to FunctionImplementations<string>. Using default (widened) types for state
|
|
1287
|
+
* keeps FunctionImplementations covariant in NodeTypeUniqueId.
|
|
1288
|
+
*/
|
|
1289
|
+
declare type ExecutionContext = {
|
|
1290
|
+
/** Runtime node instance ID */
|
|
1291
|
+
nodeId: string;
|
|
1292
|
+
/** Node type ID from the type definitions */
|
|
1293
|
+
nodeTypeId: string;
|
|
1294
|
+
/** Display name of the node type */
|
|
1295
|
+
nodeTypeName: string;
|
|
1296
|
+
/** Read-only reference to the full graph state */
|
|
1297
|
+
state: Readonly<State<string, string, SupportedUnderlyingTypes, z.ZodType>>;
|
|
1298
|
+
/** Current loop iteration (only set when executing inside a loop body) */
|
|
1299
|
+
loopIteration?: number;
|
|
1300
|
+
/** Current group nesting depth (only set when executing inside a group) */
|
|
1301
|
+
groupDepth?: number;
|
|
1302
|
+
/** Signal for cooperative cancellation */
|
|
1303
|
+
abortSignal: AbortSignal;
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Complete recording of an execution run, containing all
|
|
1308
|
+
* step records, timing data, errors, and loop/group records.
|
|
1309
|
+
* Used by the timeline/replay UI to visualize execution history.
|
|
1310
|
+
*/
|
|
1311
|
+
declare type ExecutionRecord = {
|
|
1312
|
+
/** Unique identifier for this execution run */
|
|
1313
|
+
id: string;
|
|
1314
|
+
/** Absolute start time (performance.now()) */
|
|
1315
|
+
startTime: number;
|
|
1316
|
+
/** Absolute end time (performance.now()) */
|
|
1317
|
+
endTime: number;
|
|
1318
|
+
/** Total execution duration (ms) — wall-clock time */
|
|
1319
|
+
totalDuration: number;
|
|
1320
|
+
/**
|
|
1321
|
+
* Time spent warming up the JS engine before execution (ms).
|
|
1322
|
+
* The first nodes in a session pay a JIT compilation cost; this
|
|
1323
|
+
* warmup phase absorbs that cost so recorded step timings are accurate.
|
|
1324
|
+
*/
|
|
1325
|
+
compilationDuration: number;
|
|
1326
|
+
/**
|
|
1327
|
+
* Total time spent paused during execution (ms).
|
|
1328
|
+
* Only non-zero in step-by-step mode. Subtract from totalDuration
|
|
1329
|
+
* to get execution-only duration.
|
|
1330
|
+
*/
|
|
1331
|
+
totalPauseDuration: number;
|
|
1332
|
+
/** Final status of the execution */
|
|
1333
|
+
status: ExecutionRecordStatus;
|
|
1334
|
+
/** All step records in execution order */
|
|
1335
|
+
steps: ReadonlyArray<ExecutionStepRecord>;
|
|
1336
|
+
/** All errors that occurred during execution */
|
|
1337
|
+
errors: ReadonlyArray<GraphError>;
|
|
1338
|
+
/** Timing data per concurrency level */
|
|
1339
|
+
concurrencyLevels: ReadonlyArray<ConcurrencyLevelRecord>;
|
|
1340
|
+
/** Loop execution recordings, keyed by loop structure ID */
|
|
1341
|
+
loopRecords: ReadonlyMap<string, LoopRecord>;
|
|
1342
|
+
/** Group execution recordings, keyed by group node instance ID */
|
|
1343
|
+
groupRecords: ReadonlyMap<string, GroupRecord>;
|
|
1344
|
+
/** Complete ValueStore snapshot at end of execution ("nodeId:handleId" -> value) */
|
|
1345
|
+
finalValues: ReadonlyMap<string, unknown>;
|
|
1346
|
+
/** UI preferences captured when the recording was saved */
|
|
1347
|
+
viewState?: RecordingViewState;
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
declare type ExecutionRecordStatus = (typeof executionRecordStatuses)[number];
|
|
1351
|
+
|
|
1352
|
+
declare const executionRecordStatuses: readonly ["completed", "errored", "cancelled"];
|
|
1353
|
+
|
|
1354
|
+
export declare function ExecutionStepInspector({ stepRecord, onClose, loopRecords, hideComplexValues, debugMode, edgeValuesAnimated, onEdgeValuesAnimatedChange, }: ExecutionStepInspectorProps): JSX.Element | null;
|
|
1355
|
+
|
|
1356
|
+
export declare type ExecutionStepInspectorProps = {
|
|
1357
|
+
/** The step record to inspect (null to hide) */
|
|
1358
|
+
stepRecord: ExecutionStepRecord | null;
|
|
1359
|
+
/** Close the inspector */
|
|
1360
|
+
onClose: () => void;
|
|
1361
|
+
/** Loop records for enriched loop context display */
|
|
1362
|
+
loopRecords?: ReadonlyMap<string, LoopRecord>;
|
|
1363
|
+
/** Replace complex values with type summaries */
|
|
1364
|
+
hideComplexValues?: boolean;
|
|
1365
|
+
/** Show node IDs and handle IDs alongside display names */
|
|
1366
|
+
debugMode?: boolean;
|
|
1367
|
+
/** Whether edge values animate along the path or display statically */
|
|
1368
|
+
edgeValuesAnimated?: boolean;
|
|
1369
|
+
/** Called when the edge animation toggle changes */
|
|
1370
|
+
onEdgeValuesAnimatedChange?: (animated: boolean) => void;
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* Recording of a single step's execution, including timing,
|
|
1375
|
+
* input/output values, and any error that occurred.
|
|
1376
|
+
*/
|
|
1377
|
+
declare type ExecutionStepRecord = {
|
|
1378
|
+
stepIndex: number;
|
|
1379
|
+
nodeId: string;
|
|
1380
|
+
nodeTypeId: string;
|
|
1381
|
+
nodeTypeName: string;
|
|
1382
|
+
concurrencyLevel: number;
|
|
1383
|
+
/** Time relative to execution start (ms) */
|
|
1384
|
+
startTime: number;
|
|
1385
|
+
/** Time relative to execution start (ms) */
|
|
1386
|
+
endTime: number;
|
|
1387
|
+
/** Duration of this step (ms) */
|
|
1388
|
+
duration: number;
|
|
1389
|
+
/**
|
|
1390
|
+
* Cumulative pause duration (ms) at the moment this step started.
|
|
1391
|
+
* Subtract from startTime/endTime to get execution-only timestamps
|
|
1392
|
+
* (removes user idle time from step-by-step mode).
|
|
1393
|
+
* Always 0 in instant mode.
|
|
1394
|
+
*/
|
|
1395
|
+
pauseAdjustment: number;
|
|
1396
|
+
status: ExecutionStepRecordStatus;
|
|
1397
|
+
/** Snapshot of resolved input values at execution time (handleName -> RecordedInputHandleValue) */
|
|
1398
|
+
inputValues: ReadonlyMap<string, RecordedInputHandleValue>;
|
|
1399
|
+
/** Snapshot of computed output values (handleName -> RecordedOutputHandleValue) */
|
|
1400
|
+
outputValues: ReadonlyMap<string, RecordedOutputHandleValue>;
|
|
1401
|
+
/** Error details (only when status === 'errored') */
|
|
1402
|
+
error?: GraphError;
|
|
1403
|
+
/** Loop iteration number (only when inside a loop body) */
|
|
1404
|
+
loopIteration?: number;
|
|
1405
|
+
/** Loop structure identifier (only when inside a loop body) */
|
|
1406
|
+
loopStructureId?: string;
|
|
1407
|
+
/** @deprecated Use hierarchical LoopIterationRecord.nestedLoopRecords instead */
|
|
1408
|
+
parentLoopStructureId?: string;
|
|
1409
|
+
/** @deprecated Use hierarchical LoopIterationRecord.nestedLoopRecords instead */
|
|
1410
|
+
parentLoopIteration?: number;
|
|
1411
|
+
/** Group node instance ID (only when inside a group scope) */
|
|
1412
|
+
groupNodeId?: string;
|
|
1413
|
+
/** Group nesting depth (only when inside a group scope) */
|
|
1414
|
+
groupDepth?: number;
|
|
1415
|
+
/**
|
|
1416
|
+
* True when the step's duration was below timer resolution
|
|
1417
|
+
* (performance.now() returned the same value for start and end).
|
|
1418
|
+
* Displayed as "< 0.1ms" in the UI instead of an exact value.
|
|
1419
|
+
*/
|
|
1420
|
+
estimatedTiming?: boolean;
|
|
1421
|
+
/** Position within the loop iteration lifecycle. Determines vertical
|
|
1422
|
+
* ordering in the timeline and controls edge animation behavior. */
|
|
1423
|
+
loopPhase?: LoopPhase;
|
|
1424
|
+
/** For LoopStart steps: whether the input came from upstream nodes
|
|
1425
|
+
* (iteration 0) or from LoopStop feedback (iteration N>0).
|
|
1426
|
+
* Controls which edges animate and what the inspector shows. */
|
|
1427
|
+
inputSource?: 'upstream' | 'feedback';
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
declare type ExecutionStepRecordStatus = (typeof executionStepRecordStatuses)[number];
|
|
1431
|
+
|
|
1432
|
+
declare const executionStepRecordStatuses: readonly ["completed", "errored", "skipped"];
|
|
1433
|
+
|
|
1434
|
+
export declare function ExecutionTimeline({ record, currentStepIndex, onScrubTo, onStepClick, selectedStepIndex, onNavigateToNode, }: ExecutionTimelineProps): JSX.Element;
|
|
1435
|
+
|
|
1436
|
+
export declare type ExecutionTimelineProps = {
|
|
1437
|
+
record: ExecutionRecord | null;
|
|
1438
|
+
currentStepIndex: number;
|
|
1439
|
+
onScrubTo: (stepIndex: number) => void;
|
|
1440
|
+
onStepClick: (stepRecord: ExecutionStepRecord) => void;
|
|
1441
|
+
selectedStepIndex: number | null;
|
|
1442
|
+
/** Called when the user navigates to a node via prev/next buttons. */
|
|
1443
|
+
onNavigateToNode?: (nodeId: string) => void;
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* JSON envelope for exported execution records.
|
|
1448
|
+
* All ReadonlyMap fields are converted to plain objects,
|
|
1449
|
+
* errors are serialized, and values are made JSON-safe.
|
|
1450
|
+
*/
|
|
1451
|
+
export declare type ExportedExecutionRecord = {
|
|
1452
|
+
version: 1;
|
|
1453
|
+
exportedAt: string;
|
|
1454
|
+
record: Record<string, unknown>;
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* JSON envelope for exported graph state.
|
|
1459
|
+
* The `state` field contains the serialized State with non-serializable
|
|
1460
|
+
* fields stripped (complexSchema, onChange, etc.).
|
|
1461
|
+
*/
|
|
1462
|
+
export declare type ExportedGraphState = {
|
|
1463
|
+
version: 1;
|
|
1464
|
+
exportedAt: string;
|
|
1465
|
+
state: Record<string, unknown>;
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1468
|
+
/**
|
|
1469
|
+
* Export an execution record to a JSON string.
|
|
1470
|
+
*
|
|
1471
|
+
* Converts all ReadonlyMap fields to plain objects, serializes
|
|
1472
|
+
* GraphError.originalError to a JSON-safe form, and safely
|
|
1473
|
+
* serializes all unknown values (functions → placeholder strings).
|
|
1474
|
+
*
|
|
1475
|
+
* @param record - The execution record to export
|
|
1476
|
+
* @param options - Export options (pretty-print, etc.)
|
|
1477
|
+
* @returns JSON string of the exported record
|
|
1478
|
+
*
|
|
1479
|
+
* @example
|
|
1480
|
+
* ```ts
|
|
1481
|
+
* const json = exportExecutionRecord(record, { pretty: true });
|
|
1482
|
+
* // Save to file, download, etc.
|
|
1483
|
+
* ```
|
|
1484
|
+
*/
|
|
1485
|
+
export declare function exportExecutionRecord(record: ExecutionRecord, options?: ExportOptions): string;
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* Export a graph state to a JSON string.
|
|
1489
|
+
*
|
|
1490
|
+
* Strips non-serializable fields:
|
|
1491
|
+
* - `complexSchema` (Zod class instance) from dataTypes
|
|
1492
|
+
* - `onChange` callbacks from handles
|
|
1493
|
+
* - `complexSchema` from handle `dataType.dataTypeObject`
|
|
1494
|
+
*
|
|
1495
|
+
* @param state - The graph state to export
|
|
1496
|
+
* @param options - Export options (pretty-print, etc.)
|
|
1497
|
+
* @returns JSON string of the exported state
|
|
1498
|
+
*
|
|
1499
|
+
* @example
|
|
1500
|
+
* ```ts
|
|
1501
|
+
* const json = exportGraphState(state, { pretty: true });
|
|
1502
|
+
* // Save to file, download, etc.
|
|
1503
|
+
* ```
|
|
1504
|
+
*/
|
|
1505
|
+
export declare function exportGraphState<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, options?: ExportOptions): string;
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Options for export functions.
|
|
1509
|
+
*/
|
|
1510
|
+
export declare type ExportOptions = {
|
|
1511
|
+
/** Whether to pretty-print the JSON output (2-space indent) */
|
|
1512
|
+
pretty?: boolean;
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1133
1515
|
/**
|
|
1134
1516
|
* Main graph editor component inspired by Blender's node editor
|
|
1135
1517
|
*
|
|
@@ -1216,10 +1598,16 @@ export declare type Edges = ConfigurableEdgeState[];
|
|
|
1216
1598
|
* }
|
|
1217
1599
|
* ```
|
|
1218
1600
|
*/
|
|
1219
|
-
export declare function FullGraph<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>({ state, dispatch, }: FullGraphProps<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): JSX.Element;
|
|
1601
|
+
export declare function FullGraph<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>({ state, dispatch, functionImplementations, onStateImported, onRecordingImported, onImportError, executionRecord, onExecutionRecordChange, }: FullGraphProps<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): JSX.Element;
|
|
1220
1602
|
|
|
1221
1603
|
export declare const FullGraphContext: Context< {
|
|
1222
1604
|
allProps: FullGraphProps;
|
|
1605
|
+
/** Optional map of nodeId -> runner visual state. Provided by useNodeRunner. */
|
|
1606
|
+
nodeRunnerStates?: ReadonlyMap<string, NodeRunnerState>;
|
|
1607
|
+
/** The currently inspected execution step record (when a timeline block is selected). */
|
|
1608
|
+
selectedStepRecord?: ExecutionStepRecord | null;
|
|
1609
|
+
/** Whether edge value display is animated (true) or static (false). */
|
|
1610
|
+
edgeValuesAnimated?: boolean;
|
|
1223
1611
|
}>;
|
|
1224
1612
|
|
|
1225
1613
|
/**
|
|
@@ -1237,6 +1625,50 @@ export declare type FullGraphProps<DataTypeUniqueId extends string = string, Nod
|
|
|
1237
1625
|
dispatch: ActionDispatch<[
|
|
1238
1626
|
action: Action<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>
|
|
1239
1627
|
]>;
|
|
1628
|
+
functionImplementations?: FunctionImplementations<NodeTypeUniqueId>;
|
|
1629
|
+
/** Called when state is successfully imported. Receives the raw parsed state. */
|
|
1630
|
+
onStateImported?: (importedState: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>) => void;
|
|
1631
|
+
/** Called when a recording is successfully imported. Receives the parsed ExecutionRecord. */
|
|
1632
|
+
onRecordingImported?: (record: ExecutionRecord) => void;
|
|
1633
|
+
/** Called when import validation fails. Receives the error messages. */
|
|
1634
|
+
onImportError?: (errors: string[]) => void;
|
|
1635
|
+
/** Controlled execution record. When provided, FullGraph uses this instead of internal state. */
|
|
1636
|
+
executionRecord?: ExecutionRecord | null;
|
|
1637
|
+
/** Called whenever the execution record changes (run completes, reset, load, etc.). */
|
|
1638
|
+
onExecutionRecordChange?: (record: ExecutionRecord | null) => void;
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* A single node type's execution function.
|
|
1643
|
+
*
|
|
1644
|
+
* Receives resolved input values keyed by handle **name** and output handle
|
|
1645
|
+
* metadata keyed by handle **name**. Returns a Map of output handle **names**
|
|
1646
|
+
* to computed values.
|
|
1647
|
+
*
|
|
1648
|
+
* May return synchronously (Map) or asynchronously (Promise<Map>).
|
|
1649
|
+
*
|
|
1650
|
+
* @example
|
|
1651
|
+
* ```ts
|
|
1652
|
+
* const andGate: FunctionImplementation = (inputs, outputs, ctx) => {
|
|
1653
|
+
* const a = inputs.get('A')?.connections[0]?.value ?? false;
|
|
1654
|
+
* const b = inputs.get('B')?.connections[0]?.value ?? false;
|
|
1655
|
+
* return new Map([['Out', Boolean(a) && Boolean(b)]]);
|
|
1656
|
+
* };
|
|
1657
|
+
* ```
|
|
1658
|
+
*/
|
|
1659
|
+
declare type FunctionImplementation = (inputs: ReadonlyMap<string, InputHandleValue>, outputs: ReadonlyMap<string, OutputHandleInfo>, context: ExecutionContext) => Map<string, unknown> | Promise<Map<string, unknown>>;
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* Map of node type IDs to their function implementations.
|
|
1663
|
+
* Standard node types (loopStart, loopEnd, etc.) are excluded
|
|
1664
|
+
* since they have built-in execution logic.
|
|
1665
|
+
*
|
|
1666
|
+
* Implementations are optional — missing implementations
|
|
1667
|
+
* generate warnings at compile time and errors only if the node
|
|
1668
|
+
* is actually reached during execution.
|
|
1669
|
+
*/
|
|
1670
|
+
declare type FunctionImplementations<NodeTypeUniqueId extends string = string> = {
|
|
1671
|
+
[K in Exclude<NodeTypeUniqueId, (typeof standardNodeTypeNames)[number]>]?: FunctionImplementation;
|
|
1240
1672
|
};
|
|
1241
1673
|
|
|
1242
1674
|
/**
|
|
@@ -1295,11 +1727,80 @@ export declare function getDirectDependenciesOfNodeType<DataTypeUniqueId extends
|
|
|
1295
1727
|
*/
|
|
1296
1728
|
export declare function getDirectDependentsOfNodeType<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(stateOrNodeToNodeDependents: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes'> | Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>, nodeType: NodeTypeUniqueId): Set<NodeTypeUniqueId>;
|
|
1297
1729
|
|
|
1298
|
-
export declare function getResultantDataTypeOfHandleConsideringInferredType<DataTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(handle: ConfigurableNodeInput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | ConfigurableNodeOutput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | undefined): {
|
|
1730
|
+
export declare function getResultantDataTypeOfHandleConsideringInferredType<DataTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(handle: ConfigurableNodeInput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | ConfigurableNodeOutput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | undefined, fallbackToInferFromConnectionTypeWhenNotInferred?: boolean): {
|
|
1299
1731
|
dataTypeObject: DataType<UnderlyingType, ComplexSchemaType>;
|
|
1300
1732
|
dataTypeUniqueId: DataTypeUniqueId;
|
|
1301
1733
|
} | undefined;
|
|
1302
1734
|
|
|
1735
|
+
/**
|
|
1736
|
+
* A rich error type capturing the full context of where and
|
|
1737
|
+
* how an error occurred during graph execution.
|
|
1738
|
+
*
|
|
1739
|
+
* Includes the error message, the node that errored, the full
|
|
1740
|
+
* execution path leading to it, and optional loop/group context.
|
|
1741
|
+
*/
|
|
1742
|
+
declare type GraphError = {
|
|
1743
|
+
/** Human-readable error message */
|
|
1744
|
+
message: string;
|
|
1745
|
+
/** ID of the node where the error occurred */
|
|
1746
|
+
nodeId: string;
|
|
1747
|
+
/** Node type ID */
|
|
1748
|
+
nodeTypeId: string;
|
|
1749
|
+
/** Display name of the node type */
|
|
1750
|
+
nodeTypeName: string;
|
|
1751
|
+
/** Handle ID where the error manifested (if applicable) */
|
|
1752
|
+
handleId?: string;
|
|
1753
|
+
/** Ordered list of nodes in the execution path leading to this error */
|
|
1754
|
+
path: ReadonlyArray<GraphErrorPathEntry>;
|
|
1755
|
+
/** Loop context (if the error occurred inside a loop) */
|
|
1756
|
+
loopContext?: {
|
|
1757
|
+
loopStructureId: string;
|
|
1758
|
+
iteration: number;
|
|
1759
|
+
maxIterations: number;
|
|
1760
|
+
};
|
|
1761
|
+
/** Group context (if the error occurred inside a node group) */
|
|
1762
|
+
groupContext?: {
|
|
1763
|
+
groupNodeId: string;
|
|
1764
|
+
groupNodeTypeId: string;
|
|
1765
|
+
depth: number;
|
|
1766
|
+
};
|
|
1767
|
+
/** Timestamp when the error occurred (performance.now() relative to run start) */
|
|
1768
|
+
timestamp: number;
|
|
1769
|
+
/** Duration of the step before the error (ms) */
|
|
1770
|
+
duration: number;
|
|
1771
|
+
/** The original thrown error value */
|
|
1772
|
+
originalError: unknown;
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* One entry in the error's execution path trace,
|
|
1777
|
+
* showing the chain of nodes that led to the error.
|
|
1778
|
+
*/
|
|
1779
|
+
declare type GraphErrorPathEntry = {
|
|
1780
|
+
nodeId: string;
|
|
1781
|
+
nodeTypeId: string;
|
|
1782
|
+
nodeTypeName: string;
|
|
1783
|
+
handleId?: string;
|
|
1784
|
+
concurrencyLevel: number;
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1787
|
+
export declare const groupNodeContextMenu: {
|
|
1788
|
+
locationInContextMenu: string[];
|
|
1789
|
+
priorityInContextMenu: number;
|
|
1790
|
+
};
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* Recording of a node group's execution, containing
|
|
1794
|
+
* the recursive inner execution record.
|
|
1795
|
+
*/
|
|
1796
|
+
declare type GroupRecord = {
|
|
1797
|
+
groupNodeId: string;
|
|
1798
|
+
groupNodeTypeId: string;
|
|
1799
|
+
innerRecord: ExecutionRecord;
|
|
1800
|
+
inputMapping: ReadonlyMap<string, unknown>;
|
|
1801
|
+
outputMapping: ReadonlyMap<string, unknown>;
|
|
1802
|
+
};
|
|
1803
|
+
|
|
1303
1804
|
declare type HandleIndices = {
|
|
1304
1805
|
type: 'input';
|
|
1305
1806
|
index1: number;
|
|
@@ -1330,6 +1831,74 @@ export declare const handleShapesMap: {
|
|
|
1330
1831
|
readonly parallelogram: "parallelogram";
|
|
1331
1832
|
};
|
|
1332
1833
|
|
|
1834
|
+
/**
|
|
1835
|
+
* Import an execution record from a JSON string.
|
|
1836
|
+
*
|
|
1837
|
+
* Validates the structure, applies any enabled repair strategies,
|
|
1838
|
+
* and deserializes all Record fields back to ReadonlyMaps.
|
|
1839
|
+
*
|
|
1840
|
+
* @param json - The JSON string to import
|
|
1841
|
+
* @param options - Import options (validation callbacks, repair strategies)
|
|
1842
|
+
* @returns ImportResult with the deserialized ExecutionRecord or validation errors
|
|
1843
|
+
*
|
|
1844
|
+
* @example
|
|
1845
|
+
* ```ts
|
|
1846
|
+
* const result = importExecutionRecord(json, {
|
|
1847
|
+
* onValidationError: (issue) => console.warn(issue),
|
|
1848
|
+
* repair: { sanitizeNonSerializableValues: true },
|
|
1849
|
+
* });
|
|
1850
|
+
*
|
|
1851
|
+
* if (result.success) {
|
|
1852
|
+
* // Use result.data as ExecutionRecord
|
|
1853
|
+
* } else {
|
|
1854
|
+
* // Handle result.errors
|
|
1855
|
+
* }
|
|
1856
|
+
* ```
|
|
1857
|
+
*/
|
|
1858
|
+
export declare function importExecutionRecord(json: string, options?: RecordImportOptions): ImportResult<ExecutionRecord>;
|
|
1859
|
+
|
|
1860
|
+
/**
|
|
1861
|
+
* Import a graph state from a JSON string.
|
|
1862
|
+
*
|
|
1863
|
+
* Validates the structure, applies any enabled repair strategies,
|
|
1864
|
+
* and rehydrates non-serializable fields (complexSchema, dataTypeObject)
|
|
1865
|
+
* from the user-provided `dataTypes` and `typeOfNodes`.
|
|
1866
|
+
*
|
|
1867
|
+
* @param json - The JSON string to import
|
|
1868
|
+
* @param options - Import options including dataTypes/typeOfNodes for rehydration
|
|
1869
|
+
* @returns ImportResult with the rehydrated State or validation errors
|
|
1870
|
+
*
|
|
1871
|
+
* @example
|
|
1872
|
+
* ```ts
|
|
1873
|
+
* const result = importGraphState(json, {
|
|
1874
|
+
* dataTypes: myDataTypes,
|
|
1875
|
+
* typeOfNodes: myTypeOfNodes,
|
|
1876
|
+
* onValidationError: (issue) => console.warn(issue),
|
|
1877
|
+
* repair: { removeOrphanEdges: true, fillMissingDefaults: true },
|
|
1878
|
+
* });
|
|
1879
|
+
*
|
|
1880
|
+
* if (result.success) {
|
|
1881
|
+
* // Use result.data as State
|
|
1882
|
+
* } else {
|
|
1883
|
+
* // Handle result.errors
|
|
1884
|
+
* }
|
|
1885
|
+
* ```
|
|
1886
|
+
*/
|
|
1887
|
+
export declare function importGraphState<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(json: string, options: StateImportOptions<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): ImportResult<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>>;
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Result of an import operation. Discriminated union on `success`.
|
|
1891
|
+
*/
|
|
1892
|
+
export declare type ImportResult<T> = {
|
|
1893
|
+
success: true;
|
|
1894
|
+
data: T;
|
|
1895
|
+
warnings: ValidationIssue[];
|
|
1896
|
+
} | {
|
|
1897
|
+
success: false;
|
|
1898
|
+
errors: ValidationIssue[];
|
|
1899
|
+
warnings: ValidationIssue[];
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1333
1902
|
/**
|
|
1334
1903
|
* The Input component
|
|
1335
1904
|
* - Allows the user to input a string or a number, with the ability to only allow numbers
|
|
@@ -1338,6 +1907,58 @@ export declare const handleShapesMap: {
|
|
|
1338
1907
|
*/
|
|
1339
1908
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
1340
1909
|
|
|
1910
|
+
/**
|
|
1911
|
+
* Represents a single incoming connection to an input handle,
|
|
1912
|
+
* carrying the value produced by the source and full metadata
|
|
1913
|
+
* about which node and handle it came from.
|
|
1914
|
+
*/
|
|
1915
|
+
declare type InputConnectionValue = {
|
|
1916
|
+
/** The value produced by the source output handle */
|
|
1917
|
+
value: unknown;
|
|
1918
|
+
/** Source node instance ID */
|
|
1919
|
+
sourceNodeId: string;
|
|
1920
|
+
/** Source node display name (from typeOfNodes) */
|
|
1921
|
+
sourceNodeName: string;
|
|
1922
|
+
/** Source node type ID (key in typeOfNodes) */
|
|
1923
|
+
sourceNodeTypeId: string;
|
|
1924
|
+
/** Source output handle ID (unique per node instance) */
|
|
1925
|
+
sourceHandleId: string;
|
|
1926
|
+
/** Source output handle display name */
|
|
1927
|
+
sourceHandleName: string;
|
|
1928
|
+
/** Source output handle data type ID */
|
|
1929
|
+
sourceDataTypeId: string;
|
|
1930
|
+
/** Edge ID connecting source to target */
|
|
1931
|
+
edgeId: string;
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* Represents the resolved connections and metadata for a single input
|
|
1936
|
+
* handle during execution. The map key in `FunctionImplementation` is
|
|
1937
|
+
* the handle's **name** from the node type definition.
|
|
1938
|
+
*
|
|
1939
|
+
* `connections` is **always** an array — even for single connections:
|
|
1940
|
+
* - 1 incoming edge → `connections` has 1 entry
|
|
1941
|
+
* - N incoming edges (fan-in) → `connections` has N entries
|
|
1942
|
+
* - No edges → `connections` is empty, `isDefault` is true
|
|
1943
|
+
*
|
|
1944
|
+
* For default (unconnected) inputs with `allowInput`, the user-entered
|
|
1945
|
+
* value is available in `defaultValue`.
|
|
1946
|
+
*/
|
|
1947
|
+
declare type InputHandleValue = {
|
|
1948
|
+
/** All incoming connection values — always an array, one entry per edge */
|
|
1949
|
+
connections: ReadonlyArray<InputConnectionValue>;
|
|
1950
|
+
/** Runtime handle ID (unique per node instance) */
|
|
1951
|
+
handleId: string;
|
|
1952
|
+
/** Display name from the node type definition */
|
|
1953
|
+
handleName: string;
|
|
1954
|
+
/** Data type unique ID for this handle */
|
|
1955
|
+
dataTypeId: string;
|
|
1956
|
+
/** True when no edges exist — value comes from user-entered default */
|
|
1957
|
+
isDefault: boolean;
|
|
1958
|
+
/** The user-entered default value (only meaningful when isDefault is true) */
|
|
1959
|
+
defaultValue?: unknown;
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1341
1962
|
/**
|
|
1342
1963
|
* Props for the Input component
|
|
1343
1964
|
*/
|
|
@@ -1454,6 +2075,54 @@ export declare function isSupportedUnderlyingType(type: string): type is Support
|
|
|
1454
2075
|
*/
|
|
1455
2076
|
export declare function isValidDataTypeId<DataTypeUniqueId extends string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(id: string, dataTypes: Record<DataTypeUniqueId, DataType<UnderlyingType, ComplexSchemaType>>): id is DataTypeUniqueId;
|
|
1456
2077
|
|
|
2078
|
+
export declare const loopEndInputInferHandleIndex = 1;
|
|
2079
|
+
|
|
2080
|
+
export declare const loopEndOutputInferHandleIndex = 0;
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Recording of a single loop iteration.
|
|
2084
|
+
*/
|
|
2085
|
+
declare type LoopIterationRecord = {
|
|
2086
|
+
iteration: number;
|
|
2087
|
+
startTime: number;
|
|
2088
|
+
endTime: number;
|
|
2089
|
+
duration: number;
|
|
2090
|
+
conditionValue: boolean;
|
|
2091
|
+
stepRecords: ReadonlyArray<ExecutionStepRecord>;
|
|
2092
|
+
/** Loop records for nested loops that executed within this iteration. */
|
|
2093
|
+
nestedLoopRecords: ReadonlyMap<string, LoopRecord>;
|
|
2094
|
+
};
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* Phases within a single loop iteration lifecycle.
|
|
2098
|
+
* Used for deterministic ordering in the timeline and controlling
|
|
2099
|
+
* edge animation behavior.
|
|
2100
|
+
*/
|
|
2101
|
+
declare type LoopPhase = 'loopStart' | 'preStop' | 'loopStop' | 'postStop' | 'loopEnd';
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Complete recording of a loop structure's execution.
|
|
2105
|
+
*/
|
|
2106
|
+
declare type LoopRecord = {
|
|
2107
|
+
loopStructureId: string;
|
|
2108
|
+
loopStartNodeId: string;
|
|
2109
|
+
loopStopNodeId: string;
|
|
2110
|
+
loopEndNodeId: string;
|
|
2111
|
+
iterations: ReadonlyArray<LoopIterationRecord>;
|
|
2112
|
+
totalIterations: number;
|
|
2113
|
+
startTime: number;
|
|
2114
|
+
endTime: number;
|
|
2115
|
+
duration: number;
|
|
2116
|
+
};
|
|
2117
|
+
|
|
2118
|
+
export declare const loopStartInputInferHandleIndex = 0;
|
|
2119
|
+
|
|
2120
|
+
export declare const loopStartOutputInferHandleIndex = 1;
|
|
2121
|
+
|
|
2122
|
+
export declare const loopStopInputInferHandleIndex = 2;
|
|
2123
|
+
|
|
2124
|
+
export declare const loopStopOutputInferHandleIndex = 1;
|
|
2125
|
+
|
|
1457
2126
|
/**
|
|
1458
2127
|
* Main reducer function for managing graph state
|
|
1459
2128
|
*
|
|
@@ -1665,6 +2334,11 @@ export declare function makeStateWithAutoInfer<DataTypeUniqueId extends string =
|
|
|
1665
2334
|
*/
|
|
1666
2335
|
export declare function makeTypeOfNodeWithAutoInfer<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(input: TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>;
|
|
1667
2336
|
|
|
2337
|
+
/**
|
|
2338
|
+
* Convert a ReadonlyMap to a plain Record for JSON serialization.
|
|
2339
|
+
*/
|
|
2340
|
+
export declare function mapToRecord<T>(map: ReadonlyMap<string, T>): Record<string, T>;
|
|
2341
|
+
|
|
1668
2342
|
/**
|
|
1669
2343
|
* Array of node changes for ReactFlow
|
|
1670
2344
|
*/
|
|
@@ -1737,15 +2411,80 @@ export declare type NodeResizerWithMoreControlsProps = NodeResizerProps & {
|
|
|
1737
2411
|
resizeDirection?: ResizeControlDirection;
|
|
1738
2412
|
};
|
|
1739
2413
|
|
|
2414
|
+
/**
|
|
2415
|
+
* Per-node runner state provided via context so the ReactFlow wrapper
|
|
2416
|
+
* can apply visual indicators without prop drilling.
|
|
2417
|
+
*/
|
|
2418
|
+
export declare type NodeRunnerState = {
|
|
2419
|
+
visualState: NodeVisualState;
|
|
2420
|
+
errors?: ReadonlyArray<GraphError>;
|
|
2421
|
+
warnings?: ReadonlyArray<string>;
|
|
2422
|
+
};
|
|
2423
|
+
|
|
1740
2424
|
/**
|
|
1741
2425
|
* Array of configurable nodes in the graph
|
|
1742
2426
|
*/
|
|
1743
2427
|
export declare type Nodes<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = Optional<ConfigurableNodeReactFlowWrapperProps<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>, NodeOptionalKeys>[];
|
|
1744
2428
|
|
|
2429
|
+
/**
|
|
2430
|
+
* Outline overlay and icon indicator for a node's execution state.
|
|
2431
|
+
* Uses CSS `outline` (not `border`) so the indicator never affects
|
|
2432
|
+
* the node's layout or size.
|
|
2433
|
+
*
|
|
2434
|
+
* Visual states:
|
|
2435
|
+
* - `idle`: No visual change
|
|
2436
|
+
* - `running`: Dashed blue outline with breathing glow
|
|
2437
|
+
* - `completed`: Solid green outline (persists)
|
|
2438
|
+
* - `errored`: Solid red outline + AlertCircle icon with error tooltip
|
|
2439
|
+
* - `skipped`: Dimmed opacity, dashed gray outline
|
|
2440
|
+
* - `warning`: Solid orange outline + AlertTriangle icon with warning tooltip
|
|
2441
|
+
*/
|
|
2442
|
+
export declare function NodeStatusIndicator({ visualState, errors, warnings, children, }: NodeStatusIndicatorProps): JSX.Element;
|
|
2443
|
+
|
|
2444
|
+
/**
|
|
2445
|
+
* Props for the NodeStatusIndicator component.
|
|
2446
|
+
*
|
|
2447
|
+
* Renders a border overlay and optional icon on top of a node
|
|
2448
|
+
* to indicate its execution visual state.
|
|
2449
|
+
*/
|
|
2450
|
+
export declare type NodeStatusIndicatorProps = {
|
|
2451
|
+
/** Current visual state of the node */
|
|
2452
|
+
visualState: NodeVisualState;
|
|
2453
|
+
/** Errors associated with this node (shown on hover when errored) */
|
|
2454
|
+
errors?: ReadonlyArray<GraphError>;
|
|
2455
|
+
/** Warning messages (shown on hover when warning) */
|
|
2456
|
+
warnings?: ReadonlyArray<string>;
|
|
2457
|
+
/** The node content to wrap */
|
|
2458
|
+
children: ReactNode;
|
|
2459
|
+
};
|
|
2460
|
+
|
|
2461
|
+
declare type NodeVisualState = (typeof nodeVisualStates)[number];
|
|
2462
|
+
|
|
2463
|
+
declare const nodeVisualStates: readonly ["idle", "running", "completed", "errored", "skipped", "warning"];
|
|
2464
|
+
|
|
1745
2465
|
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
1746
2466
|
|
|
1747
2467
|
declare type Orientation = 'horizontal' | 'vertical';
|
|
1748
2468
|
|
|
2469
|
+
/**
|
|
2470
|
+
* Metadata about a single output handle, passed to the function
|
|
2471
|
+
* implementation so it knows what outputs to produce.
|
|
2472
|
+
*/
|
|
2473
|
+
declare type OutputHandleInfo = {
|
|
2474
|
+
/** Runtime handle ID (unique per node instance) */
|
|
2475
|
+
handleId: string;
|
|
2476
|
+
/** Display name from the node type definition */
|
|
2477
|
+
handleName: string;
|
|
2478
|
+
/** Data type unique ID for this handle */
|
|
2479
|
+
dataTypeId: string;
|
|
2480
|
+
/** All edges consuming this output handle's value */
|
|
2481
|
+
connections: ReadonlyArray<{
|
|
2482
|
+
targetNodeId: string;
|
|
2483
|
+
targetHandleId: string;
|
|
2484
|
+
edgeId: string;
|
|
2485
|
+
}>;
|
|
2486
|
+
};
|
|
2487
|
+
|
|
1749
2488
|
/**
|
|
1750
2489
|
* ReactFlow-aware input component that automatically updates node data
|
|
1751
2490
|
*
|
|
@@ -1756,7 +2495,7 @@ declare type Orientation = 'horizontal' | 'vertical';
|
|
|
1756
2495
|
* @param props - The component props
|
|
1757
2496
|
* @returns JSX element containing the appropriate input component
|
|
1758
2497
|
*/
|
|
1759
|
-
export declare const ReactFlowAwareInput: ({ input }: ReactFlowAwareInputProps) => JSX.Element;
|
|
2498
|
+
export declare const ReactFlowAwareInput: ({ input }: ReactFlowAwareInputProps) => JSX.Element | null;
|
|
1760
2499
|
|
|
1761
2500
|
/**
|
|
1762
2501
|
* Props for the ReactFlowAwareInput component
|
|
@@ -1782,6 +2521,114 @@ export declare const ReactFlowAwareOpenButton: ({}: ReactFlowAwareOpenButtonProp
|
|
|
1782
2521
|
*/
|
|
1783
2522
|
export declare type ReactFlowAwareOpenButtonProps = {};
|
|
1784
2523
|
|
|
2524
|
+
export declare const RecordContext: Context<RecordContextValue>;
|
|
2525
|
+
|
|
2526
|
+
declare type RecordContextValue = {
|
|
2527
|
+
executionRecord: ExecutionRecord | null;
|
|
2528
|
+
setExecutionRecord: (record: ExecutionRecord | null) => void;
|
|
2529
|
+
};
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* Recorded snapshot of a single incoming connection to an input handle.
|
|
2533
|
+
* Contains the value and source metadata for display in the inspector.
|
|
2534
|
+
*/
|
|
2535
|
+
declare type RecordedInputConnection = {
|
|
2536
|
+
/** The value that arrived through this connection */
|
|
2537
|
+
value: unknown;
|
|
2538
|
+
/** Source node instance ID */
|
|
2539
|
+
sourceNodeId: string;
|
|
2540
|
+
/** Source node display name */
|
|
2541
|
+
sourceNodeName: string;
|
|
2542
|
+
/** Source output handle ID */
|
|
2543
|
+
sourceHandleId: string;
|
|
2544
|
+
/** Source output handle display name */
|
|
2545
|
+
sourceHandleName: string;
|
|
2546
|
+
/** Source output handle data type ID */
|
|
2547
|
+
sourceDataTypeId: string;
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2550
|
+
/**
|
|
2551
|
+
* Recorded snapshot of an input handle's resolved state.
|
|
2552
|
+
* Contains per-connection detail for the inspector to display
|
|
2553
|
+
* each connection on its own line with source node/handle names.
|
|
2554
|
+
*/
|
|
2555
|
+
declare type RecordedInputHandleValue = {
|
|
2556
|
+
/** All incoming connections — always an array, one per edge */
|
|
2557
|
+
connections: ReadonlyArray<RecordedInputConnection>;
|
|
2558
|
+
/** Data type unique ID for this input handle */
|
|
2559
|
+
dataTypeId: string;
|
|
2560
|
+
/** True when no edges exist — value came from user-entered default */
|
|
2561
|
+
isDefault: boolean;
|
|
2562
|
+
/** The user-entered default value (only when isDefault is true) */
|
|
2563
|
+
defaultValue?: unknown;
|
|
2564
|
+
};
|
|
2565
|
+
|
|
2566
|
+
/**
|
|
2567
|
+
* Recorded snapshot of an output handle's computed value.
|
|
2568
|
+
*/
|
|
2569
|
+
declare type RecordedOutputHandleValue = {
|
|
2570
|
+
/** The computed value for this output handle */
|
|
2571
|
+
value: unknown;
|
|
2572
|
+
/** Data type unique ID for this output handle */
|
|
2573
|
+
dataTypeId: string;
|
|
2574
|
+
/** Number of target nodes consuming this output (fan-out count) */
|
|
2575
|
+
targetCount: number;
|
|
2576
|
+
};
|
|
2577
|
+
|
|
2578
|
+
/**
|
|
2579
|
+
* Options for importing execution records.
|
|
2580
|
+
*/
|
|
2581
|
+
export declare type RecordImportOptions = {
|
|
2582
|
+
/** Called for each validation issue found during import */
|
|
2583
|
+
onValidationError?: (issue: ValidationIssue) => void;
|
|
2584
|
+
/** Repair strategies to apply (all default to false) */
|
|
2585
|
+
repair?: Partial<RecordRepairStrategies>;
|
|
2586
|
+
};
|
|
2587
|
+
|
|
2588
|
+
/**
|
|
2589
|
+
* Captures the UI state of the timeline and runner panel at the time
|
|
2590
|
+
* a recording is saved. All fields are optional so older recordings
|
|
2591
|
+
* without viewState still load correctly.
|
|
2592
|
+
*/
|
|
2593
|
+
declare type RecordingViewState = {
|
|
2594
|
+
/** Currently selected step index in the timeline (null = none) */
|
|
2595
|
+
selectedStepIndex?: number | null;
|
|
2596
|
+
/** Whether edge value badges animate along the path */
|
|
2597
|
+
edgeValuesAnimated?: boolean;
|
|
2598
|
+
/** Whether the auto-scroll (timeline + canvas) toggle is on */
|
|
2599
|
+
autoScroll?: boolean;
|
|
2600
|
+
/** Run mode used for this recording */
|
|
2601
|
+
runMode?: 'instant' | 'stepByStep';
|
|
2602
|
+
/** Max loop iterations setting */
|
|
2603
|
+
maxLoopIterations?: number;
|
|
2604
|
+
/** Whether the runner panel drawer is open */
|
|
2605
|
+
panelOpen?: boolean;
|
|
2606
|
+
/** Timeline time-mode toggle */
|
|
2607
|
+
timeMode?: 'execution' | 'wallClock';
|
|
2608
|
+
/** Timeline collapsed state */
|
|
2609
|
+
timelineCollapsed?: boolean;
|
|
2610
|
+
/** Which loop iterations are expanded (loopStructureId → iteration index) */
|
|
2611
|
+
selectedIterations?: Record<string, number>;
|
|
2612
|
+
/** Autoplay interval in seconds */
|
|
2613
|
+
autoplayIntervalSec?: number;
|
|
2614
|
+
};
|
|
2615
|
+
|
|
2616
|
+
/**
|
|
2617
|
+
* Opt-in repair strategies for execution record import.
|
|
2618
|
+
* All default to `false` — must be explicitly enabled.
|
|
2619
|
+
*/
|
|
2620
|
+
export declare type RecordRepairStrategies = {
|
|
2621
|
+
/** Replace non-serializable step values with "[non-serializable]" */
|
|
2622
|
+
sanitizeNonSerializableValues: boolean;
|
|
2623
|
+
/** Remove steps referencing nodes not present in the record */
|
|
2624
|
+
removeOrphanSteps: boolean;
|
|
2625
|
+
};
|
|
2626
|
+
|
|
2627
|
+
/**
|
|
2628
|
+
* Convert a plain Record back to a ReadonlyMap.
|
|
2629
|
+
*/
|
|
2630
|
+
export declare function recordToReadonlyMap<T>(obj: Record<string, T> | null | undefined): ReadonlyMap<string, T>;
|
|
2631
|
+
|
|
1785
2632
|
/**
|
|
1786
2633
|
* Removes an edge between two handles with type checking and inference
|
|
1787
2634
|
*
|
|
@@ -1811,6 +2658,59 @@ export declare function removeEdgeWithTypeChecking<DataTypeUniqueId extends stri
|
|
|
1811
2658
|
validation: ConnectionValidationResult;
|
|
1812
2659
|
};
|
|
1813
2660
|
|
|
2661
|
+
/**
|
|
2662
|
+
* Control bar for running/debugging the graph.
|
|
2663
|
+
*
|
|
2664
|
+
* Layout:
|
|
2665
|
+
* ```
|
|
2666
|
+
* ● Status | [▶] [⏸] [⏭] [⏹] [↺] | [Instant/Step] | Max loops: [100]
|
|
2667
|
+
* ```
|
|
2668
|
+
*/
|
|
2669
|
+
export declare function RunControls({ runnerState, onRun, onPause, onStep, onStop, onReset, mode, onModeChange, maxLoopIterations, onMaxLoopIterationsChange, }: RunControlsProps): JSX.Element;
|
|
2670
|
+
|
|
2671
|
+
/**
|
|
2672
|
+
* Props for the RunControls component.
|
|
2673
|
+
*/
|
|
2674
|
+
export declare type RunControlsProps = {
|
|
2675
|
+
/** Current runner state machine state */
|
|
2676
|
+
runnerState: RunnerState;
|
|
2677
|
+
/** Start or resume execution */
|
|
2678
|
+
onRun: () => void;
|
|
2679
|
+
/** Pause a running execution */
|
|
2680
|
+
onPause: () => void;
|
|
2681
|
+
/** Execute one step forward (starts step-by-step if idle) */
|
|
2682
|
+
onStep: () => void;
|
|
2683
|
+
/** Stop and cancel execution */
|
|
2684
|
+
onStop: () => void;
|
|
2685
|
+
/** Reset runner back to idle */
|
|
2686
|
+
onReset: () => void;
|
|
2687
|
+
/** Current execution mode */
|
|
2688
|
+
mode: RunMode;
|
|
2689
|
+
/** Change execution mode */
|
|
2690
|
+
onModeChange: (mode: RunMode) => void;
|
|
2691
|
+
/** Max loop iterations before error */
|
|
2692
|
+
maxLoopIterations: number;
|
|
2693
|
+
/** Update max loop iterations */
|
|
2694
|
+
onMaxLoopIterationsChange: (max: number) => void;
|
|
2695
|
+
};
|
|
2696
|
+
|
|
2697
|
+
/**
|
|
2698
|
+
* Execution mode: instant runs the whole graph then enables replay,
|
|
2699
|
+
* stepByStep pauses between each execution step.
|
|
2700
|
+
*/
|
|
2701
|
+
export declare type RunMode = 'instant' | 'stepByStep';
|
|
2702
|
+
|
|
2703
|
+
declare type RunnerState = (typeof runnerStates)[number];
|
|
2704
|
+
|
|
2705
|
+
declare const runnerStates: readonly ["idle", "compiling", "running", "paused", "completed", "errored"];
|
|
2706
|
+
|
|
2707
|
+
/**
|
|
2708
|
+
* Safely serialize a value for JSON. Primitives, plain objects, and arrays
|
|
2709
|
+
* pass through unchanged. Functions, symbols, and other non-serializable
|
|
2710
|
+
* values are replaced with a placeholder string.
|
|
2711
|
+
*/
|
|
2712
|
+
export declare function safeSerializeValue(value: unknown): unknown;
|
|
2713
|
+
|
|
1814
2714
|
/**
|
|
1815
2715
|
* Sanitizes a number to be shown as a text, removing the trailing zeros after the decimal point if the number is an integer
|
|
1816
2716
|
* @param value - The number to sanitize
|
|
@@ -2097,6 +2997,65 @@ export declare const SelectValue: ForwardRefExoticComponent<Omit<SelectPrimitive
|
|
|
2097
2997
|
*/
|
|
2098
2998
|
export declare type SelectValueProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
|
|
2099
2999
|
|
|
3000
|
+
declare type SerializedExecutionRecord = Omit<ExecutionRecord, 'steps' | 'errors' | 'loopRecords' | 'groupRecords' | 'finalValues' | 'concurrencyLevels'> & {
|
|
3001
|
+
steps: ReadonlyArray<SerializedStepRecord>;
|
|
3002
|
+
errors: ReadonlyArray<SerializedGraphError>;
|
|
3003
|
+
concurrencyLevels: ReadonlyArray<ConcurrencyLevelRecord>;
|
|
3004
|
+
loopRecords: Record<string, SerializedLoopRecord>;
|
|
3005
|
+
groupRecords: Record<string, SerializedGroupRecord>;
|
|
3006
|
+
finalValues: Record<string, unknown>;
|
|
3007
|
+
};
|
|
3008
|
+
|
|
3009
|
+
/** Serialized form of a GraphError (JSON-safe). */
|
|
3010
|
+
declare type SerializedGraphError = Omit<GraphError, 'originalError' | 'path'> & {
|
|
3011
|
+
originalError: unknown;
|
|
3012
|
+
path: ReadonlyArray<GraphErrorPathEntry>;
|
|
3013
|
+
};
|
|
3014
|
+
|
|
3015
|
+
declare type SerializedGroupRecord = Omit<GroupRecord, 'innerRecord' | 'inputMapping' | 'outputMapping'> & {
|
|
3016
|
+
innerRecord: SerializedExecutionRecord;
|
|
3017
|
+
inputMapping: Record<string, unknown>;
|
|
3018
|
+
outputMapping: Record<string, unknown>;
|
|
3019
|
+
};
|
|
3020
|
+
|
|
3021
|
+
declare type SerializedLoopIterationRecord = Omit<LoopIterationRecord, 'stepRecords' | 'nestedLoopRecords'> & {
|
|
3022
|
+
stepRecords: ReadonlyArray<SerializedStepRecord>;
|
|
3023
|
+
nestedLoopRecords?: Record<string, SerializedLoopRecord>;
|
|
3024
|
+
};
|
|
3025
|
+
|
|
3026
|
+
declare type SerializedLoopRecord = Omit<LoopRecord, 'iterations'> & {
|
|
3027
|
+
iterations: ReadonlyArray<SerializedLoopIterationRecord>;
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
declare type SerializedRecordedInputHandleValue = Omit<RecordedInputHandleValue, 'connections'> & {
|
|
3031
|
+
connections: ReadonlyArray<RecordedInputConnection>;
|
|
3032
|
+
defaultValue?: unknown;
|
|
3033
|
+
};
|
|
3034
|
+
|
|
3035
|
+
declare type SerializedRecordedOutputHandleValue = Omit<RecordedOutputHandleValue, 'value'> & {
|
|
3036
|
+
value: unknown;
|
|
3037
|
+
};
|
|
3038
|
+
|
|
3039
|
+
declare type SerializedStepRecord = Omit<ExecutionStepRecord, 'inputValues' | 'outputValues' | 'error'> & {
|
|
3040
|
+
inputValues: Record<string, SerializedRecordedInputHandleValue>;
|
|
3041
|
+
outputValues: Record<string, SerializedRecordedOutputHandleValue>;
|
|
3042
|
+
error?: SerializedGraphError;
|
|
3043
|
+
};
|
|
3044
|
+
|
|
3045
|
+
/**
|
|
3046
|
+
* Serialize an ExecutionRecord to a JSON-safe plain object.
|
|
3047
|
+
* Converts all ReadonlyMap fields to Records, serializes errors,
|
|
3048
|
+
* and safely serializes all values. Handles recursive GroupRecords.
|
|
3049
|
+
*/
|
|
3050
|
+
export declare function serializeExecutionRecord(record: ExecutionRecord): SerializedExecutionRecord;
|
|
3051
|
+
|
|
3052
|
+
/**
|
|
3053
|
+
* Serialize a GraphError to a JSON-safe form.
|
|
3054
|
+
* `originalError` (which can be an Error object or anything) is
|
|
3055
|
+
* converted to a structured JSON-safe representation.
|
|
3056
|
+
*/
|
|
3057
|
+
export declare function serializeGraphError(err: GraphError): SerializedGraphError;
|
|
3058
|
+
|
|
2100
3059
|
export declare function setCurrentNodesAndEdgesToStateWithMutatingState<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'nodes' | 'edges' | 'typeOfNodes' | 'openedNodeGroupStack' | 'dataTypes'>, nodes?: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodes'], edges?: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['edges']): State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>;
|
|
2101
3060
|
|
|
2102
3061
|
/**
|
|
@@ -2146,6 +3105,17 @@ export declare function setCurrentNodesAndEdgesToStateWithMutatingState<DataType
|
|
|
2146
3105
|
* min={0}
|
|
2147
3106
|
* max={1000}
|
|
2148
3107
|
* />
|
|
3108
|
+
*
|
|
3109
|
+
* // Small variant for toolbars
|
|
3110
|
+
* <SliderNumberInput
|
|
3111
|
+
* name="Interval"
|
|
3112
|
+
* value={1}
|
|
3113
|
+
* min={0.5}
|
|
3114
|
+
* max={30}
|
|
3115
|
+
* step={0.5}
|
|
3116
|
+
* size="small"
|
|
3117
|
+
* onChange={(value) => setInterval(value)}
|
|
3118
|
+
* />
|
|
2149
3119
|
* ```
|
|
2150
3120
|
*/
|
|
2151
3121
|
export declare const SliderNumberInput: ForwardRefExoticComponent<SliderNumberInputProps & RefAttributes<HTMLInputElement & HTMLDivElement>>;
|
|
@@ -2168,44 +3138,81 @@ export declare type SliderNumberInputProps = {
|
|
|
2168
3138
|
max?: number;
|
|
2169
3139
|
/** Step size for value changes */
|
|
2170
3140
|
step?: number;
|
|
3141
|
+
/** Size variant. "normal" is the canvas-friendly default, "small" is compact for toolbars. */
|
|
3142
|
+
size?: 'normal' | 'small';
|
|
3143
|
+
/** Number of decimal places to display (default: 4 for normal, 1 for small) */
|
|
3144
|
+
decimals?: number;
|
|
2171
3145
|
};
|
|
2172
3146
|
|
|
2173
|
-
export declare const standardDataTypeNames: readonly ["
|
|
3147
|
+
export declare const standardDataTypeNames: readonly ["groupInfer", "loopInfer", "condition", "bindLoopNodes"];
|
|
2174
3148
|
|
|
2175
3149
|
export declare const standardDataTypeNamesMap: {
|
|
2176
|
-
readonly
|
|
2177
|
-
readonly
|
|
3150
|
+
readonly groupInfer: "groupInfer";
|
|
3151
|
+
readonly loopInfer: "loopInfer";
|
|
3152
|
+
readonly condition: "condition";
|
|
3153
|
+
readonly bindLoopNodes: "bindLoopNodes";
|
|
2178
3154
|
};
|
|
2179
3155
|
|
|
2180
3156
|
export declare const standardDataTypes: {
|
|
2181
|
-
|
|
3157
|
+
readonly groupInfer: {
|
|
2182
3158
|
name: string;
|
|
2183
3159
|
underlyingType: "inferFromConnection";
|
|
2184
3160
|
complexSchema?: undefined;
|
|
2185
3161
|
color: string;
|
|
2186
3162
|
shape?: HandleShape_2;
|
|
2187
3163
|
allowInput?: boolean;
|
|
3164
|
+
maxConnections?: number;
|
|
2188
3165
|
};
|
|
2189
|
-
|
|
3166
|
+
readonly loopInfer: {
|
|
2190
3167
|
name: string;
|
|
2191
3168
|
underlyingType: "inferFromConnection";
|
|
2192
3169
|
complexSchema?: undefined;
|
|
2193
3170
|
color: string;
|
|
2194
3171
|
shape?: HandleShape_2;
|
|
2195
3172
|
allowInput?: boolean;
|
|
3173
|
+
maxConnections?: number;
|
|
3174
|
+
};
|
|
3175
|
+
readonly condition: {
|
|
3176
|
+
name: string;
|
|
3177
|
+
underlyingType: "boolean";
|
|
3178
|
+
complexSchema?: undefined;
|
|
3179
|
+
color: string;
|
|
3180
|
+
shape?: HandleShape_2;
|
|
3181
|
+
allowInput?: boolean;
|
|
3182
|
+
maxConnections?: number;
|
|
2196
3183
|
};
|
|
3184
|
+
readonly bindLoopNodes: {
|
|
3185
|
+
name: string;
|
|
3186
|
+
underlyingType: "noEquivalent";
|
|
3187
|
+
complexSchema?: undefined;
|
|
3188
|
+
color: string;
|
|
3189
|
+
shape?: HandleShape_2;
|
|
3190
|
+
allowInput?: boolean;
|
|
3191
|
+
maxConnections?: number;
|
|
3192
|
+
};
|
|
3193
|
+
};
|
|
3194
|
+
|
|
3195
|
+
export declare const standardNodeContextMenu: {
|
|
3196
|
+
locationInContextMenu: string[];
|
|
3197
|
+
priorityInContextMenu: number;
|
|
2197
3198
|
};
|
|
2198
3199
|
|
|
2199
|
-
export declare const standardNodeTypeNames: readonly ["groupInput", "groupOutput"];
|
|
3200
|
+
export declare const standardNodeTypeNames: readonly ["groupInput", "groupOutput", "loopStart", "loopEnd", "loopStop"];
|
|
2200
3201
|
|
|
2201
3202
|
export declare const standardNodeTypeNamesMap: {
|
|
2202
3203
|
readonly groupInput: "groupInput";
|
|
2203
3204
|
readonly groupOutput: "groupOutput";
|
|
3205
|
+
readonly loopStart: "loopStart";
|
|
3206
|
+
readonly loopEnd: "loopEnd";
|
|
3207
|
+
readonly loopStop: "loopStop";
|
|
2204
3208
|
};
|
|
2205
3209
|
|
|
2206
3210
|
export declare const standardNodeTypes: {
|
|
2207
|
-
groupInput: TypeOfNode_2<"
|
|
2208
|
-
groupOutput: TypeOfNode_2<"
|
|
3211
|
+
groupInput: TypeOfNode_2<"groupInfer" | "loopInfer" | "condition" | "bindLoopNodes", "groupInput", "string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never>;
|
|
3212
|
+
groupOutput: TypeOfNode_2<"groupInfer" | "loopInfer" | "condition" | "bindLoopNodes", "groupOutput", "string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never>;
|
|
3213
|
+
loopStart: TypeOfNode_2<"groupInfer" | "loopInfer" | "condition" | "bindLoopNodes", "loopStart", "string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never>;
|
|
3214
|
+
loopStop: TypeOfNode_2<"groupInfer" | "loopInfer" | "condition" | "bindLoopNodes", "loopStop", "string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never>;
|
|
3215
|
+
loopEnd: TypeOfNode_2<"groupInfer" | "loopInfer" | "condition" | "bindLoopNodes", "loopEnd", "string" | "number" | "boolean" | "complex" | "noEquivalent" | "inferFromConnection", never>;
|
|
2209
3216
|
};
|
|
2210
3217
|
|
|
2211
3218
|
/**
|
|
@@ -2295,6 +3302,50 @@ export declare type State<DataTypeUniqueId extends string = string, NodeTypeUniq
|
|
|
2295
3302
|
* @default undefined
|
|
2296
3303
|
*/
|
|
2297
3304
|
enableRecursionChecking?: boolean;
|
|
3305
|
+
/**
|
|
3306
|
+
* Whether to enable debugging mode
|
|
3307
|
+
* - If not provided, is considered disabled
|
|
3308
|
+
* - When disabled, no debug information is displayed in the graph
|
|
3309
|
+
* - When enabled, debug information is displayed in the graph
|
|
3310
|
+
*
|
|
3311
|
+
* @default undefined
|
|
3312
|
+
*/
|
|
3313
|
+
enableDebugMode?: boolean;
|
|
3314
|
+
};
|
|
3315
|
+
|
|
3316
|
+
/**
|
|
3317
|
+
* Options for importing graph state.
|
|
3318
|
+
*
|
|
3319
|
+
* `dataTypes` and `typeOfNodes` are required so the importer can
|
|
3320
|
+
* rehydrate Zod schemas and handle dataTypeObjects that were stripped
|
|
3321
|
+
* during export.
|
|
3322
|
+
*/
|
|
3323
|
+
export declare type StateImportOptions<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never> = {
|
|
3324
|
+
/** User-provided data type definitions (source of truth for Zod schemas) */
|
|
3325
|
+
dataTypes: Record<DataTypeUniqueId, DataType<UnderlyingType, ComplexSchemaType>>;
|
|
3326
|
+
/** User-provided node type definitions (source of truth for handle structure) */
|
|
3327
|
+
typeOfNodes: Record<NodeTypeUniqueId, TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>>;
|
|
3328
|
+
/** Called for each validation issue found during import */
|
|
3329
|
+
onValidationError?: (issue: ValidationIssue) => void;
|
|
3330
|
+
/** Repair strategies to apply (all default to false) */
|
|
3331
|
+
repair?: Partial<StateRepairStrategies>;
|
|
3332
|
+
};
|
|
3333
|
+
|
|
3334
|
+
/**
|
|
3335
|
+
* Opt-in repair strategies for state import.
|
|
3336
|
+
* All default to `false` — must be explicitly enabled.
|
|
3337
|
+
*/
|
|
3338
|
+
export declare type StateRepairStrategies = {
|
|
3339
|
+
/** Remove edges whose source or target node doesn't exist */
|
|
3340
|
+
removeOrphanEdges: boolean;
|
|
3341
|
+
/** Deduplicate nodes with the same ID (keep first occurrence) */
|
|
3342
|
+
removeDuplicateNodeIds: boolean;
|
|
3343
|
+
/** Deduplicate edges with the same ID (keep first occurrence) */
|
|
3344
|
+
removeDuplicateEdgeIds: boolean;
|
|
3345
|
+
/** Fill missing optional fields (viewport, feature flags) with defaults */
|
|
3346
|
+
fillMissingDefaults: boolean;
|
|
3347
|
+
/** Rebuild handle dataType.dataTypeObject from provided dataTypes */
|
|
3348
|
+
rehydrateDataTypeObjects: boolean;
|
|
2298
3349
|
};
|
|
2299
3350
|
|
|
2300
3351
|
/**
|
|
@@ -2305,7 +3356,7 @@ export declare type SupportedUnderlyingTypes = (typeof supportedUnderlyingTypes)
|
|
|
2305
3356
|
/**
|
|
2306
3357
|
* Array of supported underlying data types
|
|
2307
3358
|
*/
|
|
2308
|
-
declare const supportedUnderlyingTypes: readonly ["string", "number", "complex", "noEquivalent", "inferFromConnection"];
|
|
3359
|
+
declare const supportedUnderlyingTypes: readonly ["string", "number", "boolean", "complex", "noEquivalent", "inferFromConnection"];
|
|
2309
3360
|
|
|
2310
3361
|
/**
|
|
2311
3362
|
* Map of supported underlying types for type checking
|
|
@@ -2313,11 +3364,35 @@ declare const supportedUnderlyingTypes: readonly ["string", "number", "complex",
|
|
|
2313
3364
|
export declare const supportedUnderlyingTypesMap: {
|
|
2314
3365
|
readonly string: "string";
|
|
2315
3366
|
readonly number: "number";
|
|
3367
|
+
readonly boolean: "boolean";
|
|
2316
3368
|
readonly complex: "complex";
|
|
2317
3369
|
readonly noEquivalent: "noEquivalent";
|
|
2318
3370
|
readonly inferFromConnection: "inferFromConnection";
|
|
2319
3371
|
};
|
|
2320
3372
|
|
|
3373
|
+
export declare function Tooltip({ content, children, infoIcon, placement, maxWidth, className, style, as: Tag, triggerProps, }: TooltipProps): JSX.Element;
|
|
3374
|
+
|
|
3375
|
+
export declare type TooltipProps = {
|
|
3376
|
+
/** Tooltip content — string or ReactNode */
|
|
3377
|
+
content: ReactNode;
|
|
3378
|
+
/** Trigger element(s) */
|
|
3379
|
+
children: ReactNode;
|
|
3380
|
+
/** Show an ⓘ icon next to the trigger @default false */
|
|
3381
|
+
infoIcon?: boolean;
|
|
3382
|
+
/** Tooltip placement @default 'bottom' */
|
|
3383
|
+
placement?: Placement;
|
|
3384
|
+
/** Max width of the tooltip @default 240 */
|
|
3385
|
+
maxWidth?: number;
|
|
3386
|
+
/** Additional className for the trigger wrapper */
|
|
3387
|
+
className?: string;
|
|
3388
|
+
/** Inline style for the trigger wrapper (useful for absolute positioning) */
|
|
3389
|
+
style?: CSSProperties;
|
|
3390
|
+
/** Render the wrapper as a different element @default 'span' */
|
|
3391
|
+
as?: 'span' | 'div' | ComponentType<HTMLAttributes<HTMLElement>>;
|
|
3392
|
+
/** Extra props forwarded to the trigger wrapper (e.g. data-*, onClick) */
|
|
3393
|
+
triggerProps?: HTMLAttributes<HTMLElement>;
|
|
3394
|
+
};
|
|
3395
|
+
|
|
2321
3396
|
/**
|
|
2322
3397
|
* Definition of an input type in a node
|
|
2323
3398
|
*
|
|
@@ -2330,6 +3405,8 @@ export declare type TypeOfInput<DataTypeUniqueId extends string = string> = {
|
|
|
2330
3405
|
dataType: DataTypeUniqueId;
|
|
2331
3406
|
/** Whether this input allows direct user input */
|
|
2332
3407
|
allowInput?: boolean;
|
|
3408
|
+
/** Maximum number of connections for this input */
|
|
3409
|
+
maxConnections?: number;
|
|
2333
3410
|
};
|
|
2334
3411
|
|
|
2335
3412
|
/**
|
|
@@ -2358,6 +3435,11 @@ export declare type TypeOfNode<DataTypeUniqueId extends string = string, NodeTyp
|
|
|
2358
3435
|
inputs: (TypeOfInput<DataTypeUniqueId> | TypeOfInputPanel<DataTypeUniqueId>)[];
|
|
2359
3436
|
/** Array of outputs */
|
|
2360
3437
|
outputs: TypeOfInput<DataTypeUniqueId>[];
|
|
3438
|
+
/** Path in the "Add Node" context menu. e.g. ["Math", "Trig"] nests under Math > Trig.
|
|
3439
|
+
* Omit to place at root level of "Add Node". */
|
|
3440
|
+
locationInContextMenu?: string[];
|
|
3441
|
+
/** Ordering priority in the context menu. Higher values appear first. Default: 0. */
|
|
3442
|
+
priorityInContextMenu?: number;
|
|
2361
3443
|
/** Subtree of the node type (if this exists, this is a node group) */
|
|
2362
3444
|
subtree?: {
|
|
2363
3445
|
nodes: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodes'];
|
|
@@ -2382,6 +3464,40 @@ export declare type TypeOfNode<DataTypeUniqueId extends string = string, NodeTyp
|
|
|
2382
3464
|
};
|
|
2383
3465
|
};
|
|
2384
3466
|
|
|
3467
|
+
/**
|
|
3468
|
+
* Manages overflow-scroll state detection and RAF-based auto-scrolling.
|
|
3469
|
+
*
|
|
3470
|
+
* Tracks whether the container can scroll in each direction via
|
|
3471
|
+
* scroll events, ResizeObserver, window resize, and optional
|
|
3472
|
+
* MutationObserver on children. Provides start/stop controls for
|
|
3473
|
+
* continuous scrolling driven by requestAnimationFrame.
|
|
3474
|
+
*/
|
|
3475
|
+
export declare function useAutoScroll({ orientation, disabled, scrollSpeedPxPerFrame, observeChildren, }?: UseAutoScrollOptions): UseAutoScrollReturn;
|
|
3476
|
+
|
|
3477
|
+
export declare type UseAutoScrollOptions = {
|
|
3478
|
+
/** Scroll axis @default 'horizontal' */
|
|
3479
|
+
orientation?: 'horizontal' | 'vertical';
|
|
3480
|
+
/** Disable all scroll detection and auto-scrolling @default false */
|
|
3481
|
+
disabled?: boolean;
|
|
3482
|
+
/** Pixels scrolled per animation frame @default 14 */
|
|
3483
|
+
scrollSpeedPxPerFrame?: number;
|
|
3484
|
+
/** Watch for child DOM mutations to recalculate scroll state @default true */
|
|
3485
|
+
observeChildren?: boolean;
|
|
3486
|
+
};
|
|
3487
|
+
|
|
3488
|
+
export declare type UseAutoScrollReturn = {
|
|
3489
|
+
/** Ref to attach to the scrollable container element */
|
|
3490
|
+
listRef: React.RefObject<HTMLDivElement | null>;
|
|
3491
|
+
/** Whether content overflows at the start (left / top) */
|
|
3492
|
+
canScrollStart: boolean;
|
|
3493
|
+
/** Whether content overflows at the end (right / bottom) */
|
|
3494
|
+
canScrollEnd: boolean;
|
|
3495
|
+
/** Begin continuous scrolling in a direction (call on button press) */
|
|
3496
|
+
startAutoScroll: (direction: 'start' | 'end') => void;
|
|
3497
|
+
/** Stop continuous scrolling (call on button release) */
|
|
3498
|
+
stopAutoScroll: () => void;
|
|
3499
|
+
};
|
|
3500
|
+
|
|
2385
3501
|
/**
|
|
2386
3502
|
* Custom hook for detecting clicks outside of a specified element
|
|
2387
3503
|
*
|
|
@@ -2480,6 +3596,67 @@ export declare type UseDragReturn = {
|
|
|
2480
3596
|
dragRef: (element: HTMLElement | null) => void;
|
|
2481
3597
|
};
|
|
2482
3598
|
|
|
3599
|
+
/**
|
|
3600
|
+
* Consolidates the common floating-ui tooltip boilerplate:
|
|
3601
|
+
* useFloating + useHover + useDismiss + useInteractions + useTransitionStyles + arrow.
|
|
3602
|
+
*
|
|
3603
|
+
* This pattern is repeated across NodeStatusIndicator (StatusTooltip),
|
|
3604
|
+
* ExecutionTimeline (BlockTooltip, TimeModeInfoTooltip), and potentially
|
|
3605
|
+
* future tooltip-like components.
|
|
3606
|
+
*/
|
|
3607
|
+
export declare function useFloatingTooltip({ placement, offsetPx, hoverDelay, transitionDuration, withArrow, initialTransition, }?: UseFloatingTooltipOptions): {
|
|
3608
|
+
isOpen: boolean;
|
|
3609
|
+
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
|
3610
|
+
refs: {
|
|
3611
|
+
reference: MutableRefObject<ReferenceType_2 | null>;
|
|
3612
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
3613
|
+
setReference: (node: ReferenceType_2 | null) => void;
|
|
3614
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
3615
|
+
} & ExtendedRefs<ReferenceType>;
|
|
3616
|
+
floatingStyles: CSSProperties;
|
|
3617
|
+
context: {
|
|
3618
|
+
x: number;
|
|
3619
|
+
y: number;
|
|
3620
|
+
strategy: Strategy;
|
|
3621
|
+
placement: Placement;
|
|
3622
|
+
middlewareData: MiddlewareData;
|
|
3623
|
+
isPositioned: boolean;
|
|
3624
|
+
update: () => void;
|
|
3625
|
+
floatingStyles: React.CSSProperties;
|
|
3626
|
+
open: boolean;
|
|
3627
|
+
onOpenChange: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;
|
|
3628
|
+
events: FloatingEvents;
|
|
3629
|
+
dataRef: React.MutableRefObject<ContextData>;
|
|
3630
|
+
nodeId: string | undefined;
|
|
3631
|
+
floatingId: string | undefined;
|
|
3632
|
+
refs: ExtendedRefs<ReferenceType>;
|
|
3633
|
+
elements: ExtendedElements<ReferenceType>;
|
|
3634
|
+
};
|
|
3635
|
+
arrowRef: RefObject<SVGSVGElement | null>;
|
|
3636
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
|
|
3637
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
3638
|
+
isMounted: boolean;
|
|
3639
|
+
transitionStyles: CSSProperties;
|
|
3640
|
+
};
|
|
3641
|
+
|
|
3642
|
+
export declare type UseFloatingTooltipOptions = {
|
|
3643
|
+
/** Tooltip placement relative to the reference element @default 'top' */
|
|
3644
|
+
placement?: Placement;
|
|
3645
|
+
/** Offset distance in pixels @default 10 */
|
|
3646
|
+
offsetPx?: number;
|
|
3647
|
+
/** Hover delay in ms @default { open: 150, close: 0 } */
|
|
3648
|
+
hoverDelay?: {
|
|
3649
|
+
open: number;
|
|
3650
|
+
close: number;
|
|
3651
|
+
};
|
|
3652
|
+
/** Enter/exit transition duration in ms @default 150 */
|
|
3653
|
+
transitionDuration?: number;
|
|
3654
|
+
/** Whether to include an arrow element @default true */
|
|
3655
|
+
withArrow?: boolean;
|
|
3656
|
+
/** Initial transition style @default { opacity: 0, transform: 'translateY(4px)' } */
|
|
3657
|
+
initialTransition?: React.CSSProperties;
|
|
3658
|
+
};
|
|
3659
|
+
|
|
2483
3660
|
/**
|
|
2484
3661
|
* Custom hook for managing the full graph state with reducer
|
|
2485
3662
|
*
|
|
@@ -2548,9 +3725,95 @@ export declare type UseDragReturn = {
|
|
|
2548
3725
|
* });
|
|
2549
3726
|
* ```
|
|
2550
3727
|
*/
|
|
2551
|
-
export declare function useFullGraph<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ?
|
|
3728
|
+
export declare function useFullGraph<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? default_2.ZodType : never = never>(initialState: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): {
|
|
2552
3729
|
state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>;
|
|
2553
|
-
dispatch: ActionDispatch<[action:
|
|
3730
|
+
dispatch: ActionDispatch<[action: Action_2<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>]>;
|
|
3731
|
+
};
|
|
3732
|
+
|
|
3733
|
+
export declare function useRecordContext(): RecordContextValue;
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* Hook for drag-to-resize a panel dimension.
|
|
3737
|
+
*
|
|
3738
|
+
* Handles mousedown → mousemove → mouseup lifecycle with clamping,
|
|
3739
|
+
* cursor override, and user-select prevention during drag.
|
|
3740
|
+
*/
|
|
3741
|
+
export declare function useResizeHandle({ initialSize, minSize, maxSize, direction, }: UseResizeHandleOptions): UseResizeHandleReturn;
|
|
3742
|
+
|
|
3743
|
+
export declare type UseResizeHandleOptions = {
|
|
3744
|
+
/** Starting height/width in pixels */
|
|
3745
|
+
initialSize: number;
|
|
3746
|
+
/** Minimum allowed size */
|
|
3747
|
+
minSize: number;
|
|
3748
|
+
/** Maximum allowed size */
|
|
3749
|
+
maxSize: number;
|
|
3750
|
+
/**
|
|
3751
|
+
* Resize direction.
|
|
3752
|
+
* - 'up': dragging up increases size (bottom panel resized from top edge)
|
|
3753
|
+
* - 'down': dragging down increases size
|
|
3754
|
+
* - 'left': dragging left increases size
|
|
3755
|
+
* - 'right': dragging right increases size
|
|
3756
|
+
* @default 'up'
|
|
3757
|
+
*/
|
|
3758
|
+
direction?: 'up' | 'down' | 'left' | 'right';
|
|
3759
|
+
};
|
|
3760
|
+
|
|
3761
|
+
export declare type UseResizeHandleReturn = {
|
|
3762
|
+
/** Current size in pixels */
|
|
3763
|
+
size: number;
|
|
3764
|
+
/** Attach to onMouseDown of the resize handle element */
|
|
3765
|
+
onMouseDown: (e: React.MouseEvent) => void;
|
|
3766
|
+
};
|
|
3767
|
+
|
|
3768
|
+
/**
|
|
3769
|
+
* Web Animations API-based mount/unmount lifecycle for slide animations.
|
|
3770
|
+
*
|
|
3771
|
+
* Uses single-keyframe animations so interrupted toggles (e.g. rapid
|
|
3772
|
+
* close→open) smoothly reverse from the current position rather than
|
|
3773
|
+
* snapping. The clip wrapper pattern (overflow:hidden on parent)
|
|
3774
|
+
* prevents layout overflow.
|
|
3775
|
+
*
|
|
3776
|
+
* @param isOpen - Whether the element should be visible
|
|
3777
|
+
* @param options - Animation configuration
|
|
3778
|
+
* @returns mounted state, ref to attach to the animated element, and initial inline style
|
|
3779
|
+
*/
|
|
3780
|
+
export declare function useSlideAnimation(isOpen: boolean, options?: {
|
|
3781
|
+
durationMs?: number;
|
|
3782
|
+
hiddenTransform?: string;
|
|
3783
|
+
visibleTransform?: string;
|
|
3784
|
+
easing?: string;
|
|
3785
|
+
}): {
|
|
3786
|
+
mounted: boolean;
|
|
3787
|
+
ref: RefObject<HTMLDivElement | null>;
|
|
3788
|
+
style: CSSProperties;
|
|
3789
|
+
};
|
|
3790
|
+
|
|
3791
|
+
/**
|
|
3792
|
+
* Validate the structure of an exported execution record envelope.
|
|
3793
|
+
* Returns all issues found — both errors and warnings.
|
|
3794
|
+
*/
|
|
3795
|
+
export declare function validateExecutionRecordStructure(data: unknown): ValidationIssue[];
|
|
3796
|
+
|
|
3797
|
+
/**
|
|
3798
|
+
* Validate the structure of an exported graph state envelope.
|
|
3799
|
+
* Returns all issues found — both errors and warnings.
|
|
3800
|
+
*
|
|
3801
|
+
* Does NOT check type-level correctness (e.g. whether dataType IDs
|
|
3802
|
+
* in handles match actual dataTypes entries) — that's the importer's job.
|
|
3803
|
+
*/
|
|
3804
|
+
export declare function validateGraphStateStructure(data: unknown): ValidationIssue[];
|
|
3805
|
+
|
|
3806
|
+
/**
|
|
3807
|
+
* A single validation issue found during import.
|
|
3808
|
+
* Includes a dot-path to the problematic field for precise error location.
|
|
3809
|
+
*/
|
|
3810
|
+
export declare type ValidationIssue = {
|
|
3811
|
+
/** Dot-path to the problematic field, e.g. "state.nodes[2].position.x" */
|
|
3812
|
+
path: string;
|
|
3813
|
+
/** Human-readable description of the issue */
|
|
3814
|
+
message: string;
|
|
3815
|
+
/** Whether this blocks import ('error') or is informational ('warning') */
|
|
3816
|
+
severity: 'error' | 'warning';
|
|
2554
3817
|
};
|
|
2555
3818
|
|
|
2556
3819
|
/**
|