@valerypopoff/rivet2-core 2.1.8 → 2.1.10

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 (168) hide show
  1. package/dist/cjs/bundle.cjs +4457 -1809
  2. package/dist/cjs/bundle.cjs.map +4 -4
  3. package/dist/cjs/webAppRuntime.cjs +298 -21
  4. package/dist/cjs/webAppRuntime.cjs.map +4 -4
  5. package/dist/esm/exports.js +1 -0
  6. package/dist/esm/model/AgentResponseTrace.js +448 -0
  7. package/dist/esm/model/ConnectedToolContinuationHost.js +33 -0
  8. package/dist/esm/model/GraphProcessor.js +152 -74
  9. package/dist/esm/model/NodeImpl.js +6 -0
  10. package/dist/esm/model/ProcessContextBuilder.js +3 -1
  11. package/dist/esm/model/RecordingPlayer.js +164 -22
  12. package/dist/esm/model/SplitRunProcessor.js +68 -18
  13. package/dist/esm/model/SubprocessorBridge.js +2 -0
  14. package/dist/esm/model/ToolCallContinuationCoordinator.js +13 -4
  15. package/dist/esm/model/UiGraph.js +21 -0
  16. package/dist/esm/model/UiGraphActionProtocol.js +2 -0
  17. package/dist/esm/model/UiGraphBrowserRuntime.js +133 -4
  18. package/dist/esm/model/UiGraphRendererStyles.js +221 -0
  19. package/dist/esm/model/UiGraphRuntimeModel.js +9 -3
  20. package/dist/esm/model/UiGraphSchema.js +7 -1
  21. package/dist/esm/model/chat/aiSdkMessages.js +8 -0
  22. package/dist/esm/model/chat/aiSdkTools.js +3 -2
  23. package/dist/esm/model/chat-v2/chatV2CallObserver.js +11 -5
  24. package/dist/esm/model/chat-v2/chatV2EditorCache.js +58 -10
  25. package/dist/esm/model/chat-v2/chatV2Errors.js +7 -19
  26. package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +1 -1
  27. package/dist/esm/model/chat-v2/chatV2Outputs.js +56 -106
  28. package/dist/esm/model/chat-v2/chatV2Pipeline.js +142 -149
  29. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +9 -2
  30. package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +9 -0
  31. package/dist/esm/model/chat-v2/chatV2RequestPlan.js +5 -5
  32. package/dist/esm/model/chat-v2/chatV2ResponseBodyCapture.js +55 -0
  33. package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +8 -4
  34. package/dist/esm/model/chat-v2/chatV2Retry.js +4 -3
  35. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +6 -1
  36. package/dist/esm/model/chat-v2/chatV2Shared.js +1 -6
  37. package/dist/esm/model/chat-v2/chatV2Types.js +7 -1
  38. package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +78 -0
  39. package/dist/esm/model/chat-v2/customProviderApi.js +42 -0
  40. package/dist/esm/model/chat-v2/developerMessageRoles.js +45 -0
  41. package/dist/esm/model/chat-v2/index.js +12 -0
  42. package/dist/esm/model/chat-v2/llmChatV2Body.js +281 -0
  43. package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +32 -0
  44. package/dist/esm/model/chat-v2/llmChatV2CachePolicy.js +20 -0
  45. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +8 -54
  46. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +41 -20
  47. package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +24 -0
  48. package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +178 -94
  49. package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +60 -0
  50. package/dist/esm/model/chat-v2/llmInvocationDecision.js +11 -0
  51. package/dist/esm/model/chat-v2/llmInvocationJournal.js +43 -0
  52. package/dist/esm/model/chat-v2/llmInvocationPlan.js +68 -0
  53. package/dist/esm/model/chat-v2/llmInvocationProjections.js +5 -0
  54. package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +48 -0
  55. package/dist/esm/model/chat-v2/llmModelCandidate.js +75 -0
  56. package/dist/esm/model/chat-v2/llmProfile.js +31 -65
  57. package/dist/esm/model/chat-v2/llmProfileBody.js +183 -0
  58. package/dist/esm/model/chat-v2/llmProfileFallback.js +244 -0
  59. package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +67 -0
  60. package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +3 -0
  61. package/dist/esm/model/chat-v2/llmProfileTypes.js +1 -18
  62. package/dist/esm/model/chat-v2/llmResponseMaterializer.js +42 -0
  63. package/dist/esm/model/chat-v2/messageConverter.js +14 -0
  64. package/dist/esm/model/chat-v2/modelRegistry.js +54 -4
  65. package/dist/esm/model/chat-v2/parallelToolCalls.js +9 -2
  66. package/dist/esm/model/chat-v2/providerOptions.js +120 -21
  67. package/dist/esm/model/chat-v2/rivetToolRegistry.js +9 -0
  68. package/dist/esm/model/chat-v2/toolCallCodec.js +52 -0
  69. package/dist/esm/model/chat-v2/toolContinuation.js +72 -39
  70. package/dist/esm/model/chat-v2/toolHandlerResolver.js +23 -0
  71. package/dist/esm/model/chat-v2/toolRoundExecutor.js +12 -0
  72. package/dist/esm/model/nodes/AssembleMessageNode.js +6 -0
  73. package/dist/esm/model/nodes/ChatNode.js +6 -0
  74. package/dist/esm/model/nodes/ChatNodeBase.js +1 -0
  75. package/dist/esm/model/nodes/DelegateFunctionCallNode.js +26 -1
  76. package/dist/esm/model/nodes/LLMChatV2Node.js +131 -144
  77. package/dist/esm/model/nodes/LLMProfileNode.js +27 -8
  78. package/dist/esm/model/nodes/PromptNode.js +16 -2
  79. package/dist/esm/model/nodes/ToolNode.js +7 -0
  80. package/dist/esm/model/nodes/toolCallDelegation.js +193 -110
  81. package/dist/esm/plugins/anthropic/anthropic.js +4 -4
  82. package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +29 -28
  83. package/dist/esm/plugins/google/google.js +25 -18
  84. package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +21 -7
  85. package/dist/esm/recording/ExecutionRecorder.js +13 -5
  86. package/dist/esm/utils/chatMessageToOpenAIChatCompletionMessage.js +4 -0
  87. package/dist/esm/utils/emitDetached.js +6 -3
  88. package/dist/esm/utils/openai.js +60 -16
  89. package/dist/esm/utils/serialization/serialization.js +2 -0
  90. package/dist/esm/webAppRuntime.js +3 -2
  91. package/dist/types/exports.d.ts +1 -0
  92. package/dist/types/model/AgentResponseTrace.d.ts +110 -0
  93. package/dist/types/model/ConnectedToolContinuationHost.d.ts +34 -0
  94. package/dist/types/model/DataValue.d.ts +7 -1
  95. package/dist/types/model/ExecutorProtocol.d.ts +25 -7
  96. package/dist/types/model/GraphProcessor.d.ts +27 -5
  97. package/dist/types/model/NodeBase.d.ts +6 -0
  98. package/dist/types/model/NodeImpl.d.ts +18 -1
  99. package/dist/types/model/Nodes.d.ts +2 -2
  100. package/dist/types/model/ProcessContext.d.ts +51 -0
  101. package/dist/types/model/ProcessContextBuilder.d.ts +3 -1
  102. package/dist/types/model/RecordingPlayer.d.ts +6 -0
  103. package/dist/types/model/SplitRunProcessor.d.ts +11 -3
  104. package/dist/types/model/UiGraph.d.ts +8 -0
  105. package/dist/types/model/UiGraphActionProtocol.d.ts +2 -0
  106. package/dist/types/model/UiGraphBrowserRuntime.d.ts +11 -2
  107. package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
  108. package/dist/types/model/UiGraphRuntimeModel.d.ts +2 -0
  109. package/dist/types/model/UiGraphSchema.d.ts +1 -0
  110. package/dist/types/model/chat-v2/chatV2CallObserver.d.ts +2 -0
  111. package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +3 -1
  112. package/dist/types/model/chat-v2/chatV2Outputs.d.ts +7 -17
  113. package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +29 -0
  114. package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +5 -0
  115. package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +8 -0
  116. package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +2 -2
  117. package/dist/types/model/chat-v2/chatV2ResponseBodyCapture.d.ts +19 -0
  118. package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +3 -2
  119. package/dist/types/model/chat-v2/chatV2Retry.d.ts +2 -0
  120. package/dist/types/model/chat-v2/chatV2Shared.d.ts +0 -1
  121. package/dist/types/model/chat-v2/chatV2Types.d.ts +35 -1
  122. package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +14 -0
  123. package/dist/types/model/chat-v2/customProviderApi.d.ts +23 -0
  124. package/dist/types/model/chat-v2/developerMessageRoles.d.ts +10 -0
  125. package/dist/types/model/chat-v2/index.d.ts +12 -0
  126. package/dist/types/model/chat-v2/llmChatV2Body.d.ts +24 -0
  127. package/dist/types/model/chat-v2/llmChatV2CacheBoundary.d.ts +10 -0
  128. package/dist/types/model/chat-v2/llmChatV2CachePolicy.d.ts +13 -0
  129. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +13 -3
  130. package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +8 -0
  131. package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +18 -4
  132. package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +16 -0
  133. package/dist/types/model/chat-v2/llmInvocationDecision.d.ts +21 -0
  134. package/dist/types/model/chat-v2/llmInvocationJournal.d.ts +38 -0
  135. package/dist/types/model/chat-v2/llmInvocationPlan.d.ts +41 -0
  136. package/dist/types/model/chat-v2/llmInvocationProjections.d.ts +3 -0
  137. package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +26 -0
  138. package/dist/types/model/chat-v2/llmModelCandidate.d.ts +18 -0
  139. package/dist/types/model/chat-v2/llmProfile.d.ts +7 -0
  140. package/dist/types/model/chat-v2/llmProfileBody.d.ts +20 -0
  141. package/dist/types/model/chat-v2/llmProfileFallback.d.ts +47 -0
  142. package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +189 -0
  143. package/dist/types/model/chat-v2/llmProfileTypes.d.ts +1 -1
  144. package/dist/types/model/chat-v2/llmResponseMaterializer.d.ts +20 -0
  145. package/dist/types/model/chat-v2/modelRegistry.d.ts +17 -187
  146. package/dist/types/model/chat-v2/parallelToolCalls.d.ts +3 -1
  147. package/dist/types/model/chat-v2/providerOptions.d.ts +11 -0
  148. package/dist/types/model/chat-v2/rivetToolRegistry.d.ts +11 -0
  149. package/dist/types/model/chat-v2/toolCallCodec.d.ts +7 -0
  150. package/dist/types/model/chat-v2/toolContinuation.d.ts +3 -3
  151. package/dist/types/model/chat-v2/toolHandlerResolver.d.ts +25 -0
  152. package/dist/types/model/chat-v2/toolRoundExecutor.d.ts +18 -0
  153. package/dist/types/model/nodes/AssembleMessageNode.d.ts +2 -1
  154. package/dist/types/model/nodes/ChatNode.d.ts +2 -1
  155. package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +2 -1
  156. package/dist/types/model/nodes/LLMChatV2Node.d.ts +2 -1
  157. package/dist/types/model/nodes/LLMProfileNode.d.ts +2 -1
  158. package/dist/types/model/nodes/PromptNode.d.ts +6 -3
  159. package/dist/types/model/nodes/ToolNode.d.ts +2 -1
  160. package/dist/types/model/nodes/toolCallDelegation.d.ts +10 -3
  161. package/dist/types/plugins/anthropic/anthropic.d.ts +1 -0
  162. package/dist/types/plugins/google/google.d.ts +14 -9
  163. package/dist/types/plugins/google/nodes/ChatGoogleNode.d.ts +2 -1
  164. package/dist/types/recording/RecordedEvents.d.ts +6 -0
  165. package/dist/types/utils/emitDetached.d.ts +3 -2
  166. package/dist/types/utils/openai.d.ts +49 -0
  167. package/dist/types/webAppRuntime.d.ts +4 -2
  168. package/package.json +2 -2
@@ -0,0 +1,13 @@
1
+ import type { LLMChatV2NodeData } from './llmChatV2NodeData.js';
2
+ export type LLMChatV2EditorCacheEligibility = {
3
+ eligible: true;
4
+ } | {
5
+ eligible: false;
6
+ reason: 'disabled' | 'rivet-tools' | 'provider-native-tools';
7
+ };
8
+ /**
9
+ * Editor-cache replay is safe only for ordinary deterministic model calls.
10
+ * Tool-capable calls can have side effects or live Delegate run shapes that a
11
+ * cached final output cannot reproduce.
12
+ */
13
+ export declare function getLLMChatV2EditorCacheEligibility(data: LLMChatV2NodeData): LLMChatV2EditorCacheEligibility;
@@ -2,6 +2,8 @@ import type { ChatV2ResponseFormat } from './chatV2ResponseFormat.js';
2
2
  import { type ChatV2CommonNodeData } from './chatV2Shared.js';
3
3
  import type { ChatV2Provider } from './chatV2Types.js';
4
4
  import type { ChartNode, NodeId } from '../NodeBase.js';
5
+ import type { CustomProviderApi } from './customProviderApi.js';
6
+ export type { CustomProviderApi } from './customProviderApi.js';
5
7
  export type LLMChatV2ToolChoiceMode = '' | 'auto' | 'function' | 'required';
6
8
  export type LLMChatV2ApiKeySource = 'environment' | 'input';
7
9
  export type LLMChatV2ConfigurationMode = 'inline' | 'profile';
@@ -13,6 +15,8 @@ export type LLMChatV2NodeConfigData = ChatV2CommonNodeData & {
13
15
  customProviderApiKeyEnvVarName?: string;
14
16
  customProviderBaseURL: string;
15
17
  useCustomProviderBaseURLInput: boolean;
18
+ /** Missing on legacy/programmatically-created nodes means Chat Completions. */
19
+ customProviderApi?: CustomProviderApi;
16
20
  baseURL: string;
17
21
  useBaseURLInput: boolean;
18
22
  headers: {
@@ -53,14 +57,19 @@ export type LLMChatV2NodeConfigData = ChatV2CommonNodeData & {
53
57
  retryOnNon200?: boolean;
54
58
  retryOnNon200RepeatTimes?: number;
55
59
  retryOnNon200CooldownMs?: number;
56
- outputRequestStatus?: boolean;
60
+ outputLLMAttempts?: boolean;
61
+ outputRequestBody?: boolean;
62
+ outputResponseBody?: boolean;
57
63
  };
58
64
  export type LLMChatV2NodeData = LLMChatV2NodeConfigData;
59
65
  export type LLMChatV2Node = ChartNode<'llmChatV2', LLMChatV2NodeData>;
60
- export declare const llmChatV2ProfileDataKeys: readonly ["model", "useModelInput", "temperature", "useTemperatureInput", "topP", "useTopPInput", "topK", "useTopKInput", "presencePenalty", "usePresencePenaltyInput", "frequencyPenalty", "useFrequencyPenaltyInput", "stopSequences", "useStopSequencesInput", "seed", "useSeedInput", "maxTokens", "useMaxTokensInput", "provider", "apiKeySource", "customProviderApiKeyProgrammaticName", "customProviderApiKeyEnvVarName", "customProviderBaseURL", "useCustomProviderBaseURLInput", "headers", "useHeadersInput", "extraProviderOptions", "useExtraProviderOptionsInput", "openAIReasoningEffort", "openAIReasoningSummary", "openAIPreviousResponseId", "useOpenAIPreviousResponseIdInput", "enableOpenAIWebSearch", "openAIWebSearchContextSize", "enableOpenAICodeInterpreter", "anthropicThinkingMode", "anthropicThinkingBudget", "useAnthropicThinkingBudgetInput", "anthropicEffort", "anthropicCacheControlTtl", "googleThinkingBudget", "useGoogleThinkingBudgetInput", "googleThinkingLevel", "googleIncludeThoughts", "enableGoogleSearchGrounding", "enableGoogleUrlContext"];
66
+ /** @deprecated Use llmProfileDataKeys from llmProfileFieldRegistry instead. */
67
+ export declare const llmChatV2ProfileDataKeys: ("provider" | "model" | "customProviderApi" | "headers" | "temperature" | "seed" | "maxTokens" | "presencePenalty" | "frequencyPenalty" | "useModelInput" | "useTemperatureInput" | "useTopPInput" | "useMaxTokensInput" | "usePresencePenaltyInput" | "useFrequencyPenaltyInput" | "useHeadersInput" | "useSeedInput" | "topP" | "topK" | "useTopKInput" | "stopSequences" | "useStopSequencesInput" | "anthropicCacheControlTtl" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext")[];
61
68
  export type LLMChatV2ProfileDataKey = (typeof llmChatV2ProfileDataKeys)[number];
62
69
  export type LLMChatV2ProfileData = Pick<LLMChatV2NodeData, LLMChatV2ProfileDataKey>;
63
70
  export type LLMChatV2EditorCacheKeyParts = {
71
+ /** Bump when cache identity semantics change; entries are editor-memory only. */
72
+ cacheVersion?: number;
64
73
  nodeId: NodeId;
65
74
  nodeData: LLMChatV2NodeData;
66
75
  provider: ChatV2Provider;
@@ -74,7 +83,8 @@ export type LLMChatV2EditorCacheKeyParts = {
74
83
  responseFormatParameters: unknown;
75
84
  providerOptions: unknown;
76
85
  toolChoice: unknown;
86
+ /** Ordered, credential-fingerprinted fallback profile configuration. */
87
+ profileChain?: unknown;
77
88
  };
78
89
  export declare function createLLMChatV2NodeData(): LLMChatV2NodeData;
79
- export declare function hasLLMChatV2BuiltInToolsEnabled(data: LLMChatV2NodeData): boolean;
80
90
  export declare function shouldIncludeLLMChatV2ToolCalls(data: LLMChatV2NodeData): boolean;
@@ -0,0 +1,8 @@
1
+ import type { ChartNode } from '../NodeBase.js';
2
+ /**
3
+ * Serialized LLM Chat migrations live beside the node contract, rather than
4
+ * making generic project serialization understand LLM-specific settings.
5
+ * This is deliberately idempotent because deserialization can normalize a
6
+ * graph more than once while it is imported or embedded in a prefab.
7
+ */
8
+ export declare function normalizeSerializedLLMChatV2Node(node: ChartNode): void;
@@ -1,25 +1,39 @@
1
1
  import type { GptFunction } from '../DataValue.js';
2
2
  import type { Inputs, Outputs } from '../GraphProcessor.js';
3
3
  import type { InternalProcessContext } from '../ProcessContext.js';
4
- import type { ChatV2ProviderProfile } from './chatV2ProviderProfile.js';
5
- import type { RunChatV2PipelineOptions } from './chatV2Types.js';
4
+ import { type LLMAttempt } from './llmProfileFallback.js';
5
+ import type { ChatV2Model, ChatV2PipelineRoundOptions, ChatV2PipelineResult } from './chatV2Types.js';
6
6
  import { buildLLMChatV2EditorCacheKey, cloneLLMChatV2EditorCacheOutputs } from './chatV2EditorCache.js';
7
7
  import { type LLMChatV2EditorCacheKeyParts, type LLMChatV2NodeData } from './llmChatV2NodeData.js';
8
8
  export { buildLLMChatV2EditorCacheKey, cloneLLMChatV2EditorCacheOutputs };
9
9
  export { resolveLLMChatV2RuntimeProviderOptions } from './chatV2RuntimeOptions.js';
10
+ export type { LLMAttempt } from './llmProfileFallback.js';
10
11
  export type LLMChatV2RuntimeConfig = {
11
- providerProfile: ChatV2ProviderProfile;
12
- runOptions: RunChatV2PipelineOptions;
12
+ /**
13
+ * Initial continuation-round settings. In From profile mode, `runPipeline`
14
+ * resolves the actual provider model lazily so a broken primary candidate
15
+ * can advance to the next profile before any provider request is made.
16
+ */
17
+ /** Inline keeps its resolved model for compatibility/inspection; profile mode intentionally omits it. */
18
+ runOptions: ChatV2PipelineRoundOptions & {
19
+ model?: ChatV2Model | undefined;
20
+ };
21
+ runPipeline: (options: ChatV2PipelineRoundOptions) => Promise<ChatV2PipelineResult>;
13
22
  functions: GptFunction[] | undefined;
14
23
  cacheKey: string | undefined;
15
24
  cachedOutputs: Outputs | undefined;
16
25
  editorCache: Map<string, unknown> | undefined;
17
26
  shouldAutoContinueToolCalls: boolean;
18
27
  maxToolRounds: number;
28
+ outputLLMAttempts: boolean;
29
+ getProfileSummary: (() => string) | undefined;
30
+ isProfileFallbackExhausted: () => boolean;
19
31
  };
20
32
  export declare function resolveLLMChatV2RuntimeConfig(params: {
21
33
  data: LLMChatV2NodeData;
22
34
  nodeId: LLMChatV2EditorCacheKeyParts['nodeId'];
23
35
  inputs: Inputs;
24
36
  context: InternalProcessContext;
37
+ /** Invocation-owned observer; it must not affect fallback recovery. */
38
+ onLLMAttempt?: ((attempt: LLMAttempt) => void) | undefined;
25
39
  }): Promise<LLMChatV2RuntimeConfig>;
@@ -0,0 +1,16 @@
1
+ import type { ChatV2PipelineResult } from './chatV2Types.js';
2
+ import type { LLMChatV2RuntimeConfig } from './llmChatV2NodeRuntime.js';
3
+ import type { InternalProcessContext } from '../ProcessContext.js';
4
+ import type { ToolCallContinuation } from '../ToolCallContinuation.js';
5
+ import type { LLMInvocationJournal } from './llmInvocationJournal.js';
6
+ /**
7
+ * Owns the LLM-level recovery and continuation decision boundary. The node
8
+ * boundary provides a resolved runtime and GraphProcessor supplies only the
9
+ * connected Delegate host; no graph scheduling policy lives here.
10
+ */
11
+ export declare function executeLLMInvocation(params: {
12
+ context: InternalProcessContext;
13
+ journal: LLMInvocationJournal;
14
+ runtime: LLMChatV2RuntimeConfig;
15
+ toolCallContinuation: ToolCallContinuation | undefined;
16
+ }): Promise<ChatV2PipelineResult>;
@@ -0,0 +1,21 @@
1
+ import type { StreamedFunctionCall } from '../chat/streamChatResponse.js';
2
+ export type LLMInvocationRoundDecision = {
3
+ kind: 'final-model-answer';
4
+ } | {
5
+ kind: 'delegate-tools';
6
+ } | {
7
+ kind: 'release-unresolved-calls';
8
+ } | {
9
+ kind: 'max-rounds-reached';
10
+ } | {
11
+ kind: 'direct-tool-response';
12
+ };
13
+ /** Pure terminal/continuation policy, intentionally independent of scheduling. */
14
+ export declare function decideLLMInvocationRound(params: {
15
+ autoContinue: boolean;
16
+ completedRounds: number;
17
+ maxToolRounds: number;
18
+ calls: readonly StreamedFunctionCall[];
19
+ knownToolNames: ReadonlySet<string>;
20
+ isDirectReturn: boolean;
21
+ }): LLMInvocationRoundDecision;
@@ -0,0 +1,38 @@
1
+ import type { ChatV2CallFinishedEvent } from '../ProcessContext.js';
2
+ import type { LLMAttempt } from './llmProfileFallback.js';
3
+ export type LLMInvocationJournalEvent = {
4
+ type: 'model-call';
5
+ event: ChatV2CallFinishedEvent;
6
+ } | {
7
+ type: 'llm-attempt';
8
+ attempt: LLMAttempt;
9
+ } | {
10
+ type: 'tool-round';
11
+ kind: 'connected' | 'internal';
12
+ count: number;
13
+ } | {
14
+ type: 'terminal';
15
+ kind: 'final-model-answer' | 'released-unresolved-calls' | 'failed' | 'cancelled';
16
+ };
17
+ /**
18
+ * Invocation-scoped, append-only facts collected from physical provider calls.
19
+ * It stores physical-call accounting alongside the full developer-visible LLM
20
+ * attempt diagnostics selected by the node.
21
+ */
22
+ export declare class LLMInvocationJournal {
23
+ #private;
24
+ recordModelCall(event: ChatV2CallFinishedEvent): void;
25
+ recordToolRound(event: {
26
+ kind: 'connected' | 'internal';
27
+ count: number;
28
+ }): void;
29
+ recordLLMAttempt(attempt: LLMAttempt): void;
30
+ recordTerminal(event: {
31
+ kind: Extract<LLMInvocationJournalEvent, {
32
+ type: 'terminal';
33
+ }>['kind'];
34
+ }): void;
35
+ get modelCalls(): readonly ChatV2CallFinishedEvent[];
36
+ get events(): readonly LLMInvocationJournalEvent[];
37
+ get llmAttempts(): readonly LLMAttempt[];
38
+ }
@@ -0,0 +1,41 @@
1
+ import type { GptFunction } from '../DataValue.js';
2
+ import type { Inputs } from '../GraphProcessor.js';
3
+ import type { InternalProcessContext } from '../ProcessContext.js';
4
+ import { getInstructionMessageRoles } from './developerMessageRoles.js';
5
+ import { type ChatV2ResponseFormatParameters } from './chatV2ResponseFormat.js';
6
+ import { resolveLLMChatV2ToolChoice } from './chatV2RuntimeOptions.js';
7
+ import { type LLMChatV2NodeData } from './llmChatV2NodeData.js';
8
+ import { type RunChatV2PipelineOptions } from './chatV2Types.js';
9
+ import type { parseChatV2Provider } from './providerOptions.js';
10
+ import { type ChatV2ResponseBodyCapture } from './chatV2ResponseBodyCapture.js';
11
+ /** Provider-neutral state assembled once per root LLM invocation. */
12
+ export type LLMInvocationPlan = {
13
+ data: LLMChatV2NodeData;
14
+ inputs: Inputs;
15
+ context: InternalProcessContext;
16
+ prompt: unknown;
17
+ systemPrompt: unknown;
18
+ functions: GptFunction[] | undefined;
19
+ responseFormatParameters: ChatV2ResponseFormatParameters;
20
+ toolChoice: ReturnType<typeof resolveLLMChatV2ToolChoice>;
21
+ requestBodies: unknown[] | undefined;
22
+ responseBodies: unknown[] | undefined;
23
+ responseBodyCapture: ChatV2ResponseBodyCapture | undefined;
24
+ instructionRoles: ReturnType<typeof getInstructionMessageRoles>;
25
+ };
26
+ export declare function resolveLLMChatV2BaseURL(data: LLMChatV2NodeData, inputs: Inputs): string | undefined;
27
+ export declare function buildLLMInvocationPlan(params: {
28
+ data: LLMChatV2NodeData;
29
+ inputs: Inputs;
30
+ context: InternalProcessContext;
31
+ }): LLMInvocationPlan;
32
+ /**
33
+ * Build the provider-neutral portion of an executable round. A model is never
34
+ * fabricated here; candidate resolution supplies it before this reaches the
35
+ * request pipeline.
36
+ */
37
+ export declare function buildLLMInvocationRunOptions(params: {
38
+ plan: LLMInvocationPlan;
39
+ provider: ReturnType<typeof parseChatV2Provider>;
40
+ modelId: string;
41
+ }): Omit<RunChatV2PipelineOptions, 'model'>;
@@ -0,0 +1,3 @@
1
+ import type { ChatV2CallFinishedEvent } from '../ProcessContext.js';
2
+ /** Pure public-shape projections over privacy-bounded invocation facts. */
3
+ export declare function projectLLMInvocationUsage(events: readonly ChatV2CallFinishedEvent[]): import("./chatV2Types.js").ChatV2NormalizedUsage | undefined;
@@ -0,0 +1,26 @@
1
+ import type { Outputs } from '../GraphProcessor.js';
2
+ import type { ChatV2CallFinishedEvent } from '../ProcessContext.js';
3
+ import type { LLMAttempt } from './llmProfileFallback.js';
4
+ import type { ChatV2PipelineResult, ChatV2PipelineRoundOptions } from './chatV2Types.js';
5
+ type LLMInvocationDiagnosticProjectionOptions = {
6
+ runOptions: Pick<ChatV2PipelineRoundOptions, 'requestBodies' | 'responseBodies' | 'outputRequestBody' | 'outputResponseBody'>;
7
+ outputLLMAttempts: boolean | undefined;
8
+ llmAttempts: readonly LLMAttempt[];
9
+ profileSummary?: string | undefined;
10
+ };
11
+ /**
12
+ * Projects invocation facts that remain useful even when the node fails.
13
+ * Captured HTTP bodies are emitted only through their opt-in ports, while
14
+ * attempts and profile summaries retain the same public shapes as a success.
15
+ */
16
+ export declare function projectLLMInvocationDiagnostics({ runOptions, outputLLMAttempts, llmAttempts, profileSummary, }: LLMInvocationDiagnosticProjectionOptions): Outputs;
17
+ /** Applies existing public LLM Chat output shapes from invocation facts. */
18
+ export declare function projectLLMInvocationResult(params: {
19
+ result: ChatV2PipelineResult;
20
+ modelCalls: readonly ChatV2CallFinishedEvent[];
21
+ outputUsage: boolean | undefined;
22
+ outputLLMAttempts: boolean | undefined;
23
+ llmAttempts: readonly LLMAttempt[];
24
+ profileSummary?: string | undefined;
25
+ }): Outputs;
26
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { LLMInvocationPlan } from './llmInvocationPlan.js';
2
+ import { applyLLMProfileToNodeData } from './llmProfile.js';
3
+ import type { LLMProfileValue } from './llmProfileTypes.js';
4
+ import { type ChatV2CredentialResult } from './chatV2ProviderProfile.js';
5
+ import type { ChatV2PipelineRoundOptions, RunChatV2PipelineOptions } from './chatV2Types.js';
6
+ import { type ResolvedChatV2ProviderConfig } from './providerOptions.js';
7
+ /** A fully executable model/profile selection plus safe configuration facts. */
8
+ export type ResolvedLLMModelCandidate = {
9
+ effectiveData: ReturnType<typeof applyLLMProfileToNodeData>;
10
+ credential: ChatV2CredentialResult;
11
+ providerConfig: ResolvedChatV2ProviderConfig;
12
+ runOptions: RunChatV2PipelineOptions;
13
+ };
14
+ export declare function resolveLLMModelCandidate(params: {
15
+ plan: LLMInvocationPlan;
16
+ profile?: LLMProfileValue | undefined;
17
+ roundOptions?: ChatV2PipelineRoundOptions | undefined;
18
+ }): Promise<ResolvedLLMModelCandidate>;
@@ -1,3 +1,10 @@
1
1
  import { type LLMProfileValue } from './llmProfileTypes.js';
2
2
  export { applyLLMProfileToNodeData, createDefaultLLMProfileValue, createLLMProfileNodeData, LLM_PROFILE_VALUE_VERSION, pickLLMChatV2ProfileData, type LLMProfileValue, } from './llmProfileTypes.js';
3
3
  export declare function normalizeLLMProfileValue(value: unknown): LLMProfileValue;
4
+ /**
5
+ * Normalizes the single LLM Profile or ordered fallback chain accepted by
6
+ * LLM Chat's From profile input. We validate every member here rather than
7
+ * trusting a same-type `llm-config[]` wrapper: arrays can otherwise carry
8
+ * malformed values without re-entering scalar coercion.
9
+ */
10
+ export declare function normalizeLLMProfileChainInput(value: unknown): LLMProfileValue[];
@@ -0,0 +1,20 @@
1
+ import type { LLMChatV2ProfileData } from './llmChatV2NodeData.js';
2
+ export type LLMProfileBodyField = Readonly<{
3
+ label: string;
4
+ value: string;
5
+ }>;
6
+ export type LLMProfileBodySnippet = Readonly<{
7
+ label: string;
8
+ text: string;
9
+ }>;
10
+ export type LLMProfileBodySection = Readonly<{
11
+ id: 'model' | 'parameters' | 'provider' | 'advanced';
12
+ fields: readonly LLMProfileBodyField[];
13
+ snippet?: LLMProfileBodySnippet | undefined;
14
+ }>;
15
+ /**
16
+ * Stable canvas presentation data for LLM Profile configuration. It deliberately
17
+ * contains stored configuration only: runtime API-key values are never present
18
+ * in the node data and therefore cannot be rendered here.
19
+ */
20
+ export declare function getLLMProfileBodySections(data: LLMChatV2ProfileData): readonly LLMProfileBodySection[];
@@ -0,0 +1,47 @@
1
+ import { type ChatV2Provider, type ChatV2PipelineRoundOptions, type ChatV2PipelineResult, type RunChatV2PipelineOptions } from './chatV2Types.js';
2
+ import { type CustomProviderApi } from './customProviderApi.js';
3
+ export type LLMAttempt = {
4
+ roundIndex: number;
5
+ /** Present when a From profile candidate produced this attempt. */
6
+ profileIndex?: number;
7
+ provider: ChatV2Provider;
8
+ model: string;
9
+ customProviderApi?: CustomProviderApi;
10
+ stage: 'configuration' | 'request' | 'response-validation';
11
+ outcome: 'success' | 'failure' | 'aborted';
12
+ attemptIndex?: number;
13
+ status?: number;
14
+ error?: string;
15
+ };
16
+ export type LLMProfileFallbackCandidate = {
17
+ provider: ChatV2Provider;
18
+ model: string;
19
+ customProviderApi?: CustomProviderApi;
20
+ };
21
+ export type LLMProfileFallbackRunner = {
22
+ run: (roundOptions: ChatV2PipelineRoundOptions) => Promise<ChatV2PipelineResult>;
23
+ attempts: LLMAttempt[];
24
+ summary: () => string;
25
+ wasExhausted: () => boolean;
26
+ };
27
+ export declare class LLMProfileFallbackExhaustedError extends Error {
28
+ readonly attempts: readonly LLMAttempt[];
29
+ constructor(attempts: readonly LLMAttempt[]);
30
+ }
31
+ export declare function getLLMAttemptErrorMessage(error: unknown): string;
32
+ /**
33
+ * Produces the concise, developer-facing companion to the full attempt trace.
34
+ * It deliberately includes candidates that were never reached, so a successful
35
+ * primary profile does not make the configured fallback order invisible.
36
+ */
37
+ export declare function buildLLMProfileFallbackSummary(candidates: readonly LLMProfileFallbackCandidate[], attempts: readonly LLMAttempt[]): string;
38
+ /**
39
+ * Creates one forward-only fallback chain for a whole LLM Chat invocation.
40
+ * A model which succeeds in an earlier tool round stays active for subsequent
41
+ * rounds; only a later failure advances farther through the configured chain.
42
+ */
43
+ export declare function createLLMProfileFallbackRunner(params: {
44
+ candidates: readonly LLMProfileFallbackCandidate[];
45
+ resolveCandidate: (profileIndex: number, roundOptions: ChatV2PipelineRoundOptions) => Promise<RunChatV2PipelineOptions>;
46
+ onAttempt?: ((attempt: LLMAttempt) => void) | undefined;
47
+ }): LLMProfileFallbackRunner;
@@ -0,0 +1,189 @@
1
+ import type { LLMChatV2NodeData } from './llmChatV2NodeData.js';
2
+ /**
3
+ * Static ownership metadata for fields supplied by an LLM Profile.
4
+ *
5
+ * This deliberately does not attempt to describe editor layout or provider
6
+ * request construction. It provides the one fact those surfaces must share:
7
+ * which persisted LLM Chat fields are profile-owned, and which dynamic input
8
+ * ports a resolved profile consumes before it is passed to LLM Chat.
9
+ */
10
+ export type LLMProfileFieldSpec = {
11
+ key: keyof LLMChatV2NodeData;
12
+ inputId?: string;
13
+ /** Runtime validation for scalar fields; enum and collection fields keep named validators. */
14
+ valueKind?: 'string' | 'boolean' | 'required-number' | 'optional-number';
15
+ /** A resolved profile must never retain an active dynamic-input toggle. */
16
+ resolvedInputToggle?: boolean;
17
+ };
18
+ export declare const llmProfileFieldSpecs: readonly [{
19
+ readonly key: "model";
20
+ readonly inputId: "model";
21
+ readonly valueKind: "string";
22
+ }, {
23
+ readonly key: "useModelInput";
24
+ readonly valueKind: "boolean";
25
+ readonly resolvedInputToggle: true;
26
+ }, {
27
+ readonly key: "temperature";
28
+ readonly inputId: "temperature";
29
+ readonly valueKind: "required-number";
30
+ }, {
31
+ readonly key: "useTemperatureInput";
32
+ readonly valueKind: "boolean";
33
+ readonly resolvedInputToggle: true;
34
+ }, {
35
+ readonly key: "topP";
36
+ readonly inputId: "topP";
37
+ readonly valueKind: "optional-number";
38
+ }, {
39
+ readonly key: "useTopPInput";
40
+ readonly valueKind: "boolean";
41
+ readonly resolvedInputToggle: true;
42
+ }, {
43
+ readonly key: "topK";
44
+ readonly inputId: "topK";
45
+ readonly valueKind: "optional-number";
46
+ }, {
47
+ readonly key: "useTopKInput";
48
+ readonly valueKind: "boolean";
49
+ readonly resolvedInputToggle: true;
50
+ }, {
51
+ readonly key: "presencePenalty";
52
+ readonly inputId: "presencePenalty";
53
+ readonly valueKind: "optional-number";
54
+ }, {
55
+ readonly key: "usePresencePenaltyInput";
56
+ readonly valueKind: "boolean";
57
+ readonly resolvedInputToggle: true;
58
+ }, {
59
+ readonly key: "frequencyPenalty";
60
+ readonly inputId: "frequencyPenalty";
61
+ readonly valueKind: "optional-number";
62
+ }, {
63
+ readonly key: "useFrequencyPenaltyInput";
64
+ readonly valueKind: "boolean";
65
+ readonly resolvedInputToggle: true;
66
+ }, {
67
+ readonly key: "stopSequences";
68
+ readonly inputId: "stopSequences";
69
+ }, {
70
+ readonly key: "useStopSequencesInput";
71
+ readonly valueKind: "boolean";
72
+ readonly resolvedInputToggle: true;
73
+ }, {
74
+ readonly key: "seed";
75
+ readonly inputId: "seed";
76
+ readonly valueKind: "optional-number";
77
+ }, {
78
+ readonly key: "useSeedInput";
79
+ readonly valueKind: "boolean";
80
+ readonly resolvedInputToggle: true;
81
+ }, {
82
+ readonly key: "maxTokens";
83
+ readonly inputId: "maxTokens";
84
+ readonly valueKind: "required-number";
85
+ }, {
86
+ readonly key: "useMaxTokensInput";
87
+ readonly valueKind: "boolean";
88
+ readonly resolvedInputToggle: true;
89
+ }, {
90
+ readonly key: "provider";
91
+ }, {
92
+ readonly key: "apiKeySource";
93
+ readonly inputId: "apiKey";
94
+ }, {
95
+ readonly key: "customProviderApiKeyProgrammaticName";
96
+ readonly valueKind: "string";
97
+ }, {
98
+ readonly key: "customProviderApiKeyEnvVarName";
99
+ readonly valueKind: "string";
100
+ }, {
101
+ readonly key: "customProviderBaseURL";
102
+ readonly inputId: "customProviderBaseURL";
103
+ readonly valueKind: "string";
104
+ }, {
105
+ readonly key: "useCustomProviderBaseURLInput";
106
+ readonly valueKind: "boolean";
107
+ readonly resolvedInputToggle: true;
108
+ }, {
109
+ readonly key: "customProviderApi";
110
+ }, {
111
+ readonly key: "headers";
112
+ readonly inputId: "headers";
113
+ }, {
114
+ readonly key: "useHeadersInput";
115
+ readonly valueKind: "boolean";
116
+ readonly resolvedInputToggle: true;
117
+ }, {
118
+ readonly key: "extraProviderOptions";
119
+ readonly inputId: "extraProviderOptions";
120
+ readonly valueKind: "string";
121
+ }, {
122
+ readonly key: "useExtraProviderOptionsInput";
123
+ readonly valueKind: "boolean";
124
+ readonly resolvedInputToggle: true;
125
+ }, {
126
+ readonly key: "openAIReasoningEffort";
127
+ readonly valueKind: "string";
128
+ }, {
129
+ readonly key: "openAIReasoningSummary";
130
+ readonly valueKind: "string";
131
+ }, {
132
+ readonly key: "openAIPreviousResponseId";
133
+ readonly inputId: "previousResponseId";
134
+ readonly valueKind: "string";
135
+ }, {
136
+ readonly key: "useOpenAIPreviousResponseIdInput";
137
+ readonly valueKind: "boolean";
138
+ readonly resolvedInputToggle: true;
139
+ }, {
140
+ readonly key: "enableOpenAIWebSearch";
141
+ readonly valueKind: "boolean";
142
+ }, {
143
+ readonly key: "openAIWebSearchContextSize";
144
+ }, {
145
+ readonly key: "enableOpenAICodeInterpreter";
146
+ readonly valueKind: "boolean";
147
+ }, {
148
+ readonly key: "anthropicThinkingMode";
149
+ }, {
150
+ readonly key: "anthropicThinkingBudget";
151
+ readonly inputId: "anthropicThinkingBudget";
152
+ readonly valueKind: "optional-number";
153
+ }, {
154
+ readonly key: "useAnthropicThinkingBudgetInput";
155
+ readonly valueKind: "boolean";
156
+ readonly resolvedInputToggle: true;
157
+ }, {
158
+ readonly key: "anthropicEffort";
159
+ }, {
160
+ readonly key: "anthropicCacheControlTtl";
161
+ }, {
162
+ readonly key: "googleThinkingBudget";
163
+ readonly inputId: "googleThinkingBudget";
164
+ readonly valueKind: "optional-number";
165
+ }, {
166
+ readonly key: "useGoogleThinkingBudgetInput";
167
+ readonly valueKind: "boolean";
168
+ readonly resolvedInputToggle: true;
169
+ }, {
170
+ readonly key: "googleThinkingLevel";
171
+ }, {
172
+ readonly key: "googleIncludeThoughts";
173
+ readonly valueKind: "boolean";
174
+ }, {
175
+ readonly key: "enableGoogleSearchGrounding";
176
+ readonly valueKind: "boolean";
177
+ }, {
178
+ readonly key: "enableGoogleUrlContext";
179
+ readonly valueKind: "boolean";
180
+ }];
181
+ export declare const llmProfileDataKeys: ("provider" | "model" | "customProviderApi" | "headers" | "temperature" | "seed" | "maxTokens" | "presencePenalty" | "frequencyPenalty" | "useModelInput" | "useTemperatureInput" | "useTopPInput" | "useMaxTokensInput" | "usePresencePenaltyInput" | "useFrequencyPenaltyInput" | "useHeadersInput" | "useSeedInput" | "topP" | "topK" | "useTopKInput" | "stopSequences" | "useStopSequencesInput" | "anthropicCacheControlTtl" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext")[];
182
+ export declare const llmProfileInputIds: ("model" | "headers" | "temperature" | "seed" | "maxTokens" | "presencePenalty" | "frequencyPenalty" | "topP" | "topK" | "stopSequences" | "apiKey" | "customProviderBaseURL" | "extraProviderOptions" | "anthropicThinkingBudget" | "googleThinkingBudget" | "previousResponseId")[];
183
+ /** Runtime validation categories for resolved LLM Profile values. */
184
+ export declare const llmProfileStringDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
185
+ export declare const llmProfileBooleanDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
186
+ export declare const llmProfileRequiredNumberDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
187
+ export declare const llmProfileOptionalNumberDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
188
+ /** A serialized profile must be self-contained, not driven by hidden ports. */
189
+ export declare const llmProfileResolvedInputToggleDataKeys: Array<keyof LLMChatV2NodeData>;
@@ -6,7 +6,7 @@ export declare const LLM_PROFILE_VALUE_VERSION: 1;
6
6
  * until their matching provider or input toggle is enabled. This lets editor
7
7
  * operations preserve recoverable connections across configuration changes.
8
8
  */
9
- export declare const llmProfileInputIds: readonly ["model", "apiKey", "customProviderBaseURL", "previousResponseId", "temperature", "maxTokens", "topP", "topK", "presencePenalty", "frequencyPenalty", "stopSequences", "seed", "headers", "extraProviderOptions", "anthropicThinkingBudget", "googleThinkingBudget"];
9
+ export { llmProfileInputIds } from './llmProfileFieldRegistry.js';
10
10
  export type LLMProfileValue = {
11
11
  version: typeof LLM_PROFILE_VALUE_VERSION;
12
12
  configuration: LLMChatV2ProfileData;
@@ -0,0 +1,20 @@
1
+ import type { DataValue } from '../DataValue.js';
2
+ import type { ChatV2ResponseFormatMode } from './chatV2Types.js';
3
+ /**
4
+ * The one place where a provider response becomes Rivet's Response value.
5
+ *
6
+ * Providers may return a structured SDK value, JSON text, or ordinary text.
7
+ * Keeping this decision separate from port projection ensures validation sees
8
+ * exactly the same DataValue that a downstream node receives.
9
+ */
10
+ export type MaterializedLLMResponse = {
11
+ rawText: string;
12
+ value: DataValue;
13
+ source: 'sdk-structured' | 'text-json' | 'plain-text';
14
+ validation: 'not-requested' | 'valid' | 'invalid';
15
+ };
16
+ export declare function materializeLLMResponse(params: {
17
+ rawText: string;
18
+ structuredOutput: unknown | undefined;
19
+ responseFormat: ChatV2ResponseFormatMode | undefined;
20
+ }): MaterializedLLMResponse;