@valerypopoff/rivet2-core 2.0.11 → 2.1.1
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 +1657 -158
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/esm/exports.js +4 -0
- package/dist/esm/model/GraphBoundaryCache.js +36 -4
- package/dist/esm/model/GraphBoundaryEffects.js +32 -0
- package/dist/esm/model/GraphPreprocessor.js +6 -4
- package/dist/esm/model/GraphProcessor.js +129 -17
- package/dist/esm/model/NodeGraph.js +1 -1
- package/dist/esm/model/NodePrefabResolver.js +57 -0
- package/dist/esm/model/Nodes.js +4 -1
- package/dist/esm/model/ProcessContextBuilder.js +3 -1
- package/dist/esm/model/UiGraph.js +113 -0
- package/dist/esm/model/UiGraphRendererStyles.js +241 -0
- package/dist/esm/model/chat/openAIChatRuntime.js +0 -1
- package/dist/esm/model/chat-v2/aiSdkBridge.js +100 -2
- package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +1 -1
- package/dist/esm/model/chat-v2/chatV2Outputs.js +11 -2
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +38 -31
- package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +4 -1
- package/dist/esm/model/chat-v2/chatV2Shared.js +2 -2
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +5 -5
- package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +8 -2
- package/dist/esm/model/chat-v2/providerOptions.js +65 -2
- package/dist/esm/model/nodes/CoalesceNode.js +1 -1
- package/dist/esm/model/nodes/CompareNode.js +15 -14
- package/dist/esm/model/nodes/GraphOutputNode.js +1 -0
- package/dist/esm/model/nodes/LLMChatV2Node.js +66 -17
- package/dist/esm/model/nodes/NodePrefabInstanceNode.js +39 -0
- package/dist/esm/model/nodes/PromptNode.js +2 -1
- package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +49 -7
- package/dist/esm/model/nodes/SubGraphNode.js +42 -5
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/utils/jsonValueToDataValue.js +48 -0
- package/dist/esm/utils/projectComparison/connections.js +57 -0
- package/dist/esm/utils/projectComparison/graphs.js +60 -0
- package/dist/esm/utils/projectComparison/nodes.js +53 -0
- package/dist/esm/utils/projectComparison/summaries.js +60 -0
- package/dist/esm/utils/projectComparison/values.js +40 -0
- package/dist/esm/utils/projectComparison.js +73 -0
- package/dist/esm/utils/serialization/serializationHelpers.js +24 -3
- package/dist/esm/utils/serialization/serialization_v4.js +30 -0
- package/dist/types/exports.d.ts +5 -0
- package/dist/types/model/EditorDefinition.d.ts +1 -0
- package/dist/types/model/ExecutorProtocol.d.ts +13 -3
- package/dist/types/model/GraphBoundaryCache.d.ts +9 -3
- package/dist/types/model/GraphBoundaryEffects.d.ts +9 -0
- package/dist/types/model/GraphProcessor.d.ts +15 -0
- package/dist/types/model/NodeBase.d.ts +5 -0
- package/dist/types/model/NodeBodySpec.d.ts +1 -0
- package/dist/types/model/NodePrefabResolver.d.ts +13 -0
- package/dist/types/model/Nodes.d.ts +5 -4
- package/dist/types/model/ProcessContext.d.ts +5 -1
- package/dist/types/model/ProcessContextBuilder.d.ts +4 -2
- package/dist/types/model/Project.d.ts +9 -0
- package/dist/types/model/UiGraph.d.ts +84 -0
- package/dist/types/model/UiGraphRendererStyles.d.ts +2 -0
- package/dist/types/model/chat-v2/aiSdkBridge.d.ts +1 -0
- package/dist/types/model/chat-v2/chatV2FeatureCompatibility.d.ts +1 -1
- package/dist/types/model/chat-v2/chatV2Outputs.d.ts +4 -2
- package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +1 -1
- package/dist/types/model/chat-v2/chatV2Types.d.ts +24 -1
- package/dist/types/model/chat-v2/providerOptions.d.ts +1 -0
- package/dist/types/model/nodes/CompareNode.d.ts +4 -0
- package/dist/types/model/nodes/LLMChatV2Node.d.ts +2 -1
- package/dist/types/model/nodes/NodePrefabInstanceNode.d.ts +13 -0
- package/dist/types/model/nodes/SubGraphNode.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/jsonValueToDataValue.d.ts +2 -0
- package/dist/types/utils/projectComparison/connections.d.ts +5 -0
- package/dist/types/utils/projectComparison/graphs.d.ts +3 -0
- package/dist/types/utils/projectComparison/nodes.d.ts +5 -0
- package/dist/types/utils/projectComparison/summaries.d.ts +4 -0
- package/dist/types/utils/projectComparison/values.d.ts +5 -0
- package/dist/types/utils/projectComparison.d.ts +77 -0
- package/package.json +1 -1
|
@@ -89,16 +89,17 @@ export * from './nodes/MCPDiscoveryNode.js';
|
|
|
89
89
|
export * from './nodes/MCPToolCallNode.js';
|
|
90
90
|
export * from './nodes/MCPGetPromptNode.js';
|
|
91
91
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
92
|
-
export
|
|
92
|
+
export * from './nodes/NodePrefabInstanceNode.js';
|
|
93
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "comment" | "subGraph" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
93
94
|
type: "mcpDiscovery";
|
|
94
95
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
95
96
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
96
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
97
|
-
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "
|
|
97
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
98
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "comment" | "subGraph" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
98
99
|
type: "mcpDiscovery";
|
|
99
100
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
100
101
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
101
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
102
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
102
103
|
export { globalRivetNodeRegistry };
|
|
103
104
|
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
104
105
|
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Opaque } from 'type-fest';
|
|
2
|
-
import { type Settings, type NativeApi, type Project, type DataValue, type ExternalFunction, type Outputs, type GraphId, type GraphProcessor, type ScalarOrArrayDataValue, type DatasetProvider, type ChartNode, type NodeId, type AttachedNodeData, type AudioProvider, type StringArrayDataValue, type ProjectId, type MCPProvider } from '../index.js';
|
|
2
|
+
import { type Settings, type NativeApi, type Project, type DataValue, type ExternalFunction, type Outputs, type GraphId, type GraphProcessor, type ScalarOrArrayDataValue, type DatasetProvider, type ChartNode, type NodeId, type PortId, type AttachedNodeData, type AudioProvider, type StringArrayDataValue, type ProjectId, type MCPProvider } from '../index.js';
|
|
3
3
|
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
4
4
|
import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
5
5
|
import type { ProjectReferenceLoader } from './ProjectReferenceLoader.js';
|
|
@@ -63,6 +63,10 @@ export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessCon
|
|
|
63
63
|
signal: AbortSignal;
|
|
64
64
|
/** A unique ID for this specific execution of the node. */
|
|
65
65
|
processId: ProcessId;
|
|
66
|
+
/** Output ports with at least one active immediate downstream consumer in this graph run. */
|
|
67
|
+
activeOutputPortIds: ReadonlySet<PortId>;
|
|
68
|
+
/** True when this exact node is the direct terminal selected by run-to execution. */
|
|
69
|
+
isDirectRunTarget: boolean;
|
|
66
70
|
/** Stable execution lineage for the current graph invocation. */
|
|
67
71
|
execution: GraphExecutionMetadata;
|
|
68
72
|
/** Context values that are accessible on graphs and all subgraphs. */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { DataValue, ScalarOrArrayDataValue, StringArrayDataValue } from './DataValue.js';
|
|
2
2
|
import type { GraphExecutionMetadata, InternalProcessContext, ProcessId } from './ProcessContext.js';
|
|
3
|
-
import type { ChartNode } from './NodeBase.js';
|
|
3
|
+
import type { ChartNode, PortId } from './NodeBase.js';
|
|
4
4
|
import type { GraphId } from './NodeGraph.js';
|
|
5
5
|
import type { Project } from './Project.js';
|
|
6
6
|
import type { AttachedNodeData, ExternalFunction, Outputs } from './GraphProcessor.js';
|
|
7
|
-
export type NodeProcessContextBase = Omit<InternalProcessContext, 'attachedData' | 'createSubProcessor' | 'execution' | 'externalFunctions' | 'getPluginConfig' | 'node' | 'onPartialOutputs' | 'processId' | 'requestUserInput' | 'setGlobal' | 'signal' | 'waitEvent'>;
|
|
7
|
+
export type NodeProcessContextBase = Omit<InternalProcessContext, 'attachedData' | 'activeOutputPortIds' | 'createSubProcessor' | 'execution' | 'externalFunctions' | 'getPluginConfig' | 'node' | 'onPartialOutputs' | 'processId' | 'requestUserInput' | 'isDirectRunTarget' | 'setGlobal' | 'signal' | 'waitEvent'>;
|
|
8
8
|
export declare function buildNodeProcessContext(options: {
|
|
9
|
+
activeOutputPortIds: ReadonlySet<PortId>;
|
|
9
10
|
base: NodeProcessContextBase;
|
|
10
11
|
attachedData: AttachedNodeData;
|
|
11
12
|
createSubProcessor: (subGraphId: GraphId | undefined, options?: {
|
|
@@ -15,6 +16,7 @@ export declare function buildNodeProcessContext(options: {
|
|
|
15
16
|
execution: GraphExecutionMetadata;
|
|
16
17
|
externalFunctions: Record<string, ExternalFunction>;
|
|
17
18
|
getPluginConfig: (name: string) => string | undefined;
|
|
19
|
+
isDirectRunTarget: boolean;
|
|
18
20
|
node: ChartNode;
|
|
19
21
|
nodeAbortController: AbortController;
|
|
20
22
|
onPartialOutputs: (partialOutputs: Outputs) => void;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import type { Opaque } from 'type-fest';
|
|
2
|
+
import type { ChartNode } from './NodeBase.js';
|
|
2
3
|
import { type GraphId, type NodeGraph } from './NodeGraph.js';
|
|
3
4
|
import { type PluginLoadSpec } from './PluginLoadSpec.js';
|
|
4
5
|
import type { MCP } from '../integrations/mcp/MCPProvider.js';
|
|
6
|
+
import type { UiGraph, UiGraphId } from './UiGraph.js';
|
|
5
7
|
export type ProjectId = Opaque<string, 'ProjectId'>;
|
|
6
8
|
export type DataId = Opaque<string, 'DataId'>;
|
|
9
|
+
export type NodePrefabId = Opaque<string, 'NodePrefabId'>;
|
|
10
|
+
export type NodePrefab = {
|
|
11
|
+
id: NodePrefabId;
|
|
12
|
+
sourceNode: ChartNode;
|
|
13
|
+
};
|
|
7
14
|
export type Project = {
|
|
8
15
|
metadata: ProjectMetadata;
|
|
9
16
|
plugins?: PluginLoadSpec[];
|
|
10
17
|
graphs: Record<GraphId, NodeGraph>;
|
|
18
|
+
nodePrefabs?: Record<NodePrefabId, NodePrefab>;
|
|
19
|
+
uiGraphs?: Record<UiGraphId, UiGraph>;
|
|
11
20
|
data?: Record<DataId, string>;
|
|
12
21
|
/** References to other projects. */
|
|
13
22
|
references?: ProjectReference[];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Opaque } from 'type-fest';
|
|
2
|
+
import type { GraphId } from './NodeGraph.js';
|
|
3
|
+
import type { DataValue } from './DataValue.js';
|
|
4
|
+
export type UiGraphId = Opaque<string, 'UiGraphId'>;
|
|
5
|
+
export type UiComponentId = Opaque<string, 'UiComponentId'>;
|
|
6
|
+
export type UiGraphOutputs = Record<string, DataValue>;
|
|
7
|
+
export type UiGraphValueBinding = {
|
|
8
|
+
type: 'state';
|
|
9
|
+
key: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'literal';
|
|
12
|
+
value: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type UiGraphRunGraphAction = {
|
|
15
|
+
type: 'runGraph';
|
|
16
|
+
graphId?: GraphId;
|
|
17
|
+
inputMappings?: UiGraphInputBinding[];
|
|
18
|
+
inputs?: Record<string, UiGraphValueBinding>;
|
|
19
|
+
outputs?: UiGraphOutputBinding[];
|
|
20
|
+
outputKey?: string;
|
|
21
|
+
outputStateKey?: string;
|
|
22
|
+
};
|
|
23
|
+
export type UiGraphInputBinding = {
|
|
24
|
+
inputKey: string;
|
|
25
|
+
stateKey: string;
|
|
26
|
+
};
|
|
27
|
+
export type UiGraphOutputBinding = {
|
|
28
|
+
outputKey?: string;
|
|
29
|
+
stateKey: string;
|
|
30
|
+
};
|
|
31
|
+
export type UiGraphAction = UiGraphRunGraphAction;
|
|
32
|
+
export type UiGraphComponent = {
|
|
33
|
+
id: UiComponentId;
|
|
34
|
+
type: 'text';
|
|
35
|
+
text: string;
|
|
36
|
+
} | {
|
|
37
|
+
id: UiComponentId;
|
|
38
|
+
type: 'markdown';
|
|
39
|
+
markdown: string;
|
|
40
|
+
} | {
|
|
41
|
+
id: UiComponentId;
|
|
42
|
+
type: 'input';
|
|
43
|
+
label: string;
|
|
44
|
+
stateKey: string;
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
defaultValue?: string;
|
|
47
|
+
} | {
|
|
48
|
+
id: UiComponentId;
|
|
49
|
+
type: 'textarea';
|
|
50
|
+
label: string;
|
|
51
|
+
stateKey: string;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
defaultValue?: string;
|
|
54
|
+
} | {
|
|
55
|
+
id: UiComponentId;
|
|
56
|
+
type: 'button';
|
|
57
|
+
label: string;
|
|
58
|
+
action: UiGraphAction;
|
|
59
|
+
} | {
|
|
60
|
+
id: UiComponentId;
|
|
61
|
+
type: 'output';
|
|
62
|
+
label?: string;
|
|
63
|
+
stateKey: string;
|
|
64
|
+
renderAs?: 'text' | 'json' | 'markdown';
|
|
65
|
+
};
|
|
66
|
+
export type UiGraph = {
|
|
67
|
+
id: UiGraphId;
|
|
68
|
+
name: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
components: UiGraphComponent[];
|
|
71
|
+
};
|
|
72
|
+
export declare function createDefaultUiGraph(options?: {
|
|
73
|
+
graphId?: GraphId;
|
|
74
|
+
name?: string;
|
|
75
|
+
}): UiGraph;
|
|
76
|
+
export declare function getUiGraphInitialState(uiGraph: UiGraph): Record<string, unknown>;
|
|
77
|
+
export declare function getUiGraphActionComponent(uiGraph: UiGraph, componentId: UiComponentId): Extract<UiGraphComponent, {
|
|
78
|
+
type: 'button';
|
|
79
|
+
}> | undefined;
|
|
80
|
+
export declare function resolveUiGraphActionInputs(action: UiGraphRunGraphAction, state: Record<string, unknown>): Record<string, unknown>;
|
|
81
|
+
export declare function resolveUiGraphActionOutputStateValue(action: UiGraphRunGraphAction, outputs: UiGraphOutputs): unknown;
|
|
82
|
+
export declare function resolveUiGraphActionOutputStatePatch(action: UiGraphRunGraphAction, outputs: UiGraphOutputs): Record<string, unknown>;
|
|
83
|
+
export declare function getUiGraphActionOutputBindings(action: UiGraphRunGraphAction): UiGraphOutputBinding[];
|
|
84
|
+
export declare function getUiGraphActionInputBindings(action: UiGraphRunGraphAction): UiGraphInputBinding[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const RIVET_WEB_APP_RENDERER_CSS = "\n.rivet-web-app-root {\n --rivet-web-app-background: var(--grey-dark-colorish, #1c222b);\n --rivet-web-app-foreground: var(--foreground, #ffffff);\n --rivet-web-app-card-background: color-mix(in srgb, var(--modal-surface-bg, #252b34) 88%, var(--foreground, #ffffff) 4%);\n --rivet-web-app-card-border: var(--foldable-section-border, rgba(255, 255, 255, 0.04));\n --rivet-web-app-control-background: var(--form-control-bg, #20252d);\n --rivet-web-app-control-border: var(--form-control-border, rgba(255, 255, 255, 0.14));\n --rivet-web-app-button-radius: var(--rivet-web-app-host-button-radius, 6px);\n --rivet-web-app-button-background: var(--success, #3ba85b);\n --rivet-web-app-button-foreground: var(--grey-lightest, #ffffff);\n --rivet-web-app-output-title: var(--rivet-web-app-foreground, #ffffff);\n --rivet-web-app-error-color: var(--error, #ff6b5f);\n --rivet-web-app-font-size: var(--rivet-web-app-host-font-size, 15px);\n box-sizing: border-box;\n height: 100%;\n background: var(--rivet-web-app-background);\n color: var(--rivet-web-app-foreground);\n overflow: auto;\n font-family: Inter, system-ui, sans-serif;\n font-size: var(--rivet-web-app-font-size);\n line-height: 1.4;\n}\n\n.rivet-web-app-root *,\n.rivet-web-app-root *::before,\n.rivet-web-app-root *::after {\n box-sizing: border-box;\n}\n\n.rivet-web-app-surface {\n display: grid;\n gap: 16px;\n margin: 0 auto;\n max-width: 760px;\n padding: 48px 20px;\n}\n\n.rivet-web-app-card,\n.rivet-web-app-field {\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 10px;\n background: var(--rivet-web-app-card-background);\n padding: 16px;\n}\n\n.rivet-web-app-component-frame {\n border-radius: 12px;\n margin: -5px;\n padding: 4px;\n}\n\n.rivet-web-app-component-frame.active {\n background: color-mix(in srgb, var(--modal-surface-bg, #252b34) 75%, var(--primary, #ff9e2c) 16%);\n}\n\n.rivet-web-app-field {\n display: grid;\n gap: 8px;\n color: var(--rivet-web-app-foreground);\n font-size: inherit;\n font-weight: 600;\n}\n\n.rivet-web-app-field input,\n.rivet-web-app-field textarea {\n appearance: none;\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--rivet-web-app-control-border);\n border-radius: 8px;\n background: var(--rivet-web-app-control-background);\n color: var(--rivet-web-app-foreground);\n font: inherit;\n font-weight: 400;\n padding: 10px 12px;\n}\n\n.rivet-web-app-field textarea {\n min-height: 110px;\n resize: vertical;\n}\n\n.rivet-web-app-button {\n width: fit-content;\n border: 0;\n border-radius: var(--rivet-web-app-button-radius);\n background: var(--rivet-web-app-button-background);\n color: var(--rivet-web-app-button-foreground);\n cursor: pointer;\n font: inherit;\n font-weight: 700;\n padding: 10px 16px;\n}\n\n.rivet-web-app-button:disabled {\n cursor: wait;\n opacity: 0.72;\n}\n\n.rivet-web-app-output {\n display: grid;\n gap: 8px;\n}\n\n.rivet-web-app-output-title {\n color: var(--rivet-web-app-output-title);\n font-weight: 700;\n}\n\n.rivet-web-app-output pre {\n margin: 0;\n background: transparent;\n border-radius: 0;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: inherit;\n padding: 0;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.rivet-web-app-markdown,\n.rivet-web-app-output-markdown {\n word-break: break-word;\n}\n\n.rivet-web-app-markdown.markdown-body {\n background: var(--rivet-web-app-card-background);\n font-family: inherit;\n min-width: 0;\n}\n\n.rivet-web-app-output-markdown.markdown-body {\n background: transparent;\n font-family: inherit;\n min-width: 0;\n}\n\n.rivet-web-app-markdown h1,\n.rivet-web-app-output-markdown h1 {\n margin: 0 0 12px;\n padding-bottom: 8px;\n border-bottom: 1px solid var(--rivet-web-app-card-border);\n font-size: 24px;\n line-height: 1.22;\n}\n\n.rivet-web-app-markdown h2,\n.rivet-web-app-output-markdown h2 {\n margin: 0 0 10px;\n font-size: 20px;\n line-height: 1.25;\n}\n\n.rivet-web-app-markdown p,\n.rivet-web-app-output-markdown p,\n.rivet-web-app-markdown ul,\n.rivet-web-app-output-markdown ul {\n margin: 0 0 12px;\n}\n\n.rivet-web-app-markdown.markdown-body code,\n.rivet-web-app-output-markdown.markdown-body code {\n border-radius: 4px;\n background: color-mix(in srgb, var(--rivet-web-app-control-background) 70%, var(--rivet-web-app-foreground) 6%);\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n padding: 1px 4px;\n}\n\n.rivet-web-app-markdown.markdown-body pre,\n.rivet-web-app-output-markdown.markdown-body pre {\n background: transparent;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n padding: 0;\n white-space: pre-wrap;\n}\n\n.rivet-web-app-markdown > :first-child,\n.rivet-web-app-output-markdown > :first-child {\n margin-top: 0;\n}\n\n.rivet-web-app-markdown > :last-child,\n.rivet-web-app-output-markdown > :last-child {\n margin-bottom: 0;\n}\n\n.rivet-web-app-error {\n color: var(--rivet-web-app-error-color);\n font-weight: 700;\n}\n\n.rivet-web-app-modal-backdrop {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: grid;\n place-items: center;\n background: rgba(0, 0, 0, 0.46);\n background: color-mix(in srgb, var(--rivet-web-app-background) 78%, transparent);\n padding: 20px;\n}\n\n.rivet-web-app-modal {\n display: grid;\n gap: 18px;\n width: min(420px, 100%);\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 12px;\n background: var(--rivet-web-app-card-background);\n box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);\n color: var(--rivet-web-app-foreground);\n padding: 22px;\n}\n\n.rivet-web-app-modal-message {\n font-size: 18px;\n font-weight: 700;\n line-height: 1.3;\n}\n\n.rivet-web-app-modal-button {\n justify-self: start;\n}\n";
|
|
2
|
+
export declare const RIVET_WEB_APP_DOCUMENT_CSS = "\nhtml,\nbody {\n height: 100%;\n margin: 0;\n}\n\nbody {\n min-height: 100vh;\n background: #1c222b;\n}\n\n#app {\n min-height: 100vh;\n}\n";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { StreamChatV2Options, StreamChatV2Result } from './chatV2Types.js';
|
|
2
2
|
export declare function streamChatV2(options: StreamChatV2Options): Promise<StreamChatV2Result>;
|
|
3
|
+
export declare function generateChatV2(options: StreamChatV2Options): Promise<StreamChatV2Result>;
|
|
@@ -3,7 +3,7 @@ import type { LLMChatV2NodeData } from './llmChatV2NodeData.js';
|
|
|
3
3
|
export type LLMChatV2StructuredResponseFormat = ChatV2StructuredResponseFormat;
|
|
4
4
|
export declare const LLM_CHAT_V2_TOOL_RESPONSE_FORMAT_CONFLICT_COPY: {
|
|
5
5
|
readonly title: "\"Tool use\" conflicts with \"Structured outputs\"";
|
|
6
|
-
readonly paragraphs: readonly ["\"Tool use\" and \"Structured outputs\" cannot be used at the same time.", "Use \"Tool use\" with Default/Text response format, or turn \"Tool use\" off before choosing JSON/JSON schema."];
|
|
6
|
+
readonly paragraphs: readonly ["\"Tool use\" and \"Structured outputs\" cannot be used at the same time.", "Use \"Tool use\" with Default/Text response format, or turn \"Tool use\" off before choosing JSON object/JSON schema."];
|
|
7
7
|
};
|
|
8
8
|
type LLMChatV2ToolResponseFormatData = Pick<LLMChatV2NodeData, 'useToolCalling' | 'responseFormat'>;
|
|
9
9
|
export declare function isLLMChatV2StructuredResponseFormat(responseFormat: unknown): responseFormat is LLMChatV2StructuredResponseFormat;
|
|
@@ -15,6 +15,7 @@ type CreateChatV2CommonOutputsOptions = ChatV2CommonOutputOptions & {
|
|
|
15
15
|
responseError: string | undefined;
|
|
16
16
|
requestStatuses: number[];
|
|
17
17
|
requestErrors: string[];
|
|
18
|
+
requestBodies?: unknown[] | undefined;
|
|
18
19
|
};
|
|
19
20
|
type CreateChatV2ProviderFailureOutputsOptions = Pick<RunChatV2PipelineOptions, 'outputUsage' | 'outputReasoning' | 'includeFunctionCalls' | 'retryOnNon200'> & {
|
|
20
21
|
requestMessages: ChatMessage[];
|
|
@@ -22,8 +23,9 @@ type CreateChatV2ProviderFailureOutputsOptions = Pick<RunChatV2PipelineOptions,
|
|
|
22
23
|
responseError: string;
|
|
23
24
|
requestStatuses: number[];
|
|
24
25
|
requestErrors: string[];
|
|
26
|
+
requestBodies?: unknown[] | undefined;
|
|
25
27
|
};
|
|
26
28
|
export declare function normalizeChatV2Usage(usage: LanguageModelUsage | undefined, options: Pick<RunChatV2PipelineOptions, 'provider' | 'modelId'>): ChatV2NormalizedUsage | undefined;
|
|
27
|
-
export declare function createChatV2CommonOutputs({ requestMessages, response, structuredOutput, functionCalls, usage, reasoning, requestStatus, responseError, requestStatuses, requestErrors, outputUsage, outputReasoning, outputRequestStatus, includeFunctionCalls, functionCallMode, retryOnNon200, responseFormat, }: CreateChatV2CommonOutputsOptions): Outputs;
|
|
28
|
-
export declare function createChatV2ProviderFailureOutputs({ requestMessages, responseStatus, responseError, requestStatuses, requestErrors, outputUsage, outputReasoning, includeFunctionCalls, retryOnNon200, }: CreateChatV2ProviderFailureOutputsOptions): Outputs;
|
|
29
|
+
export declare function createChatV2CommonOutputs({ requestMessages, response, structuredOutput, functionCalls, usage, reasoning, requestStatus, responseError, requestStatuses, requestErrors, requestBodies, outputUsage, outputReasoning, outputRequestStatus, includeFunctionCalls, functionCallMode, retryOnNon200, responseFormat, }: CreateChatV2CommonOutputsOptions): Outputs;
|
|
30
|
+
export declare function createChatV2ProviderFailureOutputs({ requestMessages, responseStatus, responseError, requestStatuses, requestErrors, requestBodies, outputUsage, outputReasoning, includeFunctionCalls, retryOnNon200, }: CreateChatV2ProviderFailureOutputsOptions): Outputs;
|
|
29
31
|
export {};
|
|
@@ -23,5 +23,5 @@ export type ChatV2ResponseFormatParameters = undefined | {
|
|
|
23
23
|
};
|
|
24
24
|
export declare function isChatV2StructuredResponseFormat(responseFormat: unknown): responseFormat is ChatV2StructuredResponseFormat;
|
|
25
25
|
export declare function resolveChatV2ResponseFormatParameters(data: ChatV2ResponseFormatData, inputs: Inputs): ChatV2ResponseFormatParameters;
|
|
26
|
-
export declare function createChatV2ResponseOutput(parameters: ChatV2ResponseFormatParameters): ChatV2ResponseOutput | undefined;
|
|
26
|
+
export declare function createChatV2ResponseOutput(parameters: ChatV2ResponseFormatParameters, provider?: ChatV2Provider): ChatV2ResponseOutput | undefined;
|
|
27
27
|
export declare function mergeCustomProviderResponseFormatOptions(provider: ChatV2Provider, providerOptions: ChatV2ProviderOptions | undefined, parameters: ChatV2ResponseFormatParameters): ChatV2ProviderOptions | undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { streamText, LanguageModelUsage, ModelMessage, TextStreamPart, ToolSet } from 'ai';
|
|
1
|
+
import type { generateText, streamText, LanguageModelUsage, ModelMessage, TextStreamPart, ToolSet } from 'ai';
|
|
2
2
|
import type { ChatMessage, GptFunction } from '../DataValue.js';
|
|
3
3
|
import type { Outputs } from '../GraphProcessor.js';
|
|
4
4
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
5
5
|
import type { AssistantMessageFunctionCallMode, StreamedFunctionCall } from '../chat/streamChatResponse.js';
|
|
6
6
|
type StreamTextArgs = Parameters<typeof streamText>[0];
|
|
7
|
+
type GenerateTextArgs = Parameters<typeof generateText>[0];
|
|
7
8
|
type MaybePromiseLike<T> = T | PromiseLike<T>;
|
|
8
9
|
export type ChatV2Provider = 'openai' | 'anthropic' | 'google' | 'custom';
|
|
9
10
|
export type ChatV2Model = StreamTextArgs['model'];
|
|
@@ -33,6 +34,25 @@ export type ChatV2StreamHandle = {
|
|
|
33
34
|
usage?: MaybePromiseLike<LanguageModelUsage | undefined> | undefined;
|
|
34
35
|
};
|
|
35
36
|
export type ChatV2StreamExecutor = (args: StreamTextArgs) => ChatV2StreamHandle | Promise<ChatV2StreamHandle>;
|
|
37
|
+
export type ChatV2GenerateHandle = {
|
|
38
|
+
text: string;
|
|
39
|
+
output?: unknown;
|
|
40
|
+
toolCalls?: Array<{
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
toolName: string;
|
|
43
|
+
input: unknown;
|
|
44
|
+
}>;
|
|
45
|
+
finishReason?: MaybePromiseLike<string | undefined> | undefined;
|
|
46
|
+
reasoningText?: MaybePromiseLike<string | undefined> | undefined;
|
|
47
|
+
reasoning?: MaybePromiseLike<Array<{
|
|
48
|
+
text: string;
|
|
49
|
+
}> | undefined> | undefined;
|
|
50
|
+
providerMetadata?: MaybePromiseLike<ChatV2ProviderMetadata | undefined> | undefined;
|
|
51
|
+
requestStatus?: MaybePromiseLike<number | undefined> | undefined;
|
|
52
|
+
totalUsage?: MaybePromiseLike<LanguageModelUsage | undefined> | undefined;
|
|
53
|
+
usage?: MaybePromiseLike<LanguageModelUsage | undefined> | undefined;
|
|
54
|
+
};
|
|
55
|
+
export type ChatV2GenerateExecutor = (args: GenerateTextArgs) => ChatV2GenerateHandle | Promise<ChatV2GenerateHandle>;
|
|
36
56
|
export type StreamChatV2Options = {
|
|
37
57
|
model: ChatV2Model;
|
|
38
58
|
messages: ChatV2MessageList;
|
|
@@ -51,6 +71,7 @@ export type StreamChatV2Options = {
|
|
|
51
71
|
toolChoice?: ChatV2ToolChoice | undefined;
|
|
52
72
|
abortSignal?: AbortSignal | undefined;
|
|
53
73
|
executeStream?: ChatV2StreamExecutor | undefined;
|
|
74
|
+
executeGenerate?: ChatV2GenerateExecutor | undefined;
|
|
54
75
|
onPartialOutput?: ((partial: {
|
|
55
76
|
text: string;
|
|
56
77
|
functionCalls: StreamedFunctionCall[];
|
|
@@ -87,6 +108,7 @@ export type RunChatV2PipelineOptions = {
|
|
|
87
108
|
providerOptions?: ChatV2ProviderOptions | undefined;
|
|
88
109
|
toolChoice?: ChatV2ToolChoice | undefined;
|
|
89
110
|
anthropicCacheControlTtl?: '5m' | '1h' | undefined;
|
|
111
|
+
requestBodies?: unknown[] | undefined;
|
|
90
112
|
outputUsage?: boolean | undefined;
|
|
91
113
|
outputReasoning?: boolean | undefined;
|
|
92
114
|
outputRequestStatus?: boolean | undefined;
|
|
@@ -98,6 +120,7 @@ export type RunChatV2PipelineOptions = {
|
|
|
98
120
|
retryOnNon200CooldownMs?: number | undefined;
|
|
99
121
|
context: Pick<InternalProcessContext, 'signal' | 'onPartialOutputs'>;
|
|
100
122
|
executeStream?: ChatV2StreamExecutor | undefined;
|
|
123
|
+
executeGenerate?: ChatV2GenerateExecutor | undefined;
|
|
101
124
|
};
|
|
102
125
|
export type ChatV2PipelineResult = {
|
|
103
126
|
commonOutputs: Outputs;
|
|
@@ -48,6 +48,7 @@ export type CreateChatV2ModelOptions = {
|
|
|
48
48
|
apiKey?: string | undefined;
|
|
49
49
|
baseURL?: string | undefined;
|
|
50
50
|
headers?: Record<string, string> | undefined;
|
|
51
|
+
onRequestBody?: ((body: unknown) => void) | undefined;
|
|
51
52
|
};
|
|
52
53
|
export type ResolveChatV2ProviderConfigContext = Pick<InternalProcessContext, 'getChatNodeEndpoint' | 'getPluginConfig' | 'settings'>;
|
|
53
54
|
export type ResolvedChatV2ProviderConfig = {
|
|
@@ -7,6 +7,10 @@ export type CompareNodeData = {
|
|
|
7
7
|
comparisonFunction: '==' | '<' | '>' | '<=' | '>=' | '!=' | 'and' | 'or' | 'xor' | 'nand' | 'nor' | 'xnor';
|
|
8
8
|
useComparisonFunctionInput?: boolean;
|
|
9
9
|
};
|
|
10
|
+
export declare const compareNodeComparisonFunctionOptions: Array<{
|
|
11
|
+
label: string;
|
|
12
|
+
value: CompareNodeData['comparisonFunction'];
|
|
13
|
+
}>;
|
|
10
14
|
export declare class CompareNodeImpl extends NodeImpl<CompareNode> {
|
|
11
15
|
static create(): CompareNode;
|
|
12
16
|
getInputDefinitions(): NodeInputDefinition[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
2
2
|
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
3
3
|
import type { NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
4
|
+
import type { NodeBodySpec } from '../NodeBodySpec.js';
|
|
4
5
|
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
5
6
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
6
7
|
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
@@ -14,7 +15,7 @@ export declare class LLMChatV2NodeImpl extends NodeImpl<LLMChatV2Node> {
|
|
|
14
15
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
15
16
|
static getUIData(): NodeUIData;
|
|
16
17
|
getEditors(context: RivetUIContext): Promise<EditorDefinition<LLMChatV2Node>[]>;
|
|
17
|
-
getBody():
|
|
18
|
+
getBody(): NodeBodySpec;
|
|
18
19
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
19
20
|
}
|
|
20
21
|
export declare const llmChatV2Node: import("../NodeDefinition.js").NodeDefinition<LLMChatV2Node>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
2
|
+
import { type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
3
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
4
|
+
import { type NodePrefabInstanceNode, type NodePrefabInstanceNodeData } from '../NodePrefabResolver.js';
|
|
5
|
+
export type { NodePrefabInstanceNode, NodePrefabInstanceNodeData };
|
|
6
|
+
export declare class NodePrefabInstanceNodeImpl extends NodeImpl<NodePrefabInstanceNode> {
|
|
7
|
+
static create(): NodePrefabInstanceNode;
|
|
8
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
9
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
10
|
+
process(_inputData: Inputs): Promise<Outputs>;
|
|
11
|
+
static getUIData(): NodeUIData;
|
|
12
|
+
}
|
|
13
|
+
export declare const nodePrefabInstanceNode: import("../NodeDefinition.js").NodeDefinition<NodePrefabInstanceNode>;
|
|
@@ -15,6 +15,8 @@ export type SubGraphNode = ChartNode & {
|
|
|
15
15
|
useAsGraphPartialOutput?: boolean;
|
|
16
16
|
/** Data for each of the inputs of the subgraph */
|
|
17
17
|
inputData?: Record<string, DataValue>;
|
|
18
|
+
inputPortOrder?: string[];
|
|
19
|
+
outputPortOrder?: string[];
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
export declare class SubGraphNodeImpl extends NodeImpl<SubGraphNode> {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChartNode, NodeConnection } from '../../model/NodeBase.js';
|
|
2
|
+
import type { ProjectConnectionComparison } from '../projectComparison.js';
|
|
3
|
+
export declare function getProjectConnectionComparisonKey(connection: NodeConnection): string;
|
|
4
|
+
export declare function getComparableGraphConnections(connections: NodeConnection[], nodes: ChartNode[]): NodeConnection[];
|
|
5
|
+
export declare function compareConnections(beforeConnections: NodeConnection[], afterConnections: NodeConnection[]): Record<string, ProjectConnectionComparison>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GraphId, NodeGraph } from '../../model/NodeGraph.js';
|
|
2
|
+
import type { ProjectGraphComparison } from '../projectComparison.js';
|
|
3
|
+
export declare function compareGraphs(id: GraphId, before: NodeGraph | undefined, after: NodeGraph | undefined): ProjectGraphComparison;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChartNode, NodeId } from '../../model/NodeBase.js';
|
|
2
|
+
import type { ProjectNodeComparison, ProjectNodeFieldComparison } from '../projectComparison.js';
|
|
3
|
+
export declare function getProjectNodeFieldComparisons(comparison: ProjectNodeComparison): ProjectNodeFieldComparison[];
|
|
4
|
+
export declare function getComparableGraphNodes(nodes: ChartNode[]): ChartNode[];
|
|
5
|
+
export declare function compareNodes(beforeNodes: ChartNode[], afterNodes: ChartNode[]): Record<NodeId, ProjectNodeComparison>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeId } from '../../model/NodeBase.js';
|
|
2
|
+
import type { ProjectConnectionComparison, ProjectComparison, ProjectGraphComparison, ProjectNodePrefabComparison, ProjectNodeComparison, ProjectUiGraphComparison } from '../projectComparison.js';
|
|
3
|
+
export declare function summarizeProjectComparison(graphs: Record<ProjectGraphComparison['id'], ProjectGraphComparison>, nodePrefabs?: Record<string, ProjectNodePrefabComparison>, uiGraphs?: Record<string, ProjectUiGraphComparison>): ProjectComparison['summary'];
|
|
4
|
+
export declare function summarizeGraphComparison(nodes: Record<NodeId, ProjectNodeComparison>, connections: Record<string, ProjectConnectionComparison>): ProjectGraphComparison['summary'];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProjectNodeFieldComparison } from '../projectComparison.js';
|
|
2
|
+
export declare function areComparisonValuesEqual(left: unknown, right: unknown): boolean;
|
|
3
|
+
export declare function getChangedValueComparisons(path: string[], before: unknown, after: unknown): ProjectNodeFieldComparison[];
|
|
4
|
+
export declare function isComparisonRecord(value: unknown): value is Record<string, unknown>;
|
|
5
|
+
export declare function unionKeys(left: Record<string, unknown>, right: Record<string, unknown>): string[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ChartNode, NodeConnection, NodeId } from '../model/NodeBase.js';
|
|
2
|
+
import type { GraphId, NodeGraph } from '../model/NodeGraph.js';
|
|
3
|
+
import type { NodePrefab, NodePrefabId, Project } from '../model/Project.js';
|
|
4
|
+
import type { UiGraph, UiGraphId } from '../model/UiGraph.js';
|
|
5
|
+
export { getProjectConnectionComparisonKey } from './projectComparison/connections.js';
|
|
6
|
+
export { getProjectNodeFieldComparisons } from './projectComparison/nodes.js';
|
|
7
|
+
export type ProjectComparisonChangeKind = 'added' | 'removed' | 'changed' | 'unchanged';
|
|
8
|
+
export type ProjectNodeComparison = {
|
|
9
|
+
id: NodeId;
|
|
10
|
+
kind: ProjectComparisonChangeKind;
|
|
11
|
+
before?: ChartNode;
|
|
12
|
+
after?: ChartNode;
|
|
13
|
+
};
|
|
14
|
+
export type ProjectNodeFieldComparison = {
|
|
15
|
+
field: string;
|
|
16
|
+
path: string[];
|
|
17
|
+
before?: unknown;
|
|
18
|
+
after?: unknown;
|
|
19
|
+
};
|
|
20
|
+
export type ProjectConnectionComparison = {
|
|
21
|
+
key: string;
|
|
22
|
+
kind: ProjectComparisonChangeKind;
|
|
23
|
+
before?: NodeConnection;
|
|
24
|
+
after?: NodeConnection;
|
|
25
|
+
};
|
|
26
|
+
type ProjectGraphComparisonSummary = {
|
|
27
|
+
addedNodes: number;
|
|
28
|
+
removedNodes: number;
|
|
29
|
+
changedNodes: number;
|
|
30
|
+
addedConnections: number;
|
|
31
|
+
removedConnections: number;
|
|
32
|
+
changedConnections: number;
|
|
33
|
+
};
|
|
34
|
+
type ProjectComparisonSummary = {
|
|
35
|
+
addedGraphs: number;
|
|
36
|
+
removedGraphs: number;
|
|
37
|
+
changedGraphs: number;
|
|
38
|
+
addedNodePrefabs?: number;
|
|
39
|
+
removedNodePrefabs?: number;
|
|
40
|
+
changedNodePrefabs?: number;
|
|
41
|
+
addedUiGraphs?: number;
|
|
42
|
+
removedUiGraphs?: number;
|
|
43
|
+
changedUiGraphs?: number;
|
|
44
|
+
} & ProjectGraphComparisonSummary;
|
|
45
|
+
export type ProjectNodePrefabComparison = {
|
|
46
|
+
id: NodePrefabId;
|
|
47
|
+
kind: ProjectComparisonChangeKind;
|
|
48
|
+
before?: NodePrefab;
|
|
49
|
+
after?: NodePrefab;
|
|
50
|
+
sourceNode?: ProjectNodeComparison;
|
|
51
|
+
};
|
|
52
|
+
export type ProjectGraphComparison = {
|
|
53
|
+
id: GraphId;
|
|
54
|
+
kind: ProjectComparisonChangeKind;
|
|
55
|
+
before?: NodeGraph;
|
|
56
|
+
after?: NodeGraph;
|
|
57
|
+
metadataChanged: boolean;
|
|
58
|
+
nodes: Record<NodeId, ProjectNodeComparison>;
|
|
59
|
+
connections: Record<string, ProjectConnectionComparison>;
|
|
60
|
+
summary: ProjectGraphComparisonSummary;
|
|
61
|
+
};
|
|
62
|
+
export type ProjectUiGraphComparison = {
|
|
63
|
+
id: UiGraphId;
|
|
64
|
+
kind: ProjectComparisonChangeKind;
|
|
65
|
+
before?: UiGraph;
|
|
66
|
+
after?: UiGraph;
|
|
67
|
+
};
|
|
68
|
+
export type ProjectComparison = {
|
|
69
|
+
beforeProjectId: Project['metadata']['id'];
|
|
70
|
+
afterProjectId: Project['metadata']['id'];
|
|
71
|
+
metadataChanged: boolean;
|
|
72
|
+
graphs: Record<GraphId, ProjectGraphComparison>;
|
|
73
|
+
nodePrefabs?: Record<NodePrefabId, ProjectNodePrefabComparison>;
|
|
74
|
+
uiGraphs?: Record<UiGraphId, ProjectUiGraphComparison>;
|
|
75
|
+
summary: ProjectComparisonSummary;
|
|
76
|
+
};
|
|
77
|
+
export declare function compareProjects(before: Project, after: Project): ProjectComparison;
|