@alpic80/rivet-core 1.19.1-aidon.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +176 -0
- package/dist/cjs/bundle.cjs +18915 -0
- package/dist/cjs/bundle.cjs.map +7 -0
- package/dist/esm/api/createProcessor.js +131 -0
- package/dist/esm/api/streaming.js +116 -0
- package/dist/esm/exports.js +32 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/integrations/AudioProvider.js +1 -0
- package/dist/esm/integrations/DatasetProvider.js +92 -0
- package/dist/esm/integrations/EmbeddingGenerator.js +1 -0
- package/dist/esm/integrations/GptTokenizerTokenizer.js +65 -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/openai/OpenAIEmbeddingGenerator.js +23 -0
- package/dist/esm/model/DataValue.js +176 -0
- package/dist/esm/model/Dataset.js +1 -0
- package/dist/esm/model/EditorDefinition.js +1 -0
- package/dist/esm/model/GraphProcessor.js +1198 -0
- package/dist/esm/model/NodeBase.js +1 -0
- package/dist/esm/model/NodeBodySpec.js +1 -0
- package/dist/esm/model/NodeDefinition.js +12 -0
- package/dist/esm/model/NodeGraph.js +14 -0
- package/dist/esm/model/NodeImpl.js +49 -0
- package/dist/esm/model/NodeRegistration.js +144 -0
- package/dist/esm/model/Nodes.js +227 -0
- package/dist/esm/model/PluginLoadSpec.js +1 -0
- package/dist/esm/model/ProcessContext.js +1 -0
- package/dist/esm/model/Project.js +2 -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/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 +199 -0
- package/dist/esm/model/nodes/AssemblePromptNode.js +129 -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 +136 -0
- package/dist/esm/model/nodes/ChatNode.js +964 -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 +136 -0
- package/dist/esm/model/nodes/CommentNode.js +69 -0
- package/dist/esm/model/nodes/CompareNode.js +138 -0
- package/dist/esm/model/nodes/ContextNode.js +99 -0
- package/dist/esm/model/nodes/CreateDatasetNode.js +71 -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 +136 -0
- package/dist/esm/model/nodes/DestructureNode.js +86 -0
- package/dist/esm/model/nodes/EvaluateNode.js +141 -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 +128 -0
- package/dist/esm/model/nodes/ExtractRegexNode.js +201 -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/GptFunctionNode.js +169 -0
- package/dist/esm/model/nodes/GraphInputNode.js +130 -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 +257 -0
- package/dist/esm/model/nodes/IfElseNode.js +138 -0
- package/dist/esm/model/nodes/IfNode.js +124 -0
- package/dist/esm/model/nodes/ImageNode.js +107 -0
- package/dist/esm/model/nodes/JoinNode.js +135 -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/MatchNode.js +137 -0
- package/dist/esm/model/nodes/NumberNode.js +86 -0
- package/dist/esm/model/nodes/ObjectNode.js +121 -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 +227 -0
- package/dist/esm/model/nodes/RaceInputsNode.js +86 -0
- package/dist/esm/model/nodes/RaiseEventNode.js +84 -0
- package/dist/esm/model/nodes/RandomNumberNode.js +106 -0
- package/dist/esm/model/nodes/ReadDirectoryNode.js +165 -0
- package/dist/esm/model/nodes/ReadFileNode.js +114 -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 +100 -0
- package/dist/esm/model/nodes/SplitNode.js +101 -0
- package/dist/esm/model/nodes/SubGraphNode.js +181 -0
- package/dist/esm/model/nodes/TextNode.js +97 -0
- package/dist/esm/model/nodes/ToJsonNode.js +78 -0
- package/dist/esm/model/nodes/ToYamlNode.js +68 -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 +111 -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/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/aidon/index.js +2 -0
- package/dist/esm/plugins/aidon/nodes/ChatAidonNode.js +215 -0
- package/dist/esm/plugins/aidon/plugin.js +9 -0
- package/dist/esm/plugins/anthropic/anthropic.js +187 -0
- package/dist/esm/plugins/anthropic/fetchEventSource.js +106 -0
- package/dist/esm/plugins/anthropic/index.js +2 -0
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +652 -0
- package/dist/esm/plugins/anthropic/plugin.js +18 -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 +125 -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 +2 -0
- package/dist/esm/plugins/gentrace/plugin.js +192 -0
- package/dist/esm/plugins/google/google.js +60 -0
- package/dist/esm/plugins/google/index.js +2 -0
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +364 -0
- package/dist/esm/plugins/google/plugin.js +32 -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 +145 -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 +21 -0
- package/dist/esm/recording/ExecutionRecorder.js +177 -0
- package/dist/esm/recording/RecordedEvents.js +1 -0
- package/dist/esm/utils/assertNever.js +3 -0
- package/dist/esm/utils/base64.js +25 -0
- package/dist/esm/utils/chatMessageToOpenAIChatCompletionMessage.js +60 -0
- package/dist/esm/utils/coerceType.js +322 -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/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 +14 -0
- package/dist/esm/utils/inputs.js +16 -0
- package/dist/esm/utils/interpolation.js +6 -0
- package/dist/esm/utils/misc.js +1 -0
- package/dist/esm/utils/newId.js +4 -0
- package/dist/esm/utils/openai.js +219 -0
- package/dist/esm/utils/outputs.js +14 -0
- package/dist/esm/utils/serialization/serialization.js +86 -0
- package/dist/esm/utils/serialization/serializationUtils.js +13 -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 +145 -0
- package/dist/esm/utils/serialization/serialization_v4.js +200 -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/types/api/createProcessor.d.ts +37 -0
- package/dist/types/api/streaming.d.ts +56 -0
- package/dist/types/exports.d.ts +33 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/integrations/AudioProvider.d.ts +4 -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/openai/OpenAIEmbeddingGenerator.d.ts +10 -0
- package/dist/types/model/DataValue.d.ts +138 -0
- package/dist/types/model/Dataset.d.ts +19 -0
- package/dist/types/model/EditorDefinition.d.ts +142 -0
- package/dist/types/model/GraphProcessor.d.ts +192 -0
- package/dist/types/model/NodeBase.d.ts +110 -0
- package/dist/types/model/NodeBodySpec.d.ts +19 -0
- package/dist/types/model/NodeDefinition.d.ts +13 -0
- package/dist/types/model/NodeGraph.d.ts +15 -0
- package/dist/types/model/NodeImpl.d.ts +55 -0
- package/dist/types/model/NodeRegistration.d.ts +24 -0
- package/dist/types/model/Nodes.d.ts +84 -0
- package/dist/types/model/PluginLoadSpec.d.ts +17 -0
- package/dist/types/model/ProcessContext.d.ts +69 -0
- package/dist/types/model/Project.d.ts +17 -0
- package/dist/types/model/RivetPlugin.d.ts +45 -0
- package/dist/types/model/RivetUIContext.d.ts +18 -0
- package/dist/types/model/Settings.d.ts +15 -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 +20 -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/ChatNode.d.ts +77 -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 +21 -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/DatasetNearestNeigborsNode.d.ts +19 -0
- package/dist/types/model/nodes/DelayNode.d.ts +20 -0
- package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +25 -0
- package/dist/types/model/nodes/DestructureNode.d.ts +18 -0
- package/dist/types/model/nodes/EvaluateNode.d.ts +19 -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 +19 -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/GptFunctionNode.d.ts +25 -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 +27 -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/JoinNode.d.ts +21 -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/MatchNode.d.ts +19 -0
- package/dist/types/model/nodes/NumberNode.d.ts +21 -0
- package/dist/types/model/nodes/ObjectNode.d.ts +18 -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 +23 -0
- package/dist/types/model/nodes/RaceInputsNode.d.ts +17 -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/ReadDirectoryNode.d.ts +30 -0
- package/dist/types/model/nodes/ReadFileNode.d.ts +23 -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 +18 -0
- package/dist/types/model/nodes/ToJsonNode.d.ts +18 -0
- package/dist/types/model/nodes/ToYamlNode.d.ts +13 -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 +21 -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/native/BaseDir.d.ts +29 -0
- package/dist/types/native/BrowserNativeApi.d.ts +11 -0
- package/dist/types/native/NativeApi.d.ts +17 -0
- package/dist/types/plugins/aidon/index.d.ts +2 -0
- package/dist/types/plugins/aidon/nodes/ChatAidonNode.d.ts +3 -0
- package/dist/types/plugins/aidon/plugin.d.ts +2 -0
- package/dist/types/plugins/anthropic/anthropic.d.ts +216 -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 +30 -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 +5 -0
- package/dist/types/plugins/google/google.d.ts +60 -0
- package/dist/types/plugins/google/index.d.ts +2 -0
- package/dist/types/plugins/google/nodes/ChatGoogleNode.d.ts +27 -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 +20 -0
- package/dist/types/recording/ExecutionRecorder.d.ts +25 -0
- package/dist/types/recording/RecordedEvents.d.ts +100 -0
- package/dist/types/utils/assertNever.d.ts +1 -0
- package/dist/types/utils/base64.d.ts +2 -0
- package/dist/types/utils/chatMessageToOpenAIChatCompletionMessage.d.ts +3 -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/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 +14 -0
- package/dist/types/utils/inputs.d.ts +3 -0
- package/dist/types/utils/interpolation.d.ts +1 -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 +739 -0
- package/dist/types/utils/outputs.d.ts +3 -0
- package/dist/types/utils/serialization/serialization.d.ts +12 -0
- package/dist/types/utils/serialization/serializationUtils.d.ts +6 -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/package.json +97 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {} from '../NodeBase.js';
|
|
2
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
3
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
4
|
+
import {} from '../GraphProcessor.js';
|
|
5
|
+
import {} from '../../index.js';
|
|
6
|
+
import { nodeDefinition } from '../../model/NodeDefinition.js';
|
|
7
|
+
import { getInputOrData } from '../../utils/index.js';
|
|
8
|
+
export class UrlReferenceNodeImpl extends NodeImpl {
|
|
9
|
+
static create() {
|
|
10
|
+
const chartNode = {
|
|
11
|
+
type: 'urlReference',
|
|
12
|
+
title: 'URL Reference',
|
|
13
|
+
id: nanoid(),
|
|
14
|
+
visualData: {
|
|
15
|
+
x: 0,
|
|
16
|
+
y: 0,
|
|
17
|
+
width: 225,
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
url: '',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return chartNode;
|
|
24
|
+
}
|
|
25
|
+
getInputDefinitions() {
|
|
26
|
+
const inputs = [];
|
|
27
|
+
if (this.data.useUrlInput) {
|
|
28
|
+
inputs.push({
|
|
29
|
+
dataType: 'string',
|
|
30
|
+
id: 'url',
|
|
31
|
+
title: 'URL',
|
|
32
|
+
description: 'The value to convert into a URL reference.',
|
|
33
|
+
coerced: true,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return inputs;
|
|
37
|
+
}
|
|
38
|
+
getOutputDefinitions() {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
dataType: 'object',
|
|
42
|
+
id: 'urlReference',
|
|
43
|
+
title: 'URL Reference',
|
|
44
|
+
description: 'A reference to a URL.',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
getEditors() {
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
type: 'string',
|
|
52
|
+
label: 'URL',
|
|
53
|
+
dataKey: 'url',
|
|
54
|
+
useInputToggleDataKey: 'useUrlInput',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
static getUIData() {
|
|
59
|
+
return {
|
|
60
|
+
contextMenuTitle: 'URL Reference',
|
|
61
|
+
group: 'Data',
|
|
62
|
+
infoBoxTitle: 'URL Reference Node',
|
|
63
|
+
infoBoxBody: 'Defines a reference to a URL, or converts a string into a URL reference. Used with the Assemble Message node to define URLs for attachments/images.',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
getBody() {
|
|
67
|
+
return this.data.useUrlInput ? '(URL Using Input)' : this.data.url;
|
|
68
|
+
}
|
|
69
|
+
async process(inputs) {
|
|
70
|
+
const url = getInputOrData(this.data, inputs, 'url', 'string');
|
|
71
|
+
return {
|
|
72
|
+
['urlReference']: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
value: { type: 'url_reference', url },
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export const urlReferenceNode = nodeDefinition(UrlReferenceNodeImpl, 'URL Reference');
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
2
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
3
|
+
import { zip } from 'lodash-es';
|
|
4
|
+
import {} from '../../index.js';
|
|
5
|
+
import { dedent } from 'ts-dedent';
|
|
6
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
7
|
+
import { coerceType } from '../../utils/coerceType.js';
|
|
8
|
+
export class UserInputNodeImpl extends NodeImpl {
|
|
9
|
+
static create() {
|
|
10
|
+
const chartNode = {
|
|
11
|
+
type: 'userInput',
|
|
12
|
+
title: 'User Input',
|
|
13
|
+
id: nanoid(),
|
|
14
|
+
visualData: {
|
|
15
|
+
x: 0,
|
|
16
|
+
y: 0,
|
|
17
|
+
width: 250,
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
prompt: 'This is an example question?',
|
|
21
|
+
useInput: false,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
return chartNode;
|
|
25
|
+
}
|
|
26
|
+
getInputDefinitions() {
|
|
27
|
+
if (this.chartNode.data.useInput) {
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
dataType: 'string[]',
|
|
31
|
+
id: 'questions',
|
|
32
|
+
title: 'Questions',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
getOutputDefinitions() {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
dataType: 'string[]',
|
|
42
|
+
id: 'output',
|
|
43
|
+
title: 'Answers Only',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
dataType: 'string[]',
|
|
47
|
+
id: 'questionsAndAnswers',
|
|
48
|
+
title: 'Q & A',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
getEditors() {
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
type: 'code',
|
|
56
|
+
label: 'Prompt',
|
|
57
|
+
dataKey: 'prompt',
|
|
58
|
+
useInputToggleDataKey: 'useInput',
|
|
59
|
+
language: 'plain-text',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'group',
|
|
63
|
+
label: 'Rendering',
|
|
64
|
+
editors: [
|
|
65
|
+
{
|
|
66
|
+
type: 'dropdown',
|
|
67
|
+
dataKey: 'renderingFormat',
|
|
68
|
+
label: 'Format',
|
|
69
|
+
options: [
|
|
70
|
+
{ label: 'Preformatted', value: 'preformatted' },
|
|
71
|
+
{ label: 'Markdown', value: 'markdown' },
|
|
72
|
+
],
|
|
73
|
+
defaultValue: 'markdown',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
getBody() {
|
|
80
|
+
return this.data.useInput ? '(Using input)' : this.data.prompt;
|
|
81
|
+
}
|
|
82
|
+
static getUIData() {
|
|
83
|
+
return {
|
|
84
|
+
infoBoxBody: dedent `
|
|
85
|
+
Prompts the user for input during the execution of the graph. The user's response becomes the output of this node.
|
|
86
|
+
`,
|
|
87
|
+
infoBoxTitle: 'User Input Node',
|
|
88
|
+
contextMenuTitle: 'User Input',
|
|
89
|
+
group: ['Input/Output'],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
async process() {
|
|
93
|
+
return {
|
|
94
|
+
['output']: undefined,
|
|
95
|
+
['questionsAndAnswers']: undefined,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
getOutputValuesFromUserInput(questions, answers) {
|
|
99
|
+
const questionsList = this.data.useInput
|
|
100
|
+
? coerceType(questions['questions'], 'string[]')
|
|
101
|
+
: [this.data.prompt];
|
|
102
|
+
return {
|
|
103
|
+
['output']: answers,
|
|
104
|
+
['questionsAndAnswers']: {
|
|
105
|
+
type: 'string[]',
|
|
106
|
+
value: zip(questionsList, answers.value).map(([q, a]) => `${q}\n${a}`),
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export const userInputNode = nodeDefinition(UserInputNodeImpl, 'User Input');
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {} from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
3
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
4
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
5
|
+
import {} from '../GraphProcessor.js';
|
|
6
|
+
import {} from '../ProcessContext.js';
|
|
7
|
+
import {} from '../../index.js';
|
|
8
|
+
import { dedent } from 'ts-dedent';
|
|
9
|
+
import { getIntegration } from '../../integrations/integrations.js';
|
|
10
|
+
import { getInputOrData } from '../../utils/index.js';
|
|
11
|
+
export class VectorNearestNeighborsNodeImpl extends NodeImpl {
|
|
12
|
+
static create() {
|
|
13
|
+
return {
|
|
14
|
+
id: nanoid(),
|
|
15
|
+
type: 'vectorNearestNeighbors',
|
|
16
|
+
title: 'Vector KNN',
|
|
17
|
+
visualData: { x: 0, y: 0, width: 200 },
|
|
18
|
+
data: {
|
|
19
|
+
k: 10,
|
|
20
|
+
integration: 'pinecone',
|
|
21
|
+
collectionId: '',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
getInputDefinitions() {
|
|
26
|
+
const inputDefinitions = [];
|
|
27
|
+
inputDefinitions.push({
|
|
28
|
+
id: 'vector',
|
|
29
|
+
title: 'Vector',
|
|
30
|
+
dataType: 'vector',
|
|
31
|
+
required: true,
|
|
32
|
+
});
|
|
33
|
+
if (this.data.useIntegrationInput) {
|
|
34
|
+
inputDefinitions.push({
|
|
35
|
+
id: 'integration',
|
|
36
|
+
title: 'Integration',
|
|
37
|
+
dataType: 'string',
|
|
38
|
+
required: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (this.data.useCollectionIdInput) {
|
|
42
|
+
inputDefinitions.push({
|
|
43
|
+
id: 'collectionId',
|
|
44
|
+
title: 'Collection ID',
|
|
45
|
+
dataType: 'string',
|
|
46
|
+
required: true,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (this.data.useKInput) {
|
|
50
|
+
inputDefinitions.push({
|
|
51
|
+
id: 'k',
|
|
52
|
+
title: 'K',
|
|
53
|
+
dataType: 'number',
|
|
54
|
+
required: true,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return inputDefinitions;
|
|
58
|
+
}
|
|
59
|
+
getOutputDefinitions() {
|
|
60
|
+
const outputs = [
|
|
61
|
+
{
|
|
62
|
+
id: 'results',
|
|
63
|
+
title: 'Results',
|
|
64
|
+
dataType: 'any[]',
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
return outputs;
|
|
68
|
+
}
|
|
69
|
+
getEditors() {
|
|
70
|
+
return [
|
|
71
|
+
{
|
|
72
|
+
type: 'dropdown',
|
|
73
|
+
label: 'Integration',
|
|
74
|
+
dataKey: 'integration',
|
|
75
|
+
options: [{ label: 'Pinecone', value: 'pinecone' }],
|
|
76
|
+
useInputToggleDataKey: 'useIntegrationInput',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'number',
|
|
80
|
+
label: 'K',
|
|
81
|
+
dataKey: 'k',
|
|
82
|
+
min: 1,
|
|
83
|
+
max: 100,
|
|
84
|
+
step: 1,
|
|
85
|
+
defaultValue: 10,
|
|
86
|
+
useInputToggleDataKey: 'useKInput',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'string',
|
|
90
|
+
label: 'Collection ID',
|
|
91
|
+
dataKey: 'collectionId',
|
|
92
|
+
useInputToggleDataKey: 'useCollectionIdInput',
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
getBody() {
|
|
97
|
+
return dedent `
|
|
98
|
+
Integration: ${this.data.useIntegrationInput ? '(using input)' : this.data.integration}
|
|
99
|
+
K: ${this.data.useKInput ? '(using input)' : this.data.k}
|
|
100
|
+
Collection Id: ${this.data.useCollectionIdInput ? '(using input)' : this.data.collectionId}
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
static getUIData() {
|
|
104
|
+
return {
|
|
105
|
+
infoBoxBody: dedent `
|
|
106
|
+
Performs a k-nearest neighbors search on the vectors stored in the configured vector DB integration. Takes in a vector and returns the k closest vectors and their corresponding data.
|
|
107
|
+
`,
|
|
108
|
+
infoBoxTitle: 'Vector KNN Node',
|
|
109
|
+
contextMenuTitle: 'Vector KNN',
|
|
110
|
+
group: ['Input/Output'],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
async process(inputs, context) {
|
|
114
|
+
const integration = getInputOrData(this.data, inputs, 'integration');
|
|
115
|
+
const vectorDb = getIntegration('vectorDatabase', integration, context);
|
|
116
|
+
const indexUrl = getInputOrData(this.data, inputs, 'collectionId');
|
|
117
|
+
const k = getInputOrData(this.data, inputs, 'k', 'number');
|
|
118
|
+
if (inputs['vector']?.type !== 'vector') {
|
|
119
|
+
throw new Error(`Expected vector input, got ${inputs['vector']?.type}`);
|
|
120
|
+
}
|
|
121
|
+
const results = await vectorDb.nearestNeighbors({ type: 'string', value: indexUrl }, inputs['vector'], k);
|
|
122
|
+
return {
|
|
123
|
+
['results']: results,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export const vectorNearestNeighborsNode = nodeDefinition(VectorNearestNeighborsNodeImpl, 'Vector KNN');
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {} from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
3
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
4
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
5
|
+
import {} from '../GraphProcessor.js';
|
|
6
|
+
import {} from '../ProcessContext.js';
|
|
7
|
+
import {} from '../../index.js';
|
|
8
|
+
import { dedent } from 'ts-dedent';
|
|
9
|
+
import { getIntegration } from '../../integrations/integrations.js';
|
|
10
|
+
import { getInputOrData } from '../../utils/index.js';
|
|
11
|
+
import { coerceTypeOptional } from '../../utils/coerceType.js';
|
|
12
|
+
export class VectorStoreNodeImpl extends NodeImpl {
|
|
13
|
+
static create() {
|
|
14
|
+
return {
|
|
15
|
+
id: nanoid(),
|
|
16
|
+
type: 'vectorStore',
|
|
17
|
+
title: 'Vector Store',
|
|
18
|
+
visualData: { x: 0, y: 0, width: 200 },
|
|
19
|
+
data: {
|
|
20
|
+
integration: 'pinecone',
|
|
21
|
+
collectionId: '',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
getInputDefinitions() {
|
|
26
|
+
const inputDefinitions = [];
|
|
27
|
+
inputDefinitions.push({
|
|
28
|
+
id: 'vector',
|
|
29
|
+
title: 'Vector',
|
|
30
|
+
dataType: 'vector',
|
|
31
|
+
required: true,
|
|
32
|
+
});
|
|
33
|
+
if (this.data.useCollectionIdInput) {
|
|
34
|
+
inputDefinitions.push({
|
|
35
|
+
id: 'collectionId',
|
|
36
|
+
title: 'Collection ID',
|
|
37
|
+
dataType: 'string',
|
|
38
|
+
required: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
inputDefinitions.push({
|
|
42
|
+
id: 'data',
|
|
43
|
+
title: 'Data',
|
|
44
|
+
dataType: 'any',
|
|
45
|
+
required: true,
|
|
46
|
+
});
|
|
47
|
+
if (this.data.useIntegrationInput) {
|
|
48
|
+
inputDefinitions.push({
|
|
49
|
+
id: 'integration',
|
|
50
|
+
title: 'Integration',
|
|
51
|
+
dataType: 'string',
|
|
52
|
+
required: true,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
inputDefinitions.push({
|
|
56
|
+
id: 'id',
|
|
57
|
+
title: 'ID',
|
|
58
|
+
dataType: 'string',
|
|
59
|
+
required: false,
|
|
60
|
+
});
|
|
61
|
+
return inputDefinitions;
|
|
62
|
+
}
|
|
63
|
+
getOutputDefinitions() {
|
|
64
|
+
const outputs = [
|
|
65
|
+
{
|
|
66
|
+
id: 'complete',
|
|
67
|
+
title: 'Complete',
|
|
68
|
+
dataType: 'boolean',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
return outputs;
|
|
72
|
+
}
|
|
73
|
+
getEditors() {
|
|
74
|
+
return [
|
|
75
|
+
{
|
|
76
|
+
type: 'dropdown',
|
|
77
|
+
label: 'Integration',
|
|
78
|
+
dataKey: 'integration',
|
|
79
|
+
options: [{ label: 'Pinecone', value: 'pinecone' }],
|
|
80
|
+
useInputToggleDataKey: 'useIntegrationInput',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'string',
|
|
84
|
+
label: 'Collection ID',
|
|
85
|
+
dataKey: 'collectionId',
|
|
86
|
+
useInputToggleDataKey: 'useCollectionIdInput',
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
getBody() {
|
|
91
|
+
return dedent `
|
|
92
|
+
Integration: ${this.data.useIntegrationInput ? '(using input)' : this.data.integration}
|
|
93
|
+
Collection Id: ${this.data.useCollectionIdInput ? '(using input)' : this.data.collectionId}
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
static getUIData() {
|
|
97
|
+
return {
|
|
98
|
+
infoBoxBody: dedent `
|
|
99
|
+
Takes in a vector, as well as data to store with the vector. This data is stored in the configured vector DB integration for later retrieval.
|
|
100
|
+
`,
|
|
101
|
+
infoBoxTitle: 'Vector Store Node',
|
|
102
|
+
contextMenuTitle: 'Vector Store',
|
|
103
|
+
group: ['Input/Output'],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
async process(inputs, context) {
|
|
107
|
+
const integration = getInputOrData(this.data, inputs, 'integration');
|
|
108
|
+
const vectorDb = getIntegration('vectorDatabase', integration, context);
|
|
109
|
+
const indexUrl = getInputOrData(this.data, inputs, 'collectionId');
|
|
110
|
+
if (inputs['vector']?.type !== 'vector') {
|
|
111
|
+
throw new Error(`Expected vector input, got ${inputs['vector']?.type}`);
|
|
112
|
+
}
|
|
113
|
+
await vectorDb.store({ type: 'string', value: indexUrl }, inputs['vector'], inputs['data'], {
|
|
114
|
+
id: coerceTypeOptional(inputs['id'], 'string'),
|
|
115
|
+
});
|
|
116
|
+
return {
|
|
117
|
+
['complete']: {
|
|
118
|
+
type: 'boolean',
|
|
119
|
+
value: true,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export const vectorStoreNode = nodeDefinition(VectorStoreNodeImpl, 'Vector Store');
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {} from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl } from '../NodeImpl.js';
|
|
3
|
+
import { nodeDefinition } from '../NodeDefinition.js';
|
|
4
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
5
|
+
import {} from '../GraphProcessor.js';
|
|
6
|
+
import { coerceType } from '../../utils/coerceType.js';
|
|
7
|
+
import {} from '../ProcessContext.js';
|
|
8
|
+
import { dedent } from 'ts-dedent';
|
|
9
|
+
import {} from '../EditorDefinition.js';
|
|
10
|
+
import {} from '../NodeBodySpec.js';
|
|
11
|
+
export class WaitForEventNodeImpl extends NodeImpl {
|
|
12
|
+
static create() {
|
|
13
|
+
return {
|
|
14
|
+
id: nanoid(),
|
|
15
|
+
type: 'waitForEvent',
|
|
16
|
+
title: 'Wait For Event',
|
|
17
|
+
visualData: { x: 0, y: 0, width: 150 },
|
|
18
|
+
data: {
|
|
19
|
+
eventName: 'continue',
|
|
20
|
+
useEventNameInput: false,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
getInputDefinitions() {
|
|
25
|
+
const inputDefinitions = [];
|
|
26
|
+
if (this.chartNode.data.useEventNameInput) {
|
|
27
|
+
inputDefinitions.push({
|
|
28
|
+
id: 'eventName',
|
|
29
|
+
title: 'Event Name',
|
|
30
|
+
dataType: 'string',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
inputDefinitions.push({
|
|
34
|
+
id: 'inputData',
|
|
35
|
+
title: 'Data',
|
|
36
|
+
dataType: 'any',
|
|
37
|
+
});
|
|
38
|
+
return inputDefinitions;
|
|
39
|
+
}
|
|
40
|
+
getOutputDefinitions() {
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
id: 'outputData',
|
|
44
|
+
title: 'Data',
|
|
45
|
+
dataType: 'any',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'eventData',
|
|
49
|
+
title: 'Event Data',
|
|
50
|
+
dataType: 'any',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
getEditors() {
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
type: 'string',
|
|
58
|
+
label: 'Event Name',
|
|
59
|
+
dataKey: 'eventName',
|
|
60
|
+
useInputToggleDataKey: 'useEventNameInput',
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
getBody() {
|
|
65
|
+
return this.data.useEventNameInput ? '(Using Input)' : this.data.eventName;
|
|
66
|
+
}
|
|
67
|
+
static getUIData() {
|
|
68
|
+
return {
|
|
69
|
+
infoBoxBody: dedent `
|
|
70
|
+
Waits for a specific event to be raised by a 'Raise Event' node or the host project. The event name can be configured.
|
|
71
|
+
`,
|
|
72
|
+
infoBoxTitle: 'Wait For Event Node',
|
|
73
|
+
contextMenuTitle: 'Wait For Event',
|
|
74
|
+
group: ['Advanced'],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async process(inputs, context) {
|
|
78
|
+
const eventName = this.chartNode.data.useEventNameInput
|
|
79
|
+
? coerceType(inputs['eventName'], 'string')
|
|
80
|
+
: this.chartNode.data.eventName;
|
|
81
|
+
const eventData = await context.waitEvent(eventName);
|
|
82
|
+
return {
|
|
83
|
+
['outputData']: inputs['inputData'],
|
|
84
|
+
['eventData']: eventData,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export const waitForEventNode = nodeDefinition(WaitForEventNodeImpl, 'Wait For Event');
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const baseDirs = {
|
|
2
|
+
app: 'app',
|
|
3
|
+
appCache: 'appCache',
|
|
4
|
+
appConfig: 'appConfig',
|
|
5
|
+
appData: 'appData',
|
|
6
|
+
appLocalData: 'appLocalData',
|
|
7
|
+
appLog: 'appLog',
|
|
8
|
+
audio: 'audio',
|
|
9
|
+
cache: 'cache',
|
|
10
|
+
config: 'config',
|
|
11
|
+
data: 'data',
|
|
12
|
+
desktop: 'desktop',
|
|
13
|
+
document: 'document',
|
|
14
|
+
download: 'download',
|
|
15
|
+
executable: 'executable',
|
|
16
|
+
font: 'font',
|
|
17
|
+
home: 'home',
|
|
18
|
+
localData: 'localData',
|
|
19
|
+
log: 'log',
|
|
20
|
+
picture: 'picture',
|
|
21
|
+
public: 'public',
|
|
22
|
+
resource: 'resource',
|
|
23
|
+
runtime: 'runtime',
|
|
24
|
+
temp: 'temp',
|
|
25
|
+
template: 'template',
|
|
26
|
+
video: 'video',
|
|
27
|
+
};
|
|
28
|
+
export function assertBaseDir(baseDir) {
|
|
29
|
+
if (!(baseDir in baseDirs)) {
|
|
30
|
+
throw new Error(`Invalid base directory: ${baseDir}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {} from './BaseDir.js';
|
|
2
|
+
import {} from './NativeApi.js';
|
|
3
|
+
export class BrowserNativeApi {
|
|
4
|
+
readdir(_path, _baseDir) {
|
|
5
|
+
throw new Error('Method not implemented.');
|
|
6
|
+
}
|
|
7
|
+
readTextFile(_path, _baseDir) {
|
|
8
|
+
throw new Error('Method not implemented.');
|
|
9
|
+
}
|
|
10
|
+
readBinaryFile(_path, _baseDir) {
|
|
11
|
+
throw new Error('Method not implemented.');
|
|
12
|
+
}
|
|
13
|
+
writeTextFile(_path, _data, _baseDir) {
|
|
14
|
+
throw new Error('Method not implemented.');
|
|
15
|
+
}
|
|
16
|
+
exec(command, args, options) {
|
|
17
|
+
throw new Error('Method not supported.');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {} from './BaseDir.js';
|