@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,214 @@
|
|
|
1
|
+
import {} from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
3
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
4
|
+
import {} from '../GraphProcessor.js';
|
|
5
|
+
import {} from '../NodeGraph.js';
|
|
6
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
7
|
+
import {} from '../Project.js';
|
|
8
|
+
import {} from './GraphInputNode.js';
|
|
9
|
+
import {} from './GraphOutputNode.js';
|
|
10
|
+
import {} from '../DataValue.js';
|
|
11
|
+
import {} from '../ProcessContext.js';
|
|
12
|
+
import {} from '../EditorDefinition.js';
|
|
13
|
+
import { dedent } from 'ts-dedent';
|
|
14
|
+
export class LoopUntilNodeImpl extends NodeImpl {
|
|
15
|
+
static create() {
|
|
16
|
+
const chartNode = {
|
|
17
|
+
type: 'loopUntil',
|
|
18
|
+
title: 'Loop Until',
|
|
19
|
+
id: nanoid(),
|
|
20
|
+
visualData: {
|
|
21
|
+
x: 0,
|
|
22
|
+
y: 0,
|
|
23
|
+
width: 200,
|
|
24
|
+
},
|
|
25
|
+
data: {
|
|
26
|
+
targetGraph: undefined,
|
|
27
|
+
conditionType: 'allOutputsSet',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
return chartNode;
|
|
31
|
+
}
|
|
32
|
+
getInputDefinitions(_connections, _nodes, project) {
|
|
33
|
+
const inputs = [];
|
|
34
|
+
// Get inputs from the target graph
|
|
35
|
+
const graph = project.graphs[this.data.targetGraph ?? ''];
|
|
36
|
+
if (graph) {
|
|
37
|
+
const inputNodes = graph.nodes.filter((node) => node.type === 'graphInput');
|
|
38
|
+
const inputIds = [...new Set(inputNodes.map((node) => node.data.id))].sort();
|
|
39
|
+
inputIds.forEach((id) => {
|
|
40
|
+
const inputNode = inputNodes.find((node) => node.data.id === id);
|
|
41
|
+
inputs.push({
|
|
42
|
+
id: id,
|
|
43
|
+
title: id,
|
|
44
|
+
dataType: inputNode.data.dataType,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return inputs;
|
|
49
|
+
}
|
|
50
|
+
getOutputDefinitions(_connections, _nodes, project) {
|
|
51
|
+
const outputs = [];
|
|
52
|
+
// Get outputs from the target graph
|
|
53
|
+
const graph = project.graphs[this.data.targetGraph ?? ''];
|
|
54
|
+
if (graph) {
|
|
55
|
+
const outputNodes = graph.nodes.filter((node) => node.type === 'graphOutput');
|
|
56
|
+
const outputIds = [...new Set(outputNodes.map((node) => node.data.id))].sort();
|
|
57
|
+
outputIds.forEach((id) => {
|
|
58
|
+
const outputNode = outputNodes.find((node) => node.data.id === id);
|
|
59
|
+
outputs.push({
|
|
60
|
+
id: id,
|
|
61
|
+
title: id,
|
|
62
|
+
dataType: outputNode.data.dataType,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// Add standard loop outputs
|
|
67
|
+
outputs.push({
|
|
68
|
+
id: 'iteration',
|
|
69
|
+
title: 'Iterations',
|
|
70
|
+
dataType: 'number',
|
|
71
|
+
description: 'The number of iterations completed.',
|
|
72
|
+
}, {
|
|
73
|
+
id: 'completed',
|
|
74
|
+
title: 'Completed',
|
|
75
|
+
dataType: 'boolean',
|
|
76
|
+
description: 'True when the loop has completed.',
|
|
77
|
+
});
|
|
78
|
+
return outputs;
|
|
79
|
+
}
|
|
80
|
+
getEditors(context) {
|
|
81
|
+
const definitions = [
|
|
82
|
+
{
|
|
83
|
+
type: 'graphSelector',
|
|
84
|
+
label: 'Target Graph',
|
|
85
|
+
dataKey: 'targetGraph',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'dropdown',
|
|
89
|
+
dataKey: 'conditionType',
|
|
90
|
+
label: 'Stop Condition',
|
|
91
|
+
options: [
|
|
92
|
+
{ label: 'All Outputs Set', value: 'allOutputsSet' },
|
|
93
|
+
{ label: 'Input Equals Value', value: 'inputEqual' },
|
|
94
|
+
],
|
|
95
|
+
helperMessage: 'The condition that will stop the loop',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'number',
|
|
99
|
+
dataKey: 'maxIterations',
|
|
100
|
+
label: 'Max Iterations',
|
|
101
|
+
helperMessage: 'Maximum number of iterations (optional, leave empty for unlimited)',
|
|
102
|
+
allowEmpty: true,
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
if (this.data.conditionType === 'inputEqual') {
|
|
106
|
+
definitions.push({
|
|
107
|
+
type: 'string',
|
|
108
|
+
dataKey: 'inputToCheck',
|
|
109
|
+
label: 'Input to Check',
|
|
110
|
+
helperMessage: 'The name of the input to compare',
|
|
111
|
+
}, {
|
|
112
|
+
type: 'string',
|
|
113
|
+
dataKey: 'targetValue',
|
|
114
|
+
label: 'Target Value',
|
|
115
|
+
helperMessage: 'The value to compare against',
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Add dynamic editors for graph inputs
|
|
119
|
+
if (this.data.targetGraph) {
|
|
120
|
+
const graph = context.project.graphs[this.data.targetGraph];
|
|
121
|
+
if (graph) {
|
|
122
|
+
const inputNodes = graph.nodes.filter((node) => node.type === 'graphInput');
|
|
123
|
+
const inputIds = [...new Set(inputNodes.map((node) => node.data.id))].sort();
|
|
124
|
+
for (const inputId of inputIds) {
|
|
125
|
+
const inputNode = inputNodes.find((node) => node.data.id === inputId);
|
|
126
|
+
definitions.push({
|
|
127
|
+
type: 'dynamic',
|
|
128
|
+
dataKey: 'inputData',
|
|
129
|
+
dynamicDataKey: inputNode.data.id,
|
|
130
|
+
dataType: inputNode.data.dataType,
|
|
131
|
+
label: inputNode.data.id,
|
|
132
|
+
editor: inputNode.data.editor ?? 'auto',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return definitions;
|
|
138
|
+
}
|
|
139
|
+
static getUIData() {
|
|
140
|
+
return {
|
|
141
|
+
infoBoxBody: dedent `
|
|
142
|
+
Executes a subgraph in a loop until a condition is met. Each iteration's outputs become
|
|
143
|
+
the inputs for the next iteration. Supports different stopping conditions and optional
|
|
144
|
+
maximum iterations.
|
|
145
|
+
`,
|
|
146
|
+
infoBoxTitle: 'Loop Until Node',
|
|
147
|
+
contextMenuTitle: 'Loop Until',
|
|
148
|
+
group: ['Logic'],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
getBody(context) {
|
|
152
|
+
if (!this.data.targetGraph) {
|
|
153
|
+
return 'No target graph selected';
|
|
154
|
+
}
|
|
155
|
+
const graphName = context.project.graphs[this.data.targetGraph]?.metadata?.name ?? 'Unknown Graph';
|
|
156
|
+
const condition = this.data.conditionType === 'allOutputsSet'
|
|
157
|
+
? 'all outputs are set'
|
|
158
|
+
: `${this.data.inputToCheck} equals ${this.data.targetValue}`;
|
|
159
|
+
const maxIterations = this.data.maxIterations ? `\nMax iterations: ${this.data.maxIterations}` : '';
|
|
160
|
+
return `Executes ${graphName}\nuntil ${condition}${maxIterations}`;
|
|
161
|
+
}
|
|
162
|
+
shouldBreak(outputs) {
|
|
163
|
+
if (this.data.conditionType === 'allOutputsSet') {
|
|
164
|
+
// Check if any output is control-flow-excluded
|
|
165
|
+
const anyInputIsExcluded = Object.values(outputs)
|
|
166
|
+
.filter((o) => o != null)
|
|
167
|
+
.some((output) => output.type === 'control-flow-excluded');
|
|
168
|
+
return !anyInputIsExcluded;
|
|
169
|
+
}
|
|
170
|
+
else if (this.data.conditionType === 'inputEqual' && this.data.inputToCheck && this.data.targetValue) {
|
|
171
|
+
const inputValue = outputs[this.data.inputToCheck];
|
|
172
|
+
return inputValue?.value?.toString() === this.data.targetValue;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
async process(inputs, context) {
|
|
177
|
+
if (!this.data.targetGraph) {
|
|
178
|
+
throw new Error('No target graph selected');
|
|
179
|
+
}
|
|
180
|
+
let iteration = 0;
|
|
181
|
+
let currentInputs = { ...inputs };
|
|
182
|
+
// Add any default values from inputData
|
|
183
|
+
if (this.data.inputData) {
|
|
184
|
+
Object.entries(this.data.inputData).forEach(([key, value]) => {
|
|
185
|
+
if (currentInputs[key] === undefined) {
|
|
186
|
+
currentInputs[key] = value;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
let lastOutputs = {};
|
|
191
|
+
while (!context.signal.aborted) {
|
|
192
|
+
// Check max iterations if set
|
|
193
|
+
if (this.data.maxIterations && iteration >= this.data.maxIterations) {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
const subprocessor = context.createSubProcessor(this.data.targetGraph, { signal: context.signal });
|
|
197
|
+
lastOutputs = await subprocessor.processGraph(context, currentInputs, context.contextValues);
|
|
198
|
+
iteration++;
|
|
199
|
+
// Check if the condition is met
|
|
200
|
+
if (this.shouldBreak(lastOutputs)) {
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
context.onPartialOutputs?.(lastOutputs);
|
|
204
|
+
// Use outputs as inputs for next iteration
|
|
205
|
+
currentInputs = lastOutputs;
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
...lastOutputs,
|
|
209
|
+
['iteration']: { type: 'number', value: iteration },
|
|
210
|
+
['completed']: { type: 'boolean', value: true },
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export const loopUntilNode = nodeDefinition(LoopUntilNodeImpl, 'Loop Until');
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid';
|
|
2
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
3
|
+
import {} from '../../index.js';
|
|
4
|
+
import { MCPError, MCPErrorType } from '../../integrations/mcp/MCPProvider.js';
|
|
5
|
+
import { dedent, getInputOrData } from '../../utils/index.js';
|
|
6
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
7
|
+
import { getServerHelperMessage, getServerOptions, loadMCPConfiguration } from '../../integrations/mcp/MCPUtils.js';
|
|
8
|
+
import { getMCPBaseInputs } from '../../integrations/mcp/MCPBase.js';
|
|
9
|
+
class MCPDiscoveryNodeImpl extends NodeImpl {
|
|
10
|
+
static create() {
|
|
11
|
+
const chartNode = {
|
|
12
|
+
type: 'mcpDiscovery',
|
|
13
|
+
title: 'MCP Discovery',
|
|
14
|
+
id: nanoid(),
|
|
15
|
+
visualData: {
|
|
16
|
+
x: 0,
|
|
17
|
+
y: 0,
|
|
18
|
+
width: 250,
|
|
19
|
+
},
|
|
20
|
+
data: {
|
|
21
|
+
name: 'mcp-client',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
transportType: 'stdio',
|
|
24
|
+
serverUrl: 'http://localhost:8080/mcp',
|
|
25
|
+
serverId: '',
|
|
26
|
+
useNameInput: false,
|
|
27
|
+
useVersionInput: false,
|
|
28
|
+
useToolsOutput: true,
|
|
29
|
+
usePromptsOutput: true,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return chartNode;
|
|
33
|
+
}
|
|
34
|
+
getInputDefinitions() {
|
|
35
|
+
const inputs = getMCPBaseInputs(this.data);
|
|
36
|
+
return inputs;
|
|
37
|
+
}
|
|
38
|
+
getOutputDefinitions() {
|
|
39
|
+
const outputDefinitions = [];
|
|
40
|
+
if (this.data.useToolsOutput) {
|
|
41
|
+
outputDefinitions.push({
|
|
42
|
+
id: 'tools',
|
|
43
|
+
title: 'Tools',
|
|
44
|
+
dataType: 'object[]',
|
|
45
|
+
description: 'Tools returned from the MCP server',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (this.data.usePromptsOutput) {
|
|
49
|
+
outputDefinitions.push({
|
|
50
|
+
id: 'prompts',
|
|
51
|
+
title: 'Prompts',
|
|
52
|
+
dataType: 'object[]',
|
|
53
|
+
description: 'Prompts returned from the MCP server',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return outputDefinitions;
|
|
57
|
+
}
|
|
58
|
+
async getEditors(context) {
|
|
59
|
+
const editors = [
|
|
60
|
+
{
|
|
61
|
+
type: 'toggle',
|
|
62
|
+
label: 'Output Tools',
|
|
63
|
+
dataKey: 'useToolsOutput',
|
|
64
|
+
helperMessage: 'Toggle on if you want to get a Tools output',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'toggle',
|
|
68
|
+
label: 'Output Prompts',
|
|
69
|
+
dataKey: 'usePromptsOutput',
|
|
70
|
+
helperMessage: 'Toggle on if you want to get a Prompts output',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'string',
|
|
74
|
+
label: 'Name',
|
|
75
|
+
dataKey: 'name',
|
|
76
|
+
useInputToggleDataKey: 'useNameInput',
|
|
77
|
+
helperMessage: 'The name for the MCP Client',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'string',
|
|
81
|
+
label: 'Version',
|
|
82
|
+
dataKey: 'version',
|
|
83
|
+
useInputToggleDataKey: 'useVersionInput',
|
|
84
|
+
helperMessage: 'A version for the MCP Client',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: 'dropdown',
|
|
88
|
+
label: 'Transport Type',
|
|
89
|
+
dataKey: 'transportType',
|
|
90
|
+
options: [
|
|
91
|
+
{ label: 'HTTP', value: 'http' },
|
|
92
|
+
{ label: 'STDIO', value: 'stdio' },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
if (this.data.transportType === 'http') {
|
|
97
|
+
editors.push({
|
|
98
|
+
type: 'string',
|
|
99
|
+
label: 'Server URL',
|
|
100
|
+
dataKey: 'serverUrl',
|
|
101
|
+
useInputToggleDataKey: 'useServerUrlInput',
|
|
102
|
+
helperMessage: 'The base URL endpoint for the MCP server with `/mcp`',
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else if (this.data.transportType === 'stdio') {
|
|
106
|
+
const serverOptions = await getServerOptions(context);
|
|
107
|
+
editors.push({
|
|
108
|
+
type: 'dropdown',
|
|
109
|
+
label: 'Server ID',
|
|
110
|
+
dataKey: 'serverId',
|
|
111
|
+
helperMessage: getServerHelperMessage(context, serverOptions.length),
|
|
112
|
+
options: serverOptions,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return editors;
|
|
116
|
+
}
|
|
117
|
+
getBody(context) {
|
|
118
|
+
let base;
|
|
119
|
+
if (this.data.transportType === 'http') {
|
|
120
|
+
base = this.data.useServerUrlInput ? '(Using Server URL Input)' : this.data.serverUrl;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
base = `Server ID: ${this.data.serverId || '(None)'}`;
|
|
124
|
+
}
|
|
125
|
+
const namePart = `Name: ${this.data.name}`;
|
|
126
|
+
const versionPart = `Version: ${this.data.version}`;
|
|
127
|
+
const parts = [namePart, versionPart, base];
|
|
128
|
+
if (context.executor !== 'nodejs') {
|
|
129
|
+
parts.push('(Requires Node Executor)');
|
|
130
|
+
}
|
|
131
|
+
return parts.join('\n');
|
|
132
|
+
}
|
|
133
|
+
static getUIData() {
|
|
134
|
+
return {
|
|
135
|
+
infoBoxBody: dedent `
|
|
136
|
+
Connects to an MCP (Model Context Protocol) server to discover capabilities like tools and prompts.
|
|
137
|
+
`,
|
|
138
|
+
infoBoxTitle: 'MCP Discovery Node',
|
|
139
|
+
contextMenuTitle: 'MCP Discovery',
|
|
140
|
+
group: ['MCP'],
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
async process(inputs, context) {
|
|
144
|
+
const name = getInputOrData(this.data, inputs, 'name', 'string');
|
|
145
|
+
const version = getInputOrData(this.data, inputs, 'version', 'string');
|
|
146
|
+
const transportType = getInputOrData(this.data, inputs, 'transportType', 'string');
|
|
147
|
+
let tools = [];
|
|
148
|
+
let prompts = [];
|
|
149
|
+
try {
|
|
150
|
+
if (!context.mcpProvider) {
|
|
151
|
+
throw new Error('MCP Provider not found');
|
|
152
|
+
}
|
|
153
|
+
if (transportType === 'http') {
|
|
154
|
+
const serverUrl = getInputOrData(this.data, inputs, 'serverUrl', 'string');
|
|
155
|
+
if (!serverUrl || serverUrl === '') {
|
|
156
|
+
throw new MCPError(MCPErrorType.SERVER_NOT_FOUND, 'No server URL was provided');
|
|
157
|
+
}
|
|
158
|
+
if (!serverUrl.includes('/mcp')) {
|
|
159
|
+
throw new MCPError(MCPErrorType.SERVER_COMMUNICATION_FAILED, 'Include /mcp in your server URL. For example: http://localhost:8080/mcp');
|
|
160
|
+
}
|
|
161
|
+
tools = this.data.useToolsOutput ? await context.mcpProvider.getHTTPTools({ name, version }, serverUrl) : [];
|
|
162
|
+
prompts = this.data.usePromptsOutput
|
|
163
|
+
? await context.mcpProvider.getHTTPPrompts({ name, version }, serverUrl)
|
|
164
|
+
: [];
|
|
165
|
+
}
|
|
166
|
+
else if (transportType === 'stdio') {
|
|
167
|
+
const serverId = this.data.serverId ?? '';
|
|
168
|
+
const mcpConfig = await loadMCPConfiguration(context);
|
|
169
|
+
if (!mcpConfig.mcpServers[serverId]) {
|
|
170
|
+
throw new MCPError(MCPErrorType.SERVER_NOT_FOUND, `Server ${serverId} not found in MCP config`);
|
|
171
|
+
}
|
|
172
|
+
const serverConfig = {
|
|
173
|
+
config: mcpConfig.mcpServers[serverId],
|
|
174
|
+
serverId,
|
|
175
|
+
};
|
|
176
|
+
tools = this.data.useToolsOutput ? await context.mcpProvider.getStdioTools({ name, version }, serverConfig) : [];
|
|
177
|
+
prompts = this.data.usePromptsOutput
|
|
178
|
+
? await context.mcpProvider.getStdioPrompts({ name, version }, serverConfig)
|
|
179
|
+
: [];
|
|
180
|
+
}
|
|
181
|
+
const output = {};
|
|
182
|
+
const gptFunctions = tools.map((tool) => ({
|
|
183
|
+
name: tool.name,
|
|
184
|
+
description: tool.description ?? '',
|
|
185
|
+
parameters: tool.inputSchema,
|
|
186
|
+
strict: false,
|
|
187
|
+
}));
|
|
188
|
+
if (this.data.useToolsOutput) {
|
|
189
|
+
output['tools'] = {
|
|
190
|
+
type: 'gpt-function[]',
|
|
191
|
+
value: gptFunctions,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
if (this.data.usePromptsOutput) {
|
|
195
|
+
output['prompts'] = {
|
|
196
|
+
type: 'object[]',
|
|
197
|
+
value: prompts.map((prompt) => ({
|
|
198
|
+
name: prompt.name,
|
|
199
|
+
description: prompt.description,
|
|
200
|
+
arguments: prompt.arugments,
|
|
201
|
+
})),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return output;
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
if (context.executor === 'browser') {
|
|
208
|
+
throw new Error('Failed to create Client without Node Executor');
|
|
209
|
+
}
|
|
210
|
+
throw err;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export const mcpDiscoveryNode = nodeDefinition(MCPDiscoveryNodeImpl, 'MCP Discovery');
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {} from '../NodeBase.js';
|
|
2
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
3
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
4
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
5
|
+
import {} from '../GraphProcessor.js';
|
|
6
|
+
import {} from '../../index.js';
|
|
7
|
+
import { MCPError, MCPErrorType } from '../../integrations/mcp/MCPProvider.js';
|
|
8
|
+
import { coerceTypeOptional } from '../../utils/coerceType.js';
|
|
9
|
+
import { dedent, getInputOrData } from '../../utils/index.js';
|
|
10
|
+
import { getError } from '../../utils/errors.js';
|
|
11
|
+
import { getMCPBaseInputs } from '../../integrations/mcp/MCPBase.js';
|
|
12
|
+
import { getServerHelperMessage, getServerOptions, loadMCPConfiguration } from '../../integrations/mcp/MCPUtils.js';
|
|
13
|
+
import { keys } from '../../utils/typeSafety.js';
|
|
14
|
+
import { interpolate } from '../../utils/interpolation.js';
|
|
15
|
+
export class MCPGetPromptNodeImpl extends NodeImpl {
|
|
16
|
+
static create() {
|
|
17
|
+
const chartNode = {
|
|
18
|
+
type: 'mcpGetPrompt',
|
|
19
|
+
title: 'MCP Get Prompt',
|
|
20
|
+
id: nanoid(),
|
|
21
|
+
visualData: {
|
|
22
|
+
x: 0,
|
|
23
|
+
y: 0,
|
|
24
|
+
width: 250,
|
|
25
|
+
},
|
|
26
|
+
data: {
|
|
27
|
+
name: 'mcp-get-prompt-client',
|
|
28
|
+
version: '1.0.0',
|
|
29
|
+
transportType: 'stdio',
|
|
30
|
+
serverUrl: 'http://localhost:8080/mcp',
|
|
31
|
+
serverId: '',
|
|
32
|
+
promptName: '',
|
|
33
|
+
promptArguments: dedent `
|
|
34
|
+
{
|
|
35
|
+
"key": "value"
|
|
36
|
+
}`,
|
|
37
|
+
useNameInput: false,
|
|
38
|
+
useVersionInput: false,
|
|
39
|
+
usePromptNameInput: false,
|
|
40
|
+
usePromptArgumentsInput: false,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
return chartNode;
|
|
44
|
+
}
|
|
45
|
+
getInputDefinitions() {
|
|
46
|
+
const inputs = getMCPBaseInputs(this.data);
|
|
47
|
+
if (this.data.usePromptNameInput) {
|
|
48
|
+
inputs.push({
|
|
49
|
+
dataType: 'string',
|
|
50
|
+
id: 'promptName',
|
|
51
|
+
title: 'Prompt Name',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (this.data.usePromptArgumentsInput) {
|
|
55
|
+
inputs.push({
|
|
56
|
+
dataType: 'object',
|
|
57
|
+
id: 'promptArguments',
|
|
58
|
+
title: 'Prompt Arguments',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return inputs;
|
|
62
|
+
}
|
|
63
|
+
getOutputDefinitions() {
|
|
64
|
+
const outputDefinitions = [];
|
|
65
|
+
outputDefinitions.push({
|
|
66
|
+
id: 'prompt',
|
|
67
|
+
title: 'Prompt',
|
|
68
|
+
dataType: 'object',
|
|
69
|
+
description: 'Prompt response result',
|
|
70
|
+
});
|
|
71
|
+
return outputDefinitions;
|
|
72
|
+
}
|
|
73
|
+
async getEditors(context) {
|
|
74
|
+
const editors = [
|
|
75
|
+
{
|
|
76
|
+
type: 'string',
|
|
77
|
+
label: 'Name',
|
|
78
|
+
dataKey: 'name',
|
|
79
|
+
useInputToggleDataKey: 'useNameInput',
|
|
80
|
+
helperMessage: 'The name for the MCP Client',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'string',
|
|
84
|
+
label: 'Version',
|
|
85
|
+
dataKey: 'version',
|
|
86
|
+
useInputToggleDataKey: 'useVersionInput',
|
|
87
|
+
helperMessage: 'A version for the MCP Client',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'dropdown',
|
|
91
|
+
label: 'Transport Type',
|
|
92
|
+
dataKey: 'transportType',
|
|
93
|
+
options: [
|
|
94
|
+
{ label: 'HTTP', value: 'http' },
|
|
95
|
+
{ label: 'STDIO', value: 'stdio' },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: 'string',
|
|
100
|
+
label: 'Prompt Name',
|
|
101
|
+
dataKey: 'promptName',
|
|
102
|
+
useInputToggleDataKey: 'usePromptNameInput',
|
|
103
|
+
helperMessage: 'The name for the MCP prompt',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'code',
|
|
107
|
+
label: 'Prompt Arguments',
|
|
108
|
+
dataKey: 'promptArguments',
|
|
109
|
+
useInputToggleDataKey: 'usePromptArgumentsInput',
|
|
110
|
+
language: 'json',
|
|
111
|
+
helperMessage: 'Arguments to provide the prompt',
|
|
112
|
+
enableFolding: true,
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
if (this.data.transportType === 'http') {
|
|
116
|
+
editors.push({
|
|
117
|
+
type: 'string',
|
|
118
|
+
label: 'Server URL',
|
|
119
|
+
dataKey: 'serverUrl',
|
|
120
|
+
useInputToggleDataKey: 'useServerUrlInput',
|
|
121
|
+
helperMessage: 'The endpoint URL for the MCP server to connect',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else if (this.data.transportType === 'stdio') {
|
|
125
|
+
const serverOptions = await getServerOptions(context);
|
|
126
|
+
editors.push({
|
|
127
|
+
type: 'dropdown',
|
|
128
|
+
label: 'Server ID',
|
|
129
|
+
dataKey: 'serverId',
|
|
130
|
+
helperMessage: getServerHelperMessage(context, serverOptions.length),
|
|
131
|
+
options: serverOptions,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return editors;
|
|
135
|
+
}
|
|
136
|
+
getBody(context) {
|
|
137
|
+
let base;
|
|
138
|
+
if (this.data.transportType === 'http') {
|
|
139
|
+
base = this.data.useServerUrlInput ? '(Using Server URL Input)' : this.data.serverUrl;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
base = `Server ID: ${this.data.serverId || '(None)'}`;
|
|
143
|
+
}
|
|
144
|
+
const namePart = `Name: ${this.data.name}`;
|
|
145
|
+
const versionPart = `Version: ${this.data.version}`;
|
|
146
|
+
const parts = [namePart, versionPart, base];
|
|
147
|
+
if (context.executor !== 'nodejs') {
|
|
148
|
+
parts.push('(Requires Node Executor)');
|
|
149
|
+
}
|
|
150
|
+
return parts.join('\n');
|
|
151
|
+
}
|
|
152
|
+
static getUIData() {
|
|
153
|
+
return {
|
|
154
|
+
infoBoxBody: dedent `
|
|
155
|
+
Connects to an MCP (Model Context Protocol) server and gets a prompt response.
|
|
156
|
+
`,
|
|
157
|
+
infoBoxTitle: 'MCP Get Prompt Node',
|
|
158
|
+
contextMenuTitle: 'MCP Get Prompt',
|
|
159
|
+
group: ['MCP'],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
async process(inputs, context) {
|
|
163
|
+
const name = getInputOrData(this.data, inputs, 'name', 'string');
|
|
164
|
+
const version = getInputOrData(this.data, inputs, 'version', 'string');
|
|
165
|
+
const promptName = getInputOrData(this.data, inputs, 'promptName', 'string');
|
|
166
|
+
let promptArguments;
|
|
167
|
+
if (this.data.usePromptArgumentsInput) {
|
|
168
|
+
promptArguments = getInputOrData(this.data, inputs, 'promptArguments', 'object');
|
|
169
|
+
if (promptArguments == null) {
|
|
170
|
+
throw new MCPError(MCPErrorType.INVALID_SCHEMA, 'Cannot parse tool argument with input toggle on');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const inputMap = keys(inputs)
|
|
175
|
+
.filter((key) => key.startsWith('input'))
|
|
176
|
+
.reduce((acc, key) => {
|
|
177
|
+
const stringValue = coerceTypeOptional(inputs[key], 'string') ?? '';
|
|
178
|
+
const interpolationKey = key.slice('input-'.length);
|
|
179
|
+
acc[interpolationKey] = stringValue;
|
|
180
|
+
return acc;
|
|
181
|
+
}, {});
|
|
182
|
+
const interpolated = interpolate(this.data.promptArguments ?? '', inputMap);
|
|
183
|
+
promptArguments = JSON.parse(interpolated);
|
|
184
|
+
}
|
|
185
|
+
const getPromptRequest = {
|
|
186
|
+
name: promptName,
|
|
187
|
+
arguments: promptArguments,
|
|
188
|
+
};
|
|
189
|
+
const transportType = getInputOrData(this.data, inputs, 'transportType', 'string');
|
|
190
|
+
let getPromptResponse = undefined;
|
|
191
|
+
try {
|
|
192
|
+
if (!context.mcpProvider) {
|
|
193
|
+
throw new Error('MCP Provider not found');
|
|
194
|
+
}
|
|
195
|
+
if (transportType === 'http') {
|
|
196
|
+
const serverUrl = getInputOrData(this.data, inputs, 'serverUrl', 'string');
|
|
197
|
+
if (!serverUrl || serverUrl === '') {
|
|
198
|
+
throw new MCPError(MCPErrorType.SERVER_NOT_FOUND, 'No server URL was provided');
|
|
199
|
+
}
|
|
200
|
+
if (!serverUrl.includes('/mcp')) {
|
|
201
|
+
throw new MCPError(MCPErrorType.SERVER_COMMUNICATION_FAILED, 'Include /mcp in your server URL. For example: http://localhost:8080/mcp');
|
|
202
|
+
}
|
|
203
|
+
getPromptResponse = await context.mcpProvider.getHTTPrompt({ name, version }, serverUrl, getPromptRequest);
|
|
204
|
+
}
|
|
205
|
+
else if (transportType === 'stdio') {
|
|
206
|
+
const serverId = this.data.serverId ?? '';
|
|
207
|
+
const mcpConfig = await loadMCPConfiguration(context);
|
|
208
|
+
if (!mcpConfig.mcpServers[serverId]) {
|
|
209
|
+
throw new MCPError(MCPErrorType.SERVER_NOT_FOUND, `Server ${serverId} not found in MCP config`);
|
|
210
|
+
}
|
|
211
|
+
const serverConfig = {
|
|
212
|
+
config: mcpConfig.mcpServers[serverId],
|
|
213
|
+
serverId,
|
|
214
|
+
};
|
|
215
|
+
getPromptResponse = await context.mcpProvider.getStdioPrompt({ name, version }, serverConfig, getPromptRequest);
|
|
216
|
+
}
|
|
217
|
+
const output = {};
|
|
218
|
+
output['prompt'] = {
|
|
219
|
+
type: 'object',
|
|
220
|
+
value: getPromptResponse,
|
|
221
|
+
};
|
|
222
|
+
return output;
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
const { message } = getError(err);
|
|
226
|
+
if (context.executor === 'browser') {
|
|
227
|
+
throw new Error('Failed to create Client without a node executor');
|
|
228
|
+
}
|
|
229
|
+
console.log(message);
|
|
230
|
+
throw err;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
export const mcpGetPromptNode = nodeDefinition(MCPGetPromptNodeImpl, 'MCP Get Prompt');
|