@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,14 @@
|
|
|
1
|
+
/** Returns a number of milliseconds, strongly typed. */
|
|
2
|
+
export const ms = (numMilliseconds) => numMilliseconds;
|
|
3
|
+
/** Returns a number of seconds, as milliseconds. */
|
|
4
|
+
export const seconds = (numSeconds) => ms(numSeconds * 1000);
|
|
5
|
+
/** Returns a number of minutes, as milliseconds. */
|
|
6
|
+
export const minutes = (numMinutes) => seconds(numMinutes * 60);
|
|
7
|
+
/** Returns a number of hours, as milliseconds. */
|
|
8
|
+
export const hours = (numHours) => minutes(numHours * 60);
|
|
9
|
+
/** Returns a number of days, as milliseconds. */
|
|
10
|
+
export const days = (numDays) => hours(numDays * 24);
|
|
11
|
+
/** Returns a number of microseconds, strongly typed. To type a µ, press option+m on mac os. */
|
|
12
|
+
export const µs = (numMicroseconds) => numMicroseconds;
|
|
13
|
+
export const µsToMs = (numMicroseconds) => ms(numMicroseconds / 1000);
|
|
14
|
+
export const msToµs = (numMilliseconds) => µs(numMilliseconds * 1000);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-safe version of {@link Object.entries} which can infer the type for the keys in the
|
|
3
|
+
* returned pairs when the input object has a branded type as its key.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* type MyId = string & { __myIdBrand: unknown };
|
|
7
|
+
* // Types check out!
|
|
8
|
+
* const things: [MyId, Thing][] = Objects.entries({} as Record<MyId, Thing>);
|
|
9
|
+
*
|
|
10
|
+
* @see {@link fromEntries}
|
|
11
|
+
*/
|
|
12
|
+
export const entries = (
|
|
13
|
+
// In principle we should be able to use only Partial<> as the type is a superset of the non-
|
|
14
|
+
// Partial type, but in practice this causes the compiler to infer a too-restricted type for V
|
|
15
|
+
// in some cases involving unions.
|
|
16
|
+
object) => (object == null ? [] : Object.entries(object));
|
|
17
|
+
/**
|
|
18
|
+
* Type-safe version of {@link Object.fromEntries} which can infer the type for the key in the
|
|
19
|
+
* returned object when the input array has a branded type as its key.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* type MyId = string & { __myIdBrand: unknown };
|
|
23
|
+
* // Types check out!
|
|
24
|
+
* const things: Partial<Record<MyId, Thing>> = Objects.fromEntries([] as [MyId, Thing][]);
|
|
25
|
+
*
|
|
26
|
+
* @see {@link entries}
|
|
27
|
+
*/
|
|
28
|
+
// This returns a Partial<> because we can't guarantee that every key is present when K is a
|
|
29
|
+
// string literal union (which is what Record<K, V> would be saying). As a side effect, this means
|
|
30
|
+
// that using this with branded IDs will force null checks downstream, which is good practice.
|
|
31
|
+
export function fromEntries(entries_) {
|
|
32
|
+
return Object.fromEntries(entries_);
|
|
33
|
+
}
|
|
34
|
+
export function keys(o) {
|
|
35
|
+
return Object.keys(o);
|
|
36
|
+
}
|
|
37
|
+
export function values(o) {
|
|
38
|
+
return Object.values(o);
|
|
39
|
+
}
|
|
40
|
+
export function mapValues(o, fn) {
|
|
41
|
+
return Object.fromEntries(Object.entries(o).map(([key, value]) => [key, fn(value)]));
|
|
42
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
7
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
|
8
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
|
9
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
12
|
+
* the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
15
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
16
|
+
* OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
17
|
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
18
|
+
*/
|
|
19
|
+
// Copied straight from https://github.com/sindresorhus/fnv1a/blob/main/index.js
|
|
20
|
+
// with types added
|
|
21
|
+
const FNV_PRIMES = {
|
|
22
|
+
32: 16777619n,
|
|
23
|
+
64: 1099511628211n,
|
|
24
|
+
128: 309485009821345068724781371n,
|
|
25
|
+
256: 374144419156711147060143317175368453031918731002211n,
|
|
26
|
+
512: 35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,
|
|
27
|
+
1024: 5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n,
|
|
28
|
+
};
|
|
29
|
+
const FNV_OFFSETS = {
|
|
30
|
+
32: 2166136261n,
|
|
31
|
+
64: 14695981039346656037n,
|
|
32
|
+
128: 144066263297769815596495629667062367629n,
|
|
33
|
+
256: 100029257958052580907070968620625704837092796014241193945225284501741471925557n,
|
|
34
|
+
512: 9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,
|
|
35
|
+
1024: 14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n,
|
|
36
|
+
};
|
|
37
|
+
const cachedEncoder = new globalThis.TextEncoder();
|
|
38
|
+
function fnv1aUint8Array(uint8Array, size) {
|
|
39
|
+
const fnvPrime = FNV_PRIMES[size];
|
|
40
|
+
let hash = FNV_OFFSETS[size];
|
|
41
|
+
for (let index = 0; index < uint8Array.length; index++) {
|
|
42
|
+
hash ^= BigInt(uint8Array[index]);
|
|
43
|
+
hash = BigInt.asUintN(size, hash * fnvPrime);
|
|
44
|
+
}
|
|
45
|
+
return hash;
|
|
46
|
+
}
|
|
47
|
+
function fnv1aEncodeInto(string, size, utf8Buffer) {
|
|
48
|
+
if (utf8Buffer.length === 0) {
|
|
49
|
+
throw new Error('The `utf8Buffer` option must have a length greater than zero');
|
|
50
|
+
}
|
|
51
|
+
const fnvPrime = FNV_PRIMES[size];
|
|
52
|
+
let hash = FNV_OFFSETS[size];
|
|
53
|
+
let remaining = string;
|
|
54
|
+
while (remaining.length > 0) {
|
|
55
|
+
const result = cachedEncoder.encodeInto(remaining, utf8Buffer);
|
|
56
|
+
remaining = remaining.slice(result.read);
|
|
57
|
+
for (let index = 0; index < result.written; index++) {
|
|
58
|
+
hash ^= BigInt(utf8Buffer[index]);
|
|
59
|
+
hash = BigInt.asUintN(size, hash * fnvPrime);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return hash;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @param {string} value
|
|
66
|
+
* @param {{ size?: 32 | 64 | 128 | 256 | 512 | 1024, utf8Buffer?: Uint8Array }} options
|
|
67
|
+
* @returns {string}
|
|
68
|
+
*/
|
|
69
|
+
export default function fnv1a(value, { size = 32, utf8Buffer } = {}) {
|
|
70
|
+
if (!FNV_PRIMES[size]) {
|
|
71
|
+
throw new Error('The `size` option must be one of 32, 64, 128, 256, 512, or 1024');
|
|
72
|
+
}
|
|
73
|
+
if (typeof value === 'string') {
|
|
74
|
+
if (utf8Buffer) {
|
|
75
|
+
return fnv1aEncodeInto(value, size, utf8Buffer);
|
|
76
|
+
}
|
|
77
|
+
value = cachedEncoder.encode(value);
|
|
78
|
+
}
|
|
79
|
+
return fnv1aUint8Array(value, size);
|
|
80
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PascalCase } from 'type-fest';
|
|
2
|
+
import type { AttachedData } from '../utils/serialization/serializationUtils.js';
|
|
3
|
+
import type { AudioProvider } from '../integrations/AudioProvider.js';
|
|
4
|
+
import type { DataValue } from '../model/DataValue.js';
|
|
5
|
+
import type { DatasetProvider } from '../integrations/DatasetProvider.js';
|
|
6
|
+
import type { ExternalFunction, GraphProcessorConcurrency, ProcessEvents } from '../model/GraphProcessor.js';
|
|
7
|
+
import type { Project } from '../model/Project.js';
|
|
8
|
+
import type { MCPProvider } from '../integrations/mcp/MCPProvider.js';
|
|
9
|
+
import type { NativeApi } from '../native/NativeApi.js';
|
|
10
|
+
import type { NodeRegistration } from '../model/NodeRegistration.js';
|
|
11
|
+
import type { ProcessContext } from '../model/ProcessContext.js';
|
|
12
|
+
import type { RivetEventStreamFilterSpec } from './streaming.js';
|
|
13
|
+
import type { Settings } from '../model/Settings.js';
|
|
14
|
+
import { GraphProcessor } from '../model/GraphProcessor.js';
|
|
15
|
+
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
16
|
+
import { type LooseDataValue } from './looseDataValue.js';
|
|
17
|
+
import type { ProjectReferenceLoader } from '../model/ProjectReferenceLoader.js';
|
|
18
|
+
export type RunGraphOptions = {
|
|
19
|
+
graph?: string;
|
|
20
|
+
inputs?: Record<string, LooseDataValue>;
|
|
21
|
+
context?: Record<string, LooseDataValue>;
|
|
22
|
+
nativeApi?: NativeApi;
|
|
23
|
+
datasetProvider?: DatasetProvider;
|
|
24
|
+
audioProvider?: AudioProvider;
|
|
25
|
+
mcpProvider?: MCPProvider;
|
|
26
|
+
externalFunctions?: {
|
|
27
|
+
[key: string]: ExternalFunction;
|
|
28
|
+
};
|
|
29
|
+
onUserEvent?: {
|
|
30
|
+
[key: string]: (data: DataValue | undefined) => void;
|
|
31
|
+
};
|
|
32
|
+
abortSignal?: AbortSignal;
|
|
33
|
+
registry?: NodeRegistration<any, any>;
|
|
34
|
+
includeTrace?: boolean;
|
|
35
|
+
concurrency?: GraphProcessorConcurrency;
|
|
36
|
+
getChatNodeEndpoint?: ProcessContext['getChatNodeEndpoint'];
|
|
37
|
+
tokenizer?: Tokenizer;
|
|
38
|
+
codeRunner?: ProcessContext['codeRunner'];
|
|
39
|
+
projectPath?: string;
|
|
40
|
+
projectReferenceLoader?: ProjectReferenceLoader;
|
|
41
|
+
editorExecutionCache?: ProcessContext['editorExecutionCache'];
|
|
42
|
+
} & {
|
|
43
|
+
[P in keyof ProcessEvents as `on${PascalCase<P>}`]?: (params: ProcessEvents[P]) => void;
|
|
44
|
+
} & Settings;
|
|
45
|
+
export declare function coreCreateProcessor(project: Project, options: RunGraphOptions): {
|
|
46
|
+
processor: GraphProcessor;
|
|
47
|
+
inputs: Record<string, DataValue>;
|
|
48
|
+
contextValues: Record<string, DataValue>;
|
|
49
|
+
getEvents: (spec: RivetEventStreamFilterSpec) => AsyncGenerator<import("./streaming.js").RivetEventStreamEventInfo, void, any>;
|
|
50
|
+
getSSEStream: (spec: RivetEventStreamFilterSpec) => ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
51
|
+
streamNode: (nodeIdOrTitle: string) => ReadableStream<string>;
|
|
52
|
+
run(): Promise<import("../model/GraphProcessor.js").GraphOutputs>;
|
|
53
|
+
};
|
|
54
|
+
export declare function coreRunGraph(project: Project, options: RunGraphOptions): Promise<Record<string, DataValue>>;
|
|
55
|
+
export declare function loadProjectFromString(content: string): Project;
|
|
56
|
+
export declare function loadProjectAndAttachedDataFromString(content: string): [Project, AttachedData];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DataValue } from '../model/DataValue.js';
|
|
2
|
+
export type LooseDataValue = DataValue | string | number | boolean;
|
|
3
|
+
export declare function looseDataValuesToDataValues(values: Record<string, LooseDataValue>): Record<string, DataValue>;
|
|
4
|
+
export declare function looseDataValueToDataValue(value: LooseDataValue): DataValue;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Settings } from '../model/Settings.js';
|
|
2
|
+
type ProcessSettingsFallbacks = Pick<Settings, 'openAiKey' | 'openAiOrganization' | 'openAiEndpoint' | 'pluginEnv'>;
|
|
3
|
+
export declare function resolveProcessSettings(settings?: Settings, fallbacks?: Partial<ProcessSettingsFallbacks>): Required<Settings>;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type NodeId, type Inputs, type Outputs, type GraphOutputs, type GraphProcessor } from '../index.js';
|
|
2
|
+
export type RivetEventStreamFilterSpec = {
|
|
3
|
+
/** Stream partial output deltas for the specified node IDs or node titles. */
|
|
4
|
+
partialOutputs?: string[] | true;
|
|
5
|
+
/** Send the graph output when done? */
|
|
6
|
+
done?: boolean;
|
|
7
|
+
/** If the graph errors, send an error event? */
|
|
8
|
+
error?: boolean;
|
|
9
|
+
/** Stream node start events for the specified node IDs or node titles. */
|
|
10
|
+
nodeStart?: string[] | true;
|
|
11
|
+
/** Stream node finish events for the specified nodeIDs or node titles. */
|
|
12
|
+
nodeFinish?: string[] | true;
|
|
13
|
+
};
|
|
14
|
+
/** Map of all possible event names to their data for streaming events. */
|
|
15
|
+
export type RivetEventStreamEvent = {
|
|
16
|
+
/** Deltas for partial outputs. */
|
|
17
|
+
partialOutput: {
|
|
18
|
+
nodeId: NodeId;
|
|
19
|
+
nodeTitle: string;
|
|
20
|
+
delta: string;
|
|
21
|
+
};
|
|
22
|
+
nodeStart: {
|
|
23
|
+
nodeId: NodeId;
|
|
24
|
+
nodeTitle: string;
|
|
25
|
+
inputs: Inputs;
|
|
26
|
+
};
|
|
27
|
+
nodeFinish: {
|
|
28
|
+
nodeId: NodeId;
|
|
29
|
+
nodeTitle: string;
|
|
30
|
+
outputs: Outputs;
|
|
31
|
+
};
|
|
32
|
+
done: {
|
|
33
|
+
graphOutput: GraphOutputs;
|
|
34
|
+
};
|
|
35
|
+
error: {
|
|
36
|
+
error: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type RivetEventStreamEventInfo = {
|
|
40
|
+
[P in keyof RivetEventStreamEvent]: {
|
|
41
|
+
type: P;
|
|
42
|
+
} & RivetEventStreamEvent[P];
|
|
43
|
+
}[keyof RivetEventStreamEvent];
|
|
44
|
+
/** A simplified way to listen and stream processor events, including filtering. */
|
|
45
|
+
export declare function getProcessorEvents(processor: GraphProcessor, spec: RivetEventStreamFilterSpec): AsyncGenerator<RivetEventStreamEventInfo, void>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a ReadableStream for processor events, following the Server-Sent Events protocol.
|
|
48
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/EventSource
|
|
49
|
+
*
|
|
50
|
+
* Includes configuration for what events to send to the client, for example you can stream the partial output deltas
|
|
51
|
+
* for specific nodes, and/or the graph output when done.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getProcessorSSEStream(processor: GraphProcessor,
|
|
54
|
+
/** The spec for what you're streaming to the client */
|
|
55
|
+
spec: RivetEventStreamFilterSpec): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
56
|
+
export declare function getSingleNodeStream(processor: GraphProcessor, nodeIdOrTitle: string): ReadableStream<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export * from './utils/index.js';
|
|
2
|
+
export * from './model/GraphProcessor.js';
|
|
3
|
+
export * from './model/DataValue.js';
|
|
4
|
+
export * from './model/NodeBase.js';
|
|
5
|
+
export * from './model/NodeGraph.js';
|
|
6
|
+
export * from './model/NodeImpl.js';
|
|
7
|
+
export * from './model/NodeDefinition.js';
|
|
8
|
+
export * from './model/Nodes.js';
|
|
9
|
+
export * from './model/Project.js';
|
|
10
|
+
export * from './native/BaseDir.js';
|
|
11
|
+
export * from './native/NativeApi.js';
|
|
12
|
+
export * from './native/BrowserNativeApi.js';
|
|
13
|
+
export * from './model/ProcessContext.js';
|
|
14
|
+
export * from './model/ProjectReferenceLoader.js';
|
|
15
|
+
export * from './model/RivetUIContext.js';
|
|
16
|
+
export * from './model/chat-v2/index.js';
|
|
17
|
+
export * from './integrations/integrations.js';
|
|
18
|
+
import './integrations/enableIntegrations.js';
|
|
19
|
+
export * from './integrations/VectorDatabase.js';
|
|
20
|
+
export * from './integrations/mcp/MCPProvider.js';
|
|
21
|
+
export * from './integrations/EmbeddingGenerator.js';
|
|
22
|
+
export * from './integrations/LLMProvider.js';
|
|
23
|
+
export * from './recording/ExecutionRecorder.js';
|
|
24
|
+
export * from './recording/RecordedEvents.js';
|
|
25
|
+
export * from './model/RivetPlugin.js';
|
|
26
|
+
export * from './model/PluginLoadSpec.js';
|
|
27
|
+
export * from './plugins.js';
|
|
28
|
+
export * from './model/NodeRegistration.js';
|
|
29
|
+
export * from './model/RegistryAssembly.js';
|
|
30
|
+
export type * from './model/Settings.js';
|
|
31
|
+
export * from './model/EditorDefinition.js';
|
|
32
|
+
export * from './model/NodeBodySpec.js';
|
|
33
|
+
export * from './model/interpolationInputDefinition.js';
|
|
34
|
+
export * from './integrations/DatasetProvider.js';
|
|
35
|
+
export * from './model/Dataset.js';
|
|
36
|
+
export type { DatasetRequestMap, DatasetRequestMessage, DatasetRequestPayload, CodeConsoleLevel, CodeConsoleMessage, GraphUploadAllowedMessage, IncomingMessage, OutgoingMessage, OutgoingMessageMap, ProcessEventMessage, ProcessEventMessageMap, RemoteRunRequestId, SerializedProcessEventMap, } from './model/ExecutorProtocol.js';
|
|
37
|
+
export * from './api/streaming.js';
|
|
38
|
+
export * from './api/createProcessor.js';
|
|
39
|
+
export * from './api/processSettings.js';
|
|
40
|
+
export * from './integrations/AudioProvider.js';
|
|
41
|
+
export * from './api/looseDataValue.js';
|
|
42
|
+
export * from './integrations/CodeRunner.js';
|
|
43
|
+
export * from './integrations/Tokenizer.js';
|
|
44
|
+
export * from './integrations/GptTokenizerTokenizer.js';
|
|
45
|
+
export { JS_LIST_CALLBACK_LOCAL_NAMES, interpolateJSListCallbackBody } from './model/nodes/jsListCallbackHelpers.js';
|
|
46
|
+
export { extractInterpolationVariables, findInterpolationTokenSpans, getInterpolationTokenName, interpolate, protectEscapedInterpolationTokens, restoreEscapedInterpolationTokens, } from './utils/interpolation.js';
|
|
47
|
+
export { WarningsPort } from './utils/symbols.js';
|
|
48
|
+
import * as openai from './utils/openai.js';
|
|
49
|
+
export { openai };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Inputs, Outputs } from '../index.js';
|
|
2
|
+
import type { DataValue } from '../model/DataValue.js';
|
|
3
|
+
export interface CodeRunnerOptions {
|
|
4
|
+
includeRequire: boolean;
|
|
5
|
+
includeFetch: boolean;
|
|
6
|
+
includeRivet: boolean;
|
|
7
|
+
includeProcess: boolean;
|
|
8
|
+
includeConsole: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** An object that can run arbitrary code (evals it). */
|
|
11
|
+
export interface CodeRunner {
|
|
12
|
+
runCode: (code: string, inputs: Inputs, options: CodeRunnerOptions, graphInputs?: Record<string, DataValue>, contextValues?: Record<string, DataValue>) => Promise<Outputs>;
|
|
13
|
+
}
|
|
14
|
+
export declare class IsomorphicCodeRunner implements CodeRunner {
|
|
15
|
+
runCode(code: string, inputs: Inputs, options: CodeRunnerOptions, graphInputs?: Record<string, DataValue>, contextValues?: Record<string, DataValue>): Promise<Outputs>;
|
|
16
|
+
}
|
|
17
|
+
export declare class NotAllowedCodeRunner implements CodeRunner {
|
|
18
|
+
runCode(_code: string, _inputs: Inputs, _options: CodeRunnerOptions, _graphInputs?: Record<string, DataValue>, _contextValues?: Record<string, DataValue>): Promise<Outputs>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Dataset, type DatasetId, type DatasetMetadata, type DatasetRow, type ProjectId } from '../index.js';
|
|
2
|
+
import type { CombinedDataset } from '../utils/index.js';
|
|
3
|
+
export interface DatasetProvider {
|
|
4
|
+
getDatasetMetadata(id: DatasetId): Promise<DatasetMetadata | undefined>;
|
|
5
|
+
getDatasetsForProject(projectId: ProjectId): Promise<DatasetMetadata[]>;
|
|
6
|
+
getDatasetData(id: DatasetId): Promise<Dataset>;
|
|
7
|
+
putDatasetData(id: DatasetId, data: Dataset): Promise<void>;
|
|
8
|
+
putDatasetRow(id: DatasetId, row: DatasetRow): Promise<void>;
|
|
9
|
+
putDatasetMetadata(metadata: DatasetMetadata): Promise<void>;
|
|
10
|
+
clearDatasetData(id: DatasetId): Promise<void>;
|
|
11
|
+
deleteDataset(id: DatasetId): Promise<void>;
|
|
12
|
+
/** Gets the K nearest neighbor rows to the given vector. */
|
|
13
|
+
knnDatasetRows(datasetId: DatasetId, k: number, vector: number[]): Promise<(DatasetRow & {
|
|
14
|
+
distance?: number;
|
|
15
|
+
})[]>;
|
|
16
|
+
exportDatasetsForProject(projectId: ProjectId): Promise<CombinedDataset[]>;
|
|
17
|
+
}
|
|
18
|
+
export declare class InMemoryDatasetProvider implements DatasetProvider {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(datasets: CombinedDataset[]);
|
|
21
|
+
getDatasetMetadata(id: DatasetId): Promise<DatasetMetadata | undefined>;
|
|
22
|
+
getDatasetsForProject(): Promise<DatasetMetadata[]>;
|
|
23
|
+
getDatasetData(id: DatasetId): Promise<Dataset>;
|
|
24
|
+
putDatasetRow(id: DatasetId, row: DatasetRow): Promise<void>;
|
|
25
|
+
putDatasetData(id: DatasetId, data: Dataset): Promise<void>;
|
|
26
|
+
putDatasetMetadata(metadata: DatasetMetadata): Promise<void>;
|
|
27
|
+
clearDatasetData(id: DatasetId): Promise<void>;
|
|
28
|
+
deleteDataset(id: DatasetId): Promise<void>;
|
|
29
|
+
knnDatasetRows(datasetId: DatasetId, k: number, vector: number[]): Promise<(DatasetRow & {
|
|
30
|
+
distance?: number | undefined;
|
|
31
|
+
})[]>;
|
|
32
|
+
exportDatasetsForProject(_projectId: ProjectId): Promise<CombinedDataset[]>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChatMessage, type GptFunction } from '../index.js';
|
|
2
|
+
import type { Tokenizer, TokenizerCallInfo } from './Tokenizer.js';
|
|
3
|
+
import Emittery from 'emittery';
|
|
4
|
+
export declare class GptTokenizerTokenizer implements Tokenizer {
|
|
5
|
+
emitter: Emittery<{
|
|
6
|
+
error: Error;
|
|
7
|
+
}, {
|
|
8
|
+
error: Error;
|
|
9
|
+
} & import("emittery").OmnipresentEventData, never>;
|
|
10
|
+
on(event: 'error', listener: (err: Error) => void): () => void;
|
|
11
|
+
getTokenCountForString(input: string, _info: TokenizerCallInfo): Promise<number>;
|
|
12
|
+
getTokenCountForMessages(messages: ChatMessage[], functions: GptFunction[] | undefined, _info: TokenizerCallInfo): Promise<number>;
|
|
13
|
+
/**
|
|
14
|
+
* Converts GPT Functions to approximate TypeScript-style string.
|
|
15
|
+
* Per thread: https://community.openai.com/t/how-to-calculate-the-tokens-when-using-function-call/266573/24
|
|
16
|
+
* We should consider using a different library, eg. https://github.com/hmarr/openai-chat-tokens
|
|
17
|
+
* @param functions
|
|
18
|
+
*/
|
|
19
|
+
private convertGptFunctionsToPromptString;
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ArrayDataValue, type ChatMessageDataValue } from '../model/DataValue.js';
|
|
2
|
+
export type LLMParameters = {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export interface LLMProvider {
|
|
6
|
+
getCompletions(messages: ArrayDataValue<ChatMessageDataValue>, parameters: LLMParameters): Promise<ArrayDataValue<ChatMessageDataValue>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChartNode, ChatMessage, GptFunction } from '../index.js';
|
|
2
|
+
export type TokenizerCallInfo = {
|
|
3
|
+
node: ChartNode;
|
|
4
|
+
model?: string;
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
};
|
|
7
|
+
export type Tokenizer = {
|
|
8
|
+
on(event: 'error', listener: (err: Error) => void): void | (() => void);
|
|
9
|
+
getTokenCountForString(input: string, info: TokenizerCallInfo): Promise<number>;
|
|
10
|
+
getTokenCountForMessages(messages: ChatMessage[], gptFunctions: GptFunction[] | undefined, info: TokenizerCallInfo): Promise<number>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DataValue, type VectorDataValue, type ArrayDataValue, type ScalarDataValue } from '../model/DataValue.js';
|
|
2
|
+
export interface VectorDatabase {
|
|
3
|
+
store(collection: DataValue, vector: VectorDataValue, data: DataValue, metadata: {
|
|
4
|
+
id?: string;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
nearestNeighbors(collection: DataValue, vector: VectorDataValue, k: number): Promise<ArrayDataValue<ScalarDataValue>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type InternalProcessContext } from '../model/ProcessContext.js';
|
|
2
|
+
import { type EmbeddingGenerator } from './EmbeddingGenerator.js';
|
|
3
|
+
import { type LLMProvider } from './LLMProvider.js';
|
|
4
|
+
import { type VectorDatabase } from './VectorDatabase.js';
|
|
5
|
+
export type IntegrationFactories = {
|
|
6
|
+
vectorDatabase: (context: InternalProcessContext) => VectorDatabase;
|
|
7
|
+
llmProvider: (context: InternalProcessContext) => LLMProvider;
|
|
8
|
+
embeddingGenerator: (context: InternalProcessContext) => EmbeddingGenerator;
|
|
9
|
+
};
|
|
10
|
+
export type IntegrationType = keyof IntegrationFactories;
|
|
11
|
+
export declare function registerIntegration<T extends IntegrationType>(type: T, integrationKey: string, factory: IntegrationFactories[T]): void;
|
|
12
|
+
export declare function getIntegration<T extends IntegrationType>(type: T, integrationKey: string, context: InternalProcessContext): ReturnType<IntegrationFactories[T]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EditorDefinition } from '../../model/EditorDefinition.js';
|
|
2
|
+
import type { ChartNode, NodeInputDefinition } from '../../model/NodeBase.js';
|
|
3
|
+
import type { RivetUIContext } from '../../model/RivetUIContext.js';
|
|
4
|
+
import type { MCP } from './MCPProvider.js';
|
|
5
|
+
export interface MCPBaseNodeData {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
transportType: MCP.TransportType;
|
|
9
|
+
serverUrl?: string;
|
|
10
|
+
serverId?: string;
|
|
11
|
+
useNameInput?: boolean;
|
|
12
|
+
useVersionInput?: boolean;
|
|
13
|
+
useServerUrlInput?: boolean;
|
|
14
|
+
useServerIdInput?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type MCPBaseNode = ChartNode<'mcpBase', MCPBaseNodeData>;
|
|
17
|
+
export declare const getMCPBaseInputs: (data: MCPBaseNodeData) => NodeInputDefinition[];
|
|
18
|
+
export declare const getMCPBaseEditors: (context: RivetUIContext, data: MCPBaseNodeData) => Promise<EditorDefinition<MCPBaseNode>[]>;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from types here - https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/types.ts
|
|
3
|
+
*/
|
|
4
|
+
export declare namespace MCP {
|
|
5
|
+
export type TransportType = 'stdio' | 'http';
|
|
6
|
+
export interface ServerConfig {
|
|
7
|
+
command: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
env?: Record<string, string>;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
alwaysAllow?: string[];
|
|
12
|
+
}
|
|
13
|
+
export type ServerConfigWithId = {
|
|
14
|
+
config: ServerConfig;
|
|
15
|
+
serverId: string;
|
|
16
|
+
};
|
|
17
|
+
export interface Config {
|
|
18
|
+
mcpServers: Record<string, ServerConfig>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Tools
|
|
22
|
+
*/
|
|
23
|
+
interface ToolAnnotations {
|
|
24
|
+
title?: string;
|
|
25
|
+
readOnlyHint?: boolean;
|
|
26
|
+
destructiveHint?: boolean;
|
|
27
|
+
idempotentHint?: boolean;
|
|
28
|
+
openWorldHint?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface Tool {
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
inputSchema: {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
annotations?: ToolAnnotations;
|
|
37
|
+
}
|
|
38
|
+
export interface ToolCallRequest {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
name: string;
|
|
41
|
+
arguments?: {
|
|
42
|
+
[x: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
id?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ToolCallResponse {
|
|
47
|
+
content: ResponseContent[];
|
|
48
|
+
isError?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Prompts
|
|
52
|
+
*/
|
|
53
|
+
interface PromptArgument {
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
required?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface Prompt {
|
|
59
|
+
name: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
arugments?: PromptArgument[];
|
|
62
|
+
}
|
|
63
|
+
export interface GetPromptRequest {
|
|
64
|
+
[x: string]: unknown;
|
|
65
|
+
name: string;
|
|
66
|
+
arguments?: {
|
|
67
|
+
[x: string]: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface PromptMessage {
|
|
71
|
+
role: 'user' | 'assistant';
|
|
72
|
+
content: ResponseContent;
|
|
73
|
+
}
|
|
74
|
+
export interface GetPromptResponse {
|
|
75
|
+
messages: PromptMessage[];
|
|
76
|
+
description?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Content
|
|
80
|
+
*/
|
|
81
|
+
interface BaseContent {
|
|
82
|
+
type: 'text' | 'image' | 'audio';
|
|
83
|
+
}
|
|
84
|
+
interface TextContent extends BaseContent {
|
|
85
|
+
type: 'text';
|
|
86
|
+
text: string;
|
|
87
|
+
}
|
|
88
|
+
interface ImageContent extends BaseContent {
|
|
89
|
+
type: 'image';
|
|
90
|
+
data: string;
|
|
91
|
+
mimeType: string;
|
|
92
|
+
}
|
|
93
|
+
interface AudioContent extends BaseContent {
|
|
94
|
+
type: 'audio';
|
|
95
|
+
data: string;
|
|
96
|
+
mimeType: string;
|
|
97
|
+
}
|
|
98
|
+
type ResponseContent = TextContent | ImageContent | AudioContent | {
|
|
99
|
+
[key: string]: unknown;
|
|
100
|
+
};
|
|
101
|
+
export {};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Errors
|
|
105
|
+
*/
|
|
106
|
+
export declare enum MCPErrorType {
|
|
107
|
+
CONFIG_NOT_FOUND = "CONFIG_NOT_FOUND",
|
|
108
|
+
SERVER_NOT_FOUND = "SERVER_NOT_FOUND",
|
|
109
|
+
SERVER_COMMUNICATION_FAILED = "SERVER_COMMUNICATION_FAILED",
|
|
110
|
+
INVALID_SCHEMA = "INVALID_SCHEMA"
|
|
111
|
+
}
|
|
112
|
+
export declare class MCPError extends Error {
|
|
113
|
+
type: MCPErrorType;
|
|
114
|
+
details?: unknown | undefined;
|
|
115
|
+
constructor(type: MCPErrorType, message: string, details?: unknown | undefined);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* MCP Provider for Node Implementation
|
|
119
|
+
*/
|
|
120
|
+
export interface MCPProvider {
|
|
121
|
+
getHTTPTools(clientConfig: {
|
|
122
|
+
name: string;
|
|
123
|
+
version: string;
|
|
124
|
+
}, serverUrl: string): Promise<MCP.Tool[]>;
|
|
125
|
+
getStdioTools(clientConfig: {
|
|
126
|
+
name: string;
|
|
127
|
+
version: string;
|
|
128
|
+
}, serverConfig: MCP.ServerConfigWithId): Promise<MCP.Tool[]>;
|
|
129
|
+
getHTTPPrompts(clientConfig: {
|
|
130
|
+
name: string;
|
|
131
|
+
version: string;
|
|
132
|
+
}, serverUrl: string): Promise<MCP.Prompt[]>;
|
|
133
|
+
getStdioPrompts(clientConfig: {
|
|
134
|
+
name: string;
|
|
135
|
+
version: string;
|
|
136
|
+
}, serverConfig: MCP.ServerConfigWithId): Promise<MCP.Prompt[]>;
|
|
137
|
+
httpToolCall(clientConfig: {
|
|
138
|
+
name: string;
|
|
139
|
+
version: string;
|
|
140
|
+
}, serverUrl: string, toolCall: MCP.ToolCallRequest): Promise<MCP.ToolCallResponse>;
|
|
141
|
+
stdioToolCall(clientConfig: {
|
|
142
|
+
name: string;
|
|
143
|
+
version: string;
|
|
144
|
+
}, serverConfig: MCP.ServerConfigWithId, toolCall: MCP.ToolCallRequest): Promise<MCP.ToolCallResponse>;
|
|
145
|
+
getHTTPrompt(clientConfig: {
|
|
146
|
+
name: string;
|
|
147
|
+
version: string;
|
|
148
|
+
}, serverUrl: string, getPromptRequest: MCP.GetPromptRequest): Promise<MCP.GetPromptResponse>;
|
|
149
|
+
getStdioPrompt(clientConfig: {
|
|
150
|
+
name: string;
|
|
151
|
+
version: string;
|
|
152
|
+
}, serverConfig: MCP.ServerConfigWithId, getPromptRequest: MCP.GetPromptRequest): Promise<MCP.GetPromptResponse>;
|
|
153
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InternalProcessContext } from '../../model/ProcessContext.js';
|
|
2
|
+
import type { RivetUIContext } from '../../model/RivetUIContext.js';
|
|
3
|
+
import { type MCP } from './MCPProvider.js';
|
|
4
|
+
export declare const loadMCPConfiguration: (context: InternalProcessContext | RivetUIContext) => Promise<MCP.Config>;
|
|
5
|
+
export declare const getServerOptions: (context: RivetUIContext) => Promise<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[]>;
|
|
9
|
+
export declare const getServerHelperMessage: (context: RivetUIContext, optionsLength: number) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Settings } from '../../index.js';
|
|
2
|
+
import { type EmbeddingGenerator } from '../EmbeddingGenerator.js';
|
|
3
|
+
import { OpenAI } from 'openai';
|
|
4
|
+
type OpenAIOptions = Pick<OpenAI.EmbeddingCreateParams, 'model' | 'dimensions'>;
|
|
5
|
+
export declare class OpenAIEmbeddingGenerator implements EmbeddingGenerator {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(settings: Settings);
|
|
8
|
+
generateEmbedding(text: string, options?: OpenAIOptions): Promise<number[]>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|