@valerypopoff/rivet2-core 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.cjs +4350 -2077
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/interpolationRuntime.cjs +22 -3
- package/dist/cjs/interpolationRuntime.cjs.map +3 -3
- package/dist/cjs/interpolationSyntax.cjs +9 -5
- package/dist/cjs/interpolationSyntax.cjs.map +2 -2
- package/dist/esm/api/createProcessor.js +5 -2
- package/dist/esm/exports.js +2 -0
- package/dist/esm/model/GraphBoundaryCache.js +2 -1
- package/dist/esm/model/GraphProcessor.js +268 -6
- package/dist/esm/model/Nodes.js +10 -0
- package/dist/esm/model/ProjectBundle.js +235 -0
- package/dist/esm/model/SplitRunProcessor.js +28 -7
- package/dist/esm/model/StreamingWatchTopology.js +118 -8
- package/dist/esm/model/SubgraphProjectTarget.js +7 -0
- package/dist/esm/model/chat-v2/aiSdkBridge.js +7 -5
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +13 -8
- package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +19 -1
- package/dist/esm/model/chat-v2/chatV2Shared.js +2 -1
- package/dist/esm/model/chat-v2/llmChatV2Body.js +11 -8
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +2 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +15 -1
- package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +22 -2
- package/dist/esm/model/chat-v2/llmProfile.js +3 -0
- package/dist/esm/model/chat-v2/llmProfileBody.js +2 -2
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +1 -1
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +1 -1
- package/dist/esm/model/chat-v2/temperature.js +9 -0
- package/dist/esm/model/classifier/credentials.js +30 -4
- package/dist/esm/model/classifier/images.js +176 -0
- package/dist/esm/model/classifier/json.js +57 -0
- package/dist/esm/model/classifier/limits.js +270 -0
- package/dist/esm/model/classifier/openai.js +118 -0
- package/dist/esm/model/classifier/preparation.js +74 -0
- package/dist/esm/model/classifier/providers.js +260 -185
- package/dist/esm/model/classifier/questionHelpers.js +29 -45
- package/dist/esm/model/classifier/questions.js +53 -0
- package/dist/esm/model/classifier/response.js +75 -0
- package/dist/esm/model/classifier/state.js +204 -0
- package/dist/esm/model/nodeRunFailure.js +47 -0
- package/dist/esm/model/nodes/CatchStreamingChunksNode.js +42 -0
- package/dist/esm/model/nodes/ClassifierEvaluateNode.js +178 -138
- package/dist/esm/model/nodes/ClassifierQuestionNode.js +59 -15
- package/dist/esm/model/nodes/GetGlobalNode.js +2 -2
- package/dist/esm/model/nodes/HttpCallNode.js +44 -75
- package/dist/esm/model/nodes/ImageNode.js +44 -3
- package/dist/esm/model/nodes/LLMChatV2Node.js +24 -3
- package/dist/esm/model/nodes/ObjectNode.js +29 -18
- package/dist/esm/model/nodes/PromptNode.js +2 -1
- package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +4 -1
- package/dist/esm/model/nodes/SetGlobalNode.js +5 -3
- package/dist/esm/model/nodes/StopWatchingStreamingOutputNode.js +8 -8
- package/dist/esm/model/nodes/StreamValueNode.js +38 -0
- package/dist/esm/model/nodes/SubGraphNode.js +196 -35
- package/dist/esm/model/nodes/ToBase64Node.js +106 -0
- package/dist/esm/model/nodes/WatchStreamingOutputNode.js +7 -7
- package/dist/esm/recording/ExecutionRecorder.js +26 -0
- package/dist/esm/utils/base64.js +18 -15
- package/dist/esm/utils/errors.js +41 -0
- package/dist/esm/utils/interpolation.js +44 -22
- package/dist/esm/utils/interpolationSyntax.js +15 -6
- package/dist/esm/utils/serialization/serialization.js +3 -2
- package/dist/esm/utils/serialization/serializationUtils.js +6 -0
- package/dist/esm/utils/serialization/serialization_v4.js +15 -3
- package/dist/types/api/createProcessor.d.ts +7 -1
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/model/CycleDetector.d.ts +1 -2
- package/dist/types/model/ExecutorProtocol.d.ts +2 -0
- package/dist/types/model/GraphBoundaryCache.d.ts +2 -0
- package/dist/types/model/GraphProcessor.d.ts +1 -0
- package/dist/types/model/Nodes.d.ts +6 -2
- package/dist/types/model/ProcessContext.d.ts +12 -0
- package/dist/types/model/ProjectBundle.d.ts +54 -0
- package/dist/types/model/ProjectReferenceLoader.d.ts +3 -0
- package/dist/types/model/StreamingWatchTopology.d.ts +11 -1
- package/dist/types/model/SubgraphProjectTarget.d.ts +38 -0
- package/dist/types/model/chat-v2/chatV2Shared.d.ts +1 -1
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +3 -1
- package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +3 -1
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +6 -6
- package/dist/types/model/chat-v2/temperature.d.ts +2 -0
- package/dist/types/model/classifier/credentials.d.ts +3 -1
- package/dist/types/model/classifier/images.d.ts +18 -0
- package/dist/types/model/classifier/json.d.ts +19 -0
- package/dist/types/model/classifier/limits.d.ts +42 -0
- package/dist/types/model/classifier/openai.d.ts +5 -0
- package/dist/types/model/classifier/preparation.d.ts +16 -0
- package/dist/types/model/classifier/providers.d.ts +67 -9
- package/dist/types/model/classifier/questionHelpers.d.ts +6 -4
- package/dist/types/model/classifier/questions.d.ts +4 -0
- package/dist/types/model/classifier/response.d.ts +4 -0
- package/dist/types/model/classifier/state.d.ts +37 -0
- package/dist/types/model/classifier/types.d.ts +2 -0
- package/dist/types/model/nodeRunFailure.d.ts +13 -0
- package/dist/types/model/nodes/CatchStreamingChunksNode.d.ts +20 -0
- package/dist/types/model/nodes/ClassifierEvaluateNode.d.ts +3 -0
- package/dist/types/model/nodes/GetGlobalNode.d.ts +7 -0
- package/dist/types/model/nodes/ImageNode.d.ts +4 -0
- package/dist/types/model/nodes/LLMChatV2Node.d.ts +1 -0
- package/dist/types/model/nodes/ObjectNode.d.ts +2 -1
- package/dist/types/model/nodes/StreamValueNode.d.ts +14 -0
- package/dist/types/model/nodes/SubGraphNode.d.ts +21 -2
- package/dist/types/model/nodes/ToBase64Node.d.ts +12 -0
- package/dist/types/recording/ExecutionRecorder.d.ts +8 -2
- package/dist/types/utils/base64.d.ts +1 -1
- package/dist/types/utils/errors.d.ts +4 -0
- package/dist/types/utils/interpolation.d.ts +13 -2
- package/dist/types/utils/interpolationSyntax.d.ts +1 -1
- package/dist/types/utils/serialization/serialization.d.ts +3 -1
- package/dist/types/utils/serialization/serializationUtils.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
2
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
3
|
+
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
4
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
5
|
+
export declare const MAX_CAUGHT_STREAMING_CHUNKS = 1024;
|
|
6
|
+
export type CatchStreamingChunksNodeData = {
|
|
7
|
+
count: number;
|
|
8
|
+
};
|
|
9
|
+
export type CatchStreamingChunksNode = ChartNode<'catchStreamingChunks', CatchStreamingChunksNodeData>;
|
|
10
|
+
/** The processor owns this node's early, once-only output. */
|
|
11
|
+
export declare class CatchStreamingChunksNodeImpl extends NodeImpl<CatchStreamingChunksNode> {
|
|
12
|
+
static create(): CatchStreamingChunksNode;
|
|
13
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
14
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
15
|
+
static getUIData(): NodeUIData;
|
|
16
|
+
getEditors(): EditorDefinition<CatchStreamingChunksNode>[];
|
|
17
|
+
getBody(): string;
|
|
18
|
+
process(inputs: Inputs): Promise<Outputs>;
|
|
19
|
+
}
|
|
20
|
+
export declare const catchStreamingChunksNode: import("../NodeDefinition.js").NodeDefinition<CatchStreamingChunksNode>;
|
|
@@ -17,6 +17,8 @@ export type ClassifierEvaluateNodeData = {
|
|
|
17
17
|
/** Adds calculated provider cost details to the existing Usage output. */
|
|
18
18
|
outputUsage?: boolean;
|
|
19
19
|
retryOnNon200?: boolean;
|
|
20
|
+
errorOnNon200?: boolean;
|
|
21
|
+
catchRequestFailed?: boolean;
|
|
20
22
|
retryOnNon200RepeatTimes?: number;
|
|
21
23
|
retryOnNon200CooldownMs?: number;
|
|
22
24
|
timeoutMs?: number;
|
|
@@ -41,6 +43,7 @@ export declare class ClassifierEvaluateNodeImpl extends NodeImpl<ClassifierEvalu
|
|
|
41
43
|
getBody(): NodeBodySpec;
|
|
42
44
|
static getUIData(): NodeUIData;
|
|
43
45
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
46
|
+
private processRun;
|
|
44
47
|
}
|
|
45
48
|
/** Shared presentation model for the app's Classifier Evaluate card. */
|
|
46
49
|
export declare function getClassifierEvaluateBodySections(data: ClassifierEvaluateNodeData): readonly ClassifierEvaluateBodySection[];
|
|
@@ -9,6 +9,13 @@ export type GetGlobalNodeData = {
|
|
|
9
9
|
id: string;
|
|
10
10
|
useIdInput: boolean;
|
|
11
11
|
dataType: ScalarOrArrayDataType;
|
|
12
|
+
/** Editor-only explanation of a type copied from a known variable declaration. */
|
|
13
|
+
typeSuggestion?: {
|
|
14
|
+
id: string;
|
|
15
|
+
type: ScalarOrArrayDataType;
|
|
16
|
+
source: string;
|
|
17
|
+
conflictingTypes: ScalarOrArrayDataType[];
|
|
18
|
+
};
|
|
12
19
|
/**
|
|
13
20
|
* Returns a fn<value> instead of a value, so that the variable is read when nodes need it, rather than when this node executes.
|
|
14
21
|
* The only time you wouldn't want this is to read a global at the start of a subgraph.
|
|
@@ -3,8 +3,12 @@ import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
|
3
3
|
import { type DataRef, type EditorDefinition, type Inputs, type InternalProcessContext, type Outputs } from '../../index.js';
|
|
4
4
|
export type ImageNode = ChartNode<'image', ImageNodeData>;
|
|
5
5
|
type ImageNodeData = {
|
|
6
|
+
/** Missing on older projects; treat it as binary for compatibility. */
|
|
7
|
+
sourceType?: 'binary' | 'base64';
|
|
6
8
|
data?: DataRef;
|
|
7
9
|
useDataInput: boolean;
|
|
10
|
+
base64?: string;
|
|
11
|
+
useBase64Input?: boolean;
|
|
8
12
|
mediaType: 'image/png' | 'image/jpeg' | 'image/gif';
|
|
9
13
|
useMediaTypeInput: boolean;
|
|
10
14
|
};
|
|
@@ -18,5 +18,6 @@ export declare class LLMChatV2NodeImpl extends NodeImpl<LLMChatV2Node> {
|
|
|
18
18
|
getEditors(context: RivetUIContext): Promise<EditorDefinition<LLMChatV2Node>[]>;
|
|
19
19
|
getBody(): NodeBodySpec;
|
|
20
20
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
21
|
+
private processRun;
|
|
21
22
|
}
|
|
22
23
|
export declare const llmChatV2Node: import("../NodeDefinition.js").NodeDefinition<LLMChatV2Node>;
|
|
@@ -3,6 +3,7 @@ import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
|
3
3
|
import { type DataValue } from '../DataValue.js';
|
|
4
4
|
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
5
5
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
6
|
+
import { type InterpolationGuard } from '../../utils/interpolation.js';
|
|
6
7
|
export type ObjectNode = ChartNode<'object', ObjectNodeData>;
|
|
7
8
|
export type ObjectNodeData = {
|
|
8
9
|
jsonTemplate: string;
|
|
@@ -11,7 +12,7 @@ export type ObjectNodeData = {
|
|
|
11
12
|
* Interpolates a JSON template without parsing it. Shared by Object and other
|
|
12
13
|
* first-party nodes which author structured EntryType values.
|
|
13
14
|
*/
|
|
14
|
-
export declare function interpolateJsonTemplate(baseString: string, values: Record<string, unknown>, graphInputNodeValues?: Record<string, DataValue>, contextValues?: Record<string, DataValue>, globalValues?: Record<string, unknown
|
|
15
|
+
export declare function interpolateJsonTemplate(baseString: string, values: Record<string, unknown>, graphInputNodeValues?: Record<string, DataValue>, contextValues?: Record<string, DataValue>, globalValues?: Record<string, unknown>, guard?: InterpolationGuard, unwrapVariableDataValues?: boolean): string;
|
|
15
16
|
export declare class ObjectNodeImpl extends NodeImpl<ObjectNode> {
|
|
16
17
|
static create(): ObjectNode;
|
|
17
18
|
getInputDefinitions(): NodeInputDefinition[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
2
|
+
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
3
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
4
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
5
|
+
export type StreamValueNode = ChartNode<'streamValue', Record<string, never>>;
|
|
6
|
+
/** Emits one partial snapshot without changing the ordinary final value. */
|
|
7
|
+
export declare class StreamValueNodeImpl extends NodeImpl<StreamValueNode> {
|
|
8
|
+
static create(): StreamValueNode;
|
|
9
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
10
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
11
|
+
static getUIData(): NodeUIData;
|
|
12
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
13
|
+
}
|
|
14
|
+
export declare const streamValueNode: import("../NodeDefinition.js").NodeDefinition<StreamValueNode>;
|
|
@@ -6,11 +6,20 @@ import { type Project, type ProjectId } from '../Project.js';
|
|
|
6
6
|
import { type DataValue } from '../DataValue.js';
|
|
7
7
|
import { type InternalProcessContext } from '../ProcessContext.js';
|
|
8
8
|
import { type EditorDefinition } from '../../index.js';
|
|
9
|
+
import { type SubgraphProjectVersion } from '../SubgraphProjectTarget.js';
|
|
9
10
|
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
11
|
+
import { type GraphBoundary } from '../GraphBoundaryCache.js';
|
|
10
12
|
export type SubGraphNode = ChartNode & {
|
|
11
13
|
type: 'subGraph';
|
|
12
14
|
data: {
|
|
13
15
|
graphId: GraphId;
|
|
16
|
+
/** Saved project target resolved by a host or portable bundle loader. Absent means the current project. */
|
|
17
|
+
targetProjectId?: ProjectId;
|
|
18
|
+
/** Retains the hosted picker mode before an external project is selected. */
|
|
19
|
+
targetScope?: 'other-projects';
|
|
20
|
+
targetVersion?: SubgraphProjectVersion;
|
|
21
|
+
/** Last selected boundary keeps existing wires visible while a hosted preview reloads. */
|
|
22
|
+
targetBoundary?: GraphBoundary;
|
|
14
23
|
useErrorOutput?: boolean;
|
|
15
24
|
useAsGraphPartialOutput?: boolean;
|
|
16
25
|
/** Only execute child branches needed by actively connected output ports. */
|
|
@@ -21,12 +30,22 @@ export type SubGraphNode = ChartNode & {
|
|
|
21
30
|
outputPortOrder?: string[];
|
|
22
31
|
};
|
|
23
32
|
};
|
|
33
|
+
/** A saved cross-project boundary is the wire contract until the user explicitly selects a new target. */
|
|
34
|
+
export declare function getSubgraphTargetBoundaryChange(expected: GraphBoundary | undefined, actual: GraphBoundary): {
|
|
35
|
+
side: 'input' | 'output';
|
|
36
|
+
id: string;
|
|
37
|
+
} | null;
|
|
38
|
+
/** Keep the caller's saved wire IDs while adopting current target names and metadata. */
|
|
39
|
+
export declare function reconcileSubgraphTargetBoundary(expected: GraphBoundary | undefined, actual: GraphBoundary): GraphBoundary;
|
|
40
|
+
export declare function getSubgraphTargetBoundaryIssue(expected: GraphBoundary | undefined, actual: GraphBoundary): string | null;
|
|
24
41
|
export declare class SubGraphNodeImpl extends NodeImpl<SubGraphNode> {
|
|
25
42
|
static create(): SubGraphNode;
|
|
26
|
-
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project,
|
|
43
|
+
getInputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeInputDefinition[];
|
|
27
44
|
getGraphOutputs(project: Project, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
28
|
-
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project,
|
|
45
|
+
getOutputDefinitions(_connections: NodeConnection[], _nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>, definitionContext?: NodeDefinitionContext): NodeOutputDefinition[];
|
|
29
46
|
private getBoundary;
|
|
47
|
+
private getTargetProject;
|
|
48
|
+
private getTargetBoundary;
|
|
30
49
|
getEditors(context: RivetUIContext): EditorDefinition<SubGraphNode>[];
|
|
31
50
|
static getUIData(): NodeUIData;
|
|
32
51
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
4
|
+
export type ToBase64Node = ChartNode<'toBase64', Record<string, never>>;
|
|
5
|
+
export declare class ToBase64NodeImpl extends NodeImpl<ToBase64Node> {
|
|
6
|
+
static create(): ToBase64Node;
|
|
7
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
8
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
9
|
+
static getUIData(): NodeUIData;
|
|
10
|
+
process(inputs: Inputs): Promise<Outputs>;
|
|
11
|
+
}
|
|
12
|
+
export declare const toBase64Node: import("../NodeDefinition.js").NodeDefinition<ToBase64Node>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type GraphProcessor, type RecordedEvents, type Recording, type RecordingId } from '../index.js';
|
|
1
|
+
import { type GraphProcessor, type ProcessEvents, type RecordedEvents, type Recording, type RecordingId } from '../index.js';
|
|
2
2
|
import Emittery from 'emittery';
|
|
3
3
|
export type ExecutionRecorderEvents = {
|
|
4
4
|
finish: {
|
|
@@ -28,7 +28,13 @@ export declare class ExecutionRecorder {
|
|
|
28
28
|
off: Emittery<ExecutionRecorderEvents>['off'];
|
|
29
29
|
once: Emittery<ExecutionRecorderEvents>['once'];
|
|
30
30
|
recordSocket(channel: WebSocket, options?: SocketRecordingOptions): Promise<void>;
|
|
31
|
-
record(processor: GraphProcessor):
|
|
31
|
+
record(processor: GraphProcessor): (terminal?: {
|
|
32
|
+
type: 'done';
|
|
33
|
+
results: ProcessEvents['done']['results'];
|
|
34
|
+
} | {
|
|
35
|
+
type: 'error';
|
|
36
|
+
error: ProcessEvents['error']['error'];
|
|
37
|
+
}) => void;
|
|
32
38
|
getRecording(): Recording;
|
|
33
39
|
get events(): RecordedEvents[];
|
|
34
40
|
static deserializeFromString(serialized: string): ExecutionRecorder;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function uint8ArrayToBase64(uint8Array: Uint8Array): Promise<string
|
|
1
|
+
export declare function uint8ArrayToBase64(uint8Array: Uint8Array): Promise<string>;
|
|
2
2
|
export declare function uint8ArrayToBase64Sync(uint8Array: Uint8Array): string;
|
|
3
3
|
export declare function base64ToUint8Array(base64: string): Uint8Array<ArrayBuffer>;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
/** Gets an Error from an unknown error object (strict unknown errors is enabled, helper util). */
|
|
2
2
|
export declare function getError(error: unknown): Error;
|
|
3
|
+
/** Full failure text for graph error outputs, including nested causes. */
|
|
4
|
+
export declare function formatCaughtRunError(error: unknown, seen?: Set<unknown>): string;
|
|
5
|
+
/** Caller cancellation wins over provider failure, including cross-realm errors. */
|
|
6
|
+
export declare function isAbortError(error: unknown, signal: AbortSignal): boolean;
|
|
@@ -37,8 +37,18 @@ export type InterpolationTokenReplacementInfo = {
|
|
|
37
37
|
};
|
|
38
38
|
export type ReplaceInterpolationTokensOptions = {
|
|
39
39
|
trim?: boolean;
|
|
40
|
+
guard?: InterpolationGuard;
|
|
41
|
+
};
|
|
42
|
+
/** Optional caller-owned preparation limits; ordinary interpolation is unchanged. */
|
|
43
|
+
export type InterpolationGuard = {
|
|
44
|
+
tokenLimit: number;
|
|
45
|
+
check: () => void;
|
|
46
|
+
prepareValue: (value: unknown) => unknown;
|
|
47
|
+
output: (fragment: string, previousLength: number) => void;
|
|
48
|
+
processing: (input: string, name: string, parameter: number | undefined) => void;
|
|
40
49
|
};
|
|
41
50
|
export type InterpolateOptions = {
|
|
51
|
+
guard?: InterpolationGuard;
|
|
42
52
|
/** A snapshot of the globals referenced by this template. */
|
|
43
53
|
globalValues?: Record<string, unknown>;
|
|
44
54
|
/** Set false when ordinary interpolation variables are raw JSON. */
|
|
@@ -50,6 +60,7 @@ export type InterpolateOptions = {
|
|
|
50
60
|
coerceBareVariableDataValues?: boolean;
|
|
51
61
|
};
|
|
52
62
|
export type InterpolationValueSources = {
|
|
63
|
+
guard?: InterpolationGuard;
|
|
53
64
|
variables?: Record<string, unknown>;
|
|
54
65
|
graphInputValues?: Record<string, unknown>;
|
|
55
66
|
contextValues?: Record<string, unknown>;
|
|
@@ -79,7 +90,7 @@ export declare function parseInterpolationExpression(expression: string): Parsed
|
|
|
79
90
|
/** Splits an interpolation token into its expression, processor chain, and parsed reference. */
|
|
80
91
|
export declare function parseInterpolationToken(rawInner: string): Omit<ParsedInterpolationToken, 'span'>;
|
|
81
92
|
/** Returns an immutable, cached syntax representation. It never evaluates values. */
|
|
82
|
-
export declare function parseInterpolationTemplate(template: string): ParsedInterpolationTemplate;
|
|
93
|
+
export declare function parseInterpolationTemplate(template: string, check?: () => void, tokenLimit?: number): ParsedInterpolationTemplate;
|
|
83
94
|
export declare function protectEscapedInterpolationTokens(template: string): string;
|
|
84
95
|
export declare function restoreEscapedInterpolationTokens(template: string): string;
|
|
85
96
|
export declare function findInterpolationTokenSpans(template: string): InterpolationTokenSpan[];
|
|
@@ -97,7 +108,7 @@ export declare function extractInterpolationVariableReferences(template: string)
|
|
|
97
108
|
* are intentionally snapshotted at node execution: interpolation neither
|
|
98
109
|
* waits for a writer nor creates an execution dependency.
|
|
99
110
|
*/
|
|
100
|
-
export declare function getInterpolationGlobalValues<T>(template: string, getGlobal: ((id: string) => T | undefined) | undefined): Record<string, T>;
|
|
111
|
+
export declare function getInterpolationGlobalValues<T>(template: string, getGlobal: ((id: string) => T | undefined) | undefined, check?: () => void, tokenLimit?: number): Record<string, T>;
|
|
101
112
|
/** Extracts base port names only. Prefer `extractInterpolationVariableReferences` when type selection matters. */
|
|
102
113
|
export declare function extractInterpolationVariables(template: string): string[];
|
|
103
114
|
/**
|
|
@@ -18,4 +18,4 @@ export declare function isInterpolationRegexLiteralStart(value: string, index: n
|
|
|
18
18
|
* the rest of the execution runtime. The returned spans are fresh data and
|
|
19
19
|
* exclude escaped triple-brace tokens.
|
|
20
20
|
*/
|
|
21
|
-
export declare function scanInterpolationTokenSpans(template: string): InterpolationTokenSpan[];
|
|
21
|
+
export declare function scanInterpolationTokenSpans(template: string, check?: () => void, tokenLimit?: number): InterpolationTokenSpan[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Project, NodeGraph, Dataset, DatasetMetadata } from '../../index.js';
|
|
2
2
|
import { type AttachedData } from './serializationUtils.js';
|
|
3
3
|
export declare function serializeProject(project: Project, attachedData?: AttachedData): unknown;
|
|
4
|
-
export declare function deserializeProject(serializedProject: unknown, path?: string | null
|
|
4
|
+
export declare function deserializeProject(serializedProject: unknown, path?: string | null, options?: {
|
|
5
|
+
logErrors?: boolean;
|
|
6
|
+
}): [Project, AttachedData];
|
|
5
7
|
export declare function serializeGraph(graph: NodeGraph): unknown;
|
|
6
8
|
export declare function deserializeGraph(serializedGraph: unknown): NodeGraph;
|
|
7
9
|
export type CombinedDataset = {
|
|
@@ -13,6 +13,7 @@ export declare class ProjectValidationError extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
/** Validates a deserialized project structure. Returns errors for structural problems. */
|
|
15
15
|
export declare function validateProject(project: unknown): ProjectValidationResult;
|
|
16
|
+
export declare function isValidProjectStaticData(value: unknown): boolean;
|
|
16
17
|
/** Quick structural check - throws on invalid project. */
|
|
17
18
|
export declare function doubleCheckProject(project: Project): void;
|
|
18
19
|
export declare function yamlProblem(err: yaml.YAMLError): never;
|