@valerypopoff/rivet2-core 2.1.9 → 2.3.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/README.md +1 -1
- package/dist/cjs/bundle.cjs +5618 -2533
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/webAppRuntime.cjs +333 -22
- package/dist/cjs/webAppRuntime.cjs.map +4 -4
- package/dist/esm/api/createProcessor.js +2 -0
- package/dist/esm/exports.js +1 -0
- package/dist/esm/integrations/CodeRunner.js +2 -7
- package/dist/esm/integrations/CodeRunnerOptions.js +7 -0
- package/dist/esm/model/AgentResponseTrace.js +558 -0
- package/dist/esm/model/ConnectedToolContinuationHost.js +33 -0
- package/dist/esm/model/GraphProcessor.js +165 -74
- package/dist/esm/model/NodeImpl.js +6 -0
- package/dist/esm/model/ProcessContextBuilder.js +3 -1
- package/dist/esm/model/RecordingPlayer.js +212 -25
- package/dist/esm/model/SplitRunProcessor.js +49 -8
- package/dist/esm/model/SubprocessorBridge.js +3 -0
- package/dist/esm/model/ToolCallContinuationCoordinator.js +7 -3
- package/dist/esm/model/UiGraph.js +21 -0
- package/dist/esm/model/UiGraphActionProtocol.js +3 -0
- package/dist/esm/model/UiGraphBrowserRuntime.js +133 -4
- package/dist/esm/model/UiGraphRendererStyles.js +221 -0
- package/dist/esm/model/UiGraphRuntimeModel.js +9 -3
- package/dist/esm/model/UiGraphSchema.js +7 -1
- package/dist/esm/model/chat/aiSdkTools.js +3 -2
- package/dist/esm/model/chat-v2/aiSdkBridge.js +146 -14
- package/dist/esm/model/chat-v2/chatV2CallObserver.js +11 -5
- package/dist/esm/model/chat-v2/chatV2CredentialNames.js +93 -0
- package/dist/esm/model/chat-v2/chatV2EditorCache.js +47 -20
- package/dist/esm/model/chat-v2/chatV2Errors.js +7 -19
- package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +1 -1
- package/dist/esm/model/chat-v2/chatV2Outputs.js +48 -108
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +101 -149
- package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +39 -4
- package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +9 -0
- package/dist/esm/model/chat-v2/chatV2RequestPlan.js +2 -3
- package/dist/esm/model/chat-v2/chatV2ResponseBodyCapture.js +63 -0
- package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +8 -4
- package/dist/esm/model/chat-v2/chatV2Retry.js +4 -3
- package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +7 -7
- package/dist/esm/model/chat-v2/chatV2Shared.js +1 -1
- package/dist/esm/model/chat-v2/chatV2Types.js +20 -8
- package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +78 -0
- package/dist/esm/model/chat-v2/customProviderApi.js +40 -0
- package/dist/esm/model/chat-v2/index.js +15 -0
- package/dist/esm/model/chat-v2/llmChatV2Body.js +289 -0
- package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +32 -0
- package/dist/esm/model/chat-v2/llmChatV2CachePolicy.js +25 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +13 -50
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +117 -24
- package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +24 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +150 -199
- package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +60 -0
- package/dist/esm/model/chat-v2/llmInvocationDecision.js +11 -0
- package/dist/esm/model/chat-v2/llmInvocationJournal.js +43 -0
- package/dist/esm/model/chat-v2/llmInvocationPlan.js +68 -0
- package/dist/esm/model/chat-v2/llmInvocationProjections.js +5 -0
- package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +48 -0
- package/dist/esm/model/chat-v2/llmModelCandidate.js +79 -0
- package/dist/esm/model/chat-v2/llmProfile.js +52 -65
- package/dist/esm/model/chat-v2/llmProfileBody.js +193 -0
- package/dist/esm/model/chat-v2/llmProfileFallback.js +442 -100
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +74 -0
- package/dist/esm/model/chat-v2/llmProfileHealthStore.js +326 -0
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +55 -33
- package/dist/esm/model/chat-v2/llmProfileTypes.js +1 -18
- package/dist/esm/model/chat-v2/llmResponseMaterializer.js +42 -0
- package/dist/esm/model/chat-v2/modelRegistry.js +54 -4
- package/dist/esm/model/chat-v2/parallelToolCalls.js +9 -2
- package/dist/esm/model/chat-v2/providerOptions.js +116 -24
- package/dist/esm/model/chat-v2/rivetToolRegistry.js +9 -0
- package/dist/esm/model/chat-v2/toolCallCodec.js +52 -0
- package/dist/esm/model/chat-v2/toolContinuation.js +72 -35
- package/dist/esm/model/chat-v2/toolHandlerResolver.js +23 -0
- package/dist/esm/model/chat-v2/toolRoundExecutor.js +12 -0
- package/dist/esm/model/nodes/ChatNode.js +6 -0
- package/dist/esm/model/nodes/ChatNodeBase.js +1 -0
- package/dist/esm/model/nodes/CodeNewNode.js +5 -47
- package/dist/esm/model/nodes/CodeNode.js +4 -46
- package/dist/esm/model/nodes/DelegateFunctionCallNode.js +19 -6
- package/dist/esm/model/nodes/ExpressionNode.js +5 -8
- package/dist/esm/model/nodes/LLMChatV2Node.js +121 -229
- package/dist/esm/model/nodes/LLMProfileNode.js +27 -8
- package/dist/esm/model/nodes/MatchNode.js +86 -41
- package/dist/esm/model/nodes/PromptNode.js +7 -0
- package/dist/esm/model/nodes/ToolNode.js +7 -0
- package/dist/esm/model/nodes/toolCallDelegation.js +177 -110
- package/dist/esm/plugins/anthropic/anthropic.js +4 -4
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +7 -0
- package/dist/esm/plugins/gentrace/gentraceSdk.js +0 -1
- package/dist/esm/plugins/gentrace/index.js +0 -1
- package/dist/esm/plugins/gentrace/plugin.js +61 -179
- package/dist/esm/plugins/google/google.js +5 -9
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +4 -1
- package/dist/esm/plugins.js +1 -2
- package/dist/esm/recording/ExecutionRecorder.js +62 -13
- package/dist/esm/utils/emitDetached.js +6 -3
- package/dist/esm/utils/openai.js +60 -16
- package/dist/esm/utils/serialization/serialization.js +2 -19
- package/dist/esm/webAppRuntime.js +3 -2
- package/dist/types/api/createProcessor.d.ts +3 -0
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/integrations/CodeRunner.d.ts +10 -7
- package/dist/types/integrations/CodeRunnerOptions.d.ts +15 -0
- package/dist/types/model/AgentResponseTrace.d.ts +123 -0
- package/dist/types/model/ConnectedToolContinuationHost.d.ts +34 -0
- package/dist/types/model/EditorDefinition.d.ts +16 -0
- package/dist/types/model/ExecutorProtocol.d.ts +32 -11
- package/dist/types/model/GraphProcessor.d.ts +41 -9
- package/dist/types/model/NodeBase.d.ts +0 -10
- package/dist/types/model/NodeImpl.d.ts +18 -1
- package/dist/types/model/Nodes.d.ts +2 -2
- package/dist/types/model/ProcessContext.d.ts +99 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +3 -1
- package/dist/types/model/RecordingPlayer.d.ts +6 -0
- package/dist/types/model/SplitRunProcessor.d.ts +10 -3
- package/dist/types/model/UiGraph.d.ts +8 -0
- package/dist/types/model/UiGraphActionProtocol.d.ts +3 -0
- package/dist/types/model/UiGraphBrowserRuntime.d.ts +11 -2
- package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
- package/dist/types/model/UiGraphRuntimeModel.d.ts +2 -0
- package/dist/types/model/UiGraphSchema.d.ts +1 -0
- package/dist/types/model/chat-v2/chatV2CallObserver.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2CredentialNames.d.ts +30 -0
- package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +2 -3
- package/dist/types/model/chat-v2/chatV2Outputs.d.ts +6 -16
- package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +13 -17
- package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +7 -0
- package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +8 -0
- package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +2 -2
- package/dist/types/model/chat-v2/chatV2ResponseBodyCapture.d.ts +25 -0
- package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +3 -2
- package/dist/types/model/chat-v2/chatV2Retry.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2RuntimeOptions.d.ts +3 -8
- package/dist/types/model/chat-v2/chatV2Types.d.ts +44 -10
- package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +14 -0
- package/dist/types/model/chat-v2/customProviderApi.d.ts +22 -0
- package/dist/types/model/chat-v2/index.d.ts +15 -0
- package/dist/types/model/chat-v2/llmChatV2Body.d.ts +24 -0
- package/dist/types/model/chat-v2/llmChatV2CacheBoundary.d.ts +10 -0
- package/dist/types/model/chat-v2/llmChatV2CachePolicy.d.ts +13 -0
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +19 -3
- package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +8 -0
- package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +14 -16
- package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +16 -0
- package/dist/types/model/chat-v2/llmInvocationDecision.d.ts +21 -0
- package/dist/types/model/chat-v2/llmInvocationJournal.d.ts +38 -0
- package/dist/types/model/chat-v2/llmInvocationPlan.d.ts +41 -0
- package/dist/types/model/chat-v2/llmInvocationProjections.d.ts +3 -0
- package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +26 -0
- package/dist/types/model/chat-v2/llmModelCandidate.d.ts +20 -0
- package/dist/types/model/chat-v2/llmProfile.d.ts +14 -0
- package/dist/types/model/chat-v2/llmProfileBody.d.ts +20 -0
- package/dist/types/model/chat-v2/llmProfileFallback.d.ts +36 -49
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +209 -0
- package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +111 -0
- package/dist/types/model/chat-v2/llmProfileNodeRuntime.d.ts +1 -1
- package/dist/types/model/chat-v2/llmProfileTypes.d.ts +4 -1
- package/dist/types/model/chat-v2/llmResponseMaterializer.d.ts +20 -0
- package/dist/types/model/chat-v2/modelRegistry.d.ts +17 -187
- package/dist/types/model/chat-v2/parallelToolCalls.d.ts +3 -1
- package/dist/types/model/chat-v2/providerOptions.d.ts +12 -0
- package/dist/types/model/chat-v2/rivetToolRegistry.d.ts +11 -0
- package/dist/types/model/chat-v2/toolCallCodec.d.ts +7 -0
- package/dist/types/model/chat-v2/toolContinuation.d.ts +3 -3
- package/dist/types/model/chat-v2/toolHandlerResolver.d.ts +25 -0
- package/dist/types/model/chat-v2/toolRoundExecutor.d.ts +18 -0
- package/dist/types/model/nodes/ChatNode.d.ts +2 -1
- package/dist/types/model/nodes/CodeNewNode.d.ts +0 -5
- package/dist/types/model/nodes/CodeNode.d.ts +0 -5
- package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +2 -1
- package/dist/types/model/nodes/LLMChatV2Node.d.ts +2 -1
- package/dist/types/model/nodes/LLMProfileNode.d.ts +2 -1
- package/dist/types/model/nodes/MatchNode.d.ts +6 -0
- package/dist/types/model/nodes/PromptNode.d.ts +4 -1
- package/dist/types/model/nodes/ToolNode.d.ts +2 -1
- package/dist/types/model/nodes/toolCallDelegation.d.ts +10 -3
- package/dist/types/plugins/anthropic/anthropic.d.ts +1 -0
- package/dist/types/plugins/gentrace/gentraceSdk.d.ts +0 -1
- package/dist/types/plugins/gentrace/plugin.d.ts +55 -9
- package/dist/types/plugins/google/google.d.ts +2 -8
- package/dist/types/plugins.d.ts +1 -1
- package/dist/types/recording/ExecutionRecorder.d.ts +7 -1
- package/dist/types/recording/RecordedEvents.d.ts +6 -0
- package/dist/types/utils/emitDetached.d.ts +3 -2
- package/dist/types/utils/openai.d.ts +49 -0
- package/dist/types/webAppRuntime.d.ts +4 -2
- package/package.json +2 -2
|
@@ -103,12 +103,12 @@ export * from './nodes/MCPToolCallNode.js';
|
|
|
103
103
|
export * from './nodes/MCPGetPromptNode.js';
|
|
104
104
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
105
105
|
export * from './nodes/NodePrefabInstanceNode.js';
|
|
106
|
-
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "graphOutput" | "setGlobal" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "setStoredValue" | "abortGraph" | "
|
|
106
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "graphOutput" | "delegateFunctionCall" | "setGlobal" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "setStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "userInput" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "dataBus" | "startBackgroundBranch" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
107
107
|
type: "mcpDiscovery";
|
|
108
108
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
109
109
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
110
110
|
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
|
|
111
|
-
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "graphOutput" | "setGlobal" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "setStoredValue" | "abortGraph" | "
|
|
111
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "graphInput" | "graphOutput" | "delegateFunctionCall" | "setGlobal" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "setStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "userInput" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "dataBus" | "startBackgroundBranch" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
112
112
|
type: "mcpDiscovery";
|
|
113
113
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
114
114
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
@@ -5,10 +5,12 @@ import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
|
5
5
|
import type { ProjectReferenceLoader } from './ProjectReferenceLoader.js';
|
|
6
6
|
import type { GraphBoundary } from './GraphBoundaryCache.js';
|
|
7
7
|
import type { GraphProgress } from './GraphProgress.js';
|
|
8
|
+
import type { CustomProviderApi } from './chat-v2/customProviderApi.js';
|
|
8
9
|
import type { RivetStoredValue, RivetStoredValueCacheResult, RivetStoredValueReadResult, RivetStoredValueSetResult } from './StoredValueStore.js';
|
|
9
10
|
import type { ToolCallContinuation } from './ToolCallContinuation.js';
|
|
10
11
|
import type { KnowledgeStoreConnectionId, RivetKnowledgeStore } from '../integrations/KnowledgeStore.js';
|
|
11
12
|
import type { ChatV2Provider } from './chat-v2/chatV2ProviderTypes.js';
|
|
13
|
+
import type { RivetLLMProfileHealthOutcome, RivetLLMProfileHealthState, RivetLLMProfileHealthStore } from './chat-v2/llmProfileHealthStore.js';
|
|
12
14
|
export type ChatV2CallId = Opaque<string, 'ChatV2CallId'>;
|
|
13
15
|
export type ChatV2CallOutcome = 'success' | 'provider-failure' | 'aborted';
|
|
14
16
|
/**
|
|
@@ -54,19 +56,85 @@ export type ChatV2CallFinishedEvent = {
|
|
|
54
56
|
attemptIndex: number;
|
|
55
57
|
/** Zero-based profile index when LLM Chat is using a profile fallback chain. */
|
|
56
58
|
profileIndex?: number;
|
|
59
|
+
/** Privacy-bounded stable profile health key when circuit breaking is enabled. */
|
|
60
|
+
profileHealthKey?: string;
|
|
61
|
+
/** Circuit state observed when this physical call was admitted. */
|
|
62
|
+
profileHealthState?: 'closed' | 'open' | 'half-open';
|
|
57
63
|
/** Zero-based model round within one auto-continued LLM Chat invocation. */
|
|
58
64
|
roundIndex?: number;
|
|
59
65
|
nodeId: NodeId;
|
|
60
66
|
processId: ProcessId;
|
|
61
67
|
provider: ChatV2Provider;
|
|
62
68
|
model: string;
|
|
69
|
+
/** Selected wire contract when provider is Custom. */
|
|
70
|
+
customProviderApi?: CustomProviderApi;
|
|
63
71
|
outcome: ChatV2CallOutcome;
|
|
64
72
|
finishReason?: string;
|
|
65
73
|
rawUsage?: ChatV2CallRawUsage;
|
|
66
74
|
normalizedUsage?: ChatV2CallNormalizedUsage;
|
|
67
75
|
pricing: ChatV2CallPricing;
|
|
76
|
+
/** Epoch milliseconds when the physical provider attempt started. */
|
|
77
|
+
startedAt?: number;
|
|
78
|
+
/** Wall-clock duration of this physical provider attempt. */
|
|
79
|
+
durationMs?: number;
|
|
68
80
|
};
|
|
69
81
|
export type ChatV2CallFinishedObserver = (event: ChatV2CallFinishedEvent) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Portable, privacy-bounded subset of a completed physical Chat V2 call.
|
|
84
|
+
* Provider-shaped raw usage is intentionally retained only by the host observer
|
|
85
|
+
* and cannot enter processor events, recordings, or remote transport.
|
|
86
|
+
*/
|
|
87
|
+
export type ChatV2CallTraceEvent = Omit<ChatV2CallFinishedEvent, 'rawUsage'>;
|
|
88
|
+
/**
|
|
89
|
+
* Privacy-bounded lifecycle event for one profile decision inside an LLM Chat
|
|
90
|
+
* fallback round. Unlike physical-call events, this also records candidates
|
|
91
|
+
* skipped by an open circuit and health-store fail-open decisions.
|
|
92
|
+
*/
|
|
93
|
+
export type LLMProfileAttemptTraceEvent = {
|
|
94
|
+
eventId: string;
|
|
95
|
+
roundIndex: number;
|
|
96
|
+
/** Present when this attempt belongs to a From profile fallback candidate. */
|
|
97
|
+
profileIndex?: number;
|
|
98
|
+
nodeId: NodeId;
|
|
99
|
+
processId: ProcessId;
|
|
100
|
+
provider: ChatV2Provider;
|
|
101
|
+
model: string;
|
|
102
|
+
customProviderApi?: CustomProviderApi;
|
|
103
|
+
stage: 'configuration' | 'request' | 'response-validation' | 'health-gate' | 'health-update';
|
|
104
|
+
outcome: 'success' | 'failure' | 'aborted' | 'skipped';
|
|
105
|
+
attemptIndex?: number;
|
|
106
|
+
status?: number;
|
|
107
|
+
error?: string;
|
|
108
|
+
profileHealthKey?: string;
|
|
109
|
+
healthState?: RivetLLMProfileHealthState;
|
|
110
|
+
healthDisposition?: 'allow' | 'deny' | 'fail-open';
|
|
111
|
+
healthOutcome?: RivetLLMProfileHealthOutcome;
|
|
112
|
+
retryAt?: number;
|
|
113
|
+
timeoutKind?: 'first-output' | 'stream-inactivity';
|
|
114
|
+
};
|
|
115
|
+
export type LLMProfileAttemptObserver = (event: LLMProfileAttemptTraceEvent) => void;
|
|
116
|
+
export type ToolCallFinishedEvent = {
|
|
117
|
+
toolCallId?: string;
|
|
118
|
+
toolName: string;
|
|
119
|
+
sourceNodeId: NodeId;
|
|
120
|
+
sourceProcessId: ProcessId;
|
|
121
|
+
/**
|
|
122
|
+
* Exact node invocation that owns the persisted tool-result output, when
|
|
123
|
+
* delegation ran through a Delegate Tool Call node. This is intentionally a
|
|
124
|
+
* pointer only: execution traces never copy tool arguments or result text.
|
|
125
|
+
*/
|
|
126
|
+
resultOwner?: {
|
|
127
|
+
nodeId: NodeId;
|
|
128
|
+
processId: ProcessId;
|
|
129
|
+
outputPortId: PortId;
|
|
130
|
+
};
|
|
131
|
+
handlerKind: 'graph' | 'external' | 'unknown';
|
|
132
|
+
handlerGraphId?: GraphId;
|
|
133
|
+
handlerName?: string;
|
|
134
|
+
outcome: 'success' | 'passthrough-error' | 'failure' | 'aborted';
|
|
135
|
+
startedAt?: number;
|
|
136
|
+
durationMs?: number;
|
|
137
|
+
};
|
|
70
138
|
export type ProcessContext = {
|
|
71
139
|
settings: RuntimeSettings;
|
|
72
140
|
nativeApi?: NativeApi;
|
|
@@ -94,6 +162,12 @@ export type ProcessContext = {
|
|
|
94
162
|
* provider attempt. Observer failures are isolated from graph execution.
|
|
95
163
|
*/
|
|
96
164
|
onChatV2CallFinished?: ChatV2CallFinishedObserver;
|
|
165
|
+
/** Host-only observer for profile fallback and circuit-health decisions. */
|
|
166
|
+
onLLMProfileAttempt?: LLMProfileAttemptObserver;
|
|
167
|
+
/** Optional shared persistence for cross-run LLM Profile circuit state. */
|
|
168
|
+
llmProfileHealthStore?: RivetLLMProfileHealthStore;
|
|
169
|
+
/** Optional host-owned Evaluation identity propagated into execution events and recordings. */
|
|
170
|
+
evaluation?: EvaluationExecutionMetadata;
|
|
97
171
|
/**
|
|
98
172
|
* If implemented, chat nodes will first call this to resolve their configured endpoint to a final endpoint.
|
|
99
173
|
* You can use this for adding auth headers, or to load balance between multiple endpoints.
|
|
@@ -113,12 +187,25 @@ export type SubgraphExecutorMetadata = {
|
|
|
113
187
|
processId: ProcessId;
|
|
114
188
|
splitIndex?: number;
|
|
115
189
|
};
|
|
190
|
+
/**
|
|
191
|
+
* Optional identity attached to graph runs started by an Evaluation suite.
|
|
192
|
+
* It stays outside graph inputs so a graph never depends on an evaluation
|
|
193
|
+
* workspace being available.
|
|
194
|
+
*/
|
|
195
|
+
export type EvaluationExecutionMetadata = {
|
|
196
|
+
evaluationRunId: string;
|
|
197
|
+
suiteId: string;
|
|
198
|
+
caseId: string;
|
|
199
|
+
trialIndex: number;
|
|
200
|
+
phase: 'target' | 'evaluator';
|
|
201
|
+
};
|
|
116
202
|
export type GraphExecutionMetadata = {
|
|
117
203
|
rootRunId: RootRunId;
|
|
118
204
|
graphRunId: GraphRunId;
|
|
119
205
|
graphId: GraphId;
|
|
120
206
|
parentGraphRunId?: GraphRunId;
|
|
121
207
|
executor?: SubgraphExecutorMetadata;
|
|
208
|
+
evaluation?: EvaluationExecutionMetadata;
|
|
122
209
|
};
|
|
123
210
|
export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessContext & {
|
|
124
211
|
/** The executor that is running the current processor. */
|
|
@@ -142,6 +229,18 @@ export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessCon
|
|
|
142
229
|
isDirectRunTarget: boolean;
|
|
143
230
|
/** Stable execution lineage for the current graph invocation. */
|
|
144
231
|
execution: GraphExecutionMetadata;
|
|
232
|
+
/**
|
|
233
|
+
* Marks this invocation's terminal result as an editor-cache replay.
|
|
234
|
+
* Cache-aware node implementations call this only after confirming a hit.
|
|
235
|
+
*/
|
|
236
|
+
markResultAsEditorCacheHit?: () => void;
|
|
237
|
+
/** Emits privacy-bounded metadata after a delegated tool execution settles. */
|
|
238
|
+
onToolCallFinished?: (event: ToolCallFinishedEvent) => void;
|
|
239
|
+
/** LLM invocation that owns a connected Delegate Tool Call execution. */
|
|
240
|
+
toolCallTraceSource?: {
|
|
241
|
+
nodeId: NodeId;
|
|
242
|
+
processId: ProcessId;
|
|
243
|
+
};
|
|
145
244
|
/** Context values that are accessible on graphs and all subgraphs. */
|
|
146
245
|
contextValues: Record<string, DataValue>;
|
|
147
246
|
/** Inputs that were passed to the curent graph. Used for GraphInputNode. */
|
|
@@ -4,7 +4,7 @@ import type { ChartNode, PortId } from './NodeBase.js';
|
|
|
4
4
|
import type { GraphId } from './NodeGraph.js';
|
|
5
5
|
import type { Project } from './Project.js';
|
|
6
6
|
import type { AttachedNodeData, ExternalFunction, Outputs } from './GraphProcessor.js';
|
|
7
|
-
export type NodeProcessContextBase = Omit<InternalProcessContext, 'attachedData' | 'activeOutputPortIds' | 'createSubProcessor' | 'execution' | 'externalFunctions' | 'getPluginConfig' | 'node' | 'onPartialOutputs' | 'processId' | 'requestUserInput' | 'reportProgress' | 'isDirectRunTarget' | 'setGlobal' | 'signal' | 'toolCallContinuation' | 'waitEvent'>;
|
|
7
|
+
export type NodeProcessContextBase = Omit<InternalProcessContext, 'attachedData' | 'activeOutputPortIds' | 'createSubProcessor' | 'execution' | 'externalFunctions' | 'getPluginConfig' | 'node' | 'onPartialOutputs' | 'processId' | 'requestUserInput' | 'reportProgress' | 'isDirectRunTarget' | 'markResultAsEditorCacheHit' | 'setGlobal' | 'signal' | 'toolCallContinuation' | 'toolCallTraceSource' | 'waitEvent'>;
|
|
8
8
|
export declare function buildNodeProcessContext(options: {
|
|
9
9
|
activeOutputPortIds: ReadonlySet<PortId>;
|
|
10
10
|
base: NodeProcessContextBase;
|
|
@@ -17,6 +17,7 @@ export declare function buildNodeProcessContext(options: {
|
|
|
17
17
|
externalFunctions: Record<string, ExternalFunction>;
|
|
18
18
|
getPluginConfig: (name: string) => string | undefined;
|
|
19
19
|
isDirectRunTarget: boolean;
|
|
20
|
+
markResultAsEditorCacheHit?: InternalProcessContext['markResultAsEditorCacheHit'];
|
|
20
21
|
node: ChartNode;
|
|
21
22
|
nodeAbortController: AbortController;
|
|
22
23
|
onPartialOutputs: (partialOutputs: Outputs) => void;
|
|
@@ -25,5 +26,6 @@ export declare function buildNodeProcessContext(options: {
|
|
|
25
26
|
reportProgress: InternalProcessContext['reportProgress'];
|
|
26
27
|
setGlobal: (id: string, value: ScalarOrArrayDataValue) => void;
|
|
27
28
|
toolCallContinuation?: InternalProcessContext['toolCallContinuation'];
|
|
29
|
+
toolCallTraceSource?: InternalProcessContext['toolCallTraceSource'];
|
|
28
30
|
waitEvent: (event: string) => Promise<DataValue | undefined>;
|
|
29
31
|
}): InternalProcessContext;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ExecutionRecorder } from '../recording/ExecutionRecorder.js';
|
|
2
2
|
import type { DataValue } from './DataValue.js';
|
|
3
|
+
import type { GraphExecutionMetadata } from './ProcessContext.js';
|
|
4
|
+
import type { GraphId } from './NodeGraph.js';
|
|
3
5
|
import type { NodeId, PortId } from './NodeBase.js';
|
|
4
6
|
import type { ProcessEvents } from './GraphProcessor.js';
|
|
5
7
|
import type Emittery from 'emittery';
|
|
@@ -12,6 +14,10 @@ export declare function replayExecutionRecording(options: {
|
|
|
12
14
|
erroredNodes: Map<NodeId, Error | string>;
|
|
13
15
|
graphInputs: GraphInputs;
|
|
14
16
|
graphOutputs: GraphOutputs;
|
|
17
|
+
/** Current graph selected for replay; used only if a recording has no scoped lifecycle event. */
|
|
18
|
+
fallbackGraphId?: GraphId;
|
|
19
|
+
/** Identity already allocated by the playback processor for its own lifecycle events. */
|
|
20
|
+
initialReplayExecution?: GraphExecutionMetadata;
|
|
15
21
|
project: Project;
|
|
16
22
|
recorder: ExecutionRecorder;
|
|
17
23
|
recordingPlaybackChatLatency: number;
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { type ChartNode, type NodeInputDefinition } from './NodeBase.js';
|
|
1
|
+
import { type ChartNode, type NodeConnection, type NodeInputDefinition } from './NodeBase.js';
|
|
2
2
|
import type { ProcessId } from './ProcessContext.js';
|
|
3
3
|
import type { Inputs, Outputs } from './GraphProcessor.js';
|
|
4
|
+
type SplitRunResultOrigin = 'executed' | 'editor-cache';
|
|
4
5
|
export type SplitRunDeps = {
|
|
5
6
|
getInputValues(node: ChartNode): Inputs;
|
|
7
|
+
getInputConnections(node: ChartNode): NodeConnection[];
|
|
6
8
|
getInputDefinitions(node: ChartNode): NodeInputDefinition[];
|
|
7
9
|
isExcludedDueToControlFlow(node: ChartNode, inputValues: Inputs, processId: ProcessId): boolean;
|
|
8
|
-
processNodeWithInputData(node: ChartNode, inputs: Inputs, index: number, processId: ProcessId, partialOutput?: (node: ChartNode, partialOutputs: Outputs, index: number) => void): Promise<Outputs>;
|
|
10
|
+
processNodeWithInputData(node: ChartNode, inputs: Inputs, index: number, processId: ProcessId, partialOutput?: (node: ChartNode, partialOutputs: Outputs, index: number) => void, markResultAsEditorCacheHit?: () => void): Promise<Outputs>;
|
|
9
11
|
splitRunConcurrency: number;
|
|
10
12
|
accumulateCost(output: Outputs): void;
|
|
11
13
|
setNodeResults(nodeId: ChartNode['id'], outputs: Outputs): void;
|
|
12
14
|
markNodeVisited(nodeId: ChartNode['id']): void;
|
|
13
|
-
nodeErrored(node: ChartNode, error: unknown, processId: ProcessId, durationMs?: number, splitRunDurationMs?: Record<number, number
|
|
15
|
+
nodeErrored(node: ChartNode, error: unknown, processId: ProcessId, durationMs?: number, splitRunDurationMs?: Record<number, number>, resultOrigin?: SplitRunResultOrigin): Promise<void>;
|
|
14
16
|
isAborted(): boolean;
|
|
15
17
|
getAbortError(): Error;
|
|
16
18
|
emit(event: 'nodeStart', data: {
|
|
17
19
|
node: ChartNode;
|
|
18
20
|
inputs: Inputs;
|
|
21
|
+
inputConnections: NodeConnection[];
|
|
19
22
|
processId: ProcessId;
|
|
23
|
+
resultOrigin: 'executed';
|
|
20
24
|
}): Promise<void> | void;
|
|
21
25
|
emit(event: 'nodeFinish', data: {
|
|
22
26
|
node: ChartNode;
|
|
23
27
|
outputs: Outputs;
|
|
24
28
|
processId: ProcessId;
|
|
29
|
+
resultOrigin: SplitRunResultOrigin;
|
|
25
30
|
durationMs?: number;
|
|
26
31
|
splitRunDurationMs?: Record<number, number>;
|
|
27
32
|
}): Promise<void> | void;
|
|
@@ -30,8 +35,10 @@ export type SplitRunDeps = {
|
|
|
30
35
|
outputs: Outputs;
|
|
31
36
|
index: number;
|
|
32
37
|
processId: ProcessId;
|
|
38
|
+
resultOrigin: 'executed';
|
|
33
39
|
}): void;
|
|
34
40
|
startNodeTiming?(): number | undefined;
|
|
35
41
|
finishNodeTiming?(start: number | undefined): number | undefined;
|
|
36
42
|
};
|
|
37
43
|
export declare function processSplitRunNode(node: ChartNode, processId: ProcessId, deps: SplitRunDeps): Promise<void>;
|
|
44
|
+
export {};
|
|
@@ -41,6 +41,8 @@ export type UiGraphChatMessage = {
|
|
|
41
41
|
content: string;
|
|
42
42
|
/** UTC ISO-8601 timestamp captured by the browser when the message is shown. */
|
|
43
43
|
timestamp?: string;
|
|
44
|
+
/** Reference to separately persisted response metadata. Never sent to an LLM. */
|
|
45
|
+
responseTraceId?: string;
|
|
44
46
|
};
|
|
45
47
|
export type UiGraphChatPin = {
|
|
46
48
|
messageIndex: number;
|
|
@@ -99,6 +101,7 @@ export type UiGraphComponent = {
|
|
|
99
101
|
type: 'chat';
|
|
100
102
|
action: UiGraphChatRunGraphAction;
|
|
101
103
|
placeholder?: string;
|
|
104
|
+
allowResponseInspection?: boolean;
|
|
102
105
|
} | {
|
|
103
106
|
id: UiComponentId;
|
|
104
107
|
type: 'output';
|
|
@@ -133,6 +136,11 @@ export declare function getUiGraphChatPinsStateKey(componentId: UiComponentId):
|
|
|
133
136
|
export declare function getUiGraphChatMessages(componentId: UiComponentId, state: Readonly<Record<string, unknown>>): UiGraphChatMessage[];
|
|
134
137
|
export declare function getUiGraphChatPins(componentId: UiComponentId, state: Readonly<Record<string, unknown>>): UiGraphChatPin[];
|
|
135
138
|
export declare function createUiGraphChatPinStatePatch(componentId: UiComponentId, state: Readonly<Record<string, unknown>>, messageIndex: number): Record<string, unknown> | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Removes one persisted Chat message and keeps pinned assistant indexes aligned
|
|
141
|
+
* with the remaining history. Removing a pinned response unpins it.
|
|
142
|
+
*/
|
|
143
|
+
export declare function createUiGraphChatMessageRemovalStatePatch(componentId: UiComponentId, state: Readonly<Record<string, unknown>>, messageIndex: number): Record<string, unknown> | undefined;
|
|
136
144
|
/** Clears a Chat's conversation and pins without discarding an unsent draft. */
|
|
137
145
|
export declare function createUiGraphChatHistoryFlushStatePatch(componentId: UiComponentId): Record<string, unknown>;
|
|
138
146
|
export declare function createUiGraphChatSubmissionStatePatch(componentId: UiComponentId, state: Readonly<Record<string, unknown>>, timestamp?: string): Record<string, unknown> | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { UiComponentId } from './UiGraph.js';
|
|
2
2
|
import { type GraphProgress } from './GraphProgress.js';
|
|
3
|
+
import { type AgentResponseTrace } from './AgentResponseTrace.js';
|
|
3
4
|
export declare const RIVET_WEB_APP_ACTION_PROTOCOL_VERSION: 1;
|
|
4
5
|
export type RivetWebAppActionStartMessage = {
|
|
5
6
|
type: 'action.start';
|
|
@@ -40,10 +41,12 @@ export type RivetWebAppServerMessage = {
|
|
|
40
41
|
type: 'action.completed';
|
|
41
42
|
statePatch: Record<string, unknown>;
|
|
42
43
|
storagePatch?: Record<string, unknown>;
|
|
44
|
+
responseTrace?: AgentResponseTrace;
|
|
43
45
|
} & RunEventBase) | ({
|
|
44
46
|
type: 'action.failed';
|
|
45
47
|
error: string;
|
|
46
48
|
code?: string;
|
|
49
|
+
responseTrace?: AgentResponseTrace;
|
|
47
50
|
} & RunEventBase) | ({
|
|
48
51
|
type: 'action.cancelled';
|
|
49
52
|
} & RunEventBase) | ({
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type UiGraph, type UiGraphChatMessage } from './UiGraph.js';
|
|
2
|
+
import { type AgentResponseTrace } from './AgentResponseTrace.js';
|
|
3
|
+
type UiGraphBrowserStorage = Pick<Storage, 'getItem' | 'removeItem' | 'setItem'>;
|
|
4
|
+
type UiGraphStorageLocation = Pick<Location, 'origin' | 'pathname'>;
|
|
2
5
|
export type UiGraphChatMessageTimestampPresentation = Readonly<{
|
|
3
6
|
dateTime: string;
|
|
7
|
+
/** Present only for an assistant response with a valid preceding user-turn timestamp. */
|
|
8
|
+
elapsedSincePreviousUserMessage?: string;
|
|
4
9
|
label: string;
|
|
5
10
|
}>;
|
|
6
11
|
export type UiGraphChatMessagePresentation = Readonly<{
|
|
@@ -11,8 +16,6 @@ export type UiGraphChatMessagePresentationOptions = Readonly<{
|
|
|
11
16
|
locales?: Intl.LocalesArgument;
|
|
12
17
|
timeZone?: string;
|
|
13
18
|
}>;
|
|
14
|
-
type UiGraphBrowserStorage = Pick<Storage, 'getItem' | 'removeItem' | 'setItem'>;
|
|
15
|
-
type UiGraphStorageLocation = Pick<Location, 'origin' | 'pathname'>;
|
|
16
19
|
/**
|
|
17
20
|
* Formats persisted Chat timestamps in the current browser locale and timezone.
|
|
18
21
|
* Undated or malformed legacy messages deliberately remain present without time
|
|
@@ -23,6 +26,12 @@ export declare function getUiGraphChatMessagePresentations(messages: readonly Ui
|
|
|
23
26
|
export declare function getUiGraphChatStorageKey(uiGraph: UiGraph, location?: UiGraphStorageLocation | undefined): string | undefined;
|
|
24
27
|
/** Returns the browser-local key for graph-managed storage owned by one web app. */
|
|
25
28
|
export declare function getUiGraphWebAppStorageKey(uiGraph: UiGraph, location?: UiGraphStorageLocation | undefined): string | undefined;
|
|
29
|
+
/** Persists a validated trace outside Chat history so it never enters model context. */
|
|
30
|
+
export declare function saveUiGraphResponseTrace(uiGraph: UiGraph, componentId: string, trace: AgentResponseTrace, storage?: UiGraphBrowserStorage | undefined, location?: UiGraphStorageLocation): void;
|
|
31
|
+
/** Loads one validated response trace from the app/UI-graph-scoped store. */
|
|
32
|
+
export declare function loadUiGraphResponseTrace(uiGraph: UiGraph, componentId: string, traceId: string, storage?: UiGraphBrowserStorage | undefined, location?: UiGraphStorageLocation): AgentResponseTrace | undefined;
|
|
33
|
+
/** Removes retained traces no longer referenced by Chat messages. */
|
|
34
|
+
export declare function pruneUiGraphResponseTraces(uiGraph: UiGraph, state: Readonly<Record<string, unknown>>, storage?: UiGraphBrowserStorage | undefined, location?: UiGraphStorageLocation): void;
|
|
26
35
|
/** Loads the browser snapshot used by Stored Value nodes for this one web app. */
|
|
27
36
|
export declare function loadUiGraphWebAppStorage(uiGraph: UiGraph, storage?: UiGraphBrowserStorage | undefined, location?: UiGraphStorageLocation): Record<string, unknown>;
|
|
28
37
|
/** Merges a successful action's changed keys and persists the complete app-local record. */
|