@valerypopoff/rivet2-core 2.13.0 → 2.17.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 +28167 -23834
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/interpolationRuntime.cjs +22 -3
- package/dist/cjs/interpolationRuntime.cjs.map +3 -3
- package/dist/cjs/interpolationSyntax.cjs +9 -5
- package/dist/cjs/interpolationSyntax.cjs.map +2 -2
- package/dist/esm/api/createProcessor.js +10 -2
- package/dist/esm/api/processSettings.js +1 -0
- package/dist/esm/exports.js +6 -0
- package/dist/esm/model/GraphBoundaryCache.js +2 -1
- package/dist/esm/model/GraphProcessor.js +278 -22
- package/dist/esm/model/MarkdownSanitizationPolicy.js +2 -0
- package/dist/esm/model/NodeImpl.js +1 -1
- package/dist/esm/model/Nodes.js +16 -0
- package/dist/esm/model/ProjectBundle.js +235 -0
- package/dist/esm/model/SplitRunProcessor.js +28 -7
- package/dist/esm/model/StreamingWatchTopology.js +211 -64
- package/dist/esm/model/SubgraphProjectTarget.js +7 -0
- package/dist/esm/model/chat-v2/aiSdkBridge.js +7 -5
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +13 -8
- package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +19 -1
- package/dist/esm/model/chat-v2/chatV2Shared.js +2 -1
- package/dist/esm/model/chat-v2/llmChatV2Body.js +11 -8
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +2 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +15 -1
- package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +22 -2
- package/dist/esm/model/chat-v2/llmProfile.js +3 -0
- package/dist/esm/model/chat-v2/llmProfileBody.js +2 -2
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +1 -1
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +1 -1
- package/dist/esm/model/chat-v2/temperature.js +9 -0
- package/dist/esm/model/classifier/credentials.js +107 -0
- package/dist/esm/model/classifier/images.js +176 -0
- package/dist/esm/model/classifier/json.js +57 -0
- package/dist/esm/model/classifier/limits.js +270 -0
- package/dist/esm/model/classifier/migration.js +97 -0
- package/dist/esm/model/classifier/openai.js +118 -0
- package/dist/esm/model/classifier/preparation.js +74 -0
- package/dist/esm/model/classifier/providers.js +422 -0
- package/dist/esm/model/classifier/questionHelpers.js +109 -0
- package/dist/esm/model/classifier/questions.js +53 -0
- package/dist/esm/model/classifier/response.js +75 -0
- package/dist/esm/model/classifier/state.js +204 -0
- package/dist/esm/model/classifier/types.js +1 -0
- package/dist/esm/model/nodeBodyMarkdown.js +37 -0
- package/dist/esm/model/nodeRunFailure.js +47 -0
- package/dist/esm/model/nodes/CatchStreamingChunksNode.js +42 -0
- package/dist/esm/model/nodes/ClassifierEvaluateNode.js +432 -0
- package/dist/esm/model/nodes/ClassifierQuestionNode.js +613 -0
- package/dist/esm/model/nodes/CodeNewNode.js +33 -9
- package/dist/esm/model/nodes/GetGlobalNode.js +2 -2
- package/dist/esm/model/nodes/HttpCallNode.js +44 -75
- package/dist/esm/model/nodes/ImageNode.js +44 -3
- package/dist/esm/model/nodes/LLMChatV2Node.js +27 -15
- package/dist/esm/model/nodes/LLMProfileNode.js +6 -12
- package/dist/esm/model/nodes/MatchCaseNode.js +76 -1
- package/dist/esm/model/nodes/MatchCaseNodeBase.js +24 -2
- package/dist/esm/model/nodes/ObjectNode.js +68 -50
- package/dist/esm/model/nodes/PassthroughNode.js +1 -1
- package/dist/esm/model/nodes/PromptNode.js +2 -1
- package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +4 -1
- package/dist/esm/model/nodes/SetGlobalNode.js +5 -3
- package/dist/esm/model/nodes/StopWatchingStreamingOutputNode.js +8 -8
- package/dist/esm/model/nodes/StreamValueNode.js +38 -0
- package/dist/esm/model/nodes/SubGraphNode.js +196 -35
- package/dist/esm/model/nodes/ToBase64Node.js +106 -0
- package/dist/esm/model/nodes/WatchStreamingOutputNode.js +7 -7
- package/dist/esm/model/nodes/codeOutputInference.js +292 -0
- package/dist/esm/recording/ExecutionRecorder.js +26 -0
- package/dist/esm/utils/base64.js +18 -15
- package/dist/esm/utils/errors.js +41 -0
- package/dist/esm/utils/interpolation.js +44 -22
- package/dist/esm/utils/interpolationSyntax.js +15 -6
- package/dist/esm/utils/serialization/serialization.js +7 -2
- package/dist/esm/utils/serialization/serializationUtils.js +6 -0
- package/dist/esm/utils/serialization/serialization_v4.js +15 -3
- package/dist/types/api/createProcessor.d.ts +7 -1
- package/dist/types/exports.d.ts +6 -0
- package/dist/types/model/CycleDetector.d.ts +1 -2
- package/dist/types/model/EditorDefinition.d.ts +24 -0
- package/dist/types/model/ExecutorProtocol.d.ts +2 -0
- package/dist/types/model/GraphBoundaryCache.d.ts +2 -0
- package/dist/types/model/GraphProcessor.d.ts +1 -0
- package/dist/types/model/MarkdownSanitizationPolicy.d.ts +1 -1
- package/dist/types/model/NodeImpl.d.ts +3 -1
- package/dist/types/model/Nodes.d.ts +10 -4
- package/dist/types/model/ProcessContext.d.ts +12 -0
- package/dist/types/model/ProjectBundle.d.ts +54 -0
- package/dist/types/model/ProjectReferenceLoader.d.ts +3 -0
- package/dist/types/model/Settings.d.ts +4 -0
- package/dist/types/model/StreamingWatchTopology.d.ts +17 -1
- package/dist/types/model/SubgraphProjectTarget.d.ts +38 -0
- package/dist/types/model/chat-v2/chatV2Shared.d.ts +1 -1
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +3 -1
- package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +3 -1
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +6 -6
- package/dist/types/model/chat-v2/temperature.d.ts +2 -0
- package/dist/types/model/classifier/credentials.d.ts +26 -0
- package/dist/types/model/classifier/images.d.ts +18 -0
- package/dist/types/model/classifier/json.d.ts +19 -0
- package/dist/types/model/classifier/limits.d.ts +42 -0
- package/dist/types/model/classifier/migration.d.ts +18 -0
- package/dist/types/model/classifier/openai.d.ts +5 -0
- package/dist/types/model/classifier/preparation.d.ts +16 -0
- package/dist/types/model/classifier/providers.d.ts +136 -0
- package/dist/types/model/classifier/questionHelpers.d.ts +33 -0
- package/dist/types/model/classifier/questions.d.ts +4 -0
- package/dist/types/model/classifier/response.d.ts +4 -0
- package/dist/types/model/classifier/state.d.ts +37 -0
- package/dist/types/model/classifier/types.d.ts +60 -0
- package/dist/types/model/nodeBodyMarkdown.d.ts +19 -0
- package/dist/types/model/nodeRunFailure.d.ts +13 -0
- package/dist/types/model/nodes/CatchStreamingChunksNode.d.ts +20 -0
- package/dist/types/model/nodes/ClassifierEvaluateNode.d.ts +50 -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/GetGlobalNode.d.ts +7 -0
- package/dist/types/model/nodes/ImageNode.d.ts +4 -0
- package/dist/types/model/nodes/LLMChatV2Node.d.ts +1 -0
- package/dist/types/model/nodes/MatchCaseNode.d.ts +8 -1
- package/dist/types/model/nodes/MatchCaseNodeBase.d.ts +13 -1
- package/dist/types/model/nodes/ObjectNode.d.ts +6 -0
- package/dist/types/model/nodes/StreamValueNode.d.ts +14 -0
- package/dist/types/model/nodes/SubGraphNode.d.ts +21 -2
- package/dist/types/model/nodes/ToBase64Node.d.ts +12 -0
- package/dist/types/model/nodes/codeOutputInference.d.ts +31 -0
- package/dist/types/recording/ExecutionRecorder.d.ts +8 -2
- package/dist/types/utils/base64.d.ts +1 -1
- package/dist/types/utils/errors.d.ts +4 -0
- package/dist/types/utils/interpolation.d.ts +13 -2
- package/dist/types/utils/interpolationSyntax.d.ts +1 -1
- package/dist/types/utils/serialization/serialization.d.ts +3 -1
- package/dist/types/utils/serialization/serializationUtils.d.ts +1 -0
- package/package.json +1 -1
|
@@ -41,8 +41,10 @@ export function isInterpolationRegexLiteralStart(value, index) {
|
|
|
41
41
|
}
|
|
42
42
|
return previousIndex < 0 || REGEX_LITERAL_PREFIX_CHARACTERS.has(value[previousIndex]);
|
|
43
43
|
}
|
|
44
|
-
function getEscapedTripleTokenEnd(template, start) {
|
|
44
|
+
function getEscapedTripleTokenEnd(template, start, check) {
|
|
45
45
|
for (let cursor = start + 3; cursor < template.length - 2; cursor += 1) {
|
|
46
|
+
if ((cursor & 4095) === 0)
|
|
47
|
+
check?.();
|
|
46
48
|
if (template[cursor] === '}' && template[cursor + 1] === '}' && template[cursor + 2] === '}') {
|
|
47
49
|
return cursor + 3;
|
|
48
50
|
}
|
|
@@ -50,7 +52,7 @@ function getEscapedTripleTokenEnd(template, start) {
|
|
|
50
52
|
return undefined;
|
|
51
53
|
}
|
|
52
54
|
/** Finds a matching `}}` while allowing JSONPath filters, quotes, and braces. */
|
|
53
|
-
function scanInterpolationToken(template, start) {
|
|
55
|
+
function scanInterpolationToken(template, start, check) {
|
|
54
56
|
let quote;
|
|
55
57
|
let regex = false;
|
|
56
58
|
let regexCharacterClass = false;
|
|
@@ -58,6 +60,8 @@ function scanInterpolationToken(template, start) {
|
|
|
58
60
|
let parenthesisDepth = 0;
|
|
59
61
|
let braceDepth = 0;
|
|
60
62
|
for (let cursor = start + 2; cursor < template.length; cursor += 1) {
|
|
63
|
+
if ((cursor & 4095) === 0)
|
|
64
|
+
check?.();
|
|
61
65
|
const character = template[cursor];
|
|
62
66
|
if (regex) {
|
|
63
67
|
if (character === '[' && !isInterpolationSyntaxCharacterEscaped(template, cursor)) {
|
|
@@ -66,7 +70,9 @@ function scanInterpolationToken(template, start) {
|
|
|
66
70
|
else if (character === ']' && !isInterpolationSyntaxCharacterEscaped(template, cursor)) {
|
|
67
71
|
regexCharacterClass = false;
|
|
68
72
|
}
|
|
69
|
-
else if (character === '/' &&
|
|
73
|
+
else if (character === '/' &&
|
|
74
|
+
!regexCharacterClass &&
|
|
75
|
+
!isInterpolationSyntaxCharacterEscaped(template, cursor)) {
|
|
70
76
|
regex = false;
|
|
71
77
|
}
|
|
72
78
|
continue;
|
|
@@ -132,22 +138,23 @@ function scanInterpolationToken(template, start) {
|
|
|
132
138
|
* the rest of the execution runtime. The returned spans are fresh data and
|
|
133
139
|
* exclude escaped triple-brace tokens.
|
|
134
140
|
*/
|
|
135
|
-
export function scanInterpolationTokenSpans(template) {
|
|
141
|
+
export function scanInterpolationTokenSpans(template, check, tokenLimit = Infinity) {
|
|
136
142
|
const spans = [];
|
|
137
143
|
let searchIndex = 0;
|
|
138
144
|
while (searchIndex < template.length) {
|
|
145
|
+
check?.();
|
|
139
146
|
const start = template.indexOf('{{', searchIndex);
|
|
140
147
|
if (start === -1) {
|
|
141
148
|
break;
|
|
142
149
|
}
|
|
143
150
|
if (template[start + 2] === '{') {
|
|
144
|
-
const escapedEnd = getEscapedTripleTokenEnd(template, start);
|
|
151
|
+
const escapedEnd = getEscapedTripleTokenEnd(template, start, check);
|
|
145
152
|
if (escapedEnd !== undefined) {
|
|
146
153
|
searchIndex = escapedEnd;
|
|
147
154
|
continue;
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
|
-
const scanResult = scanInterpolationToken(template, start);
|
|
157
|
+
const scanResult = scanInterpolationToken(template, start, check);
|
|
151
158
|
if (scanResult.kind === 'nested') {
|
|
152
159
|
searchIndex = scanResult.start;
|
|
153
160
|
continue;
|
|
@@ -164,6 +171,8 @@ export function scanInterpolationTokenSpans(template) {
|
|
|
164
171
|
searchIndex = nextStart;
|
|
165
172
|
continue;
|
|
166
173
|
}
|
|
174
|
+
if (spans.length >= tokenLimit)
|
|
175
|
+
throw new Error('Interpolation template has too many tokens.');
|
|
167
176
|
spans.push({
|
|
168
177
|
start,
|
|
169
178
|
end: scanResult.end,
|
|
@@ -9,11 +9,12 @@ 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
|
}
|
|
15
16
|
const errMessage = (err) => `${getError(err).message}\n${getError(err).stack}`;
|
|
16
|
-
export function deserializeProject(serializedProject, path = null) {
|
|
17
|
+
export function deserializeProject(serializedProject, path = null, options = {}) {
|
|
17
18
|
const { deserializerInput, version } = prepareSerializedInput(serializedProject);
|
|
18
19
|
try {
|
|
19
20
|
const result = deserializeProjectByVersion(deserializerInput, version);
|
|
@@ -27,7 +28,8 @@ export function deserializeProject(serializedProject, path = null) {
|
|
|
27
28
|
if (err instanceof yaml.YAMLError) {
|
|
28
29
|
yamlProblem(err);
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
if (options.logErrors !== false)
|
|
32
|
+
console.warn(`Failed to deserialize project v${version}: ${errMessage(err)}`);
|
|
31
33
|
if (err instanceof UiGraphNormalizationError) {
|
|
32
34
|
throw new Error(`Could not deserialize project: ${err.message}`, { cause: err });
|
|
33
35
|
}
|
|
@@ -56,6 +58,7 @@ export function deserializeGraph(serializedGraph) {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
function normalizeDeserializedProject(project) {
|
|
61
|
+
normalizeClassifierProject(project);
|
|
59
62
|
for (const graph of Object.values(project.graphs)) {
|
|
60
63
|
normalizeDeserializedGraph(graph);
|
|
61
64
|
}
|
|
@@ -64,6 +67,7 @@ function normalizeDeserializedProject(project) {
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
function normalizeDeserializedGraph(graph) {
|
|
70
|
+
normalizeClassifierGraph(graph);
|
|
67
71
|
for (const node of graph.nodes) {
|
|
68
72
|
normalizeDeserializedNode(node);
|
|
69
73
|
}
|
|
@@ -73,6 +77,7 @@ function hasLegacyDataBusFlag(node) {
|
|
|
73
77
|
return node.type === 'passthrough' && data != null && Object.hasOwn(data, 'renderAsDataBus');
|
|
74
78
|
}
|
|
75
79
|
function normalizeDeserializedNode(node) {
|
|
80
|
+
normalizeClassifierNode(node);
|
|
76
81
|
if (node.type === 'code' && node.title === 'Code') {
|
|
77
82
|
node.title = 'Code (legacy)';
|
|
78
83
|
}
|
|
@@ -18,6 +18,9 @@ export function validateProject(project) {
|
|
|
18
18
|
return { valid: false, errors: ['Project is not an object'], warnings };
|
|
19
19
|
}
|
|
20
20
|
const p = project;
|
|
21
|
+
if (!isValidProjectStaticData(p.data)) {
|
|
22
|
+
errors.push('Project data must be a record of static-data strings');
|
|
23
|
+
}
|
|
21
24
|
// Metadata checks
|
|
22
25
|
if (!p.metadata || typeof p.metadata !== 'object') {
|
|
23
26
|
errors.push('Missing project metadata');
|
|
@@ -136,6 +139,9 @@ function isPlainRecord(value) {
|
|
|
136
139
|
const prototype = Object.getPrototypeOf(value);
|
|
137
140
|
return prototype === Object.prototype || prototype === null;
|
|
138
141
|
}
|
|
142
|
+
export function isValidProjectStaticData(value) {
|
|
143
|
+
return (value === undefined || (isPlainRecord(value) && Object.values(value).every((entry) => typeof entry === 'string')));
|
|
144
|
+
}
|
|
139
145
|
function validateUiGraphs(uiGraphs, errors) {
|
|
140
146
|
try {
|
|
141
147
|
normalizeUiGraphRecord(uiGraphs, { repairComponentIds: false });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mapValues } from 'lodash-es';
|
|
2
|
-
import {
|
|
2
|
+
import { normalizeSerializedLLMTemperatureData } from '../../model/chat-v2/llmChatV2NodeMigration.js';
|
|
3
|
+
import { doubleCheckProject, isValidProjectStaticData } from './serializationUtils.js';
|
|
3
4
|
import { entries } from '../typeSafety.js';
|
|
4
5
|
import {} from '../../model/Project.js';
|
|
5
6
|
import { normalizeUiGraphRecord } from '../../model/UiGraphNormalization.js';
|
|
@@ -16,6 +17,9 @@ export function graphV4Deserializer(data) {
|
|
|
16
17
|
return fromSerializedGraph(serializedGraph);
|
|
17
18
|
}
|
|
18
19
|
export function projectV4Serializer(project, attachedData) {
|
|
20
|
+
if (!isValidProjectStaticData(project.data)) {
|
|
21
|
+
throw new Error('Project data must be a record of static-data strings');
|
|
22
|
+
}
|
|
19
23
|
// Project Settings canonicalizes these values, but integrations and callers
|
|
20
24
|
// can author Project objects directly. Never write a project file that will
|
|
21
25
|
// later fail its own project-global validation at load or execution time.
|
|
@@ -48,6 +52,7 @@ function toSerializedProject(project, attachedData) {
|
|
|
48
52
|
attachedData,
|
|
49
53
|
plugins: project.plugins ?? [],
|
|
50
54
|
references: project.references ?? [],
|
|
55
|
+
data: project.data,
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
function fromSerializedProject(serializedProject) {
|
|
@@ -64,6 +69,7 @@ function fromSerializedProject(serializedProject) {
|
|
|
64
69
|
uiGraphs: Object.keys(uiGraphs).length > 0 ? uiGraphs : undefined,
|
|
65
70
|
plugins: serializedProject.plugins ?? [],
|
|
66
71
|
references: serializedProject.references ?? [],
|
|
72
|
+
...(serializedProject.data !== undefined ? { data: serializedProject.data } : {}),
|
|
67
73
|
},
|
|
68
74
|
serializedProject.attachedData ?? {},
|
|
69
75
|
];
|
|
@@ -134,6 +140,7 @@ function fromSerializedGraph(serializedGraph) {
|
|
|
134
140
|
};
|
|
135
141
|
}
|
|
136
142
|
function toSerializedNode(node, allNodes, allConnections) {
|
|
143
|
+
const data = normalizeSerializedLLMTemperatureData(node.type, node.data);
|
|
137
144
|
const outgoingConnections = allConnections
|
|
138
145
|
.filter((connection) => connection.outputNodeId === node.id)
|
|
139
146
|
.map((connection) => serializeConnection(connection, allNodes))
|
|
@@ -145,9 +152,14 @@ function toSerializedNode(node, allNodes, allConnections) {
|
|
|
145
152
|
splitRunMax: node.isSplitRun ? node.splitRunMax : undefined,
|
|
146
153
|
splitRunConcurrency: node.isSplitRun ? node.splitRunConcurrency : undefined,
|
|
147
154
|
isSplitSequential: node.isSplitSequential ? true : undefined,
|
|
148
|
-
data: Object.keys(
|
|
155
|
+
data: Object.keys(data ?? {}).length > 0 ? data : undefined,
|
|
149
156
|
outgoingConnections: outgoingConnections.length > 0 ? outgoingConnections : undefined,
|
|
150
|
-
variants: (node.variants?.length ?? 0) > 0
|
|
157
|
+
variants: (node.variants?.length ?? 0) > 0
|
|
158
|
+
? node.variants.map((variant) => ({
|
|
159
|
+
...variant,
|
|
160
|
+
data: normalizeSerializedLLMTemperatureData(node.type, variant.data),
|
|
161
|
+
}))
|
|
162
|
+
: undefined,
|
|
151
163
|
disabled: node.disabled ? true : undefined,
|
|
152
164
|
isConditional: node.isConditional,
|
|
153
165
|
};
|
|
@@ -15,6 +15,7 @@ import { GraphProcessor } from '../model/GraphProcessor.js';
|
|
|
15
15
|
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
16
16
|
import { type LooseDataValue } from './looseDataValue.js';
|
|
17
17
|
import type { ProjectReferenceLoader } from '../model/ProjectReferenceLoader.js';
|
|
18
|
+
import type { SubgraphProjectLoader } from '../model/SubgraphProjectTarget.js';
|
|
18
19
|
import type { RivetStoredValueStore } from '../model/StoredValueStore.js';
|
|
19
20
|
import type { RivetKnowledgeStoreRegistry } from '../integrations/KnowledgeStore.js';
|
|
20
21
|
import type { RivetLLMProfileHealthStore } from '../model/chat-v2/llmProfileHealthStore.js';
|
|
@@ -47,6 +48,9 @@ export type RunGraphOptions = {
|
|
|
47
48
|
codeRunner?: ProcessContext['codeRunner'];
|
|
48
49
|
projectPath?: string;
|
|
49
50
|
projectReferenceLoader?: ProjectReferenceLoader;
|
|
51
|
+
subgraphProjectLoader?: SubgraphProjectLoader;
|
|
52
|
+
onSubgraphProjectRun?: ProcessContext['onSubgraphProjectRun'];
|
|
53
|
+
subgraphRecordingOptions?: ProcessContext['subgraphRecordingOptions'];
|
|
50
54
|
editorExecutionCache?: ProcessContext['editorExecutionCache'];
|
|
51
55
|
storedValueStore?: RivetStoredValueStore;
|
|
52
56
|
knowledgeStores?: RivetKnowledgeStoreRegistry;
|
|
@@ -73,5 +77,7 @@ export declare function coreCreateProcessor(project: Project, options: RunGraphO
|
|
|
73
77
|
run(): Promise<import("../model/GraphProcessor.js").GraphOutputs>;
|
|
74
78
|
};
|
|
75
79
|
export declare function coreRunGraph(project: Project, options: RunGraphOptions): Promise<Record<string, DataValue>>;
|
|
76
|
-
export declare function loadProjectFromString(content: string
|
|
80
|
+
export declare function loadProjectFromString(content: string, options?: {
|
|
81
|
+
logErrors?: boolean;
|
|
82
|
+
}): Project;
|
|
77
83
|
export declare function loadProjectAndAttachedDataFromString(content: string): [Project, AttachedData];
|
package/dist/types/exports.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export * from './model/ProcessContext.js';
|
|
|
34
34
|
export * from './model/AgentResponseTrace.js';
|
|
35
35
|
export * from './model/DebuggerTransportSentinel.js';
|
|
36
36
|
export * from './model/ProjectReferenceLoader.js';
|
|
37
|
+
export * from './model/SubgraphProjectTarget.js';
|
|
38
|
+
export * from './model/ProjectBundle.js';
|
|
37
39
|
export * from './model/RivetUIContext.js';
|
|
38
40
|
export * from './model/chat-v2/index.js';
|
|
39
41
|
export * from './integrations/integrations.js';
|
|
@@ -52,6 +54,10 @@ export * from './recording/RecordedEvents.js';
|
|
|
52
54
|
export * from './model/RivetPlugin.js';
|
|
53
55
|
export * from './model/PluginLoadSpec.js';
|
|
54
56
|
export * from './plugins.js';
|
|
57
|
+
export * from './model/classifier/credentials.js';
|
|
58
|
+
export * from './model/classifier/migration.js';
|
|
59
|
+
export * from './model/classifier/providers.js';
|
|
60
|
+
export * from './model/classifier/types.js';
|
|
55
61
|
export * from './model/NodeRegistration.js';
|
|
56
62
|
export * from './model/RegistryAssembly.js';
|
|
57
63
|
export type * from './model/Settings.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function findStronglyConnectedComponents(nodes: ChartNode[], getAdjacentNodes: (node: ChartNode) => ChartNode[]): ChartNode[][];
|
|
1
|
+
export declare function findStronglyConnectedComponents<T extends object>(nodes: T[], getAdjacentNodes: (node: T) => T[]): T[][];
|
|
@@ -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>[];
|
|
@@ -253,6 +253,8 @@ export type OutgoingMessageMap = {
|
|
|
253
253
|
projectPath?: string | null;
|
|
254
254
|
useEditorCache?: boolean;
|
|
255
255
|
captureNodeTimings?: boolean;
|
|
256
|
+
/** Hosted editor setting; only the authenticated Node executor uses it. */
|
|
257
|
+
recordSubgraphProjectRuns?: boolean;
|
|
256
258
|
evaluation?: EvaluationExecutionMetadata;
|
|
257
259
|
/**
|
|
258
260
|
* An opaque, host-owned ID that lets a trusted executor join an unhealthy
|
|
@@ -8,6 +8,8 @@ export type GraphBoundaryInput = {
|
|
|
8
8
|
dataType: DataType;
|
|
9
9
|
editor?: DynamicEditorEditor;
|
|
10
10
|
id: string;
|
|
11
|
+
/** Stable Graph Input node identity; older saved boundaries may omit it. */
|
|
12
|
+
nodeId?: NodeId;
|
|
11
13
|
portId: PortId;
|
|
12
14
|
};
|
|
13
15
|
export type GraphBoundaryOutput = {
|
|
@@ -320,6 +320,7 @@ export declare class GraphProcessor {
|
|
|
320
320
|
[asyncBranchInputAnchorsOverride]?: GraphNodeDefinitions;
|
|
321
321
|
[consumedStreamingWatchNodeOverride]?: NodeId;
|
|
322
322
|
});
|
|
323
|
+
get recordingProjectScope(): string | undefined;
|
|
323
324
|
on: Emittery<ProcessEvents>["on"];
|
|
324
325
|
off: Emittery<ProcessEvents>["off"];
|
|
325
326
|
once: Emittery<ProcessEvents>["once"];
|
|
@@ -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 = {
|
|
@@ -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>[]>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NodeRegistration } from './NodeRegistration.js';
|
|
2
2
|
export * from './nodes/UserInputNode.js';
|
|
3
3
|
export * from './nodes/TextNode.js';
|
|
4
|
+
export { buildNodeBodyPreview } from './nodes/nodeBodyPreview.js';
|
|
4
5
|
export * from './nodes/ChatNode.js';
|
|
5
6
|
export * from './nodes/ChatNodeBase.js';
|
|
6
7
|
export * from './nodes/LLMChatV2Node.js';
|
|
@@ -42,6 +43,8 @@ export * from './DataBusTopology.js';
|
|
|
42
43
|
export * from './nodes/StartBackgroundBranchNode.js';
|
|
43
44
|
export * from './nodes/WatchStreamingOutputNode.js';
|
|
44
45
|
export * from './nodes/StopWatchingStreamingOutputNode.js';
|
|
46
|
+
export * from './nodes/StreamValueNode.js';
|
|
47
|
+
export * from './nodes/CatchStreamingChunksNode.js';
|
|
45
48
|
export * from './nodes/PopNode.js';
|
|
46
49
|
export * from './nodes/SetGlobalNode.js';
|
|
47
50
|
export * from './nodes/GetGlobalNode.js';
|
|
@@ -63,6 +66,7 @@ export * from './nodes/HashNode.js';
|
|
|
63
66
|
export * from './nodes/AbortGraphNode.js';
|
|
64
67
|
export * from './nodes/RaceInputsNode.js';
|
|
65
68
|
export * from './nodes/ToJsonNode.js';
|
|
69
|
+
export * from './nodes/ToBase64Node.js';
|
|
66
70
|
export * from './nodes/JoinNode.js';
|
|
67
71
|
export * from './nodes/FilterNode.js';
|
|
68
72
|
export * from './nodes/JSFilterNode.js';
|
|
@@ -109,16 +113,18 @@ export * from './nodes/MCPToolCallNode.js';
|
|
|
109
113
|
export * from './nodes/MCPGetPromptNode.js';
|
|
110
114
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
111
115
|
export * from './nodes/NodePrefabInstanceNode.js';
|
|
112
|
-
export
|
|
116
|
+
export * from './nodes/ClassifierQuestionNode.js';
|
|
117
|
+
export * from './nodes/ClassifierEvaluateNode.js';
|
|
118
|
+
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" | "userInput" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "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" | "streamValue" | "catchStreamingChunks" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "hash" | "raceInputs" | "toJson" | "toBase64" | "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/StreamValueNode.js").StreamValueNode | import("./nodes/CatchStreamingChunksNode.js").CatchStreamingChunksNode | 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/ToBase64Node.js").ToBase64Node | 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 & {
|
|
113
119
|
type: "mcpDiscovery";
|
|
114
120
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
115
121
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
116
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
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" | "
|
|
122
|
+
}) | 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>;
|
|
123
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "userInput" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "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" | "streamValue" | "catchStreamingChunks" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "hash" | "raceInputs" | "toJson" | "toBase64" | "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/StreamValueNode.js").StreamValueNode | import("./nodes/CatchStreamingChunksNode.js").CatchStreamingChunksNode | 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/ToBase64Node.js").ToBase64Node | 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
124
|
type: "mcpDiscovery";
|
|
119
125
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
120
126
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
121
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
127
|
+
}) | 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>;
|
|
122
128
|
export { globalRivetNodeRegistry };
|
|
123
129
|
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
124
130
|
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
@@ -3,6 +3,8 @@ import { type RuntimeSettings, type NativeApi, type Project, type DataValue, typ
|
|
|
3
3
|
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
4
4
|
import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
5
5
|
import type { ProjectReferenceLoader } from './ProjectReferenceLoader.js';
|
|
6
|
+
import type { ResolvedSubgraphProject, SubgraphProjectLoader, SubgraphProjectRun } from './SubgraphProjectTarget.js';
|
|
7
|
+
import type { ExecutionRecorderOptions } from '../recording/ExecutionRecorder.js';
|
|
6
8
|
import type { GraphBoundary } from './GraphBoundaryCache.js';
|
|
7
9
|
import type { GraphInputStream } from './GraphInputStream.js';
|
|
8
10
|
import type { GraphProgress } from './GraphProgress.js';
|
|
@@ -174,6 +176,12 @@ export type ProcessContext = {
|
|
|
174
176
|
codeRunner?: CodeRunner;
|
|
175
177
|
/** The loader for loading project references. */
|
|
176
178
|
projectReferenceLoader?: ProjectReferenceLoader;
|
|
179
|
+
/** Host-only resolver for Studio Server Subgraph nodes targeting another saved project. */
|
|
180
|
+
subgraphProjectLoader?: SubgraphProjectLoader;
|
|
181
|
+
/** Optional host-owned recording sink. Failures must not alter graph results. */
|
|
182
|
+
onSubgraphProjectRun?: (run: SubgraphProjectRun) => void | Promise<void>;
|
|
183
|
+
/** Apply the host's recording privacy settings to called-project replays. */
|
|
184
|
+
subgraphRecordingOptions?: ExecutionRecorderOptions;
|
|
177
185
|
/** The path to the current project. Required if project references are being used. */
|
|
178
186
|
projectPath?: string;
|
|
179
187
|
/**
|
|
@@ -235,11 +243,15 @@ export type GraphExecutionMetadata = {
|
|
|
235
243
|
rootRunId: RootRunId;
|
|
236
244
|
graphRunId: GraphRunId;
|
|
237
245
|
graphId: GraphId;
|
|
246
|
+
/** Present for a hosted Subgraph call into another saved project. */
|
|
247
|
+
projectScope?: string;
|
|
238
248
|
parentGraphRunId?: GraphRunId;
|
|
239
249
|
executor?: SubgraphExecutorMetadata;
|
|
240
250
|
evaluation?: EvaluationExecutionMetadata;
|
|
241
251
|
};
|
|
242
252
|
export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessContext & {
|
|
253
|
+
/** Dataset snapshot belonging to this node's selected external Subgraph target. */
|
|
254
|
+
subgraphTarget?: ResolvedSubgraphProject;
|
|
243
255
|
/** Invocation-scoped live inputs for a named graph caller. Never serialized. */
|
|
244
256
|
graphInputStreams?: Readonly<Record<string, GraphInputStream>>;
|
|
245
257
|
/** The executor that is running the current processor. */
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Project } from './Project.js';
|
|
2
|
+
import { type GraphBoundary } from './GraphBoundaryCache.js';
|
|
3
|
+
import type { PluginLoadSpec } from './PluginLoadSpec.js';
|
|
4
|
+
/** Deliberate, user-facing bundle validation failures; never raw storage errors. */
|
|
5
|
+
export declare class ProjectBundleError extends Error {
|
|
6
|
+
constructor(message: string, options?: ErrorOptions);
|
|
7
|
+
}
|
|
8
|
+
/** Portable, immutable project snapshots. Paths are relative to the manifest. */
|
|
9
|
+
export type ProjectBundleFile = {
|
|
10
|
+
path: string;
|
|
11
|
+
bytes: number;
|
|
12
|
+
sha256: string;
|
|
13
|
+
};
|
|
14
|
+
export type ProjectBundleArtifact = {
|
|
15
|
+
id: string;
|
|
16
|
+
projectId: string;
|
|
17
|
+
title: string;
|
|
18
|
+
version: 'latest' | 'published';
|
|
19
|
+
revision: string;
|
|
20
|
+
project: ProjectBundleFile;
|
|
21
|
+
datasets?: ProjectBundleFile;
|
|
22
|
+
};
|
|
23
|
+
export type ProjectBundleManifest = {
|
|
24
|
+
format: 'rivet-project-bundle';
|
|
25
|
+
schemaVersion: 1;
|
|
26
|
+
requiredLoaderVersion: 1;
|
|
27
|
+
exportingRuntimeVersion: string;
|
|
28
|
+
rootArtifact: string;
|
|
29
|
+
artifacts: ProjectBundleArtifact[];
|
|
30
|
+
targets: {
|
|
31
|
+
projectId: string;
|
|
32
|
+
version: 'latest' | 'published';
|
|
33
|
+
artifact: string;
|
|
34
|
+
}[];
|
|
35
|
+
references: {
|
|
36
|
+
projectId: string;
|
|
37
|
+
artifact: string;
|
|
38
|
+
}[];
|
|
39
|
+
plugins: PluginLoadSpec[];
|
|
40
|
+
};
|
|
41
|
+
export declare const PROJECT_BUNDLE_MANIFEST = "rivet-bundle.json";
|
|
42
|
+
export declare const PROJECT_BUNDLE_MAX_ARTIFACTS = 256;
|
|
43
|
+
export declare function projectBundleTargetKey(projectId: string, version: string): string;
|
|
44
|
+
export declare function listProjectBundleCalls(project: Project): {
|
|
45
|
+
projectId: string;
|
|
46
|
+
version: 'latest' | 'published';
|
|
47
|
+
graphId: string;
|
|
48
|
+
boundary?: GraphBoundary;
|
|
49
|
+
}[];
|
|
50
|
+
/** Uses the same saved wire contract as runtime execution, without running any nodes. */
|
|
51
|
+
export declare function validateProjectBundleCall(call: ReturnType<typeof listProjectBundleCalls>[number], target: Project): void;
|
|
52
|
+
/** Reject missing bindings and cross-project dependency cycles before executing any graph. */
|
|
53
|
+
export declare function validateProjectBundleProjects(manifest: ProjectBundleManifest, projects: ReadonlyMap<string, Project>): void;
|
|
54
|
+
export declare function validateProjectBundleManifest(value: unknown): ProjectBundleManifest;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Project, ProjectId, ProjectReference } from './Project.js';
|
|
2
|
+
import type { DatasetProvider } from '../integrations/DatasetProvider.js';
|
|
2
3
|
export type ProjectReferenceLoader = {
|
|
3
4
|
/** Loads a project based on the given reference. */
|
|
4
5
|
loadProject: (currentProjectPath: string | undefined, reference: ProjectReference) => Promise<Project>;
|
|
6
|
+
/** Optional snapshot-owned datasets; older loaders retain the caller's provider. */
|
|
7
|
+
getDatasetProvider?: (project: Project) => DatasetProvider | undefined;
|
|
5
8
|
};
|
|
6
9
|
/** The root information needed to load its complete referenced-project closure. */
|
|
7
10
|
export type ProjectReferenceRoot = {
|
|
@@ -10,6 +10,10 @@ export interface Settings<PluginSettings = Record<string, Record<string, unknown
|
|
|
10
10
|
pluginEnv?: {
|
|
11
11
|
[key: string]: string | undefined;
|
|
12
12
|
};
|
|
13
|
+
/** First-party credentials used by built-in classifier providers. */
|
|
14
|
+
classifierProviders?: Record<string, {
|
|
15
|
+
apiKey?: string | undefined;
|
|
16
|
+
}>;
|
|
13
17
|
openAiApiKey?: string;
|
|
14
18
|
openAiKey?: string;
|
|
15
19
|
anthropicApiKey?: string;
|