@valerypopoff/rivet2-core 2.12.0 → 2.15.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 +3188 -592
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/esm/api/createProcessor.js +5 -0
- package/dist/esm/api/processSettings.js +1 -0
- package/dist/esm/exports.js +5 -0
- package/dist/esm/model/GraphInputStream.js +70 -0
- package/dist/esm/model/GraphProcessor.js +264 -29
- package/dist/esm/model/MarkdownSanitizationPolicy.js +2 -0
- package/dist/esm/model/NodeExecutionPlanner.js +4 -4
- package/dist/esm/model/NodeImpl.js +1 -1
- package/dist/esm/model/Nodes.js +9 -0
- package/dist/esm/model/ProcessContextBuilder.js +2 -1
- package/dist/esm/model/StreamingOutputWatch.js +5 -0
- package/dist/esm/model/StreamingWatchTopology.js +228 -0
- package/dist/esm/model/classifier/credentials.js +81 -0
- package/dist/esm/model/classifier/migration.js +97 -0
- package/dist/esm/model/classifier/providers.js +347 -0
- package/dist/esm/model/classifier/questionHelpers.js +125 -0
- package/dist/esm/model/classifier/types.js +1 -0
- package/dist/esm/model/nodeBodyMarkdown.js +37 -0
- package/dist/esm/model/nodes/AssembleMessageNode.js +2 -2
- package/dist/esm/model/nodes/AssemblePromptNode.js +46 -17
- package/dist/esm/model/nodes/ClassifierEvaluateNode.js +392 -0
- package/dist/esm/model/nodes/ClassifierQuestionNode.js +569 -0
- package/dist/esm/model/nodes/CodeNewNode.js +33 -9
- package/dist/esm/model/nodes/GraphInputNode.js +15 -19
- package/dist/esm/model/nodes/LLMChatV2Node.js +3 -12
- package/dist/esm/model/nodes/LLMProfileNode.js +6 -12
- package/dist/esm/model/nodes/MatchCaseNode.js +78 -3
- package/dist/esm/model/nodes/MatchCaseNodeBase.js +24 -2
- package/dist/esm/model/nodes/ObjectNode.js +48 -41
- package/dist/esm/model/nodes/PassthroughNode.js +1 -1
- 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/codeOutputInference.js +292 -0
- package/dist/esm/model/nodes/variadicPortIndex.js +1 -1
- package/dist/esm/utils/serialization/serialization.js +4 -0
- package/dist/types/exports.d.ts +6 -0
- package/dist/types/model/EditorDefinition.d.ts +24 -0
- package/dist/types/model/GraphInputStream.d.ts +23 -0
- package/dist/types/model/GraphProcessor.d.ts +3 -0
- package/dist/types/model/MarkdownSanitizationPolicy.d.ts +1 -1
- package/dist/types/model/NodeExecutionPlanner.d.ts +1 -1
- package/dist/types/model/NodeImpl.d.ts +3 -1
- package/dist/types/model/Nodes.d.ts +7 -4
- package/dist/types/model/ProcessContext.d.ts +3 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +2 -1
- package/dist/types/model/Settings.d.ts +4 -0
- package/dist/types/model/StreamingOutputWatch.d.ts +2 -0
- package/dist/types/model/StreamingWatchTopology.d.ts +26 -0
- package/dist/types/model/classifier/credentials.d.ts +24 -0
- package/dist/types/model/classifier/migration.d.ts +18 -0
- package/dist/types/model/classifier/providers.d.ts +78 -0
- package/dist/types/model/classifier/questionHelpers.d.ts +31 -0
- package/dist/types/model/classifier/types.d.ts +58 -0
- package/dist/types/model/nodeBodyMarkdown.d.ts +19 -0
- package/dist/types/model/nodes/AssemblePromptNode.d.ts +4 -3
- package/dist/types/model/nodes/ClassifierEvaluateNode.d.ts +47 -0
- package/dist/types/model/nodes/ClassifierQuestionNode.d.ts +60 -0
- package/dist/types/model/nodes/CodeNewNode.d.ts +6 -0
- package/dist/types/model/nodes/GraphInputNode.d.ts +2 -0
- package/dist/types/model/nodes/MatchCaseNode.d.ts +9 -2
- package/dist/types/model/nodes/MatchCaseNodeBase.d.ts +13 -1
- package/dist/types/model/nodes/ObjectNode.d.ts +5 -0
- package/dist/types/model/nodes/ProjectNameNode.d.ts +12 -0
- package/dist/types/model/nodes/codeOutputInference.d.ts +31 -0
- package/dist/types/model/nodes/variadicPortIndex.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
2
|
+
import { parse } from 'acorn';
|
|
3
|
+
import { buildJsValueInterpolatedSource, getJsValueInterpolationRuntimeContext } from './jsValueInterpolation.js';
|
|
4
|
+
const cache = new Map();
|
|
5
|
+
const MAX_CACHED_SOURCES = 128;
|
|
6
|
+
const WRAPPER_PREFIX = 'async function __codeOutputs() {\n';
|
|
7
|
+
const TRAVERSAL_BOUNDARIES = new Set([
|
|
8
|
+
'FunctionDeclaration',
|
|
9
|
+
'FunctionExpression',
|
|
10
|
+
'ArrowFunctionExpression',
|
|
11
|
+
'ClassDeclaration',
|
|
12
|
+
'ClassExpression',
|
|
13
|
+
]);
|
|
14
|
+
function isAstNode(value) {
|
|
15
|
+
return value !== null && typeof value === 'object' && 'type' in value && typeof value.type === 'string';
|
|
16
|
+
}
|
|
17
|
+
function getPropertyKey(property) {
|
|
18
|
+
if (property.type !== 'Property') {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const objectProperty = property;
|
|
22
|
+
if (objectProperty.computed || objectProperty.method || objectProperty.kind !== 'init')
|
|
23
|
+
return undefined;
|
|
24
|
+
const key = objectProperty.key;
|
|
25
|
+
if (key.type === 'Identifier') {
|
|
26
|
+
return { key: key.name, start: key.start, end: key.end };
|
|
27
|
+
}
|
|
28
|
+
return key.type === 'Literal' && ['string', 'number'].includes(typeof key.value)
|
|
29
|
+
? { key: String(key.value), start: key.start, end: key.end }
|
|
30
|
+
: undefined;
|
|
31
|
+
}
|
|
32
|
+
function analyzeCodeOutputSyntax(code) {
|
|
33
|
+
const cached = cache.get(code);
|
|
34
|
+
if (cached) {
|
|
35
|
+
return cached;
|
|
36
|
+
}
|
|
37
|
+
let result;
|
|
38
|
+
try {
|
|
39
|
+
const source = buildJsValueInterpolatedSource(code, getJsValueInterpolationRuntimeContext(code, '__codeOutputInputs'), { trim: false });
|
|
40
|
+
const tree = parse(`${WRAPPER_PREFIX}${source}\n}`, { ecmaVersion: 'latest' });
|
|
41
|
+
const keys = new Set();
|
|
42
|
+
const occurrences = [];
|
|
43
|
+
const visit = (node) => {
|
|
44
|
+
if (TRAVERSAL_BOUNDARIES.has(node.type))
|
|
45
|
+
return;
|
|
46
|
+
if (node.type === 'ReturnStatement') {
|
|
47
|
+
const argument = node.argument;
|
|
48
|
+
if (argument?.type === 'ObjectExpression') {
|
|
49
|
+
for (const property of argument.properties) {
|
|
50
|
+
const key = getPropertyKey(property);
|
|
51
|
+
if (key === undefined)
|
|
52
|
+
continue;
|
|
53
|
+
keys.add(key.key);
|
|
54
|
+
occurrences.push({
|
|
55
|
+
key: key.key,
|
|
56
|
+
start: key.start - WRAPPER_PREFIX.length,
|
|
57
|
+
end: key.end - WRAPPER_PREFIX.length,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
for (const value of Object.values(node)) {
|
|
64
|
+
if (Array.isArray(value)) {
|
|
65
|
+
for (const child of value)
|
|
66
|
+
if (isAstNode(child))
|
|
67
|
+
visit(child);
|
|
68
|
+
}
|
|
69
|
+
else if (isAstNode(value)) {
|
|
70
|
+
visit(value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
// Enter only the wrapper body; nested functions remain traversal boundaries.
|
|
75
|
+
visit(tree.body[0].body);
|
|
76
|
+
result = Object.freeze({
|
|
77
|
+
valid: true,
|
|
78
|
+
keys: Object.freeze([...keys]),
|
|
79
|
+
occurrences: Object.freeze(occurrences.map((occurrence) => Object.freeze(occurrence))),
|
|
80
|
+
source,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
result = Object.freeze({ valid: false });
|
|
85
|
+
}
|
|
86
|
+
if (cache.size >= MAX_CACHED_SOURCES) {
|
|
87
|
+
cache.delete(cache.keys().next().value);
|
|
88
|
+
}
|
|
89
|
+
cache.set(code, result);
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
/** Syntax-only analysis of explicit object returns in the authored function. */
|
|
93
|
+
export function analyzeCodeOutputs(code) {
|
|
94
|
+
const analysis = analyzeCodeOutputSyntax(code);
|
|
95
|
+
return analysis.valid ? Object.freeze({ valid: true, keys: analysis.keys }) : Object.freeze({ valid: false });
|
|
96
|
+
}
|
|
97
|
+
function sanitizeOutputFields(fieldsToSanitize) {
|
|
98
|
+
const seenIds = new Set();
|
|
99
|
+
const seenKeys = new Set();
|
|
100
|
+
const fields = [];
|
|
101
|
+
for (const field of fieldsToSanitize ?? []) {
|
|
102
|
+
if (typeof field?.id !== 'string' ||
|
|
103
|
+
!field.id.startsWith('field:') ||
|
|
104
|
+
typeof field.key !== 'string' ||
|
|
105
|
+
seenIds.has(field.id) ||
|
|
106
|
+
seenKeys.has(field.key)) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
seenIds.add(field.id);
|
|
110
|
+
seenKeys.add(field.key);
|
|
111
|
+
fields.push({ id: field.id, key: field.key });
|
|
112
|
+
}
|
|
113
|
+
return fields;
|
|
114
|
+
}
|
|
115
|
+
function getStoredOutputFields(data) {
|
|
116
|
+
return sanitizeOutputFields(data.inferredOutputFields);
|
|
117
|
+
}
|
|
118
|
+
function getLegacyOutputFields(keys) {
|
|
119
|
+
return [...new Set(keys.filter((key) => typeof key === 'string'))].map((key) => ({
|
|
120
|
+
id: `field:${key}`,
|
|
121
|
+
key,
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
/** Resolves the displayed fields and their stable port identities without mutating node data. */
|
|
125
|
+
export function getCodeOutputFields(data) {
|
|
126
|
+
const analysis = analyzeCodeOutputSyntax(data.code);
|
|
127
|
+
const storedFields = getStoredOutputFields(data);
|
|
128
|
+
if (!analysis.valid) {
|
|
129
|
+
return storedFields.length > 0 ? storedFields : getLegacyOutputFields(data.inferredOutputKeys ?? []);
|
|
130
|
+
}
|
|
131
|
+
const storedFieldByKey = new Map(storedFields.map((field) => [field.key, field]));
|
|
132
|
+
return analysis.keys.map((key) => storedFieldByKey.get(key) ?? { id: `field:${key}`, key });
|
|
133
|
+
}
|
|
134
|
+
export function getCodeOutputKeys(data) {
|
|
135
|
+
return getCodeOutputFields(data).map((field) => field.key);
|
|
136
|
+
}
|
|
137
|
+
function getSingleTextChange(previous, next) {
|
|
138
|
+
let prefixLength = 0;
|
|
139
|
+
const sharedLength = Math.min(previous.length, next.length);
|
|
140
|
+
while (prefixLength < sharedLength && previous[prefixLength] === next[prefixLength]) {
|
|
141
|
+
prefixLength += 1;
|
|
142
|
+
}
|
|
143
|
+
let previousEnd = previous.length;
|
|
144
|
+
let nextEnd = next.length;
|
|
145
|
+
while (previousEnd > prefixLength && nextEnd > prefixLength && previous[previousEnd - 1] === next[nextEnd - 1]) {
|
|
146
|
+
previousEnd -= 1;
|
|
147
|
+
nextEnd -= 1;
|
|
148
|
+
}
|
|
149
|
+
if (prefixLength === previousEnd && prefixLength === nextEnd) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
previousStart: prefixLength,
|
|
154
|
+
previousEnd,
|
|
155
|
+
nextStart: prefixLength,
|
|
156
|
+
nextEnd,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function isChangeWithinOccurrence(start, end, occurrence) {
|
|
160
|
+
return start >= occurrence.start && end <= occurrence.end;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A rename is safe only when the complete source change is confined to one
|
|
164
|
+
* explicit property key on each side. This deliberately rejects broad edits.
|
|
165
|
+
*/
|
|
166
|
+
function getProvenOutputRename(previous, next) {
|
|
167
|
+
if (!previous.valid || !next.valid) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
const previousKeys = new Set(previous.keys);
|
|
171
|
+
const nextKeys = new Set(next.keys);
|
|
172
|
+
const removedKeys = previous.keys.filter((key) => !nextKeys.has(key));
|
|
173
|
+
const addedKeys = next.keys.filter((key) => !previousKeys.has(key));
|
|
174
|
+
if (removedKeys.length !== 1 || addedKeys.length !== 1) {
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
const oldKey = removedKeys[0];
|
|
178
|
+
const newKey = addedKeys[0];
|
|
179
|
+
const previousOccurrences = previous.occurrences.filter((occurrence) => occurrence.key === oldKey);
|
|
180
|
+
const nextOccurrences = next.occurrences.filter((occurrence) => occurrence.key === newKey);
|
|
181
|
+
if (previousOccurrences.length !== 1 || nextOccurrences.length !== 1) {
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
const change = getSingleTextChange(previous.source, next.source);
|
|
185
|
+
if (!change) {
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
return isChangeWithinOccurrence(change.previousStart, change.previousEnd, previousOccurrences[0]) &&
|
|
189
|
+
isChangeWithinOccurrence(change.nextStart, change.nextEnd, nextOccurrences[0])
|
|
190
|
+
? { oldKey, newKey }
|
|
191
|
+
: undefined;
|
|
192
|
+
}
|
|
193
|
+
function createOutputFieldId(usedIds) {
|
|
194
|
+
let id;
|
|
195
|
+
do {
|
|
196
|
+
id = `field:${nanoid()}`;
|
|
197
|
+
} while (usedIds.has(id));
|
|
198
|
+
return id;
|
|
199
|
+
}
|
|
200
|
+
function getPreviousOutputFields(data) {
|
|
201
|
+
const storedFields = getStoredOutputFields(data);
|
|
202
|
+
return storedFields.length > 0 ? storedFields : [...getCodeOutputFields(data)];
|
|
203
|
+
}
|
|
204
|
+
function getRetiredOutputFields(data, activeFields) {
|
|
205
|
+
const activeIds = new Set(activeFields.map((field) => field.id));
|
|
206
|
+
const activeKeys = new Set(activeFields.map((field) => field.key));
|
|
207
|
+
return sanitizeOutputFields(data.inferredOutputRetiredFields).filter((field) => !activeIds.has(field.id) && !activeKeys.has(field.key));
|
|
208
|
+
}
|
|
209
|
+
const MAX_RETIRED_OUTPUT_FIELDS = 32;
|
|
210
|
+
function reconcileOutputFields(previous, nextAnalysis) {
|
|
211
|
+
const previousFields = getPreviousOutputFields(previous);
|
|
212
|
+
const previousFieldByKey = new Map(previousFields.map((field) => [field.key, field]));
|
|
213
|
+
const retiredFields = getRetiredOutputFields(previous, previousFields);
|
|
214
|
+
const retiredFieldByKey = new Map(retiredFields.map((field) => [field.key, field]));
|
|
215
|
+
const sourceForRename = previous.inferredOutputLastValidCode ?? previous.code;
|
|
216
|
+
const rename = getProvenOutputRename(analyzeCodeOutputSyntax(sourceForRename), nextAnalysis);
|
|
217
|
+
const usedIds = new Set([...previousFields, ...retiredFields].map((field) => field.id));
|
|
218
|
+
const fields = [];
|
|
219
|
+
const reusedRetiredKeys = new Set();
|
|
220
|
+
const renamedKeys = new Set();
|
|
221
|
+
for (const key of nextAnalysis.keys) {
|
|
222
|
+
const exactField = previousFieldByKey.get(key);
|
|
223
|
+
if (exactField) {
|
|
224
|
+
fields.push({ ...exactField });
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const retiredField = retiredFieldByKey.get(key);
|
|
228
|
+
if (retiredField) {
|
|
229
|
+
fields.push({ ...retiredField });
|
|
230
|
+
reusedRetiredKeys.add(key);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
const renamedField = rename?.newKey === key ? previousFieldByKey.get(rename.oldKey) : undefined;
|
|
234
|
+
if (renamedField && rename && !previousFieldByKey.has(key)) {
|
|
235
|
+
fields.push({ id: renamedField.id, key });
|
|
236
|
+
renamedKeys.add(rename.oldKey);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
const id = createOutputFieldId(usedIds);
|
|
240
|
+
usedIds.add(id);
|
|
241
|
+
fields.push({ id, key });
|
|
242
|
+
}
|
|
243
|
+
const fieldKeys = new Set(fields.map((field) => field.key));
|
|
244
|
+
const fieldIds = new Set(fields.map((field) => field.id));
|
|
245
|
+
const newlyRetiredFields = previousFields.filter((field) => !fieldKeys.has(field.key) && !renamedKeys.has(field.key));
|
|
246
|
+
const nextRetiredFields = [
|
|
247
|
+
...retiredFields.filter((field) => !reusedRetiredKeys.has(field.key)),
|
|
248
|
+
...newlyRetiredFields,
|
|
249
|
+
]
|
|
250
|
+
.filter((field, index, all) => !fieldIds.has(field.id) && all.findIndex((candidate) => candidate.id === field.id) === index)
|
|
251
|
+
.slice(-MAX_RETIRED_OUTPUT_FIELDS);
|
|
252
|
+
return {
|
|
253
|
+
inferredOutputFields: fields,
|
|
254
|
+
inferredOutputRetiredFields: nextRetiredFields,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function getLastValidCode(data) {
|
|
258
|
+
return analyzeCodeOutputSyntax(data.code).valid ? data.code : data.inferredOutputLastValidCode;
|
|
259
|
+
}
|
|
260
|
+
function withoutOutputMetadata(data) {
|
|
261
|
+
const { inferredOutputFields: _discardedFields, inferredOutputKeys: _discardedKeys, inferredOutputRetiredFields: _discardedRetiredFields, inferredOutputLastValidCode: _discardedLastValidCode, ...dataWithoutOutputMetadata } = data;
|
|
262
|
+
return dataWithoutOutputMetadata;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Prepares persisted output identities as part of an editor transaction.
|
|
266
|
+
* Valid source owns the visible fields. Invalid source retains the last valid
|
|
267
|
+
* identities and source so a completed key-only rename can still be proved.
|
|
268
|
+
*/
|
|
269
|
+
export function prepareCodeOutputEdit(previous, patch) {
|
|
270
|
+
const next = { ...previous, ...patch };
|
|
271
|
+
const analysis = analyzeCodeOutputSyntax(next.code);
|
|
272
|
+
const nextWithoutOutputMetadata = withoutOutputMetadata(next);
|
|
273
|
+
if (analysis.valid) {
|
|
274
|
+
const { inferredOutputFields, inferredOutputRetiredFields } = reconcileOutputFields(previous, analysis);
|
|
275
|
+
return {
|
|
276
|
+
...nextWithoutOutputMetadata,
|
|
277
|
+
inferredOutputFields,
|
|
278
|
+
inferredOutputKeys: inferredOutputFields.map((field) => field.key),
|
|
279
|
+
...(inferredOutputRetiredFields.length > 0 ? { inferredOutputRetiredFields } : {}),
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const inferredOutputFields = getPreviousOutputFields(previous);
|
|
283
|
+
const inferredOutputRetiredFields = getRetiredOutputFields(previous, inferredOutputFields);
|
|
284
|
+
const lastValidCode = getLastValidCode(previous);
|
|
285
|
+
return {
|
|
286
|
+
...nextWithoutOutputMetadata,
|
|
287
|
+
inferredOutputFields,
|
|
288
|
+
inferredOutputKeys: inferredOutputFields.map((field) => field.key),
|
|
289
|
+
...(inferredOutputRetiredFields.length > 0 ? { inferredOutputRetiredFields } : {}),
|
|
290
|
+
...(lastValidCode ? { inferredOutputLastValidCode: lastValidCode } : {}),
|
|
291
|
+
};
|
|
292
|
+
}
|
|
@@ -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;
|
|
@@ -9,6 +9,7 @@ import { datasetV4Deserializer, datasetV4Serializer, graphV4Deserializer, graphV
|
|
|
9
9
|
import { graphV2Deserializer, projectV2Deserializer } from './serialization_v2.js';
|
|
10
10
|
import { graphV1Deserializer, projectV1Deserializer } from './serialization_v1.js';
|
|
11
11
|
import { normalizeSerializedLLMChatV2Node } from '../../model/chat-v2/llmChatV2NodeMigration.js';
|
|
12
|
+
import { normalizeClassifierGraph, normalizeClassifierNode, normalizeClassifierProject, } from '../../model/classifier/migration.js';
|
|
12
13
|
export function serializeProject(project, attachedData) {
|
|
13
14
|
return projectV4Serializer(project, attachedData);
|
|
14
15
|
}
|
|
@@ -56,6 +57,7 @@ export function deserializeGraph(serializedGraph) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
function normalizeDeserializedProject(project) {
|
|
60
|
+
normalizeClassifierProject(project);
|
|
59
61
|
for (const graph of Object.values(project.graphs)) {
|
|
60
62
|
normalizeDeserializedGraph(graph);
|
|
61
63
|
}
|
|
@@ -64,6 +66,7 @@ function normalizeDeserializedProject(project) {
|
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
function normalizeDeserializedGraph(graph) {
|
|
69
|
+
normalizeClassifierGraph(graph);
|
|
67
70
|
for (const node of graph.nodes) {
|
|
68
71
|
normalizeDeserializedNode(node);
|
|
69
72
|
}
|
|
@@ -73,6 +76,7 @@ function hasLegacyDataBusFlag(node) {
|
|
|
73
76
|
return node.type === 'passthrough' && data != null && Object.hasOwn(data, 'renderAsDataBus');
|
|
74
77
|
}
|
|
75
78
|
function normalizeDeserializedNode(node) {
|
|
79
|
+
normalizeClassifierNode(node);
|
|
76
80
|
if (node.type === 'code' && node.title === 'Code') {
|
|
77
81
|
node.title = 'Code (legacy)';
|
|
78
82
|
}
|
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';
|
|
@@ -50,6 +52,10 @@ export * from './recording/RecordedEvents.js';
|
|
|
50
52
|
export * from './model/RivetPlugin.js';
|
|
51
53
|
export * from './model/PluginLoadSpec.js';
|
|
52
54
|
export * from './plugins.js';
|
|
55
|
+
export * from './model/classifier/credentials.js';
|
|
56
|
+
export * from './model/classifier/migration.js';
|
|
57
|
+
export * from './model/classifier/providers.js';
|
|
58
|
+
export * from './model/classifier/types.js';
|
|
53
59
|
export * from './model/NodeRegistration.js';
|
|
54
60
|
export * from './model/RegistryAssembly.js';
|
|
55
61
|
export type * from './model/Settings.js';
|
|
@@ -65,10 +65,14 @@ export type DropdownEditorDefinition<T extends ChartNode> = SharedEditorDefiniti
|
|
|
65
65
|
label: string;
|
|
66
66
|
}[];
|
|
67
67
|
defaultValue?: string;
|
|
68
|
+
/** Accessible name when the visual label is intentionally omitted. */
|
|
69
|
+
ariaLabel?: string;
|
|
68
70
|
useInputToggleDataKey?: DataOfType<T, boolean>;
|
|
69
71
|
};
|
|
70
72
|
export type SegmentedEditorDefinition<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
71
73
|
type: 'segmented';
|
|
74
|
+
/** Keep choices on one line when the surrounding layout provides intrinsic width. */
|
|
75
|
+
allowOptionWrap?: boolean;
|
|
72
76
|
dataKey: DataOfType<T, string | boolean>;
|
|
73
77
|
ariaLabel?: string;
|
|
74
78
|
options: {
|
|
@@ -107,6 +111,8 @@ export type CodeEditorInterpolationSyntax = 'js-value' | 'json-template';
|
|
|
107
111
|
export type CodeEditorDefinition<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
108
112
|
type: 'code';
|
|
109
113
|
dataKey: DataOfType<T, string>;
|
|
114
|
+
/** Displayed for an absent legacy value without mutating the node on mount. */
|
|
115
|
+
defaultValue?: string;
|
|
110
116
|
useInputToggleDataKey?: DataOfType<T, boolean>;
|
|
111
117
|
postEditorHelperMessage?: string | ((data: T['data']) => string | undefined);
|
|
112
118
|
language: string;
|
|
@@ -154,7 +160,12 @@ export type KeyValuePairEditorDefinition<T extends ChartNode> = SharedEditorDefi
|
|
|
154
160
|
useInputToggleDataKey?: DataOfType<T, boolean>;
|
|
155
161
|
keyPlaceholder?: string;
|
|
156
162
|
valuePlaceholder?: string;
|
|
163
|
+
/** Singular noun used by add, remove, and reorder controls. */
|
|
164
|
+
itemLabel?: string;
|
|
157
165
|
valuesSecret?: boolean;
|
|
166
|
+
reorderable?: boolean;
|
|
167
|
+
/** Highlight Rivet interpolation tokens in the value field. */
|
|
168
|
+
highlightInterpolationTokens?: boolean;
|
|
158
169
|
};
|
|
159
170
|
export type StringListEditorDefinition<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
160
171
|
type: 'stringList';
|
|
@@ -162,7 +173,15 @@ export type StringListEditorDefinition<T extends ChartNode> = SharedEditorDefini
|
|
|
162
173
|
useInputToggleDataKey?: DataOfType<T, boolean>;
|
|
163
174
|
placeholder?: string;
|
|
164
175
|
newItemDefault?: string;
|
|
176
|
+
/** Keep this many authored rows available in the editor. */
|
|
177
|
+
minimumItems?: number;
|
|
165
178
|
reorderable?: boolean;
|
|
179
|
+
/** Highlight active Rivet {{...}} interpolation tokens without changing the saved string. */
|
|
180
|
+
highlightInterpolationTokens?: boolean;
|
|
181
|
+
/** Use the same monospace font as text and code editors. */
|
|
182
|
+
inputFontFamily?: 'monospace';
|
|
183
|
+
/** Render this list in a persistent, non-collapsible settings panel. */
|
|
184
|
+
boxed?: boolean;
|
|
166
185
|
portBinding?: StringListPortBinding<T>;
|
|
167
186
|
};
|
|
168
187
|
export type StringListPortBinding<T extends ChartNode> = {
|
|
@@ -187,6 +206,11 @@ export type StringListPortBinding<T extends ChartNode> = {
|
|
|
187
206
|
};
|
|
188
207
|
export type EditorDefinitionGroup<T extends ChartNode> = SharedEditorDefinitionProps<T> & {
|
|
189
208
|
type: 'group';
|
|
209
|
+
/**
|
|
210
|
+
* A non-collapsible, unboxed settings section with a semantic heading.
|
|
211
|
+
* Omit to retain the ordinary collapsible-panel behavior.
|
|
212
|
+
*/
|
|
213
|
+
presentation?: 'section';
|
|
190
214
|
defaultOpen?: boolean;
|
|
191
215
|
toggleDataKey?: DataOfType<T, boolean>;
|
|
192
216
|
editors: EditorDefinition<T>[];
|
|
@@ -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. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RIVET_MARKDOWN_ALLOWED_TAGS: readonly ["a", "blockquote", "br", "code", "del", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "li", "ol", "p", "pre", "strong", "sub", "sup", "table", "tbody", "td", "th", "thead", "tr", "ul"];
|
|
1
|
+
export declare const RIVET_MARKDOWN_ALLOWED_TAGS: readonly ["a", "blockquote", "br", "code", "del", "div", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "li", "ol", "p", "pre", "span", "strong", "sub", "sup", "table", "tbody", "td", "th", "thead", "tr", "ul"];
|
|
2
2
|
export declare const RIVET_MARKDOWN_ALLOWED_ATTRIBUTES: readonly ["class", "href", "title"];
|
|
3
3
|
export declare const RIVET_MARKDOWN_ALLOWED_URI_REGEXP_SOURCE = "^(?:https?:|mailto:|#|\\?(?:[^/]|$)|/(?!/)|\\.{1,2}/|[a-z0-9._~-]+(?:[/?#]|$))";
|
|
4
4
|
export type RivetMarkdownSanitizerPolicy = {
|
|
@@ -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;
|
|
@@ -11,7 +11,9 @@ export type NodeDefinitionContext = {
|
|
|
11
11
|
getGraphBoundary: (project: Project, graphId: GraphId | undefined) => GraphBoundary | undefined;
|
|
12
12
|
};
|
|
13
13
|
export interface PluginNodeImpl<T extends ChartNode> {
|
|
14
|
-
getInputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project
|
|
14
|
+
getInputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project,
|
|
15
|
+
/** Concrete owner for node-scoped dynamic definitions. Older plugins may omit this optional argument. */
|
|
16
|
+
node?: T): NodeInputDefinition[];
|
|
15
17
|
getOutputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
16
18
|
process(data: T['data'], inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
17
19
|
getEditors(data: T['data'], context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
@@ -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,16 +109,18 @@ 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
|
|
112
|
+
export * from './nodes/ClassifierQuestionNode.js';
|
|
113
|
+
export * from './nodes/ClassifierEvaluateNode.js';
|
|
114
|
+
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" | "classifierQuestion" | "classifierEvaluate", 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
115
|
type: "mcpDiscovery";
|
|
113
116
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
114
117
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
115
|
-
}) | 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 & {
|
|
118
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode | import("./nodes/ClassifierQuestionNode.js").ClassifierQuestionNode | import("./nodes/ClassifierEvaluateNode.js").ClassifierEvaluateNode>;
|
|
119
|
+
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" | "classifierQuestion" | "classifierEvaluate", 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
120
|
type: "mcpDiscovery";
|
|
118
121
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
119
122
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
120
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
123
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode | import("./nodes/ClassifierQuestionNode.js").ClassifierQuestionNode | import("./nodes/ClassifierEvaluateNode.js").ClassifierEvaluateNode>;
|
|
121
124
|
export { globalRivetNodeRegistry };
|
|
122
125
|
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
123
126
|
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
@@ -4,6 +4,7 @@ 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
6
|
import type { GraphBoundary } from './GraphBoundaryCache.js';
|
|
7
|
+
import type { GraphInputStream } from './GraphInputStream.js';
|
|
7
8
|
import type { GraphProgress } from './GraphProgress.js';
|
|
8
9
|
import type { CustomProviderApi } from './chat-v2/customProviderApi.js';
|
|
9
10
|
import type { RivetStoredValue, RivetStoredValueCacheResult, RivetStoredValueReadResult, RivetStoredValueSetResult } from './StoredValueStore.js';
|
|
@@ -239,6 +240,8 @@ export type GraphExecutionMetadata = {
|
|
|
239
240
|
evaluation?: EvaluationExecutionMetadata;
|
|
240
241
|
};
|
|
241
242
|
export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessContext & {
|
|
243
|
+
/** Invocation-scoped live inputs for a named graph caller. Never serialized. */
|
|
244
|
+
graphInputStreams?: Readonly<Record<string, GraphInputStream>>;
|
|
242
245
|
/** The executor that is running the current processor. */
|
|
243
246
|
executor: 'nodejs' | 'browser';
|
|
244
247
|
/** The project being executed. */
|