@valerypopoff/rivet2-core 2.0.8 → 2.0.10
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/dist/cjs/bundle.cjs +1187 -589
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/esm/api/createProcessor.js +1 -0
- package/dist/esm/api/streaming.js +1 -0
- package/dist/esm/exports.js +1 -0
- package/dist/esm/model/DebuggerTransportSentinel.js +78 -0
- package/dist/esm/model/GraphAbortReasons.js +69 -0
- package/dist/esm/model/GraphBoundaryCache.js +92 -0
- package/dist/esm/model/GraphPreprocessor.js +88 -30
- package/dist/esm/model/GraphProcessor.js +295 -96
- package/dist/esm/model/NodeImpl.js +6 -4
- package/dist/esm/model/ProcessContextBuilder.js +2 -17
- package/dist/esm/model/RecordingPlayer.js +27 -7
- package/dist/esm/model/SplitRunProcessor.js +48 -9
- package/dist/esm/model/SubprocessorBridge.js +30 -23
- package/dist/esm/model/nodes/DidRunNode.js +12 -7
- package/dist/esm/model/nodes/GetGlobalNode.js +14 -4
- package/dist/esm/model/nodes/GraphOutputNode.js +31 -2
- package/dist/esm/model/nodes/LoopUntilNode.js +18 -45
- package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +24 -63
- package/dist/esm/model/nodes/SetGlobalNode.js +2 -1
- package/dist/esm/model/nodes/SubGraphNode.js +22 -63
- package/dist/esm/recording/ExecutionRecorder.js +19 -6
- package/dist/esm/utils/emitDetached.js +2 -2
- package/dist/esm/utils/interpolation.js +41 -1
- package/dist/esm/utils/serialization/serialization.js +6 -5
- package/dist/esm/utils/serialization/serializationHelpers.js +2 -2
- package/dist/esm/utils/serialization/serializationInput.js +48 -0
- package/dist/esm/utils/serialization/serializationUtils.js +2 -33
- package/dist/esm/utils/serialization/serialization_v2.js +8 -8
- package/dist/types/api/createProcessor.d.ts +1 -0
- package/dist/types/api/streaming.d.ts +1 -0
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/model/DebuggerTransportSentinel.d.ts +21 -0
- package/dist/types/model/EditorDefinition.d.ts +7 -1
- package/dist/types/model/ExecutorProtocol.d.ts +5 -0
- package/dist/types/model/GraphAbortReasons.d.ts +23 -0
- package/dist/types/model/GraphBoundaryCache.d.ts +27 -0
- package/dist/types/model/GraphPreprocessor.d.ts +3 -1
- package/dist/types/model/GraphProcessor.d.ts +8 -0
- package/dist/types/model/NodeImpl.d.ts +10 -5
- package/dist/types/model/Nodes.d.ts +2 -2
- package/dist/types/model/ProcessContext.d.ts +3 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +4 -20
- package/dist/types/model/SplitRunProcessor.d.ts +8 -3
- package/dist/types/model/nodes/DidRunNode.d.ts +2 -1
- package/dist/types/model/nodes/LoopUntilNode.d.ts +5 -4
- package/dist/types/model/nodes/ReferencedGraphAliasNode.d.ts +5 -4
- package/dist/types/model/nodes/SubGraphNode.d.ts +6 -5
- package/dist/types/recording/RecordedEvents.d.ts +4 -0
- package/dist/types/utils/emitDetached.d.ts +2 -2
- package/dist/types/utils/serialization/serializationInput.d.ts +7 -0
- package/package.json +1 -1
|
@@ -10,10 +10,15 @@ export type SharedEditorDefinitionProps<T extends ChartNode> = {
|
|
|
10
10
|
label: string;
|
|
11
11
|
helperMessage?: string | ((data: T['data']) => string | undefined);
|
|
12
12
|
autoFocus?: boolean;
|
|
13
|
+
includeInGraphSearch?: boolean;
|
|
13
14
|
layout?: 'inline';
|
|
14
15
|
hideIf?: (data: T['data']) => boolean;
|
|
15
16
|
disableIf?: (data: T['data']) => boolean;
|
|
16
17
|
};
|
|
18
|
+
export type InfoEditorDefinition<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
19
|
+
type: 'info';
|
|
20
|
+
useInputToggleDataKey?: never;
|
|
21
|
+
};
|
|
17
22
|
export type StringEditorDefinition<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
18
23
|
type: 'string';
|
|
19
24
|
dataKey: DataOfType<T, string>;
|
|
@@ -25,6 +30,7 @@ export type ToggleEditorDefinition<T extends ChartNode> = SharedEditorDefinition
|
|
|
25
30
|
type: 'toggle';
|
|
26
31
|
dataKey: DataOfType<T, boolean>;
|
|
27
32
|
useInputToggleDataKey?: DataOfType<T, boolean>;
|
|
33
|
+
turnOffDataKeysWhenEnabled?: DataOfType<T, boolean>[];
|
|
28
34
|
};
|
|
29
35
|
export type DataTypeSelectorEditorDefinition<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
30
36
|
type: 'dataTypeSelector';
|
|
@@ -175,5 +181,5 @@ export type DynamicEditorDefinition<T extends ChartNode> = SharedEditorDefinitio
|
|
|
175
181
|
dataType: DataType;
|
|
176
182
|
editor: DynamicEditorEditor;
|
|
177
183
|
};
|
|
178
|
-
export type EditorDefinition<T extends ChartNode> = StringEditorDefinition<T> | ToggleEditorDefinition<T> | DataTypeSelectorEditorDefinition<T> | AnyDataEditorDefinition<T> | DropdownEditorDefinition<T> | SegmentedEditorDefinition<T> | NumberEditorDefinition<T> | CodeEditorDefinition<T> | GraphSelectorEditorDefinition<T> | ColorEditorDefinition<T> | GraphSelectorEditorDefinition<T> | FileBrowserEditorDefinition<T> | ImageBrowserEditorDefinition<T> | DatasetSelectorEditorDefinition<T> | KeyValuePairEditorDefinition<T> | EditorDefinitionGroup<T> | StringListEditorDefinition<T> | CustomEditorDefinition<T> | DynamicEditorDefinition<T> | FilePathBrowserEditorDefinition<T> | DirectoryBrowserEditorDefinition<T>;
|
|
184
|
+
export type EditorDefinition<T extends ChartNode> = InfoEditorDefinition<T> | StringEditorDefinition<T> | ToggleEditorDefinition<T> | DataTypeSelectorEditorDefinition<T> | AnyDataEditorDefinition<T> | DropdownEditorDefinition<T> | SegmentedEditorDefinition<T> | NumberEditorDefinition<T> | CodeEditorDefinition<T> | GraphSelectorEditorDefinition<T> | ColorEditorDefinition<T> | GraphSelectorEditorDefinition<T> | FileBrowserEditorDefinition<T> | ImageBrowserEditorDefinition<T> | DatasetSelectorEditorDefinition<T> | KeyValuePairEditorDefinition<T> | EditorDefinitionGroup<T> | StringListEditorDefinition<T> | CustomEditorDefinition<T> | DynamicEditorDefinition<T> | FilePathBrowserEditorDefinition<T> | DirectoryBrowserEditorDefinition<T>;
|
|
179
185
|
export {};
|
|
@@ -51,11 +51,15 @@ export type SerializedProcessEventMap = {
|
|
|
51
51
|
node: ChartNode;
|
|
52
52
|
outputs: Outputs;
|
|
53
53
|
processId: ProcessId;
|
|
54
|
+
durationMs?: number;
|
|
55
|
+
splitRunDurationMs?: Record<number, number>;
|
|
54
56
|
}>;
|
|
55
57
|
nodeError: WithExecution<{
|
|
56
58
|
node: ChartNode;
|
|
57
59
|
error: Error | string;
|
|
58
60
|
processId: ProcessId;
|
|
61
|
+
durationMs?: number;
|
|
62
|
+
splitRunDurationMs?: Record<number, number>;
|
|
59
63
|
}>;
|
|
60
64
|
nodeExcluded: WithExecution<{
|
|
61
65
|
node: ChartNode;
|
|
@@ -195,6 +199,7 @@ export type OutgoingMessageMap = {
|
|
|
195
199
|
inputs?: GraphInputs;
|
|
196
200
|
projectPath?: string | null;
|
|
197
201
|
useEditorCache?: boolean;
|
|
202
|
+
captureNodeTimings?: boolean;
|
|
198
203
|
};
|
|
199
204
|
abort: undefined;
|
|
200
205
|
pause: undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const RACE_LOSER_EXCLUSION_REASON = "Race branch lost";
|
|
2
|
+
export declare const SUCCESSFUL_GRAPH_ABORT_EXCLUSION_REASON = "Graph aborted successfully";
|
|
3
|
+
declare const GRAPH_ABORT_ERROR_MARKER = "rivet:graph-abort-error";
|
|
4
|
+
declare const GRAPH_ABORT_REASON_MARKER = "rivet:graph-abort-reason";
|
|
5
|
+
export type GraphAbortReason = {
|
|
6
|
+
error?: Error | string;
|
|
7
|
+
marker: typeof GRAPH_ABORT_REASON_MARKER;
|
|
8
|
+
successful: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type GraphAbortError = Error & {
|
|
11
|
+
graphAbortReason?: GraphAbortReason;
|
|
12
|
+
marker: typeof GRAPH_ABORT_ERROR_MARKER;
|
|
13
|
+
};
|
|
14
|
+
export declare function createGraphAbortReason(successful: boolean, error?: Error | string): GraphAbortReason;
|
|
15
|
+
export declare function createGraphAbortError(reason: GraphAbortReason | undefined, message?: string): GraphAbortError;
|
|
16
|
+
export declare function createGraphAbortErrorFromSignal(signal: AbortSignal | undefined, message?: string): GraphAbortError;
|
|
17
|
+
export declare function getAbortSignalReason(signal: AbortSignal | undefined): unknown;
|
|
18
|
+
export declare function getGraphAbortReasonFromSignal(signal: AbortSignal | undefined): GraphAbortReason | undefined;
|
|
19
|
+
export declare function getGraphAbortReasonFromError(error: unknown): GraphAbortReason | undefined;
|
|
20
|
+
export declare function isRaceLoserGraphAbortReason(reason: GraphAbortReason | undefined): boolean;
|
|
21
|
+
export declare function isSuccessfulNonRaceGraphAbortReason(reason: GraphAbortReason | undefined): boolean;
|
|
22
|
+
export declare function isAbortLikeError(error: Error): boolean;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DataType, DataValue } from './DataValue.js';
|
|
2
|
+
import type { Inputs, Outputs } from './GraphProcessor.js';
|
|
3
|
+
import type { NodeInputDefinition, NodeOutputDefinition, PortId } from './NodeBase.js';
|
|
4
|
+
import type { GraphId, NodeGraph } from './NodeGraph.js';
|
|
5
|
+
import type { Project } from './Project.js';
|
|
6
|
+
import type { DynamicEditorEditor } from './EditorDefinition.js';
|
|
7
|
+
export type GraphBoundaryInput = {
|
|
8
|
+
dataType: DataType;
|
|
9
|
+
editor?: DynamicEditorEditor;
|
|
10
|
+
id: string;
|
|
11
|
+
portId: PortId;
|
|
12
|
+
};
|
|
13
|
+
export type GraphBoundaryOutput = {
|
|
14
|
+
dataType: DataType;
|
|
15
|
+
id: string;
|
|
16
|
+
portId: PortId;
|
|
17
|
+
};
|
|
18
|
+
export type GraphBoundary = {
|
|
19
|
+
inputs: readonly GraphBoundaryInput[];
|
|
20
|
+
outputs: readonly GraphBoundaryOutput[];
|
|
21
|
+
};
|
|
22
|
+
export type GraphBoundaryCache = WeakMap<NodeGraph, GraphBoundary>;
|
|
23
|
+
export declare function getGraphBoundary(project: Project, graphId: GraphId | undefined, cache?: GraphBoundaryCache): GraphBoundary | undefined;
|
|
24
|
+
export declare function getGraphBoundaryInputDefinitions(boundary: GraphBoundary): NodeInputDefinition[];
|
|
25
|
+
export declare function getGraphBoundaryOutputDefinitions(boundary: GraphBoundary): NodeOutputDefinition[];
|
|
26
|
+
export declare function buildGraphBoundaryInputData(boundary: GraphBoundary, inputs: Inputs, defaults: Record<string, DataValue> | undefined): Inputs;
|
|
27
|
+
export declare function buildExcludedGraphBoundaryOutputs(boundary: GraphBoundary): Outputs;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NodeRegistration } from './NodeRegistration.js';
|
|
2
2
|
import type { NodeGraph } from './NodeGraph.js';
|
|
3
3
|
import type { NodeConnection, NodeId, ChartNode, NodeInputDefinition, NodeOutputDefinition, PortId } from './NodeBase.js';
|
|
4
|
-
import type { NodeImpl } from './NodeImpl.js';
|
|
4
|
+
import type { NodeDefinitionContext, NodeImpl } from './NodeImpl.js';
|
|
5
5
|
import type { Project, ProjectId } from './Project.js';
|
|
6
6
|
export type GraphNodeDefinitions = Record<NodeId, {
|
|
7
7
|
inputs: NodeInputDefinition[];
|
|
@@ -28,6 +28,7 @@ export type GraphPreprocessorResult = {
|
|
|
28
28
|
export type GraphExecutionPlan = Omit<GraphPreprocessorResult, 'nodeInstances'> & {
|
|
29
29
|
cycleIndexByNode: Record<NodeId, number>;
|
|
30
30
|
graphNodes: ChartNode[];
|
|
31
|
+
nodeIds: readonly NodeId[];
|
|
31
32
|
inputConnectionByNodeAndPort: GraphPortConnectionMap;
|
|
32
33
|
inputConnectionsByNode: Record<NodeId, NodeConnection[]>;
|
|
33
34
|
inputNodesByNode: Record<NodeId, ChartNode[]>;
|
|
@@ -40,6 +41,7 @@ export type GraphPreprocessorExecutionPlanResult = GraphPreprocessorResult & Gra
|
|
|
40
41
|
export type GraphPreprocessedState = GraphPreprocessorResult | GraphPreprocessorExecutionPlanResult;
|
|
41
42
|
type GraphPreprocessorOptions = {
|
|
42
43
|
buildExecutionPlan?: boolean;
|
|
44
|
+
definitionContext?: NodeDefinitionContext;
|
|
43
45
|
graph: NodeGraph;
|
|
44
46
|
loadedProjects: Record<ProjectId, Project>;
|
|
45
47
|
project: Project;
|
|
@@ -8,6 +8,7 @@ import type { ExecutionRecorder } from '../recording/ExecutionRecorder.js';
|
|
|
8
8
|
import type { Tagged } from 'type-fest';
|
|
9
9
|
import type { NodeRegistration } from './NodeRegistration.js';
|
|
10
10
|
import { type GraphExecutionPlan } from './GraphPreprocessor.js';
|
|
11
|
+
import { type GraphBoundaryCache } from './GraphBoundaryCache.js';
|
|
11
12
|
type WithExecution<T extends object> = T & {
|
|
12
13
|
execution: GraphExecutionMetadata;
|
|
13
14
|
};
|
|
@@ -51,12 +52,16 @@ export type ProcessEvents = {
|
|
|
51
52
|
node: ChartNode;
|
|
52
53
|
outputs: Outputs;
|
|
53
54
|
processId: ProcessId;
|
|
55
|
+
durationMs?: number;
|
|
56
|
+
splitRunDurationMs?: Record<number, number>;
|
|
54
57
|
}>;
|
|
55
58
|
/** Called when a node has errored during processing. */
|
|
56
59
|
nodeError: WithExecution<{
|
|
57
60
|
node: ChartNode;
|
|
58
61
|
error: Error | string;
|
|
59
62
|
processId: ProcessId;
|
|
63
|
+
durationMs?: number;
|
|
64
|
+
splitRunDurationMs?: Record<number, number>;
|
|
60
65
|
}>;
|
|
61
66
|
/** Called when a node has been excluded from processing. */
|
|
62
67
|
nodeExcluded: WithExecution<{
|
|
@@ -143,6 +148,7 @@ export type GraphProcessorConcurrency = {
|
|
|
143
148
|
};
|
|
144
149
|
export type GraphProcessorRuntimeCache = {
|
|
145
150
|
executionPlans?: WeakMap<NodeGraph, GraphExecutionPlan>;
|
|
151
|
+
graphBoundaries?: GraphBoundaryCache;
|
|
146
152
|
loadedProjects?: Record<ProjectId, Project>;
|
|
147
153
|
};
|
|
148
154
|
export type GraphProcessorExecutionPlanCacheMode = 'all' | 'subprocessors';
|
|
@@ -183,8 +189,10 @@ export declare class GraphProcessor {
|
|
|
183
189
|
get isRunning(): boolean;
|
|
184
190
|
constructor(project: Project, graphId: GraphId | undefined, registry: NodeRegistration<any, any>, includeTrace?: boolean, options?: {
|
|
185
191
|
cacheLoadedProjects?: boolean;
|
|
192
|
+
captureNodeTimings?: boolean;
|
|
186
193
|
concurrency?: GraphProcessorConcurrency;
|
|
187
194
|
executionPlanCacheMode?: GraphProcessorExecutionPlanCacheMode;
|
|
195
|
+
initialExecutionPlan?: GraphExecutionPlan;
|
|
188
196
|
runtimeCache?: GraphProcessorRuntimeCache;
|
|
189
197
|
scheduler?: GraphProcessorScheduler;
|
|
190
198
|
});
|
|
@@ -5,6 +5,11 @@ import type { InternalProcessContext } from './ProcessContext.js';
|
|
|
5
5
|
import type { EditorDefinition } from './EditorDefinition.js';
|
|
6
6
|
import type { NodeBodySpec } from './NodeBodySpec.js';
|
|
7
7
|
import type { RivetUIContext } from './RivetUIContext.js';
|
|
8
|
+
import type { GraphBoundary } from './GraphBoundaryCache.js';
|
|
9
|
+
import type { GraphId } from './NodeGraph.js';
|
|
10
|
+
export type NodeDefinitionContext = {
|
|
11
|
+
getGraphBoundary: (project: Project, graphId: GraphId | undefined) => GraphBoundary | undefined;
|
|
12
|
+
};
|
|
8
13
|
export interface PluginNodeImpl<T extends ChartNode> {
|
|
9
14
|
getInputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
10
15
|
getOutputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
@@ -25,9 +30,9 @@ export declare abstract class NodeImpl<T extends ChartNode, Type extends T['type
|
|
|
25
30
|
y: number;
|
|
26
31
|
};
|
|
27
32
|
get data(): T['data'];
|
|
28
|
-
abstract getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project
|
|
29
|
-
getInputDefinitionsIncludingBuiltIn(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project
|
|
30
|
-
abstract getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project
|
|
33
|
+
abstract getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
34
|
+
getInputDefinitionsIncludingBuiltIn(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
35
|
+
abstract getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
31
36
|
abstract process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
32
37
|
getEditors(_context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
33
38
|
getBody(_context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
@@ -36,8 +41,8 @@ export type NodeBody = string | NodeBodySpec | NodeBodySpec[] | undefined;
|
|
|
36
41
|
export declare class PluginNodeImplClass<T extends ChartNode, Type extends T['type'] = T['type']> extends NodeImpl<T, Type> {
|
|
37
42
|
readonly impl: PluginNodeImpl<T>;
|
|
38
43
|
constructor(chartNode: T, impl: PluginNodeImpl<T>);
|
|
39
|
-
getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
40
|
-
getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
44
|
+
getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, _referencedProjects?: Record<ProjectId, Project>, _definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
45
|
+
getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, _referencedProjects?: Record<ProjectId, Project>, _definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
41
46
|
process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
42
47
|
getEditors(context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
43
48
|
getBody(context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
@@ -89,12 +89,12 @@ export * from './nodes/MCPDiscoveryNode.js';
|
|
|
89
89
|
export * from './nodes/MCPToolCallNode.js';
|
|
90
90
|
export * from './nodes/MCPGetPromptNode.js';
|
|
91
91
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
92
|
-
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "
|
|
92
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
93
93
|
type: "mcpDiscovery";
|
|
94
94
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
95
95
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
96
96
|
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
97
|
-
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "
|
|
97
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
98
98
|
type: "mcpDiscovery";
|
|
99
99
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
100
100
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
@@ -3,6 +3,7 @@ import { type Settings, type NativeApi, type Project, type DataValue, type Exter
|
|
|
3
3
|
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
4
4
|
import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
5
5
|
import type { ProjectReferenceLoader } from './ProjectReferenceLoader.js';
|
|
6
|
+
import type { GraphBoundary } from './GraphBoundaryCache.js';
|
|
6
7
|
export type ProcessContext = {
|
|
7
8
|
settings: Settings;
|
|
8
9
|
nativeApi?: NativeApi;
|
|
@@ -85,6 +86,8 @@ export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessCon
|
|
|
85
86
|
externalFunctions: Record<string, ExternalFunction>;
|
|
86
87
|
/** Global cache shared by all nodes, is present for the entire execution of a graph (and shared in subgraphs). */
|
|
87
88
|
executionCache: Map<string, unknown>;
|
|
89
|
+
/** Resolves graph input/output boundary metadata through the processor/runner runtime cache when available. */
|
|
90
|
+
getGraphBoundary?: (project: Project, graphId: GraphId | undefined) => GraphBoundary | undefined;
|
|
88
91
|
/** Call when the node has partial data but has not finished execution yet. */
|
|
89
92
|
onPartialOutputs?: (outputs: Outputs) => void;
|
|
90
93
|
/** Creates a subprocessor, for executing subgraphs. */
|
|
@@ -1,41 +1,25 @@
|
|
|
1
1
|
import type { DataValue, ScalarOrArrayDataValue, StringArrayDataValue } from './DataValue.js';
|
|
2
|
-
import type { GraphExecutionMetadata, InternalProcessContext,
|
|
2
|
+
import type { GraphExecutionMetadata, InternalProcessContext, ProcessId } from './ProcessContext.js';
|
|
3
3
|
import type { ChartNode } from './NodeBase.js';
|
|
4
4
|
import type { GraphId } from './NodeGraph.js';
|
|
5
|
-
import type { Project
|
|
5
|
+
import type { Project } from './Project.js';
|
|
6
6
|
import type { AttachedNodeData, ExternalFunction, Outputs } from './GraphProcessor.js';
|
|
7
|
-
|
|
8
|
-
import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
7
|
+
export type NodeProcessContextBase = Omit<InternalProcessContext, 'attachedData' | 'createSubProcessor' | 'execution' | 'externalFunctions' | 'getPluginConfig' | 'node' | 'onPartialOutputs' | 'processId' | 'requestUserInput' | 'setGlobal' | 'signal' | 'waitEvent'>;
|
|
9
8
|
export declare function buildNodeProcessContext(options: {
|
|
9
|
+
base: NodeProcessContextBase;
|
|
10
10
|
attachedData: AttachedNodeData;
|
|
11
|
-
codeRunner: CodeRunner;
|
|
12
|
-
context: ProcessContext;
|
|
13
|
-
contextValues: Record<string, DataValue>;
|
|
14
11
|
createSubProcessor: (subGraphId: GraphId | undefined, options?: {
|
|
15
12
|
signal?: AbortSignal;
|
|
16
13
|
project?: Project;
|
|
17
14
|
}) => unknown;
|
|
18
15
|
execution: GraphExecutionMetadata;
|
|
19
|
-
executionCache: Map<string, unknown>;
|
|
20
|
-
executor: 'nodejs' | 'browser';
|
|
21
16
|
externalFunctions: Record<string, ExternalFunction>;
|
|
22
|
-
getGlobal: (id: string) => ScalarOrArrayDataValue | undefined;
|
|
23
17
|
getPluginConfig: (name: string) => string | undefined;
|
|
24
|
-
graphInputNodeValues: Record<string, DataValue>;
|
|
25
|
-
graphInputs: Record<string, DataValue>;
|
|
26
|
-
graphOutputs: Record<string, DataValue>;
|
|
27
|
-
loadedProjects: Record<ProjectId, Project>;
|
|
28
18
|
node: ChartNode;
|
|
29
19
|
nodeAbortController: AbortController;
|
|
30
20
|
onPartialOutputs: (partialOutputs: Outputs) => void;
|
|
31
21
|
processId: ProcessId;
|
|
32
|
-
project: Project;
|
|
33
|
-
raiseEvent: (event: string, data: DataValue | undefined) => void;
|
|
34
22
|
requestUserInput: (inputStrings: string[], renderingType: 'text' | 'markdown') => Promise<StringArrayDataValue>;
|
|
35
23
|
setGlobal: (id: string, value: ScalarOrArrayDataValue) => void;
|
|
36
|
-
tokenizer: Tokenizer;
|
|
37
|
-
trace: (message: string) => void;
|
|
38
24
|
waitEvent: (event: string) => Promise<DataValue | undefined>;
|
|
39
|
-
waitForGlobal: (id: string) => Promise<ScalarOrArrayDataValue>;
|
|
40
|
-
abortGraph: (error?: Error | string) => void;
|
|
41
25
|
}): InternalProcessContext;
|
|
@@ -9,23 +9,28 @@ export type SplitRunDeps = {
|
|
|
9
9
|
accumulateCost(output: Outputs): void;
|
|
10
10
|
setNodeResults(nodeId: ChartNode['id'], outputs: Outputs): void;
|
|
11
11
|
markNodeVisited(nodeId: ChartNode['id']): void;
|
|
12
|
-
nodeErrored(node: ChartNode, error: unknown, processId: ProcessId): void
|
|
12
|
+
nodeErrored(node: ChartNode, error: unknown, processId: ProcessId, durationMs?: number, splitRunDurationMs?: Record<number, number>): Promise<void>;
|
|
13
13
|
isAborted(): boolean;
|
|
14
|
+
getAbortError(): Error;
|
|
14
15
|
emit(event: 'nodeStart', data: {
|
|
15
16
|
node: ChartNode;
|
|
16
17
|
inputs: Inputs;
|
|
17
18
|
processId: ProcessId;
|
|
18
|
-
}): void;
|
|
19
|
+
}): Promise<void> | void;
|
|
19
20
|
emit(event: 'nodeFinish', data: {
|
|
20
21
|
node: ChartNode;
|
|
21
22
|
outputs: Outputs;
|
|
22
23
|
processId: ProcessId;
|
|
23
|
-
|
|
24
|
+
durationMs?: number;
|
|
25
|
+
splitRunDurationMs?: Record<number, number>;
|
|
26
|
+
}): Promise<void> | void;
|
|
24
27
|
emit(event: 'partialOutput', data: {
|
|
25
28
|
node: ChartNode;
|
|
26
29
|
outputs: Outputs;
|
|
27
30
|
index: number;
|
|
28
31
|
processId: ProcessId;
|
|
29
32
|
}): void;
|
|
33
|
+
startNodeTiming?(): number | undefined;
|
|
34
|
+
finishNodeTiming?(start: number | undefined): number | undefined;
|
|
30
35
|
};
|
|
31
36
|
export declare function processSplitRunNode(node: ChartNode, processId: ProcessId, deps: SplitRunDeps): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ChartNode, type NodeConnection, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
2
|
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
4
5
|
export type DidRunNode = ChartNode<'didRun', DidRunNodeData>;
|
|
5
6
|
export type DidRunNodeData = {};
|
|
6
7
|
export declare class DidRunNodeImpl extends NodeImpl<DidRunNode> {
|
|
@@ -9,7 +10,7 @@ export declare class DidRunNodeImpl extends NodeImpl<DidRunNode> {
|
|
|
9
10
|
getInputDefinitions(connections: NodeConnection[]): NodeInputDefinition[];
|
|
10
11
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
11
12
|
static getUIData(): NodeUIData;
|
|
12
|
-
|
|
13
|
+
getEditors(): EditorDefinition<DidRunNode>[];
|
|
13
14
|
process(inputData: Inputs): Promise<Outputs>;
|
|
14
15
|
}
|
|
15
16
|
export declare const didRunNode: import("../NodeDefinition.js").NodeDefinition<DidRunNode>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ChartNode, type NodeConnection, type NodeId, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
-
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
2
|
+
import { NodeImpl, type NodeDefinitionContext, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
4
|
import { type GraphId } from '../NodeGraph.js';
|
|
5
|
-
import { type Project } from '../Project.js';
|
|
5
|
+
import { type Project, type ProjectId } from '../Project.js';
|
|
6
6
|
import { type DataValue } from '../DataValue.js';
|
|
7
7
|
import { type InternalProcessContext } from '../ProcessContext.js';
|
|
8
8
|
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
@@ -20,11 +20,12 @@ export type LoopUntilNodeData = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare class LoopUntilNodeImpl extends NodeImpl<LoopUntilNode> {
|
|
22
22
|
static create(): LoopUntilNode;
|
|
23
|
-
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
24
|
-
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
23
|
+
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project, _referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
24
|
+
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project, _referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
25
25
|
getEditors(context: RivetUIContext): EditorDefinition<LoopUntilNode>[];
|
|
26
26
|
static getUIData(): NodeUIData;
|
|
27
27
|
getBody(context: RivetUIContext): string;
|
|
28
|
+
private getBoundary;
|
|
28
29
|
private shouldBreak;
|
|
29
30
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
30
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChartNode, type NodeConnection, type NodeId, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
-
import { NodeImpl, type NodeBody, type NodeUIData } from '../NodeImpl.js';
|
|
2
|
+
import { NodeImpl, type NodeBody, type NodeDefinitionContext, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
4
|
import { type GraphId } from '../NodeGraph.js';
|
|
5
5
|
import { type Project, type ProjectId } from '../Project.js';
|
|
@@ -20,9 +20,10 @@ export type ReferencedGraphAliasNode = ChartNode & {
|
|
|
20
20
|
};
|
|
21
21
|
export declare class ReferencedGraphAliasNodeImpl extends NodeImpl<ReferencedGraphAliasNode> {
|
|
22
22
|
static create(): ReferencedGraphAliasNode;
|
|
23
|
-
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, _project: Project, referencedProjects: Record<ProjectId, Project
|
|
24
|
-
getGraphOutputs(referencedProject: Project): NodeOutputDefinition[];
|
|
25
|
-
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, _project: Project, referencedProjects: Record<ProjectId, Project
|
|
23
|
+
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, _project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
24
|
+
getGraphOutputs(referencedProject: Project, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
25
|
+
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, _project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
26
|
+
private getBoundary;
|
|
26
27
|
getEditors(context: RivetUIContext): EditorDefinition<ReferencedGraphAliasNode>[];
|
|
27
28
|
getBody(context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
28
29
|
static getUIData(): NodeUIData;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ChartNode, type NodeConnection, type NodeId, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
-
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
2
|
+
import { NodeImpl, type NodeDefinitionContext, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
4
|
import { type GraphId } from '../NodeGraph.js';
|
|
5
|
-
import { type Project } from '../Project.js';
|
|
5
|
+
import { type Project, type ProjectId } from '../Project.js';
|
|
6
6
|
import { type DataValue } from '../DataValue.js';
|
|
7
7
|
import { type InternalProcessContext } from '../ProcessContext.js';
|
|
8
8
|
import { type EditorDefinition } from '../../index.js';
|
|
@@ -19,9 +19,10 @@ export type SubGraphNode = ChartNode & {
|
|
|
19
19
|
};
|
|
20
20
|
export declare class SubGraphNodeImpl extends NodeImpl<SubGraphNode> {
|
|
21
21
|
static create(): SubGraphNode;
|
|
22
|
-
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
23
|
-
getGraphOutputs(project: Project): NodeOutputDefinition[];
|
|
24
|
-
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
22
|
+
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project, _referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
23
|
+
getGraphOutputs(project: Project, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
24
|
+
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project, _referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
25
|
+
private getBoundary;
|
|
25
26
|
getEditors(context: RivetUIContext): EditorDefinition<SubGraphNode>[];
|
|
26
27
|
static getUIData(): NodeUIData;
|
|
27
28
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
@@ -44,12 +44,16 @@ export type RecordedEventsMap = OverrideProperties<ProcessEvents, {
|
|
|
44
44
|
nodeId: NodeId;
|
|
45
45
|
outputs: Outputs;
|
|
46
46
|
processId: ProcessId;
|
|
47
|
+
durationMs?: number;
|
|
48
|
+
splitRunDurationMs?: Record<number, number>;
|
|
47
49
|
}>;
|
|
48
50
|
/** Called when a node has errored during processing. */
|
|
49
51
|
nodeError: WithOptionalExecution<{
|
|
50
52
|
nodeId: NodeId;
|
|
51
53
|
error: string;
|
|
52
54
|
processId: ProcessId;
|
|
55
|
+
durationMs?: number;
|
|
56
|
+
splitRunDurationMs?: Record<number, number>;
|
|
53
57
|
}>;
|
|
54
58
|
/** Called when a node has been excluded from processing. */
|
|
55
59
|
nodeExcluded: WithOptionalExecution<{
|
|
@@ -5,7 +5,7 @@ import type Emittery from 'emittery';
|
|
|
5
5
|
* Use this instead of inline `// eslint-disable-next-line @typescript-eslint/no-floating-promises`
|
|
6
6
|
* to make the "detached async" intent explicit and auditable.
|
|
7
7
|
*
|
|
8
|
-
* The returned promise is intentionally discarded.
|
|
9
|
-
*
|
|
8
|
+
* The returned promise is intentionally discarded. Call this only for events
|
|
9
|
+
* where listener completion does not affect processor ordering.
|
|
10
10
|
*/
|
|
11
11
|
export declare function emitDetached<T extends Record<string, unknown>>(emitter: Emittery<T>, event: keyof T & string, data: T[keyof T & string]): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type PreparedSerializationVersion = 1 | 2 | 3 | 4;
|
|
2
|
+
export type PreparedSerializedInput = {
|
|
3
|
+
deserializerInput: unknown;
|
|
4
|
+
version: PreparedSerializationVersion;
|
|
5
|
+
};
|
|
6
|
+
export declare function prepareSerializedInput(data: unknown): PreparedSerializedInput;
|
|
7
|
+
export {};
|