@valerypopoff/rivet2-core 2.1.2 → 2.1.4

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.
Files changed (112) hide show
  1. package/dist/cjs/bundle.cjs +3373 -1208
  2. package/dist/cjs/bundle.cjs.map +4 -4
  3. package/dist/cjs/webAppRuntime.cjs +625 -0
  4. package/dist/cjs/webAppRuntime.cjs.map +7 -0
  5. package/dist/esm/api/createProcessor.js +3 -0
  6. package/dist/esm/api/processSettings.js +5 -0
  7. package/dist/esm/api/streaming.js +6 -0
  8. package/dist/esm/exports.js +7 -0
  9. package/dist/esm/integrations/mcp/MCPBase.js +92 -34
  10. package/dist/esm/model/GraphProcessor.js +35 -49
  11. package/dist/esm/model/GraphProgress.js +15 -0
  12. package/dist/esm/model/GraphRunLifecycle.js +67 -0
  13. package/dist/esm/model/MarkdownSanitizationPolicy.js +38 -0
  14. package/dist/esm/model/Nodes.js +3 -0
  15. package/dist/esm/model/ProcessContextBuilder.js +2 -1
  16. package/dist/esm/model/RecordingPlayer.js +10 -0
  17. package/dist/esm/model/SubprocessorBridge.js +1 -0
  18. package/dist/esm/model/UiGraph.js +181 -1
  19. package/dist/esm/model/UiGraphActionProtocol.js +122 -0
  20. package/dist/esm/model/UiGraphBindings.js +530 -0
  21. package/dist/esm/model/UiGraphBrowserRuntime.js +40 -0
  22. package/dist/esm/model/UiGraphNormalization.js +298 -0
  23. package/dist/esm/model/UiGraphRendererStyles.js +456 -6
  24. package/dist/esm/model/UiGraphRuntimeModel.js +371 -0
  25. package/dist/esm/model/UiGraphWebAppStatus.js +19 -0
  26. package/dist/esm/model/chat-v2/aiSdkBridge.js +1 -1
  27. package/dist/esm/model/chat-v2/chatV2EditorCache.js +2 -2
  28. package/dist/esm/model/chat-v2/chatV2Pipeline.js +35 -48
  29. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +98 -0
  30. package/dist/esm/model/chat-v2/chatV2RequestPlan.js +64 -0
  31. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +11 -39
  32. package/dist/esm/model/chat-v2/index.js +2 -0
  33. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +1 -0
  34. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +31 -11
  35. package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +21 -9
  36. package/dist/esm/model/chat-v2/providerOptions.js +9 -35
  37. package/dist/esm/model/nodes/ArrayNode.js +2 -13
  38. package/dist/esm/model/nodes/AssembleMessageNode.js +2 -13
  39. package/dist/esm/model/nodes/AssemblePromptNode.js +2 -13
  40. package/dist/esm/model/nodes/CoalesceNode.js +2 -15
  41. package/dist/esm/model/nodes/DelayNode.js +3 -14
  42. package/dist/esm/model/nodes/DidRunNode.js +2 -13
  43. package/dist/esm/model/nodes/JoinNode.js +2 -13
  44. package/dist/esm/model/nodes/LLMChatV2Node.js +3 -3
  45. package/dist/esm/model/nodes/LoopControllerNode.js +3 -14
  46. package/dist/esm/model/nodes/MCPDiscoveryNode.js +19 -90
  47. package/dist/esm/model/nodes/MCPGetPromptNode.js +11 -97
  48. package/dist/esm/model/nodes/MCPToolCallNode.js +11 -97
  49. package/dist/esm/model/nodes/PassthroughNode.js +3 -14
  50. package/dist/esm/model/nodes/RaceInputsNode.js +2 -13
  51. package/dist/esm/model/nodes/ReportProgressNode.js +57 -0
  52. package/dist/esm/model/nodes/variadicPortIndex.js +32 -0
  53. package/dist/esm/plugins/anthropic/anthropic.js +1 -1
  54. package/dist/esm/plugins/autoevals/AutoEvalsNode.js +3 -1
  55. package/dist/esm/plugins/gentrace/gentraceSdk.js +8 -0
  56. package/dist/esm/plugins/gentrace/plugin.js +5 -4
  57. package/dist/esm/plugins/google/google.js +9 -7
  58. package/dist/esm/recording/ExecutionRecorder.js +5 -0
  59. package/dist/esm/utils/fetchEventSource.js +16 -17
  60. package/dist/esm/utils/pQueueCompat.js +1 -1
  61. package/dist/esm/utils/serialization/serialization.js +4 -0
  62. package/dist/esm/utils/serialization/serializationUtils.js +16 -0
  63. package/dist/esm/utils/serialization/serialization_v4.js +5 -4
  64. package/dist/esm/webAppRuntime.js +4 -0
  65. package/dist/types/api/createProcessor.d.ts +1 -1
  66. package/dist/types/api/processSettings.d.ts +3 -4
  67. package/dist/types/api/streaming.d.ts +6 -0
  68. package/dist/types/exports.d.ts +7 -0
  69. package/dist/types/integrations/mcp/MCPBase.d.ts +26 -3
  70. package/dist/types/model/ExecutorProtocol.d.ts +7 -0
  71. package/dist/types/model/GraphProcessor.d.ts +7 -0
  72. package/dist/types/model/GraphProgress.d.ts +6 -0
  73. package/dist/types/model/GraphRunLifecycle.d.ts +22 -0
  74. package/dist/types/model/MarkdownSanitizationPolicy.d.ts +9 -0
  75. package/dist/types/model/Nodes.d.ts +3 -2
  76. package/dist/types/model/ProcessContext.d.ts +5 -2
  77. package/dist/types/model/ProcessContextBuilder.d.ts +2 -1
  78. package/dist/types/model/Settings.d.ts +1 -0
  79. package/dist/types/model/UiGraph.d.ts +50 -5
  80. package/dist/types/model/UiGraphActionProtocol.d.ts +69 -0
  81. package/dist/types/model/UiGraphBindings.d.ts +45 -0
  82. package/dist/types/model/UiGraphBrowserRuntime.d.ts +4 -0
  83. package/dist/types/model/UiGraphNormalization.d.ts +24 -0
  84. package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
  85. package/dist/types/model/UiGraphRuntimeModel.d.ts +124 -0
  86. package/dist/types/model/UiGraphWebAppStatus.d.ts +5 -0
  87. package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +46 -0
  88. package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +42 -0
  89. package/dist/types/model/chat-v2/chatV2Types.d.ts +1 -0
  90. package/dist/types/model/chat-v2/index.d.ts +2 -0
  91. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +1 -0
  92. package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +2 -0
  93. package/dist/types/model/chat-v2/providerOptions.d.ts +2 -2
  94. package/dist/types/model/nodes/ArrayNode.d.ts +0 -1
  95. package/dist/types/model/nodes/AssembleMessageNode.d.ts +0 -1
  96. package/dist/types/model/nodes/AssemblePromptNode.d.ts +0 -1
  97. package/dist/types/model/nodes/DelayNode.d.ts +0 -1
  98. package/dist/types/model/nodes/DidRunNode.d.ts +0 -1
  99. package/dist/types/model/nodes/JoinNode.d.ts +0 -1
  100. package/dist/types/model/nodes/LoopControllerNode.d.ts +0 -1
  101. package/dist/types/model/nodes/PassthroughNode.d.ts +0 -1
  102. package/dist/types/model/nodes/RaceInputsNode.d.ts +0 -1
  103. package/dist/types/model/nodes/ReportProgressNode.d.ts +23 -0
  104. package/dist/types/model/nodes/variadicPortIndex.d.ts +4 -0
  105. package/dist/types/plugins/gentrace/gentraceSdk.d.ts +5 -0
  106. package/dist/types/plugins/gentrace/plugin.d.ts +1 -1
  107. package/dist/types/recording/RecordedEvents.d.ts +5 -0
  108. package/dist/types/utils/pQueueCompat.d.ts +1 -1
  109. package/dist/types/webAppRuntime.d.ts +9 -0
  110. package/package.json +15 -9
  111. package/dist/esm/plugins/anthropic/fetchEventSource.js +0 -107
  112. package/dist/types/plugins/anthropic/fetchEventSource.d.ts +0 -11
@@ -27,6 +27,7 @@ export * from './nodes/TrimChatMessagesNode.js';
27
27
  export * from './nodes/ExternalCallNode.js';
28
28
  export * from './nodes/ExtractObjectPathNode.js';
29
29
  export * from './nodes/RaiseEventNode.js';
30
+ export * from './nodes/ReportProgressNode.js';
30
31
  export * from './nodes/ContextNode.js';
31
32
  export * from './nodes/CoalesceNode.js';
32
33
  export * from './nodes/DidRunNode.js';
@@ -90,12 +91,12 @@ export * from './nodes/MCPToolCallNode.js';
90
91
  export * from './nodes/MCPGetPromptNode.js';
91
92
  export * from './nodes/ReferencedGraphAliasNode.js';
92
93
  export * from './nodes/NodePrefabInstanceNode.js';
93
- export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "comment" | "subGraph" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/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/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
94
+ export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "code" | "context" | "array" | "codeNew" | "comment" | "subGraph" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "reportProgress" | "getGlobal" | "setGlobal" | "abortGraph" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/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/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
94
95
  type: "mcpDiscovery";
95
96
  data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
96
97
  variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
97
98
  }) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode>;
98
- declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "codeNew" | "comment" | "subGraph" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "getGlobal" | "setGlobal" | "abortGraph" | "chat" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/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/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
99
+ declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "code" | "context" | "array" | "codeNew" | "comment" | "subGraph" | "graphInput" | "graphOutput" | "userInput" | "prompt" | "raiseEvent" | "reportProgress" | "getGlobal" | "setGlobal" | "abortGraph" | "llmChatV2" | "extractRegex" | "expression" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "coalesce" | "didRun" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/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/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
99
100
  type: "mcpDiscovery";
100
101
  data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
101
102
  variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
@@ -1,11 +1,12 @@
1
1
  import type { Opaque } from 'type-fest';
2
- import { type Settings, type NativeApi, type Project, type DataValue, type ExternalFunction, type Outputs, type GraphId, type GraphProcessor, type ScalarOrArrayDataValue, type DatasetProvider, type ChartNode, type NodeId, type PortId, type AttachedNodeData, type AudioProvider, type StringArrayDataValue, type ProjectId, type MCPProvider } from '../index.js';
2
+ import { type RuntimeSettings, type NativeApi, type Project, type DataValue, type ExternalFunction, type Outputs, type GraphId, type GraphProcessor, type ScalarOrArrayDataValue, type DatasetProvider, type ChartNode, type NodeId, type PortId, type AttachedNodeData, type AudioProvider, type StringArrayDataValue, type ProjectId, type MCPProvider } from '../index.js';
3
3
  import type { Tokenizer } from '../integrations/Tokenizer.js';
4
4
  import type { CodeRunner } from '../integrations/CodeRunner.js';
5
5
  import type { ProjectReferenceLoader } from './ProjectReferenceLoader.js';
6
6
  import type { GraphBoundary } from './GraphBoundaryCache.js';
7
+ import type { GraphProgress } from './GraphProgress.js';
7
8
  export type ProcessContext = {
8
- settings: Settings;
9
+ settings: RuntimeSettings;
9
10
  nativeApi?: NativeApi;
10
11
  /** Sets the dataset provider to be used for all dataset node calls. */
11
12
  datasetProvider?: DatasetProvider;
@@ -85,6 +86,8 @@ export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessCon
85
86
  attachedData: AttachedNodeData;
86
87
  /** Raises a user event that can be listened for on the GraphProcessor. */
87
88
  raiseEvent: (eventName: string, data: DataValue | undefined) => void;
89
+ /** Reports sanitized public progress to progress-aware graph hosts. */
90
+ reportProgress: (progress: GraphProgress) => void;
88
91
  waitEvent: (eventName: string) => Promise<DataValue | undefined>;
89
92
  /** External functions that have been defined on the GraphProcessor (or its parent). */
90
93
  externalFunctions: Record<string, ExternalFunction>;
@@ -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' | 'isDirectRunTarget' | 'setGlobal' | 'signal' | 'waitEvent'>;
7
+ export type NodeProcessContextBase = Omit<InternalProcessContext, 'attachedData' | 'activeOutputPortIds' | 'createSubProcessor' | 'execution' | 'externalFunctions' | 'getPluginConfig' | 'node' | 'onPartialOutputs' | 'processId' | 'requestUserInput' | 'reportProgress' | 'isDirectRunTarget' | 'setGlobal' | 'signal' | 'waitEvent'>;
8
8
  export declare function buildNodeProcessContext(options: {
9
9
  activeOutputPortIds: ReadonlySet<PortId>;
10
10
  base: NodeProcessContextBase;
@@ -22,6 +22,7 @@ export declare function buildNodeProcessContext(options: {
22
22
  onPartialOutputs: (partialOutputs: Outputs) => void;
23
23
  processId: ProcessId;
24
24
  requestUserInput: (inputStrings: string[], renderingType: 'text' | 'markdown') => Promise<StringArrayDataValue>;
25
+ reportProgress: InternalProcessContext['reportProgress'];
25
26
  setGlobal: (id: string, value: ScalarOrArrayDataValue) => void;
26
27
  waitEvent: (event: string) => Promise<DataValue | undefined>;
27
28
  }): InternalProcessContext;
@@ -22,3 +22,4 @@ export interface Settings<PluginSettings = Record<string, Record<string, unknown
22
22
  chatNodeHeaders?: Record<string, string>;
23
23
  throttleChatNode?: number;
24
24
  }
25
+ export type RuntimeSettings<PluginSettings = Record<string, Record<string, unknown>>> = Required<Settings<PluginSettings>> & Record<string, unknown>;
@@ -4,6 +4,10 @@ import type { DataValue } from './DataValue.js';
4
4
  export type UiGraphId = Opaque<string, 'UiGraphId'>;
5
5
  export type UiComponentId = Opaque<string, 'UiComponentId'>;
6
6
  export type UiGraphOutputs = Record<string, DataValue>;
7
+ export declare const UI_GRAPH_GAP_SIZES: readonly ["small", "medium", "large"];
8
+ export type UiGraphGapSize = (typeof UI_GRAPH_GAP_SIZES)[number];
9
+ export declare const UI_GRAPH_OUTPUT_RENDER_MODES: readonly ["text", "json", "markdown", "image"];
10
+ export type UiGraphOutputRenderMode = (typeof UI_GRAPH_OUTPUT_RENDER_MODES)[number];
7
11
  export type UiGraphValueBinding = {
8
12
  type: 'state';
9
13
  key: string;
@@ -20,6 +24,18 @@ export type UiGraphRunGraphAction = {
20
24
  outputKey?: string;
21
25
  outputStateKey?: string;
22
26
  };
27
+ export type UiGraphChatRunGraphAction = {
28
+ type: 'runGraph';
29
+ graphId?: GraphId;
30
+ userInputId?: string;
31
+ historyInputId?: string;
32
+ responseOutputId?: string;
33
+ inputMappings?: UiGraphInputBinding[];
34
+ };
35
+ export type UiGraphChatMessage = {
36
+ role: 'assistant' | 'user';
37
+ content: string;
38
+ };
23
39
  export type UiGraphInputBinding = {
24
40
  inputKey: string;
25
41
  stateKey: string;
@@ -37,6 +53,10 @@ export type UiGraphComponent = {
37
53
  id: UiComponentId;
38
54
  type: 'markdown';
39
55
  markdown: string;
56
+ } | {
57
+ id: UiComponentId;
58
+ type: 'gap';
59
+ size: UiGraphGapSize;
40
60
  } | {
41
61
  id: UiComponentId;
42
62
  type: 'input';
@@ -56,12 +76,17 @@ export type UiGraphComponent = {
56
76
  type: 'button';
57
77
  label: string;
58
78
  action: UiGraphAction;
79
+ } | {
80
+ id: UiComponentId;
81
+ type: 'chat';
82
+ action: UiGraphChatRunGraphAction;
83
+ placeholder?: string;
59
84
  } | {
60
85
  id: UiComponentId;
61
86
  type: 'output';
62
87
  label?: string;
63
88
  stateKey: string;
64
- renderAs?: 'text' | 'json' | 'markdown';
89
+ renderAs?: UiGraphOutputRenderMode;
65
90
  };
66
91
  export type UiGraph = {
67
92
  id: UiGraphId;
@@ -69,15 +94,35 @@ export type UiGraph = {
69
94
  description?: string;
70
95
  components: UiGraphComponent[];
71
96
  };
97
+ export type UiGraphActionComponent = Extract<UiGraphComponent, {
98
+ type: 'button' | 'chat';
99
+ }>;
100
+ export declare function hasValidUiGraphComponentIds(uiGraph: UiGraph): boolean;
101
+ /**
102
+ * Returns an immutable component-ID repair for legacy or externally assembled
103
+ * UI graphs. Full untrusted-data validation belongs to normalizeUiGraph().
104
+ */
105
+ export declare function normalizeUiGraphComponentIds(uiGraph: UiGraph): UiGraph;
72
106
  export declare function createDefaultUiGraph(options?: {
73
107
  graphId?: GraphId;
74
108
  name?: string;
75
109
  }): UiGraph;
76
110
  export declare function getUiGraphInitialState(uiGraph: UiGraph): Record<string, unknown>;
77
- export declare function getUiGraphActionComponent(uiGraph: UiGraph, componentId: UiComponentId): Extract<UiGraphComponent, {
78
- type: 'button';
79
- }> | undefined;
80
- export declare function resolveUiGraphActionInputs(action: UiGraphRunGraphAction, state: Record<string, unknown>): Record<string, unknown>;
111
+ export declare function getUiGraphActionComponent(uiGraph: UiGraph, componentId: UiComponentId): UiGraphActionComponent | undefined;
112
+ export declare function getUiGraphChatDraftStateKey(componentId: UiComponentId): string;
113
+ export declare function getUiGraphChatMessagesStateKey(componentId: UiComponentId): string;
114
+ export declare function getUiGraphChatMessages(componentId: UiComponentId, state: Readonly<Record<string, unknown>>): UiGraphChatMessage[];
115
+ export declare function createUiGraphChatSubmissionStatePatch(componentId: UiComponentId, state: Readonly<Record<string, unknown>>): Record<string, unknown> | undefined;
116
+ export declare function getUiGraphComponentActionState(component: UiGraphActionComponent, state: Readonly<Record<string, unknown>>): Record<string, unknown>;
117
+ export declare function resolveUiGraphComponentActionInputs(component: UiGraphActionComponent, state: Readonly<Record<string, unknown>>): Record<string, unknown>;
118
+ export declare function resolveUiGraphComponentActionOutputStatePatch(component: UiGraphActionComponent, outputs: UiGraphOutputs, state: Readonly<Record<string, unknown>>): Record<string, unknown>;
119
+ export declare function getUiGraphComponentActionOutputStateKeys(component: UiGraphActionComponent): string[];
120
+ export declare function resolveUiGraphActionInputs(action: UiGraphRunGraphAction, state: Readonly<Record<string, unknown>>): Record<string, unknown>;
121
+ /**
122
+ * Selects the UI state that a button action is explicitly allowed to send.
123
+ * Outputs and unrelated form fields stay local to the rendered web app.
124
+ */
125
+ export declare function getUiGraphActionState(action: UiGraphRunGraphAction, state: Readonly<Record<string, unknown>>): Record<string, unknown>;
81
126
  export declare function resolveUiGraphActionOutputStateValue(action: UiGraphRunGraphAction, outputs: UiGraphOutputs): unknown;
82
127
  export declare function resolveUiGraphActionOutputStatePatch(action: UiGraphRunGraphAction, outputs: UiGraphOutputs): Record<string, unknown>;
83
128
  export declare function getUiGraphActionOutputBindings(action: UiGraphRunGraphAction): UiGraphOutputBinding[];
@@ -0,0 +1,69 @@
1
+ import type { UiComponentId } from './UiGraph.js';
2
+ import { type GraphProgress } from './GraphProgress.js';
3
+ export declare const RIVET_WEB_APP_ACTION_PROTOCOL_VERSION: 1;
4
+ export type RivetWebAppActionStartMessage = {
5
+ type: 'action.start';
6
+ requestId: string;
7
+ componentId: UiComponentId;
8
+ revisionKey?: string;
9
+ state: Record<string, unknown>;
10
+ };
11
+ export type RivetWebAppActionCancelMessage = {
12
+ type: 'action.cancel';
13
+ runId: string;
14
+ };
15
+ export type RivetWebAppRunResumeMessage = {
16
+ type: 'run.resume';
17
+ runId: string;
18
+ lastSequence: number;
19
+ };
20
+ export type RivetWebAppClientHelloMessage = {
21
+ type: 'client.hello';
22
+ protocolVersion: typeof RIVET_WEB_APP_ACTION_PROTOCOL_VERSION;
23
+ };
24
+ export type RivetWebAppClientMessage = RivetWebAppClientHelloMessage | RivetWebAppActionStartMessage | RivetWebAppActionCancelMessage | RivetWebAppRunResumeMessage;
25
+ type RunEventBase = {
26
+ requestId: string;
27
+ runId: string;
28
+ sequence: number;
29
+ };
30
+ export type RivetWebAppServerMessage = {
31
+ type: 'server.ready';
32
+ protocolVersion: typeof RIVET_WEB_APP_ACTION_PROTOCOL_VERSION;
33
+ } | ({
34
+ type: 'action.accepted';
35
+ } & RunEventBase) | ({
36
+ type: 'action.progress';
37
+ progress: GraphProgress;
38
+ } & RunEventBase) | ({
39
+ type: 'action.completed';
40
+ statePatch: Record<string, unknown>;
41
+ } & RunEventBase) | ({
42
+ type: 'action.failed';
43
+ error: string;
44
+ code?: string;
45
+ } & RunEventBase) | ({
46
+ type: 'action.cancelled';
47
+ } & RunEventBase) | ({
48
+ type: 'action.interrupted';
49
+ error: string;
50
+ } & RunEventBase) | {
51
+ type: 'action.rejected';
52
+ requestId: string;
53
+ error: string;
54
+ code?: string;
55
+ } | {
56
+ type: 'run.rejected';
57
+ runId: string;
58
+ error: string;
59
+ code?: string;
60
+ } | {
61
+ type: 'server.draining';
62
+ };
63
+ export type RivetWebAppRunEvent = Exclude<RivetWebAppServerMessage, {
64
+ type: 'server.ready' | 'action.rejected' | 'run.rejected' | 'server.draining';
65
+ }>;
66
+ export declare function parseRivetWebAppClientMessage(value: unknown): RivetWebAppClientMessage | undefined;
67
+ export declare function parseRivetWebAppServerMessage(value: unknown): RivetWebAppServerMessage | undefined;
68
+ export declare function isRivetWebAppRunTerminalEvent(event: RivetWebAppRunEvent): boolean;
69
+ export {};
@@ -0,0 +1,45 @@
1
+ import { type GraphBoundary } from './GraphBoundaryCache.js';
2
+ import type { GraphId } from './NodeGraph.js';
3
+ import type { Project } from './Project.js';
4
+ import { type UiComponentId, type UiGraph, type UiGraphChatRunGraphAction, type UiGraphId, type UiGraphInputBinding, type UiGraphOutputBinding, type UiGraphRunGraphAction } from './UiGraph.js';
5
+ export type UiGraphButtonBindingRenames = {
6
+ inputIds?: Readonly<Record<string, string>>;
7
+ outputIds?: Readonly<Record<string, string>>;
8
+ };
9
+ export type UiGraphActionBindingIssue = {
10
+ code: 'duplicate-chat-input' | 'duplicate-input-binding' | 'duplicate-output-state-key' | 'empty-input-id' | 'empty-input-state-key' | 'empty-output-state-key' | 'missing-chat-history-input' | 'missing-chat-response-output' | 'missing-chat-user-input' | 'missing-target-graph' | 'stale-input-binding' | 'stale-output-binding' | 'target-graph-not-found';
11
+ componentId: UiComponentId;
12
+ graphId?: GraphId;
13
+ message: string;
14
+ portId?: string;
15
+ severity: 'error';
16
+ uiGraphId: UiGraphId;
17
+ };
18
+ /** @deprecated Use UiGraphActionBindingIssue for Button and Chat components. */
19
+ export type UiGraphButtonBindingIssue = UiGraphActionBindingIssue;
20
+ /**
21
+ * Aligns a button with a graph boundary without guessing by row position.
22
+ * Exact IDs win; state keys cross an ID change only for a proven node rename.
23
+ */
24
+ export declare function reconcileUiGraphRunGraphActionBindings(action: UiGraphRunGraphAction, boundary: GraphBoundary, renames?: UiGraphButtonBindingRenames): UiGraphRunGraphAction;
25
+ /** Seeds a new button from ordered factory placeholder data keys. */
26
+ export declare function initializeUiGraphRunGraphActionBindings(action: UiGraphRunGraphAction, boundary: GraphBoundary): UiGraphRunGraphAction;
27
+ /** Seeds the three graph-boundary roles required by a new Chat component. */
28
+ export declare function initializeUiGraphChatActionBindings(action: UiGraphChatRunGraphAction, boundary: GraphBoundary | undefined): UiGraphChatRunGraphAction;
29
+ export declare function reconcileUiGraphChatActionBindings(action: UiGraphChatRunGraphAction, boundary: GraphBoundary, renames?: UiGraphButtonBindingRenames, changed?: {
30
+ inputs: boolean;
31
+ outputs: boolean;
32
+ }): UiGraphChatRunGraphAction;
33
+ export declare function getReconciledUiGraphActionInputBindings(action: UiGraphRunGraphAction, boundary: GraphBoundary): UiGraphInputBinding[];
34
+ export declare function getReconciledUiGraphActionOutputBindings(action: UiGraphRunGraphAction, boundary: GraphBoundary): UiGraphOutputBinding[];
35
+ /** Reconciles workflow-bound UI components for changed graph boundaries. */
36
+ export declare function reconcileProjectUiGraphBindings<TProject extends Project>(previousProject: TProject, nextProject: TProject): TProject;
37
+ /** @deprecated Use reconcileProjectUiGraphBindings for all workflow-bound components. */
38
+ export declare const reconcileProjectUiGraphButtonBindings: typeof reconcileProjectUiGraphBindings;
39
+ /** Non-mutating preflight for desktop and hosted web-app runners. */
40
+ export declare function validateUiGraphActionBindings(project: Project, uiGraph: UiGraph, componentId?: UiComponentId): UiGraphActionBindingIssue[];
41
+ export declare function validateUiGraphButtonBindings(project: Project, uiGraph: UiGraph, componentId?: UiComponentId): UiGraphButtonBindingIssue[];
42
+ export declare function validateProjectUiGraphButtonBindings(project: Project): UiGraphButtonBindingIssue[];
43
+ export declare function validateProjectUiGraphActionBindings(project: Project): UiGraphActionBindingIssue[];
44
+ export declare function formatUiGraphActionBindingIssues(issues: readonly UiGraphActionBindingIssue[]): string;
45
+ export declare function formatUiGraphButtonBindingIssues(issues: readonly UiGraphButtonBindingIssue[]): string;
@@ -0,0 +1,4 @@
1
+ /** Copies rendered web-app output without requiring the modern Clipboard API. */
2
+ export declare function copyUiGraphText(value: string): Promise<boolean>;
3
+ /** Downloads the exact JSON string rendered by a web-app output component. */
4
+ export declare function downloadUiGraphJsonOutput(value: string, appName: string): void;
@@ -0,0 +1,24 @@
1
+ import type { Project } from './Project.js';
2
+ import { type UiGraph, type UiGraphId } from './UiGraph.js';
3
+ export type UiGraphNormalizationIssue = {
4
+ message: string;
5
+ path: string;
6
+ };
7
+ export type UiGraphNormalizationOptions = {
8
+ /** Disable only when validating raw data before known legacy ID repair. */
9
+ repairComponentIds?: boolean;
10
+ };
11
+ export declare class UiGraphNormalizationError extends Error {
12
+ readonly issues: readonly UiGraphNormalizationIssue[];
13
+ constructor(issues: readonly UiGraphNormalizationIssue[]);
14
+ }
15
+ export declare function formatUiGraphNormalizationIssue(issue: UiGraphNormalizationIssue): string;
16
+ /**
17
+ * Validates every UI graph and component discriminator while applying only the
18
+ * deterministic component-ID repair supported for legacy project snapshots.
19
+ */
20
+ export declare function normalizeUiGraph(value: unknown, options?: UiGraphNormalizationOptions): UiGraph;
21
+ export declare function normalizeUiGraphRecord(value: unknown, options?: UiGraphNormalizationOptions): Record<UiGraphId, UiGraph>;
22
+ export declare function normalizeProjectUiGraphs<T extends {
23
+ uiGraphs?: Project['uiGraphs'];
24
+ }>(project: T): T;
@@ -1,2 +1,2 @@
1
- export declare const RIVET_WEB_APP_RENDERER_CSS = "\n.rivet-web-app-root {\n --rivet-web-app-background: var(--grey-dark-colorish, #1c222b);\n --rivet-web-app-foreground: var(--foreground, #ffffff);\n --rivet-web-app-card-background: color-mix(in srgb, var(--modal-surface-bg, #252b34) 88%, var(--foreground, #ffffff) 4%);\n --rivet-web-app-card-border: var(--foldable-section-border, rgba(255, 255, 255, 0.04));\n --rivet-web-app-control-background: var(--form-control-bg, #20252d);\n --rivet-web-app-control-border: var(--form-control-border, rgba(255, 255, 255, 0.14));\n --rivet-web-app-button-radius: var(--rivet-web-app-host-button-radius, 6px);\n --rivet-web-app-button-background: var(--success, #3ba85b);\n --rivet-web-app-button-foreground: var(--grey-lightest, #ffffff);\n --rivet-web-app-output-title: var(--rivet-web-app-foreground, #ffffff);\n --rivet-web-app-error-color: var(--error, #ff6b5f);\n --rivet-web-app-font-size: var(--rivet-web-app-host-font-size, 15px);\n box-sizing: border-box;\n height: 100%;\n background: var(--rivet-web-app-background);\n color: var(--rivet-web-app-foreground);\n overflow: auto;\n font-family: Inter, system-ui, sans-serif;\n font-size: var(--rivet-web-app-font-size);\n line-height: 1.4;\n}\n\n.rivet-web-app-root *,\n.rivet-web-app-root *::before,\n.rivet-web-app-root *::after {\n box-sizing: border-box;\n}\n\n.rivet-web-app-surface {\n display: grid;\n gap: 16px;\n margin: 0 auto;\n max-width: 760px;\n padding: 48px 20px;\n}\n\n.rivet-web-app-card,\n.rivet-web-app-field {\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 10px;\n background: var(--rivet-web-app-card-background);\n padding: 16px;\n}\n\n.rivet-web-app-component-frame {\n border-radius: 12px;\n margin: -5px;\n padding: 4px;\n}\n\n.rivet-web-app-component-frame.active {\n background: color-mix(in srgb, var(--modal-surface-bg, #252b34) 75%, var(--primary, #ff9e2c) 16%);\n}\n\n.rivet-web-app-field {\n display: grid;\n gap: 8px;\n color: var(--rivet-web-app-foreground);\n font-size: inherit;\n font-weight: 600;\n}\n\n.rivet-web-app-field input,\n.rivet-web-app-field textarea {\n appearance: none;\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--rivet-web-app-control-border);\n border-radius: 8px;\n background: var(--rivet-web-app-control-background);\n color: var(--rivet-web-app-foreground);\n font: inherit;\n font-weight: 400;\n padding: 10px 12px;\n}\n\n.rivet-web-app-field textarea {\n min-height: 110px;\n resize: vertical;\n}\n\n.rivet-web-app-button {\n width: fit-content;\n border: 0;\n border-radius: var(--rivet-web-app-button-radius);\n background: var(--rivet-web-app-button-background);\n color: var(--rivet-web-app-button-foreground);\n cursor: pointer;\n font: inherit;\n font-weight: 700;\n padding: 10px 16px;\n}\n\n.rivet-web-app-button:disabled {\n cursor: wait;\n opacity: 0.72;\n}\n\n.rivet-web-app-output {\n display: grid;\n gap: 8px;\n}\n\n.rivet-web-app-output-title {\n color: var(--rivet-web-app-output-title);\n font-weight: 700;\n}\n\n.rivet-web-app-output pre {\n margin: 0;\n background: transparent;\n border-radius: 0;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: inherit;\n padding: 0;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.rivet-web-app-markdown,\n.rivet-web-app-output-markdown {\n word-break: break-word;\n}\n\n.rivet-web-app-markdown.markdown-body {\n background: var(--rivet-web-app-card-background);\n font-family: inherit;\n min-width: 0;\n}\n\n.rivet-web-app-output-markdown.markdown-body {\n background: transparent;\n font-family: inherit;\n min-width: 0;\n}\n\n.rivet-web-app-markdown h1,\n.rivet-web-app-output-markdown h1 {\n margin: 0 0 12px;\n padding-bottom: 8px;\n border-bottom: 1px solid var(--rivet-web-app-card-border);\n font-size: 24px;\n line-height: 1.22;\n}\n\n.rivet-web-app-markdown h2,\n.rivet-web-app-output-markdown h2 {\n margin: 0 0 10px;\n font-size: 20px;\n line-height: 1.25;\n}\n\n.rivet-web-app-markdown p,\n.rivet-web-app-output-markdown p,\n.rivet-web-app-markdown ul,\n.rivet-web-app-output-markdown ul {\n margin: 0 0 12px;\n}\n\n.rivet-web-app-markdown.markdown-body code,\n.rivet-web-app-output-markdown.markdown-body code {\n border-radius: 4px;\n background: color-mix(in srgb, var(--rivet-web-app-control-background) 70%, var(--rivet-web-app-foreground) 6%);\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n padding: 1px 4px;\n}\n\n.rivet-web-app-markdown.markdown-body pre,\n.rivet-web-app-output-markdown.markdown-body pre {\n background: transparent;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n padding: 0;\n white-space: pre-wrap;\n}\n\n.rivet-web-app-markdown > :first-child,\n.rivet-web-app-output-markdown > :first-child {\n margin-top: 0;\n}\n\n.rivet-web-app-markdown > :last-child,\n.rivet-web-app-output-markdown > :last-child {\n margin-bottom: 0;\n}\n\n.rivet-web-app-error {\n color: var(--rivet-web-app-error-color);\n font-weight: 700;\n}\n\n.rivet-web-app-modal-backdrop {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: grid;\n place-items: center;\n background: rgba(0, 0, 0, 0.46);\n background: color-mix(in srgb, var(--rivet-web-app-background) 78%, transparent);\n padding: 20px;\n}\n\n.rivet-web-app-modal {\n display: grid;\n gap: 18px;\n width: min(420px, 100%);\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 12px;\n background: var(--rivet-web-app-card-background);\n box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);\n color: var(--rivet-web-app-foreground);\n padding: 22px;\n}\n\n.rivet-web-app-modal-message {\n font-size: 18px;\n font-weight: 700;\n line-height: 1.3;\n}\n\n.rivet-web-app-modal-button {\n justify-self: start;\n}\n";
1
+ export declare const RIVET_WEB_APP_RENDERER_CSS = "\n.rivet-web-app-root {\n --rivet-web-app-background: var(--grey-dark-colorish, #1c222b);\n --rivet-web-app-foreground: var(--foreground, #ffffff);\n --rivet-web-app-card-background: color-mix(in srgb, var(--modal-surface-bg, #252b34) 88%, var(--foreground, #ffffff) 4%);\n --rivet-web-app-card-border: var(--foldable-section-border, rgba(255, 255, 255, 0.04));\n --rivet-web-app-control-background: var(--form-control-bg, #20252d);\n --rivet-web-app-control-border: var(--form-control-border, rgba(255, 255, 255, 0.14));\n --rivet-web-app-button-radius: var(--rivet-web-app-host-button-radius, var(--ui-button-radius, 6px));\n --rivet-web-app-button-height: calc(32px * var(--ui-font-scale, 1));\n --rivet-web-app-button-background: var(--success, #3ba85b);\n --rivet-web-app-button-foreground: var(--grey-lightest, #ffffff);\n --rivet-web-app-output-title: var(--rivet-web-app-foreground, #ffffff);\n --rivet-web-app-error-color: var(--error, #ff6b5f);\n --rivet-web-app-font-size: var(--rivet-web-app-host-font-size, 15px);\n --rivet-web-app-chat-min-height: clamp(360px, calc(100vh - 136px), 540px);\n box-sizing: border-box;\n height: 100%;\n background: var(--rivet-web-app-background);\n color: var(--rivet-web-app-foreground);\n overflow: auto;\n font-family: Inter, system-ui, sans-serif;\n font-size: var(--rivet-web-app-font-size);\n line-height: 1.4;\n}\n\n.rivet-web-app-root *,\n.rivet-web-app-root *::before,\n.rivet-web-app-root *::after {\n box-sizing: border-box;\n}\n\n.rivet-web-app-surface {\n display: flex;\n flex-direction: column;\n gap: 16px;\n height: 100%;\n margin: 0 auto;\n max-width: 760px;\n padding: 48px 20px;\n}\n\n.rivet-web-app-card,\n.rivet-web-app-field {\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 10px;\n background: var(--rivet-web-app-card-background);\n padding: 16px;\n}\n\n.rivet-web-app-text {\n background: transparent;\n}\n\n.rivet-web-app-gap {\n width: 100%;\n border: 0;\n background: transparent;\n}\n\n.rivet-web-app-gap-small {\n height: 8px;\n}\n\n.rivet-web-app-gap-medium {\n height: 24px;\n}\n\n.rivet-web-app-gap-large {\n height: 48px;\n}\n\n.rivet-web-app-component-frame {\n flex: 0 0 auto;\n border-radius: 12px;\n margin: -5px;\n padding: 4px;\n}\n\n.rivet-web-app-component-frame[data-rivet-web-app-component-type='chat'] {\n display: flex;\n flex: 1 0 var(--rivet-web-app-chat-min-height);\n min-height: var(--rivet-web-app-chat-min-height);\n}\n\n.rivet-web-app-component-frame.active {\n background: color-mix(in srgb, var(--modal-surface-bg, #252b34) 75%, var(--primary, #ff9e2c) 16%);\n}\n\n.rivet-web-app-field {\n display: grid;\n gap: 8px;\n color: var(--rivet-web-app-foreground);\n font-size: inherit;\n font-weight: 600;\n}\n\n.rivet-web-app-field input,\n.rivet-web-app-field textarea {\n appearance: none;\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--rivet-web-app-control-border);\n border-radius: 8px;\n background: var(--rivet-web-app-control-background);\n color: var(--rivet-web-app-foreground);\n font: inherit;\n font-weight: 400;\n padding: 10px 12px;\n}\n\n.rivet-web-app-field textarea {\n min-height: 110px;\n resize: vertical;\n}\n\n.rivet-web-app-button {\n width: fit-content;\n border: 0;\n border-radius: var(--rivet-web-app-button-radius);\n background: var(--rivet-web-app-button-background);\n color: var(--rivet-web-app-button-foreground);\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font: inherit;\n font-family: var(--font-family, Inter, system-ui, sans-serif);\n font-size: var(--ui-font-size-base, var(--rivet-web-app-font-size));\n height: var(--rivet-web-app-button-height);\n margin: 0;\n padding: 0.5rem 1rem;\n corner-shape: squircle;\n}\n\n.rivet-web-app-button:disabled {\n background: var(--grey-darkish, #30343b);\n color: var(--grey-light, #b6b8bf);\n cursor: wait;\n opacity: 0.8;\n}\n\n.rivet-web-app-button:hover:not(:disabled) {\n background: var(--success-dark, #009624);\n}\n\n.rivet-web-app-running-indicator {\n box-sizing: border-box;\n color: currentColor;\n display: inline-block;\n width: calc(16px * var(--ui-font-scale, 1));\n height: calc(16px * var(--ui-font-scale, 1));\n border: calc(2px * var(--ui-font-scale, 1)) solid currentColor;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-radius: 50%;\n flex: 0 0 auto;\n pointer-events: none;\n animation: rivet-web-app-running-indicator-spin 0.8s linear infinite;\n}\n\n@keyframes rivet-web-app-running-indicator-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.rivet-web-app-action-stack {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n min-width: 0;\n}\n\n.rivet-web-app-action-stack-running > .rivet-web-app-button,\n.rivet-web-app-action-stack-running > .rivet-web-app-abort-button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: var(--rivet-web-app-button-height);\n min-height: var(--rivet-web-app-button-height);\n padding: 0.5rem 1rem;\n}\n\n.rivet-web-app-action-stack-running > .rivet-web-app-button {\n gap: 8px;\n white-space: nowrap;\n}\n\n.rivet-web-app-action-stack .rivet-web-app-progress {\n flex: 0 0 100%;\n}\n\n.rivet-web-app-abort-button {\n flex: 0 0 auto;\n border: 1px solid var(--rivet-web-app-control-border);\n border-radius: var(--rivet-web-app-button-radius);\n background: transparent;\n color: var(--rivet-web-app-foreground);\n cursor: pointer;\n font: inherit;\n font-size: var(--ui-font-size-base, var(--rivet-web-app-font-size));\n padding: 6px 10px;\n}\n\n.rivet-web-app-abort-button:hover,\n.rivet-web-app-abort-button:focus-visible {\n border-color: color-mix(in srgb, var(--rivet-web-app-foreground) 40%, transparent);\n outline: none;\n}\n\n.rivet-web-app-progress {\n display: grid;\n gap: 5px;\n color: color-mix(in srgb, var(--rivet-web-app-foreground) 68%, transparent);\n font-size: 13px;\n min-width: 0;\n}\n\n.rivet-web-app-progress progress {\n width: min(320px, 100%);\n height: 6px;\n accent-color: var(--rivet-web-app-button-background);\n}\n\n.rivet-web-app-chat {\n display: grid;\n flex: 1;\n grid-template-rows: auto minmax(0, 1fr) auto auto;\n min-height: 0;\n width: 100%;\n overflow: hidden;\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 14px;\n background: var(--rivet-web-app-card-background);\n}\n\n.rivet-web-app-chat-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: 52px;\n border-bottom: 1px solid var(--rivet-web-app-card-border);\n padding: 0 18px;\n font-weight: 700;\n}\n\n.rivet-web-app-chat-status {\n color: color-mix(in srgb, var(--rivet-web-app-foreground) 56%, transparent);\n font-size: 12px;\n font-weight: 500;\n}\n\n.rivet-web-app-chat-header-actions {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.rivet-web-app-chat > .rivet-web-app-progress {\n border-top: 1px solid var(--rivet-web-app-card-border);\n padding: 10px 14px 0;\n}\n\n.rivet-web-app-chat-messages {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-height: 0;\n overflow-y: auto;\n padding: 22px 18px;\n scrollbar-gutter: stable;\n}\n\n.rivet-web-app-chat-messages > :first-child {\n margin-top: auto;\n}\n\n.rivet-web-app-chat-empty {\n display: grid;\n place-content: center;\n gap: 6px;\n flex: 1;\n min-height: 220px;\n color: color-mix(in srgb, var(--rivet-web-app-foreground) 56%, transparent);\n text-align: center;\n}\n\n.rivet-web-app-chat-empty strong {\n color: var(--rivet-web-app-foreground);\n font-size: 17px;\n}\n\n.rivet-web-app-chat-message {\n width: fit-content;\n max-width: min(82%, 620px);\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 14px;\n padding: 10px 13px;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.rivet-web-app-chat-message-user {\n align-self: flex-end;\n border-bottom-right-radius: 5px;\n background: color-mix(in srgb, var(--rivet-web-app-button-background) 72%, var(--rivet-web-app-card-background));\n color: var(--rivet-web-app-button-foreground);\n}\n\n.rivet-web-app-chat-message-assistant {\n align-self: flex-start;\n border-bottom-left-radius: 5px;\n background: var(--rivet-web-app-control-background);\n}\n\n.rivet-web-app-chat-thinking {\n display: flex;\n gap: 5px;\n align-items: center;\n min-width: 52px;\n min-height: 38px;\n}\n\n.rivet-web-app-chat-thinking span {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.35;\n animation: rivet-web-app-chat-thinking 1.1s ease-in-out infinite;\n}\n\n.rivet-web-app-chat-thinking span:nth-child(2) {\n animation-delay: 0.14s;\n}\n\n.rivet-web-app-chat-thinking span:nth-child(3) {\n animation-delay: 0.28s;\n}\n\n.rivet-web-app-chat-error {\n border-top: 1px solid var(--rivet-web-app-card-border);\n color: var(--rivet-web-app-error-color);\n padding: 10px 18px 0;\n font-size: 13px;\n font-weight: 600;\n}\n\n.rivet-web-app-chat-composer {\n display: flex;\n align-items: flex-end;\n gap: 10px;\n border-top: 1px solid var(--rivet-web-app-card-border);\n padding: 14px;\n}\n\n.rivet-web-app-chat-error + .rivet-web-app-chat-composer {\n border-top: 0;\n}\n\n.rivet-web-app-chat-composer textarea {\n field-sizing: content;\n flex: 1;\n min-width: 0;\n min-height: 42px;\n max-height: 160px;\n border: 1px solid var(--rivet-web-app-control-border);\n border-radius: 12px;\n outline: none;\n background: var(--rivet-web-app-control-background);\n color: var(--rivet-web-app-foreground);\n font: inherit;\n line-height: 1.35;\n padding: 10px 12px;\n resize: none;\n}\n\n.rivet-web-app-chat-composer textarea:focus {\n border-color: color-mix(in srgb, var(--rivet-web-app-foreground) 34%, transparent);\n}\n\n.rivet-web-app-chat-send {\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n border: 0;\n border-radius: 50%;\n background: var(--rivet-web-app-button-background);\n color: var(--rivet-web-app-button-foreground);\n cursor: pointer;\n font: inherit;\n font-size: 21px;\n font-weight: 700;\n line-height: 1;\n padding: 0 0 2px;\n}\n\n.rivet-web-app-chat-send:disabled {\n cursor: default;\n opacity: 0.42;\n}\n\n@keyframes rivet-web-app-chat-thinking {\n 0%,\n 60%,\n 100% {\n transform: translateY(0);\n opacity: 0.35;\n }\n 30% {\n transform: translateY(-3px);\n opacity: 0.9;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .rivet-web-app-chat-thinking span {\n animation: none;\n }\n}\n\n@media (max-width: 600px) {\n .rivet-web-app-root {\n --rivet-web-app-chat-min-height: clamp(320px, calc(100vh - 64px), 540px);\n }\n\n .rivet-web-app-chat {\n border-radius: 10px;\n }\n\n .rivet-web-app-chat-message {\n max-width: 90%;\n }\n}\n\n.rivet-web-app-output {\n display: grid;\n gap: 8px;\n position: relative;\n}\n\n.rivet-web-app-output-title {\n color: var(--rivet-web-app-output-title);\n font-weight: 700;\n padding-right: 32px;\n}\n\n.rivet-web-app-output-has-download .rivet-web-app-output-title {\n padding-right: 64px;\n}\n\n.rivet-web-app-output-action-button {\n position: absolute;\n top: 11px;\n width: 24px;\n height: 24px;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: color-mix(in srgb, var(--rivet-web-app-foreground) 68%, transparent);\n cursor: pointer;\n padding: 0;\n}\n\n.rivet-web-app-output-copy-button {\n right: 11px;\n}\n\n.rivet-web-app-output-download-button {\n right: 39px;\n}\n\n.rivet-web-app-output-copy-button::before,\n.rivet-web-app-output-copy-button::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 12px;\n border: 1.5px solid currentColor;\n border-radius: 2px;\n}\n\n.rivet-web-app-output-copy-button::before {\n top: 5px;\n left: 8px;\n}\n\n.rivet-web-app-output-copy-button::after {\n top: 8px;\n left: 5px;\n background: var(--rivet-web-app-card-background);\n}\n\n.rivet-web-app-output-download-button::before,\n.rivet-web-app-output-download-button::after {\n content: \"\";\n position: absolute;\n}\n\n.rivet-web-app-output-download-button::before {\n top: 5px;\n left: 8px;\n width: 8px;\n height: 8px;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n transform: rotate(45deg);\n}\n\n.rivet-web-app-output-download-button::after {\n top: 16px;\n left: 6px;\n width: 12px;\n height: 4px;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n border-left: 1.5px solid currentColor;\n border-radius: 0 0 2px 2px;\n}\n\n.rivet-web-app-output-action-button:hover,\n.rivet-web-app-output-action-button:focus-visible {\n color: var(--primary, #ff9e2c);\n outline: none;\n background: color-mix(in srgb, var(--rivet-web-app-foreground) 8%, transparent);\n}\n\n.rivet-web-app-output pre {\n margin: 0;\n background: transparent;\n border-radius: 0;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: inherit;\n padding: 0;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.rivet-web-app-output-image {\n display: block;\n width: auto;\n max-width: 100%;\n height: auto;\n max-height: min(70vh, 720px);\n margin: 0 auto;\n border-radius: 6px;\n object-fit: contain;\n}\n\n.rivet-web-app-output-image-placeholder {\n color: color-mix(in srgb, var(--rivet-web-app-foreground) 56%, transparent);\n font-size: 13px;\n}\n\n.rivet-web-app-output-image-placeholder:empty {\n display: none;\n}\n\n.rivet-web-app-markdown,\n.rivet-web-app-output-markdown {\n word-break: break-word;\n}\n\n.rivet-web-app-markdown.markdown-body {\n background: transparent;\n font-family: inherit;\n min-width: 0;\n}\n\n.rivet-web-app-output-markdown.markdown-body {\n background: transparent;\n font-family: inherit;\n min-width: 0;\n}\n\n.rivet-web-app-markdown h1,\n.rivet-web-app-output-markdown h1 {\n margin: 0 0 12px;\n padding-bottom: 8px;\n border-bottom: 1px solid var(--rivet-web-app-card-border);\n font-size: 24px;\n line-height: 1.22;\n}\n\n.rivet-web-app-markdown h2,\n.rivet-web-app-output-markdown h2 {\n margin: 0 0 10px;\n font-size: 20px;\n line-height: 1.25;\n}\n\n.rivet-web-app-markdown p,\n.rivet-web-app-output-markdown p,\n.rivet-web-app-markdown ul,\n.rivet-web-app-output-markdown ul {\n margin: 0 0 12px;\n}\n\n.rivet-web-app-markdown.markdown-body code,\n.rivet-web-app-output-markdown.markdown-body code {\n border-radius: 4px;\n background: color-mix(in srgb, var(--rivet-web-app-control-background) 70%, var(--rivet-web-app-foreground) 6%);\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n padding: 1px 4px;\n}\n\n.rivet-web-app-markdown.markdown-body pre,\n.rivet-web-app-output-markdown.markdown-body pre {\n background: transparent;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n padding: 0;\n white-space: pre-wrap;\n}\n\n.rivet-web-app-markdown > :first-child,\n.rivet-web-app-output-markdown > :first-child {\n margin-top: 0;\n}\n\n.rivet-web-app-markdown > :last-child,\n.rivet-web-app-output-markdown > :last-child {\n margin-bottom: 0;\n}\n\n.rivet-web-app-error {\n color: var(--rivet-web-app-error-color);\n font-weight: 700;\n}\n\n.rivet-web-app-modal-backdrop {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: grid;\n place-items: center;\n background: rgba(0, 0, 0, 0.46);\n background: color-mix(in srgb, var(--rivet-web-app-background) 78%, transparent);\n padding: 20px;\n}\n\n.rivet-web-app-modal {\n display: grid;\n gap: 18px;\n width: min(420px, 100%);\n border: 1px solid var(--rivet-web-app-card-border);\n border-radius: 12px;\n background: var(--rivet-web-app-card-background);\n box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);\n color: var(--rivet-web-app-foreground);\n padding: 22px;\n}\n\n.rivet-web-app-modal-message {\n font-size: 18px;\n font-weight: 700;\n line-height: 1.3;\n}\n\n.rivet-web-app-modal-button {\n justify-self: start;\n}\n\n.rivet-web-app-clipboard-fallback {\n position: fixed;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n opacity: 0;\n pointer-events: none;\n}\n";
2
2
  export declare const RIVET_WEB_APP_DOCUMENT_CSS = "\nhtml,\nbody {\n height: 100%;\n margin: 0;\n}\n\nbody {\n min-height: 100vh;\n background: #1c222b;\n}\n\n#app {\n min-height: 100vh;\n}\n";
@@ -0,0 +1,124 @@
1
+ import { type UiComponentId, type UiGraph, type UiGraphActionComponent, type UiGraphChatMessage, type UiGraphComponent, type UiGraphGapSize, type UiGraphOutputRenderMode } from './UiGraph.js';
2
+ import { type GraphProgress } from './GraphProgress.js';
3
+ export type UiGraphOutputRenderModel = {
4
+ hasValue: boolean;
5
+ imageErrorMessage?: string;
6
+ imageSource?: string;
7
+ jsonDownloadValue?: string;
8
+ renderedValue: string;
9
+ renderAs: UiGraphOutputRenderMode;
10
+ };
11
+ export type UiGraphComponentRenderModel = {
12
+ component: Extract<UiGraphComponent, {
13
+ type: 'text';
14
+ }>;
15
+ text: string;
16
+ type: 'text';
17
+ } | {
18
+ component: Extract<UiGraphComponent, {
19
+ type: 'markdown';
20
+ }>;
21
+ markdown: string;
22
+ type: 'markdown';
23
+ } | {
24
+ component: Extract<UiGraphComponent, {
25
+ type: 'gap';
26
+ }>;
27
+ size: UiGraphGapSize;
28
+ type: 'gap';
29
+ } | {
30
+ component: Extract<UiGraphComponent, {
31
+ type: 'input' | 'textarea';
32
+ }>;
33
+ label: string;
34
+ type: 'input' | 'textarea';
35
+ value: string;
36
+ } | {
37
+ component: Extract<UiGraphComponent, {
38
+ type: 'button';
39
+ }>;
40
+ label: string;
41
+ type: 'button';
42
+ } | {
43
+ component: Extract<UiGraphComponent, {
44
+ type: 'chat';
45
+ }>;
46
+ draft: string;
47
+ messages: UiGraphChatMessage[];
48
+ type: 'chat';
49
+ } | {
50
+ component: Extract<UiGraphComponent, {
51
+ type: 'output';
52
+ }>;
53
+ label: string;
54
+ output: UiGraphOutputRenderModel;
55
+ type: 'output';
56
+ };
57
+ export type UiGraphActionExecution = Readonly<{
58
+ componentId: UiComponentId;
59
+ id: number;
60
+ }>;
61
+ export type UiGraphActionExecutionController = {
62
+ begin(component: UiGraphActionComponent): UiGraphActionExecution | undefined;
63
+ finish(execution: UiGraphActionExecution): boolean;
64
+ isCurrent(execution: UiGraphActionExecution): boolean;
65
+ isRunning(componentId: UiComponentId): boolean;
66
+ noteStateWrite(stateKey: string): void;
67
+ resolveStatePatch(execution: UiGraphActionExecution, statePatch: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
68
+ reset(): void;
69
+ };
70
+ export type UiGraphInteractionChange = 'action' | 'graph' | 'state';
71
+ export type UiGraphInteractionSnapshot = Readonly<{
72
+ actionErrors: Readonly<Record<string, string>>;
73
+ actionProgress: Readonly<Record<string, GraphProgress>>;
74
+ runningComponentIds: ReadonlySet<UiComponentId>;
75
+ state: Readonly<Record<string, unknown>>;
76
+ }>;
77
+ export type UiGraphActionRunContext = Readonly<{
78
+ abortOtherActions(): void;
79
+ componentId: UiComponentId;
80
+ reportProgress(progress: GraphProgress): void;
81
+ signal: AbortSignal;
82
+ state: Record<string, unknown>;
83
+ }>;
84
+ export type UiGraphActionRunResult = {
85
+ statePatch?: Record<string, unknown>;
86
+ };
87
+ export type UiGraphActionRunner = (context: UiGraphActionRunContext) => Promise<UiGraphActionRunResult>;
88
+ export type UiGraphInteractionController = {
89
+ abortActions(): void;
90
+ cancelAction(componentId: UiComponentId): void;
91
+ detachActions(): void;
92
+ getSnapshot(): UiGraphInteractionSnapshot;
93
+ runAction(component: UiGraphActionComponent, runner: UiGraphActionRunner): Promise<void>;
94
+ setUiGraph(uiGraph: UiGraph): void;
95
+ subscribe(listener: (change: UiGraphInteractionChange) => void): () => void;
96
+ updateState(stateKey: string, value: unknown): void;
97
+ updateStatePatch(statePatch: Record<string, unknown>): void;
98
+ };
99
+ export type UiGraphInteractionControllerOptions = {
100
+ initialState?: Record<string, unknown>;
101
+ };
102
+ /**
103
+ * Coordinates independent web-app actions without allowing older completions to
104
+ * clear newer loading states or overwrite newer writes to the same UI state key.
105
+ */
106
+ export declare function createUiGraphActionExecutionController(): UiGraphActionExecutionController;
107
+ /**
108
+ * Owns mutable web-app interaction state for every renderer. React and direct
109
+ * DOM hosts subscribe to this controller instead of reimplementing action
110
+ * cancellation, loading/error state, and stale state-patch protection.
111
+ */
112
+ export declare function createUiGraphInteractionController(initialUiGraph: UiGraph, options?: UiGraphInteractionControllerOptions): UiGraphInteractionController;
113
+ export declare function getUiGraphComponentRenderModel(component: UiGraphComponent, state: Readonly<Record<string, unknown>>): UiGraphComponentRenderModel;
114
+ export declare function getUiGraphComponentLabel(component: Extract<UiGraphComponent, {
115
+ type: 'input' | 'textarea' | 'output';
116
+ }>): string;
117
+ export declare function getUiGraphOutputRenderModel(state: Readonly<Record<string, unknown>>, stateKey: string, renderAs: UiGraphOutputRenderMode): UiGraphOutputRenderModel;
118
+ export declare function hasUiGraphStateValue(state: Readonly<Record<string, unknown>>, key: string): boolean;
119
+ export declare function renderUiGraphOutputValue(value: unknown, renderAs: UiGraphOutputRenderMode): string;
120
+ export declare function getUiGraphImageSource(value: unknown): string | undefined;
121
+ export declare function stringifyUiGraphValue(value: unknown): string | undefined;
122
+ export declare function getUiGraphJsonOutputFilename(appName: string, date?: Date): string;
123
+ export declare function formatUiGraphDownloadDateTime(date: Date): string;
124
+ export declare function applyUiGraphStatePatch(state: Record<string, unknown>, statePatch: Record<string, unknown> | undefined): Record<string, unknown>;
@@ -0,0 +1,5 @@
1
+ import type { ExternalFunction } from './GraphProcessor.js';
2
+ export declare const RIVET_WEB_APP_STATUS_FUNCTION_NAME = "setWebAppStatus";
3
+ /** Built-in External Call function used to report web-app status. */
4
+ export declare const rivetWebAppStatusExternalFunction: ExternalFunction;
5
+ export declare function formatRivetWebAppStatusMessage(value: unknown): string;
@@ -0,0 +1,46 @@
1
+ import type { Inputs } from '../GraphProcessor.js';
2
+ import type { InternalProcessContext } from '../ProcessContext.js';
3
+ import { type CreateChatV2ModelOptions, type ResolvedChatV2ProviderConfig } from './providerOptions.js';
4
+ import type { ChatV2Model, ChatV2Provider } from './chatV2Types.js';
5
+ export type ChatV2CredentialReference = {
6
+ source: 'input' | 'settings' | 'plugin' | 'programmatic' | 'environment' | 'none';
7
+ name?: string | undefined;
8
+ };
9
+ export type ChatV2CredentialResult = {
10
+ value?: string | undefined;
11
+ reference: ChatV2CredentialReference;
12
+ };
13
+ export type ChatV2ProviderProfile = {
14
+ provider: ChatV2Provider;
15
+ modelId: string;
16
+ baseURL?: string | undefined;
17
+ hasCustomHeaders: boolean;
18
+ credential: ChatV2CredentialReference;
19
+ capabilities: {
20
+ builtInTools: boolean;
21
+ structuredOutput: boolean;
22
+ };
23
+ };
24
+ type ProviderContext = Pick<InternalProcessContext, 'getPluginConfig' | 'settings'>;
25
+ export declare function resolveChatV2Credential(options: {
26
+ provider: ChatV2Provider;
27
+ context: ProviderContext;
28
+ apiKeySource?: 'configured' | 'input' | undefined;
29
+ inputs?: Inputs | undefined;
30
+ customProgrammaticName?: string | undefined;
31
+ customEnvironmentName?: string | undefined;
32
+ }): ChatV2CredentialResult;
33
+ export declare function createResolvedChatV2Provider(options: {
34
+ provider: ChatV2Provider;
35
+ modelId: string;
36
+ context: ProviderContext;
37
+ baseURL?: string | undefined;
38
+ headers?: Record<string, string> | undefined;
39
+ credential: ChatV2CredentialResult;
40
+ onRequestBody?: CreateChatV2ModelOptions['onRequestBody'];
41
+ }): Promise<{
42
+ profile: ChatV2ProviderProfile;
43
+ model: ChatV2Model;
44
+ config: ResolvedChatV2ProviderConfig;
45
+ }>;
46
+ export {};