@valerypopoff/rivet2-core 2.0.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/LICENSE +7 -0
- package/README.md +15 -0
- package/dist/cjs/bundle.cjs +28772 -0
- package/dist/cjs/bundle.cjs.map +7 -0
- package/dist/esm/api/createProcessor.js +116 -0
- package/dist/esm/api/looseDataValue.js +16 -0
- package/dist/esm/api/processSettings.js +16 -0
- package/dist/esm/api/streaming.js +116 -0
- package/dist/esm/exports.js +48 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/integrations/AudioProvider.js +1 -0
- package/dist/esm/integrations/CodeRunner.js +44 -0
- package/dist/esm/integrations/DatasetProvider.js +92 -0
- package/dist/esm/integrations/EmbeddingGenerator.js +1 -0
- package/dist/esm/integrations/GptTokenizerTokenizer.js +67 -0
- package/dist/esm/integrations/LLMProvider.js +1 -0
- package/dist/esm/integrations/Tokenizer.js +1 -0
- package/dist/esm/integrations/VectorDatabase.js +1 -0
- package/dist/esm/integrations/enableIntegrations.js +3 -0
- package/dist/esm/integrations/integrations.js +19 -0
- package/dist/esm/integrations/mcp/MCPBase.js +87 -0
- package/dist/esm/integrations/mcp/MCPProvider.js +23 -0
- package/dist/esm/integrations/mcp/MCPUtils.js +33 -0
- package/dist/esm/integrations/openai/OpenAIEmbeddingGenerator.js +23 -0
- package/dist/esm/model/CycleDetector.js +43 -0
- package/dist/esm/model/DataValue.js +188 -0
- package/dist/esm/model/Dataset.js +1 -0
- package/dist/esm/model/EditorDefinition.js +1 -0
- package/dist/esm/model/ExecutorProtocol.js +1 -0
- package/dist/esm/model/GraphPreprocessor.js +97 -0
- package/dist/esm/model/GraphProcessor.js +1136 -0
- package/dist/esm/model/NodeBase.js +11 -0
- package/dist/esm/model/NodeBodySpec.js +1 -0
- package/dist/esm/model/NodeDefinition.js +12 -0
- package/dist/esm/model/NodeExecutionPlanner.js +82 -0
- package/dist/esm/model/NodeGraph.js +14 -0
- package/dist/esm/model/NodeImpl.js +57 -0
- package/dist/esm/model/NodeRegistration.js +146 -0
- package/dist/esm/model/Nodes.js +279 -0
- package/dist/esm/model/PluginLoadSpec.js +1 -0
- package/dist/esm/model/ProcessContext.js +1 -0
- package/dist/esm/model/ProcessContextBuilder.js +33 -0
- package/dist/esm/model/Project.js +2 -0
- package/dist/esm/model/ProjectReferenceLoader.js +1 -0
- package/dist/esm/model/RecordingPlayer.js +262 -0
- package/dist/esm/model/RegistryAssembly.js +53 -0
- package/dist/esm/model/RivetPlugin.js +1 -0
- package/dist/esm/model/RivetUIContext.js +1 -0
- package/dist/esm/model/Settings.js +1 -0
- package/dist/esm/model/SplitRunProcessor.js +98 -0
- package/dist/esm/model/SubprocessorBridge.js +82 -0
- package/dist/esm/model/chat/aiSdkMessages.js +105 -0
- package/dist/esm/model/chat/aiSdkStreaming.js +38 -0
- package/dist/esm/model/chat/aiSdkTools.js +10 -0
- package/dist/esm/model/chat/chatCost.js +33 -0
- package/dist/esm/model/chat/chatMessages.js +47 -0
- package/dist/esm/model/chat/openAIChatRequest.js +110 -0
- package/dist/esm/model/chat/openAIChatRuntime.js +220 -0
- package/dist/esm/model/chat/streamChatResponse.js +97 -0
- package/dist/esm/model/chat/tokenBudget.js +16 -0
- package/dist/esm/model/chat-v2/aiSdkBridge.js +88 -0
- package/dist/esm/model/chat-v2/chatV2EditorCache.js +107 -0
- package/dist/esm/model/chat-v2/chatV2Errors.js +255 -0
- package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +16 -0
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +387 -0
- package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +57 -0
- package/dist/esm/model/chat-v2/chatV2Retry.js +41 -0
- package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +242 -0
- package/dist/esm/model/chat-v2/chatV2Shared.js +285 -0
- package/dist/esm/model/chat-v2/chatV2Types.js +1 -0
- package/dist/esm/model/chat-v2/index.js +10 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +56 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +475 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +90 -0
- package/dist/esm/model/chat-v2/messageConverter.js +173 -0
- package/dist/esm/model/chat-v2/modelRegistry.js +23 -0
- package/dist/esm/model/chat-v2/providerOptions.js +202 -0
- package/dist/esm/model/chat-v2/toolContinuation.js +108 -0
- package/dist/esm/model/chat-v2/toolConverter.js +4 -0
- package/dist/esm/model/interpolationInputDefinition.js +36 -0
- package/dist/esm/model/loopControllerBreak.js +4 -0
- package/dist/esm/model/nodes/AbortGraphNode.js +100 -0
- package/dist/esm/model/nodes/AppendToDatasetNode.js +115 -0
- package/dist/esm/model/nodes/ArrayNode.js +144 -0
- package/dist/esm/model/nodes/AssembleMessageNode.js +209 -0
- package/dist/esm/model/nodes/AssemblePromptNode.js +151 -0
- package/dist/esm/model/nodes/AudioNode.js +101 -0
- package/dist/esm/model/nodes/BooleanNode.js +74 -0
- package/dist/esm/model/nodes/CallGraphNode.js +135 -0
- package/dist/esm/model/nodes/ChatLoopNode.js +150 -0
- package/dist/esm/model/nodes/ChatNode.js +56 -0
- package/dist/esm/model/nodes/ChatNodeBase.js +912 -0
- package/dist/esm/model/nodes/ChunkNode.js +166 -0
- package/dist/esm/model/nodes/CoalesceNode.js +104 -0
- package/dist/esm/model/nodes/CodeNode.js +197 -0
- package/dist/esm/model/nodes/CommentNode.js +71 -0
- package/dist/esm/model/nodes/CompareNode.js +144 -0
- package/dist/esm/model/nodes/ContextNode.js +99 -0
- package/dist/esm/model/nodes/CreateDatasetNode.js +71 -0
- package/dist/esm/model/nodes/CronNode.js +248 -0
- package/dist/esm/model/nodes/DatasetNearestNeigborsNode.js +97 -0
- package/dist/esm/model/nodes/DelayNode.js +105 -0
- package/dist/esm/model/nodes/DelegateFunctionCallNode.js +175 -0
- package/dist/esm/model/nodes/DestructureNode.js +110 -0
- package/dist/esm/model/nodes/DocumentNode.js +183 -0
- package/dist/esm/model/nodes/EvaluateNode.js +141 -0
- package/dist/esm/model/nodes/ExpressionNode.js +143 -0
- package/dist/esm/model/nodes/ExternalCallNode.js +162 -0
- package/dist/esm/model/nodes/ExtractJsonNode.js +122 -0
- package/dist/esm/model/nodes/ExtractMarkdownCodeBlocksNode.js +100 -0
- package/dist/esm/model/nodes/ExtractObjectPathNode.js +159 -0
- package/dist/esm/model/nodes/ExtractRegexNode.js +200 -0
- package/dist/esm/model/nodes/ExtractYamlNode.js +214 -0
- package/dist/esm/model/nodes/FilterNode.js +73 -0
- package/dist/esm/model/nodes/GetAllDatasetsNode.js +53 -0
- package/dist/esm/model/nodes/GetDatasetRowNode.js +99 -0
- package/dist/esm/model/nodes/GetEmbeddingNode.js +130 -0
- package/dist/esm/model/nodes/GetGlobalNode.js +139 -0
- package/dist/esm/model/nodes/GraphInputNode.js +132 -0
- package/dist/esm/model/nodes/GraphOutputNode.js +104 -0
- package/dist/esm/model/nodes/GraphReferenceNode.js +128 -0
- package/dist/esm/model/nodes/HashNode.js +97 -0
- package/dist/esm/model/nodes/HttpCallNode.js +592 -0
- package/dist/esm/model/nodes/IfElseNode.js +138 -0
- package/dist/esm/model/nodes/IfNode.js +129 -0
- package/dist/esm/model/nodes/ImageNode.js +107 -0
- package/dist/esm/model/nodes/JSFilterNode.js +69 -0
- package/dist/esm/model/nodes/JSMapNode.js +69 -0
- package/dist/esm/model/nodes/JoinNode.js +135 -0
- package/dist/esm/model/nodes/LLMChatV2Node.js +234 -0
- package/dist/esm/model/nodes/ListGraphsNode.js +61 -0
- package/dist/esm/model/nodes/LoadDatasetNode.js +83 -0
- package/dist/esm/model/nodes/LoopControllerNode.js +206 -0
- package/dist/esm/model/nodes/LoopUntilNode.js +214 -0
- package/dist/esm/model/nodes/MCPDiscoveryNode.js +214 -0
- package/dist/esm/model/nodes/MCPGetPromptNode.js +234 -0
- package/dist/esm/model/nodes/MCPToolCallNode.js +262 -0
- package/dist/esm/model/nodes/MatchNode.js +160 -0
- package/dist/esm/model/nodes/NumberNode.js +86 -0
- package/dist/esm/model/nodes/ObjectNode.js +152 -0
- package/dist/esm/model/nodes/PassthroughNode.js +78 -0
- package/dist/esm/model/nodes/PlayAudioNode.js +61 -0
- package/dist/esm/model/nodes/PopNode.js +89 -0
- package/dist/esm/model/nodes/PromptNode.js +248 -0
- package/dist/esm/model/nodes/RaceInputsNode.js +85 -0
- package/dist/esm/model/nodes/RaiseEventNode.js +84 -0
- package/dist/esm/model/nodes/RandomNumberNode.js +117 -0
- package/dist/esm/model/nodes/ReadAllFilesNode.js +210 -0
- package/dist/esm/model/nodes/ReadDirectoryNode.js +171 -0
- package/dist/esm/model/nodes/ReadFileNode.js +114 -0
- package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +199 -0
- package/dist/esm/model/nodes/ReplaceDatasetNode.js +118 -0
- package/dist/esm/model/nodes/SetGlobalNode.js +124 -0
- package/dist/esm/model/nodes/ShuffleNode.js +64 -0
- package/dist/esm/model/nodes/SliceNode.js +99 -0
- package/dist/esm/model/nodes/SplitNode.js +101 -0
- package/dist/esm/model/nodes/SubGraphNode.js +180 -0
- package/dist/esm/model/nodes/TextNode.js +125 -0
- package/dist/esm/model/nodes/ToJsonNode.js +78 -0
- package/dist/esm/model/nodes/ToMarkdownTableNode.js +119 -0
- package/dist/esm/model/nodes/ToTreeNode.js +133 -0
- package/dist/esm/model/nodes/ToYamlNode.js +68 -0
- package/dist/esm/model/nodes/ToolNode.js +172 -0
- package/dist/esm/model/nodes/TrimChatMessagesNode.js +120 -0
- package/dist/esm/model/nodes/URLReferenceNode.js +79 -0
- package/dist/esm/model/nodes/UserInputNode.js +109 -0
- package/dist/esm/model/nodes/VectorNearestNeighborsNode.js +127 -0
- package/dist/esm/model/nodes/VectorStoreNode.js +124 -0
- package/dist/esm/model/nodes/WaitForEventNode.js +88 -0
- package/dist/esm/model/nodes/codeNodeErrorDiagnostics.js +104 -0
- package/dist/esm/model/nodes/jsListCallbackHelpers.js +196 -0
- package/dist/esm/model/nodes/jsValueInterpolation.js +163 -0
- package/dist/esm/model/nodes/toolCallDelegation.js +159 -0
- package/dist/esm/native/BaseDir.js +32 -0
- package/dist/esm/native/BrowserNativeApi.js +19 -0
- package/dist/esm/native/NativeApi.js +1 -0
- package/dist/esm/plugins/anthropic/anthropic.js +208 -0
- package/dist/esm/plugins/anthropic/fetchEventSource.js +107 -0
- package/dist/esm/plugins/anthropic/index.js +2 -0
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +767 -0
- package/dist/esm/plugins/anthropic/plugin.js +26 -0
- package/dist/esm/plugins/assemblyAi/LemurActionItemsNode.js +75 -0
- package/dist/esm/plugins/assemblyAi/LemurQaNode.js +155 -0
- package/dist/esm/plugins/assemblyAi/LemurSummaryNode.js +79 -0
- package/dist/esm/plugins/assemblyAi/LemurTaskNode.js +82 -0
- package/dist/esm/plugins/assemblyAi/TranscribeAudioNode.js +126 -0
- package/dist/esm/plugins/assemblyAi/index.js +2 -0
- package/dist/esm/plugins/assemblyAi/lemurHelpers.js +114 -0
- package/dist/esm/plugins/assemblyAi/plugin.js +32 -0
- package/dist/esm/plugins/autoevals/AutoEvalsNode.js +223 -0
- package/dist/esm/plugins/autoevals/index.js +2 -0
- package/dist/esm/plugins/autoevals/plugin.js +8 -0
- package/dist/esm/plugins/gentrace/index.js +3 -0
- package/dist/esm/plugins/gentrace/plugin.js +195 -0
- package/dist/esm/plugins/google/google.js +165 -0
- package/dist/esm/plugins/google/index.js +2 -0
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +584 -0
- package/dist/esm/plugins/google/plugin.js +39 -0
- package/dist/esm/plugins/huggingface/index.js +2 -0
- package/dist/esm/plugins/huggingface/nodes/ChatHuggingFace.js +243 -0
- package/dist/esm/plugins/huggingface/nodes/TextToImageHuggingFace.js +189 -0
- package/dist/esm/plugins/huggingface/plugin.js +26 -0
- package/dist/esm/plugins/openai/handleOpenaiError.js +17 -0
- package/dist/esm/plugins/openai/index.js +2 -0
- package/dist/esm/plugins/openai/nodes/AttachAssistantFileNode.js +123 -0
- package/dist/esm/plugins/openai/nodes/CreateAssistantNode.js +289 -0
- package/dist/esm/plugins/openai/nodes/CreateThreadMessageNode.js +176 -0
- package/dist/esm/plugins/openai/nodes/CreateThreadNode.js +157 -0
- package/dist/esm/plugins/openai/nodes/DeleteAssistantNode.js +104 -0
- package/dist/esm/plugins/openai/nodes/DeleteThreadNode.js +97 -0
- package/dist/esm/plugins/openai/nodes/GetAssistantNode.js +118 -0
- package/dist/esm/plugins/openai/nodes/GetOpenAIFileNode.js +100 -0
- package/dist/esm/plugins/openai/nodes/GetThreadNode.js +108 -0
- package/dist/esm/plugins/openai/nodes/ListAssistantsNode.js +202 -0
- package/dist/esm/plugins/openai/nodes/ListOpenAIFilesNode.js +94 -0
- package/dist/esm/plugins/openai/nodes/ListThreadMessagesNode.js +224 -0
- package/dist/esm/plugins/openai/nodes/RunThreadNode.js +630 -0
- package/dist/esm/plugins/openai/nodes/ThreadMessageNode.js +143 -0
- package/dist/esm/plugins/openai/nodes/UploadFileNode.js +121 -0
- package/dist/esm/plugins/openai/plugin.js +44 -0
- package/dist/esm/plugins/pinecone/PineconeVectorDatabase.js +88 -0
- package/dist/esm/plugins/pinecone/index.js +2 -0
- package/dist/esm/plugins/pinecone/plugin.js +19 -0
- package/dist/esm/plugins.js +29 -0
- package/dist/esm/recording/ExecutionRecorder.js +273 -0
- package/dist/esm/recording/RecordedEvents.js +1 -0
- package/dist/esm/utils/assertNever.js +3 -0
- package/dist/esm/utils/base64.js +38 -0
- package/dist/esm/utils/chatMessageToOpenAIChatCompletionMessage.js +73 -0
- package/dist/esm/utils/coerceType.js +326 -0
- package/dist/esm/utils/compatibility.js +27 -0
- package/dist/esm/utils/copyToClipboard.js +10 -0
- package/dist/esm/utils/defaults.js +2 -0
- package/dist/esm/utils/emitDetached.js +12 -0
- package/dist/esm/utils/errors.js +7 -0
- package/dist/esm/utils/expectType.js +34 -0
- package/dist/esm/utils/fetchEventSource.js +120 -0
- package/dist/esm/utils/genericUtilFunctions.js +25 -0
- package/dist/esm/utils/getPluginConfig.js +23 -0
- package/dist/esm/utils/handleEscapeCharacters.js +11 -0
- package/dist/esm/utils/index.js +17 -0
- package/dist/esm/utils/inputs.js +16 -0
- package/dist/esm/utils/interpolation.js +286 -0
- package/dist/esm/utils/misc.js +1 -0
- package/dist/esm/utils/newId.js +4 -0
- package/dist/esm/utils/openai.js +206 -0
- package/dist/esm/utils/orderedStringPortIds.js +27 -0
- package/dist/esm/utils/outputs.js +14 -0
- package/dist/esm/utils/pQueueCompat.js +12 -0
- package/dist/esm/utils/paths.js +80 -0
- package/dist/esm/utils/providerStreamParsing.js +14 -0
- package/dist/esm/utils/runtimeLogging.js +121 -0
- package/dist/esm/utils/serialization/serialization.js +77 -0
- package/dist/esm/utils/serialization/serializationHelpers.js +63 -0
- package/dist/esm/utils/serialization/serializationUtils.js +112 -0
- package/dist/esm/utils/serialization/serialization_v1.js +19 -0
- package/dist/esm/utils/serialization/serialization_v2.js +24 -0
- package/dist/esm/utils/serialization/serialization_v3.js +100 -0
- package/dist/esm/utils/serialization/serialization_v4.js +156 -0
- package/dist/esm/utils/symbols.js +2 -0
- package/dist/esm/utils/time.js +14 -0
- package/dist/esm/utils/typeSafety.js +42 -0
- package/dist/esm/vendor/fnv1a.js +80 -0
- package/dist/types/api/createProcessor.d.ts +56 -0
- package/dist/types/api/looseDataValue.d.ts +4 -0
- package/dist/types/api/processSettings.d.ts +4 -0
- package/dist/types/api/streaming.d.ts +56 -0
- package/dist/types/exports.d.ts +49 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/integrations/AudioProvider.d.ts +4 -0
- package/dist/types/integrations/CodeRunner.d.ts +19 -0
- package/dist/types/integrations/DatasetProvider.d.ts +33 -0
- package/dist/types/integrations/EmbeddingGenerator.d.ts +3 -0
- package/dist/types/integrations/GptTokenizerTokenizer.d.ts +20 -0
- package/dist/types/integrations/LLMProvider.d.ts +7 -0
- package/dist/types/integrations/Tokenizer.d.ts +11 -0
- package/dist/types/integrations/VectorDatabase.d.ts +7 -0
- package/dist/types/integrations/enableIntegrations.d.ts +1 -0
- package/dist/types/integrations/integrations.d.ts +12 -0
- package/dist/types/integrations/mcp/MCPBase.d.ts +18 -0
- package/dist/types/integrations/mcp/MCPProvider.d.ts +153 -0
- package/dist/types/integrations/mcp/MCPUtils.d.ts +9 -0
- package/dist/types/integrations/openai/OpenAIEmbeddingGenerator.d.ts +10 -0
- package/dist/types/model/CycleDetector.d.ts +2 -0
- package/dist/types/model/DataValue.d.ts +160 -0
- package/dist/types/model/Dataset.d.ts +19 -0
- package/dist/types/model/EditorDefinition.d.ts +176 -0
- package/dist/types/model/ExecutorProtocol.d.ts +216 -0
- package/dist/types/model/GraphPreprocessor.d.ts +24 -0
- package/dist/types/model/GraphProcessor.d.ts +210 -0
- package/dist/types/model/NodeBase.d.ts +116 -0
- package/dist/types/model/NodeBodySpec.d.ts +19 -0
- package/dist/types/model/NodeDefinition.d.ts +13 -0
- package/dist/types/model/NodeExecutionPlanner.d.ts +28 -0
- package/dist/types/model/NodeGraph.d.ts +15 -0
- package/dist/types/model/NodeImpl.d.ts +56 -0
- package/dist/types/model/NodeRegistration.d.ts +29 -0
- package/dist/types/model/Nodes.d.ts +112 -0
- package/dist/types/model/PluginLoadSpec.d.ts +17 -0
- package/dist/types/model/ProcessContext.d.ts +110 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +41 -0
- package/dist/types/model/Project.d.ts +31 -0
- package/dist/types/model/ProjectReferenceLoader.d.ts +5 -0
- package/dist/types/model/RecordingPlayer.d.ts +27 -0
- package/dist/types/model/RegistryAssembly.d.ts +42 -0
- package/dist/types/model/RivetPlugin.d.ts +51 -0
- package/dist/types/model/RivetUIContext.d.ts +27 -0
- package/dist/types/model/Settings.d.ts +20 -0
- package/dist/types/model/SplitRunProcessor.d.ts +31 -0
- package/dist/types/model/SubprocessorBridge.d.ts +13 -0
- package/dist/types/model/chat/aiSdkMessages.d.ts +3 -0
- package/dist/types/model/chat/aiSdkStreaming.d.ts +9 -0
- package/dist/types/model/chat/aiSdkTools.d.ts +3 -0
- package/dist/types/model/chat/chatCost.d.ts +30 -0
- package/dist/types/model/chat/chatMessages.d.ts +5 -0
- package/dist/types/model/chat/openAIChatRequest.d.ts +39 -0
- package/dist/types/model/chat/openAIChatRuntime.d.ts +61 -0
- package/dist/types/model/chat/streamChatResponse.d.ts +27 -0
- package/dist/types/model/chat/tokenBudget.d.ts +3 -0
- package/dist/types/model/chat-v2/aiSdkBridge.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +25 -0
- package/dist/types/model/chat-v2/chatV2Errors.d.ts +23 -0
- package/dist/types/model/chat-v2/chatV2FeatureCompatibility.d.ts +12 -0
- package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +24 -0
- package/dist/types/model/chat-v2/chatV2Retry.d.ts +5 -0
- package/dist/types/model/chat-v2/chatV2RuntimeOptions.d.ts +12 -0
- package/dist/types/model/chat-v2/chatV2Shared.d.ts +56 -0
- package/dist/types/model/chat-v2/chatV2Types.d.ts +110 -0
- package/dist/types/model/chat-v2/index.d.ts +10 -0
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +73 -0
- package/dist/types/model/chat-v2/llmChatV2NodeEditors.d.ts +4 -0
- package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +23 -0
- package/dist/types/model/chat-v2/messageConverter.d.ts +8 -0
- package/dist/types/model/chat-v2/modelRegistry.d.ts +296 -0
- package/dist/types/model/chat-v2/providerOptions.d.ts +59 -0
- package/dist/types/model/chat-v2/toolContinuation.d.ts +15 -0
- package/dist/types/model/chat-v2/toolConverter.d.ts +3 -0
- package/dist/types/model/interpolationInputDefinition.d.ts +16 -0
- package/dist/types/model/loopControllerBreak.d.ts +3 -0
- package/dist/types/model/nodes/AbortGraphNode.d.ts +22 -0
- package/dist/types/model/nodes/AppendToDatasetNode.d.ts +21 -0
- package/dist/types/model/nodes/ArrayNode.d.ts +20 -0
- package/dist/types/model/nodes/AssembleMessageNode.d.ts +23 -0
- package/dist/types/model/nodes/AssemblePromptNode.d.ts +23 -0
- package/dist/types/model/nodes/AudioNode.d.ts +20 -0
- package/dist/types/model/nodes/BooleanNode.d.ts +19 -0
- package/dist/types/model/nodes/CallGraphNode.d.ts +16 -0
- package/dist/types/model/nodes/ChatLoopNode.d.ts +21 -0
- package/dist/types/model/nodes/ChatNode.d.ts +17 -0
- package/dist/types/model/nodes/ChatNodeBase.d.ts +85 -0
- package/dist/types/model/nodes/ChunkNode.d.ts +22 -0
- package/dist/types/model/nodes/CoalesceNode.d.ts +14 -0
- package/dist/types/model/nodes/CodeNode.d.ts +27 -0
- package/dist/types/model/nodes/CommentNode.d.ts +20 -0
- package/dist/types/model/nodes/CompareNode.d.ts +19 -0
- package/dist/types/model/nodes/ContextNode.d.ts +24 -0
- package/dist/types/model/nodes/CreateDatasetNode.d.ts +13 -0
- package/dist/types/model/nodes/CronNode.d.ts +34 -0
- package/dist/types/model/nodes/DatasetNearestNeigborsNode.d.ts +19 -0
- package/dist/types/model/nodes/DelayNode.d.ts +20 -0
- package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +28 -0
- package/dist/types/model/nodes/DestructureNode.d.ts +19 -0
- package/dist/types/model/nodes/DocumentNode.d.ts +28 -0
- package/dist/types/model/nodes/EvaluateNode.d.ts +19 -0
- package/dist/types/model/nodes/ExpressionNode.d.ts +21 -0
- package/dist/types/model/nodes/ExternalCallNode.d.ts +22 -0
- package/dist/types/model/nodes/ExtractJsonNode.d.ts +13 -0
- package/dist/types/model/nodes/ExtractMarkdownCodeBlocksNode.d.ts +12 -0
- package/dist/types/model/nodes/ExtractObjectPathNode.d.ts +22 -0
- package/dist/types/model/nodes/ExtractRegexNode.d.ts +22 -0
- package/dist/types/model/nodes/ExtractYamlNode.d.ts +21 -0
- package/dist/types/model/nodes/FilterNode.d.ts +13 -0
- package/dist/types/model/nodes/GetAllDatasetsNode.d.ts +14 -0
- package/dist/types/model/nodes/GetDatasetRowNode.d.ts +19 -0
- package/dist/types/model/nodes/GetEmbeddingNode.d.ts +24 -0
- package/dist/types/model/nodes/GetGlobalNode.d.ts +29 -0
- package/dist/types/model/nodes/GraphInputNode.d.ts +24 -0
- package/dist/types/model/nodes/GraphOutputNode.d.ts +22 -0
- package/dist/types/model/nodes/GraphReferenceNode.d.ts +22 -0
- package/dist/types/model/nodes/HashNode.d.ts +17 -0
- package/dist/types/model/nodes/HttpCallNode.d.ts +32 -0
- package/dist/types/model/nodes/IfElseNode.d.ts +18 -0
- package/dist/types/model/nodes/IfNode.d.ts +17 -0
- package/dist/types/model/nodes/ImageNode.d.ts +20 -0
- package/dist/types/model/nodes/JSFilterNode.d.ts +19 -0
- package/dist/types/model/nodes/JSMapNode.d.ts +19 -0
- package/dist/types/model/nodes/JoinNode.d.ts +21 -0
- package/dist/types/model/nodes/LLMChatV2Node.d.ts +20 -0
- package/dist/types/model/nodes/ListGraphsNode.d.ts +14 -0
- package/dist/types/model/nodes/LoadDatasetNode.d.ts +17 -0
- package/dist/types/model/nodes/LoopControllerNode.d.ts +20 -0
- package/dist/types/model/nodes/LoopUntilNode.d.ts +32 -0
- package/dist/types/model/nodes/MCPDiscoveryNode.d.ts +9 -0
- package/dist/types/model/nodes/MCPGetPromptNode.d.ts +23 -0
- package/dist/types/model/nodes/MCPToolCallNode.d.ts +26 -0
- package/dist/types/model/nodes/MatchNode.d.ts +20 -0
- package/dist/types/model/nodes/NumberNode.d.ts +21 -0
- package/dist/types/model/nodes/ObjectNode.d.ts +19 -0
- package/dist/types/model/nodes/PassthroughNode.d.ts +14 -0
- package/dist/types/model/nodes/PlayAudioNode.d.ts +15 -0
- package/dist/types/model/nodes/PopNode.d.ts +19 -0
- package/dist/types/model/nodes/PromptNode.d.ts +25 -0
- package/dist/types/model/nodes/RaceInputsNode.d.ts +16 -0
- package/dist/types/model/nodes/RaiseEventNode.d.ts +22 -0
- package/dist/types/model/nodes/RandomNumberNode.d.ts +23 -0
- package/dist/types/model/nodes/ReadAllFilesNode.d.ts +30 -0
- package/dist/types/model/nodes/ReadDirectoryNode.d.ts +30 -0
- package/dist/types/model/nodes/ReadFileNode.d.ts +23 -0
- package/dist/types/model/nodes/ReferencedGraphAliasNode.d.ts +31 -0
- package/dist/types/model/nodes/ReplaceDatasetNode.d.ts +21 -0
- package/dist/types/model/nodes/SetGlobalNode.d.ts +23 -0
- package/dist/types/model/nodes/ShuffleNode.d.ts +12 -0
- package/dist/types/model/nodes/SliceNode.d.ts +22 -0
- package/dist/types/model/nodes/SplitNode.d.ts +19 -0
- package/dist/types/model/nodes/SubGraphNode.d.ts +29 -0
- package/dist/types/model/nodes/TextNode.d.ts +19 -0
- package/dist/types/model/nodes/ToJsonNode.d.ts +18 -0
- package/dist/types/model/nodes/ToMarkdownTableNode.d.ts +19 -0
- package/dist/types/model/nodes/ToTreeNode.d.ts +21 -0
- package/dist/types/model/nodes/ToYamlNode.d.ts +13 -0
- package/dist/types/model/nodes/ToolNode.d.ts +25 -0
- package/dist/types/model/nodes/TrimChatMessagesNode.d.ts +20 -0
- package/dist/types/model/nodes/URLReferenceNode.d.ts +19 -0
- package/dist/types/model/nodes/UserInputNode.d.ts +20 -0
- package/dist/types/model/nodes/VectorNearestNeighborsNode.d.ts +24 -0
- package/dist/types/model/nodes/VectorStoreNode.d.ts +22 -0
- package/dist/types/model/nodes/WaitForEventNode.d.ts +21 -0
- package/dist/types/model/nodes/codeNodeErrorDiagnostics.d.ts +9 -0
- package/dist/types/model/nodes/jsListCallbackHelpers.d.ts +23 -0
- package/dist/types/model/nodes/jsValueInterpolation.d.ts +11 -0
- package/dist/types/model/nodes/toolCallDelegation.d.ts +29 -0
- package/dist/types/native/BaseDir.d.ts +29 -0
- package/dist/types/native/BrowserNativeApi.d.ts +9 -0
- package/dist/types/native/NativeApi.d.ts +17 -0
- package/dist/types/plugins/anthropic/anthropic.d.ts +315 -0
- package/dist/types/plugins/anthropic/fetchEventSource.d.ts +11 -0
- package/dist/types/plugins/anthropic/index.d.ts +2 -0
- package/dist/types/plugins/anthropic/nodes/ChatAnthropicNode.d.ts +40 -0
- package/dist/types/plugins/anthropic/plugin.d.ts +2 -0
- package/dist/types/plugins/assemblyAi/LemurActionItemsNode.d.ts +6 -0
- package/dist/types/plugins/assemblyAi/LemurQaNode.d.ts +22 -0
- package/dist/types/plugins/assemblyAi/LemurSummaryNode.d.ts +8 -0
- package/dist/types/plugins/assemblyAi/LemurTaskNode.d.ts +8 -0
- package/dist/types/plugins/assemblyAi/TranscribeAudioNode.d.ts +7 -0
- package/dist/types/plugins/assemblyAi/index.d.ts +2 -0
- package/dist/types/plugins/assemblyAi/lemurHelpers.d.ts +67 -0
- package/dist/types/plugins/assemblyAi/plugin.d.ts +2 -0
- package/dist/types/plugins/autoevals/AutoEvalsNode.d.ts +8 -0
- package/dist/types/plugins/autoevals/index.d.ts +2 -0
- package/dist/types/plugins/autoevals/plugin.d.ts +2 -0
- package/dist/types/plugins/gentrace/index.d.ts +2 -0
- package/dist/types/plugins/gentrace/plugin.d.ts +10 -0
- package/dist/types/plugins/google/google.d.ts +129 -0
- package/dist/types/plugins/google/index.d.ts +2 -0
- package/dist/types/plugins/google/nodes/ChatGoogleNode.d.ts +35 -0
- package/dist/types/plugins/google/plugin.d.ts +2 -0
- package/dist/types/plugins/huggingface/index.d.ts +2 -0
- package/dist/types/plugins/huggingface/nodes/ChatHuggingFace.d.ts +24 -0
- package/dist/types/plugins/huggingface/nodes/TextToImageHuggingFace.d.ts +20 -0
- package/dist/types/plugins/huggingface/plugin.d.ts +2 -0
- package/dist/types/plugins/openai/handleOpenaiError.d.ts +1 -0
- package/dist/types/plugins/openai/index.d.ts +2 -0
- package/dist/types/plugins/openai/nodes/AttachAssistantFileNode.d.ts +10 -0
- package/dist/types/plugins/openai/nodes/CreateAssistantNode.d.ts +26 -0
- package/dist/types/plugins/openai/nodes/CreateThreadMessageNode.d.ts +15 -0
- package/dist/types/plugins/openai/nodes/CreateThreadNode.d.ts +13 -0
- package/dist/types/plugins/openai/nodes/DeleteAssistantNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/DeleteThreadNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/GetAssistantNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/GetOpenAIFileNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/GetThreadNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/ListAssistantsNode.d.ts +14 -0
- package/dist/types/plugins/openai/nodes/ListOpenAIFilesNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/ListThreadMessagesNode.d.ts +16 -0
- package/dist/types/plugins/openai/nodes/RunThreadNode.d.ts +28 -0
- package/dist/types/plugins/openai/nodes/ThreadMessageNode.d.ts +14 -0
- package/dist/types/plugins/openai/nodes/UploadFileNode.d.ts +7 -0
- package/dist/types/plugins/openai/plugin.d.ts +2 -0
- package/dist/types/plugins/pinecone/PineconeVectorDatabase.d.ts +9 -0
- package/dist/types/plugins/pinecone/index.d.ts +2 -0
- package/dist/types/plugins/pinecone/plugin.d.ts +2 -0
- package/dist/types/plugins.d.ts +22 -0
- package/dist/types/recording/ExecutionRecorder.d.ts +27 -0
- package/dist/types/recording/RecordedEvents.d.ts +114 -0
- package/dist/types/utils/assertNever.d.ts +1 -0
- package/dist/types/utils/base64.d.ts +3 -0
- package/dist/types/utils/chatMessageToOpenAIChatCompletionMessage.d.ts +5 -0
- package/dist/types/utils/coerceType.d.ts +6 -0
- package/dist/types/utils/compatibility.d.ts +3 -0
- package/dist/types/utils/copyToClipboard.d.ts +1 -0
- package/dist/types/utils/defaults.d.ts +2 -0
- package/dist/types/utils/emitDetached.d.ts +11 -0
- package/dist/types/utils/errors.d.ts +2 -0
- package/dist/types/utils/expectType.d.ts +3 -0
- package/dist/types/utils/fetchEventSource.d.ts +12 -0
- package/dist/types/utils/genericUtilFunctions.d.ts +21 -0
- package/dist/types/utils/getPluginConfig.d.ts +2 -0
- package/dist/types/utils/handleEscapeCharacters.d.ts +2 -0
- package/dist/types/utils/index.d.ts +17 -0
- package/dist/types/utils/inputs.d.ts +3 -0
- package/dist/types/utils/interpolation.d.ts +26 -0
- package/dist/types/utils/misc.d.ts +1 -0
- package/dist/types/utils/newId.d.ts +1 -0
- package/dist/types/utils/openai.d.ts +784 -0
- package/dist/types/utils/orderedStringPortIds.d.ts +10 -0
- package/dist/types/utils/outputs.d.ts +3 -0
- package/dist/types/utils/pQueueCompat.d.ts +10 -0
- package/dist/types/utils/paths.d.ts +8 -0
- package/dist/types/utils/providerStreamParsing.d.ts +1 -0
- package/dist/types/utils/runtimeLogging.d.ts +10 -0
- package/dist/types/utils/serialization/serialization.d.ts +12 -0
- package/dist/types/utils/serialization/serializationHelpers.d.ts +27 -0
- package/dist/types/utils/serialization/serializationUtils.d.ts +16 -0
- package/dist/types/utils/serialization/serialization_v1.d.ts +3 -0
- package/dist/types/utils/serialization/serialization_v2.d.ts +3 -0
- package/dist/types/utils/serialization/serialization_v3.d.ts +19 -0
- package/dist/types/utils/serialization/serialization_v4.d.ts +9 -0
- package/dist/types/utils/symbols.d.ts +3 -0
- package/dist/types/utils/time.d.ts +22 -0
- package/dist/types/utils/typeSafety.d.ts +37 -0
- package/dist/types/vendor/fnv1a.d.ts +9 -0
- package/package.json +77 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { type DataValue, type StringArrayDataValue, type ScalarOrArrayDataValue } from './DataValue.js';
|
|
2
|
+
import { type ChartNode, type NodeConnection, type NodeId, type PortId } from './NodeBase.js';
|
|
3
|
+
import type { GraphId, NodeGraph } from './NodeGraph.js';
|
|
4
|
+
import Emittery from 'emittery';
|
|
5
|
+
import { type Project } from './Project.js';
|
|
6
|
+
import type { GraphExecutionMetadata, InternalProcessContext, ProcessContext, ProcessId } from './ProcessContext.js';
|
|
7
|
+
import type { ExecutionRecorder } from '../recording/ExecutionRecorder.js';
|
|
8
|
+
import type { Tagged } from 'type-fest';
|
|
9
|
+
import type { NodeRegistration } from './NodeRegistration.js';
|
|
10
|
+
type WithExecution<T extends object> = T & {
|
|
11
|
+
execution: GraphExecutionMetadata;
|
|
12
|
+
};
|
|
13
|
+
export type ProcessEvents = {
|
|
14
|
+
/** Called when processing has started. */
|
|
15
|
+
start: WithExecution<{
|
|
16
|
+
project: Project;
|
|
17
|
+
startGraph: NodeGraph;
|
|
18
|
+
inputs: GraphInputs;
|
|
19
|
+
contextValues: Record<string, DataValue>;
|
|
20
|
+
}>;
|
|
21
|
+
/** Called when a graph or subgraph has started. */
|
|
22
|
+
graphStart: WithExecution<{
|
|
23
|
+
graph: NodeGraph;
|
|
24
|
+
inputs: GraphInputs;
|
|
25
|
+
}>;
|
|
26
|
+
/** Called when a graph or subgraph has errored. */
|
|
27
|
+
graphError: WithExecution<{
|
|
28
|
+
graph: NodeGraph;
|
|
29
|
+
error: Error | string;
|
|
30
|
+
}>;
|
|
31
|
+
/** Called when a graph or a subgraph has finished. */
|
|
32
|
+
graphFinish: WithExecution<{
|
|
33
|
+
graph: NodeGraph;
|
|
34
|
+
outputs: GraphOutputs;
|
|
35
|
+
}>;
|
|
36
|
+
/** Called when a graph has been aborted. */
|
|
37
|
+
graphAbort: WithExecution<{
|
|
38
|
+
successful: boolean;
|
|
39
|
+
graph: NodeGraph;
|
|
40
|
+
error?: Error | string;
|
|
41
|
+
}>;
|
|
42
|
+
/** Called when a node has started processing, with the input values for the node. */
|
|
43
|
+
nodeStart: WithExecution<{
|
|
44
|
+
node: ChartNode;
|
|
45
|
+
inputs: Inputs;
|
|
46
|
+
processId: ProcessId;
|
|
47
|
+
}>;
|
|
48
|
+
/** Called when a node has finished processing, with the output values for the node. */
|
|
49
|
+
nodeFinish: WithExecution<{
|
|
50
|
+
node: ChartNode;
|
|
51
|
+
outputs: Outputs;
|
|
52
|
+
processId: ProcessId;
|
|
53
|
+
}>;
|
|
54
|
+
/** Called when a node has errored during processing. */
|
|
55
|
+
nodeError: WithExecution<{
|
|
56
|
+
node: ChartNode;
|
|
57
|
+
error: Error | string;
|
|
58
|
+
processId: ProcessId;
|
|
59
|
+
}>;
|
|
60
|
+
/** Called when a node has been excluded from processing. */
|
|
61
|
+
nodeExcluded: WithExecution<{
|
|
62
|
+
node: ChartNode;
|
|
63
|
+
processId: ProcessId;
|
|
64
|
+
inputs: Inputs;
|
|
65
|
+
outputs: Outputs;
|
|
66
|
+
reason: string;
|
|
67
|
+
}>;
|
|
68
|
+
/** Called when a user input node requires user input. Call the callback when finished, or call userInput() on the GraphProcessor with the results. */
|
|
69
|
+
userInput: WithExecution<{
|
|
70
|
+
node: ChartNode;
|
|
71
|
+
inputStrings: string[];
|
|
72
|
+
/** @deprecated use inputStrings instead */
|
|
73
|
+
inputs: Inputs;
|
|
74
|
+
callback: (values: StringArrayDataValue) => void;
|
|
75
|
+
processId: ProcessId;
|
|
76
|
+
renderingType: 'text' | 'markdown';
|
|
77
|
+
}>;
|
|
78
|
+
/** Called when a node has partially processed, with the current partial output values for the node. */
|
|
79
|
+
partialOutput: WithExecution<{
|
|
80
|
+
node: ChartNode;
|
|
81
|
+
outputs: Outputs;
|
|
82
|
+
index: number;
|
|
83
|
+
processId: ProcessId;
|
|
84
|
+
}>;
|
|
85
|
+
/** Called when the outputs of a node have been cleared entirely. If processId is present, only the one process() should be cleared. */
|
|
86
|
+
nodeOutputsCleared: WithExecution<{
|
|
87
|
+
node: ChartNode;
|
|
88
|
+
processId?: ProcessId;
|
|
89
|
+
}>;
|
|
90
|
+
/** Called when the root graph has errored. The root graph will also throw. */
|
|
91
|
+
error: {
|
|
92
|
+
error: Error | string;
|
|
93
|
+
};
|
|
94
|
+
/** Called when processing has completed. */
|
|
95
|
+
done: {
|
|
96
|
+
results: GraphOutputs;
|
|
97
|
+
};
|
|
98
|
+
/** Called when processing has been aborted. */
|
|
99
|
+
abort: {
|
|
100
|
+
successful: boolean;
|
|
101
|
+
error?: string | Error;
|
|
102
|
+
};
|
|
103
|
+
/** Called when processing has finished either successfully or unsuccessfully. */
|
|
104
|
+
finish: void;
|
|
105
|
+
/** Called for trace level logs. */
|
|
106
|
+
trace: string;
|
|
107
|
+
/** Called when the graph has been paused. */
|
|
108
|
+
pause: void;
|
|
109
|
+
/** Called when the graph has been resumed. */
|
|
110
|
+
resume: void;
|
|
111
|
+
/** Called when a global variable has been set in a graph. */
|
|
112
|
+
globalSet: WithExecution<{
|
|
113
|
+
id: string;
|
|
114
|
+
value: ScalarOrArrayDataValue;
|
|
115
|
+
processId: ProcessId;
|
|
116
|
+
}>;
|
|
117
|
+
/** Called when an AbortController has been created. Used by node to increase the max event listeners. */
|
|
118
|
+
newAbortController: AbortController;
|
|
119
|
+
} & {
|
|
120
|
+
/** Listen for any user event. */
|
|
121
|
+
[key: `userEvent:${string}`]: DataValue | undefined;
|
|
122
|
+
} & {
|
|
123
|
+
[key: `globalSet:${string}`]: ScalarOrArrayDataValue | undefined;
|
|
124
|
+
};
|
|
125
|
+
export type ProcessEvent = {
|
|
126
|
+
[P in keyof ProcessEvents]: {
|
|
127
|
+
type: P;
|
|
128
|
+
} & ProcessEvents[P];
|
|
129
|
+
}[keyof ProcessEvents];
|
|
130
|
+
export type GraphOutputs = Record<string, DataValue>;
|
|
131
|
+
export type GraphInputs = Record<string, DataValue>;
|
|
132
|
+
export type NodeResults = Map<NodeId, Outputs>;
|
|
133
|
+
export type Inputs = Record<PortId, DataValue | undefined>;
|
|
134
|
+
export type Outputs = Record<PortId, DataValue | undefined>;
|
|
135
|
+
export type ExternalFunctionProcessContext = Omit<InternalProcessContext, 'setGlobal'>;
|
|
136
|
+
export type ExternalFunction = (context: ExternalFunctionProcessContext, ...args: unknown[]) => Promise<DataValue & {
|
|
137
|
+
cost?: number;
|
|
138
|
+
}>;
|
|
139
|
+
export type GraphProcessorConcurrency = {
|
|
140
|
+
nodeConcurrency?: number;
|
|
141
|
+
splitRunConcurrency?: number;
|
|
142
|
+
};
|
|
143
|
+
export declare const DEFAULT_SPLIT_RUN_CONCURRENCY = 4;
|
|
144
|
+
export type RaceId = Tagged<string, 'RaceId'>;
|
|
145
|
+
export type LoopInfo = AttachedNodeDataItem & {
|
|
146
|
+
/** ID of the controller of the loop */
|
|
147
|
+
loopControllerId: NodeId;
|
|
148
|
+
/** Nodes add themselves to this as the loop processes */
|
|
149
|
+
nodes: Set<NodeId>;
|
|
150
|
+
iterationCount: number;
|
|
151
|
+
};
|
|
152
|
+
export type AttachedNodeDataItem = {
|
|
153
|
+
propagate: boolean | ((parent: ChartNode, connections: NodeConnection[]) => boolean);
|
|
154
|
+
};
|
|
155
|
+
export type AttachedNodeData = {
|
|
156
|
+
loopInfo?: LoopInfo;
|
|
157
|
+
races?: {
|
|
158
|
+
propagate: boolean;
|
|
159
|
+
raceIds: RaceId[];
|
|
160
|
+
completed: boolean;
|
|
161
|
+
};
|
|
162
|
+
[key: string]: AttachedNodeDataItem | undefined;
|
|
163
|
+
};
|
|
164
|
+
export declare class GraphProcessor {
|
|
165
|
+
#private;
|
|
166
|
+
slowMode: boolean;
|
|
167
|
+
id: string;
|
|
168
|
+
executor?: 'nodejs' | 'browser';
|
|
169
|
+
/** If set, specifies the node(s) that the graph will run TO, instead of the nodes without any dependents. */
|
|
170
|
+
runToNodeIds?: NodeId[];
|
|
171
|
+
/** If set, specifies the node that the graph will run FROM, instead of the start nodes. Requires preloading data. */
|
|
172
|
+
runFromNodeId?: NodeId;
|
|
173
|
+
/** The interval between nodeFinish events when playing back a recording. I.e. how fast the playback is. */
|
|
174
|
+
recordingPlaybackChatLatency: number;
|
|
175
|
+
warnOnInvalidGraph: boolean;
|
|
176
|
+
get isRunning(): boolean;
|
|
177
|
+
constructor(project: Project, graphId: GraphId | undefined, registry: NodeRegistration<any, any>, includeTrace?: boolean, options?: {
|
|
178
|
+
concurrency?: GraphProcessorConcurrency;
|
|
179
|
+
});
|
|
180
|
+
on: Emittery<ProcessEvents>["on"];
|
|
181
|
+
off: Emittery<ProcessEvents>["off"];
|
|
182
|
+
once: Emittery<ProcessEvents>["once"];
|
|
183
|
+
onAny: Emittery<ProcessEvents>["onAny"];
|
|
184
|
+
offAny: Emittery<ProcessEvents>["offAny"];
|
|
185
|
+
onUserEvent(onEvent: string, listener: (event: DataValue | undefined) => void): void;
|
|
186
|
+
offUserEvent(listener: (data: DataValue | undefined) => void): void;
|
|
187
|
+
userInput(nodeId: NodeId, values: StringArrayDataValue): void;
|
|
188
|
+
setExternalFunction(name: string, fn: ExternalFunction): void;
|
|
189
|
+
abort(successful?: boolean, error?: Error | string): Promise<void>;
|
|
190
|
+
pause(): void;
|
|
191
|
+
resume(): void;
|
|
192
|
+
setSlowMode(slowMode: boolean): void;
|
|
193
|
+
events(): AsyncGenerator<ProcessEvent>;
|
|
194
|
+
preloadNodeData(nodeId: NodeId, data: Outputs): void;
|
|
195
|
+
/** Gets all node IDs that a given node ID depends on being complete before the given node ID can start. */
|
|
196
|
+
getDependencyNodesDeep(nodeId: NodeId): NodeId[];
|
|
197
|
+
replayRecording(recorder: ExecutionRecorder): Promise<GraphOutputs>;
|
|
198
|
+
/** Main function for running a graph. Runs a graph and returns the outputs from the output nodes of the graph. */
|
|
199
|
+
processGraph(
|
|
200
|
+
/** Required and optional context available to the nodes and all subgraphs. */
|
|
201
|
+
context: ProcessContext,
|
|
202
|
+
/** Inputs to the main graph. You should pass all inputs required by the GraphInputNodes of the graph. */
|
|
203
|
+
inputs?: Record<string, DataValue>,
|
|
204
|
+
/** Contextual data available to all graphs and subgraphs. Kind of like react context, avoids drilling down data into subgraphs. Be careful when using it. */
|
|
205
|
+
contextValues?: Record<string, DataValue>): Promise<GraphOutputs>;
|
|
206
|
+
getRootProcessor(): GraphProcessor;
|
|
207
|
+
/** Raise a user event on the processor, all subprocessors, and their children. */
|
|
208
|
+
raiseEvent(event: string, data: DataValue): void;
|
|
209
|
+
}
|
|
210
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Opaque } from 'type-fest';
|
|
2
|
+
import type { DataType } from './DataValue.js';
|
|
3
|
+
import type { GraphId } from '../index.js';
|
|
4
|
+
/** Unique in a NodeGraph. */
|
|
5
|
+
export type NodeId = Opaque<string, 'NodeId'>;
|
|
6
|
+
/** Unique within the inputs of a single node */
|
|
7
|
+
export type PortId = Opaque<string, 'PortId'>;
|
|
8
|
+
/** Base interface for a node in a NodeGraph. All nodes will have this data.*/
|
|
9
|
+
export interface NodeBase {
|
|
10
|
+
/** The type of the node. See Nodes['type']. */
|
|
11
|
+
type: string;
|
|
12
|
+
/** The unique identifier of the node. Unique within a NodeGraph. */
|
|
13
|
+
id: NodeId;
|
|
14
|
+
/** The title of the node. Displayed in the graph. */
|
|
15
|
+
title: string;
|
|
16
|
+
/** A user description/notes for the node */
|
|
17
|
+
description?: string;
|
|
18
|
+
isSplitRun?: boolean;
|
|
19
|
+
/** When splitting, should the executions be ran sequentially instead of in parallel? */
|
|
20
|
+
isSplitSequential?: boolean;
|
|
21
|
+
splitRunMax?: number;
|
|
22
|
+
/** Maximum concurrent item executions for parallel split runs. */
|
|
23
|
+
splitRunConcurrency?: number;
|
|
24
|
+
/** The visual data of the node, including its position. Visual data does not affect its processing. */
|
|
25
|
+
visualData: {
|
|
26
|
+
/** The x-coordinate of the node's position. */
|
|
27
|
+
x: number;
|
|
28
|
+
/** The y-coordinate of the node's position. */
|
|
29
|
+
y: number;
|
|
30
|
+
width?: number;
|
|
31
|
+
/** The accent color of the node in the UI. */
|
|
32
|
+
color?: {
|
|
33
|
+
border: string;
|
|
34
|
+
bg: string;
|
|
35
|
+
};
|
|
36
|
+
/** The z-index, the last grabbed node is on top of all others. */
|
|
37
|
+
zIndex?: number;
|
|
38
|
+
};
|
|
39
|
+
/** The data associated with the node. Typed when using `Nodes` or a subtype. */
|
|
40
|
+
data: unknown;
|
|
41
|
+
/** Alternative sets of data for the node. */
|
|
42
|
+
variants?: ChartNodeVariant<unknown>[];
|
|
43
|
+
tests?: NodeTestGroup[];
|
|
44
|
+
/** If true, the node is disabled and effectively "not ran" */
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** If true, the node exposes an `if` port that lets it run conditionally. */
|
|
47
|
+
isConditional?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Base type for a typed node. */
|
|
50
|
+
export type ChartNode<Type extends string = string, Data = unknown> = NodeBase & {
|
|
51
|
+
/** The type of the node. */
|
|
52
|
+
type: Type;
|
|
53
|
+
/** The data associated with the node. */
|
|
54
|
+
data: Data;
|
|
55
|
+
/** Alternative sets of data for the node. */
|
|
56
|
+
variants?: ChartNodeVariant<Data>[];
|
|
57
|
+
};
|
|
58
|
+
export type ChartNodeVariant<Data = unknown> = {
|
|
59
|
+
id: string;
|
|
60
|
+
data: Data;
|
|
61
|
+
};
|
|
62
|
+
export type NodeTestGroup = {
|
|
63
|
+
id: string;
|
|
64
|
+
evaluatorGraphId: GraphId;
|
|
65
|
+
tests: NodeTest[];
|
|
66
|
+
};
|
|
67
|
+
export type NodeTest = {
|
|
68
|
+
conditionText: string;
|
|
69
|
+
};
|
|
70
|
+
/** Represents an input definition of a node. */
|
|
71
|
+
export type NodeInputDefinition = {
|
|
72
|
+
/** The unique identifier of the input. Unique within a single node only. */
|
|
73
|
+
id: PortId;
|
|
74
|
+
/** The title of the input. Shows in the UI. */
|
|
75
|
+
title: string;
|
|
76
|
+
/** Whether the input is required. If it is required, there is no default value, and the node cannot process if this input is not connected. */
|
|
77
|
+
required?: boolean;
|
|
78
|
+
/** The data type of the input. */
|
|
79
|
+
dataType: DataType | Readonly<DataType[]>;
|
|
80
|
+
/** Other data associated with the input. Typed in subtypes. */
|
|
81
|
+
data?: unknown;
|
|
82
|
+
/** The default value of the input, if it is not connected to an output. */
|
|
83
|
+
defaultValue?: unknown;
|
|
84
|
+
/** User-facing description of the port. */
|
|
85
|
+
description?: string;
|
|
86
|
+
/** Will the input value attempt to be coerced into the desired type? */
|
|
87
|
+
coerced?: boolean;
|
|
88
|
+
};
|
|
89
|
+
/** Represents an output definition of a node. */
|
|
90
|
+
export type NodeOutputDefinition = {
|
|
91
|
+
/** The unique identifier of the output. Unique within a single node. */
|
|
92
|
+
id: PortId;
|
|
93
|
+
/** The title of the output. Shown in the UI. */
|
|
94
|
+
title: string;
|
|
95
|
+
/** The data type of the output. */
|
|
96
|
+
dataType: DataType | Readonly<DataType[]>;
|
|
97
|
+
/** The data associated with the output. */
|
|
98
|
+
data?: unknown;
|
|
99
|
+
/** The default value of the output. Some outputs just have a fixed value. */
|
|
100
|
+
defaultValue?: unknown;
|
|
101
|
+
/** User-facing description of the port. */
|
|
102
|
+
description?: string;
|
|
103
|
+
};
|
|
104
|
+
/** Represents a connection between two nodes. */
|
|
105
|
+
export type NodeConnection = {
|
|
106
|
+
/** The unique identifier of the output node. */
|
|
107
|
+
outputNodeId: NodeId;
|
|
108
|
+
/** The unique identifier of the input node. */
|
|
109
|
+
inputNodeId: NodeId;
|
|
110
|
+
/** The unique identifier of the output. */
|
|
111
|
+
outputId: PortId;
|
|
112
|
+
/** The unique identifier of the input. */
|
|
113
|
+
inputId: PortId;
|
|
114
|
+
};
|
|
115
|
+
export declare const IF_PORT: NodeInputDefinition;
|
|
116
|
+
export declare function isBuiltInInputDefinition(input: NodeInputDefinition): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type NodeBodySpecBase = {
|
|
2
|
+
fontSize?: number;
|
|
3
|
+
fontFamily?: 'monospace' | 'sans-serif';
|
|
4
|
+
};
|
|
5
|
+
export type PlainNodeBodySpec = {
|
|
6
|
+
type: 'plain';
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
export type MarkdownNodeBodySpec = {
|
|
10
|
+
type: 'markdown';
|
|
11
|
+
text: string;
|
|
12
|
+
};
|
|
13
|
+
export type ColorizedNodeBodySpec = {
|
|
14
|
+
type: 'colorized';
|
|
15
|
+
language: string;
|
|
16
|
+
text: string;
|
|
17
|
+
theme?: string;
|
|
18
|
+
};
|
|
19
|
+
export type NodeBodySpec = NodeBodySpecBase & (PlainNodeBodySpec | MarkdownNodeBodySpec | ColorizedNodeBodySpec);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartNode } from './NodeBase.js';
|
|
2
|
+
import type { NodeImplConstructor, PluginNodeImpl } from './NodeImpl.js';
|
|
3
|
+
export type NodeDefinition<T extends ChartNode> = {
|
|
4
|
+
impl: NodeImplConstructor<T>;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export type PluginNodeDefinition<T extends ChartNode> = {
|
|
8
|
+
impl: PluginNodeImpl<T>;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export type UnknownNodeDefinition = NodeDefinition<ChartNode>;
|
|
12
|
+
export declare function nodeDefinition<T extends ChartNode>(impl: NodeImplConstructor<T>, displayName: string): NodeDefinition<T>;
|
|
13
|
+
export declare function pluginNodeDefinition<T extends ChartNode>(impl: PluginNodeImpl<T>, displayName: string): PluginNodeDefinition<T>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChartNode, NodeConnection, NodeId, NodeInputDefinition, NodeOutputDefinition } from './NodeBase.js';
|
|
2
|
+
import type { Inputs } from './GraphProcessor.js';
|
|
3
|
+
export type ExecutionState = {
|
|
4
|
+
connections: Record<NodeId, NodeConnection[]>;
|
|
5
|
+
definitions: Record<NodeId, {
|
|
6
|
+
inputs: NodeInputDefinition[];
|
|
7
|
+
outputs: NodeOutputDefinition[];
|
|
8
|
+
}>;
|
|
9
|
+
erroredNodes: Map<NodeId, Error | string>;
|
|
10
|
+
loopControllersSeen: Set<NodeId>;
|
|
11
|
+
nodesById: Record<NodeId, ChartNode>;
|
|
12
|
+
stronglyConnectedComponents: ChartNode[][];
|
|
13
|
+
visitedNodes: Set<NodeId>;
|
|
14
|
+
};
|
|
15
|
+
export type OutputNodeResult = {
|
|
16
|
+
nodes: ChartNode[];
|
|
17
|
+
connections: NodeConnection[];
|
|
18
|
+
connectionsToNodes: {
|
|
19
|
+
connections: NodeConnection[];
|
|
20
|
+
node: ChartNode;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
export declare function getStartNodes(state: ExecutionState, graphNodes: ChartNode[], runToNodeIds?: NodeId[]): ChartNode[];
|
|
24
|
+
export declare function getInputNodesTo(state: ExecutionState, node: ChartNode): ChartNode[];
|
|
25
|
+
export declare function getOutputNodesFrom(state: ExecutionState, node: ChartNode): OutputNodeResult;
|
|
26
|
+
export declare function hasErroredInputNode(state: ExecutionState, node: ChartNode, inputNodes: ChartNode[], onTrace?: (message: string) => void): boolean;
|
|
27
|
+
export declare function areRequiredInputsConnected(state: ExecutionState, node: ChartNode): boolean;
|
|
28
|
+
export declare function getWaitingForInputNode(state: ExecutionState, node: ChartNode, inputNodes: ChartNode[], inputValues: Inputs): false | string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ChartNode, type NodeConnection } from './NodeBase.js';
|
|
2
|
+
import type { Opaque } from 'type-fest';
|
|
3
|
+
import { type AttachedData } from '../utils/serialization/serializationUtils.js';
|
|
4
|
+
export type GraphId = Opaque<string, 'GraphId'>;
|
|
5
|
+
export interface NodeGraph {
|
|
6
|
+
metadata?: {
|
|
7
|
+
id?: GraphId;
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
attachedData?: AttachedData;
|
|
11
|
+
};
|
|
12
|
+
nodes: ChartNode[];
|
|
13
|
+
connections: NodeConnection[];
|
|
14
|
+
}
|
|
15
|
+
export declare function emptyNodeGraph(): NodeGraph;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Inputs, Outputs } from './GraphProcessor.js';
|
|
2
|
+
import { type ChartNode, type NodeConnection, type NodeId, type NodeInputDefinition, type NodeOutputDefinition } from './NodeBase.js';
|
|
3
|
+
import type { Project, ProjectId } from './Project.js';
|
|
4
|
+
import type { InternalProcessContext } from './ProcessContext.js';
|
|
5
|
+
import type { EditorDefinition } from './EditorDefinition.js';
|
|
6
|
+
import type { NodeBodySpec } from './NodeBodySpec.js';
|
|
7
|
+
import type { RivetUIContext } from './RivetUIContext.js';
|
|
8
|
+
export interface PluginNodeImpl<T extends ChartNode> {
|
|
9
|
+
getInputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
10
|
+
getOutputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
11
|
+
process(data: T['data'], inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
12
|
+
getEditors(data: T['data'], context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
13
|
+
getBody(data: T['data'], context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
14
|
+
create(): T;
|
|
15
|
+
getUIData(context: RivetUIContext): NodeUIData | Promise<NodeUIData>;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class NodeImpl<T extends ChartNode, Type extends T['type'] = T['type']> {
|
|
18
|
+
readonly chartNode: T;
|
|
19
|
+
constructor(chartNode: T);
|
|
20
|
+
get id(): string;
|
|
21
|
+
get type(): Type;
|
|
22
|
+
get title(): string;
|
|
23
|
+
get visualData(): {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
get data(): T['data'];
|
|
28
|
+
abstract getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>): NodeInputDefinition[];
|
|
29
|
+
getInputDefinitionsIncludingBuiltIn(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>): NodeInputDefinition[];
|
|
30
|
+
abstract getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project, referencedProjects: Record<ProjectId, Project>): NodeOutputDefinition[];
|
|
31
|
+
abstract process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
32
|
+
getEditors(_context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
33
|
+
getBody(_context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
34
|
+
}
|
|
35
|
+
export type NodeBody = string | NodeBodySpec | NodeBodySpec[] | undefined;
|
|
36
|
+
export declare class PluginNodeImplClass<T extends ChartNode, Type extends T['type'] = T['type']> extends NodeImpl<T, Type> {
|
|
37
|
+
readonly impl: PluginNodeImpl<T>;
|
|
38
|
+
constructor(chartNode: T, impl: PluginNodeImpl<T>);
|
|
39
|
+
getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
40
|
+
getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
41
|
+
process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
42
|
+
getEditors(context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
43
|
+
getBody(context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
44
|
+
}
|
|
45
|
+
export type NodeUIData = {
|
|
46
|
+
contextMenuTitle?: string;
|
|
47
|
+
infoBoxTitle?: string;
|
|
48
|
+
infoBoxBody?: string;
|
|
49
|
+
infoBoxImageUri?: string;
|
|
50
|
+
group?: string | string[];
|
|
51
|
+
};
|
|
52
|
+
export type NodeImplConstructor<T extends ChartNode> = {
|
|
53
|
+
new (chartNode: T, pluginImpl: PluginNodeImpl<T> | undefined): NodeImpl<T>;
|
|
54
|
+
create(pluginImpl?: PluginNodeImpl<T>): T;
|
|
55
|
+
getUIData(context: RivetUIContext): NodeUIData | Promise<NodeUIData>;
|
|
56
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ChartNode } from './NodeBase.js';
|
|
2
|
+
import { type NodeImplConstructor, type NodeImpl } from './NodeImpl.js';
|
|
3
|
+
import type { NodeDefinition, PluginNodeDefinition } from './NodeDefinition.js';
|
|
4
|
+
import { type RivetPlugin } from './RivetPlugin.js';
|
|
5
|
+
export declare class NodeRegistration<NodeTypes extends string = never, Nodes extends ChartNode = never> {
|
|
6
|
+
#private;
|
|
7
|
+
NodesType: Nodes;
|
|
8
|
+
NodeTypesType: NodeTypes;
|
|
9
|
+
register<T extends ChartNode>(definition: NodeDefinition<T>, plugin?: RivetPlugin): NodeRegistration<NodeTypes | T['type'], Nodes | T>;
|
|
10
|
+
registerPluginNode<T extends ChartNode>(definition: PluginNodeDefinition<T>, plugin: RivetPlugin): NodeRegistration<NodeTypes | T['type'], Nodes | T>;
|
|
11
|
+
registerPlugin(plugin: RivetPlugin): void;
|
|
12
|
+
create<T extends NodeTypes>(type: T): Extract<Nodes, {
|
|
13
|
+
type: T;
|
|
14
|
+
}>;
|
|
15
|
+
createDynamic(type: string): ChartNode;
|
|
16
|
+
createImpl<TType extends NodeTypes>(node: Extract<Nodes, {
|
|
17
|
+
type: TType;
|
|
18
|
+
}>): NodeImpl<Extract<Nodes, {
|
|
19
|
+
type: TType;
|
|
20
|
+
}>>;
|
|
21
|
+
createDynamicImpl(node: ChartNode): NodeImpl<ChartNode>;
|
|
22
|
+
getDisplayName<T extends NodeTypes>(type: T): string;
|
|
23
|
+
getDynamicDisplayName(type: string): string;
|
|
24
|
+
isRegistered(type: NodeTypes): boolean;
|
|
25
|
+
getNodeTypes(): NodeTypes[];
|
|
26
|
+
getNodeConstructors(): NodeImplConstructor<ChartNode>[];
|
|
27
|
+
getPluginFor(type: string): RivetPlugin | undefined;
|
|
28
|
+
getPlugins(): RivetPlugin[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { NodeRegistration } from './NodeRegistration.js';
|
|
2
|
+
export * from './nodes/UserInputNode.js';
|
|
3
|
+
export * from './nodes/TextNode.js';
|
|
4
|
+
export * from './nodes/ChatNode.js';
|
|
5
|
+
export * from './nodes/ChatNodeBase.js';
|
|
6
|
+
export * from './nodes/LLMChatV2Node.js';
|
|
7
|
+
export * from './nodes/PromptNode.js';
|
|
8
|
+
export * from './nodes/ExtractRegexNode.js';
|
|
9
|
+
export * from './nodes/CodeNode.js';
|
|
10
|
+
export * from './nodes/ExpressionNode.js';
|
|
11
|
+
export * from './nodes/MatchNode.js';
|
|
12
|
+
export * from './nodes/IfNode.js';
|
|
13
|
+
export * from './nodes/ReadDirectoryNode.js';
|
|
14
|
+
export * from './nodes/ReadFileNode.js';
|
|
15
|
+
export * from './nodes/IfElseNode.js';
|
|
16
|
+
export * from './nodes/ChunkNode.js';
|
|
17
|
+
export * from './nodes/GraphInputNode.js';
|
|
18
|
+
export * from './nodes/GraphOutputNode.js';
|
|
19
|
+
export * from './nodes/SubGraphNode.js';
|
|
20
|
+
export * from './nodes/ArrayNode.js';
|
|
21
|
+
export * from './nodes/ExtractJsonNode.js';
|
|
22
|
+
export * from './nodes/ExtractYamlNode.js';
|
|
23
|
+
export * from './nodes/AssemblePromptNode.js';
|
|
24
|
+
export * from './nodes/LoopControllerNode.js';
|
|
25
|
+
export * from './nodes/TrimChatMessagesNode.js';
|
|
26
|
+
export * from './nodes/ExternalCallNode.js';
|
|
27
|
+
export * from './nodes/ExtractObjectPathNode.js';
|
|
28
|
+
export * from './nodes/RaiseEventNode.js';
|
|
29
|
+
export * from './nodes/ContextNode.js';
|
|
30
|
+
export * from './nodes/CoalesceNode.js';
|
|
31
|
+
export * from './nodes/PassthroughNode.js';
|
|
32
|
+
export * from './nodes/PopNode.js';
|
|
33
|
+
export * from './nodes/SetGlobalNode.js';
|
|
34
|
+
export * from './nodes/GetGlobalNode.js';
|
|
35
|
+
export * from './nodes/WaitForEventNode.js';
|
|
36
|
+
export * from './nodes/ToolNode.js';
|
|
37
|
+
export * from './nodes/ToYamlNode.js';
|
|
38
|
+
export * from './nodes/GetEmbeddingNode.js';
|
|
39
|
+
export * from './nodes/VectorStoreNode.js';
|
|
40
|
+
export * from './nodes/VectorNearestNeighborsNode.js';
|
|
41
|
+
export * from './nodes/HashNode.js';
|
|
42
|
+
export * from './nodes/AbortGraphNode.js';
|
|
43
|
+
export * from './nodes/RaceInputsNode.js';
|
|
44
|
+
export * from './nodes/ToJsonNode.js';
|
|
45
|
+
export * from './nodes/JoinNode.js';
|
|
46
|
+
export * from './nodes/FilterNode.js';
|
|
47
|
+
export * from './nodes/JSFilterNode.js';
|
|
48
|
+
export * from './nodes/JSMapNode.js';
|
|
49
|
+
export * from './nodes/ObjectNode.js';
|
|
50
|
+
export * from './nodes/BooleanNode.js';
|
|
51
|
+
export * from './nodes/CompareNode.js';
|
|
52
|
+
export * from './nodes/EvaluateNode.js';
|
|
53
|
+
export * from './nodes/NumberNode.js';
|
|
54
|
+
export * from './nodes/RandomNumberNode.js';
|
|
55
|
+
export * from './nodes/ShuffleNode.js';
|
|
56
|
+
export * from './nodes/CommentNode.js';
|
|
57
|
+
export * from './nodes/ImageNode.js';
|
|
58
|
+
export * from './nodes/AudioNode.js';
|
|
59
|
+
export * from './nodes/HttpCallNode.js';
|
|
60
|
+
export * from './nodes/DelayNode.js';
|
|
61
|
+
export * from './nodes/AppendToDatasetNode.js';
|
|
62
|
+
export * from './nodes/CreateDatasetNode.js';
|
|
63
|
+
export * from './nodes/LoadDatasetNode.js';
|
|
64
|
+
export * from './nodes/GetAllDatasetsNode.js';
|
|
65
|
+
export * from './nodes/SplitNode.js';
|
|
66
|
+
export * from './nodes/DatasetNearestNeigborsNode.js';
|
|
67
|
+
export * from './nodes/GetDatasetRowNode.js';
|
|
68
|
+
export * from './nodes/SliceNode.js';
|
|
69
|
+
export * from './nodes/ExtractMarkdownCodeBlocksNode.js';
|
|
70
|
+
export * from './nodes/AssembleMessageNode.js';
|
|
71
|
+
export * from './nodes/URLReferenceNode.js';
|
|
72
|
+
export * from './nodes/DestructureNode.js';
|
|
73
|
+
export * from './nodes/ReplaceDatasetNode.js';
|
|
74
|
+
export * from './nodes/ListGraphsNode.js';
|
|
75
|
+
export * from './nodes/GraphReferenceNode.js';
|
|
76
|
+
export * from './nodes/CallGraphNode.js';
|
|
77
|
+
export * from './nodes/DelegateFunctionCallNode.js';
|
|
78
|
+
export * from './nodes/PlayAudioNode.js';
|
|
79
|
+
export * from './nodes/DocumentNode.js';
|
|
80
|
+
export * from './nodes/ChatLoopNode.js';
|
|
81
|
+
export * from './nodes/ReadAllFilesNode.js';
|
|
82
|
+
export * from './nodes/ToMarkdownTableNode.js';
|
|
83
|
+
export * from './nodes/CronNode.js';
|
|
84
|
+
export * from './nodes/ToTreeNode.js';
|
|
85
|
+
export * from './nodes/LoopUntilNode.js';
|
|
86
|
+
export * from './nodes/MCPDiscoveryNode.js';
|
|
87
|
+
export * from './nodes/MCPToolCallNode.js';
|
|
88
|
+
export * from './nodes/MCPGetPromptNode.js';
|
|
89
|
+
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
90
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "graphInput" | "graphOutput" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias", 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/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/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | 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/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 & {
|
|
91
|
+
type: "mcpDiscovery";
|
|
92
|
+
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
93
|
+
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
94
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
95
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "graphInput" | "graphOutput" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias", 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/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/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | 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/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 & {
|
|
96
|
+
type: "mcpDiscovery";
|
|
97
|
+
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
98
|
+
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
99
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
100
|
+
export { globalRivetNodeRegistry };
|
|
101
|
+
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
102
|
+
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
103
|
+
export type NodeOfType<T extends BuiltInNodeType> = Extract<BuiltInNodes, {
|
|
104
|
+
type: T;
|
|
105
|
+
}>;
|
|
106
|
+
/** Resets the global node registry to a fresh one with only built-in nodes registered. */
|
|
107
|
+
export declare function resetGlobalRivetNodeRegistry(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Replace the global registry with a fully-assembled one.
|
|
110
|
+
* Use after `assembleRegistry()` to install a registry that includes project plugins.
|
|
111
|
+
*/
|
|
112
|
+
export declare function replaceGlobalRivetNodeRegistry(registry: NodeRegistration<any, any>): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type BuiltInPluginLoadSpec = {
|
|
2
|
+
type: 'built-in';
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
export type URIPluginLoadSpec = {
|
|
7
|
+
type: 'uri';
|
|
8
|
+
id: string;
|
|
9
|
+
uri: string;
|
|
10
|
+
};
|
|
11
|
+
export type PackagePluginLoadSpec = {
|
|
12
|
+
type: 'package';
|
|
13
|
+
id: string;
|
|
14
|
+
package: string;
|
|
15
|
+
tag: string;
|
|
16
|
+
};
|
|
17
|
+
export type PluginLoadSpec = URIPluginLoadSpec | BuiltInPluginLoadSpec | PackagePluginLoadSpec;
|