@valerypopoff/rivet2-core 2.15.0 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/cjs/bundle.cjs +7906 -3980
  2. package/dist/cjs/bundle.cjs.map +4 -4
  3. package/dist/cjs/interpolationRuntime.cjs +62 -7
  4. package/dist/cjs/interpolationRuntime.cjs.map +3 -3
  5. package/dist/cjs/interpolationSyntax.cjs +9 -5
  6. package/dist/cjs/interpolationSyntax.cjs.map +2 -2
  7. package/dist/cjs/serialization.cjs +1880 -0
  8. package/dist/cjs/serialization.cjs.map +7 -0
  9. package/dist/cjs/webAppRuntime.cjs +168 -6
  10. package/dist/cjs/webAppRuntime.cjs.map +3 -3
  11. package/dist/esm/api/createProcessor.js +5 -2
  12. package/dist/esm/api/processSettings.js +1 -0
  13. package/dist/esm/exports.js +4 -0
  14. package/dist/esm/model/AgentResponseTrace.js +99 -34
  15. package/dist/esm/model/AgentResponseTracePresentation.js +130 -0
  16. package/dist/esm/model/DataValue.js +11 -2
  17. package/dist/esm/model/GlobalVariables.js +2 -1
  18. package/dist/esm/model/GraphBoundaryCache.js +2 -1
  19. package/dist/esm/model/GraphBoundaryEffects.js +38 -1
  20. package/dist/esm/model/GraphExecutionState.js +81 -0
  21. package/dist/esm/model/GraphProcessor.js +825 -884
  22. package/dist/esm/model/GraphSchedulerBoundaryState.js +64 -0
  23. package/dist/esm/model/Nodes.js +15 -0
  24. package/dist/esm/model/ProjectBundle.js +248 -0
  25. package/dist/esm/model/ProjectBundleRuntime.js +54 -0
  26. package/dist/esm/model/SchedulerBoundaryPlanner.js +233 -0
  27. package/dist/esm/model/SplitRunProcessor.js +28 -7
  28. package/dist/esm/model/StreamingWatchTopology.js +118 -8
  29. package/dist/esm/model/SubgraphProjectTarget.js +7 -0
  30. package/dist/esm/model/SubprocessorBridge.js +125 -87
  31. package/dist/esm/model/ToolCallContinuationCoordinator.js +1 -1
  32. package/dist/esm/model/chat-v2/aiSdkBridge.js +22 -17
  33. package/dist/esm/model/chat-v2/chatV2CallObserver.js +2 -4
  34. package/dist/esm/model/chat-v2/chatV2CredentialNames.js +5 -1
  35. package/dist/esm/model/chat-v2/chatV2Outputs.js +2 -2
  36. package/dist/esm/model/chat-v2/chatV2Pipeline.js +24 -9
  37. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +3 -2
  38. package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +46 -6
  39. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +26 -1
  40. package/dist/esm/model/chat-v2/chatV2Shared.js +2 -1
  41. package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +10 -0
  42. package/dist/esm/model/chat-v2/llmChatV2Body.js +13 -10
  43. package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +5 -2
  44. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +3 -0
  45. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +33 -9
  46. package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +22 -2
  47. package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +10 -2
  48. package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +17 -0
  49. package/dist/esm/model/chat-v2/llmModelCandidate.js +2 -1
  50. package/dist/esm/model/chat-v2/llmProfile.js +5 -1
  51. package/dist/esm/model/chat-v2/llmProfileBody.js +11 -2
  52. package/dist/esm/model/chat-v2/llmProfileFallback.js +7 -4
  53. package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +2 -1
  54. package/dist/esm/model/chat-v2/llmProfileHealthStore.js +16 -3
  55. package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +1 -1
  56. package/dist/esm/model/chat-v2/messageConverter.js +18 -16
  57. package/dist/esm/model/chat-v2/modelRegistry.js +14 -4
  58. package/dist/esm/model/chat-v2/openRouterModel.js +73 -0
  59. package/dist/esm/model/chat-v2/parallelToolCalls.js +2 -0
  60. package/dist/esm/model/chat-v2/providerOptions.js +30 -25
  61. package/dist/esm/model/chat-v2/temperature.js +9 -0
  62. package/dist/esm/model/classifier/credentials.js +42 -6
  63. package/dist/esm/model/classifier/images.js +176 -0
  64. package/dist/esm/model/classifier/json.js +57 -0
  65. package/dist/esm/model/classifier/limits.js +300 -0
  66. package/dist/esm/model/classifier/openai.js +118 -0
  67. package/dist/esm/model/classifier/perplexity.js +63 -0
  68. package/dist/esm/model/classifier/preparation.js +74 -0
  69. package/dist/esm/model/classifier/profile.js +151 -0
  70. package/dist/esm/model/classifier/profileExecution.js +294 -0
  71. package/dist/esm/model/classifier/providers.js +454 -192
  72. package/dist/esm/model/classifier/questionHelpers.js +29 -45
  73. package/dist/esm/model/classifier/questions.js +53 -0
  74. package/dist/esm/model/classifier/response.js +75 -0
  75. package/dist/esm/model/classifier/state.js +207 -0
  76. package/dist/esm/model/classifier/types.js +11 -1
  77. package/dist/esm/model/nodeRunFailure.js +54 -0
  78. package/dist/esm/model/nodes/CallGraphNode.js +6 -0
  79. package/dist/esm/model/nodes/CatchStreamingChunksNode.js +42 -0
  80. package/dist/esm/model/nodes/ClassifierEvaluateNode.js +385 -154
  81. package/dist/esm/model/nodes/ClassifierProfileNode.js +133 -0
  82. package/dist/esm/model/nodes/ClassifierQuestionNode.js +59 -15
  83. package/dist/esm/model/nodes/DelegateFunctionCallNode.js +1 -1
  84. package/dist/esm/model/nodes/GetGlobalNode.js +2 -2
  85. package/dist/esm/model/nodes/HttpCallNode.js +44 -75
  86. package/dist/esm/model/nodes/ImageNode.js +44 -3
  87. package/dist/esm/model/nodes/LLMChatV2Node.js +26 -4
  88. package/dist/esm/model/nodes/ObjectNode.js +29 -18
  89. package/dist/esm/model/nodes/PromptNode.js +2 -1
  90. package/dist/esm/model/nodes/ReferencedGraphAliasNode.js +4 -1
  91. package/dist/esm/model/nodes/SetGlobalNode.js +5 -3
  92. package/dist/esm/model/nodes/StopWatchingStreamingOutputNode.js +8 -8
  93. package/dist/esm/model/nodes/StreamValueNode.js +38 -0
  94. package/dist/esm/model/nodes/SubGraphNode.js +199 -35
  95. package/dist/esm/model/nodes/ToBase64Node.js +106 -0
  96. package/dist/esm/model/nodes/WatchStreamingOutputNode.js +7 -7
  97. package/dist/esm/model/nodes/toolCallDelegation.js +5 -1
  98. package/dist/esm/model/profileSuspensionHints.js +8 -0
  99. package/dist/esm/recording/ExecutionRecorder.js +26 -0
  100. package/dist/esm/serialization.js +2 -0
  101. package/dist/esm/utils/base64.js +18 -15
  102. package/dist/esm/utils/coerceType.js +11 -1
  103. package/dist/esm/utils/errors.js +41 -0
  104. package/dist/esm/utils/interpolation.js +44 -22
  105. package/dist/esm/utils/interpolationSyntax.js +15 -6
  106. package/dist/esm/utils/serialization/serialization.js +3 -2
  107. package/dist/esm/utils/serialization/serializationUtils.js +6 -0
  108. package/dist/esm/utils/serialization/serialization_v4.js +15 -3
  109. package/dist/esm/webAppRuntime.js +1 -0
  110. package/dist/types/api/createProcessor.d.ts +7 -1
  111. package/dist/types/exports.d.ts +4 -0
  112. package/dist/types/model/AgentResponseTrace.d.ts +15 -4
  113. package/dist/types/model/AgentResponseTracePresentation.d.ts +15 -0
  114. package/dist/types/model/CycleDetector.d.ts +1 -2
  115. package/dist/types/model/DataValue.d.ts +12 -8
  116. package/dist/types/model/ExecutorProtocol.d.ts +9 -0
  117. package/dist/types/model/GraphBoundaryCache.d.ts +2 -0
  118. package/dist/types/model/GraphBoundaryEffects.d.ts +10 -1
  119. package/dist/types/model/GraphExecutionState.d.ts +68 -0
  120. package/dist/types/model/GraphProcessor.d.ts +2 -0
  121. package/dist/types/model/GraphSchedulerBoundaryState.d.ts +96 -0
  122. package/dist/types/model/Nodes.d.ts +11 -4
  123. package/dist/types/model/ProcessContext.d.ts +24 -3
  124. package/dist/types/model/ProjectBundle.d.ts +59 -0
  125. package/dist/types/model/ProjectBundleRuntime.d.ts +24 -0
  126. package/dist/types/model/ProjectReferenceLoader.d.ts +3 -0
  127. package/dist/types/model/RivetUIContext.d.ts +1 -1
  128. package/dist/types/model/SchedulerBoundaryPlanner.d.ts +42 -0
  129. package/dist/types/model/Settings.d.ts +1 -0
  130. package/dist/types/model/StreamingWatchTopology.d.ts +11 -1
  131. package/dist/types/model/SubgraphProjectTarget.d.ts +38 -0
  132. package/dist/types/model/SubprocessorBridge.d.ts +2 -0
  133. package/dist/types/model/chat-v2/chatV2CredentialNames.d.ts +4 -0
  134. package/dist/types/model/chat-v2/chatV2Outputs.d.ts +1 -1
  135. package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +79 -1
  136. package/dist/types/model/chat-v2/chatV2ProviderTypes.d.ts +1 -1
  137. package/dist/types/model/chat-v2/chatV2Shared.d.ts +1 -1
  138. package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +2 -0
  139. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +4 -1
  140. package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +3 -1
  141. package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +2 -0
  142. package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +2 -0
  143. package/dist/types/model/chat-v2/llmProfileFallback.d.ts +51 -3
  144. package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +10 -7
  145. package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +6 -2
  146. package/dist/types/model/chat-v2/modelRegistry.d.ts +5 -4
  147. package/dist/types/model/chat-v2/openRouterModel.d.ts +2 -0
  148. package/dist/types/model/chat-v2/providerOptions.d.ts +2 -13
  149. package/dist/types/model/chat-v2/temperature.d.ts +2 -0
  150. package/dist/types/model/classifier/credentials.d.ts +7 -1
  151. package/dist/types/model/classifier/images.d.ts +18 -0
  152. package/dist/types/model/classifier/json.d.ts +19 -0
  153. package/dist/types/model/classifier/limits.d.ts +45 -0
  154. package/dist/types/model/classifier/openai.d.ts +5 -0
  155. package/dist/types/model/classifier/perplexity.d.ts +7 -0
  156. package/dist/types/model/classifier/preparation.d.ts +16 -0
  157. package/dist/types/model/classifier/profile.d.ts +46 -0
  158. package/dist/types/model/classifier/profileExecution.d.ts +32 -0
  159. package/dist/types/model/classifier/providers.d.ts +98 -9
  160. package/dist/types/model/classifier/questionHelpers.d.ts +6 -4
  161. package/dist/types/model/classifier/questions.d.ts +4 -0
  162. package/dist/types/model/classifier/response.d.ts +4 -0
  163. package/dist/types/model/classifier/state.d.ts +37 -0
  164. package/dist/types/model/classifier/types.d.ts +11 -0
  165. package/dist/types/model/nodeRunFailure.d.ts +13 -0
  166. package/dist/types/model/nodes/CatchStreamingChunksNode.d.ts +20 -0
  167. package/dist/types/model/nodes/ClassifierEvaluateNode.d.ts +17 -12
  168. package/dist/types/model/nodes/ClassifierProfileNode.d.ts +20 -0
  169. package/dist/types/model/nodes/GetGlobalNode.d.ts +7 -0
  170. package/dist/types/model/nodes/ImageNode.d.ts +4 -0
  171. package/dist/types/model/nodes/LLMChatV2Node.d.ts +1 -0
  172. package/dist/types/model/nodes/ObjectNode.d.ts +2 -1
  173. package/dist/types/model/nodes/StreamValueNode.d.ts +14 -0
  174. package/dist/types/model/nodes/SubGraphNode.d.ts +21 -2
  175. package/dist/types/model/nodes/ToBase64Node.d.ts +12 -0
  176. package/dist/types/model/nodes/toolCallDelegation.d.ts +3 -1
  177. package/dist/types/model/profileSuspensionHints.d.ts +8 -0
  178. package/dist/types/recording/ExecutionRecorder.d.ts +8 -2
  179. package/dist/types/serialization.d.ts +2 -0
  180. package/dist/types/utils/base64.d.ts +1 -1
  181. package/dist/types/utils/errors.d.ts +4 -0
  182. package/dist/types/utils/interpolation.d.ts +13 -2
  183. package/dist/types/utils/interpolationSyntax.d.ts +1 -1
  184. package/dist/types/utils/serialization/serialization.d.ts +3 -1
  185. package/dist/types/utils/serialization/serializationUtils.d.ts +1 -0
  186. package/dist/types/webAppRuntime.d.ts +1 -0
  187. package/package.json +7 -1
@@ -78,7 +78,7 @@ var DEFAULT_LLM_CHAT_V2_RETRY_ON_NON_200_COOLDOWN_MS = 0;
78
78
  var llmProfileFieldSpecs = [
79
79
  { key: "model", inputId: "model", valueKind: "string" },
80
80
  { key: "useModelInput", valueKind: "boolean", resolvedInputToggle: true },
81
- { key: "temperature", inputId: "temperature", valueKind: "required-number" },
81
+ { key: "temperature", inputId: "temperature", valueKind: "optional-number" },
82
82
  { key: "useTemperatureInput", valueKind: "boolean", resolvedInputToggle: true },
83
83
  { key: "topP", inputId: "topP", valueKind: "optional-number" },
84
84
  { key: "useTopPInput", valueKind: "boolean", resolvedInputToggle: true },
@@ -107,6 +107,7 @@ var llmProfileFieldSpecs = [
107
107
  { key: "extraProviderOptions", inputId: "extraProviderOptions", valueKind: "string" },
108
108
  { key: "useExtraProviderOptionsInput", valueKind: "boolean", resolvedInputToggle: true },
109
109
  { key: "openAIReasoningEffort", valueKind: "string" },
110
+ { key: "openRouterReasoningEffort", valueKind: "string" },
110
111
  { key: "openAIReasoningSummary", valueKind: "string" },
111
112
  { key: "openAIPreviousResponseId", inputId: "previousResponseId", valueKind: "string" },
112
113
  { key: "useOpenAIPreviousResponseIdInput", valueKind: "boolean", resolvedInputToggle: true },
@@ -158,6 +159,7 @@ function sha256(value) {
158
159
  function createRivetLLMProfileHealthIdentity(params) {
159
160
  var _a;
160
161
  const profileName = (_a = params.profileName) == null ? void 0 : _a.trim();
162
+ const openRouterRouting = params.configuration.provider === "openrouter" && params.configuration.extraProviderOptions ? pickOpenRouterRouting(JSON.parse(params.configuration.extraProviderOptions)) : {};
161
163
  const routingConfiguration = {
162
164
  provider: params.configuration.provider,
163
165
  model: params.configuration.model,
@@ -165,7 +167,8 @@ function createRivetLLMProfileHealthIdentity(params) {
165
167
  customProviderApi: params.configuration.customProviderApi ?? "completions",
166
168
  customProviderBaseURL: params.configuration.customProviderBaseURL
167
169
  },
168
- headers: canonicalizeEffectiveRoutingHeaders(params.chatNodeHeaders, params.configuration.headers)
170
+ headers: canonicalizeEffectiveRoutingHeaders(params.chatNodeHeaders, params.configuration.headers),
171
+ ...Object.keys(openRouterRouting).length > 0 ? { openRouterRouting } : {}
169
172
  };
170
173
  const serialized = (0, import_safe_stable_stringify.default)({
171
174
  routingConfiguration,
@@ -193,6 +196,11 @@ function createRivetLLMProfileHealthIdentity(params) {
193
196
  configurationFingerprint
194
197
  };
195
198
  }
199
+ function pickOpenRouterRouting(options) {
200
+ return Object.fromEntries(
201
+ ["model", "provider", "models", "route"].filter((key) => options[key] !== void 0).map((key) => [key, options[key]])
202
+ );
203
+ }
196
204
  function canonicalizeEffectiveRoutingHeaders(chatNodeHeaders, profileHeaders) {
197
205
  const headers = /* @__PURE__ */ new Map();
198
206
  for (const [key, value] of Object.entries(chatNodeHeaders ?? {})) {
@@ -228,6 +236,7 @@ function createLLMChatV2NodeData() {
228
236
  extraProviderOptions: "",
229
237
  useExtraProviderOptionsInput: false,
230
238
  openAIReasoningEffort: "",
239
+ openRouterReasoningEffort: "",
231
240
  openAIReasoningSummary: "",
232
241
  openAIPreviousResponseId: "",
233
242
  useOpenAIPreviousResponseIdInput: false,
@@ -262,6 +271,8 @@ function createLLMChatV2NodeData() {
262
271
  autoContinueToolCalls: false,
263
272
  maxToolRounds: 3,
264
273
  retryOnNon200: false,
274
+ errorOnNon200: true,
275
+ catchRequestFailed: false,
265
276
  retryOnNon200RepeatTimes: DEFAULT_LLM_CHAT_V2_RETRY_ON_NON_200_REPEAT_TIMES,
266
277
  retryOnNon200CooldownMs: DEFAULT_LLM_CHAT_V2_RETRY_ON_NON_200_COOLDOWN_MS,
267
278
  outputLLMAttempts: false,
@@ -368,6 +379,10 @@ var dataTypes = exhaustiveTuple()(
368
379
  "llm-config[]",
369
380
  "fn<llm-config>",
370
381
  "fn<llm-config[]>",
382
+ "classifier-config",
383
+ "classifier-config[]",
384
+ "fn<classifier-config>",
385
+ "fn<classifier-config[]>",
371
386
  "document",
372
387
  "document[]",
373
388
  "fn<document>",
@@ -394,6 +409,7 @@ var scalarTypes = exhaustiveTuple()(
394
409
  "knowledge-document",
395
410
  "knowledge-evidence",
396
411
  "llm-config",
412
+ "classifier-config",
397
413
  "document"
398
414
  );
399
415
  function isScalarDataValue(value) {
@@ -494,6 +510,11 @@ var scalarDefaults = {
494
510
  documentId: ""
495
511
  },
496
512
  "llm-config": createDefaultLLMProfileValue(),
513
+ "classifier-config": {
514
+ version: 1,
515
+ configuration: { provider: "jev", model: "jev-latest" },
516
+ credential: {}
517
+ },
497
518
  document: {
498
519
  mediaType: "text/plain",
499
520
  data: new Uint8Array(),
@@ -704,6 +725,10 @@ var CHAT_V2_DEFAULT_CREDENTIAL_NAMES = {
704
725
  google: {
705
726
  programmaticName: "googleApiKey",
706
727
  environmentVariableName: "GOOGLE_GENERATIVE_AI_API_KEY"
728
+ },
729
+ openrouter: {
730
+ programmaticName: "openRouterApiKey",
731
+ environmentVariableName: "OPENROUTER_API_KEY"
707
732
  }
708
733
  };
709
734
  var programmaticNamePattern = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
@@ -754,7 +779,7 @@ function normalizeChatV2CredentialNamesByProvider(value) {
754
779
  throw new Error(`Unsupported provider API key names entry: ${unsupportedProvider}.`);
755
780
  }
756
781
  const normalized = {};
757
- for (const provider of ["openai", "anthropic", "google"]) {
782
+ for (const provider of ["openai", "anthropic", "google", "openrouter"]) {
758
783
  if (raw[provider] != null) {
759
784
  normalized[provider] = normalizeChatV2CredentialNames(provider, raw[provider]);
760
785
  }
@@ -762,6 +787,15 @@ function normalizeChatV2CredentialNamesByProvider(value) {
762
787
  return Object.keys(normalized).length === 0 ? void 0 : normalized;
763
788
  }
764
789
 
790
+ // src/model/chat-v2/temperature.ts
791
+ function normalizeTemperature(value, label = "Temperature") {
792
+ if (value == null || typeof value === "number" && Number.isNaN(value)) return void 0;
793
+ if (typeof value !== "number" || !Number.isFinite(value)) {
794
+ throw new Error(`${label} must be a finite number when provided.`);
795
+ }
796
+ return value;
797
+ }
798
+
765
799
  // src/model/chat-v2/llmProfile.ts
766
800
  var credentialSources = /* @__PURE__ */ new Set([
767
801
  "input",
@@ -771,7 +805,7 @@ var credentialSources = /* @__PURE__ */ new Set([
771
805
  "environment",
772
806
  "none"
773
807
  ]);
774
- var profileProviders = /* @__PURE__ */ new Set(["openai", "anthropic", "google", "custom"]);
808
+ var profileProviders = /* @__PURE__ */ new Set(["openai", "anthropic", "google", "openrouter", "custom"]);
775
809
  function normalizeLLMProfileValue(value) {
776
810
  if (!isRecord2(value)) {
777
811
  throw new Error("LLM Profile input must contain an LLM profile value.");
@@ -792,6 +826,8 @@ function normalizeLLMProfileValue(value) {
792
826
  const configuration = normalizeConfiguration({
793
827
  ...defaults,
794
828
  ...value.configuration,
829
+ // Defaults seed new nodes, not missing values in an existing profile.
830
+ temperature: normalizeTemperature(value.configuration.temperature, "LLM Profile temperature"),
795
831
  provider,
796
832
  model: model.trim()
797
833
  });
@@ -845,6 +881,11 @@ function normalizeConfiguration(data) {
845
881
  throw new Error(`Unsupported LLM Profile API key source: ${String(data.apiKeySource)}.`);
846
882
  }
847
883
  assertEnumValue(data.openAIWebSearchContextSize, ["low", "medium", "high"], "OpenAI web search context");
884
+ assertEnumValue(
885
+ data.openRouterReasoningEffort ?? "",
886
+ ["", "none", "minimal", "low", "medium", "high", "xhigh"],
887
+ "OpenRouter reasoning effort"
888
+ );
848
889
  const customProviderApi = parseCustomProviderApi(data.customProviderApi);
849
890
  assertEnumValue(data.anthropicThinkingMode, ["", "adaptive", "enabled", "disabled"], "Anthropic thinking mode");
850
891
  assertEnumValue(data.anthropicEffort, ["", "low", "medium", "high", "max"], "Anthropic effort");
@@ -919,7 +960,7 @@ function isRecord2(value) {
919
960
 
920
961
  // src/utils/coerceType.ts
921
962
  function isValidatedObjectValueType(type) {
922
- return type === "knowledge-source" || type === "knowledge-document" || type === "knowledge-evidence" || type === "llm-config";
963
+ return type === "knowledge-source" || type === "knowledge-document" || type === "knowledge-evidence" || type === "llm-config" || type === "classifier-config";
923
964
  }
924
965
  function canAttemptGeneralCoercion(from, to) {
925
966
  return !isValidatedObjectValueType(from) || to === "object" || to === "string";
@@ -973,6 +1014,11 @@ var scalarCoercionRules = {
973
1014
  "llm-config",
974
1015
  (value) => coerceValidatedObjectValue(value, normalizeLLMProfileValue)
975
1016
  ),
1017
+ // Provider-specific validation belongs to Evaluate's bounded snapshot boundary.
1018
+ "classifier-config": sameTypeOrObjectScalarRule(
1019
+ "classifier-config",
1020
+ (value) => (value == null ? void 0 : value.value) != null && typeof value.value === "object" && !Array.isArray(value.value) ? value.value : void 0
1021
+ ),
976
1022
  document: generalScalarRule("document")
977
1023
  };
978
1024
  function coerceTypeOptional(wrapped, type) {
@@ -980,6 +1026,9 @@ function coerceTypeOptional(wrapped, type) {
980
1026
  return expectTypeOptional(wrapped, type);
981
1027
  }
982
1028
  const value = wrapped ? unwrapDataValue(wrapped) : void 0;
1029
+ if (type === "classifier-config" && (value == null ? void 0 : value.type) === "llm-config" || type === "llm-config" && (value == null ? void 0 : value.type) === "classifier-config") {
1030
+ return void 0;
1031
+ }
983
1032
  if (isArrayDataType(type) && !isArrayDataValue(value)) {
984
1033
  const coerced = coerceTypeOptional(value, getScalarTypeOf(type));
985
1034
  if (coerced === void 0) {
@@ -1557,15 +1606,21 @@ function resolveInterpolationExpressionRawValue(expression, sources) {
1557
1606
  return void 0;
1558
1607
  }
1559
1608
  const shouldUnwrapDataValue = reference.source !== "variable" || sources.unwrapVariableDataValues !== false;
1560
- const baseValue = shouldUnwrapDataValue ? unwrapPotentialDataValue(source[reference.baseName]) : source[reference.baseName];
1609
+ const property = sources.guard ? Object.getOwnPropertyDescriptor(source, reference.baseName) : void 0;
1610
+ if (sources.guard && (!property || !("value" in property)))
1611
+ throw new Error("Interpolation sources must use own data properties, not accessors.");
1612
+ const sourceValue = sources.guard ? sources.guard.prepareValue(property.value) : source[reference.baseName];
1613
+ const baseValue = shouldUnwrapDataValue ? unwrapPotentialDataValue(sourceValue) : sourceValue;
1561
1614
  if (reference.jsonPath === void 0) {
1562
1615
  return baseValue;
1563
1616
  }
1617
+ let selected;
1564
1618
  try {
1565
- return evaluateJsonPath(baseValue, reference.jsonPath, false);
1619
+ selected = evaluateJsonPath(baseValue, reference.jsonPath, false);
1566
1620
  } catch {
1567
1621
  return void 0;
1568
1622
  }
1623
+ return sources.guard ? sources.guard.prepareValue(selected) : selected;
1569
1624
  }
1570
1625
  function resolveCodeInterpolationExpression(inputs, expression, graphInputValues, contextValues, globalValues) {
1571
1626
  return resolveInterpolationExpressionRawValue(expression, {