@valerypopoff/rivet2-core 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.cjs +781 -245
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/esm/exports.js +1 -0
- package/dist/esm/model/GraphInputStream.js +70 -0
- package/dist/esm/model/GraphProcessor.js +257 -16
- package/dist/esm/model/NodeExecutionPlanner.js +4 -4
- package/dist/esm/model/Nodes.js +3 -0
- package/dist/esm/model/ProcessContextBuilder.js +2 -1
- package/dist/esm/model/StreamingOutputWatch.js +5 -0
- package/dist/esm/model/StreamingWatchTopology.js +191 -0
- package/dist/esm/model/nodes/AssembleMessageNode.js +2 -2
- package/dist/esm/model/nodes/AssemblePromptNode.js +46 -17
- package/dist/esm/model/nodes/GraphInputNode.js +15 -19
- package/dist/esm/model/nodes/MatchCaseNode.js +2 -2
- package/dist/esm/model/nodes/ProjectNameNode.js +37 -0
- package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +1 -0
- package/dist/esm/model/nodes/SubGraphNode.js +1 -0
- package/dist/esm/model/nodes/variadicPortIndex.js +1 -1
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/model/GraphInputStream.d.ts +23 -0
- package/dist/types/model/GraphProcessor.d.ts +3 -0
- package/dist/types/model/NodeExecutionPlanner.d.ts +1 -1
- package/dist/types/model/Nodes.d.ts +3 -2
- package/dist/types/model/ProcessContext.d.ts +3 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +2 -1
- package/dist/types/model/StreamingOutputWatch.d.ts +2 -0
- package/dist/types/model/StreamingWatchTopology.d.ts +20 -0
- package/dist/types/model/nodes/AssemblePromptNode.d.ts +4 -3
- package/dist/types/model/nodes/GraphInputNode.d.ts +2 -0
- package/dist/types/model/nodes/MatchCaseNode.d.ts +1 -1
- package/dist/types/model/nodes/ProjectNameNode.d.ts +12 -0
- package/dist/types/model/nodes/variadicPortIndex.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { canRenderDataBusNode, getDataBusInputChannelIndex, getDataBusOutputChannelIndex } from './DataBusTopology.js';
|
|
2
|
+
import { resolveNodePrefabInstance } from './NodePrefabResolver.js';
|
|
3
|
+
import { createGraphOutputSelection } from './GraphOutputSelection.js';
|
|
4
|
+
export function canStreamThroughGraphCaller(node) {
|
|
5
|
+
return ((node.type === 'subGraph' || node.type === 'referencedGraphAlias') &&
|
|
6
|
+
!node.disabled &&
|
|
7
|
+
!node.isConditional &&
|
|
8
|
+
!node.isSplitRun &&
|
|
9
|
+
!node.data.useErrorOutput);
|
|
10
|
+
}
|
|
11
|
+
export function canStreamThroughGraphInput(node) {
|
|
12
|
+
return (node.type === 'graphInput' &&
|
|
13
|
+
!node.disabled &&
|
|
14
|
+
!node.isConditional &&
|
|
15
|
+
!node.isSplitRun &&
|
|
16
|
+
!node.data.useDefaultValueInput);
|
|
17
|
+
}
|
|
18
|
+
/** Trace Watch demand through named boundaries without making ordinary nodes repeatable. */
|
|
19
|
+
export function getProjectStreamingOutputWatchConnections({ project, graph, referencedProjects, registry, frozenNodeOutputs = {}, isNodeFrozen, fullGraphCallers, }) {
|
|
20
|
+
// Unsaved active graph edits must take precedence over the stored project graph.
|
|
21
|
+
const currentProject = {
|
|
22
|
+
...project,
|
|
23
|
+
graphs: { ...project.graphs, ...(graph.metadata?.id ? { [graph.metadata.id]: graph } : {}) },
|
|
24
|
+
};
|
|
25
|
+
const projects = { ...referencedProjects, [project.metadata.id]: currentProject };
|
|
26
|
+
const contexts = new Map();
|
|
27
|
+
const isFrozen = (owner, candidate, node) => isNodeFrozen?.(owner, candidate, node) ??
|
|
28
|
+
(owner === currentProject &&
|
|
29
|
+
!!(candidate.metadata?.id && frozenNodeOutputs[candidate.metadata.id]?.[node.id]?.length));
|
|
30
|
+
for (const owner of Object.values(projects)) {
|
|
31
|
+
for (const candidate of Object.values(owner.graphs)) {
|
|
32
|
+
const nodes = Object.fromEntries(candidate.nodes.map((node) => [node.id, resolveNodePrefabInstance(owner, node)]));
|
|
33
|
+
const connectionsByNode = new Map();
|
|
34
|
+
for (const edge of candidate.connections) {
|
|
35
|
+
for (const id of new Set([edge.inputNodeId, edge.outputNodeId])) {
|
|
36
|
+
const edges = connectionsByNode.get(id) ?? [];
|
|
37
|
+
edges.push(edge);
|
|
38
|
+
connectionsByNode.set(id, edges);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const ports = new Map();
|
|
42
|
+
const getPorts = (nodeId) => {
|
|
43
|
+
const cached = ports.get(nodeId);
|
|
44
|
+
if (cached)
|
|
45
|
+
return cached;
|
|
46
|
+
const node = nodes[nodeId];
|
|
47
|
+
let definitions = { inputs: new Set(), outputs: new Set() };
|
|
48
|
+
try {
|
|
49
|
+
if (!node)
|
|
50
|
+
return definitions;
|
|
51
|
+
const impl = registry.createDynamicImpl(node);
|
|
52
|
+
const connections = connectionsByNode.get(node.id) ?? [];
|
|
53
|
+
definitions = {
|
|
54
|
+
inputs: new Set(impl.getInputDefinitionsIncludingBuiltIn(connections, nodes, owner, projects).map((port) => port.id)),
|
|
55
|
+
outputs: new Set(impl.getOutputDefinitions(connections, nodes, owner, projects).map((port) => port.id)),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Missing plugins or incomplete definitions cannot establish a stream route.
|
|
60
|
+
}
|
|
61
|
+
ports.set(nodeId, definitions);
|
|
62
|
+
return definitions;
|
|
63
|
+
};
|
|
64
|
+
// Resolve definitions only on visited routes, including failed plugin lookups.
|
|
65
|
+
const incomingByNode = new Map();
|
|
66
|
+
const incoming = (nodeId) => {
|
|
67
|
+
let edges = incomingByNode.get(nodeId);
|
|
68
|
+
if (!edges) {
|
|
69
|
+
edges = (connectionsByNode.get(nodeId) ?? []).filter((edge) => edge.inputNodeId === nodeId &&
|
|
70
|
+
getPorts(nodeId).inputs.has(edge.inputId) &&
|
|
71
|
+
getPorts(edge.outputNodeId).outputs.has(edge.outputId));
|
|
72
|
+
incomingByNode.set(nodeId, edges);
|
|
73
|
+
}
|
|
74
|
+
return edges;
|
|
75
|
+
};
|
|
76
|
+
contexts.set(candidate, { project: owner, nodes, incoming, marked: new Set() });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Index callers by the actual target graph, not graph/node IDs (which are local).
|
|
80
|
+
const callers = new Map();
|
|
81
|
+
for (const [parent, context] of contexts) {
|
|
82
|
+
for (const node of Object.values(context.nodes)) {
|
|
83
|
+
if (node.disabled || isFrozen(context.project, parent, node) || !canStreamThroughGraphCaller(node))
|
|
84
|
+
continue;
|
|
85
|
+
const caller = node;
|
|
86
|
+
const owner = caller.type === 'subGraph' ? context.project : projects[caller.data.projectId];
|
|
87
|
+
const child = owner?.graphs[caller.data.graphId];
|
|
88
|
+
if (!child)
|
|
89
|
+
continue;
|
|
90
|
+
let selected;
|
|
91
|
+
if (caller.type === 'subGraph' &&
|
|
92
|
+
caller.data.skipUnusedOutputs &&
|
|
93
|
+
!caller.data.useAsGraphPartialOutput &&
|
|
94
|
+
!(parent === graph && fullGraphCallers?.has(caller.id))) {
|
|
95
|
+
const childContext = contexts.get(child);
|
|
96
|
+
const outputNames = new Set(Object.values(childContext.nodes)
|
|
97
|
+
.filter((node) => node.type === 'graphOutput')
|
|
98
|
+
.map((node) => node.data.id));
|
|
99
|
+
const outputs = parent.connections
|
|
100
|
+
.filter((edge) => edge.outputNodeId === caller.id)
|
|
101
|
+
.map((edge) => edge.outputId)
|
|
102
|
+
.filter((id) => outputNames.has(id));
|
|
103
|
+
try {
|
|
104
|
+
selected = createGraphOutputSelection({ ...child, nodes: Object.values(childContext.nodes) }, outputs, (node) => childContext.incoming(node.id).map((edge) => childContext.nodes[edge.outputNodeId])).nodeIds;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const entries = callers.get(child) ?? [];
|
|
111
|
+
entries.push({ graph: parent, node, selected });
|
|
112
|
+
callers.set(child, entries);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const pending = [];
|
|
116
|
+
for (const [candidate, context] of contexts) {
|
|
117
|
+
for (const node of Object.values(context.nodes)) {
|
|
118
|
+
if (node.type !== 'watchStreamingOutput' || node.disabled || isFrozen(context.project, candidate, node))
|
|
119
|
+
continue;
|
|
120
|
+
const inputs = context.incoming(node.id).filter((edge) => edge.inputId === 'stream');
|
|
121
|
+
// Multiple providers are rejected by the Watch scheduler, not multiple streams.
|
|
122
|
+
if (inputs.length === 1)
|
|
123
|
+
pending.push({ graph: candidate, edge: inputs[0] });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
while (pending.length) {
|
|
127
|
+
const { graph: candidate, edge } = pending.pop();
|
|
128
|
+
const context = contexts.get(candidate);
|
|
129
|
+
if (context.marked.has(edge))
|
|
130
|
+
continue;
|
|
131
|
+
const route = new Set([edge]);
|
|
132
|
+
let producerEdge = edge;
|
|
133
|
+
let source = context.nodes[producerEdge.outputNodeId];
|
|
134
|
+
while (source && canRenderDataBusNode(source)) {
|
|
135
|
+
const channel = getDataBusOutputChannelIndex(producerEdge.outputId);
|
|
136
|
+
const providers = context
|
|
137
|
+
.incoming(source.id)
|
|
138
|
+
.filter((input) => getDataBusInputChannelIndex(input.inputId) === channel);
|
|
139
|
+
if (channel == null || providers.length !== 1 || route.has(providers[0])) {
|
|
140
|
+
source = undefined;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
producerEdge = providers[0];
|
|
144
|
+
route.add(producerEdge);
|
|
145
|
+
source = context.nodes[producerEdge.outputNodeId];
|
|
146
|
+
}
|
|
147
|
+
if (!source || source.disabled || source.type === 'dataBus')
|
|
148
|
+
continue;
|
|
149
|
+
if (context.nodes[edge.inputNodeId]?.type === 'graphOutput' && source.isSplitRun)
|
|
150
|
+
continue;
|
|
151
|
+
for (const segment of route)
|
|
152
|
+
context.marked.add(segment);
|
|
153
|
+
if (source.isSplitRun || isFrozen(context.project, candidate, source))
|
|
154
|
+
continue;
|
|
155
|
+
if (source.type === 'graphInput' && producerEdge.outputId === 'data') {
|
|
156
|
+
if (!canStreamThroughGraphInput(source))
|
|
157
|
+
continue;
|
|
158
|
+
const inputName = source.data.id;
|
|
159
|
+
for (const parent of callers.get(candidate) ?? []) {
|
|
160
|
+
if (parent.selected && !parent.selected.has(edge.inputNodeId))
|
|
161
|
+
continue;
|
|
162
|
+
for (const input of contexts.get(parent.graph).incoming(parent.node.id)) {
|
|
163
|
+
if (input.inputId === inputName)
|
|
164
|
+
pending.push({ graph: parent.graph, edge: input });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (!canStreamThroughGraphCaller(source))
|
|
170
|
+
continue;
|
|
171
|
+
const caller = source;
|
|
172
|
+
const childProject = caller.type === 'subGraph' ? context.project : projects[caller.data.projectId];
|
|
173
|
+
const child = childProject?.graphs[caller.data.graphId];
|
|
174
|
+
const childContext = child && contexts.get(child);
|
|
175
|
+
if (!child || !childContext)
|
|
176
|
+
continue;
|
|
177
|
+
const outputs = Object.values(childContext.nodes).filter((node) => node.type === 'graphOutput' && !node.disabled && node.data.id === producerEdge.outputId);
|
|
178
|
+
// Duplicate names have first-final-winner semantics, so cannot relay partials.
|
|
179
|
+
if (outputs.length !== 1)
|
|
180
|
+
continue;
|
|
181
|
+
const output = outputs[0];
|
|
182
|
+
if (output.isConditional || output.isSplitRun || isFrozen(childProject, child, output))
|
|
183
|
+
continue;
|
|
184
|
+
for (const input of childContext.incoming(output.id)) {
|
|
185
|
+
if (input.inputId === 'value' && !childContext.nodes[input.outputNodeId]?.isSplitRun) {
|
|
186
|
+
pending.push({ graph: child, edge: input });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return contexts.get(graph)?.marked ?? new Set();
|
|
191
|
+
}
|
|
@@ -7,7 +7,7 @@ import { orderBy } from 'lodash-es';
|
|
|
7
7
|
import { coerceTypeOptional, dedent, getInputOrData } from '../../utils/index.js';
|
|
8
8
|
import { nodeDefinition } from '../NodeDefinition.js';
|
|
9
9
|
import { match } from 'ts-pattern';
|
|
10
|
-
import { getNextVariadicPortIndex } from './variadicPortIndex.js';
|
|
10
|
+
import { getNextVariadicPortIndex, parseVariadicPortIndex } from './variadicPortIndex.js';
|
|
11
11
|
const messageTypeToTitle = {
|
|
12
12
|
assistant: 'Assistant',
|
|
13
13
|
developer: 'Developer',
|
|
@@ -148,7 +148,7 @@ export class AssembleMessageNodeImpl extends NodeImpl {
|
|
|
148
148
|
.otherwise(() => {
|
|
149
149
|
throw new Error(`Invalid type: ${type}`);
|
|
150
150
|
});
|
|
151
|
-
const inputParts = orderBy(Object.entries(inputs).filter(([key]) => key.startsWith('part')), ([key]) => key, 'asc');
|
|
151
|
+
const inputParts = orderBy(Object.entries(inputs).filter(([key]) => key.startsWith('part')), ([key]) => parseVariadicPortIndex(key, 'part', 'legacy'), 'asc');
|
|
152
152
|
for (const [, inputPart] of inputParts) {
|
|
153
153
|
if (!inputPart || inputPart.type === 'control-flow-excluded' || !inputPart.value) {
|
|
154
154
|
continue;
|
|
@@ -8,7 +8,18 @@ import { orderBy } from 'lodash-es';
|
|
|
8
8
|
import { dedent } from 'ts-dedent';
|
|
9
9
|
import { nodeDefinition } from '../NodeDefinition.js';
|
|
10
10
|
import { getInputOrData } from '../../utils/inputs.js';
|
|
11
|
-
import { getNextVariadicPortIndex } from './variadicPortIndex.js';
|
|
11
|
+
import { getNextVariadicPortIndex, parseVariadicPortIndex } from './variadicPortIndex.js';
|
|
12
|
+
function isEmptyPromptMessage(message) {
|
|
13
|
+
// Tool protocol messages remain meaningful even when their textual content is empty.
|
|
14
|
+
if (message.type === 'function') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
if (message.type === 'assistant' && (message.function_call != null || (message.function_calls?.length ?? 0) > 0)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const parts = Array.isArray(message.message) ? message.message : [message.message];
|
|
21
|
+
return !parts.some((part) => typeof part !== 'string' || part.trim().length > 0);
|
|
22
|
+
}
|
|
12
23
|
export class AssemblePromptNodeImpl extends NodeImpl {
|
|
13
24
|
static create() {
|
|
14
25
|
const chartNode = {
|
|
@@ -20,7 +31,9 @@ export class AssemblePromptNodeImpl extends NodeImpl {
|
|
|
20
31
|
y: 0,
|
|
21
32
|
width: 250,
|
|
22
33
|
},
|
|
23
|
-
data: {
|
|
34
|
+
data: {
|
|
35
|
+
filterEmptyPrompts: false,
|
|
36
|
+
},
|
|
24
37
|
};
|
|
25
38
|
return chartNode;
|
|
26
39
|
}
|
|
@@ -32,7 +45,7 @@ export class AssemblePromptNodeImpl extends NodeImpl {
|
|
|
32
45
|
dataType: 'boolean',
|
|
33
46
|
id: 'isLastMessageCacheBreakpoint',
|
|
34
47
|
title: 'Is Last Message Cache Breakpoint',
|
|
35
|
-
description: 'Whether the last message in
|
|
48
|
+
description: 'Whether the last message in a multi-message prompt should be a cache breakpoint.',
|
|
36
49
|
});
|
|
37
50
|
}
|
|
38
51
|
for (let i = 1; i <= messageCount; i++) {
|
|
@@ -78,48 +91,64 @@ export class AssemblePromptNodeImpl extends NodeImpl {
|
|
|
78
91
|
group: ['AI'],
|
|
79
92
|
};
|
|
80
93
|
}
|
|
81
|
-
getEditors(
|
|
94
|
+
getEditors() {
|
|
82
95
|
return [
|
|
83
96
|
{
|
|
84
97
|
type: 'toggle',
|
|
85
98
|
label: 'Compute Token Count',
|
|
86
99
|
dataKey: 'computeTokenCount',
|
|
87
100
|
},
|
|
101
|
+
{
|
|
102
|
+
type: 'toggle',
|
|
103
|
+
label: 'Filter empty prompts',
|
|
104
|
+
dataKey: 'filterEmptyPrompts',
|
|
105
|
+
defaultValue: false,
|
|
106
|
+
helperMessage: 'Removes text-only messages whose content is empty or whitespace. Rich-content and tool-protocol messages are preserved.',
|
|
107
|
+
},
|
|
88
108
|
{
|
|
89
109
|
type: 'toggle',
|
|
90
110
|
label: 'Is Last Message Cache Breakpoint',
|
|
91
111
|
dataKey: 'isLastMessageCacheBreakpoint',
|
|
92
|
-
|
|
112
|
+
useInputToggleDataKey: 'useIsLastMessageCacheBreakpointInput',
|
|
113
|
+
helperMessage: 'For Anthropic, marks the last message in a prompt containing at least two messages as a cache breakpoint. This message and every message before it will be cached using Prompt Caching.',
|
|
93
114
|
},
|
|
94
115
|
];
|
|
95
116
|
}
|
|
96
|
-
getBody(
|
|
97
|
-
return
|
|
117
|
+
getBody() {
|
|
118
|
+
return [
|
|
119
|
+
this.data.filterEmptyPrompts ? 'Filter empty prompts: Enabled' : '',
|
|
120
|
+
this.data.useIsLastMessageCacheBreakpointInput
|
|
121
|
+
? 'Last message cache breakpoint: From input'
|
|
122
|
+
: this.data.isLastMessageCacheBreakpoint
|
|
123
|
+
? 'Last message is cache breakpoint'
|
|
124
|
+
: '',
|
|
125
|
+
]
|
|
126
|
+
.filter(Boolean)
|
|
127
|
+
.join('\n');
|
|
98
128
|
}
|
|
99
129
|
async process(inputs, context) {
|
|
100
130
|
const output = {};
|
|
101
131
|
const isLastMessageCacheBreakpoint = getInputOrData(this.data, inputs, 'isLastMessageCacheBreakpoint', 'boolean');
|
|
102
132
|
const outMessages = [];
|
|
103
|
-
const inputMessages = orderBy(Object.entries(inputs).filter(([key]) => key.startsWith('message')), ([key]) => key, 'asc');
|
|
133
|
+
const inputMessages = orderBy(Object.entries(inputs).filter(([key]) => key.startsWith('message')), ([key]) => parseVariadicPortIndex(key, 'message', 'legacy'), 'asc');
|
|
104
134
|
for (const [, inputMessage] of inputMessages) {
|
|
105
135
|
if (!inputMessage || inputMessage.type === 'control-flow-excluded' || !inputMessage.value) {
|
|
106
136
|
continue;
|
|
107
137
|
}
|
|
108
138
|
const inMessages = arrayizeDataValue(unwrapDataValue(inputMessage));
|
|
109
139
|
for (const message of inMessages) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
else {
|
|
114
|
-
const coerced = coerceType(message, 'chat-message');
|
|
115
|
-
if (coerced) {
|
|
116
|
-
outMessages.push(coerced);
|
|
117
|
-
}
|
|
140
|
+
const outMessage = message.type === 'chat-message' ? message.value : coerceType(message, 'chat-message');
|
|
141
|
+
if (this.data.filterEmptyPrompts && isEmptyPromptMessage(outMessage)) {
|
|
142
|
+
continue;
|
|
118
143
|
}
|
|
144
|
+
outMessages.push(outMessage);
|
|
119
145
|
}
|
|
120
146
|
}
|
|
121
147
|
if (isLastMessageCacheBreakpoint && outMessages.length > 1) {
|
|
122
|
-
outMessages.
|
|
148
|
+
outMessages[outMessages.length - 1] = {
|
|
149
|
+
...outMessages[outMessages.length - 1],
|
|
150
|
+
isCacheBreakpoint: true,
|
|
151
|
+
};
|
|
123
152
|
}
|
|
124
153
|
output['prompt'] = {
|
|
125
154
|
type: 'chat-message[]',
|
|
@@ -105,28 +105,24 @@ export class GraphInputNodeImpl extends NodeImpl {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
async process(inputs, context) {
|
|
108
|
-
|
|
109
|
-
? undefined
|
|
110
|
-
: coerceTypeOptional(context.graphInputs[this.data.id], this.data.dataType);
|
|
111
|
-
if (inputValue == null && this.data.useDefaultValueInput) {
|
|
112
|
-
inputValue = coerceTypeOptional(inputs['default'], this.data.dataType);
|
|
113
|
-
}
|
|
114
|
-
if (inputValue == null) {
|
|
115
|
-
inputValue =
|
|
116
|
-
coerceTypeOptional(inferType(this.data.defaultValue), this.data.dataType) ||
|
|
117
|
-
getDefaultValue(this.data.dataType);
|
|
118
|
-
}
|
|
119
|
-
// Resolve undefined for array inputs to empty array
|
|
120
|
-
if (inputValue == null && isArrayDataType(this.data.dataType)) {
|
|
121
|
-
inputValue = { type: this.data.dataType, value: [] };
|
|
122
|
-
}
|
|
123
|
-
const value = {
|
|
124
|
-
type: this.data.dataType,
|
|
125
|
-
value: inputValue,
|
|
126
|
-
};
|
|
108
|
+
const value = resolveGraphInputValue(this.data, context.graphInputs[this.data.id], inputs);
|
|
127
109
|
// Store the resolved value in the context for access by other nodes
|
|
128
110
|
context.graphInputNodeValues[this.data.id] = value;
|
|
129
111
|
return { ['data']: value };
|
|
130
112
|
}
|
|
131
113
|
}
|
|
114
|
+
/** One coercion/default policy for ordinary and live graph inputs. */
|
|
115
|
+
export function resolveGraphInputValue(data, input, inputs = {}) {
|
|
116
|
+
let inputValue = input == null ? undefined : coerceTypeOptional(input, data.dataType);
|
|
117
|
+
if (inputValue == null && data.useDefaultValueInput) {
|
|
118
|
+
inputValue = coerceTypeOptional(inputs['default'], data.dataType);
|
|
119
|
+
}
|
|
120
|
+
if (inputValue == null) {
|
|
121
|
+
inputValue = coerceTypeOptional(inferType(data.defaultValue), data.dataType) || getDefaultValue(data.dataType);
|
|
122
|
+
}
|
|
123
|
+
if (inputValue == null && isArrayDataType(data.dataType)) {
|
|
124
|
+
inputValue = { type: data.dataType, value: [] };
|
|
125
|
+
}
|
|
126
|
+
return { type: data.dataType, value: inputValue };
|
|
127
|
+
}
|
|
132
128
|
export const graphInputNode = nodeDefinition(GraphInputNodeImpl, 'Graph Input');
|
|
@@ -18,7 +18,7 @@ export class MatchCaseNodeImpl extends MatchCaseNodeBase {
|
|
|
18
18
|
{ value: true, label: 'First matching case' },
|
|
19
19
|
{ value: false, label: 'All matching cases' },
|
|
20
20
|
];
|
|
21
|
-
sharedCustomValueInputTitle = '
|
|
21
|
+
sharedCustomValueInputTitle = 'Output value';
|
|
22
22
|
triggerEditorLabel = 'Trigger';
|
|
23
23
|
static create() {
|
|
24
24
|
return {
|
|
@@ -115,7 +115,7 @@ export class MatchCaseNodeImpl extends MatchCaseNodeBase {
|
|
|
115
115
|
infoBoxBody: dedent `
|
|
116
116
|
Routes an Input value to matching case outputs. Plain text cases use exact, case-sensitive equality by default; turn off Case sensitive to ignore letter case. Choose Regular expression to use the existing JavaScript RegExp pattern behavior; the Case sensitive switch does not apply in that mode.
|
|
117
117
|
|
|
118
|
-
Choose First matching case to trigger only the first matching output, or All matching cases to trigger every matching output. Active outputs return True by default. They can instead return the Input value, or a custom value supplied through one shared
|
|
118
|
+
Choose First matching case to trigger only the first matching output, or All matching cases to trigger every matching output. Active outputs return True by default. They can instead return the Input value, or a custom value supplied through one shared Output value input or separate Output values inputs for every case and Unmatched.
|
|
119
119
|
`,
|
|
120
120
|
infoBoxTitle: 'Match case Node',
|
|
121
121
|
contextMenuTitle: 'Match case',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { newId } from '../../utils/index.js';
|
|
2
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
3
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
4
|
+
export class ProjectNameNodeImpl extends NodeImpl {
|
|
5
|
+
static create() {
|
|
6
|
+
return {
|
|
7
|
+
id: newId(),
|
|
8
|
+
type: 'projectName',
|
|
9
|
+
title: 'Project Name',
|
|
10
|
+
visualData: { x: 0, y: 0, width: 250 },
|
|
11
|
+
data: {},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
getInputDefinitions() {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
getOutputDefinitions() {
|
|
18
|
+
return [{ id: 'projectName', title: 'Project Name', dataType: 'string' }];
|
|
19
|
+
}
|
|
20
|
+
getEditors() {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
static getUIData() {
|
|
24
|
+
return {
|
|
25
|
+
contextMenuTitle: 'Project Name',
|
|
26
|
+
infoBoxTitle: 'Project Name',
|
|
27
|
+
infoBoxBody: "Returns the name of the project that owns the graph currently being executed. A graph called from a referenced project returns that referenced project's name.",
|
|
28
|
+
group: ['Debug'],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async process(_inputs, context) {
|
|
32
|
+
return {
|
|
33
|
+
['projectName']: { type: 'string', value: context.project.metadata.title },
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const projectNameNode = nodeDefinition(ProjectNameNodeImpl, 'Project Name');
|
|
@@ -125,6 +125,7 @@ export class ReferencedGraphAliasNodeImpl extends NodeImpl {
|
|
|
125
125
|
try {
|
|
126
126
|
const startTime = Date.now();
|
|
127
127
|
const outputs = await subGraphProcessor.processGraph(context, inputData, context.contextValues, {
|
|
128
|
+
graphInputStreams: context.graphInputStreams,
|
|
128
129
|
// This node preserves the referenced graph's named boundary ports,
|
|
129
130
|
// so it may relay their direct producer partials to a parent Watch.
|
|
130
131
|
// An Error-output alias can replace normal ports with exclusions,
|
|
@@ -127,6 +127,7 @@ export class SubGraphNodeImpl extends NodeImpl {
|
|
|
127
127
|
const startTime = Date.now();
|
|
128
128
|
const graphOutputs = await subGraphProcessor.processGraph(context, inputData, context.contextValues, {
|
|
129
129
|
...(requestedGraphOutputIds ? { requestedGraphOutputIds } : {}),
|
|
130
|
+
graphInputStreams: context.graphInputStreams,
|
|
130
131
|
// A child Graph Output can relay a direct producer's partial value
|
|
131
132
|
// under the public boundary port ID. An Error-output Subgraph may
|
|
132
133
|
// later replace that same normal output with an exclusion, so it is
|
|
@@ -14,7 +14,7 @@ export function getHighestVariadicPortIndex(connections, inputNodeId, prefix, po
|
|
|
14
14
|
export function getNextVariadicPortIndex(connections, inputNodeId, prefix, policy) {
|
|
15
15
|
return getHighestVariadicPortIndex(connections, inputNodeId, prefix, policy) + 1;
|
|
16
16
|
}
|
|
17
|
-
function parseVariadicPortIndex(portId, prefix, policy) {
|
|
17
|
+
export function parseVariadicPortIndex(portId, prefix, policy) {
|
|
18
18
|
if (policy === 'legacy') {
|
|
19
19
|
const index = parseInt(portId.replace(prefix, ''));
|
|
20
20
|
return Number.isNaN(index) ? undefined : index;
|
package/dist/types/exports.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from './model/DataValue.js';
|
|
|
5
5
|
export * from './model/NodeBase.js';
|
|
6
6
|
export * from './model/NodeGraph.js';
|
|
7
7
|
export * from './model/NodePrefabResolver.js';
|
|
8
|
+
export * from './model/StreamingWatchTopology.js';
|
|
9
|
+
export type { GraphInputStream } from './model/GraphInputStream.js';
|
|
8
10
|
export { getGraphBoundary } from './model/GraphBoundaryCache.js';
|
|
9
11
|
export type { GraphBoundary } from './model/GraphBoundaryCache.js';
|
|
10
12
|
export * from './model/UiGraph.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DataValue } from './DataValue.js';
|
|
2
|
+
export type GraphInputStreamResult = {
|
|
3
|
+
value: DataValue;
|
|
4
|
+
error?: never;
|
|
5
|
+
} | {
|
|
6
|
+
error: Error;
|
|
7
|
+
value?: never;
|
|
8
|
+
};
|
|
9
|
+
export type GraphInputStream = {
|
|
10
|
+
readonly result: GraphInputStreamResult | undefined;
|
|
11
|
+
readonly settled: Promise<GraphInputStreamResult>;
|
|
12
|
+
subscribe(listener: (value: DataValue, coalesced: number) => void): () => void;
|
|
13
|
+
};
|
|
14
|
+
/** One invocation/port, one subscriber, bounded pre-start snapshot, one terminal. */
|
|
15
|
+
export declare class GraphInputStreamRelay implements GraphInputStream {
|
|
16
|
+
#private;
|
|
17
|
+
result: GraphInputStreamResult | undefined;
|
|
18
|
+
readonly settled: Promise<GraphInputStreamResult>;
|
|
19
|
+
constructor();
|
|
20
|
+
publish(value: DataValue, coalesced?: number): void;
|
|
21
|
+
finish(result: GraphInputStreamResult): void;
|
|
22
|
+
subscribe(listener: (value: DataValue, coalesced: number) => void): () => void;
|
|
23
|
+
}
|
|
@@ -13,6 +13,7 @@ import { type GraphBoundaryCache } from './GraphBoundaryCache.js';
|
|
|
13
13
|
import { type GraphProgress } from './GraphProgress.js';
|
|
14
14
|
import { type RivetStoredValueStore } from './StoredValueStore.js';
|
|
15
15
|
import { type StreamingOutputWatchHistorySummary } from './StreamingOutputWatchHistory.js';
|
|
16
|
+
import { type GraphInputStream } from './GraphInputStream.js';
|
|
16
17
|
import type { RivetKnowledgeStoreRegistry } from '../integrations/KnowledgeStore.js';
|
|
17
18
|
/**
|
|
18
19
|
* Provenance attached only while RecordingPlayer re-emits a historical event.
|
|
@@ -359,6 +360,8 @@ export declare class GraphProcessor {
|
|
|
359
360
|
* event protocol.
|
|
360
361
|
*/
|
|
361
362
|
onGraphOutputPartial?: GraphOutputPartialListener;
|
|
363
|
+
/** Internal, invocation-scoped live named inputs. Not a serialized value. */
|
|
364
|
+
graphInputStreams?: Readonly<Record<string, GraphInputStream>>;
|
|
362
365
|
}): Promise<GraphOutputs>;
|
|
363
366
|
getRootProcessor(): GraphProcessor;
|
|
364
367
|
/** Raise a user event on the processor, all subprocessors, and their children. */
|
|
@@ -20,4 +20,4 @@ export declare function getInputNodesTo(state: ExecutionState, node: ChartNode):
|
|
|
20
20
|
export declare function getOutputNodesFrom(state: ExecutionState, node: ChartNode): OutputNodeResult;
|
|
21
21
|
export declare function hasErroredInputNode(state: ExecutionState, node: ChartNode, inputNodes: ChartNode[], onTrace?: (message: string) => void): boolean;
|
|
22
22
|
export declare function getMissingRequiredInputs(state: ExecutionState, node: ChartNode): NodeInputDefinition[];
|
|
23
|
-
export declare function getWaitingForInputNode(state: ExecutionState, node: ChartNode, inputNodes: ChartNode[], inputValues: Inputs):
|
|
23
|
+
export declare function getWaitingForInputNode(state: ExecutionState, node: ChartNode, inputNodes: ChartNode[], inputValues: Inputs): ChartNode | undefined;
|
|
@@ -32,6 +32,7 @@ export * from './nodes/RaiseEventNode.js';
|
|
|
32
32
|
export * from './nodes/ReportProgressNode.js';
|
|
33
33
|
export * from './nodes/ContextNode.js';
|
|
34
34
|
export * from './nodes/GraphCallPathNode.js';
|
|
35
|
+
export * from './nodes/ProjectNameNode.js';
|
|
35
36
|
export * from './nodes/CoalesceNode.js';
|
|
36
37
|
export * from './nodes/CoalesceNewNode.js';
|
|
37
38
|
export * from './nodes/DidRunNode.js';
|
|
@@ -108,12 +109,12 @@ export * from './nodes/MCPToolCallNode.js';
|
|
|
108
109
|
export * from './nodes/MCPGetPromptNode.js';
|
|
109
110
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
110
111
|
export * from './nodes/NodePrefabInstanceNode.js';
|
|
111
|
-
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "userInput" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "matchCase" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "coalesceNew" | "didRun" | "passthrough" | "dataBus" | "startBackgroundBranch" | "watchStreamingOutput" | "stopWatchingStreamingOutput" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "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" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | 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/MatchCaseNode.js").MatchCaseNode | 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/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/GraphCallPathNode.js").GraphCallPathNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/CoalesceNewNode.js").CoalesceNewNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/WatchStreamingOutputNode.js").WatchStreamingOutputNode | import("./nodes/StopWatchingStreamingOutputNode.js").StopWatchingStreamingOutputNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | 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/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | 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 & {
|
|
112
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "userInput" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "matchCase" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "projectName" | "coalesce" | "coalesceNew" | "didRun" | "passthrough" | "dataBus" | "startBackgroundBranch" | "watchStreamingOutput" | "stopWatchingStreamingOutput" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "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" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | 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/MatchCaseNode.js").MatchCaseNode | 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/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/GraphCallPathNode.js").GraphCallPathNode | import("./nodes/ProjectNameNode.js").ProjectNameNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/CoalesceNewNode.js").CoalesceNewNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/WatchStreamingOutputNode.js").WatchStreamingOutputNode | import("./nodes/StopWatchingStreamingOutputNode.js").StopWatchingStreamingOutputNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | 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/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | 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 & {
|
|
112
113
|
type: "mcpDiscovery";
|
|
113
114
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
114
115
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
115
116
|
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
116
|
-
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "userInput" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "matchCase" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "coalesceNew" | "didRun" | "passthrough" | "dataBus" | "startBackgroundBranch" | "watchStreamingOutput" | "stopWatchingStreamingOutput" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "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" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | 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/MatchCaseNode.js").MatchCaseNode | 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/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/GraphCallPathNode.js").GraphCallPathNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/CoalesceNewNode.js").CoalesceNewNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/WatchStreamingOutputNode.js").WatchStreamingOutputNode | import("./nodes/StopWatchingStreamingOutputNode.js").StopWatchingStreamingOutputNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | 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/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | 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 & {
|
|
117
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "userInput" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "matchCase" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "projectName" | "coalesce" | "coalesceNew" | "didRun" | "passthrough" | "dataBus" | "startBackgroundBranch" | "watchStreamingOutput" | "stopWatchingStreamingOutput" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "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" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | 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/MatchCaseNode.js").MatchCaseNode | 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/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/GraphCallPathNode.js").GraphCallPathNode | import("./nodes/ProjectNameNode.js").ProjectNameNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/CoalesceNewNode.js").CoalesceNewNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/WatchStreamingOutputNode.js").WatchStreamingOutputNode | import("./nodes/StopWatchingStreamingOutputNode.js").StopWatchingStreamingOutputNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | 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/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | 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 & {
|
|
117
118
|
type: "mcpDiscovery";
|
|
118
119
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
119
120
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|