@valerypopoff/rivet2-core 2.0.5 → 2.0.7
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 +736 -439
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/esm/model/Nodes.js +3 -0
- package/dist/esm/model/nodes/CodeNewNode.js +207 -0
- package/dist/esm/model/nodes/CodeNode.js +10 -9
- package/dist/esm/model/nodes/CommentNode.js +1 -1
- package/dist/esm/model/nodes/ExpressionNode.js +23 -39
- package/dist/esm/model/nodes/ObjectNode.js +1 -0
- package/dist/esm/model/nodes/ToolNode.js +1 -0
- package/dist/esm/model/nodes/codeNodeErrorDiagnostics.js +14 -8
- package/dist/esm/model/nodes/jsListCallbackHelpers.js +26 -30
- package/dist/esm/model/nodes/jsValueInterpolation.js +56 -2
- package/dist/esm/utils/serialization/serialization.js +22 -1
- package/dist/types/model/EditorDefinition.d.ts +2 -0
- package/dist/types/model/Nodes.d.ts +3 -2
- package/dist/types/model/ProcessContext.d.ts +2 -2
- package/dist/types/model/nodes/CodeNewNode.d.ts +27 -0
- package/dist/types/model/nodes/codeNodeErrorDiagnostics.d.ts +3 -0
- package/dist/types/model/nodes/jsValueInterpolation.d.ts +20 -0
- package/package.json +1 -1
package/dist/cjs/bundle.cjs
CHANGED
|
@@ -38,12 +38,14 @@ __export(src_exports, {
|
|
|
38
38
|
AudioNodeImpl: () => AudioNodeImpl,
|
|
39
39
|
BooleanNodeImpl: () => BooleanNodeImpl,
|
|
40
40
|
BrowserNativeApi: () => BrowserNativeApi,
|
|
41
|
+
CODE_NEW_OUTPUT_PORT_ID: () => CODE_NEW_OUTPUT_PORT_ID,
|
|
41
42
|
CallGraphNodeImpl: () => CallGraphNodeImpl,
|
|
42
43
|
ChatLoopNodeImpl: () => ChatLoopNodeImpl,
|
|
43
44
|
ChatNodeBase: () => ChatNodeBase,
|
|
44
45
|
ChatNodeImpl: () => ChatNodeImpl,
|
|
45
46
|
ChunkNodeImpl: () => ChunkNodeImpl,
|
|
46
47
|
CoalesceNodeImpl: () => CoalesceNodeImpl,
|
|
48
|
+
CodeNewNodeImpl: () => CodeNewNodeImpl,
|
|
47
49
|
CodeNodeImpl: () => CodeNodeImpl,
|
|
48
50
|
CommentNodeImpl: () => CommentNodeImpl,
|
|
49
51
|
CompareNodeImpl: () => CompareNodeImpl,
|
|
@@ -175,6 +177,7 @@ __export(src_exports, {
|
|
|
175
177
|
chunkStringByTokenCount: () => chunkStringByTokenCount,
|
|
176
178
|
cleanHeaders: () => cleanHeaders,
|
|
177
179
|
coalesceNode: () => coalesceNode,
|
|
180
|
+
codeNewNode: () => codeNewNode,
|
|
178
181
|
codeNode: () => codeNode,
|
|
179
182
|
coerceType: () => coerceType,
|
|
180
183
|
coerceTypeOptional: () => coerceTypeOptional,
|
|
@@ -267,6 +270,7 @@ __export(src_exports, {
|
|
|
267
270
|
imageNode: () => imageNode,
|
|
268
271
|
inferType: () => inferType,
|
|
269
272
|
interpolate: () => interpolate,
|
|
273
|
+
interpolateCodeNewSource: () => interpolateCodeNewSource,
|
|
270
274
|
interpolateExpressionSource: () => interpolateExpressionSource,
|
|
271
275
|
interpolateExtractObjectPathSource: () => interpolateExtractObjectPathSource,
|
|
272
276
|
interpolateJSListCallbackBody: () => interpolateJSListCallbackBody,
|
|
@@ -393,12 +397,14 @@ __export(exports_exports, {
|
|
|
393
397
|
AudioNodeImpl: () => AudioNodeImpl,
|
|
394
398
|
BooleanNodeImpl: () => BooleanNodeImpl,
|
|
395
399
|
BrowserNativeApi: () => BrowserNativeApi,
|
|
400
|
+
CODE_NEW_OUTPUT_PORT_ID: () => CODE_NEW_OUTPUT_PORT_ID,
|
|
396
401
|
CallGraphNodeImpl: () => CallGraphNodeImpl,
|
|
397
402
|
ChatLoopNodeImpl: () => ChatLoopNodeImpl,
|
|
398
403
|
ChatNodeBase: () => ChatNodeBase,
|
|
399
404
|
ChatNodeImpl: () => ChatNodeImpl,
|
|
400
405
|
ChunkNodeImpl: () => ChunkNodeImpl,
|
|
401
406
|
CoalesceNodeImpl: () => CoalesceNodeImpl,
|
|
407
|
+
CodeNewNodeImpl: () => CodeNewNodeImpl,
|
|
402
408
|
CodeNodeImpl: () => CodeNodeImpl,
|
|
403
409
|
CommentNodeImpl: () => CommentNodeImpl,
|
|
404
410
|
CompareNodeImpl: () => CompareNodeImpl,
|
|
@@ -529,6 +535,7 @@ __export(exports_exports, {
|
|
|
529
535
|
chunkStringByTokenCount: () => chunkStringByTokenCount,
|
|
530
536
|
cleanHeaders: () => cleanHeaders,
|
|
531
537
|
coalesceNode: () => coalesceNode,
|
|
538
|
+
codeNewNode: () => codeNewNode,
|
|
532
539
|
codeNode: () => codeNode,
|
|
533
540
|
coerceType: () => coerceType,
|
|
534
541
|
coerceTypeOptional: () => coerceTypeOptional,
|
|
@@ -621,6 +628,7 @@ __export(exports_exports, {
|
|
|
621
628
|
imageNode: () => imageNode,
|
|
622
629
|
inferType: () => inferType,
|
|
623
630
|
interpolate: () => interpolate,
|
|
631
|
+
interpolateCodeNewSource: () => interpolateCodeNewSource,
|
|
624
632
|
interpolateExpressionSource: () => interpolateExpressionSource,
|
|
625
633
|
interpolateExtractObjectPathSource: () => interpolateExtractObjectPathSource,
|
|
626
634
|
interpolateJSListCallbackBody: () => interpolateJSListCallbackBody,
|
|
@@ -1823,6 +1831,7 @@ function deserializeProject(serializedProject, path = null) {
|
|
|
1823
1831
|
const version = detectSerializationVersion(serializedProject);
|
|
1824
1832
|
try {
|
|
1825
1833
|
const result = deserializeProjectByVersion(serializedProject, version);
|
|
1834
|
+
normalizeProjectDefaultNodeTitles(result[0]);
|
|
1826
1835
|
if (path !== null) {
|
|
1827
1836
|
result[0].metadata.path = path;
|
|
1828
1837
|
}
|
|
@@ -1841,7 +1850,9 @@ function serializeGraph(graph) {
|
|
|
1841
1850
|
function deserializeGraph(serializedGraph) {
|
|
1842
1851
|
const version = detectSerializationVersion(serializedGraph);
|
|
1843
1852
|
try {
|
|
1844
|
-
|
|
1853
|
+
const graph = deserializeGraphByVersion(serializedGraph, version);
|
|
1854
|
+
normalizeGraphDefaultNodeTitles(graph);
|
|
1855
|
+
return graph;
|
|
1845
1856
|
} catch (err) {
|
|
1846
1857
|
if (err instanceof yaml3.YAMLError) {
|
|
1847
1858
|
yamlProblem(err);
|
|
@@ -1850,6 +1861,23 @@ function deserializeGraph(serializedGraph) {
|
|
|
1850
1861
|
throw new Error("Could not deserialize graph");
|
|
1851
1862
|
}
|
|
1852
1863
|
}
|
|
1864
|
+
function normalizeProjectDefaultNodeTitles(project) {
|
|
1865
|
+
for (const graph of Object.values(project.graphs)) {
|
|
1866
|
+
normalizeGraphDefaultNodeTitles(graph);
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
function normalizeGraphDefaultNodeTitles(graph) {
|
|
1870
|
+
for (const node of graph.nodes) {
|
|
1871
|
+
normalizeDefaultCodeNodeTitle(node);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
function normalizeDefaultCodeNodeTitle(node) {
|
|
1875
|
+
if (node.type === "code" && node.title === "Code") {
|
|
1876
|
+
node.title = "Code (legacy)";
|
|
1877
|
+
} else if (node.type === "codeNew" && node.title === "Code new") {
|
|
1878
|
+
node.title = "Code";
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1853
1881
|
function deserializeProjectByVersion(serializedProject, version) {
|
|
1854
1882
|
switch (version) {
|
|
1855
1883
|
case 4:
|
|
@@ -11053,7 +11081,7 @@ function getRuntimeErrorLocationFromStack(params) {
|
|
|
11053
11081
|
}
|
|
11054
11082
|
const generatedLine = Number(match10[1]);
|
|
11055
11083
|
const column = Number(match10[2]);
|
|
11056
|
-
const line = generatedLine - ASYNC_FUNCTION_LINE_OFFSET;
|
|
11084
|
+
const line = generatedLine - ASYNC_FUNCTION_LINE_OFFSET - (params.userCodeLineOffset ?? 0);
|
|
11057
11085
|
const lineCount = Math.max(params.code.split(/\r?\n/).length, 1);
|
|
11058
11086
|
if (!Number.isFinite(line) || line < 1 || line > lineCount) {
|
|
11059
11087
|
return void 0;
|
|
@@ -11076,12 +11104,12 @@ function getParserErrorLocation(error) {
|
|
|
11076
11104
|
line: loc.line
|
|
11077
11105
|
};
|
|
11078
11106
|
}
|
|
11079
|
-
async function getSyntaxErrorLocation(code, error) {
|
|
11107
|
+
async function getSyntaxErrorLocation(code, error, options2 = {}) {
|
|
11080
11108
|
if (error.name !== "SyntaxError") {
|
|
11081
11109
|
return void 0;
|
|
11082
11110
|
}
|
|
11083
11111
|
const wrappedCode = `async function __rivetCodeNode__() {
|
|
11084
|
-
${code}
|
|
11112
|
+
${options2.diagnosticCode ?? code}
|
|
11085
11113
|
}`;
|
|
11086
11114
|
try {
|
|
11087
11115
|
const { parse: parse4 } = await import("acorn");
|
|
@@ -11097,7 +11125,10 @@ ${code}
|
|
|
11097
11125
|
}
|
|
11098
11126
|
const lineCount = Math.max(code.split(/\r?\n/).length, 1);
|
|
11099
11127
|
const line = Math.min(
|
|
11100
|
-
Math.max(
|
|
11128
|
+
Math.max(
|
|
11129
|
+
parserLocation.line - SYNTAX_PARSE_WRAPPER_LINE_OFFSET - (options2.userCodeLineOffset ?? 0),
|
|
11130
|
+
1
|
|
11131
|
+
),
|
|
11101
11132
|
lineCount
|
|
11102
11133
|
);
|
|
11103
11134
|
return {
|
|
@@ -11107,9 +11138,9 @@ ${code}
|
|
|
11107
11138
|
}
|
|
11108
11139
|
return void 0;
|
|
11109
11140
|
}
|
|
11110
|
-
function formatLocationSuffix(location) {
|
|
11141
|
+
function formatLocationSuffix(location, locationLabel) {
|
|
11111
11142
|
const columnText = location.column != null ? `, column ${location.column}` : "";
|
|
11112
|
-
return
|
|
11143
|
+
return `${locationLabel} line ${location.line}${columnText}`;
|
|
11113
11144
|
}
|
|
11114
11145
|
function replaceStackHeader(stack, error) {
|
|
11115
11146
|
if (!stack) {
|
|
@@ -11121,15 +11152,20 @@ function replaceStackHeader(stack, error) {
|
|
|
11121
11152
|
}
|
|
11122
11153
|
async function enrichCodeNodeErrorWithLocation(params) {
|
|
11123
11154
|
const originalError = getError(params.error);
|
|
11155
|
+
const userCodeLineOffset = params.userCodeLineOffset ?? 0;
|
|
11124
11156
|
const location = getRuntimeErrorLocationFromStack({
|
|
11125
11157
|
code: params.code,
|
|
11126
11158
|
error: originalError,
|
|
11127
|
-
sourceUrl: params.sourceUrl
|
|
11128
|
-
|
|
11159
|
+
sourceUrl: params.sourceUrl,
|
|
11160
|
+
userCodeLineOffset
|
|
11161
|
+
}) ?? await getSyntaxErrorLocation(params.code, originalError, {
|
|
11162
|
+
diagnosticCode: params.diagnosticCode,
|
|
11163
|
+
userCodeLineOffset
|
|
11164
|
+
});
|
|
11129
11165
|
if (!location) {
|
|
11130
11166
|
return originalError;
|
|
11131
11167
|
}
|
|
11132
|
-
originalError.message = `${originalError.message} (${formatLocationSuffix(location)})`;
|
|
11168
|
+
originalError.message = `${originalError.message} (${formatLocationSuffix(location, params.locationLabel ?? "Code node")})`;
|
|
11133
11169
|
originalError.stack = replaceStackHeader(originalError.stack, originalError);
|
|
11134
11170
|
return originalError;
|
|
11135
11171
|
}
|
|
@@ -11139,7 +11175,7 @@ var CodeNodeImpl = class extends NodeImpl {
|
|
|
11139
11175
|
static create() {
|
|
11140
11176
|
const chartNode = {
|
|
11141
11177
|
type: "code",
|
|
11142
|
-
title: "Code",
|
|
11178
|
+
title: "Code (legacy)",
|
|
11143
11179
|
id: (0, import_non_secure11.nanoid)(),
|
|
11144
11180
|
visualData: {
|
|
11145
11181
|
x: 0,
|
|
@@ -11147,10 +11183,10 @@ var CodeNodeImpl = class extends NodeImpl {
|
|
|
11147
11183
|
},
|
|
11148
11184
|
data: {
|
|
11149
11185
|
code: import_ts_dedent8.dedent`
|
|
11150
|
-
// This is a
|
|
11186
|
+
// This is a Code (legacy) node. Write JavaScript here and it will be executed.
|
|
11151
11187
|
// Inputs are accessible via an object \`inputs\` and data is typed (i.e. inputs.foo.type, inputs.foo.value)
|
|
11152
11188
|
// Return an object with named outputs that match the output names specified in the node's config.
|
|
11153
|
-
// Output values must
|
|
11189
|
+
// Output values must be typed as well (e.g. { bar: { type: 'string', value: 'bar' } }
|
|
11154
11190
|
return {
|
|
11155
11191
|
output1: {
|
|
11156
11192
|
type: inputs.input1.type,
|
|
@@ -11276,10 +11312,10 @@ var CodeNodeImpl = class extends NodeImpl {
|
|
|
11276
11312
|
static getUIData() {
|
|
11277
11313
|
return {
|
|
11278
11314
|
infoBoxBody: import_ts_dedent8.dedent`
|
|
11279
|
-
Executes
|
|
11315
|
+
Executes legacy JavaScript code with manually configured inputs and outputs.
|
|
11280
11316
|
`,
|
|
11281
|
-
infoBoxTitle: "Code Node",
|
|
11282
|
-
contextMenuTitle: "Code",
|
|
11317
|
+
infoBoxTitle: "Code (legacy) Node",
|
|
11318
|
+
contextMenuTitle: "Code (legacy)",
|
|
11283
11319
|
group: ["Advanced"]
|
|
11284
11320
|
};
|
|
11285
11321
|
}
|
|
@@ -11304,29 +11340,48 @@ var CodeNodeImpl = class extends NodeImpl {
|
|
|
11304
11340
|
throw await enrichCodeNodeErrorWithLocation({
|
|
11305
11341
|
code: this.data.code,
|
|
11306
11342
|
error,
|
|
11343
|
+
locationLabel: "Code (legacy) node",
|
|
11307
11344
|
sourceUrl
|
|
11308
11345
|
});
|
|
11309
11346
|
}
|
|
11310
11347
|
if (outputs == null || typeof outputs !== "object" || "then" in outputs && typeof outputs.then === "function") {
|
|
11311
|
-
throw new Error("Code node must return an object with output values.");
|
|
11348
|
+
throw new Error("Code (legacy) node must return an object with output values.");
|
|
11312
11349
|
}
|
|
11313
11350
|
const missingOutputs = this.getOutputDefinitions().filter((output) => !(output.id in outputs));
|
|
11314
11351
|
if (missingOutputs.length > 0) {
|
|
11315
11352
|
throw new Error(
|
|
11316
|
-
`Code node must return an object with output values for all outputs. To not run an output, return { "type": "control-flow-excluded", "value": undefined }. To return undefined, return { "type": "any", "value": undefined }. Missing: ${missingOutputs.map((output) => output.id).join(", ")}`
|
|
11353
|
+
`Code (legacy) node must return an object with output values for all outputs. To not run an output, return { "type": "control-flow-excluded", "value": undefined }. To return undefined, return { "type": "any", "value": undefined }. Missing: ${missingOutputs.map((output) => output.id).join(", ")}`
|
|
11317
11354
|
);
|
|
11318
11355
|
}
|
|
11319
11356
|
return outputs;
|
|
11320
11357
|
}
|
|
11321
11358
|
};
|
|
11322
|
-
var codeNode = nodeDefinition(CodeNodeImpl, "Code");
|
|
11359
|
+
var codeNode = nodeDefinition(CodeNodeImpl, "Code (legacy)");
|
|
11323
11360
|
|
|
11324
|
-
// src/model/nodes/
|
|
11361
|
+
// src/model/nodes/CodeNewNode.ts
|
|
11325
11362
|
var import_non_secure12 = require("nanoid/non-secure");
|
|
11326
11363
|
var import_ts_dedent10 = require("ts-dedent");
|
|
11327
11364
|
|
|
11328
11365
|
// src/model/nodes/jsValueInterpolation.ts
|
|
11329
11366
|
var import_ts_dedent9 = require("ts-dedent");
|
|
11367
|
+
function escapeRegExp2(value) {
|
|
11368
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
11369
|
+
}
|
|
11370
|
+
function containsIdentifier(source, identifier) {
|
|
11371
|
+
return new RegExp(`(^|[^A-Za-z0-9_$])${escapeRegExp2(identifier)}($|[^A-Za-z0-9_$])`).test(source);
|
|
11372
|
+
}
|
|
11373
|
+
function getSafeJsValueInterpolationIdentifier(source, baseIdentifier) {
|
|
11374
|
+
let index = 0;
|
|
11375
|
+
let candidate = baseIdentifier;
|
|
11376
|
+
while (containsIdentifier(source, candidate)) {
|
|
11377
|
+
index += 1;
|
|
11378
|
+
candidate = `${baseIdentifier}_${index}`;
|
|
11379
|
+
}
|
|
11380
|
+
return candidate;
|
|
11381
|
+
}
|
|
11382
|
+
function buildJsValuePreview(source, maxLines) {
|
|
11383
|
+
return source.split("\n").slice(0, maxLines).join("\n").trim();
|
|
11384
|
+
}
|
|
11330
11385
|
function isSpecialReference(inputName) {
|
|
11331
11386
|
return inputName.startsWith("@graphInputs.") || inputName.startsWith("@context.");
|
|
11332
11387
|
}
|
|
@@ -11375,18 +11430,33 @@ function getJsValueInterpolationInputNames(template, options2 = {}) {
|
|
|
11375
11430
|
return !((_a = options2.localIdentifiers) == null ? void 0 : _a.has(inputName));
|
|
11376
11431
|
});
|
|
11377
11432
|
}
|
|
11433
|
+
function getJsValueInterpolationInputDefinitions(template, options2 = {}) {
|
|
11434
|
+
return getJsValueInterpolationInputNames(template, options2).map(
|
|
11435
|
+
(inputName) => createInterpolationInputDefinition({
|
|
11436
|
+
interpolationName: inputName,
|
|
11437
|
+
dataType: "any",
|
|
11438
|
+
required: false
|
|
11439
|
+
})
|
|
11440
|
+
);
|
|
11441
|
+
}
|
|
11442
|
+
function getJsValueInterpolationRuntimeContext(template, baseInputsIdentifier, options2 = {}) {
|
|
11443
|
+
return {
|
|
11444
|
+
inputNames: getJsValueInterpolationInputNames(template, options2),
|
|
11445
|
+
inputsIdentifier: getSafeJsValueInterpolationIdentifier(template, baseInputsIdentifier)
|
|
11446
|
+
};
|
|
11447
|
+
}
|
|
11378
11448
|
function buildJsValueInterpolatedSource(template, targetIdentifier, options2 = {}) {
|
|
11379
11449
|
return replaceInterpolationTokens(
|
|
11380
11450
|
template,
|
|
11381
11451
|
(token) => buildJsValueReference(token.tokenName, targetIdentifier, options2),
|
|
11382
11452
|
{
|
|
11383
|
-
trim: true
|
|
11453
|
+
trim: options2.trim ?? true
|
|
11384
11454
|
}
|
|
11385
11455
|
);
|
|
11386
11456
|
}
|
|
11387
11457
|
function interpolateJsValuePreviewSource(template, inputs, options2 = {}) {
|
|
11388
11458
|
return replaceInterpolationTokens(template, (token) => formatJsValuePreviewValue(token.tokenName, inputs, options2), {
|
|
11389
|
-
trim: true
|
|
11459
|
+
trim: options2.trim ?? true
|
|
11390
11460
|
});
|
|
11391
11461
|
}
|
|
11392
11462
|
function buildCloneJsInputValueFunction() {
|
|
@@ -11486,6 +11556,26 @@ function buildClonedInputValueAssignments(inputNames, targetIdentifier, cacheIde
|
|
|
11486
11556
|
)}]?.value, ${cacheIdentifier});`
|
|
11487
11557
|
).join("\n");
|
|
11488
11558
|
}
|
|
11559
|
+
function buildJsValueInputClonePreamble({
|
|
11560
|
+
cacheIdentifier,
|
|
11561
|
+
inputsIdentifier
|
|
11562
|
+
}) {
|
|
11563
|
+
return import_ts_dedent9.dedent`
|
|
11564
|
+
${buildCloneJsInputValueFunction()}
|
|
11565
|
+
const ${inputsIdentifier} = Object.create(null);
|
|
11566
|
+
const ${cacheIdentifier} = new WeakMap();
|
|
11567
|
+
`;
|
|
11568
|
+
}
|
|
11569
|
+
function buildJsValueInputsInitializer({
|
|
11570
|
+
cacheIdentifier,
|
|
11571
|
+
inputNames,
|
|
11572
|
+
inputsIdentifier
|
|
11573
|
+
}) {
|
|
11574
|
+
return import_ts_dedent9.dedent`
|
|
11575
|
+
${buildJsValueInputClonePreamble({ cacheIdentifier, inputsIdentifier })}
|
|
11576
|
+
${buildClonedInputValueAssignments(inputNames, inputsIdentifier, cacheIdentifier)}
|
|
11577
|
+
`;
|
|
11578
|
+
}
|
|
11489
11579
|
function sanitizeGeneratedJsValueText(text, inputNames, targetIdentifier, fallbackLabel) {
|
|
11490
11580
|
if (!text) {
|
|
11491
11581
|
return text;
|
|
@@ -11497,51 +11587,255 @@ function sanitizeGeneratedJsValueText(text, inputNames, targetIdentifier, fallba
|
|
|
11497
11587
|
}
|
|
11498
11588
|
return sanitized.replaceAll(targetIdentifier, fallbackLabel);
|
|
11499
11589
|
}
|
|
11590
|
+
function sanitizeGeneratedJsValueError(error, inputNames, targetIdentifier, fallbackLabel) {
|
|
11591
|
+
const jsValueError = getError(error);
|
|
11592
|
+
jsValueError.message = sanitizeGeneratedJsValueText(jsValueError.message, inputNames, targetIdentifier, fallbackLabel) ?? jsValueError.message;
|
|
11593
|
+
jsValueError.stack = sanitizeGeneratedJsValueText(
|
|
11594
|
+
jsValueError.stack,
|
|
11595
|
+
inputNames,
|
|
11596
|
+
targetIdentifier,
|
|
11597
|
+
fallbackLabel
|
|
11598
|
+
);
|
|
11599
|
+
return jsValueError;
|
|
11600
|
+
}
|
|
11601
|
+
|
|
11602
|
+
// src/model/nodes/CodeNewNode.ts
|
|
11603
|
+
var DEFAULT_CODE_NEW = import_ts_dedent10.dedent`
|
|
11604
|
+
// This is a Code node. Write JavaScript here and return one value.
|
|
11605
|
+
// Interpolation tokens create input ports and evaluate as connected values.
|
|
11606
|
+
// The returned value becomes the node's single output.
|
|
11607
|
+
const value = {{input}};
|
|
11608
|
+
return value;
|
|
11609
|
+
`;
|
|
11610
|
+
var MAX_BODY_PREVIEW_LINES2 = 15;
|
|
11611
|
+
var CODE_NEW_INPUTS_IDENTIFIER = "__codeNewInputs";
|
|
11612
|
+
var CODE_NEW_INPUT_CLONE_CACHE_IDENTIFIER = "codeNewInputCloneCache";
|
|
11613
|
+
var CODE_NEW_OUTPUT_PORT_ID = "output";
|
|
11614
|
+
function buildCodeNewPreview(code) {
|
|
11615
|
+
return buildJsValuePreview(code, MAX_BODY_PREVIEW_LINES2);
|
|
11616
|
+
}
|
|
11617
|
+
function buildCodeNewRuntimeSource(code, inputsIdentifier) {
|
|
11618
|
+
return buildJsValueInterpolatedSource(code, inputsIdentifier, { trim: false });
|
|
11619
|
+
}
|
|
11620
|
+
function buildCodeNewInputsInitializer(inputNames, inputsIdentifier) {
|
|
11621
|
+
return buildJsValueInputsInitializer({
|
|
11622
|
+
cacheIdentifier: CODE_NEW_INPUT_CLONE_CACHE_IDENTIFIER,
|
|
11623
|
+
inputNames,
|
|
11624
|
+
inputsIdentifier
|
|
11625
|
+
});
|
|
11626
|
+
}
|
|
11627
|
+
function interpolateCodeNewSource(code, inputs) {
|
|
11628
|
+
return interpolateJsValuePreviewSource(code, inputs, { trim: false });
|
|
11629
|
+
}
|
|
11630
|
+
function sanitizeCodeNewError(error, inputNames, inputsIdentifier) {
|
|
11631
|
+
return sanitizeGeneratedJsValueError(error, inputNames, inputsIdentifier, "code input");
|
|
11632
|
+
}
|
|
11633
|
+
function buildCodeNewWrapper(code, interpolationContext) {
|
|
11634
|
+
const { inputNames, inputsIdentifier } = interpolationContext;
|
|
11635
|
+
const beforeUserCodeLines = [
|
|
11636
|
+
...buildCodeNewInputsInitializer(inputNames, inputsIdentifier).split(/\r?\n/),
|
|
11637
|
+
"",
|
|
11638
|
+
"const __codeNewResult = await (async () => {"
|
|
11639
|
+
];
|
|
11640
|
+
const afterUserCodeLines = [
|
|
11641
|
+
"})();",
|
|
11642
|
+
"",
|
|
11643
|
+
"return {",
|
|
11644
|
+
" output: {",
|
|
11645
|
+
" type: 'any',",
|
|
11646
|
+
" value: __codeNewResult,",
|
|
11647
|
+
" },",
|
|
11648
|
+
"};"
|
|
11649
|
+
];
|
|
11650
|
+
return {
|
|
11651
|
+
source: [...beforeUserCodeLines, buildCodeNewRuntimeSource(code, inputsIdentifier), ...afterUserCodeLines].join(
|
|
11652
|
+
"\n"
|
|
11653
|
+
),
|
|
11654
|
+
userCodeLineOffset: beforeUserCodeLines.length
|
|
11655
|
+
};
|
|
11656
|
+
}
|
|
11657
|
+
function isDataValueLike(value) {
|
|
11658
|
+
return typeof value === "object" && value !== null && typeof value.type === "string" && Object.prototype.hasOwnProperty.call(value, "value");
|
|
11659
|
+
}
|
|
11660
|
+
function validateCodeNewRunnerOutputs(outputs) {
|
|
11661
|
+
if (outputs == null || typeof outputs !== "object" || "then" in outputs && typeof outputs.then === "function") {
|
|
11662
|
+
throw new Error("Code node runner must return an object containing the Output value.");
|
|
11663
|
+
}
|
|
11664
|
+
const output = outputs[CODE_NEW_OUTPUT_PORT_ID];
|
|
11665
|
+
if (!isDataValueLike(output)) {
|
|
11666
|
+
throw new Error("Code node runner must return a DataValue for the Output port.");
|
|
11667
|
+
}
|
|
11668
|
+
if (output.type !== "any") {
|
|
11669
|
+
throw new Error("Code node runner must return an any DataValue for the Output port.");
|
|
11670
|
+
}
|
|
11671
|
+
return outputs;
|
|
11672
|
+
}
|
|
11673
|
+
var CodeNewNodeImpl = class extends NodeImpl {
|
|
11674
|
+
static create() {
|
|
11675
|
+
return {
|
|
11676
|
+
type: "codeNew",
|
|
11677
|
+
title: "Code",
|
|
11678
|
+
id: (0, import_non_secure12.nanoid)(),
|
|
11679
|
+
visualData: {
|
|
11680
|
+
x: 0,
|
|
11681
|
+
y: 0,
|
|
11682
|
+
width: 260
|
|
11683
|
+
},
|
|
11684
|
+
data: {
|
|
11685
|
+
code: DEFAULT_CODE_NEW,
|
|
11686
|
+
allowFetch: false,
|
|
11687
|
+
allowRequire: false,
|
|
11688
|
+
allowRivet: false,
|
|
11689
|
+
allowProcess: false,
|
|
11690
|
+
allowConsole: false
|
|
11691
|
+
}
|
|
11692
|
+
};
|
|
11693
|
+
}
|
|
11694
|
+
getInputDefinitions() {
|
|
11695
|
+
return getJsValueInterpolationInputDefinitions(this.data.code);
|
|
11696
|
+
}
|
|
11697
|
+
getOutputDefinitions() {
|
|
11698
|
+
return [
|
|
11699
|
+
{
|
|
11700
|
+
id: CODE_NEW_OUTPUT_PORT_ID,
|
|
11701
|
+
title: "Output",
|
|
11702
|
+
dataType: "any"
|
|
11703
|
+
}
|
|
11704
|
+
];
|
|
11705
|
+
}
|
|
11706
|
+
getEditors() {
|
|
11707
|
+
return [
|
|
11708
|
+
{
|
|
11709
|
+
type: "code",
|
|
11710
|
+
label: "Code",
|
|
11711
|
+
helperMessage: "Use {{var}} to create input ports. Interpolated variables evaluate as the connected values.",
|
|
11712
|
+
dataKey: "code",
|
|
11713
|
+
language: "javascript",
|
|
11714
|
+
interpolationSyntax: "js-value",
|
|
11715
|
+
enableFolding: true
|
|
11716
|
+
},
|
|
11717
|
+
{
|
|
11718
|
+
type: "group",
|
|
11719
|
+
label: "Runtime permissions",
|
|
11720
|
+
defaultOpen: true,
|
|
11721
|
+
editors: [
|
|
11722
|
+
{
|
|
11723
|
+
type: "toggle",
|
|
11724
|
+
label: 'Allow "fetch"',
|
|
11725
|
+
dataKey: "allowFetch"
|
|
11726
|
+
},
|
|
11727
|
+
{
|
|
11728
|
+
type: "toggle",
|
|
11729
|
+
label: 'Allow "Rivet"',
|
|
11730
|
+
dataKey: "allowRivet"
|
|
11731
|
+
},
|
|
11732
|
+
{
|
|
11733
|
+
type: "toggle",
|
|
11734
|
+
label: 'Allow "console"',
|
|
11735
|
+
dataKey: "allowConsole"
|
|
11736
|
+
},
|
|
11737
|
+
{
|
|
11738
|
+
type: "toggle",
|
|
11739
|
+
label: 'Allow "require"',
|
|
11740
|
+
dataKey: "allowRequire",
|
|
11741
|
+
helperMessage: "Only available with the Node executor"
|
|
11742
|
+
},
|
|
11743
|
+
{
|
|
11744
|
+
type: "toggle",
|
|
11745
|
+
label: 'Allow "process"',
|
|
11746
|
+
dataKey: "allowProcess",
|
|
11747
|
+
helperMessage: "Only available with the Node executor"
|
|
11748
|
+
}
|
|
11749
|
+
]
|
|
11750
|
+
}
|
|
11751
|
+
];
|
|
11752
|
+
}
|
|
11753
|
+
getBody() {
|
|
11754
|
+
return {
|
|
11755
|
+
type: "colorized",
|
|
11756
|
+
text: buildCodeNewPreview(this.data.code),
|
|
11757
|
+
language: "javascript",
|
|
11758
|
+
fontSize: 12,
|
|
11759
|
+
fontFamily: "monospace"
|
|
11760
|
+
};
|
|
11761
|
+
}
|
|
11762
|
+
static getUIData() {
|
|
11763
|
+
return {
|
|
11764
|
+
infoBoxBody: import_ts_dedent10.dedent`
|
|
11765
|
+
Runs JavaScript code that can use interpolation-created input ports and emits the returned value as the node output.
|
|
11766
|
+
`,
|
|
11767
|
+
infoBoxTitle: "Code Node",
|
|
11768
|
+
contextMenuTitle: "Code",
|
|
11769
|
+
group: ["Advanced"]
|
|
11770
|
+
};
|
|
11771
|
+
}
|
|
11772
|
+
async process(inputs, context) {
|
|
11773
|
+
const sourceUrl = buildCodeNodeSourceUrl(this.chartNode.id, context.processId);
|
|
11774
|
+
const interpolationContext = getJsValueInterpolationRuntimeContext(this.data.code, CODE_NEW_INPUTS_IDENTIFIER);
|
|
11775
|
+
const { inputNames, inputsIdentifier } = interpolationContext;
|
|
11776
|
+
const { source, userCodeLineOffset } = buildCodeNewWrapper(this.data.code, interpolationContext);
|
|
11777
|
+
try {
|
|
11778
|
+
const outputs = await context.codeRunner.runCode(
|
|
11779
|
+
appendCodeNodeSourceUrl(source, sourceUrl),
|
|
11780
|
+
inputs,
|
|
11781
|
+
{
|
|
11782
|
+
includeFetch: this.data.allowFetch ?? false,
|
|
11783
|
+
includeRequire: this.data.allowRequire ?? false,
|
|
11784
|
+
includeRivet: this.data.allowRivet ?? false,
|
|
11785
|
+
includeProcess: this.data.allowProcess ?? false,
|
|
11786
|
+
includeConsole: this.data.allowConsole ?? false
|
|
11787
|
+
},
|
|
11788
|
+
context.graphInputNodeValues,
|
|
11789
|
+
context.contextValues
|
|
11790
|
+
);
|
|
11791
|
+
return validateCodeNewRunnerOutputs(outputs);
|
|
11792
|
+
} catch (error) {
|
|
11793
|
+
const enrichedError = await enrichCodeNodeErrorWithLocation({
|
|
11794
|
+
code: this.data.code,
|
|
11795
|
+
diagnosticCode: source,
|
|
11796
|
+
error,
|
|
11797
|
+
locationLabel: "Code node",
|
|
11798
|
+
sourceUrl,
|
|
11799
|
+
userCodeLineOffset
|
|
11800
|
+
});
|
|
11801
|
+
throw sanitizeCodeNewError(enrichedError, inputNames, inputsIdentifier);
|
|
11802
|
+
}
|
|
11803
|
+
}
|
|
11804
|
+
};
|
|
11805
|
+
var codeNewNode = nodeDefinition(CodeNewNodeImpl, "Code");
|
|
11500
11806
|
|
|
11501
11807
|
// src/model/nodes/ExpressionNode.ts
|
|
11808
|
+
var import_non_secure13 = require("nanoid/non-secure");
|
|
11809
|
+
var import_ts_dedent11 = require("ts-dedent");
|
|
11502
11810
|
var DEFAULT_EXPRESSION = '{{a}} == "123" ? {{b}} : {{c}}';
|
|
11503
|
-
var
|
|
11811
|
+
var MAX_BODY_PREVIEW_LINES3 = 15;
|
|
11504
11812
|
var EXPRESSION_INPUTS_IDENTIFIER = "__expressionInputs";
|
|
11505
11813
|
var EXPRESSION_INPUT_CLONE_CACHE_IDENTIFIER = "expressionInputCloneCache";
|
|
11506
11814
|
var EXPRESSION_OUTPUT_PORT_ID = "output";
|
|
11507
11815
|
function buildExpressionPreview(expression) {
|
|
11508
|
-
return expression
|
|
11509
|
-
}
|
|
11510
|
-
function getExpressionInputNames(expression) {
|
|
11511
|
-
return getJsValueInterpolationInputNames(expression);
|
|
11816
|
+
return buildJsValuePreview(expression, MAX_BODY_PREVIEW_LINES3);
|
|
11512
11817
|
}
|
|
11513
|
-
function buildExpressionRuntimeSource(expression) {
|
|
11514
|
-
return buildJsValueInterpolatedSource(expression,
|
|
11818
|
+
function buildExpressionRuntimeSource(expression, inputsIdentifier) {
|
|
11819
|
+
return buildJsValueInterpolatedSource(expression, inputsIdentifier);
|
|
11515
11820
|
}
|
|
11516
|
-
function buildExpressionInputsInitializer(inputNames) {
|
|
11517
|
-
return
|
|
11518
|
-
|
|
11519
|
-
const ${EXPRESSION_INPUTS_IDENTIFIER} = Object.create(null);
|
|
11520
|
-
const ${EXPRESSION_INPUT_CLONE_CACHE_IDENTIFIER} = new WeakMap();
|
|
11521
|
-
${buildClonedInputValueAssignments(
|
|
11821
|
+
function buildExpressionInputsInitializer(inputNames, inputsIdentifier) {
|
|
11822
|
+
return buildJsValueInputsInitializer({
|
|
11823
|
+
cacheIdentifier: EXPRESSION_INPUT_CLONE_CACHE_IDENTIFIER,
|
|
11522
11824
|
inputNames,
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
)}
|
|
11526
|
-
`;
|
|
11825
|
+
inputsIdentifier
|
|
11826
|
+
});
|
|
11527
11827
|
}
|
|
11528
11828
|
function interpolateExpressionSource(expression, inputs) {
|
|
11529
11829
|
return interpolateJsValuePreviewSource(expression, inputs);
|
|
11530
11830
|
}
|
|
11531
|
-
function
|
|
11532
|
-
return
|
|
11533
|
-
}
|
|
11534
|
-
function sanitizeExpressionError(error, inputNames) {
|
|
11535
|
-
const expressionError = getError(error);
|
|
11536
|
-
expressionError.message = sanitizeGeneratedExpressionText(expressionError.message, inputNames) ?? expressionError.message;
|
|
11537
|
-
expressionError.stack = sanitizeGeneratedExpressionText(expressionError.stack, inputNames);
|
|
11538
|
-
return expressionError;
|
|
11831
|
+
function sanitizeExpressionError(error, inputNames, inputsIdentifier) {
|
|
11832
|
+
return sanitizeGeneratedJsValueError(error, inputNames, inputsIdentifier, "expression input");
|
|
11539
11833
|
}
|
|
11540
|
-
function buildExpressionWrapper(expression) {
|
|
11541
|
-
const inputNames =
|
|
11542
|
-
const expressionSource = buildExpressionRuntimeSource(expression);
|
|
11543
|
-
return
|
|
11544
|
-
${buildExpressionInputsInitializer(inputNames)}
|
|
11834
|
+
function buildExpressionWrapper(expression, interpolationContext) {
|
|
11835
|
+
const { inputNames, inputsIdentifier } = interpolationContext;
|
|
11836
|
+
const expressionSource = buildExpressionRuntimeSource(expression, inputsIdentifier);
|
|
11837
|
+
return import_ts_dedent11.dedent`
|
|
11838
|
+
${buildExpressionInputsInitializer(inputNames, inputsIdentifier)}
|
|
11545
11839
|
|
|
11546
11840
|
return {
|
|
11547
11841
|
output: {
|
|
@@ -11556,7 +11850,7 @@ var ExpressionNodeImpl = class extends NodeImpl {
|
|
|
11556
11850
|
const chartNode = {
|
|
11557
11851
|
type: "expression",
|
|
11558
11852
|
title: "Expression",
|
|
11559
|
-
id: (0,
|
|
11853
|
+
id: (0, import_non_secure13.nanoid)(),
|
|
11560
11854
|
visualData: {
|
|
11561
11855
|
x: 0,
|
|
11562
11856
|
y: 0,
|
|
@@ -11569,13 +11863,7 @@ var ExpressionNodeImpl = class extends NodeImpl {
|
|
|
11569
11863
|
return chartNode;
|
|
11570
11864
|
}
|
|
11571
11865
|
getInputDefinitions() {
|
|
11572
|
-
return
|
|
11573
|
-
return createInterpolationInputDefinition({
|
|
11574
|
-
interpolationName: inputName,
|
|
11575
|
-
dataType: "any",
|
|
11576
|
-
required: false
|
|
11577
|
-
});
|
|
11578
|
-
});
|
|
11866
|
+
return getJsValueInterpolationInputDefinitions(this.data.expression);
|
|
11579
11867
|
}
|
|
11580
11868
|
getOutputDefinitions() {
|
|
11581
11869
|
return [
|
|
@@ -11594,6 +11882,7 @@ var ExpressionNodeImpl = class extends NodeImpl {
|
|
|
11594
11882
|
helperMessage: "Use {{var}} to create input ports. Interpolated variables evaluate as the connected values.",
|
|
11595
11883
|
dataKey: "expression",
|
|
11596
11884
|
language: "javascript",
|
|
11885
|
+
interpolationSyntax: "js-value",
|
|
11597
11886
|
enableFolding: true
|
|
11598
11887
|
}
|
|
11599
11888
|
];
|
|
@@ -11609,7 +11898,7 @@ var ExpressionNodeImpl = class extends NodeImpl {
|
|
|
11609
11898
|
}
|
|
11610
11899
|
static getUIData() {
|
|
11611
11900
|
return {
|
|
11612
|
-
infoBoxBody:
|
|
11901
|
+
infoBoxBody: import_ts_dedent11.dedent`
|
|
11613
11902
|
Evaluates a single JavaScript expression and returns the resulting value.
|
|
11614
11903
|
|
|
11615
11904
|
<code>{{interpolation}}</code> creates dynamic input ports. Interpolated variables evaluate as connected values, so arrays, objects, strings, numbers, and booleans can be used directly.
|
|
@@ -11620,10 +11909,15 @@ var ExpressionNodeImpl = class extends NodeImpl {
|
|
|
11620
11909
|
};
|
|
11621
11910
|
}
|
|
11622
11911
|
async process(inputs, context) {
|
|
11623
|
-
const
|
|
11912
|
+
const interpolationContext = getJsValueInterpolationRuntimeContext(
|
|
11913
|
+
this.data.expression,
|
|
11914
|
+
EXPRESSION_INPUTS_IDENTIFIER
|
|
11915
|
+
);
|
|
11916
|
+
const { inputNames, inputsIdentifier } = interpolationContext;
|
|
11917
|
+
const source = buildExpressionWrapper(this.data.expression, interpolationContext);
|
|
11624
11918
|
try {
|
|
11625
11919
|
return await context.codeRunner.runCode(
|
|
11626
|
-
|
|
11920
|
+
source,
|
|
11627
11921
|
inputs,
|
|
11628
11922
|
{
|
|
11629
11923
|
includeFetch: false,
|
|
@@ -11636,21 +11930,21 @@ var ExpressionNodeImpl = class extends NodeImpl {
|
|
|
11636
11930
|
context.contextValues
|
|
11637
11931
|
);
|
|
11638
11932
|
} catch (error) {
|
|
11639
|
-
throw sanitizeExpressionError(error, inputNames);
|
|
11933
|
+
throw sanitizeExpressionError(error, inputNames, inputsIdentifier);
|
|
11640
11934
|
}
|
|
11641
11935
|
}
|
|
11642
11936
|
};
|
|
11643
11937
|
var expressionNode = nodeDefinition(ExpressionNodeImpl, "Expression");
|
|
11644
11938
|
|
|
11645
11939
|
// src/model/nodes/MatchNode.ts
|
|
11646
|
-
var
|
|
11647
|
-
var
|
|
11940
|
+
var import_non_secure14 = require("nanoid/non-secure");
|
|
11941
|
+
var import_ts_dedent12 = require("ts-dedent");
|
|
11648
11942
|
var MatchNodeImpl = class extends NodeImpl {
|
|
11649
11943
|
static create() {
|
|
11650
11944
|
const chartNode = {
|
|
11651
11945
|
type: "match",
|
|
11652
11946
|
title: "Match",
|
|
11653
|
-
id: (0,
|
|
11947
|
+
id: (0, import_non_secure14.nanoid)(),
|
|
11654
11948
|
visualData: {
|
|
11655
11949
|
x: 0,
|
|
11656
11950
|
y: 0,
|
|
@@ -11658,7 +11952,7 @@ var MatchNodeImpl = class extends NodeImpl {
|
|
|
11658
11952
|
},
|
|
11659
11953
|
data: {
|
|
11660
11954
|
cases: ["YES", "NO"],
|
|
11661
|
-
casePortIds: [(0,
|
|
11955
|
+
casePortIds: [(0, import_non_secure14.nanoid)(), (0, import_non_secure14.nanoid)()]
|
|
11662
11956
|
}
|
|
11663
11957
|
};
|
|
11664
11958
|
return chartNode;
|
|
@@ -11706,7 +12000,7 @@ var MatchNodeImpl = class extends NodeImpl {
|
|
|
11706
12000
|
return outputs;
|
|
11707
12001
|
}
|
|
11708
12002
|
getBody() {
|
|
11709
|
-
return
|
|
12003
|
+
return import_ts_dedent12.dedent`
|
|
11710
12004
|
${this.data.exclusive ? "First Matching Case" : "All Matching Cases"}
|
|
11711
12005
|
${this.data.cases.length} Cases
|
|
11712
12006
|
`;
|
|
@@ -11741,7 +12035,7 @@ var MatchNodeImpl = class extends NodeImpl {
|
|
|
11741
12035
|
}
|
|
11742
12036
|
static getUIData() {
|
|
11743
12037
|
return {
|
|
11744
|
-
infoBoxBody:
|
|
12038
|
+
infoBoxBody: import_ts_dedent12.dedent`
|
|
11745
12039
|
Any number of regular expressions can be configured, each corresponding to an output of the node. The output port of the first matching regex will be ran, and all other output ports will not be ran.
|
|
11746
12040
|
`,
|
|
11747
12041
|
infoBoxTitle: "Match Node",
|
|
@@ -11796,14 +12090,14 @@ var MatchNodeImpl = class extends NodeImpl {
|
|
|
11796
12090
|
var matchNode = nodeDefinition(MatchNodeImpl, "Match");
|
|
11797
12091
|
|
|
11798
12092
|
// src/model/nodes/IfNode.ts
|
|
11799
|
-
var
|
|
11800
|
-
var
|
|
12093
|
+
var import_non_secure15 = require("nanoid/non-secure");
|
|
12094
|
+
var import_ts_dedent13 = require("ts-dedent");
|
|
11801
12095
|
var IfNodeImpl = class extends NodeImpl {
|
|
11802
12096
|
static create = () => {
|
|
11803
12097
|
const chartNode = {
|
|
11804
12098
|
type: "if",
|
|
11805
12099
|
title: "If",
|
|
11806
|
-
id: (0,
|
|
12100
|
+
id: (0, import_non_secure15.nanoid)(),
|
|
11807
12101
|
data: {
|
|
11808
12102
|
// Legacy behavior is false
|
|
11809
12103
|
unconnectedControlFlowExcluded: true
|
|
@@ -11850,7 +12144,7 @@ var IfNodeImpl = class extends NodeImpl {
|
|
|
11850
12144
|
}
|
|
11851
12145
|
static getUIData() {
|
|
11852
12146
|
return {
|
|
11853
|
-
infoBoxBody:
|
|
12147
|
+
infoBoxBody: import_ts_dedent13.dedent`
|
|
11854
12148
|
Takes in a condition and a value. If the condition is truthy, the value is passed through the True port, and the False port is not ran.
|
|
11855
12149
|
If the condition is falsy, the value is passed through the False port, and the True port is not ran.
|
|
11856
12150
|
`,
|
|
@@ -11920,8 +12214,8 @@ var IfNodeImpl = class extends NodeImpl {
|
|
|
11920
12214
|
var ifNode = nodeDefinition(IfNodeImpl, "If");
|
|
11921
12215
|
|
|
11922
12216
|
// src/model/nodes/ReadDirectoryNode.ts
|
|
11923
|
-
var
|
|
11924
|
-
var
|
|
12217
|
+
var import_non_secure16 = require("nanoid/non-secure");
|
|
12218
|
+
var import_ts_dedent14 = require("ts-dedent");
|
|
11925
12219
|
|
|
11926
12220
|
// src/utils/paths.ts
|
|
11927
12221
|
function createTreeFromPaths(paths, rootPath) {
|
|
@@ -11996,7 +12290,7 @@ function createTreeFromPaths(paths, rootPath) {
|
|
|
11996
12290
|
var ReadDirectoryNodeImpl = class extends NodeImpl {
|
|
11997
12291
|
static create() {
|
|
11998
12292
|
return {
|
|
11999
|
-
id: (0,
|
|
12293
|
+
id: (0, import_non_secure16.nanoid)(),
|
|
12000
12294
|
type: "readDirectory",
|
|
12001
12295
|
title: "Read Directory",
|
|
12002
12296
|
visualData: { x: 0, y: 0 },
|
|
@@ -12085,7 +12379,7 @@ var ReadDirectoryNodeImpl = class extends NodeImpl {
|
|
|
12085
12379
|
];
|
|
12086
12380
|
}
|
|
12087
12381
|
getBody() {
|
|
12088
|
-
return
|
|
12382
|
+
return import_ts_dedent14.dedent`
|
|
12089
12383
|
Path: ${this.data.usePathInput ? "(Input)" : this.data.path}
|
|
12090
12384
|
Recursive: ${this.data.useRecursiveInput ? "(Input)" : this.data.recursive}
|
|
12091
12385
|
Include Directories: ${this.data.useIncludeDirectoriesInput ? "(Input)" : this.data.includeDirectories}
|
|
@@ -12095,7 +12389,7 @@ var ReadDirectoryNodeImpl = class extends NodeImpl {
|
|
|
12095
12389
|
}
|
|
12096
12390
|
static getUIData() {
|
|
12097
12391
|
return {
|
|
12098
|
-
infoBoxBody:
|
|
12392
|
+
infoBoxBody: import_ts_dedent14.dedent`
|
|
12099
12393
|
Reads the contents of the specified directory and outputs:
|
|
12100
12394
|
1. An array of filenames
|
|
12101
12395
|
2. The root path of the search
|
|
@@ -12151,12 +12445,12 @@ var ReadDirectoryNodeImpl = class extends NodeImpl {
|
|
|
12151
12445
|
var readDirectoryNode = nodeDefinition(ReadDirectoryNodeImpl, "Read Directory");
|
|
12152
12446
|
|
|
12153
12447
|
// src/model/nodes/ReadFileNode.ts
|
|
12154
|
-
var
|
|
12155
|
-
var
|
|
12448
|
+
var import_non_secure17 = require("nanoid/non-secure");
|
|
12449
|
+
var import_ts_dedent15 = require("ts-dedent");
|
|
12156
12450
|
var ReadFileNodeImpl = class extends NodeImpl {
|
|
12157
12451
|
static create() {
|
|
12158
12452
|
return {
|
|
12159
|
-
id: (0,
|
|
12453
|
+
id: (0, import_non_secure17.nanoid)(),
|
|
12160
12454
|
type: "readFile",
|
|
12161
12455
|
title: "Read File",
|
|
12162
12456
|
visualData: { x: 0, y: 0, width: 250 },
|
|
@@ -12191,7 +12485,7 @@ var ReadFileNodeImpl = class extends NodeImpl {
|
|
|
12191
12485
|
}
|
|
12192
12486
|
static getUIData() {
|
|
12193
12487
|
return {
|
|
12194
|
-
infoBoxBody:
|
|
12488
|
+
infoBoxBody: import_ts_dedent15.dedent`
|
|
12195
12489
|
Reads the contents of the specified file and outputs it as a string.
|
|
12196
12490
|
`,
|
|
12197
12491
|
infoBoxTitle: "Read File Node",
|
|
@@ -12220,7 +12514,7 @@ var ReadFileNodeImpl = class extends NodeImpl {
|
|
|
12220
12514
|
];
|
|
12221
12515
|
}
|
|
12222
12516
|
getBody() {
|
|
12223
|
-
return
|
|
12517
|
+
return import_ts_dedent15.dedent`
|
|
12224
12518
|
${this.data.asBinary ? "Read as Binary" : "Read as Text"}
|
|
12225
12519
|
${this.data.usePathInput ? "" : `Path: ${this.data.path}`}
|
|
12226
12520
|
`;
|
|
@@ -12258,14 +12552,14 @@ var ReadFileNodeImpl = class extends NodeImpl {
|
|
|
12258
12552
|
var readFileNode = nodeDefinition(ReadFileNodeImpl, "Read File");
|
|
12259
12553
|
|
|
12260
12554
|
// src/model/nodes/IfElseNode.ts
|
|
12261
|
-
var
|
|
12262
|
-
var
|
|
12555
|
+
var import_non_secure18 = require("nanoid/non-secure");
|
|
12556
|
+
var import_ts_dedent16 = require("ts-dedent");
|
|
12263
12557
|
var IfElseNodeImpl = class extends NodeImpl {
|
|
12264
12558
|
static create = () => {
|
|
12265
12559
|
const chartNode = {
|
|
12266
12560
|
type: "ifElse",
|
|
12267
12561
|
title: "If/Else",
|
|
12268
|
-
id: (0,
|
|
12562
|
+
id: (0, import_non_secure18.nanoid)(),
|
|
12269
12563
|
data: {
|
|
12270
12564
|
// Legacy behavior is false
|
|
12271
12565
|
unconnectedControlFlowExcluded: true
|
|
@@ -12312,7 +12606,7 @@ var IfElseNodeImpl = class extends NodeImpl {
|
|
|
12312
12606
|
}
|
|
12313
12607
|
static getUIData() {
|
|
12314
12608
|
return {
|
|
12315
|
-
infoBoxBody:
|
|
12609
|
+
infoBoxBody: import_ts_dedent16.dedent`
|
|
12316
12610
|
Takes in three inputs: a condition, a true value, and a false value. If the condition is truthy, the true value is passed through the output port. If the condition is not truthy, the false value is passed through the output port.
|
|
12317
12611
|
|
|
12318
12612
|
This node can "consume" a \`Not Ran\` to continue a graph from that point.
|
|
@@ -12391,14 +12685,14 @@ var IfElseNodeImpl = class extends NodeImpl {
|
|
|
12391
12685
|
var ifElseNode = nodeDefinition(IfElseNodeImpl, "If/Else");
|
|
12392
12686
|
|
|
12393
12687
|
// src/model/nodes/ChunkNode.ts
|
|
12394
|
-
var
|
|
12395
|
-
var
|
|
12688
|
+
var import_non_secure19 = require("nanoid/non-secure");
|
|
12689
|
+
var import_ts_dedent17 = require("ts-dedent");
|
|
12396
12690
|
var ChunkNodeImpl = class extends NodeImpl {
|
|
12397
12691
|
static create() {
|
|
12398
12692
|
const chartNode = {
|
|
12399
12693
|
type: "chunk",
|
|
12400
12694
|
title: "Chunk",
|
|
12401
|
-
id: (0,
|
|
12695
|
+
id: (0, import_non_secure19.nanoid)(),
|
|
12402
12696
|
visualData: {
|
|
12403
12697
|
x: 0,
|
|
12404
12698
|
y: 0,
|
|
@@ -12487,7 +12781,7 @@ var ChunkNodeImpl = class extends NodeImpl {
|
|
|
12487
12781
|
];
|
|
12488
12782
|
}
|
|
12489
12783
|
getBody() {
|
|
12490
|
-
return
|
|
12784
|
+
return import_ts_dedent17.dedent`
|
|
12491
12785
|
Model: ${this.data.model}
|
|
12492
12786
|
Token Count: ${this.data.numTokensPerChunk.toLocaleString()}
|
|
12493
12787
|
${this.data.overlap ? `Overlap: ${this.data.overlap}%` : ""}
|
|
@@ -12495,7 +12789,7 @@ var ChunkNodeImpl = class extends NodeImpl {
|
|
|
12495
12789
|
}
|
|
12496
12790
|
static getUIData() {
|
|
12497
12791
|
return {
|
|
12498
|
-
infoBoxBody:
|
|
12792
|
+
infoBoxBody: import_ts_dedent17.dedent`
|
|
12499
12793
|
Splits the input text into an array of chunks based on an approximate GPT token count per chunk.
|
|
12500
12794
|
|
|
12501
12795
|
The "overlap" setting allows you to partially overlap the chunks for redundancy.
|
|
@@ -12561,14 +12855,14 @@ async function chunkStringByTokenCount(tokenizer, tokenizerInfo, input, targetTo
|
|
|
12561
12855
|
}
|
|
12562
12856
|
|
|
12563
12857
|
// src/model/nodes/GraphInputNode.ts
|
|
12564
|
-
var
|
|
12565
|
-
var
|
|
12858
|
+
var import_non_secure20 = require("nanoid/non-secure");
|
|
12859
|
+
var import_ts_dedent18 = require("ts-dedent");
|
|
12566
12860
|
var GraphInputNodeImpl = class extends NodeImpl {
|
|
12567
12861
|
static create() {
|
|
12568
12862
|
const chartNode = {
|
|
12569
12863
|
type: "graphInput",
|
|
12570
12864
|
title: "Graph Input",
|
|
12571
|
-
id: (0,
|
|
12865
|
+
id: (0, import_non_secure20.nanoid)(),
|
|
12572
12866
|
visualData: {
|
|
12573
12867
|
x: 0,
|
|
12574
12868
|
y: 0,
|
|
@@ -12643,7 +12937,7 @@ var GraphInputNodeImpl = class extends NodeImpl {
|
|
|
12643
12937
|
];
|
|
12644
12938
|
}
|
|
12645
12939
|
getBody() {
|
|
12646
|
-
return
|
|
12940
|
+
return import_ts_dedent18.dedent`
|
|
12647
12941
|
${this.data.id}
|
|
12648
12942
|
Type: ${this.data.dataType}
|
|
12649
12943
|
${this.data.defaultValue == null ? "" : `Default: ${this.data.defaultValue}`}
|
|
@@ -12651,7 +12945,7 @@ var GraphInputNodeImpl = class extends NodeImpl {
|
|
|
12651
12945
|
}
|
|
12652
12946
|
static getUIData() {
|
|
12653
12947
|
return {
|
|
12654
|
-
infoBoxBody:
|
|
12948
|
+
infoBoxBody: import_ts_dedent18.dedent`
|
|
12655
12949
|
Defines an input for the graph which can be passed in when the graph is called, or defines one of the input ports when the graph is a subgraph.
|
|
12656
12950
|
`,
|
|
12657
12951
|
infoBoxTitle: "Graph Input Node",
|
|
@@ -12681,14 +12975,14 @@ var GraphInputNodeImpl = class extends NodeImpl {
|
|
|
12681
12975
|
var graphInputNode = nodeDefinition(GraphInputNodeImpl, "Graph Input");
|
|
12682
12976
|
|
|
12683
12977
|
// src/model/nodes/GraphOutputNode.ts
|
|
12684
|
-
var
|
|
12685
|
-
var
|
|
12978
|
+
var import_non_secure21 = require("nanoid/non-secure");
|
|
12979
|
+
var import_ts_dedent19 = require("ts-dedent");
|
|
12686
12980
|
var GraphOutputNodeImpl = class extends NodeImpl {
|
|
12687
12981
|
static create() {
|
|
12688
12982
|
const chartNode = {
|
|
12689
12983
|
type: "graphOutput",
|
|
12690
12984
|
title: "Graph Output",
|
|
12691
|
-
id: (0,
|
|
12985
|
+
id: (0, import_non_secure21.nanoid)(),
|
|
12692
12986
|
visualData: {
|
|
12693
12987
|
x: 0,
|
|
12694
12988
|
y: 0,
|
|
@@ -12734,14 +13028,14 @@ var GraphOutputNodeImpl = class extends NodeImpl {
|
|
|
12734
13028
|
];
|
|
12735
13029
|
}
|
|
12736
13030
|
getBody() {
|
|
12737
|
-
return
|
|
13031
|
+
return import_ts_dedent19.dedent`
|
|
12738
13032
|
${this.data.id}
|
|
12739
13033
|
Type: ${this.data.dataType}
|
|
12740
13034
|
`;
|
|
12741
13035
|
}
|
|
12742
13036
|
static getUIData() {
|
|
12743
13037
|
return {
|
|
12744
|
-
infoBoxBody:
|
|
13038
|
+
infoBoxBody: import_ts_dedent19.dedent`
|
|
12745
13039
|
Each instance of this node represents an individual output of the graph. The value passed into this node becomes part of the overall output of the graph.
|
|
12746
13040
|
`,
|
|
12747
13041
|
infoBoxTitle: "Graph Output Node",
|
|
@@ -12777,14 +13071,14 @@ var GraphOutputNodeImpl = class extends NodeImpl {
|
|
|
12777
13071
|
var graphOutputNode = nodeDefinition(GraphOutputNodeImpl, "Graph Output");
|
|
12778
13072
|
|
|
12779
13073
|
// src/model/nodes/SubGraphNode.ts
|
|
12780
|
-
var
|
|
12781
|
-
var
|
|
13074
|
+
var import_non_secure22 = require("nanoid/non-secure");
|
|
13075
|
+
var import_ts_dedent20 = require("ts-dedent");
|
|
12782
13076
|
var SubGraphNodeImpl = class extends NodeImpl {
|
|
12783
13077
|
static create() {
|
|
12784
13078
|
const chartNode = {
|
|
12785
13079
|
type: "subGraph",
|
|
12786
13080
|
title: "Subgraph",
|
|
12787
|
-
id: (0,
|
|
13081
|
+
id: (0, import_non_secure22.nanoid)(),
|
|
12788
13082
|
visualData: {
|
|
12789
13083
|
x: 0,
|
|
12790
13084
|
y: 0,
|
|
@@ -12876,7 +13170,7 @@ var SubGraphNodeImpl = class extends NodeImpl {
|
|
|
12876
13170
|
}
|
|
12877
13171
|
static getUIData() {
|
|
12878
13172
|
return {
|
|
12879
|
-
infoBoxBody:
|
|
13173
|
+
infoBoxBody: import_ts_dedent20.dedent`
|
|
12880
13174
|
Executes another graph. Inputs and outputs are defined by Graph Input and Graph Output nodes within the subgraph.
|
|
12881
13175
|
`,
|
|
12882
13176
|
infoBoxTitle: "Subgraph Node",
|
|
@@ -12958,15 +13252,15 @@ var SubGraphNodeImpl = class extends NodeImpl {
|
|
|
12958
13252
|
var subGraphNode = nodeDefinition(SubGraphNodeImpl, "Subgraph");
|
|
12959
13253
|
|
|
12960
13254
|
// src/model/nodes/ArrayNode.ts
|
|
12961
|
-
var
|
|
13255
|
+
var import_non_secure23 = require("nanoid/non-secure");
|
|
12962
13256
|
var import_lodash_es9 = require("lodash");
|
|
12963
|
-
var
|
|
13257
|
+
var import_ts_dedent21 = require("ts-dedent");
|
|
12964
13258
|
var ArrayNodeImpl = class extends NodeImpl {
|
|
12965
13259
|
static create() {
|
|
12966
13260
|
const chartNode = {
|
|
12967
13261
|
type: "array",
|
|
12968
13262
|
title: "Array",
|
|
12969
|
-
id: (0,
|
|
13263
|
+
id: (0, import_non_secure23.nanoid)(),
|
|
12970
13264
|
visualData: {
|
|
12971
13265
|
x: 0,
|
|
12972
13266
|
y: 0,
|
|
@@ -13040,7 +13334,7 @@ var ArrayNodeImpl = class extends NodeImpl {
|
|
|
13040
13334
|
}
|
|
13041
13335
|
static getUIData() {
|
|
13042
13336
|
return {
|
|
13043
|
-
infoBoxBody:
|
|
13337
|
+
infoBoxBody: import_ts_dedent21.dedent`
|
|
13044
13338
|
Creates an array from the input values. By default, flattens any arrays which are inputs into a single array. Can be configured to keep the arrays separate, or deeply flatten arrays.
|
|
13045
13339
|
|
|
13046
13340
|
Useful for both creating and merging arrays.
|
|
@@ -13053,7 +13347,7 @@ var ArrayNodeImpl = class extends NodeImpl {
|
|
|
13053
13347
|
};
|
|
13054
13348
|
}
|
|
13055
13349
|
getBody() {
|
|
13056
|
-
return
|
|
13350
|
+
return import_ts_dedent21.dedent`
|
|
13057
13351
|
${this.data.flatten ? this.data.flattenDeep ? "Flatten (Deep)" : "Flatten" : "No Flatten"}
|
|
13058
13352
|
`;
|
|
13059
13353
|
}
|
|
@@ -13097,14 +13391,14 @@ var ArrayNodeImpl = class extends NodeImpl {
|
|
|
13097
13391
|
var arrayNode = nodeDefinition(ArrayNodeImpl, "Array");
|
|
13098
13392
|
|
|
13099
13393
|
// src/model/nodes/ExtractJsonNode.ts
|
|
13100
|
-
var
|
|
13101
|
-
var
|
|
13394
|
+
var import_non_secure24 = require("nanoid/non-secure");
|
|
13395
|
+
var import_ts_dedent22 = require("ts-dedent");
|
|
13102
13396
|
var ExtractJsonNodeImpl = class extends NodeImpl {
|
|
13103
13397
|
static create() {
|
|
13104
13398
|
const chartNode = {
|
|
13105
13399
|
type: "extractJson",
|
|
13106
13400
|
title: "Extract JSON",
|
|
13107
|
-
id: (0,
|
|
13401
|
+
id: (0, import_non_secure24.nanoid)(),
|
|
13108
13402
|
visualData: {
|
|
13109
13403
|
x: 0,
|
|
13110
13404
|
y: 0,
|
|
@@ -13141,7 +13435,7 @@ var ExtractJsonNodeImpl = class extends NodeImpl {
|
|
|
13141
13435
|
}
|
|
13142
13436
|
static getUIData() {
|
|
13143
13437
|
return {
|
|
13144
|
-
infoBoxBody:
|
|
13438
|
+
infoBoxBody: import_ts_dedent22.dedent`
|
|
13145
13439
|
Finds and parses the first JSON object in input text, or passes through an already-structured input object.
|
|
13146
13440
|
|
|
13147
13441
|
Outputs the parsed or passed-through object.
|
|
@@ -13221,15 +13515,15 @@ function createMatchedOutput(value) {
|
|
|
13221
13515
|
}
|
|
13222
13516
|
|
|
13223
13517
|
// src/model/nodes/AssemblePromptNode.ts
|
|
13224
|
-
var
|
|
13518
|
+
var import_non_secure25 = require("nanoid/non-secure");
|
|
13225
13519
|
var import_lodash_es10 = require("lodash");
|
|
13226
|
-
var
|
|
13520
|
+
var import_ts_dedent23 = require("ts-dedent");
|
|
13227
13521
|
var AssemblePromptNodeImpl = class extends NodeImpl {
|
|
13228
13522
|
static create() {
|
|
13229
13523
|
const chartNode = {
|
|
13230
13524
|
type: "assemblePrompt",
|
|
13231
13525
|
title: "Assemble Prompt",
|
|
13232
|
-
id: (0,
|
|
13526
|
+
id: (0, import_non_secure25.nanoid)(),
|
|
13233
13527
|
visualData: {
|
|
13234
13528
|
x: 0,
|
|
13235
13529
|
y: 0,
|
|
@@ -13295,7 +13589,7 @@ var AssemblePromptNodeImpl = class extends NodeImpl {
|
|
|
13295
13589
|
}
|
|
13296
13590
|
static getUIData() {
|
|
13297
13591
|
return {
|
|
13298
|
-
infoBoxBody:
|
|
13592
|
+
infoBoxBody: import_ts_dedent23.dedent`
|
|
13299
13593
|
Assembles an array of chat messages for use with a Chat node. The inputs can be strings or chat messages.
|
|
13300
13594
|
|
|
13301
13595
|
The number of inputs is dynamic based on the number of connections.
|
|
@@ -13372,16 +13666,16 @@ var AssemblePromptNodeImpl = class extends NodeImpl {
|
|
|
13372
13666
|
var assemblePromptNode = nodeDefinition(AssemblePromptNodeImpl, "Assemble Prompt");
|
|
13373
13667
|
|
|
13374
13668
|
// src/model/nodes/ExtractYamlNode.ts
|
|
13375
|
-
var
|
|
13669
|
+
var import_non_secure26 = require("nanoid/non-secure");
|
|
13376
13670
|
var import_yaml = __toESM(require("yaml"), 1);
|
|
13377
13671
|
var import_jsonpath_plus = require("jsonpath-plus");
|
|
13378
|
-
var
|
|
13672
|
+
var import_ts_dedent24 = require("ts-dedent");
|
|
13379
13673
|
var ExtractYamlNodeImpl = class extends NodeImpl {
|
|
13380
13674
|
static create() {
|
|
13381
13675
|
const chartNode = {
|
|
13382
13676
|
type: "extractYaml",
|
|
13383
13677
|
title: "Extract YAML",
|
|
13384
|
-
id: (0,
|
|
13678
|
+
id: (0, import_non_secure26.nanoid)(),
|
|
13385
13679
|
visualData: {
|
|
13386
13680
|
x: 0,
|
|
13387
13681
|
y: 0,
|
|
@@ -13461,14 +13755,14 @@ var ExtractYamlNodeImpl = class extends NodeImpl {
|
|
|
13461
13755
|
];
|
|
13462
13756
|
}
|
|
13463
13757
|
getBody() {
|
|
13464
|
-
return
|
|
13758
|
+
return import_ts_dedent24.dedent`
|
|
13465
13759
|
Root: ${this.data.useRootPropertyNameInput ? "(Using Input)" : this.data.rootPropertyName}
|
|
13466
13760
|
${this.data.useObjectPathInput ? "Path: (Using Input)" : this.data.objectPath ? `Path: ${this.data.objectPath}` : ``}
|
|
13467
13761
|
`;
|
|
13468
13762
|
}
|
|
13469
13763
|
static getUIData() {
|
|
13470
13764
|
return {
|
|
13471
|
-
infoBoxBody:
|
|
13765
|
+
infoBoxBody: import_ts_dedent24.dedent`
|
|
13472
13766
|
Finds and parses a YAML object in the input text with a predefined root property name (configurable).
|
|
13473
13767
|
|
|
13474
13768
|
Defaults to \`yamlDocument\`, which means the input text must have a \`yamlDocument:\` root node somewhere in it. All indented text after that is considered part of the YAML.
|
|
@@ -13568,14 +13862,14 @@ var ExtractYamlNodeImpl = class extends NodeImpl {
|
|
|
13568
13862
|
var extractYamlNode = nodeDefinition(ExtractYamlNodeImpl, "Extract YAML");
|
|
13569
13863
|
|
|
13570
13864
|
// src/model/nodes/LoopControllerNode.ts
|
|
13571
|
-
var
|
|
13572
|
-
var
|
|
13865
|
+
var import_non_secure27 = require("nanoid/non-secure");
|
|
13866
|
+
var import_ts_dedent25 = require("ts-dedent");
|
|
13573
13867
|
var LoopControllerNodeImpl = class extends NodeImpl {
|
|
13574
13868
|
static create() {
|
|
13575
13869
|
const chartNode = {
|
|
13576
13870
|
type: "loopController",
|
|
13577
13871
|
title: "Loop Controller",
|
|
13578
|
-
id: (0,
|
|
13872
|
+
id: (0, import_non_secure27.nanoid)(),
|
|
13579
13873
|
visualData: {
|
|
13580
13874
|
x: 0,
|
|
13581
13875
|
y: 0,
|
|
@@ -13681,7 +13975,7 @@ var LoopControllerNodeImpl = class extends NodeImpl {
|
|
|
13681
13975
|
}
|
|
13682
13976
|
static getUIData() {
|
|
13683
13977
|
return {
|
|
13684
|
-
infoBoxBody:
|
|
13978
|
+
infoBoxBody: import_ts_dedent25.dedent`
|
|
13685
13979
|
Defines the entry point for a loop. Values from inside the loop should be passed back through the "Input" ports, and their corresponding "Default" values can be specified on the input ports as well.
|
|
13686
13980
|
|
|
13687
13981
|
If the "continue" input is falsey, then the "break" output will run.
|
|
@@ -13767,14 +14061,14 @@ var LoopControllerNodeImpl = class extends NodeImpl {
|
|
|
13767
14061
|
var loopControllerNode = nodeDefinition(LoopControllerNodeImpl, "Loop Controller");
|
|
13768
14062
|
|
|
13769
14063
|
// src/model/nodes/TrimChatMessagesNode.ts
|
|
13770
|
-
var
|
|
13771
|
-
var
|
|
14064
|
+
var import_non_secure28 = require("nanoid/non-secure");
|
|
14065
|
+
var import_ts_dedent26 = require("ts-dedent");
|
|
13772
14066
|
var TrimChatMessagesNodeImpl = class extends NodeImpl {
|
|
13773
14067
|
static create() {
|
|
13774
14068
|
const chartNode = {
|
|
13775
14069
|
type: "trimChatMessages",
|
|
13776
14070
|
title: "Trim Chat Messages",
|
|
13777
|
-
id: (0,
|
|
14071
|
+
id: (0, import_non_secure28.nanoid)(),
|
|
13778
14072
|
visualData: {
|
|
13779
14073
|
x: 0,
|
|
13780
14074
|
y: 0,
|
|
@@ -13837,14 +14131,14 @@ var TrimChatMessagesNodeImpl = class extends NodeImpl {
|
|
|
13837
14131
|
];
|
|
13838
14132
|
}
|
|
13839
14133
|
getBody() {
|
|
13840
|
-
return
|
|
14134
|
+
return import_ts_dedent26.dedent`
|
|
13841
14135
|
Max Token Count: ${this.data.useMaxTokenCountInput ? "(From Input)" : this.data.maxTokenCount}
|
|
13842
14136
|
Remove From Beginning: ${this.data.useRemoveFromBeginningInput ? "(From Input)" : this.data.removeFromBeginning ? "Yes" : "No"}
|
|
13843
14137
|
`;
|
|
13844
14138
|
}
|
|
13845
14139
|
static getUIData() {
|
|
13846
14140
|
return {
|
|
13847
|
-
infoBoxBody:
|
|
14141
|
+
infoBoxBody: import_ts_dedent26.dedent`
|
|
13848
14142
|
Takes an array of chat messages, and slices messages from the beginning or the end of the list until the total length of the messages is under the configured token length.
|
|
13849
14143
|
|
|
13850
14144
|
Useful for setting up infinite message chains that stay under the LLM context limit.
|
|
@@ -13882,13 +14176,13 @@ var TrimChatMessagesNodeImpl = class extends NodeImpl {
|
|
|
13882
14176
|
var trimChatMessagesNode = nodeDefinition(TrimChatMessagesNodeImpl, "Trim Chat Messages");
|
|
13883
14177
|
|
|
13884
14178
|
// src/model/nodes/ExternalCallNode.ts
|
|
13885
|
-
var
|
|
14179
|
+
var import_non_secure29 = require("nanoid/non-secure");
|
|
13886
14180
|
var import_lodash_es11 = require("lodash");
|
|
13887
|
-
var
|
|
14181
|
+
var import_ts_dedent27 = require("ts-dedent");
|
|
13888
14182
|
var ExternalCallNodeImpl = class extends NodeImpl {
|
|
13889
14183
|
static create() {
|
|
13890
14184
|
return {
|
|
13891
|
-
id: (0,
|
|
14185
|
+
id: (0, import_non_secure29.nanoid)(),
|
|
13892
14186
|
type: "externalCall",
|
|
13893
14187
|
title: "External Call",
|
|
13894
14188
|
visualData: { x: 0, y: 0, width: 150 },
|
|
@@ -13952,7 +14246,7 @@ var ExternalCallNodeImpl = class extends NodeImpl {
|
|
|
13952
14246
|
}
|
|
13953
14247
|
static getUIData() {
|
|
13954
14248
|
return {
|
|
13955
|
-
infoBoxBody:
|
|
14249
|
+
infoBoxBody: import_ts_dedent27.dedent`
|
|
13956
14250
|
Provides a way to call into the host project from inside a Rivet graph when Rivet graphs are integrated into another project.
|
|
13957
14251
|
`,
|
|
13958
14252
|
infoBoxTitle: "External Call Node",
|
|
@@ -14031,9 +14325,9 @@ var ExternalCallNodeImpl = class extends NodeImpl {
|
|
|
14031
14325
|
var externalCallNode = nodeDefinition(ExternalCallNodeImpl, "External Call");
|
|
14032
14326
|
|
|
14033
14327
|
// src/model/nodes/ExtractObjectPathNode.ts
|
|
14034
|
-
var
|
|
14328
|
+
var import_non_secure30 = require("nanoid/non-secure");
|
|
14035
14329
|
var import_jsonpath_plus2 = require("jsonpath-plus");
|
|
14036
|
-
var
|
|
14330
|
+
var import_ts_dedent28 = require("ts-dedent");
|
|
14037
14331
|
var RESERVED_INPUT_IDS = /* @__PURE__ */ new Set(["object"]);
|
|
14038
14332
|
function getExtractObjectPathInterpolationInputNames(path) {
|
|
14039
14333
|
return extractInterpolationVariables(path).filter((inputName) => !RESERVED_INPUT_IDS.has(inputName));
|
|
@@ -14059,7 +14353,7 @@ var ExtractObjectPathNodeImpl = class extends NodeImpl {
|
|
|
14059
14353
|
const chartNode = {
|
|
14060
14354
|
type: "extractObjectPath",
|
|
14061
14355
|
title: "Extract Object Path",
|
|
14062
|
-
id: (0,
|
|
14356
|
+
id: (0, import_non_secure30.nanoid)(),
|
|
14063
14357
|
visualData: {
|
|
14064
14358
|
x: 0,
|
|
14065
14359
|
y: 0,
|
|
@@ -14136,7 +14430,7 @@ var ExtractObjectPathNodeImpl = class extends NodeImpl {
|
|
|
14136
14430
|
}
|
|
14137
14431
|
static getUIData() {
|
|
14138
14432
|
return {
|
|
14139
|
-
infoBoxBody:
|
|
14433
|
+
infoBoxBody: import_ts_dedent28.dedent`
|
|
14140
14434
|
Extracts the value at the specified path from the input value. The path uses JSONPath notation to navigate through the value.
|
|
14141
14435
|
`,
|
|
14142
14436
|
infoBoxTitle: "Extract Object Path Node",
|
|
@@ -14186,12 +14480,12 @@ var ExtractObjectPathNodeImpl = class extends NodeImpl {
|
|
|
14186
14480
|
var extractObjectPathNode = nodeDefinition(ExtractObjectPathNodeImpl, "Extract Object Path");
|
|
14187
14481
|
|
|
14188
14482
|
// src/model/nodes/RaiseEventNode.ts
|
|
14189
|
-
var
|
|
14190
|
-
var
|
|
14483
|
+
var import_non_secure31 = require("nanoid/non-secure");
|
|
14484
|
+
var import_ts_dedent29 = require("ts-dedent");
|
|
14191
14485
|
var RaiseEventNodeImpl = class extends NodeImpl {
|
|
14192
14486
|
static create() {
|
|
14193
14487
|
return {
|
|
14194
|
-
id: (0,
|
|
14488
|
+
id: (0, import_non_secure31.nanoid)(),
|
|
14195
14489
|
type: "raiseEvent",
|
|
14196
14490
|
title: "Raise Event",
|
|
14197
14491
|
visualData: { x: 0, y: 0, width: 150 },
|
|
@@ -14241,7 +14535,7 @@ var RaiseEventNodeImpl = class extends NodeImpl {
|
|
|
14241
14535
|
}
|
|
14242
14536
|
static getUIData() {
|
|
14243
14537
|
return {
|
|
14244
|
-
infoBoxBody:
|
|
14538
|
+
infoBoxBody: import_ts_dedent29.dedent`
|
|
14245
14539
|
Raises an event that the host project or a 'Wait For Event' node can listen for.
|
|
14246
14540
|
`,
|
|
14247
14541
|
infoBoxTitle: "Raise Event Node",
|
|
@@ -14261,14 +14555,14 @@ var RaiseEventNodeImpl = class extends NodeImpl {
|
|
|
14261
14555
|
var raiseEventNode = nodeDefinition(RaiseEventNodeImpl, "Raise Event");
|
|
14262
14556
|
|
|
14263
14557
|
// src/model/nodes/ContextNode.ts
|
|
14264
|
-
var
|
|
14265
|
-
var
|
|
14558
|
+
var import_non_secure32 = require("nanoid/non-secure");
|
|
14559
|
+
var import_ts_dedent30 = require("ts-dedent");
|
|
14266
14560
|
var ContextNodeImpl = class extends NodeImpl {
|
|
14267
14561
|
static create() {
|
|
14268
14562
|
const chartNode = {
|
|
14269
14563
|
type: "context",
|
|
14270
14564
|
title: "Context",
|
|
14271
|
-
id: (0,
|
|
14565
|
+
id: (0, import_non_secure32.nanoid)(),
|
|
14272
14566
|
visualData: {
|
|
14273
14567
|
x: 0,
|
|
14274
14568
|
y: 0,
|
|
@@ -14317,14 +14611,14 @@ var ContextNodeImpl = class extends NodeImpl {
|
|
|
14317
14611
|
];
|
|
14318
14612
|
}
|
|
14319
14613
|
getBody() {
|
|
14320
|
-
return
|
|
14614
|
+
return import_ts_dedent30.dedent`
|
|
14321
14615
|
${this.data.id}
|
|
14322
14616
|
Type: ${this.data.dataType}
|
|
14323
14617
|
`;
|
|
14324
14618
|
}
|
|
14325
14619
|
static getUIData() {
|
|
14326
14620
|
return {
|
|
14327
|
-
infoBoxBody:
|
|
14621
|
+
infoBoxBody: import_ts_dedent30.dedent`
|
|
14328
14622
|
Retrieves a value from the graph's context using a configured id. The context serves as a "global graph input", allowing the same values to be accessible from any graph or subgraph.
|
|
14329
14623
|
`,
|
|
14330
14624
|
infoBoxTitle: "Context Node",
|
|
@@ -14362,8 +14656,8 @@ var ContextNodeImpl = class extends NodeImpl {
|
|
|
14362
14656
|
var contextNode = nodeDefinition(ContextNodeImpl, "Context");
|
|
14363
14657
|
|
|
14364
14658
|
// src/model/nodes/CoalesceNode.ts
|
|
14365
|
-
var
|
|
14366
|
-
var
|
|
14659
|
+
var import_non_secure33 = require("nanoid/non-secure");
|
|
14660
|
+
var import_ts_dedent31 = require("ts-dedent");
|
|
14367
14661
|
var INPUT_PORT_ID_PATTERN = /^input(\d+)$/;
|
|
14368
14662
|
var IGNORE_NULL_LABEL = "Ignore 'null'";
|
|
14369
14663
|
var IGNORE_UNDEFINED_LABEL = "Ignore 'undefined'";
|
|
@@ -14372,7 +14666,7 @@ var CoalesceNodeImpl = class extends NodeImpl {
|
|
|
14372
14666
|
const chartNode = {
|
|
14373
14667
|
type: "coalesce",
|
|
14374
14668
|
title: "Coalesce",
|
|
14375
|
-
id: (0,
|
|
14669
|
+
id: (0, import_non_secure33.nanoid)(),
|
|
14376
14670
|
data: {
|
|
14377
14671
|
ignoreNull: false,
|
|
14378
14672
|
ignoreUndefined: false
|
|
@@ -14437,7 +14731,7 @@ var CoalesceNodeImpl = class extends NodeImpl {
|
|
|
14437
14731
|
}
|
|
14438
14732
|
static getUIData() {
|
|
14439
14733
|
return {
|
|
14440
|
-
infoBoxBody:
|
|
14734
|
+
infoBoxBody: import_ts_dedent31.dedent`
|
|
14441
14735
|
Takes in any number of inputs and outputs the first value that is not "Not Ran". Useful for consolidating branches after a Match node.
|
|
14442
14736
|
|
|
14443
14737
|
Null and undefined input values are emitted by default, but the node can be configured to skip either value and continue checking later inputs.
|
|
@@ -14513,14 +14807,14 @@ var CoalesceNodeImpl = class extends NodeImpl {
|
|
|
14513
14807
|
var coalesceNode = nodeDefinition(CoalesceNodeImpl, "Coalesce");
|
|
14514
14808
|
|
|
14515
14809
|
// src/model/nodes/DidRunNode.ts
|
|
14516
|
-
var
|
|
14517
|
-
var
|
|
14810
|
+
var import_non_secure34 = require("nanoid/non-secure");
|
|
14811
|
+
var import_ts_dedent32 = require("ts-dedent");
|
|
14518
14812
|
var DidRunNodeImpl = class extends NodeImpl {
|
|
14519
14813
|
static create() {
|
|
14520
14814
|
return {
|
|
14521
14815
|
type: "didRun",
|
|
14522
14816
|
title: "Did Run",
|
|
14523
|
-
id: (0,
|
|
14817
|
+
id: (0, import_non_secure34.nanoid)(),
|
|
14524
14818
|
data: {},
|
|
14525
14819
|
visualData: {
|
|
14526
14820
|
x: 0,
|
|
@@ -14552,7 +14846,7 @@ var DidRunNodeImpl = class extends NodeImpl {
|
|
|
14552
14846
|
}
|
|
14553
14847
|
static getUIData() {
|
|
14554
14848
|
return {
|
|
14555
|
-
infoBoxBody:
|
|
14849
|
+
infoBoxBody: import_ts_dedent32.dedent`
|
|
14556
14850
|
Outputs true when all connected inputs have run. Falsy or empty values still count as having run, so this is useful for adapting "did this branch run at all?" into a boolean If port.
|
|
14557
14851
|
`,
|
|
14558
14852
|
infoBoxTitle: "Did Run Node",
|
|
@@ -14598,14 +14892,14 @@ var DidRunNodeImpl = class extends NodeImpl {
|
|
|
14598
14892
|
var didRunNode = nodeDefinition(DidRunNodeImpl, "Did Run");
|
|
14599
14893
|
|
|
14600
14894
|
// src/model/nodes/PassthroughNode.ts
|
|
14601
|
-
var
|
|
14602
|
-
var
|
|
14895
|
+
var import_non_secure35 = require("nanoid/non-secure");
|
|
14896
|
+
var import_ts_dedent33 = require("ts-dedent");
|
|
14603
14897
|
var PassthroughNodeImpl = class extends NodeImpl {
|
|
14604
14898
|
static create = () => {
|
|
14605
14899
|
const chartNode = {
|
|
14606
14900
|
type: "passthrough",
|
|
14607
14901
|
title: "Passthrough",
|
|
14608
|
-
id: (0,
|
|
14902
|
+
id: (0, import_non_secure35.nanoid)(),
|
|
14609
14903
|
data: {},
|
|
14610
14904
|
visualData: {
|
|
14611
14905
|
x: 0,
|
|
@@ -14641,7 +14935,7 @@ var PassthroughNodeImpl = class extends NodeImpl {
|
|
|
14641
14935
|
}
|
|
14642
14936
|
static getUIData() {
|
|
14643
14937
|
return {
|
|
14644
|
-
infoBoxBody:
|
|
14938
|
+
infoBoxBody: import_ts_dedent33.dedent`
|
|
14645
14939
|
Simply passes the input value to the output without any modifications.
|
|
14646
14940
|
`,
|
|
14647
14941
|
infoBoxTitle: "Passthrough Node",
|
|
@@ -14676,14 +14970,14 @@ var PassthroughNodeImpl = class extends NodeImpl {
|
|
|
14676
14970
|
var passthroughNode = nodeDefinition(PassthroughNodeImpl, "Passthrough");
|
|
14677
14971
|
|
|
14678
14972
|
// src/model/nodes/PopNode.ts
|
|
14679
|
-
var
|
|
14680
|
-
var
|
|
14973
|
+
var import_non_secure36 = require("nanoid/non-secure");
|
|
14974
|
+
var import_ts_dedent34 = require("ts-dedent");
|
|
14681
14975
|
var PopNodeImpl = class extends NodeImpl {
|
|
14682
14976
|
static create() {
|
|
14683
14977
|
const baseNode = {
|
|
14684
14978
|
type: "pop",
|
|
14685
14979
|
title: "Pop",
|
|
14686
|
-
id: (0,
|
|
14980
|
+
id: (0, import_non_secure36.nanoid)(),
|
|
14687
14981
|
visualData: {
|
|
14688
14982
|
x: 0,
|
|
14689
14983
|
y: 0,
|
|
@@ -14728,7 +15022,7 @@ var PopNodeImpl = class extends NodeImpl {
|
|
|
14728
15022
|
}
|
|
14729
15023
|
static getUIData() {
|
|
14730
15024
|
return {
|
|
14731
|
-
infoBoxBody:
|
|
15025
|
+
infoBoxBody: import_ts_dedent34.dedent`
|
|
14732
15026
|
Pops the last value off the input array and outputs the new array and the popped value.
|
|
14733
15027
|
|
|
14734
15028
|
Can also be used to just extract the last value from an array.
|
|
@@ -14764,14 +15058,14 @@ var PopNodeImpl = class extends NodeImpl {
|
|
|
14764
15058
|
var popNode = nodeDefinition(PopNodeImpl, "Pop");
|
|
14765
15059
|
|
|
14766
15060
|
// src/model/nodes/SetGlobalNode.ts
|
|
14767
|
-
var
|
|
14768
|
-
var
|
|
15061
|
+
var import_non_secure37 = require("nanoid/non-secure");
|
|
15062
|
+
var import_ts_dedent35 = require("ts-dedent");
|
|
14769
15063
|
var SetGlobalNodeImpl = class extends NodeImpl {
|
|
14770
15064
|
static create() {
|
|
14771
15065
|
const chartNode = {
|
|
14772
15066
|
type: "setGlobal",
|
|
14773
15067
|
title: "Set Global",
|
|
14774
|
-
id: (0,
|
|
15068
|
+
id: (0, import_non_secure37.nanoid)(),
|
|
14775
15069
|
visualData: {
|
|
14776
15070
|
x: 0,
|
|
14777
15071
|
y: 0,
|
|
@@ -14838,14 +15132,14 @@ var SetGlobalNodeImpl = class extends NodeImpl {
|
|
|
14838
15132
|
];
|
|
14839
15133
|
}
|
|
14840
15134
|
getBody() {
|
|
14841
|
-
return
|
|
15135
|
+
return import_ts_dedent35.dedent`
|
|
14842
15136
|
${this.data.id}
|
|
14843
15137
|
Type: ${this.data.dataType}
|
|
14844
15138
|
`;
|
|
14845
15139
|
}
|
|
14846
15140
|
static getUIData() {
|
|
14847
15141
|
return {
|
|
14848
|
-
infoBoxBody:
|
|
15142
|
+
infoBoxBody: import_ts_dedent35.dedent`
|
|
14849
15143
|
Sets a global value that is shared across all graphs and subgraphs. The id of the global value and the value itself are configured in this node.
|
|
14850
15144
|
`,
|
|
14851
15145
|
infoBoxTitle: "Set Global Node",
|
|
@@ -14880,14 +15174,14 @@ var SetGlobalNodeImpl = class extends NodeImpl {
|
|
|
14880
15174
|
var setGlobalNode = nodeDefinition(SetGlobalNodeImpl, "Set Global");
|
|
14881
15175
|
|
|
14882
15176
|
// src/model/nodes/GetGlobalNode.ts
|
|
14883
|
-
var
|
|
14884
|
-
var
|
|
15177
|
+
var import_non_secure38 = require("nanoid/non-secure");
|
|
15178
|
+
var import_ts_dedent36 = require("ts-dedent");
|
|
14885
15179
|
var GetGlobalNodeImpl = class extends NodeImpl {
|
|
14886
15180
|
static create() {
|
|
14887
15181
|
const chartNode = {
|
|
14888
15182
|
type: "getGlobal",
|
|
14889
15183
|
title: "Get Global",
|
|
14890
|
-
id: (0,
|
|
15184
|
+
id: (0, import_non_secure38.nanoid)(),
|
|
14891
15185
|
visualData: {
|
|
14892
15186
|
x: 0,
|
|
14893
15187
|
y: 0,
|
|
@@ -14956,7 +15250,7 @@ var GetGlobalNodeImpl = class extends NodeImpl {
|
|
|
14956
15250
|
];
|
|
14957
15251
|
}
|
|
14958
15252
|
getBody() {
|
|
14959
|
-
return
|
|
15253
|
+
return import_ts_dedent36.dedent`
|
|
14960
15254
|
${this.data.useIdInput ? "(ID from input)" : this.data.id}
|
|
14961
15255
|
Type: ${this.data.dataType}
|
|
14962
15256
|
${this.data.wait ? "Waits for available data" : ""}
|
|
@@ -14964,7 +15258,7 @@ var GetGlobalNodeImpl = class extends NodeImpl {
|
|
|
14964
15258
|
}
|
|
14965
15259
|
static getUIData() {
|
|
14966
15260
|
return {
|
|
14967
|
-
infoBoxBody:
|
|
15261
|
+
infoBoxBody: import_ts_dedent36.dedent`
|
|
14968
15262
|
Retrieves a global value that is shared across all graphs and subgraphs. The id of the global value is configured in this node.
|
|
14969
15263
|
`,
|
|
14970
15264
|
infoBoxTitle: "Get Global Node",
|
|
@@ -15011,12 +15305,12 @@ var GetGlobalNodeImpl = class extends NodeImpl {
|
|
|
15011
15305
|
var getGlobalNode = nodeDefinition(GetGlobalNodeImpl, "Get Global");
|
|
15012
15306
|
|
|
15013
15307
|
// src/model/nodes/WaitForEventNode.ts
|
|
15014
|
-
var
|
|
15015
|
-
var
|
|
15308
|
+
var import_non_secure39 = require("nanoid/non-secure");
|
|
15309
|
+
var import_ts_dedent37 = require("ts-dedent");
|
|
15016
15310
|
var WaitForEventNodeImpl = class extends NodeImpl {
|
|
15017
15311
|
static create() {
|
|
15018
15312
|
return {
|
|
15019
|
-
id: (0,
|
|
15313
|
+
id: (0, import_non_secure39.nanoid)(),
|
|
15020
15314
|
type: "waitForEvent",
|
|
15021
15315
|
title: "Wait For Event",
|
|
15022
15316
|
visualData: { x: 0, y: 0, width: 150 },
|
|
@@ -15071,7 +15365,7 @@ var WaitForEventNodeImpl = class extends NodeImpl {
|
|
|
15071
15365
|
}
|
|
15072
15366
|
static getUIData() {
|
|
15073
15367
|
return {
|
|
15074
|
-
infoBoxBody:
|
|
15368
|
+
infoBoxBody: import_ts_dedent37.dedent`
|
|
15075
15369
|
Waits for a specific event to be raised by a 'Raise Event' node or the host project. The event name can be configured.
|
|
15076
15370
|
`,
|
|
15077
15371
|
infoBoxTitle: "Wait For Event Node",
|
|
@@ -15091,14 +15385,14 @@ var WaitForEventNodeImpl = class extends NodeImpl {
|
|
|
15091
15385
|
var waitForEventNode = nodeDefinition(WaitForEventNodeImpl, "Wait For Event");
|
|
15092
15386
|
|
|
15093
15387
|
// src/model/nodes/ToolNode.ts
|
|
15094
|
-
var
|
|
15095
|
-
var
|
|
15388
|
+
var import_non_secure40 = require("nanoid/non-secure");
|
|
15389
|
+
var import_ts_dedent38 = require("ts-dedent");
|
|
15096
15390
|
var GptFunctionNodeImpl = class extends NodeImpl {
|
|
15097
15391
|
static create() {
|
|
15098
15392
|
const chartNode = {
|
|
15099
15393
|
type: "gptFunction",
|
|
15100
15394
|
title: "Tool",
|
|
15101
|
-
id: (0,
|
|
15395
|
+
id: (0, import_non_secure40.nanoid)(),
|
|
15102
15396
|
visualData: {
|
|
15103
15397
|
x: 0,
|
|
15104
15398
|
y: 0,
|
|
@@ -15107,7 +15401,7 @@ var GptFunctionNodeImpl = class extends NodeImpl {
|
|
|
15107
15401
|
data: {
|
|
15108
15402
|
name: "newTool",
|
|
15109
15403
|
description: "No description provided",
|
|
15110
|
-
schema:
|
|
15404
|
+
schema: import_ts_dedent38.dedent`
|
|
15111
15405
|
{
|
|
15112
15406
|
"type": "object",
|
|
15113
15407
|
"properties": {}
|
|
@@ -15193,6 +15487,7 @@ var GptFunctionNodeImpl = class extends NodeImpl {
|
|
|
15193
15487
|
label: "Schema",
|
|
15194
15488
|
dataKey: "schema",
|
|
15195
15489
|
language: "json",
|
|
15490
|
+
interpolationSyntax: "json-template",
|
|
15196
15491
|
useInputToggleDataKey: "useSchemaInput",
|
|
15197
15492
|
enableFolding: true
|
|
15198
15493
|
},
|
|
@@ -15213,7 +15508,7 @@ ${this.data.description}`
|
|
|
15213
15508
|
}
|
|
15214
15509
|
static getUIData() {
|
|
15215
15510
|
return {
|
|
15216
|
-
infoBoxBody:
|
|
15511
|
+
infoBoxBody: import_ts_dedent38.dedent`
|
|
15217
15512
|
Defines a tool, which is a method that the LLM can call in its responses.
|
|
15218
15513
|
`,
|
|
15219
15514
|
infoBoxTitle: "Tool Node",
|
|
@@ -15256,15 +15551,15 @@ ${this.data.description}`
|
|
|
15256
15551
|
var gptFunctionNode = nodeDefinition(GptFunctionNodeImpl, "Tool");
|
|
15257
15552
|
|
|
15258
15553
|
// src/model/nodes/ToYamlNode.ts
|
|
15259
|
-
var
|
|
15554
|
+
var import_non_secure41 = require("nanoid/non-secure");
|
|
15260
15555
|
var import_yaml2 = __toESM(require("yaml"), 1);
|
|
15261
|
-
var
|
|
15556
|
+
var import_ts_dedent39 = require("ts-dedent");
|
|
15262
15557
|
var ToYamlNodeImpl = class extends NodeImpl {
|
|
15263
15558
|
static create() {
|
|
15264
15559
|
const chartNode = {
|
|
15265
15560
|
type: "toYaml",
|
|
15266
15561
|
title: "To YAML",
|
|
15267
|
-
id: (0,
|
|
15562
|
+
id: (0, import_non_secure41.nanoid)(),
|
|
15268
15563
|
visualData: {
|
|
15269
15564
|
x: 0,
|
|
15270
15565
|
y: 0,
|
|
@@ -15295,7 +15590,7 @@ var ToYamlNodeImpl = class extends NodeImpl {
|
|
|
15295
15590
|
}
|
|
15296
15591
|
static getUIData() {
|
|
15297
15592
|
return {
|
|
15298
|
-
infoBoxBody:
|
|
15593
|
+
infoBoxBody: import_ts_dedent39.dedent`
|
|
15299
15594
|
Turns the input object into YAML text.
|
|
15300
15595
|
`,
|
|
15301
15596
|
infoBoxTitle: "To YAML Node",
|
|
@@ -15320,8 +15615,8 @@ var ToYamlNodeImpl = class extends NodeImpl {
|
|
|
15320
15615
|
var toYamlNode = nodeDefinition(ToYamlNodeImpl, "To YAML");
|
|
15321
15616
|
|
|
15322
15617
|
// src/model/nodes/GetEmbeddingNode.ts
|
|
15323
|
-
var
|
|
15324
|
-
var
|
|
15618
|
+
var import_non_secure42 = require("nanoid/non-secure");
|
|
15619
|
+
var import_ts_dedent40 = require("ts-dedent");
|
|
15325
15620
|
|
|
15326
15621
|
// src/integrations/integrations.ts
|
|
15327
15622
|
var registeredIntegrations = {
|
|
@@ -15344,7 +15639,7 @@ function getIntegration(type, integrationKey, context) {
|
|
|
15344
15639
|
var GetEmbeddingNodeImpl = class extends NodeImpl {
|
|
15345
15640
|
static create() {
|
|
15346
15641
|
return {
|
|
15347
|
-
id: (0,
|
|
15642
|
+
id: (0, import_non_secure42.nanoid)(),
|
|
15348
15643
|
type: "getEmbedding",
|
|
15349
15644
|
title: "Get Embedding",
|
|
15350
15645
|
visualData: { x: 0, y: 0, width: 250 },
|
|
@@ -15428,7 +15723,7 @@ var GetEmbeddingNodeImpl = class extends NodeImpl {
|
|
|
15428
15723
|
}
|
|
15429
15724
|
static getUIData() {
|
|
15430
15725
|
return {
|
|
15431
|
-
infoBoxBody:
|
|
15726
|
+
infoBoxBody: import_ts_dedent40.dedent`
|
|
15432
15727
|
Gets a OpenAI vector embedding for the input text provided.
|
|
15433
15728
|
|
|
15434
15729
|
Can be used with the Vector Store and Vector KNN nodes.
|
|
@@ -15459,12 +15754,12 @@ var GetEmbeddingNodeImpl = class extends NodeImpl {
|
|
|
15459
15754
|
var getEmbeddingNode = nodeDefinition(GetEmbeddingNodeImpl, "Get Embedding");
|
|
15460
15755
|
|
|
15461
15756
|
// src/model/nodes/VectorStoreNode.ts
|
|
15462
|
-
var
|
|
15463
|
-
var
|
|
15757
|
+
var import_non_secure43 = require("nanoid/non-secure");
|
|
15758
|
+
var import_ts_dedent41 = require("ts-dedent");
|
|
15464
15759
|
var VectorStoreNodeImpl = class extends NodeImpl {
|
|
15465
15760
|
static create() {
|
|
15466
15761
|
return {
|
|
15467
|
-
id: (0,
|
|
15762
|
+
id: (0, import_non_secure43.nanoid)(),
|
|
15468
15763
|
type: "vectorStore",
|
|
15469
15764
|
title: "Vector Store",
|
|
15470
15765
|
visualData: { x: 0, y: 0, width: 200 },
|
|
@@ -15540,14 +15835,14 @@ var VectorStoreNodeImpl = class extends NodeImpl {
|
|
|
15540
15835
|
];
|
|
15541
15836
|
}
|
|
15542
15837
|
getBody() {
|
|
15543
|
-
return
|
|
15838
|
+
return import_ts_dedent41.dedent`
|
|
15544
15839
|
Integration: ${this.data.useIntegrationInput ? "(using input)" : this.data.integration}
|
|
15545
15840
|
Collection Id: ${this.data.useCollectionIdInput ? "(using input)" : this.data.collectionId}
|
|
15546
15841
|
`;
|
|
15547
15842
|
}
|
|
15548
15843
|
static getUIData() {
|
|
15549
15844
|
return {
|
|
15550
|
-
infoBoxBody:
|
|
15845
|
+
infoBoxBody: import_ts_dedent41.dedent`
|
|
15551
15846
|
Takes in a vector, as well as data to store with the vector. This data is stored in the configured vector DB integration for later retrieval.
|
|
15552
15847
|
`,
|
|
15553
15848
|
infoBoxTitle: "Vector Store Node",
|
|
@@ -15582,12 +15877,12 @@ var VectorStoreNodeImpl = class extends NodeImpl {
|
|
|
15582
15877
|
var vectorStoreNode = nodeDefinition(VectorStoreNodeImpl, "Vector Store");
|
|
15583
15878
|
|
|
15584
15879
|
// src/model/nodes/VectorNearestNeighborsNode.ts
|
|
15585
|
-
var
|
|
15586
|
-
var
|
|
15880
|
+
var import_non_secure44 = require("nanoid/non-secure");
|
|
15881
|
+
var import_ts_dedent42 = require("ts-dedent");
|
|
15587
15882
|
var VectorNearestNeighborsNodeImpl = class extends NodeImpl {
|
|
15588
15883
|
static create() {
|
|
15589
15884
|
return {
|
|
15590
|
-
id: (0,
|
|
15885
|
+
id: (0, import_non_secure44.nanoid)(),
|
|
15591
15886
|
type: "vectorNearestNeighbors",
|
|
15592
15887
|
title: "Vector KNN",
|
|
15593
15888
|
visualData: { x: 0, y: 0, width: 200 },
|
|
@@ -15670,7 +15965,7 @@ var VectorNearestNeighborsNodeImpl = class extends NodeImpl {
|
|
|
15670
15965
|
];
|
|
15671
15966
|
}
|
|
15672
15967
|
getBody() {
|
|
15673
|
-
return
|
|
15968
|
+
return import_ts_dedent42.dedent`
|
|
15674
15969
|
Integration: ${this.data.useIntegrationInput ? "(using input)" : this.data.integration}
|
|
15675
15970
|
K: ${this.data.useKInput ? "(using input)" : this.data.k}
|
|
15676
15971
|
Collection Id: ${this.data.useCollectionIdInput ? "(using input)" : this.data.collectionId}
|
|
@@ -15678,7 +15973,7 @@ var VectorNearestNeighborsNodeImpl = class extends NodeImpl {
|
|
|
15678
15973
|
}
|
|
15679
15974
|
static getUIData() {
|
|
15680
15975
|
return {
|
|
15681
|
-
infoBoxBody:
|
|
15976
|
+
infoBoxBody: import_ts_dedent42.dedent`
|
|
15682
15977
|
Performs a k-nearest neighbors search on the vectors stored in the configured vector DB integration. Takes in a vector and returns the k closest vectors and their corresponding data.
|
|
15683
15978
|
`,
|
|
15684
15979
|
infoBoxTitle: "Vector KNN Node",
|
|
@@ -15708,17 +16003,17 @@ var VectorNearestNeighborsNodeImpl = class extends NodeImpl {
|
|
|
15708
16003
|
var vectorNearestNeighborsNode = nodeDefinition(VectorNearestNeighborsNodeImpl, "Vector KNN");
|
|
15709
16004
|
|
|
15710
16005
|
// src/model/nodes/HashNode.ts
|
|
15711
|
-
var
|
|
16006
|
+
var import_non_secure45 = require("nanoid/non-secure");
|
|
15712
16007
|
var crypto = __toESM(require("crypto-js"), 1);
|
|
15713
16008
|
var import_ts_pattern4 = require("ts-pattern");
|
|
15714
|
-
var
|
|
16009
|
+
var import_ts_dedent43 = require("ts-dedent");
|
|
15715
16010
|
var { SHA256, SHA512, MD5, SHA1 } = crypto;
|
|
15716
16011
|
var HashNodeImpl = class extends NodeImpl {
|
|
15717
16012
|
static create() {
|
|
15718
16013
|
const chartNode = {
|
|
15719
16014
|
type: "hash",
|
|
15720
16015
|
title: "Hash",
|
|
15721
|
-
id: (0,
|
|
16016
|
+
id: (0, import_non_secure45.nanoid)(),
|
|
15722
16017
|
visualData: {
|
|
15723
16018
|
x: 0,
|
|
15724
16019
|
y: 0,
|
|
@@ -15769,7 +16064,7 @@ var HashNodeImpl = class extends NodeImpl {
|
|
|
15769
16064
|
}
|
|
15770
16065
|
static getUIData() {
|
|
15771
16066
|
return {
|
|
15772
|
-
infoBoxBody:
|
|
16067
|
+
infoBoxBody: import_ts_dedent43.dedent`
|
|
15773
16068
|
Computes a hash of the input value using the configured hash function.
|
|
15774
16069
|
`,
|
|
15775
16070
|
infoBoxTitle: "Hash Node",
|
|
@@ -15797,14 +16092,14 @@ var algorithmDisplayName = {
|
|
|
15797
16092
|
var hashNode = nodeDefinition(HashNodeImpl, "Hash");
|
|
15798
16093
|
|
|
15799
16094
|
// src/model/nodes/AbortGraphNode.ts
|
|
15800
|
-
var
|
|
15801
|
-
var
|
|
16095
|
+
var import_non_secure46 = require("nanoid/non-secure");
|
|
16096
|
+
var import_ts_dedent44 = require("ts-dedent");
|
|
15802
16097
|
var AbortGraphNodeImpl = class extends NodeImpl {
|
|
15803
16098
|
static create() {
|
|
15804
16099
|
const chartNode = {
|
|
15805
16100
|
type: "abortGraph",
|
|
15806
16101
|
title: "Abort Graph",
|
|
15807
|
-
id: (0,
|
|
16102
|
+
id: (0, import_non_secure46.nanoid)(),
|
|
15808
16103
|
visualData: {
|
|
15809
16104
|
x: 0,
|
|
15810
16105
|
y: 0,
|
|
@@ -15855,13 +16150,13 @@ var AbortGraphNodeImpl = class extends NodeImpl {
|
|
|
15855
16150
|
];
|
|
15856
16151
|
}
|
|
15857
16152
|
getBody() {
|
|
15858
|
-
return
|
|
16153
|
+
return import_ts_dedent44.dedent`
|
|
15859
16154
|
${this.data.useSuccessfullyInput ? "Success depends on input" : this.data.successfully ? "Successfully Abort" : this.data.errorMessage ? `Error Abort: ${this.data.errorMessage}` : "Error Abort"}
|
|
15860
16155
|
`;
|
|
15861
16156
|
}
|
|
15862
16157
|
static getUIData() {
|
|
15863
16158
|
return {
|
|
15864
|
-
infoBoxBody:
|
|
16159
|
+
infoBoxBody: import_ts_dedent44.dedent`
|
|
15865
16160
|
Aborts the execution of the entire graph immediately.
|
|
15866
16161
|
|
|
15867
16162
|
Can either "successfully" abort the graph (early-exit), or "error" abort the graph.
|
|
@@ -15886,14 +16181,14 @@ var AbortGraphNodeImpl = class extends NodeImpl {
|
|
|
15886
16181
|
var abortGraphNode = nodeDefinition(AbortGraphNodeImpl, "Abort Graph");
|
|
15887
16182
|
|
|
15888
16183
|
// src/model/nodes/RaceInputsNode.ts
|
|
15889
|
-
var
|
|
15890
|
-
var
|
|
16184
|
+
var import_non_secure47 = require("nanoid/non-secure");
|
|
16185
|
+
var import_ts_dedent45 = require("ts-dedent");
|
|
15891
16186
|
var RaceInputsNodeImpl = class extends NodeImpl {
|
|
15892
16187
|
static create() {
|
|
15893
16188
|
const chartNode = {
|
|
15894
16189
|
type: "raceInputs",
|
|
15895
16190
|
title: "Race Inputs",
|
|
15896
|
-
id: (0,
|
|
16191
|
+
id: (0, import_non_secure47.nanoid)(),
|
|
15897
16192
|
visualData: {
|
|
15898
16193
|
x: 0,
|
|
15899
16194
|
y: 0,
|
|
@@ -15943,7 +16238,7 @@ var RaceInputsNodeImpl = class extends NodeImpl {
|
|
|
15943
16238
|
}
|
|
15944
16239
|
static getUIData() {
|
|
15945
16240
|
return {
|
|
15946
|
-
infoBoxBody:
|
|
16241
|
+
infoBoxBody: import_ts_dedent45.dedent`
|
|
15947
16242
|
Takes in multiple inputs and outputs the value of the first one to finish. The other inputs are cancelled.
|
|
15948
16243
|
`,
|
|
15949
16244
|
infoBoxTitle: "Race Inputs Node",
|
|
@@ -15971,14 +16266,14 @@ var RaceInputsNodeImpl = class extends NodeImpl {
|
|
|
15971
16266
|
var raceInputsNode = nodeDefinition(RaceInputsNodeImpl, "Race Inputs");
|
|
15972
16267
|
|
|
15973
16268
|
// src/model/nodes/ToJsonNode.ts
|
|
15974
|
-
var
|
|
15975
|
-
var
|
|
16269
|
+
var import_non_secure48 = require("nanoid/non-secure");
|
|
16270
|
+
var import_ts_dedent46 = require("ts-dedent");
|
|
15976
16271
|
var ToJsonNodeImpl = class extends NodeImpl {
|
|
15977
16272
|
static create() {
|
|
15978
16273
|
const chartNode = {
|
|
15979
16274
|
type: "toJson",
|
|
15980
16275
|
title: "To JSON",
|
|
15981
|
-
id: (0,
|
|
16276
|
+
id: (0, import_non_secure48.nanoid)(),
|
|
15982
16277
|
visualData: {
|
|
15983
16278
|
x: 0,
|
|
15984
16279
|
y: 0,
|
|
@@ -16023,7 +16318,7 @@ var ToJsonNodeImpl = class extends NodeImpl {
|
|
|
16023
16318
|
}
|
|
16024
16319
|
static getUIData() {
|
|
16025
16320
|
return {
|
|
16026
|
-
infoBoxBody:
|
|
16321
|
+
infoBoxBody: import_ts_dedent46.dedent`
|
|
16027
16322
|
Turns the input value into its JSON equivalent (stringifies the value).
|
|
16028
16323
|
`,
|
|
16029
16324
|
infoBoxTitle: "To JSON Node",
|
|
@@ -16045,14 +16340,14 @@ var ToJsonNodeImpl = class extends NodeImpl {
|
|
|
16045
16340
|
var toJsonNode = nodeDefinition(ToJsonNodeImpl, "To JSON");
|
|
16046
16341
|
|
|
16047
16342
|
// src/model/nodes/JoinNode.ts
|
|
16048
|
-
var
|
|
16049
|
-
var
|
|
16343
|
+
var import_non_secure49 = require("nanoid/non-secure");
|
|
16344
|
+
var import_ts_dedent47 = require("ts-dedent");
|
|
16050
16345
|
var JoinNodeImpl = class extends NodeImpl {
|
|
16051
16346
|
static create = () => {
|
|
16052
16347
|
const chartNode = {
|
|
16053
16348
|
type: "join",
|
|
16054
16349
|
title: "Join",
|
|
16055
|
-
id: (0,
|
|
16350
|
+
id: (0, import_non_secure49.nanoid)(),
|
|
16056
16351
|
data: {
|
|
16057
16352
|
flatten: true,
|
|
16058
16353
|
joinString: "\n"
|
|
@@ -16128,7 +16423,7 @@ var JoinNodeImpl = class extends NodeImpl {
|
|
|
16128
16423
|
}
|
|
16129
16424
|
static getUIData() {
|
|
16130
16425
|
return {
|
|
16131
|
-
infoBoxBody:
|
|
16426
|
+
infoBoxBody: import_ts_dedent47.dedent`
|
|
16132
16427
|
Takes an array of strings, and joins them using the configured delimiter.
|
|
16133
16428
|
|
|
16134
16429
|
Defaults to a newline.
|
|
@@ -16165,15 +16460,15 @@ var JoinNodeImpl = class extends NodeImpl {
|
|
|
16165
16460
|
var joinNode = nodeDefinition(JoinNodeImpl, "Coalesce");
|
|
16166
16461
|
|
|
16167
16462
|
// src/model/nodes/FilterNode.ts
|
|
16168
|
-
var
|
|
16463
|
+
var import_non_secure50 = require("nanoid/non-secure");
|
|
16169
16464
|
var import_lodash_es12 = require("lodash");
|
|
16170
|
-
var
|
|
16465
|
+
var import_ts_dedent48 = require("ts-dedent");
|
|
16171
16466
|
var FilterNodeImpl = class extends NodeImpl {
|
|
16172
16467
|
static create() {
|
|
16173
16468
|
const chartNode = {
|
|
16174
16469
|
type: "filter",
|
|
16175
16470
|
title: "Filter",
|
|
16176
|
-
id: (0,
|
|
16471
|
+
id: (0, import_non_secure50.nanoid)(),
|
|
16177
16472
|
visualData: {
|
|
16178
16473
|
x: 0,
|
|
16179
16474
|
y: 0,
|
|
@@ -16210,7 +16505,7 @@ var FilterNodeImpl = class extends NodeImpl {
|
|
|
16210
16505
|
}
|
|
16211
16506
|
static getUIData() {
|
|
16212
16507
|
return {
|
|
16213
|
-
infoBoxBody:
|
|
16508
|
+
infoBoxBody: import_ts_dedent48.dedent`
|
|
16214
16509
|
Takes in both an array of values, and an array of booleans of the same length, and filters the array where the corresponding boolean is true.
|
|
16215
16510
|
`,
|
|
16216
16511
|
infoBoxTitle: "Filter Node",
|
|
@@ -16235,11 +16530,11 @@ var FilterNodeImpl = class extends NodeImpl {
|
|
|
16235
16530
|
var filterNode = nodeDefinition(FilterNodeImpl, "Filter");
|
|
16236
16531
|
|
|
16237
16532
|
// src/model/nodes/JSFilterNode.ts
|
|
16238
|
-
var
|
|
16239
|
-
var
|
|
16533
|
+
var import_non_secure51 = require("nanoid/non-secure");
|
|
16534
|
+
var import_ts_dedent50 = require("ts-dedent");
|
|
16240
16535
|
|
|
16241
16536
|
// src/model/nodes/jsListCallbackHelpers.ts
|
|
16242
|
-
var
|
|
16537
|
+
var import_ts_dedent49 = require("ts-dedent");
|
|
16243
16538
|
var MAX_CALLBACK_PREVIEW_BODY_LINES = 13;
|
|
16244
16539
|
var JS_LIST_CALLBACK_SIGNATURE = "(item, index, array)";
|
|
16245
16540
|
var JS_LIST_CALLBACK_LOCAL_NAMES = /* @__PURE__ */ new Set(["item", "index", "array"]);
|
|
@@ -16260,44 +16555,42 @@ function assertSynchronousCallbackResult(result, nodeName) {
|
|
|
16260
16555
|
throw new Error(`${nodeName} callbacks must be synchronous.`);
|
|
16261
16556
|
}
|
|
16262
16557
|
}
|
|
16263
|
-
function
|
|
16264
|
-
return
|
|
16558
|
+
function getJSListInterpolationContext(callbackBody) {
|
|
16559
|
+
return getJsValueInterpolationRuntimeContext(callbackBody, JS_LIST_INPUTS_IDENTIFIER, {
|
|
16265
16560
|
localIdentifiers: JS_LIST_CALLBACK_LOCAL_NAMES
|
|
16266
16561
|
});
|
|
16267
16562
|
}
|
|
16268
|
-
function buildJSListRuntimePreamble(
|
|
16269
|
-
|
|
16270
|
-
return import_ts_dedent48.dedent`
|
|
16563
|
+
function buildJSListRuntimePreamble(interpolationContext) {
|
|
16564
|
+
return import_ts_dedent49.dedent`
|
|
16271
16565
|
const assertSynchronousCallbackResult = ${assertSynchronousCallbackResult.toString()};
|
|
16272
|
-
${
|
|
16273
|
-
|
|
16274
|
-
|
|
16566
|
+
${buildJsValueInputClonePreamble({
|
|
16567
|
+
cacheIdentifier: JS_LIST_INPUT_CLONE_CACHE_IDENTIFIER,
|
|
16568
|
+
inputsIdentifier: interpolationContext.inputsIdentifier
|
|
16569
|
+
})}
|
|
16275
16570
|
const array = cloneJsInputValue(inputs.array?.value, ${JS_LIST_INPUT_CLONE_CACHE_IDENTIFIER});
|
|
16276
|
-
${buildClonedInputValueAssignments(
|
|
16571
|
+
${buildClonedInputValueAssignments(
|
|
16572
|
+
interpolationContext.inputNames,
|
|
16573
|
+
interpolationContext.inputsIdentifier,
|
|
16574
|
+
JS_LIST_INPUT_CLONE_CACHE_IDENTIFIER
|
|
16575
|
+
)}
|
|
16277
16576
|
`;
|
|
16278
16577
|
}
|
|
16279
|
-
function buildJSListCallbackRuntimeSource(callbackBody) {
|
|
16280
|
-
return buildJsValueInterpolatedSource(callbackBody,
|
|
16578
|
+
function buildJSListCallbackRuntimeSource(callbackBody, inputsIdentifier) {
|
|
16579
|
+
return buildJsValueInterpolatedSource(callbackBody, inputsIdentifier, {
|
|
16281
16580
|
localIdentifiers: JS_LIST_CALLBACK_LOCAL_NAMES
|
|
16282
16581
|
});
|
|
16283
16582
|
}
|
|
16284
16583
|
function sanitizeJSListError(error, callbackBody, nodeName) {
|
|
16285
|
-
const
|
|
16286
|
-
const inputNames = getJSListCallbackInterpolationInputNames(callbackBody);
|
|
16584
|
+
const { inputNames, inputsIdentifier } = getJSListInterpolationContext(callbackBody);
|
|
16287
16585
|
const fallbackLabel = `${nodeName} input`;
|
|
16288
|
-
|
|
16289
|
-
jsListError.stack = sanitizeGeneratedJsValueText(
|
|
16290
|
-
jsListError.stack,
|
|
16291
|
-
inputNames,
|
|
16292
|
-
JS_LIST_INPUTS_IDENTIFIER,
|
|
16293
|
-
fallbackLabel
|
|
16294
|
-
);
|
|
16295
|
-
return jsListError;
|
|
16586
|
+
return sanitizeGeneratedJsValueError(error, inputNames, inputsIdentifier, fallbackLabel);
|
|
16296
16587
|
}
|
|
16297
16588
|
function buildJSFilterWrapper(callbackBody) {
|
|
16298
|
-
const
|
|
16299
|
-
|
|
16300
|
-
|
|
16589
|
+
const interpolationContext = getJSListInterpolationContext(callbackBody);
|
|
16590
|
+
const { inputsIdentifier } = interpolationContext;
|
|
16591
|
+
const callbackBodySource = buildJSListCallbackRuntimeSource(callbackBody, inputsIdentifier);
|
|
16592
|
+
return import_ts_dedent49.dedent`
|
|
16593
|
+
${buildJSListRuntimePreamble(interpolationContext)}
|
|
16301
16594
|
|
|
16302
16595
|
if (!Array.isArray(array)) {
|
|
16303
16596
|
throw new Error('JS Filter input "array" must be an array.');
|
|
@@ -16330,9 +16623,11 @@ function buildJSFilterWrapper(callbackBody) {
|
|
|
16330
16623
|
`;
|
|
16331
16624
|
}
|
|
16332
16625
|
function buildJSMapWrapper(callbackBody) {
|
|
16333
|
-
const
|
|
16334
|
-
|
|
16335
|
-
|
|
16626
|
+
const interpolationContext = getJSListInterpolationContext(callbackBody);
|
|
16627
|
+
const { inputsIdentifier } = interpolationContext;
|
|
16628
|
+
const callbackBodySource = buildJSListCallbackRuntimeSource(callbackBody, inputsIdentifier);
|
|
16629
|
+
return import_ts_dedent49.dedent`
|
|
16630
|
+
${buildJSListRuntimePreamble(interpolationContext)}
|
|
16336
16631
|
|
|
16337
16632
|
if (!Array.isArray(array)) {
|
|
16338
16633
|
throw new Error('JS Map input "array" must be an array.');
|
|
@@ -16362,13 +16657,9 @@ function buildJSMapWrapper(callbackBody) {
|
|
|
16362
16657
|
`;
|
|
16363
16658
|
}
|
|
16364
16659
|
function getJSListCallbackInterpolationInputDefinitions(callbackBody) {
|
|
16365
|
-
return
|
|
16366
|
-
|
|
16367
|
-
|
|
16368
|
-
dataType: "any",
|
|
16369
|
-
required: false
|
|
16370
|
-
})
|
|
16371
|
-
);
|
|
16660
|
+
return getJsValueInterpolationInputDefinitions(callbackBody, {
|
|
16661
|
+
localIdentifiers: JS_LIST_CALLBACK_LOCAL_NAMES
|
|
16662
|
+
});
|
|
16372
16663
|
}
|
|
16373
16664
|
function getJSListInputDefinitions(callbackBody) {
|
|
16374
16665
|
return [
|
|
@@ -16390,6 +16681,7 @@ function getJSListEditors() {
|
|
|
16390
16681
|
postEditorHelperMessage: "};\n\n//Use {{var}} to create input ports that evaluate as connected values.",
|
|
16391
16682
|
dataKey: "callbackBody",
|
|
16392
16683
|
language: "javascript",
|
|
16684
|
+
interpolationSyntax: "js-value",
|
|
16393
16685
|
enableFolding: true
|
|
16394
16686
|
}
|
|
16395
16687
|
];
|
|
@@ -16400,10 +16692,10 @@ function interpolateJSListCallbackBody(callbackBody, inputs) {
|
|
|
16400
16692
|
});
|
|
16401
16693
|
}
|
|
16402
16694
|
function getJSListNodeBody(callbackBody) {
|
|
16403
|
-
const previewBody = callbackBody
|
|
16695
|
+
const previewBody = buildJsValuePreview(callbackBody, MAX_CALLBACK_PREVIEW_BODY_LINES);
|
|
16404
16696
|
return {
|
|
16405
16697
|
type: "colorized",
|
|
16406
|
-
text:
|
|
16698
|
+
text: import_ts_dedent49.dedent`
|
|
16407
16699
|
${JS_LIST_CALLBACK_SIGNATURE} => {
|
|
16408
16700
|
${indentLines(previewBody, " ")}
|
|
16409
16701
|
}
|
|
@@ -16451,7 +16743,7 @@ var JSFilterNodeImpl = class extends NodeImpl {
|
|
|
16451
16743
|
const chartNode = {
|
|
16452
16744
|
type: "jsFilter",
|
|
16453
16745
|
title: "JS Filter",
|
|
16454
|
-
id: (0,
|
|
16746
|
+
id: (0, import_non_secure51.nanoid)(),
|
|
16455
16747
|
visualData: {
|
|
16456
16748
|
x: 0,
|
|
16457
16749
|
y: 0,
|
|
@@ -16483,7 +16775,7 @@ var JSFilterNodeImpl = class extends NodeImpl {
|
|
|
16483
16775
|
}
|
|
16484
16776
|
static getUIData() {
|
|
16485
16777
|
return {
|
|
16486
|
-
infoBoxBody:
|
|
16778
|
+
infoBoxBody: import_ts_dedent50.dedent`
|
|
16487
16779
|
Filters an input array using the body of a JavaScript callback.
|
|
16488
16780
|
|
|
16489
16781
|
Available callback parameters are <code>item</code>, <code>index</code>, and <code>array</code>.
|
|
@@ -16509,15 +16801,15 @@ var JSFilterNodeImpl = class extends NodeImpl {
|
|
|
16509
16801
|
var jsFilterNode = nodeDefinition(JSFilterNodeImpl, "JS Filter");
|
|
16510
16802
|
|
|
16511
16803
|
// src/model/nodes/JSMapNode.ts
|
|
16512
|
-
var
|
|
16513
|
-
var
|
|
16804
|
+
var import_non_secure52 = require("nanoid/non-secure");
|
|
16805
|
+
var import_ts_dedent51 = require("ts-dedent");
|
|
16514
16806
|
var DEFAULT_CALLBACK_BODY2 = "return item;";
|
|
16515
16807
|
var JSMapNodeImpl = class extends NodeImpl {
|
|
16516
16808
|
static create() {
|
|
16517
16809
|
const chartNode = {
|
|
16518
16810
|
type: "jsMap",
|
|
16519
16811
|
title: "JS Map",
|
|
16520
|
-
id: (0,
|
|
16812
|
+
id: (0, import_non_secure52.nanoid)(),
|
|
16521
16813
|
visualData: {
|
|
16522
16814
|
x: 0,
|
|
16523
16815
|
y: 0,
|
|
@@ -16549,7 +16841,7 @@ var JSMapNodeImpl = class extends NodeImpl {
|
|
|
16549
16841
|
}
|
|
16550
16842
|
static getUIData() {
|
|
16551
16843
|
return {
|
|
16552
|
-
infoBoxBody:
|
|
16844
|
+
infoBoxBody: import_ts_dedent51.dedent`
|
|
16553
16845
|
Maps an input array using the body of a JavaScript callback.
|
|
16554
16846
|
|
|
16555
16847
|
Available callback parameters are <code>item</code>, <code>index</code>, and <code>array</code>.
|
|
@@ -16575,8 +16867,8 @@ var JSMapNodeImpl = class extends NodeImpl {
|
|
|
16575
16867
|
var jsMapNode = nodeDefinition(JSMapNodeImpl, "JS Map");
|
|
16576
16868
|
|
|
16577
16869
|
// src/model/nodes/ObjectNode.ts
|
|
16578
|
-
var
|
|
16579
|
-
var
|
|
16870
|
+
var import_non_secure53 = require("nanoid/non-secure");
|
|
16871
|
+
var import_ts_dedent52 = require("ts-dedent");
|
|
16580
16872
|
var DEFAULT_JSON_TEMPLATE = `{
|
|
16581
16873
|
"key": "{{input}}"
|
|
16582
16874
|
}`;
|
|
@@ -16623,7 +16915,7 @@ var ObjectNodeImpl = class extends NodeImpl {
|
|
|
16623
16915
|
const chartNode = {
|
|
16624
16916
|
type: "object",
|
|
16625
16917
|
title: "Object",
|
|
16626
|
-
id: (0,
|
|
16918
|
+
id: (0, import_non_secure53.nanoid)(),
|
|
16627
16919
|
visualData: {
|
|
16628
16920
|
x: 0,
|
|
16629
16921
|
y: 0,
|
|
@@ -16666,6 +16958,7 @@ var ObjectNodeImpl = class extends NodeImpl {
|
|
|
16666
16958
|
label: "JSON Template",
|
|
16667
16959
|
dataKey: "jsonTemplate",
|
|
16668
16960
|
language: "json",
|
|
16961
|
+
interpolationSyntax: "json-template",
|
|
16669
16962
|
theme: "prompt-interpolation",
|
|
16670
16963
|
enableFolding: true
|
|
16671
16964
|
}
|
|
@@ -16673,7 +16966,7 @@ var ObjectNodeImpl = class extends NodeImpl {
|
|
|
16673
16966
|
}
|
|
16674
16967
|
static getUIData() {
|
|
16675
16968
|
return {
|
|
16676
|
-
infoBoxBody:
|
|
16969
|
+
infoBoxBody: import_ts_dedent52.dedent`
|
|
16677
16970
|
Creates an object from input values and a JSON template, escaping the input values and inserting them into the template.
|
|
16678
16971
|
|
|
16679
16972
|
Use double-quotes around the input values to escape them. String values are automatically escaped.
|
|
@@ -16760,14 +17053,14 @@ var ObjectNodeImpl = class extends NodeImpl {
|
|
|
16760
17053
|
var objectNode = nodeDefinition(ObjectNodeImpl, "Object");
|
|
16761
17054
|
|
|
16762
17055
|
// src/model/nodes/BooleanNode.ts
|
|
16763
|
-
var
|
|
16764
|
-
var
|
|
17056
|
+
var import_non_secure54 = require("nanoid/non-secure");
|
|
17057
|
+
var import_ts_dedent53 = require("ts-dedent");
|
|
16765
17058
|
var BooleanNodeImpl = class extends NodeImpl {
|
|
16766
17059
|
static create() {
|
|
16767
17060
|
const chartNode = {
|
|
16768
17061
|
type: "boolean",
|
|
16769
17062
|
title: "Bool",
|
|
16770
|
-
id: (0,
|
|
17063
|
+
id: (0, import_non_secure54.nanoid)(),
|
|
16771
17064
|
visualData: {
|
|
16772
17065
|
x: 0,
|
|
16773
17066
|
y: 0,
|
|
@@ -16805,7 +17098,7 @@ var BooleanNodeImpl = class extends NodeImpl {
|
|
|
16805
17098
|
}
|
|
16806
17099
|
static getUIData() {
|
|
16807
17100
|
return {
|
|
16808
|
-
infoBoxBody:
|
|
17101
|
+
infoBoxBody: import_ts_dedent53.dedent`
|
|
16809
17102
|
Outputs a boolean constant, or converts an input value into a boolean.
|
|
16810
17103
|
`,
|
|
16811
17104
|
infoBoxTitle: "Bool Node",
|
|
@@ -16826,16 +17119,16 @@ var BooleanNodeImpl = class extends NodeImpl {
|
|
|
16826
17119
|
var booleanNode = nodeDefinition(BooleanNodeImpl, "Boolean");
|
|
16827
17120
|
|
|
16828
17121
|
// src/model/nodes/CompareNode.ts
|
|
16829
|
-
var
|
|
17122
|
+
var import_non_secure55 = require("nanoid/non-secure");
|
|
16830
17123
|
var import_lodash_es13 = require("lodash");
|
|
16831
17124
|
var import_ts_pattern5 = require("ts-pattern");
|
|
16832
|
-
var
|
|
17125
|
+
var import_ts_dedent54 = require("ts-dedent");
|
|
16833
17126
|
var CompareNodeImpl = class extends NodeImpl {
|
|
16834
17127
|
static create() {
|
|
16835
17128
|
const chartNode = {
|
|
16836
17129
|
type: "compare",
|
|
16837
17130
|
title: "Compare",
|
|
16838
|
-
id: (0,
|
|
17131
|
+
id: (0, import_non_secure55.nanoid)(),
|
|
16839
17132
|
visualData: {
|
|
16840
17133
|
x: 0,
|
|
16841
17134
|
y: 0,
|
|
@@ -16907,7 +17200,7 @@ var CompareNodeImpl = class extends NodeImpl {
|
|
|
16907
17200
|
}
|
|
16908
17201
|
static getUIData() {
|
|
16909
17202
|
return {
|
|
16910
|
-
infoBoxBody:
|
|
17203
|
+
infoBoxBody: import_ts_dedent54.dedent`
|
|
16911
17204
|
Compares two values using the configured operator and outputs the result.
|
|
16912
17205
|
|
|
16913
17206
|
If the data types of the values do not match, then the B value is converted to the type of the A value.
|
|
@@ -16948,9 +17241,9 @@ var CompareNodeImpl = class extends NodeImpl {
|
|
|
16948
17241
|
var compareNode = nodeDefinition(CompareNodeImpl, "Compare");
|
|
16949
17242
|
|
|
16950
17243
|
// src/model/nodes/EvaluateNode.ts
|
|
16951
|
-
var
|
|
17244
|
+
var import_non_secure56 = require("nanoid/non-secure");
|
|
16952
17245
|
var import_ts_pattern6 = require("ts-pattern");
|
|
16953
|
-
var
|
|
17246
|
+
var import_ts_dedent55 = require("ts-dedent");
|
|
16954
17247
|
var unaryOperation = ["abs", "negate"];
|
|
16955
17248
|
var isUnaryOp = (operation) => unaryOperation.includes(operation);
|
|
16956
17249
|
var EvaluateNodeImpl = class extends NodeImpl {
|
|
@@ -16958,7 +17251,7 @@ var EvaluateNodeImpl = class extends NodeImpl {
|
|
|
16958
17251
|
const chartNode = {
|
|
16959
17252
|
type: "evaluate",
|
|
16960
17253
|
title: "Evaluate",
|
|
16961
|
-
id: (0,
|
|
17254
|
+
id: (0, import_non_secure56.nanoid)(),
|
|
16962
17255
|
visualData: {
|
|
16963
17256
|
x: 0,
|
|
16964
17257
|
y: 0,
|
|
@@ -17036,7 +17329,7 @@ var EvaluateNodeImpl = class extends NodeImpl {
|
|
|
17036
17329
|
}
|
|
17037
17330
|
static getUIData() {
|
|
17038
17331
|
return {
|
|
17039
|
-
infoBoxBody:
|
|
17332
|
+
infoBoxBody: import_ts_dedent55.dedent`
|
|
17040
17333
|
Evaluates the configured mathematical operation on the input values and outputs the result.
|
|
17041
17334
|
|
|
17042
17335
|
For more complex operations, you should use the \`Code\` node.
|
|
@@ -17072,14 +17365,14 @@ var EvaluateNodeImpl = class extends NodeImpl {
|
|
|
17072
17365
|
var evaluateNode = nodeDefinition(EvaluateNodeImpl, "Evaluate");
|
|
17073
17366
|
|
|
17074
17367
|
// src/model/nodes/NumberNode.ts
|
|
17075
|
-
var
|
|
17076
|
-
var
|
|
17368
|
+
var import_non_secure57 = require("nanoid/non-secure");
|
|
17369
|
+
var import_ts_dedent56 = require("ts-dedent");
|
|
17077
17370
|
var NumberNodeImpl = class extends NodeImpl {
|
|
17078
17371
|
static create() {
|
|
17079
17372
|
const chartNode = {
|
|
17080
17373
|
type: "number",
|
|
17081
17374
|
title: "Number",
|
|
17082
|
-
id: (0,
|
|
17375
|
+
id: (0, import_non_secure57.nanoid)(),
|
|
17083
17376
|
visualData: {
|
|
17084
17377
|
x: 0,
|
|
17085
17378
|
y: 0,
|
|
@@ -17123,7 +17416,7 @@ var NumberNodeImpl = class extends NodeImpl {
|
|
|
17123
17416
|
}
|
|
17124
17417
|
static getUIData() {
|
|
17125
17418
|
return {
|
|
17126
|
-
infoBoxBody:
|
|
17419
|
+
infoBoxBody: import_ts_dedent56.dedent`
|
|
17127
17420
|
Outputs a number constant, or converts an input value into a number.
|
|
17128
17421
|
|
|
17129
17422
|
Can be configured to round the number to a certain number of decimal places.
|
|
@@ -17150,8 +17443,8 @@ var NumberNodeImpl = class extends NodeImpl {
|
|
|
17150
17443
|
var numberNode = nodeDefinition(NumberNodeImpl, "Number");
|
|
17151
17444
|
|
|
17152
17445
|
// src/model/nodes/RandomNumberNode.ts
|
|
17153
|
-
var
|
|
17154
|
-
var
|
|
17446
|
+
var import_non_secure58 = require("nanoid/non-secure");
|
|
17447
|
+
var import_ts_dedent57 = require("ts-dedent");
|
|
17155
17448
|
var randomNumberTypeOptions = [
|
|
17156
17449
|
{ value: false, label: "Float" },
|
|
17157
17450
|
{ value: true, label: "Integer" }
|
|
@@ -17161,7 +17454,7 @@ var RandomNumberNodeImpl = class extends NodeImpl {
|
|
|
17161
17454
|
const chartNode = {
|
|
17162
17455
|
type: "randomNumber",
|
|
17163
17456
|
title: "Random number",
|
|
17164
|
-
id: (0,
|
|
17457
|
+
id: (0, import_non_secure58.nanoid)(),
|
|
17165
17458
|
visualData: {
|
|
17166
17459
|
x: 0,
|
|
17167
17460
|
y: 0,
|
|
@@ -17219,7 +17512,7 @@ var RandomNumberNodeImpl = class extends NodeImpl {
|
|
|
17219
17512
|
];
|
|
17220
17513
|
}
|
|
17221
17514
|
getBody() {
|
|
17222
|
-
return
|
|
17515
|
+
return import_ts_dedent57.dedent`
|
|
17223
17516
|
Min: ${this.data.useMinInput ? "(Input)" : this.data.min ?? 0}
|
|
17224
17517
|
Max: ${this.data.useMaxInput ? "(Input)" : this.data.max ?? 1}
|
|
17225
17518
|
${this.data.integers ? "Integers" : "Floats"}
|
|
@@ -17228,7 +17521,7 @@ var RandomNumberNodeImpl = class extends NodeImpl {
|
|
|
17228
17521
|
}
|
|
17229
17522
|
static getUIData() {
|
|
17230
17523
|
return {
|
|
17231
|
-
infoBoxBody:
|
|
17524
|
+
infoBoxBody: import_ts_dedent57.dedent`
|
|
17232
17525
|
Outputs a random number between the configured min and max values.
|
|
17233
17526
|
|
|
17234
17527
|
Can be configured to output only integers, and whether the max value is inclusive or exclusive.
|
|
@@ -17259,15 +17552,15 @@ var RandomNumberNodeImpl = class extends NodeImpl {
|
|
|
17259
17552
|
var randomNumberNode = nodeDefinition(RandomNumberNodeImpl, "Random number");
|
|
17260
17553
|
|
|
17261
17554
|
// src/model/nodes/ShuffleNode.ts
|
|
17262
|
-
var
|
|
17555
|
+
var import_non_secure59 = require("nanoid/non-secure");
|
|
17263
17556
|
var import_lodash_es14 = require("lodash");
|
|
17264
|
-
var
|
|
17557
|
+
var import_ts_dedent58 = require("ts-dedent");
|
|
17265
17558
|
var ShuffleNodeImpl = class extends NodeImpl {
|
|
17266
17559
|
static create() {
|
|
17267
17560
|
const chartNode = {
|
|
17268
17561
|
type: "shuffle",
|
|
17269
17562
|
title: "Shuffle",
|
|
17270
|
-
id: (0,
|
|
17563
|
+
id: (0, import_non_secure59.nanoid)(),
|
|
17271
17564
|
visualData: {
|
|
17272
17565
|
x: 0,
|
|
17273
17566
|
y: 0,
|
|
@@ -17297,7 +17590,7 @@ var ShuffleNodeImpl = class extends NodeImpl {
|
|
|
17297
17590
|
}
|
|
17298
17591
|
static getUIData() {
|
|
17299
17592
|
return {
|
|
17300
|
-
infoBoxBody:
|
|
17593
|
+
infoBoxBody: import_ts_dedent58.dedent`
|
|
17301
17594
|
Shuffles the input array. Outputs the shuffled array.
|
|
17302
17595
|
`,
|
|
17303
17596
|
infoBoxTitle: "Shuffle Node",
|
|
@@ -17321,14 +17614,14 @@ var ShuffleNodeImpl = class extends NodeImpl {
|
|
|
17321
17614
|
var shuffleNode = nodeDefinition(ShuffleNodeImpl, "Shuffle");
|
|
17322
17615
|
|
|
17323
17616
|
// src/model/nodes/CommentNode.ts
|
|
17324
|
-
var
|
|
17325
|
-
var
|
|
17617
|
+
var import_non_secure60 = require("nanoid/non-secure");
|
|
17618
|
+
var import_ts_dedent59 = require("ts-dedent");
|
|
17326
17619
|
var CommentNodeImpl = class extends NodeImpl {
|
|
17327
17620
|
static create() {
|
|
17328
17621
|
const chartNode = {
|
|
17329
17622
|
type: "comment",
|
|
17330
17623
|
title: "Comment",
|
|
17331
|
-
id: (0,
|
|
17624
|
+
id: (0, import_non_secure60.nanoid)(),
|
|
17332
17625
|
visualData: {
|
|
17333
17626
|
x: 0,
|
|
17334
17627
|
y: 0,
|
|
@@ -17338,7 +17631,7 @@ var CommentNodeImpl = class extends NodeImpl {
|
|
|
17338
17631
|
text: "",
|
|
17339
17632
|
height: 600,
|
|
17340
17633
|
color: "rgba(255,255,255,1)",
|
|
17341
|
-
backgroundColor: "rgba(
|
|
17634
|
+
backgroundColor: "rgba(128,128,128,0.05)"
|
|
17342
17635
|
}
|
|
17343
17636
|
};
|
|
17344
17637
|
return chartNode;
|
|
@@ -17374,7 +17667,7 @@ var CommentNodeImpl = class extends NodeImpl {
|
|
|
17374
17667
|
}
|
|
17375
17668
|
static getUIData() {
|
|
17376
17669
|
return {
|
|
17377
|
-
infoBoxBody:
|
|
17670
|
+
infoBoxBody: import_ts_dedent59.dedent`
|
|
17378
17671
|
A comment node is a node that does nothing. It is useful for adding notes to a graph.
|
|
17379
17672
|
`,
|
|
17380
17673
|
infoBoxTitle: "Comment Node",
|
|
@@ -17389,11 +17682,11 @@ var CommentNodeImpl = class extends NodeImpl {
|
|
|
17389
17682
|
var commentNode = nodeDefinition(CommentNodeImpl, "Comment");
|
|
17390
17683
|
|
|
17391
17684
|
// src/model/nodes/ImageNode.ts
|
|
17392
|
-
var
|
|
17685
|
+
var import_non_secure61 = require("nanoid/non-secure");
|
|
17393
17686
|
var ImageNodeImpl = class extends NodeImpl {
|
|
17394
17687
|
static create() {
|
|
17395
17688
|
return {
|
|
17396
|
-
id: (0,
|
|
17689
|
+
id: (0, import_non_secure61.nanoid)(),
|
|
17397
17690
|
type: "image",
|
|
17398
17691
|
title: "Image",
|
|
17399
17692
|
visualData: { x: 0, y: 0, width: 250 },
|
|
@@ -17490,11 +17783,11 @@ var ImageNodeImpl = class extends NodeImpl {
|
|
|
17490
17783
|
var imageNode = nodeDefinition(ImageNodeImpl, "Image");
|
|
17491
17784
|
|
|
17492
17785
|
// src/model/nodes/AudioNode.ts
|
|
17493
|
-
var
|
|
17786
|
+
var import_non_secure62 = require("nanoid/non-secure");
|
|
17494
17787
|
var AudioNodeImpl = class extends NodeImpl {
|
|
17495
17788
|
static create() {
|
|
17496
17789
|
return {
|
|
17497
|
-
id: (0,
|
|
17790
|
+
id: (0, import_non_secure62.nanoid)(),
|
|
17498
17791
|
type: "audio",
|
|
17499
17792
|
title: "Audio",
|
|
17500
17793
|
visualData: { x: 0, y: 0, width: 300 },
|
|
@@ -17587,7 +17880,7 @@ var AudioNodeImpl = class extends NodeImpl {
|
|
|
17587
17880
|
var audioNode = nodeDefinition(AudioNodeImpl, "Audio");
|
|
17588
17881
|
|
|
17589
17882
|
// src/model/nodes/HttpCallNode.ts
|
|
17590
|
-
var
|
|
17883
|
+
var import_non_secure63 = require("nanoid/non-secure");
|
|
17591
17884
|
var REQUEST_FAILED_OUTPUT_ID = "requestFailed";
|
|
17592
17885
|
var REQUEST_ERROR_OUTPUT_ID = "requestError";
|
|
17593
17886
|
var STATUS_CODE_OUTPUT_ID = "statusCode";
|
|
@@ -17816,7 +18109,7 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
17816
18109
|
const chartNode = {
|
|
17817
18110
|
type: "httpCall",
|
|
17818
18111
|
title: "Http Call",
|
|
17819
|
-
id: (0,
|
|
18112
|
+
id: (0, import_non_secure63.nanoid)(),
|
|
17820
18113
|
visualData: {
|
|
17821
18114
|
x: 0,
|
|
17822
18115
|
y: 0,
|
|
@@ -18156,14 +18449,14 @@ var HttpCallNodeImpl = class extends NodeImpl {
|
|
|
18156
18449
|
var httpCallNode = nodeDefinition(HttpCallNodeImpl, "Http Call");
|
|
18157
18450
|
|
|
18158
18451
|
// src/model/nodes/DelayNode.ts
|
|
18159
|
-
var
|
|
18160
|
-
var
|
|
18452
|
+
var import_non_secure64 = require("nanoid/non-secure");
|
|
18453
|
+
var import_ts_dedent60 = require("ts-dedent");
|
|
18161
18454
|
var DelayNodeImpl = class extends NodeImpl {
|
|
18162
18455
|
static create() {
|
|
18163
18456
|
const chartNode = {
|
|
18164
18457
|
type: "delay",
|
|
18165
18458
|
title: "Delay",
|
|
18166
|
-
id: (0,
|
|
18459
|
+
id: (0, import_non_secure64.nanoid)(),
|
|
18167
18460
|
visualData: {
|
|
18168
18461
|
x: 0,
|
|
18169
18462
|
y: 0,
|
|
@@ -18208,7 +18501,7 @@ var DelayNodeImpl = class extends NodeImpl {
|
|
|
18208
18501
|
}
|
|
18209
18502
|
static getUIData() {
|
|
18210
18503
|
return {
|
|
18211
|
-
infoBoxBody:
|
|
18504
|
+
infoBoxBody: import_ts_dedent60.dedent`
|
|
18212
18505
|
Delays the execution and then passes the input value to the output without any modifications.
|
|
18213
18506
|
`,
|
|
18214
18507
|
infoBoxTitle: "Delay Node",
|
|
@@ -18259,12 +18552,12 @@ var DelayNodeImpl = class extends NodeImpl {
|
|
|
18259
18552
|
var delayNode = nodeDefinition(DelayNodeImpl, "Delay");
|
|
18260
18553
|
|
|
18261
18554
|
// src/model/nodes/AppendToDatasetNode.ts
|
|
18262
|
-
var
|
|
18263
|
-
var
|
|
18555
|
+
var import_non_secure65 = require("nanoid/non-secure");
|
|
18556
|
+
var import_ts_dedent61 = require("ts-dedent");
|
|
18264
18557
|
var AppendToDatasetNodeImpl = class extends NodeImpl {
|
|
18265
18558
|
static create() {
|
|
18266
18559
|
return {
|
|
18267
|
-
id: (0,
|
|
18560
|
+
id: (0, import_non_secure65.nanoid)(),
|
|
18268
18561
|
type: "appendToDataset",
|
|
18269
18562
|
title: "Append to Dataset",
|
|
18270
18563
|
visualData: { x: 0, y: 0, width: 250 },
|
|
@@ -18320,7 +18613,7 @@ var AppendToDatasetNodeImpl = class extends NodeImpl {
|
|
|
18320
18613
|
}
|
|
18321
18614
|
static getUIData() {
|
|
18322
18615
|
return {
|
|
18323
|
-
infoBoxBody:
|
|
18616
|
+
infoBoxBody: import_ts_dedent61.dedent`
|
|
18324
18617
|
Appends a row of data to the specified dataset.
|
|
18325
18618
|
`,
|
|
18326
18619
|
infoBoxTitle: "Append to Dataset Node",
|
|
@@ -18870,14 +19163,14 @@ var GetDatasetRowNodeImpl = class extends NodeImpl {
|
|
|
18870
19163
|
var getDatasetRowNode = nodeDefinition(GetDatasetRowNodeImpl, "Get Dataset Row");
|
|
18871
19164
|
|
|
18872
19165
|
// src/model/nodes/SliceNode.ts
|
|
18873
|
-
var
|
|
18874
|
-
var
|
|
19166
|
+
var import_non_secure66 = require("nanoid/non-secure");
|
|
19167
|
+
var import_ts_dedent62 = require("ts-dedent");
|
|
18875
19168
|
var SliceNodeImpl = class extends NodeImpl {
|
|
18876
19169
|
static create() {
|
|
18877
19170
|
const chartNode = {
|
|
18878
19171
|
type: "slice",
|
|
18879
19172
|
title: "Slice",
|
|
18880
|
-
id: (0,
|
|
19173
|
+
id: (0, import_non_secure66.nanoid)(),
|
|
18881
19174
|
visualData: {
|
|
18882
19175
|
x: 0,
|
|
18883
19176
|
y: 0,
|
|
@@ -18930,14 +19223,14 @@ var SliceNodeImpl = class extends NodeImpl {
|
|
|
18930
19223
|
];
|
|
18931
19224
|
}
|
|
18932
19225
|
getBody() {
|
|
18933
|
-
return
|
|
19226
|
+
return import_ts_dedent62.dedent`
|
|
18934
19227
|
Start: ${this.data.useStartInput ? "(Using Input)" : this.data.start == null ? "0" : this.data.start}
|
|
18935
19228
|
Count: ${this.data.useCountInput ? "(Using Input)" : this.data.count == null ? "All" : this.data.count}
|
|
18936
19229
|
`;
|
|
18937
19230
|
}
|
|
18938
19231
|
static getUIData() {
|
|
18939
19232
|
return {
|
|
18940
|
-
infoBoxBody:
|
|
19233
|
+
infoBoxBody: import_ts_dedent62.dedent`
|
|
18941
19234
|
Slices an array from the start index for the count number of elements.
|
|
18942
19235
|
|
|
18943
19236
|
Useful for extracting a portion of an array.
|
|
@@ -18963,14 +19256,14 @@ var SliceNodeImpl = class extends NodeImpl {
|
|
|
18963
19256
|
var sliceNode = nodeDefinition(SliceNodeImpl, "Slice");
|
|
18964
19257
|
|
|
18965
19258
|
// src/model/nodes/ExtractMarkdownCodeBlocksNode.ts
|
|
18966
|
-
var
|
|
18967
|
-
var
|
|
19259
|
+
var import_non_secure67 = require("nanoid/non-secure");
|
|
19260
|
+
var import_ts_dedent63 = require("ts-dedent");
|
|
18968
19261
|
var ExtractMarkdownCodeBlocksNodeImpl = class extends NodeImpl {
|
|
18969
19262
|
static create() {
|
|
18970
19263
|
const chartNode = {
|
|
18971
19264
|
type: "extractMarkdownCodeBlocks",
|
|
18972
19265
|
title: "Extract Markdown Code Blocks",
|
|
18973
|
-
id: (0,
|
|
19266
|
+
id: (0, import_non_secure67.nanoid)(),
|
|
18974
19267
|
visualData: {
|
|
18975
19268
|
x: 0,
|
|
18976
19269
|
y: 0,
|
|
@@ -19011,7 +19304,7 @@ var ExtractMarkdownCodeBlocksNodeImpl = class extends NodeImpl {
|
|
|
19011
19304
|
}
|
|
19012
19305
|
static getUIData() {
|
|
19013
19306
|
return {
|
|
19014
|
-
infoBoxBody:
|
|
19307
|
+
infoBoxBody: import_ts_dedent63.dedent`
|
|
19015
19308
|
Extracts the code blocks in the input Markdown text.
|
|
19016
19309
|
|
|
19017
19310
|
Outputs the first matched block, all matched blocks, and the languages specified for the blocks.
|
|
@@ -19062,7 +19355,7 @@ var extractMarkdownCodeBlocksNode = nodeDefinition(
|
|
|
19062
19355
|
);
|
|
19063
19356
|
|
|
19064
19357
|
// src/model/nodes/AssembleMessageNode.ts
|
|
19065
|
-
var
|
|
19358
|
+
var import_non_secure68 = require("nanoid/non-secure");
|
|
19066
19359
|
var import_lodash_es15 = require("lodash");
|
|
19067
19360
|
var import_ts_pattern7 = require("ts-pattern");
|
|
19068
19361
|
var messageTypeToTitle = {
|
|
@@ -19076,7 +19369,7 @@ var AssembleMessageNodeImpl = class extends NodeImpl {
|
|
|
19076
19369
|
const chartNode = {
|
|
19077
19370
|
type: "assembleMessage",
|
|
19078
19371
|
title: "Assemble Message",
|
|
19079
|
-
id: (0,
|
|
19372
|
+
id: (0, import_non_secure68.nanoid)(),
|
|
19080
19373
|
visualData: {
|
|
19081
19374
|
x: 0,
|
|
19082
19375
|
y: 0,
|
|
@@ -19273,13 +19566,13 @@ var AssembleMessageNodeImpl = class extends NodeImpl {
|
|
|
19273
19566
|
var assembleMessageNode = nodeDefinition(AssembleMessageNodeImpl, "Assemble Prompt");
|
|
19274
19567
|
|
|
19275
19568
|
// src/model/nodes/URLReferenceNode.ts
|
|
19276
|
-
var
|
|
19569
|
+
var import_non_secure69 = require("nanoid/non-secure");
|
|
19277
19570
|
var UrlReferenceNodeImpl = class extends NodeImpl {
|
|
19278
19571
|
static create() {
|
|
19279
19572
|
const chartNode = {
|
|
19280
19573
|
type: "urlReference",
|
|
19281
19574
|
title: "URL Reference",
|
|
19282
|
-
id: (0,
|
|
19575
|
+
id: (0, import_non_secure69.nanoid)(),
|
|
19283
19576
|
visualData: {
|
|
19284
19577
|
x: 0,
|
|
19285
19578
|
y: 0,
|
|
@@ -19348,15 +19641,15 @@ var UrlReferenceNodeImpl = class extends NodeImpl {
|
|
|
19348
19641
|
var urlReferenceNode = nodeDefinition(UrlReferenceNodeImpl, "URL Reference");
|
|
19349
19642
|
|
|
19350
19643
|
// src/model/nodes/DestructureNode.ts
|
|
19351
|
-
var
|
|
19644
|
+
var import_non_secure70 = require("nanoid/non-secure");
|
|
19352
19645
|
var import_jsonpath_plus3 = require("jsonpath-plus");
|
|
19353
|
-
var
|
|
19646
|
+
var import_ts_dedent64 = require("ts-dedent");
|
|
19354
19647
|
var DestructureNodeImpl = class extends NodeImpl {
|
|
19355
19648
|
static create() {
|
|
19356
19649
|
const chartNode = {
|
|
19357
19650
|
type: "destructure",
|
|
19358
19651
|
title: "Destructure",
|
|
19359
|
-
id: (0,
|
|
19652
|
+
id: (0, import_non_secure70.nanoid)(),
|
|
19360
19653
|
visualData: {
|
|
19361
19654
|
x: 0,
|
|
19362
19655
|
y: 0,
|
|
@@ -19364,7 +19657,7 @@ var DestructureNodeImpl = class extends NodeImpl {
|
|
|
19364
19657
|
},
|
|
19365
19658
|
data: {
|
|
19366
19659
|
paths: ["$.value"],
|
|
19367
|
-
pathPortIds: [(0,
|
|
19660
|
+
pathPortIds: [(0, import_non_secure70.nanoid)()]
|
|
19368
19661
|
}
|
|
19369
19662
|
};
|
|
19370
19663
|
return chartNode;
|
|
@@ -19418,7 +19711,7 @@ var DestructureNodeImpl = class extends NodeImpl {
|
|
|
19418
19711
|
}
|
|
19419
19712
|
static getUIData() {
|
|
19420
19713
|
return {
|
|
19421
|
-
infoBoxBody:
|
|
19714
|
+
infoBoxBody: import_ts_dedent64.dedent`
|
|
19422
19715
|
Destructures the input value by extracting values at the specified paths. The paths use JSONPath notation to navigate through the value.
|
|
19423
19716
|
`,
|
|
19424
19717
|
infoBoxTitle: "Destructure Node",
|
|
@@ -19452,12 +19745,12 @@ var DestructureNodeImpl = class extends NodeImpl {
|
|
|
19452
19745
|
var destructureNode = nodeDefinition(DestructureNodeImpl, "Destructure");
|
|
19453
19746
|
|
|
19454
19747
|
// src/model/nodes/ReplaceDatasetNode.ts
|
|
19455
|
-
var
|
|
19456
|
-
var
|
|
19748
|
+
var import_non_secure71 = require("nanoid/non-secure");
|
|
19749
|
+
var import_ts_dedent65 = require("ts-dedent");
|
|
19457
19750
|
var ReplaceDatasetNodeImpl = class extends NodeImpl {
|
|
19458
19751
|
static create() {
|
|
19459
19752
|
return {
|
|
19460
|
-
id: (0,
|
|
19753
|
+
id: (0, import_non_secure71.nanoid)(),
|
|
19461
19754
|
type: "replaceDataset",
|
|
19462
19755
|
title: "Replace Dataset",
|
|
19463
19756
|
visualData: { x: 0, y: 0, width: 250 },
|
|
@@ -19496,7 +19789,7 @@ var ReplaceDatasetNodeImpl = class extends NodeImpl {
|
|
|
19496
19789
|
}
|
|
19497
19790
|
static getUIData() {
|
|
19498
19791
|
return {
|
|
19499
|
-
infoBoxBody:
|
|
19792
|
+
infoBoxBody: import_ts_dedent65.dedent`
|
|
19500
19793
|
Replaces the data in a dataset with the given data. If no data is given, the dataset will be cleared instead.
|
|
19501
19794
|
`,
|
|
19502
19795
|
infoBoxTitle: "Replace Dataset Node",
|
|
@@ -19628,14 +19921,14 @@ var ListGraphsNodeImpl = class extends NodeImpl {
|
|
|
19628
19921
|
var listGraphsNode = nodeDefinition(ListGraphsNodeImpl, "List Graphs");
|
|
19629
19922
|
|
|
19630
19923
|
// src/model/nodes/GraphReferenceNode.ts
|
|
19631
|
-
var
|
|
19632
|
-
var
|
|
19924
|
+
var import_non_secure72 = require("nanoid/non-secure");
|
|
19925
|
+
var import_ts_dedent66 = require("ts-dedent");
|
|
19633
19926
|
var GraphReferenceNodeImpl = class extends NodeImpl {
|
|
19634
19927
|
static create() {
|
|
19635
19928
|
const chartNode = {
|
|
19636
19929
|
type: "graphReference",
|
|
19637
19930
|
title: "Graph Reference",
|
|
19638
|
-
id: (0,
|
|
19931
|
+
id: (0, import_non_secure72.nanoid)(),
|
|
19639
19932
|
visualData: {
|
|
19640
19933
|
x: 0,
|
|
19641
19934
|
y: 0,
|
|
@@ -19684,7 +19977,7 @@ var GraphReferenceNodeImpl = class extends NodeImpl {
|
|
|
19684
19977
|
}
|
|
19685
19978
|
static getUIData() {
|
|
19686
19979
|
return {
|
|
19687
|
-
infoBoxBody:
|
|
19980
|
+
infoBoxBody: import_ts_dedent66.dedent`
|
|
19688
19981
|
Gets a reference to another graph, that can be used to pass around graphs to call using a Call Graph node.
|
|
19689
19982
|
`,
|
|
19690
19983
|
infoBoxTitle: "Graph Reference Node",
|
|
@@ -19750,8 +20043,8 @@ var GraphReferenceNodeImpl = class extends NodeImpl {
|
|
|
19750
20043
|
var graphReferenceNode = nodeDefinition(GraphReferenceNodeImpl, "Graph Reference");
|
|
19751
20044
|
|
|
19752
20045
|
// src/model/nodes/CallGraphNode.ts
|
|
19753
|
-
var
|
|
19754
|
-
var
|
|
20046
|
+
var import_non_secure73 = require("nanoid/non-secure");
|
|
20047
|
+
var import_ts_dedent67 = require("ts-dedent");
|
|
19755
20048
|
|
|
19756
20049
|
// src/api/looseDataValue.ts
|
|
19757
20050
|
var import_lodash_es16 = require("lodash");
|
|
@@ -19777,7 +20070,7 @@ var CallGraphNodeImpl = class extends NodeImpl {
|
|
|
19777
20070
|
const chartNode = {
|
|
19778
20071
|
type: "callGraph",
|
|
19779
20072
|
title: "Call Graph",
|
|
19780
|
-
id: (0,
|
|
20073
|
+
id: (0, import_non_secure73.nanoid)(),
|
|
19781
20074
|
visualData: {
|
|
19782
20075
|
x: 0,
|
|
19783
20076
|
y: 0,
|
|
@@ -19827,7 +20120,7 @@ var CallGraphNodeImpl = class extends NodeImpl {
|
|
|
19827
20120
|
}
|
|
19828
20121
|
static getUIData() {
|
|
19829
20122
|
return {
|
|
19830
|
-
infoBoxBody:
|
|
20123
|
+
infoBoxBody: import_ts_dedent67.dedent`
|
|
19831
20124
|
Calls another graph and passes inputs to it. Use in combination with the Graph Reference node to call dynamic graphs.
|
|
19832
20125
|
`,
|
|
19833
20126
|
infoBoxTitle: "Call Graph Node",
|
|
@@ -19899,7 +20192,7 @@ var callGraphNode = nodeDefinition(CallGraphNodeImpl, "Call Graph");
|
|
|
19899
20192
|
|
|
19900
20193
|
// src/model/nodes/DelegateFunctionCallNode.ts
|
|
19901
20194
|
var import_nanoid = require("nanoid");
|
|
19902
|
-
var
|
|
20195
|
+
var import_ts_dedent68 = require("ts-dedent");
|
|
19903
20196
|
var DelegateFunctionCallNodeImpl = class extends NodeImpl {
|
|
19904
20197
|
static create() {
|
|
19905
20198
|
const chartNode = {
|
|
@@ -19951,7 +20244,7 @@ var DelegateFunctionCallNodeImpl = class extends NodeImpl {
|
|
|
19951
20244
|
}
|
|
19952
20245
|
static getUIData() {
|
|
19953
20246
|
return {
|
|
19954
|
-
infoBoxBody:
|
|
20247
|
+
infoBoxBody: import_ts_dedent68.dedent`
|
|
19955
20248
|
Handles a tool call by delegating it to a different subgraph depending on the tool call.
|
|
19956
20249
|
`,
|
|
19957
20250
|
infoBoxTitle: "Delegate Tool Call Node",
|
|
@@ -20072,11 +20365,11 @@ function buildDelegatedToolCallOutputs(records) {
|
|
|
20072
20365
|
var delegateFunctionCallNode = nodeDefinition(DelegateFunctionCallNodeImpl, "Delegate Tool Call");
|
|
20073
20366
|
|
|
20074
20367
|
// src/model/nodes/PlayAudioNode.ts
|
|
20075
|
-
var
|
|
20368
|
+
var import_non_secure74 = require("nanoid/non-secure");
|
|
20076
20369
|
var PlayAudioNodeImpl = class extends NodeImpl {
|
|
20077
20370
|
static create() {
|
|
20078
20371
|
return {
|
|
20079
|
-
id: (0,
|
|
20372
|
+
id: (0, import_non_secure74.nanoid)(),
|
|
20080
20373
|
type: "playAudio",
|
|
20081
20374
|
title: "Play Audio",
|
|
20082
20375
|
visualData: { x: 0, y: 0, width: 200 },
|
|
@@ -20130,11 +20423,11 @@ var PlayAudioNodeImpl = class extends NodeImpl {
|
|
|
20130
20423
|
var playAudioNode = nodeDefinition(PlayAudioNodeImpl, "Play Audio");
|
|
20131
20424
|
|
|
20132
20425
|
// src/model/nodes/DocumentNode.ts
|
|
20133
|
-
var
|
|
20426
|
+
var import_non_secure75 = require("nanoid/non-secure");
|
|
20134
20427
|
var DocumentNodeImpl = class extends NodeImpl {
|
|
20135
20428
|
static create() {
|
|
20136
20429
|
return {
|
|
20137
|
-
id: (0,
|
|
20430
|
+
id: (0, import_non_secure75.nanoid)(),
|
|
20138
20431
|
type: "document",
|
|
20139
20432
|
title: "Document",
|
|
20140
20433
|
visualData: { x: 0, y: 0, width: 300 },
|
|
@@ -20300,14 +20593,14 @@ var DocumentNodeImpl = class extends NodeImpl {
|
|
|
20300
20593
|
var documentNode = nodeDefinition(DocumentNodeImpl, "Document");
|
|
20301
20594
|
|
|
20302
20595
|
// src/model/nodes/ChatLoopNode.ts
|
|
20303
|
-
var
|
|
20304
|
-
var
|
|
20596
|
+
var import_non_secure76 = require("nanoid/non-secure");
|
|
20597
|
+
var import_ts_dedent69 = require("ts-dedent");
|
|
20305
20598
|
var ChatLoopNodeImpl = class extends NodeImpl {
|
|
20306
20599
|
static create() {
|
|
20307
20600
|
const chartNode = {
|
|
20308
20601
|
type: "chatLoop",
|
|
20309
20602
|
title: "Chat Loop",
|
|
20310
|
-
id: (0,
|
|
20603
|
+
id: (0, import_non_secure76.nanoid)(),
|
|
20311
20604
|
visualData: {
|
|
20312
20605
|
x: 0,
|
|
20313
20606
|
y: 0,
|
|
@@ -20340,7 +20633,7 @@ var ChatLoopNodeImpl = class extends NodeImpl {
|
|
|
20340
20633
|
}
|
|
20341
20634
|
static getUIData() {
|
|
20342
20635
|
return {
|
|
20343
|
-
infoBoxBody:
|
|
20636
|
+
infoBoxBody: import_ts_dedent69.dedent`
|
|
20344
20637
|
Creates an interactive chat loop with an AI model. The node will:
|
|
20345
20638
|
1. Send the initial prompt to the AI
|
|
20346
20639
|
2. Show the AI's response and prompt for user input
|
|
@@ -20440,12 +20733,12 @@ var ChatLoopNodeImpl = class extends NodeImpl {
|
|
|
20440
20733
|
var chatLoopNode = nodeDefinition(ChatLoopNodeImpl, "Chat Loop");
|
|
20441
20734
|
|
|
20442
20735
|
// src/model/nodes/ReadAllFilesNode.ts
|
|
20443
|
-
var
|
|
20444
|
-
var
|
|
20736
|
+
var import_non_secure77 = require("nanoid/non-secure");
|
|
20737
|
+
var import_ts_dedent70 = require("ts-dedent");
|
|
20445
20738
|
var ReadAllFilesNodeImpl = class extends NodeImpl {
|
|
20446
20739
|
static create() {
|
|
20447
20740
|
return {
|
|
20448
|
-
id: (0,
|
|
20741
|
+
id: (0, import_non_secure77.nanoid)(),
|
|
20449
20742
|
type: "readAllFiles",
|
|
20450
20743
|
title: "Read All Files",
|
|
20451
20744
|
visualData: { x: 0, y: 0, width: 250 },
|
|
@@ -20556,7 +20849,7 @@ var ReadAllFilesNodeImpl = class extends NodeImpl {
|
|
|
20556
20849
|
];
|
|
20557
20850
|
}
|
|
20558
20851
|
getBody() {
|
|
20559
|
-
return
|
|
20852
|
+
return import_ts_dedent70.dedent`
|
|
20560
20853
|
${this.data.asBinary ? "Read as Binary" : "Read as Text"}
|
|
20561
20854
|
Path: ${this.data.usePathInput ? "(Input)" : this.data.path}
|
|
20562
20855
|
Recursive: ${this.data.useRecursiveInput ? "(Input)" : this.data.recursive}
|
|
@@ -20565,7 +20858,7 @@ var ReadAllFilesNodeImpl = class extends NodeImpl {
|
|
|
20565
20858
|
}
|
|
20566
20859
|
static getUIData() {
|
|
20567
20860
|
return {
|
|
20568
|
-
infoBoxBody:
|
|
20861
|
+
infoBoxBody: import_ts_dedent70.dedent`
|
|
20569
20862
|
Reads all files in the specified directory and outputs an array of objects containing each file's path and contents.
|
|
20570
20863
|
Each object has a 'path' (string) and 'content' (string or binary) property.
|
|
20571
20864
|
`,
|
|
@@ -20638,14 +20931,14 @@ var ReadAllFilesNodeImpl = class extends NodeImpl {
|
|
|
20638
20931
|
var readAllFilesNode = nodeDefinition(ReadAllFilesNodeImpl, "Read All Files");
|
|
20639
20932
|
|
|
20640
20933
|
// src/model/nodes/ToMarkdownTableNode.ts
|
|
20641
|
-
var
|
|
20642
|
-
var
|
|
20934
|
+
var import_non_secure78 = require("nanoid/non-secure");
|
|
20935
|
+
var import_ts_dedent71 = require("ts-dedent");
|
|
20643
20936
|
var ToMarkdownTableNodeImpl = class extends NodeImpl {
|
|
20644
20937
|
static create() {
|
|
20645
20938
|
const chartNode = {
|
|
20646
20939
|
type: "toMarkdownTable",
|
|
20647
20940
|
title: "To Markdown Table",
|
|
20648
|
-
id: (0,
|
|
20941
|
+
id: (0, import_non_secure78.nanoid)(),
|
|
20649
20942
|
visualData: {
|
|
20650
20943
|
x: 0,
|
|
20651
20944
|
y: 0,
|
|
@@ -20701,7 +20994,7 @@ var ToMarkdownTableNodeImpl = class extends NodeImpl {
|
|
|
20701
20994
|
}
|
|
20702
20995
|
static getUIData() {
|
|
20703
20996
|
return {
|
|
20704
|
-
infoBoxBody:
|
|
20997
|
+
infoBoxBody: import_ts_dedent71.dedent`
|
|
20705
20998
|
Converts an array of objects into a markdown table format.
|
|
20706
20999
|
Input should be an array of objects with consistent keys.
|
|
20707
21000
|
`,
|
|
@@ -20753,7 +21046,7 @@ var toMarkdownTableNode = nodeDefinition(ToMarkdownTableNodeImpl, "To Markdown T
|
|
|
20753
21046
|
|
|
20754
21047
|
// src/model/nodes/CronNode.ts
|
|
20755
21048
|
var import_nanoid2 = require("nanoid");
|
|
20756
|
-
var
|
|
21049
|
+
var import_ts_dedent72 = require("ts-dedent");
|
|
20757
21050
|
var cronParser = __toESM(require("cron-parser"), 1);
|
|
20758
21051
|
var CronNodeImpl = class extends NodeImpl {
|
|
20759
21052
|
static create() {
|
|
@@ -20823,7 +21116,7 @@ var CronNodeImpl = class extends NodeImpl {
|
|
|
20823
21116
|
}
|
|
20824
21117
|
static getUIData() {
|
|
20825
21118
|
return {
|
|
20826
|
-
infoBoxBody:
|
|
21119
|
+
infoBoxBody: import_ts_dedent72.dedent`
|
|
20827
21120
|
Executes a subgraph on a schedule. Supports:
|
|
20828
21121
|
- Natural language (e.g., "every 5 minutes", "daily at 3pm")
|
|
20829
21122
|
- Cron expressions (e.g., "0 * * * *")
|
|
@@ -20863,7 +21156,7 @@ var CronNodeImpl = class extends NodeImpl {
|
|
|
20863
21156
|
type: "string",
|
|
20864
21157
|
dataKey: "schedule",
|
|
20865
21158
|
label: "Schedule",
|
|
20866
|
-
helperMessage:
|
|
21159
|
+
helperMessage: import_ts_dedent72.dedent`
|
|
20867
21160
|
Examples:
|
|
20868
21161
|
Cron: "*/5 * * * *", "0 15 * * *"
|
|
20869
21162
|
Interval: "5 minutes", "1 hour", "7 days"
|
|
@@ -20994,15 +21287,15 @@ ${this.data.schedule}`;
|
|
|
20994
21287
|
var cronNode = nodeDefinition(CronNodeImpl, "Cron");
|
|
20995
21288
|
|
|
20996
21289
|
// src/model/nodes/ToTreeNode.ts
|
|
20997
|
-
var
|
|
20998
|
-
var
|
|
21290
|
+
var import_non_secure79 = require("nanoid/non-secure");
|
|
21291
|
+
var import_ts_dedent73 = require("ts-dedent");
|
|
20999
21292
|
var import_lodash_es17 = require("lodash");
|
|
21000
21293
|
var ToTreeNodeImpl = class extends NodeImpl {
|
|
21001
21294
|
static create() {
|
|
21002
21295
|
const chartNode = {
|
|
21003
21296
|
type: "toTree",
|
|
21004
21297
|
title: "To Tree",
|
|
21005
|
-
id: (0,
|
|
21298
|
+
id: (0, import_non_secure79.nanoid)(),
|
|
21006
21299
|
visualData: {
|
|
21007
21300
|
x: 0,
|
|
21008
21301
|
y: 0,
|
|
@@ -21057,7 +21350,7 @@ var ToTreeNodeImpl = class extends NodeImpl {
|
|
|
21057
21350
|
];
|
|
21058
21351
|
}
|
|
21059
21352
|
getBody() {
|
|
21060
|
-
return
|
|
21353
|
+
return import_ts_dedent73.dedent`
|
|
21061
21354
|
Format: ${this.data.format}
|
|
21062
21355
|
Children: ${this.data.childrenProperty}
|
|
21063
21356
|
Sort: ${this.data.useSortAlphabetically ? "Yes" : "No"}
|
|
@@ -21065,7 +21358,7 @@ var ToTreeNodeImpl = class extends NodeImpl {
|
|
|
21065
21358
|
}
|
|
21066
21359
|
static getUIData() {
|
|
21067
21360
|
return {
|
|
21068
|
-
infoBoxBody:
|
|
21361
|
+
infoBoxBody: import_ts_dedent73.dedent`
|
|
21069
21362
|
Converts an array of objects into a tree structure and renders it as text.
|
|
21070
21363
|
|
|
21071
21364
|
The format field supports interpolation using {{property}} syntax to determine
|
|
@@ -21120,14 +21413,14 @@ var ToTreeNodeImpl = class extends NodeImpl {
|
|
|
21120
21413
|
var toTreeNode = nodeDefinition(ToTreeNodeImpl, "To Tree");
|
|
21121
21414
|
|
|
21122
21415
|
// src/model/nodes/LoopUntilNode.ts
|
|
21123
|
-
var
|
|
21124
|
-
var
|
|
21416
|
+
var import_non_secure80 = require("nanoid/non-secure");
|
|
21417
|
+
var import_ts_dedent74 = require("ts-dedent");
|
|
21125
21418
|
var LoopUntilNodeImpl = class extends NodeImpl {
|
|
21126
21419
|
static create() {
|
|
21127
21420
|
const chartNode = {
|
|
21128
21421
|
type: "loopUntil",
|
|
21129
21422
|
title: "Loop Until",
|
|
21130
|
-
id: (0,
|
|
21423
|
+
id: (0, import_non_secure80.nanoid)(),
|
|
21131
21424
|
visualData: {
|
|
21132
21425
|
x: 0,
|
|
21133
21426
|
y: 0,
|
|
@@ -21251,7 +21544,7 @@ var LoopUntilNodeImpl = class extends NodeImpl {
|
|
|
21251
21544
|
}
|
|
21252
21545
|
static getUIData() {
|
|
21253
21546
|
return {
|
|
21254
|
-
infoBoxBody:
|
|
21547
|
+
infoBoxBody: import_ts_dedent74.dedent`
|
|
21255
21548
|
Executes a subgraph in a loop until a condition is met. Each iteration's outputs become
|
|
21256
21549
|
the inputs for the next iteration. Supports different stopping conditions and optional
|
|
21257
21550
|
maximum iterations.
|
|
@@ -21609,14 +21902,14 @@ var MCPDiscoveryNodeImpl = class extends NodeImpl {
|
|
|
21609
21902
|
var mcpDiscoveryNode = nodeDefinition(MCPDiscoveryNodeImpl, "MCP Discovery");
|
|
21610
21903
|
|
|
21611
21904
|
// src/model/nodes/MCPToolCallNode.ts
|
|
21612
|
-
var
|
|
21613
|
-
var
|
|
21905
|
+
var import_non_secure81 = require("nanoid/non-secure");
|
|
21906
|
+
var import_ts_dedent75 = require("ts-dedent");
|
|
21614
21907
|
var MCPToolCallNodeImpl = class extends NodeImpl {
|
|
21615
21908
|
static create() {
|
|
21616
21909
|
const chartNode = {
|
|
21617
21910
|
type: "mcpToolCall",
|
|
21618
21911
|
title: "MCP Tool Call",
|
|
21619
|
-
id: (0,
|
|
21912
|
+
id: (0, import_non_secure81.nanoid)(),
|
|
21620
21913
|
visualData: {
|
|
21621
21914
|
x: 0,
|
|
21622
21915
|
y: 0,
|
|
@@ -21629,7 +21922,7 @@ var MCPToolCallNodeImpl = class extends NodeImpl {
|
|
|
21629
21922
|
serverUrl: "http://localhost:8080/mcp",
|
|
21630
21923
|
serverId: "",
|
|
21631
21924
|
toolName: "",
|
|
21632
|
-
toolArguments:
|
|
21925
|
+
toolArguments: import_ts_dedent75.dedent`
|
|
21633
21926
|
{
|
|
21634
21927
|
"key": "value"
|
|
21635
21928
|
}`,
|
|
@@ -21769,7 +22062,7 @@ var MCPToolCallNodeImpl = class extends NodeImpl {
|
|
|
21769
22062
|
}
|
|
21770
22063
|
static getUIData() {
|
|
21771
22064
|
return {
|
|
21772
|
-
infoBoxBody:
|
|
22065
|
+
infoBoxBody: import_ts_dedent75.dedent`
|
|
21773
22066
|
Connects to an MCP (Model Context Protocol) server and gets a tool call response.
|
|
21774
22067
|
`,
|
|
21775
22068
|
infoBoxTitle: "MCP Tool Call Node",
|
|
@@ -21858,13 +22151,13 @@ var MCPToolCallNodeImpl = class extends NodeImpl {
|
|
|
21858
22151
|
var mcpToolCallNode = nodeDefinition(MCPToolCallNodeImpl, "MCP Tool Call");
|
|
21859
22152
|
|
|
21860
22153
|
// src/model/nodes/MCPGetPromptNode.ts
|
|
21861
|
-
var
|
|
22154
|
+
var import_non_secure82 = require("nanoid/non-secure");
|
|
21862
22155
|
var MCPGetPromptNodeImpl = class extends NodeImpl {
|
|
21863
22156
|
static create() {
|
|
21864
22157
|
const chartNode = {
|
|
21865
22158
|
type: "mcpGetPrompt",
|
|
21866
22159
|
title: "MCP Get Prompt",
|
|
21867
|
-
id: (0,
|
|
22160
|
+
id: (0, import_non_secure82.nanoid)(),
|
|
21868
22161
|
visualData: {
|
|
21869
22162
|
x: 0,
|
|
21870
22163
|
y: 0,
|
|
@@ -22080,15 +22373,15 @@ var MCPGetPromptNodeImpl = class extends NodeImpl {
|
|
|
22080
22373
|
var mcpGetPromptNode = nodeDefinition(MCPGetPromptNodeImpl, "MCP Get Prompt");
|
|
22081
22374
|
|
|
22082
22375
|
// src/model/nodes/ReferencedGraphAliasNode.ts
|
|
22083
|
-
var
|
|
22084
|
-
var
|
|
22376
|
+
var import_non_secure83 = require("nanoid/non-secure");
|
|
22377
|
+
var import_ts_dedent76 = require("ts-dedent");
|
|
22085
22378
|
var ReferencedGraphAliasNodeImpl = class extends NodeImpl {
|
|
22086
22379
|
static create() {
|
|
22087
22380
|
const chartNode = {
|
|
22088
22381
|
type: "referencedGraphAlias",
|
|
22089
22382
|
title: "",
|
|
22090
22383
|
// Always set initially by the editor
|
|
22091
|
-
id: (0,
|
|
22384
|
+
id: (0, import_non_secure83.nanoid)(),
|
|
22092
22385
|
visualData: {
|
|
22093
22386
|
x: 0,
|
|
22094
22387
|
y: 0,
|
|
@@ -22195,7 +22488,7 @@ var ReferencedGraphAliasNodeImpl = class extends NodeImpl {
|
|
|
22195
22488
|
}
|
|
22196
22489
|
static getUIData() {
|
|
22197
22490
|
return {
|
|
22198
|
-
infoBoxBody:
|
|
22491
|
+
infoBoxBody: import_ts_dedent76.dedent`
|
|
22199
22492
|
References a graph from another project. Inputs and outputs are defined by Graph Input and Graph Output nodes within the referenced graph.
|
|
22200
22493
|
`,
|
|
22201
22494
|
infoBoxTitle: "Referenced Graph Alias Node",
|
|
@@ -22289,7 +22582,7 @@ var referencedGraphAliasNode = nodeDefinition(ReferencedGraphAliasNodeImpl, "Ref
|
|
|
22289
22582
|
|
|
22290
22583
|
// src/model/Nodes.ts
|
|
22291
22584
|
var registerBuiltInNodes = (registry) => {
|
|
22292
|
-
return registry.register(toYamlNode).register(userInputNode).register(textNode).register(llmChatV2Node).register(chatNode).register(promptNode).register(extractRegexNode).register(codeNode).register(expressionNode).register(matchNode).register(ifNode).register(readDirectoryNode).register(readFileNode).register(ifElseNode).register(chunkNode).register(graphInputNode).register(graphOutputNode).register(subGraphNode).register(arrayNode).register(extractJsonNode).register(assemblePromptNode).register(loopControllerNode).register(trimChatMessagesNode).register(extractYamlNode).register(externalCallNode).register(extractObjectPathNode).register(raiseEventNode).register(contextNode).register(coalesceNode).register(didRunNode).register(passthroughNode).register(popNode).register(setGlobalNode).register(getGlobalNode).register(waitForEventNode).register(gptFunctionNode).register(getEmbeddingNode).register(vectorStoreNode).register(vectorNearestNeighborsNode).register(hashNode).register(abortGraphNode).register(raceInputsNode).register(toJsonNode).register(joinNode).register(filterNode).register(jsFilterNode).register(jsMapNode).register(objectNode).register(booleanNode).register(compareNode).register(evaluateNode).register(numberNode).register(randomNumberNode).register(shuffleNode).register(commentNode).register(imageNode).register(audioNode).register(httpCallNode).register(delayNode).register(appendToDatasetNode).register(createDatasetNode).register(loadDatasetNode).register(getAllDatasetsNode).register(splitNode).register(datasetNearestNeighborsNode).register(getDatasetRowNode).register(sliceNode).register(extractMarkdownCodeBlocksNode).register(assembleMessageNode).register(urlReferenceNode).register(destructureNode).register(replaceDatasetNode).register(listGraphsNode).register(graphReferenceNode).register(callGraphNode).register(delegateFunctionCallNode).register(playAudioNode).register(documentNode).register(chatLoopNode).register(readAllFilesNode).register(toMarkdownTableNode).register(cronNode).register(toTreeNode).register(loopUntilNode).register(mcpDiscoveryNode).register(mcpToolCallNode).register(mcpGetPromptNode).register(referencedGraphAliasNode);
|
|
22585
|
+
return registry.register(toYamlNode).register(userInputNode).register(textNode).register(llmChatV2Node).register(chatNode).register(promptNode).register(extractRegexNode).register(codeNode).register(codeNewNode).register(expressionNode).register(matchNode).register(ifNode).register(readDirectoryNode).register(readFileNode).register(ifElseNode).register(chunkNode).register(graphInputNode).register(graphOutputNode).register(subGraphNode).register(arrayNode).register(extractJsonNode).register(assemblePromptNode).register(loopControllerNode).register(trimChatMessagesNode).register(extractYamlNode).register(externalCallNode).register(extractObjectPathNode).register(raiseEventNode).register(contextNode).register(coalesceNode).register(didRunNode).register(passthroughNode).register(popNode).register(setGlobalNode).register(getGlobalNode).register(waitForEventNode).register(gptFunctionNode).register(getEmbeddingNode).register(vectorStoreNode).register(vectorNearestNeighborsNode).register(hashNode).register(abortGraphNode).register(raceInputsNode).register(toJsonNode).register(joinNode).register(filterNode).register(jsFilterNode).register(jsMapNode).register(objectNode).register(booleanNode).register(compareNode).register(evaluateNode).register(numberNode).register(randomNumberNode).register(shuffleNode).register(commentNode).register(imageNode).register(audioNode).register(httpCallNode).register(delayNode).register(appendToDatasetNode).register(createDatasetNode).register(loadDatasetNode).register(getAllDatasetsNode).register(splitNode).register(datasetNearestNeighborsNode).register(getDatasetRowNode).register(sliceNode).register(extractMarkdownCodeBlocksNode).register(assembleMessageNode).register(urlReferenceNode).register(destructureNode).register(replaceDatasetNode).register(listGraphsNode).register(graphReferenceNode).register(callGraphNode).register(delegateFunctionCallNode).register(playAudioNode).register(documentNode).register(chatLoopNode).register(readAllFilesNode).register(toMarkdownTableNode).register(cronNode).register(toTreeNode).register(loopUntilNode).register(mcpDiscoveryNode).register(mcpToolCallNode).register(mcpGetPromptNode).register(referencedGraphAliasNode);
|
|
22293
22586
|
};
|
|
22294
22587
|
var globalRivetNodeRegistry = registerBuiltInNodes(new NodeRegistration());
|
|
22295
22588
|
function resetGlobalRivetNodeRegistry() {
|
|
@@ -22380,7 +22673,7 @@ var OpenAIEmbeddingGenerator = class {
|
|
|
22380
22673
|
registerIntegration("embeddingGenerator", "openai", (context) => new OpenAIEmbeddingGenerator(context.settings));
|
|
22381
22674
|
|
|
22382
22675
|
// src/recording/ExecutionRecorder.ts
|
|
22383
|
-
var
|
|
22676
|
+
var import_non_secure84 = require("nanoid/non-secure");
|
|
22384
22677
|
var import_emittery2 = __toESM(require("emittery-0-13"), 1);
|
|
22385
22678
|
var import_lodash_es18 = require("lodash");
|
|
22386
22679
|
var import_json_stream_es = require("json-stream-es");
|
|
@@ -22573,7 +22866,7 @@ function serializeToObject(recording) {
|
|
|
22573
22866
|
const asString = uint8ArrayToBase64Sync(val);
|
|
22574
22867
|
const existingAsset = Object.entries(serialized.assets).find(([, asset]) => asset === asString);
|
|
22575
22868
|
if (!existingAsset) {
|
|
22576
|
-
const id = (0,
|
|
22869
|
+
const id = (0, import_non_secure84.nanoid)();
|
|
22577
22870
|
serialized.assets[id] = asString;
|
|
22578
22871
|
return `$ASSET:${id}`;
|
|
22579
22872
|
} else {
|
|
@@ -22632,7 +22925,7 @@ var ExecutionRecorder = class _ExecutionRecorder {
|
|
|
22632
22925
|
once = void 0;
|
|
22633
22926
|
recordSocket(channel) {
|
|
22634
22927
|
return new Promise((resolve) => {
|
|
22635
|
-
this.recordingId = (0,
|
|
22928
|
+
this.recordingId = (0, import_non_secure84.nanoid)();
|
|
22636
22929
|
const listener = (event) => {
|
|
22637
22930
|
const { message, data } = JSON.parse(event.data);
|
|
22638
22931
|
if (this.#includePartialOutputs === false && message === "partialOutput") {
|
|
@@ -22657,7 +22950,7 @@ var ExecutionRecorder = class _ExecutionRecorder {
|
|
|
22657
22950
|
});
|
|
22658
22951
|
}
|
|
22659
22952
|
record(processor) {
|
|
22660
|
-
this.recordingId = (0,
|
|
22953
|
+
this.recordingId = (0, import_non_secure84.nanoid)();
|
|
22661
22954
|
processor.onAny((event, data) => {
|
|
22662
22955
|
if (this.#includePartialOutputs === false && event === "partialOutput") {
|
|
22663
22956
|
return;
|
|
@@ -22713,8 +23006,8 @@ var ExecutionRecorder = class _ExecutionRecorder {
|
|
|
22713
23006
|
};
|
|
22714
23007
|
|
|
22715
23008
|
// src/plugins/anthropic/nodes/ChatAnthropicNode.ts
|
|
22716
|
-
var
|
|
22717
|
-
var
|
|
23009
|
+
var import_non_secure85 = require("nanoid/non-secure");
|
|
23010
|
+
var import_ts_dedent77 = require("ts-dedent");
|
|
22718
23011
|
var import_p_retry2 = __toESM(require("p-retry-4"), 1);
|
|
22719
23012
|
|
|
22720
23013
|
// src/utils/assertNever.ts
|
|
@@ -22729,7 +23022,7 @@ var ChatAnthropicNodeImpl = {
|
|
|
22729
23022
|
const chartNode = {
|
|
22730
23023
|
type: "chatAnthropic",
|
|
22731
23024
|
title: "Chat (Anthropic, Legacy)",
|
|
22732
|
-
id: (0,
|
|
23025
|
+
id: (0, import_non_secure85.nanoid)(),
|
|
22733
23026
|
visualData: {
|
|
22734
23027
|
x: 0,
|
|
22735
23028
|
y: 0,
|
|
@@ -22873,7 +23166,7 @@ var ChatAnthropicNodeImpl = {
|
|
|
22873
23166
|
getBody(data) {
|
|
22874
23167
|
var _a;
|
|
22875
23168
|
const modelName = data.overrideModel ? data.overrideModel : ((_a = anthropicModels[data.model]) == null ? void 0 : _a.displayName) ?? "Unknown Model";
|
|
22876
|
-
return
|
|
23169
|
+
return import_ts_dedent77.dedent`
|
|
22877
23170
|
${modelName}
|
|
22878
23171
|
${data.useTopP ? `Top P: ${data.useTopPInput ? "(Using Input)" : data.top_p}` : `Temperature: ${data.useTemperatureInput ? "(Using Input)" : data.temperature}`}
|
|
22879
23172
|
Max Tokens: ${data.maxTokens}
|
|
@@ -22998,7 +23291,7 @@ var ChatAnthropicNodeImpl = {
|
|
|
22998
23291
|
},
|
|
22999
23292
|
getUIData() {
|
|
23000
23293
|
return {
|
|
23001
|
-
infoBoxBody:
|
|
23294
|
+
infoBoxBody: import_ts_dedent77.dedent`
|
|
23002
23295
|
Legacy Anthropic chat node.
|
|
23003
23296
|
|
|
23004
23297
|
For new work, prefer \`LLM Chat\`, which keeps provider selection inside one shared node.
|
|
@@ -23471,8 +23764,8 @@ var anthropicPlugin = {
|
|
|
23471
23764
|
var anthropic_default = anthropicPlugin;
|
|
23472
23765
|
|
|
23473
23766
|
// src/plugins/autoevals/AutoEvalsNode.ts
|
|
23474
|
-
var
|
|
23475
|
-
var
|
|
23767
|
+
var import_non_secure86 = require("nanoid/non-secure");
|
|
23768
|
+
var import_ts_dedent78 = require("ts-dedent");
|
|
23476
23769
|
var import_autoevals = require("autoevals");
|
|
23477
23770
|
var import_ts_pattern8 = require("ts-pattern");
|
|
23478
23771
|
var options = [
|
|
@@ -23491,7 +23784,7 @@ var AutoEvalsNodeImpl = {
|
|
|
23491
23784
|
const chartNode = {
|
|
23492
23785
|
type: "autoevals",
|
|
23493
23786
|
title: "Autoevals",
|
|
23494
|
-
id: (0,
|
|
23787
|
+
id: (0, import_non_secure86.nanoid)(),
|
|
23495
23788
|
visualData: {
|
|
23496
23789
|
x: 0,
|
|
23497
23790
|
y: 0,
|
|
@@ -23606,7 +23899,7 @@ var AutoEvalsNodeImpl = {
|
|
|
23606
23899
|
},
|
|
23607
23900
|
getUIData() {
|
|
23608
23901
|
return {
|
|
23609
|
-
infoBoxBody:
|
|
23902
|
+
infoBoxBody: import_ts_dedent78.dedent`
|
|
23610
23903
|
Evaluates the validity of a response using the autoevals library.
|
|
23611
23904
|
`,
|
|
23612
23905
|
infoBoxTitle: "Autoevals Node",
|
|
@@ -23686,8 +23979,8 @@ var autoevalsPlugin = {
|
|
|
23686
23979
|
var autoevals_default = autoevalsPlugin;
|
|
23687
23980
|
|
|
23688
23981
|
// src/plugins/assemblyAi/LemurQaNode.ts
|
|
23689
|
-
var
|
|
23690
|
-
var
|
|
23982
|
+
var import_non_secure87 = require("nanoid/non-secure");
|
|
23983
|
+
var import_ts_dedent79 = require("ts-dedent");
|
|
23691
23984
|
|
|
23692
23985
|
// src/plugins/assemblyAi/lemurHelpers.ts
|
|
23693
23986
|
var import_assemblyai = require("assemblyai");
|
|
@@ -23807,7 +24100,7 @@ var LemurQaNodeImpl = {
|
|
|
23807
24100
|
const chartNode = {
|
|
23808
24101
|
type: "assemblyAiLemurQa",
|
|
23809
24102
|
title: "LeMUR Question & Answers",
|
|
23810
|
-
id: (0,
|
|
24103
|
+
id: (0, import_non_secure87.nanoid)(),
|
|
23811
24104
|
visualData: {
|
|
23812
24105
|
x: 0,
|
|
23813
24106
|
y: 0,
|
|
@@ -23873,7 +24166,7 @@ var LemurQaNodeImpl = {
|
|
|
23873
24166
|
},
|
|
23874
24167
|
getUIData() {
|
|
23875
24168
|
return {
|
|
23876
|
-
infoBoxBody:
|
|
24169
|
+
infoBoxBody: import_ts_dedent79.dedent`Use AssemblyAI LeMUR to ask questions about transcripts`,
|
|
23877
24170
|
infoBoxTitle: "Use AssemblyAI LeMUR Question & Answer",
|
|
23878
24171
|
contextMenuTitle: "LeMUR Q&A",
|
|
23879
24172
|
group: ["AI", "AssemblyAI"]
|
|
@@ -23945,14 +24238,14 @@ function applyQuestionEditors(data, question) {
|
|
|
23945
24238
|
var lemurQaNode = pluginNodeDefinition(LemurQaNodeImpl, "LeMUR Q&A");
|
|
23946
24239
|
|
|
23947
24240
|
// src/plugins/assemblyAi/TranscribeAudioNode.ts
|
|
23948
|
-
var
|
|
23949
|
-
var
|
|
24241
|
+
var import_non_secure88 = require("nanoid/non-secure");
|
|
24242
|
+
var import_ts_dedent80 = require("ts-dedent");
|
|
23950
24243
|
var TranscribeAudioNodeImpl = {
|
|
23951
24244
|
create() {
|
|
23952
24245
|
const chartNode = {
|
|
23953
24246
|
type: "assemblyAiTranscribeAudio",
|
|
23954
24247
|
title: "Transcribe Audio",
|
|
23955
|
-
id: (0,
|
|
24248
|
+
id: (0, import_non_secure88.nanoid)(),
|
|
23956
24249
|
visualData: {
|
|
23957
24250
|
x: 0,
|
|
23958
24251
|
y: 0,
|
|
@@ -24008,7 +24301,7 @@ var TranscribeAudioNodeImpl = {
|
|
|
24008
24301
|
},
|
|
24009
24302
|
getUIData() {
|
|
24010
24303
|
return {
|
|
24011
|
-
infoBoxBody:
|
|
24304
|
+
infoBoxBody: import_ts_dedent80.dedent`Use AssemblyAI to transcribe audio`,
|
|
24012
24305
|
infoBoxTitle: "Transcribe Audio Node",
|
|
24013
24306
|
contextMenuTitle: "Transcribe Audio",
|
|
24014
24307
|
group: ["AI", "AssemblyAI"]
|
|
@@ -24067,15 +24360,15 @@ function getAdditionalParameters(data) {
|
|
|
24067
24360
|
}
|
|
24068
24361
|
|
|
24069
24362
|
// src/plugins/assemblyAi/LemurSummaryNode.ts
|
|
24070
|
-
var
|
|
24071
|
-
var
|
|
24363
|
+
var import_non_secure89 = require("nanoid/non-secure");
|
|
24364
|
+
var import_ts_dedent81 = require("ts-dedent");
|
|
24072
24365
|
var import_assemblyai3 = require("assemblyai");
|
|
24073
24366
|
var LemurSummaryNodeImpl = {
|
|
24074
24367
|
create() {
|
|
24075
24368
|
const chartNode = {
|
|
24076
24369
|
type: "assemblyAiLemurSummary",
|
|
24077
24370
|
title: "LeMUR Summary",
|
|
24078
|
-
id: (0,
|
|
24371
|
+
id: (0, import_non_secure89.nanoid)(),
|
|
24079
24372
|
visualData: {
|
|
24080
24373
|
x: 0,
|
|
24081
24374
|
y: 0,
|
|
@@ -24121,7 +24414,7 @@ var LemurSummaryNodeImpl = {
|
|
|
24121
24414
|
},
|
|
24122
24415
|
getUIData() {
|
|
24123
24416
|
return {
|
|
24124
|
-
infoBoxBody:
|
|
24417
|
+
infoBoxBody: import_ts_dedent81.dedent`Use AssemblyAI LeMUR Summary to summarize transcripts`,
|
|
24125
24418
|
infoBoxTitle: "Use AssemblyAI LeMUR Summary",
|
|
24126
24419
|
contextMenuTitle: "LeMUR Summary",
|
|
24127
24420
|
group: ["AI", "AssemblyAI"]
|
|
@@ -24145,15 +24438,15 @@ var LemurSummaryNodeImpl = {
|
|
|
24145
24438
|
var lemurSummaryNode = pluginNodeDefinition(LemurSummaryNodeImpl, "LeMUR Summary");
|
|
24146
24439
|
|
|
24147
24440
|
// src/plugins/assemblyAi/LemurTaskNode.ts
|
|
24148
|
-
var
|
|
24149
|
-
var
|
|
24441
|
+
var import_non_secure90 = require("nanoid/non-secure");
|
|
24442
|
+
var import_ts_dedent82 = require("ts-dedent");
|
|
24150
24443
|
var import_assemblyai4 = require("assemblyai");
|
|
24151
24444
|
var LemurTaskNodeImpl = {
|
|
24152
24445
|
create() {
|
|
24153
24446
|
const chartNode = {
|
|
24154
24447
|
type: "assemblyAiLemurTask",
|
|
24155
24448
|
title: "LeMUR Task",
|
|
24156
|
-
id: (0,
|
|
24449
|
+
id: (0, import_non_secure90.nanoid)(),
|
|
24157
24450
|
visualData: {
|
|
24158
24451
|
x: 0,
|
|
24159
24452
|
y: 0,
|
|
@@ -24199,7 +24492,7 @@ var LemurTaskNodeImpl = {
|
|
|
24199
24492
|
},
|
|
24200
24493
|
getUIData() {
|
|
24201
24494
|
return {
|
|
24202
|
-
infoBoxBody:
|
|
24495
|
+
infoBoxBody: import_ts_dedent82.dedent`Use AssemblyAI LeMUR Custom Task to ask anything.`,
|
|
24203
24496
|
infoBoxTitle: "Use AssemblyAI LeMUR Custom Task",
|
|
24204
24497
|
contextMenuTitle: "LeMUR Custom Task",
|
|
24205
24498
|
group: ["AI", "AssemblyAI"]
|
|
@@ -24225,14 +24518,14 @@ var LemurTaskNodeImpl = {
|
|
|
24225
24518
|
var lemurTaskNode = pluginNodeDefinition(LemurTaskNodeImpl, "LeMUR Task");
|
|
24226
24519
|
|
|
24227
24520
|
// src/plugins/assemblyAi/LemurActionItemsNode.ts
|
|
24228
|
-
var
|
|
24229
|
-
var
|
|
24521
|
+
var import_non_secure91 = require("nanoid/non-secure");
|
|
24522
|
+
var import_ts_dedent83 = require("ts-dedent");
|
|
24230
24523
|
var LemurActionItemsNodeImpl = {
|
|
24231
24524
|
create() {
|
|
24232
24525
|
const chartNode = {
|
|
24233
24526
|
type: "assemblyAiLemurActionItems",
|
|
24234
24527
|
title: "LeMUR Action Items",
|
|
24235
|
-
id: (0,
|
|
24528
|
+
id: (0, import_non_secure91.nanoid)(),
|
|
24236
24529
|
visualData: {
|
|
24237
24530
|
x: 0,
|
|
24238
24531
|
y: 0,
|
|
@@ -24278,7 +24571,7 @@ var LemurActionItemsNodeImpl = {
|
|
|
24278
24571
|
},
|
|
24279
24572
|
getUIData() {
|
|
24280
24573
|
return {
|
|
24281
|
-
infoBoxBody:
|
|
24574
|
+
infoBoxBody: import_ts_dedent83.dedent`Use AssemblyAI LeMUR Action Items to extract action items`,
|
|
24282
24575
|
infoBoxTitle: "Use AssemblyAI LeMUR Action Items",
|
|
24283
24576
|
contextMenuTitle: "LeMUR Action Items",
|
|
24284
24577
|
group: ["AI", "AssemblyAI"]
|
|
@@ -24330,12 +24623,12 @@ var assemblyAiPlugin = {
|
|
|
24330
24623
|
var assemblyAi_default = assemblyAiPlugin;
|
|
24331
24624
|
|
|
24332
24625
|
// src/plugins/huggingface/nodes/ChatHuggingFace.ts
|
|
24333
|
-
var
|
|
24626
|
+
var import_non_secure92 = require("nanoid/non-secure");
|
|
24334
24627
|
var import_inference = require("@huggingface/inference");
|
|
24335
24628
|
var ChatHuggingFaceNodeImpl = {
|
|
24336
24629
|
create() {
|
|
24337
24630
|
return {
|
|
24338
|
-
id: (0,
|
|
24631
|
+
id: (0, import_non_secure92.nanoid)(),
|
|
24339
24632
|
type: "chatHuggingFace",
|
|
24340
24633
|
data: {
|
|
24341
24634
|
model: "",
|
|
@@ -24565,13 +24858,13 @@ var ChatHuggingFaceNodeImpl = {
|
|
|
24565
24858
|
var chatHuggingFaceNode = pluginNodeDefinition(ChatHuggingFaceNodeImpl, "Chat (Hugging Face, Legacy)");
|
|
24566
24859
|
|
|
24567
24860
|
// src/plugins/huggingface/nodes/TextToImageHuggingFace.ts
|
|
24568
|
-
var
|
|
24861
|
+
var import_non_secure93 = require("nanoid/non-secure");
|
|
24569
24862
|
var import_inference2 = require("@huggingface/inference");
|
|
24570
|
-
var
|
|
24863
|
+
var import_ts_dedent84 = require("ts-dedent");
|
|
24571
24864
|
var TextToImageHuggingFaceNodeImpl = {
|
|
24572
24865
|
create() {
|
|
24573
24866
|
return {
|
|
24574
|
-
id: (0,
|
|
24867
|
+
id: (0, import_non_secure93.nanoid)(),
|
|
24575
24868
|
type: "textToImageHuggingFace",
|
|
24576
24869
|
data: {
|
|
24577
24870
|
model: "",
|
|
@@ -24712,7 +25005,7 @@ var TextToImageHuggingFaceNodeImpl = {
|
|
|
24712
25005
|
];
|
|
24713
25006
|
},
|
|
24714
25007
|
getBody(data) {
|
|
24715
|
-
return
|
|
25008
|
+
return import_ts_dedent84.dedent`
|
|
24716
25009
|
Model: ${data.useModelInput ? "(Using Input)" : data.model}
|
|
24717
25010
|
`;
|
|
24718
25011
|
},
|
|
@@ -27887,8 +28180,8 @@ var openAIPlugin = {
|
|
|
27887
28180
|
};
|
|
27888
28181
|
|
|
27889
28182
|
// src/plugins/google/nodes/ChatGoogleNode.ts
|
|
27890
|
-
var
|
|
27891
|
-
var
|
|
28183
|
+
var import_non_secure94 = require("nanoid/non-secure");
|
|
28184
|
+
var import_ts_dedent85 = require("ts-dedent");
|
|
27892
28185
|
var import_p_retry3 = __toESM(require("p-retry-4"), 1);
|
|
27893
28186
|
var import_ts_pattern9 = require("ts-pattern");
|
|
27894
28187
|
var import_genai2 = require("@google/genai");
|
|
@@ -27916,7 +28209,7 @@ var ChatGoogleNodeImpl = {
|
|
|
27916
28209
|
const chartNode = {
|
|
27917
28210
|
type: "chatGoogle",
|
|
27918
28211
|
title: "Chat (Google, Legacy)",
|
|
27919
|
-
id: (0,
|
|
28212
|
+
id: (0, import_non_secure94.nanoid)(),
|
|
27920
28213
|
visualData: {
|
|
27921
28214
|
x: 0,
|
|
27922
28215
|
y: 0,
|
|
@@ -28051,7 +28344,7 @@ var ChatGoogleNodeImpl = {
|
|
|
28051
28344
|
},
|
|
28052
28345
|
getBody(data) {
|
|
28053
28346
|
var _a;
|
|
28054
|
-
return
|
|
28347
|
+
return import_ts_dedent85.dedent`
|
|
28055
28348
|
${((_a = generativeAiGoogleModels[data.model]) == null ? void 0 : _a.displayName) ?? `Google (${data.model})`}
|
|
28056
28349
|
${data.useTopP ? `Top P: ${data.useTopPInput ? "(Using Input)" : data.top_p}` : `Temperature: ${data.useTemperatureInput ? "(Using Input)" : data.temperature}`}
|
|
28057
28350
|
Max Tokens: ${data.maxTokens}
|
|
@@ -28138,7 +28431,7 @@ var ChatGoogleNodeImpl = {
|
|
|
28138
28431
|
},
|
|
28139
28432
|
getUIData() {
|
|
28140
28433
|
return {
|
|
28141
|
-
infoBoxBody:
|
|
28434
|
+
infoBoxBody: import_ts_dedent85.dedent`
|
|
28142
28435
|
Legacy Google chat node.
|
|
28143
28436
|
|
|
28144
28437
|
For new work, prefer \`LLM Chat\`, which keeps provider selection inside one shared node.
|
|
@@ -28880,12 +29173,14 @@ var Rivet = void 0;
|
|
|
28880
29173
|
AudioNodeImpl,
|
|
28881
29174
|
BooleanNodeImpl,
|
|
28882
29175
|
BrowserNativeApi,
|
|
29176
|
+
CODE_NEW_OUTPUT_PORT_ID,
|
|
28883
29177
|
CallGraphNodeImpl,
|
|
28884
29178
|
ChatLoopNodeImpl,
|
|
28885
29179
|
ChatNodeBase,
|
|
28886
29180
|
ChatNodeImpl,
|
|
28887
29181
|
ChunkNodeImpl,
|
|
28888
29182
|
CoalesceNodeImpl,
|
|
29183
|
+
CodeNewNodeImpl,
|
|
28889
29184
|
CodeNodeImpl,
|
|
28890
29185
|
CommentNodeImpl,
|
|
28891
29186
|
CompareNodeImpl,
|
|
@@ -29017,6 +29312,7 @@ var Rivet = void 0;
|
|
|
29017
29312
|
chunkStringByTokenCount,
|
|
29018
29313
|
cleanHeaders,
|
|
29019
29314
|
coalesceNode,
|
|
29315
|
+
codeNewNode,
|
|
29020
29316
|
codeNode,
|
|
29021
29317
|
coerceType,
|
|
29022
29318
|
coerceTypeOptional,
|
|
@@ -29109,6 +29405,7 @@ var Rivet = void 0;
|
|
|
29109
29405
|
imageNode,
|
|
29110
29406
|
inferType,
|
|
29111
29407
|
interpolate,
|
|
29408
|
+
interpolateCodeNewSource,
|
|
29112
29409
|
interpolateExpressionSource,
|
|
29113
29410
|
interpolateExtractObjectPathSource,
|
|
29114
29411
|
interpolateJSListCallbackBody,
|