@valerypopoff/rivet2-core 2.17.0 → 2.21.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 (120) hide show
  1. package/dist/cjs/bundle.cjs +3197 -1461
  2. package/dist/cjs/bundle.cjs.map +4 -4
  3. package/dist/cjs/interpolationRuntime.cjs +40 -4
  4. package/dist/cjs/interpolationRuntime.cjs.map +2 -2
  5. package/dist/cjs/serialization.cjs +1880 -0
  6. package/dist/cjs/serialization.cjs.map +7 -0
  7. package/dist/cjs/webAppRuntime.cjs +168 -6
  8. package/dist/cjs/webAppRuntime.cjs.map +3 -3
  9. package/dist/esm/api/processSettings.js +1 -0
  10. package/dist/esm/exports.js +3 -0
  11. package/dist/esm/model/AgentResponseTrace.js +99 -34
  12. package/dist/esm/model/AgentResponseTracePresentation.js +130 -0
  13. package/dist/esm/model/DataValue.js +11 -2
  14. package/dist/esm/model/GlobalVariables.js +2 -1
  15. package/dist/esm/model/GraphBoundaryEffects.js +38 -1
  16. package/dist/esm/model/GraphExecutionState.js +81 -0
  17. package/dist/esm/model/GraphProcessor.js +625 -943
  18. package/dist/esm/model/GraphSchedulerBoundaryState.js +64 -0
  19. package/dist/esm/model/Nodes.js +5 -0
  20. package/dist/esm/model/ProjectBundle.js +69 -11
  21. package/dist/esm/model/ProjectBundleRuntime.js +54 -0
  22. package/dist/esm/model/ProjectGraphCallSites.js +46 -0
  23. package/dist/esm/model/SchedulerBoundaryPlanner.js +233 -0
  24. package/dist/esm/model/SubprocessorBridge.js +125 -87
  25. package/dist/esm/model/ToolCallContinuationCoordinator.js +1 -1
  26. package/dist/esm/model/chat-v2/aiSdkBridge.js +15 -12
  27. package/dist/esm/model/chat-v2/chatV2CallObserver.js +2 -4
  28. package/dist/esm/model/chat-v2/chatV2CredentialNames.js +5 -1
  29. package/dist/esm/model/chat-v2/chatV2Outputs.js +2 -2
  30. package/dist/esm/model/chat-v2/chatV2Pipeline.js +11 -1
  31. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +3 -2
  32. package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +46 -6
  33. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +7 -0
  34. package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +10 -0
  35. package/dist/esm/model/chat-v2/llmChatV2Body.js +3 -3
  36. package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +5 -2
  37. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +1 -0
  38. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +25 -15
  39. package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +10 -2
  40. package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +17 -0
  41. package/dist/esm/model/chat-v2/llmModelCandidate.js +2 -1
  42. package/dist/esm/model/chat-v2/llmProfile.js +2 -1
  43. package/dist/esm/model/chat-v2/llmProfileBody.js +9 -0
  44. package/dist/esm/model/chat-v2/llmProfileFallback.js +7 -4
  45. package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +1 -0
  46. package/dist/esm/model/chat-v2/llmProfileHealthStore.js +16 -3
  47. package/dist/esm/model/chat-v2/messageConverter.js +18 -16
  48. package/dist/esm/model/chat-v2/modelRegistry.js +14 -4
  49. package/dist/esm/model/chat-v2/openRouterModel.js +73 -0
  50. package/dist/esm/model/chat-v2/parallelToolCalls.js +2 -0
  51. package/dist/esm/model/chat-v2/providerOptions.js +30 -25
  52. package/dist/esm/model/classifier/credentials.js +13 -3
  53. package/dist/esm/model/classifier/limits.js +33 -3
  54. package/dist/esm/model/classifier/perplexity.js +63 -0
  55. package/dist/esm/model/classifier/profile.js +151 -0
  56. package/dist/esm/model/classifier/profileExecution.js +294 -0
  57. package/dist/esm/model/classifier/providers.js +217 -30
  58. package/dist/esm/model/classifier/state.js +4 -1
  59. package/dist/esm/model/classifier/types.js +11 -1
  60. package/dist/esm/model/nodeRunFailure.js +8 -1
  61. package/dist/esm/model/nodes/CallGraphNode.js +6 -0
  62. package/dist/esm/model/nodes/ClassifierEvaluateNode.js +257 -66
  63. package/dist/esm/model/nodes/ClassifierProfileNode.js +133 -0
  64. package/dist/esm/model/nodes/DelegateFunctionCallNode.js +1 -1
  65. package/dist/esm/model/nodes/LLMChatV2Node.js +2 -1
  66. package/dist/esm/model/nodes/SubGraphNode.js +4 -0
  67. package/dist/esm/model/nodes/toolCallDelegation.js +5 -1
  68. package/dist/esm/model/profileSuspensionHints.js +8 -0
  69. package/dist/esm/serialization.js +2 -0
  70. package/dist/esm/utils/coerceType.js +11 -1
  71. package/dist/esm/webAppRuntime.js +1 -0
  72. package/dist/types/exports.d.ts +3 -0
  73. package/dist/types/model/AgentResponseTrace.d.ts +15 -4
  74. package/dist/types/model/AgentResponseTracePresentation.d.ts +15 -0
  75. package/dist/types/model/DataValue.d.ts +12 -8
  76. package/dist/types/model/ExecutorProtocol.d.ts +14 -2
  77. package/dist/types/model/GraphBoundaryEffects.d.ts +10 -1
  78. package/dist/types/model/GraphExecutionState.d.ts +68 -0
  79. package/dist/types/model/GraphProcessor.d.ts +1 -0
  80. package/dist/types/model/GraphSchedulerBoundaryState.d.ts +96 -0
  81. package/dist/types/model/Nodes.d.ts +7 -4
  82. package/dist/types/model/ProcessContext.d.ts +12 -3
  83. package/dist/types/model/ProjectBundle.d.ts +18 -4
  84. package/dist/types/model/ProjectBundleRuntime.d.ts +24 -0
  85. package/dist/types/model/ProjectGraphCallSites.d.ts +12 -0
  86. package/dist/types/model/RivetUIContext.d.ts +1 -1
  87. package/dist/types/model/SchedulerBoundaryPlanner.d.ts +42 -0
  88. package/dist/types/model/Settings.d.ts +1 -0
  89. package/dist/types/model/SubgraphProjectTarget.d.ts +6 -0
  90. package/dist/types/model/SubprocessorBridge.d.ts +2 -0
  91. package/dist/types/model/chat-v2/chatV2CredentialNames.d.ts +4 -0
  92. package/dist/types/model/chat-v2/chatV2Outputs.d.ts +1 -1
  93. package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +79 -1
  94. package/dist/types/model/chat-v2/chatV2ProviderTypes.d.ts +1 -1
  95. package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +2 -0
  96. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +2 -1
  97. package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +2 -0
  98. package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +2 -0
  99. package/dist/types/model/chat-v2/llmProfileFallback.d.ts +51 -3
  100. package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +9 -6
  101. package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +6 -2
  102. package/dist/types/model/chat-v2/modelRegistry.d.ts +5 -4
  103. package/dist/types/model/chat-v2/openRouterModel.d.ts +2 -0
  104. package/dist/types/model/chat-v2/providerOptions.d.ts +2 -13
  105. package/dist/types/model/classifier/credentials.d.ts +4 -0
  106. package/dist/types/model/classifier/limits.d.ts +4 -1
  107. package/dist/types/model/classifier/perplexity.d.ts +7 -0
  108. package/dist/types/model/classifier/profile.d.ts +46 -0
  109. package/dist/types/model/classifier/profileExecution.d.ts +32 -0
  110. package/dist/types/model/classifier/providers.d.ts +32 -1
  111. package/dist/types/model/classifier/types.d.ts +9 -0
  112. package/dist/types/model/nodes/ClassifierEvaluateNode.d.ts +14 -12
  113. package/dist/types/model/nodes/ClassifierProfileNode.d.ts +20 -0
  114. package/dist/types/model/nodes/SubGraphNode.d.ts +1 -1
  115. package/dist/types/model/nodes/toolCallDelegation.d.ts +3 -1
  116. package/dist/types/model/profileSuspensionHints.d.ts +8 -0
  117. package/dist/types/recording/ExecutionRecorder.d.ts +5 -1
  118. package/dist/types/serialization.d.ts +2 -0
  119. package/dist/types/webAppRuntime.d.ts +1 -0
  120. package/package.json +7 -1
@@ -41,6 +41,7 @@ __export(webAppRuntime_exports, {
41
41
  applyUiGraphWebAppStorageActionPatch: () => applyUiGraphWebAppStorageActionPatch,
42
42
  applyUiGraphWebAppStorageActionPatchAsync: () => applyUiGraphWebAppStorageActionPatchAsync,
43
43
  applyUiGraphWebAppStoragePatch: () => applyUiGraphWebAppStoragePatch,
44
+ buildAgentProfileAttemptInspectorRows: () => buildAgentProfileAttemptInspectorRows,
44
45
  clearUiGraphChatSearchMatches: () => clearUiGraphChatSearchMatches,
45
46
  copyUiGraphText: () => copyUiGraphText,
46
47
  createUiGraphActionExecutionController: () => createUiGraphActionExecutionController,
@@ -55,6 +56,9 @@ __export(webAppRuntime_exports, {
55
56
  downloadUiGraphJsonOutput: () => downloadUiGraphJsonOutput,
56
57
  encodeRivetWebAppStorageBinaryFrame: () => encodeRivetWebAppStorageBinaryFrame,
57
58
  enhanceUiGraphChatJsonCodeBlocks: () => enhanceUiGraphChatJsonCodeBlocks,
59
+ formatClassifierRequestCount: () => formatClassifierRequestCount,
60
+ getClassifierRequestCount: () => getClassifierRequestCount,
61
+ getProfileAttemptOmissionNotice: () => getProfileAttemptOmissionNotice,
58
62
  getUiGraphActionState: () => getUiGraphActionState,
59
63
  getUiGraphChatDraftStateKey: () => getUiGraphChatDraftStateKey,
60
64
  getUiGraphChatMessagePresentations: () => getUiGraphChatMessagePresentations,
@@ -70,6 +74,7 @@ __export(webAppRuntime_exports, {
70
74
  hasUiGraphChatPersistentStateChanged: () => hasUiGraphChatPersistentStateChanged,
71
75
  highlightUiGraphChatSearchMatches: () => highlightUiGraphChatSearchMatches,
72
76
  isAgentResponseTrace: () => isAgentResponseTrace,
77
+ isClassifierRequest: () => isClassifierRequest,
73
78
  loadUiGraphChatPersistentState: () => loadUiGraphChatPersistentState,
74
79
  loadUiGraphResponseTrace: () => loadUiGraphResponseTrace,
75
80
  loadUiGraphWebAppStorage: () => loadUiGraphWebAppStorage,
@@ -89,6 +94,18 @@ __export(webAppRuntime_exports, {
89
94
  });
90
95
  module.exports = __toCommonJS(webAppRuntime_exports);
91
96
 
97
+ // src/model/classifier/types.ts
98
+ var classifierFailureKinds = [
99
+ "configuration",
100
+ "capability",
101
+ "authentication",
102
+ "transport",
103
+ "http",
104
+ "timeout",
105
+ "response-parsing",
106
+ "response-validation"
107
+ ];
108
+
92
109
  // src/model/AgentResponseTrace.ts
93
110
  var AGENT_RESPONSE_TRACE_SCHEMA_VERSION = 1;
94
111
  var AGENT_RESPONSE_TRACE_MAX_MODEL_CALLS = 250;
@@ -122,7 +139,8 @@ function isAgentResponseTrace(value) {
122
139
  return false;
123
140
  if (typeof value.traceId !== "string" || typeof value.rootRunId !== "string") return false;
124
141
  if (typeof value.graphRunId !== "string" || typeof value.graphId !== "string") return false;
125
- if (value.scope !== "response" && value.scope !== "llm-invocation") return false;
142
+ if (value.scope !== "response" && value.scope !== "llm-invocation" && value.scope !== "classifier-invocation")
143
+ return false;
126
144
  if (!isRecord(value.summary) || !Array.isArray(value.modelCalls) || !Array.isArray(value.toolCalls)) return false;
127
145
  if (value.profileAttempts !== void 0 && !Array.isArray(value.profileAttempts)) return false;
128
146
  if (value.modelCalls.length > AGENT_RESPONSE_TRACE_MAX_MODEL_CALLS) return false;
@@ -174,10 +192,16 @@ function isAgentLLMProfileAttemptTrace(value) {
174
192
  "healthDisposition",
175
193
  "healthOutcome",
176
194
  "retryAt",
177
- "timeoutKind"
178
- ]) && typeof value.eventId === "string" && isNonNegativeInteger(value.roundIndex) && isOptionalNonNegativeInteger(value.profileIndex) && isOptionalString(value.profileName) && typeof value.nodeId === "string" && typeof value.processId === "string" && typeof value.provider === "string" && typeof value.model === "string" && (value.customProviderApi === void 0 || value.customProviderApi === "completions" || value.customProviderApi === "responses") && ["configuration", "request", "response-validation", "health-gate", "health-update"].includes(
179
- String(value.stage)
180
- ) && ["success", "failure", "aborted", "skipped"].includes(String(value.outcome)) && isOptionalNonNegativeInteger(value.attemptIndex) && isOptionalNonNegativeFiniteNumber(value.status) && isOptionalString(value.error) && isOptionalString(value.profileHealthKey) && (value.healthState === void 0 || value.healthState === "closed" || value.healthState === "open" || value.healthState === "half-open") && (value.healthDisposition === void 0 || value.healthDisposition === "allow" || value.healthDisposition === "deny" || value.healthDisposition === "fail-open") && (value.healthOutcome === void 0 || value.healthOutcome === "healthy" || value.healthOutcome === "unhealthy" || value.healthOutcome === "ignored") && isOptionalNonNegativeFiniteNumber(value.retryAt) && (value.timeoutKind === void 0 || value.timeoutKind === "first-output" || value.timeoutKind === "stream-inactivity");
195
+ "timeoutKind",
196
+ "family",
197
+ "failureKind",
198
+ "skipReason",
199
+ "classifierUsage",
200
+ "durationMs"
201
+ ]) && typeof value.eventId === "string" && isNonNegativeInteger(value.roundIndex) && isOptionalNonNegativeInteger(value.profileIndex) && isOptionalString(value.profileName) && isOptionalNonNegativeFiniteNumber(value.durationMs) && (value.family === void 0 || value.family === "llm" || value.family === "classifier") && (value.skipReason === void 0 || value.skipReason === "unreached" && value.outcome === "skipped") && (value.classifierUsage === void 0 || value.family === "classifier" && isClassifierAttemptUsage(value.classifierUsage)) && (value.failureKind === void 0 || classifierFailureKinds.includes(value.failureKind)) && typeof value.nodeId === "string" && typeof value.processId === "string" && typeof value.provider === "string" && typeof value.model === "string" && (value.customProviderApi === void 0 || value.customProviderApi === "completions" || value.customProviderApi === "responses") && ["configuration", "request", "response-validation", "health-gate", "health-update"].includes(String(value.stage)) && ["success", "failure", "aborted", "skipped"].includes(String(value.outcome)) && isOptionalNonNegativeInteger(value.attemptIndex) && isOptionalNonNegativeFiniteNumber(value.status) && isOptionalString(value.error) && isOptionalString(value.profileHealthKey) && (value.healthState === void 0 || value.healthState === "closed" || value.healthState === "open" || value.healthState === "half-open") && (value.healthDisposition === void 0 || value.healthDisposition === "allow" || value.healthDisposition === "deny" || value.healthDisposition === "fail-open") && (value.healthOutcome === void 0 || value.healthOutcome === "healthy" || value.healthOutcome === "unhealthy" || value.healthOutcome === "ignored") && isOptionalNonNegativeFiniteNumber(value.retryAt) && (value.timeoutKind === void 0 || value.timeoutKind === "first-output" || value.timeoutKind === "stream-inactivity" || value.timeoutKind === "response");
202
+ }
203
+ function isClassifierAttemptUsage(value) {
204
+ return isRecord(value) && hasOnlyKeys(value, ["inputTokens", "outputTokens", "estimatedCostUsd"]) && Number.isSafeInteger(value.inputTokens) && value.inputTokens >= 0 && Number.isSafeInteger(value.outputTokens) && value.outputTokens >= 0 && isOptionalNonNegativeFiniteNumber(value.estimatedCostUsd);
181
205
  }
182
206
  function isAgentToolCallTrace(value) {
183
207
  const hasKnownOutcome = isRecord(value) && (value.outcome === "success" || value.outcome === "passthrough-error" || value.outcome === "failure" || value.outcome === "aborted");
@@ -204,6 +228,7 @@ function isAgentToolResultOwner(value) {
204
228
  function isAgentTraceSummary(value) {
205
229
  return hasOnlyKeys(value, [
206
230
  "modelCallCount",
231
+ "classifierRequestCount",
207
232
  "toolCallCount",
208
233
  "retryCount",
209
234
  "fallbackCount",
@@ -214,7 +239,7 @@ function isAgentTraceSummary(value) {
214
239
  "reasoningTokens",
215
240
  "knownCostUsd",
216
241
  "costStatus"
217
- ]) && isNonNegativeInteger(value.modelCallCount) && isNonNegativeInteger(value.toolCallCount) && isNonNegativeInteger(value.retryCount) && isNonNegativeInteger(value.fallbackCount) && isOptionalNonNegativeFiniteNumber(value.promptTokens) && isOptionalNonNegativeFiniteNumber(value.completionTokens) && isOptionalNonNegativeFiniteNumber(value.totalTokens) && isOptionalNonNegativeFiniteNumber(value.cachedTokens) && isOptionalNonNegativeFiniteNumber(value.reasoningTokens) && isNonNegativeFiniteNumber(value.knownCostUsd) && (value.costStatus === "known" || value.costStatus === "partial" || value.costStatus === "unknown");
242
+ ]) && isNonNegativeInteger(value.modelCallCount) && isOptionalNonNegativeInteger(value.classifierRequestCount) && isNonNegativeInteger(value.toolCallCount) && isNonNegativeInteger(value.retryCount) && isNonNegativeInteger(value.fallbackCount) && isOptionalNonNegativeFiniteNumber(value.promptTokens) && isOptionalNonNegativeFiniteNumber(value.completionTokens) && isOptionalNonNegativeFiniteNumber(value.totalTokens) && isOptionalNonNegativeFiniteNumber(value.cachedTokens) && isOptionalNonNegativeFiniteNumber(value.reasoningTokens) && isNonNegativeFiniteNumber(value.knownCostUsd) && (value.costStatus === "known" || value.costStatus === "partial" || value.costStatus === "unknown");
218
243
  }
219
244
  function isAgentTraceUsage(value) {
220
245
  return isRecord(value) && hasOnlyKeys(value, ["promptTokens", "completionTokens", "totalTokens", "cachedTokens", "reasoningTokens"]) && Object.values(value).every(isNonNegativeFiniteNumber);
@@ -251,6 +276,138 @@ function isRecord(value) {
251
276
  return typeof value === "object" && value != null && !Array.isArray(value);
252
277
  }
253
278
 
279
+ // src/model/chat-v2/customProviderApi.ts
280
+ var customProviderApiContracts = {
281
+ completions: {
282
+ api: "completions",
283
+ adapter: "openai-compatible",
284
+ endpointPath: "/chat/completions",
285
+ label: "Custom Completions",
286
+ structuredOutput: "raw-response-format",
287
+ parallelToolCalls: "enabled-only-raw-field"
288
+ },
289
+ responses: {
290
+ api: "responses",
291
+ adapter: "openai-responses",
292
+ endpointPath: "/responses",
293
+ label: "Custom Responses",
294
+ structuredOutput: "sdk-output",
295
+ parallelToolCalls: "openai-option"
296
+ }
297
+ };
298
+ function parseCustomProviderApi(value) {
299
+ switch (value) {
300
+ case void 0:
301
+ case "completions":
302
+ return "completions";
303
+ case "responses":
304
+ return "responses";
305
+ default:
306
+ throw new Error(`Unsupported Custom provider API: ${String(value)}.`);
307
+ }
308
+ }
309
+ function getCustomProviderApiContract(value) {
310
+ return customProviderApiContracts[parseCustomProviderApi(value)];
311
+ }
312
+
313
+ // src/model/AgentResponseTracePresentation.ts
314
+ function buildAgentProfileAttemptInspectorRows(attempts) {
315
+ return attempts.map((attempt) => {
316
+ var _a;
317
+ return {
318
+ eventId: attempt.eventId,
319
+ providerAndModel: [
320
+ ...attempt.profileName == null || attempt.profileName.trim() === "" ? [] : [`Profile: ${attempt.profileName.trim()}`],
321
+ `${formatProvider(attempt)} / ${attempt.model}`
322
+ ].join(" \xB7 "),
323
+ context: [
324
+ ((_a = attempt.failureKind) == null ? void 0 : _a.replaceAll("-", " ")) ?? describeStage(attempt.stage),
325
+ describeOutcome(attempt),
326
+ attempt.profileIndex == null ? void 0 : `profile ${attempt.profileIndex + 1}`,
327
+ attempt.family === "classifier" ? void 0 : `round ${attempt.roundIndex + 1}`,
328
+ attempt.attemptIndex == null ? void 0 : `attempt ${attempt.attemptIndex + 1}`,
329
+ attempt.status == null ? void 0 : `HTTP ${attempt.status}`,
330
+ attempt.durationMs == null ? isClassifierRequest(attempt) ? "duration unavailable" : void 0 : `${(attempt.durationMs / 1e3).toFixed(2)} sec`,
331
+ attempt.classifierUsage == null ? isClassifierRequest(attempt) ? "usage not reported" : void 0 : `${attempt.classifierUsage.inputTokens} input / ${attempt.classifierUsage.outputTokens} output tokens`,
332
+ attempt.classifierUsage == null ? isClassifierRequest(attempt) ? "cost unknown" : void 0 : attempt.classifierUsage.estimatedCostUsd == null ? "cost unknown" : `estimated $${attempt.classifierUsage.estimatedCostUsd.toPrecision(4)}`
333
+ ].filter((value) => value != null).join(" / "),
334
+ ...attempt.error == null ? {} : { error: attempt.error }
335
+ };
336
+ });
337
+ }
338
+ function isClassifierRequest(attempt) {
339
+ return attempt.family === "classifier" && attempt.attemptIndex != null;
340
+ }
341
+ function getClassifierRequestCount(trace) {
342
+ var _a;
343
+ if (trace.summary.classifierRequestCount != null) return trace.summary.classifierRequestCount;
344
+ const attempts = (_a = trace.profileAttempts) == null ? void 0 : _a.filter((attempt) => attempt.family === "classifier");
345
+ if (trace.scope !== "classifier-invocation" && !(attempts == null ? void 0 : attempts.length)) return void 0;
346
+ return (attempts == null ? void 0 : attempts.filter(isClassifierRequest).length) ?? 0;
347
+ }
348
+ function formatClassifierRequestCount(trace) {
349
+ const count = getClassifierRequestCount(trace);
350
+ if (count == null) return void 0;
351
+ return trace.summary.classifierRequestCount == null && (trace.omittedProfileAttemptCount ?? 0) > 0 ? `${count} (retained evidence only)` : String(count);
352
+ }
353
+ function getProfileAttemptOmissionNotice(trace) {
354
+ const omitted = trace.omittedProfileAttemptCount ?? 0;
355
+ return omitted > 0 ? `${omitted} additional profile-attempt rows (requests or decisions) omitted by the trace limit.` : void 0;
356
+ }
357
+ function formatProvider(attempt) {
358
+ return attempt.provider === "custom" ? getCustomProviderApiContract(attempt.customProviderApi).label : attempt.provider;
359
+ }
360
+ function describeStage(stage) {
361
+ switch (stage) {
362
+ case "health-gate":
363
+ return "reliability check";
364
+ case "health-update":
365
+ return "reliability update";
366
+ case "response-validation":
367
+ return "response validation";
368
+ default:
369
+ return stage;
370
+ }
371
+ }
372
+ function describeOutcome(attempt) {
373
+ if (attempt.skipReason === "unreached") return "not reached";
374
+ if (attempt.healthDisposition === "deny") {
375
+ return attempt.retryAt == null ? "profile suspended; skipped" : `profile suspended until ${new Date(attempt.retryAt).toLocaleString()}`;
376
+ }
377
+ if (attempt.healthDisposition === "fail-open") {
378
+ return "reliability service unavailable; profile request continued";
379
+ }
380
+ if (attempt.timeoutKind === "first-output") return "first output timed out";
381
+ if (attempt.timeoutKind === "stream-inactivity") return "stream became inactive";
382
+ if (attempt.timeoutKind === "response") return "response timed out";
383
+ if (attempt.stage === "health-update" && attempt.healthOutcome) {
384
+ return `recorded ${describeReliabilityOutcome(attempt.healthOutcome)}${describeReliabilityState(attempt.healthState)}`;
385
+ }
386
+ return `${attempt.outcome}${describeReliabilityState(attempt.healthState)}`;
387
+ }
388
+ function describeReliabilityOutcome(outcome) {
389
+ switch (outcome) {
390
+ case "healthy":
391
+ return "success";
392
+ case "unhealthy":
393
+ return "failure";
394
+ default:
395
+ return "ignored result";
396
+ }
397
+ }
398
+ function describeReliabilityState(state) {
399
+ switch (state) {
400
+ case "open":
401
+ return "; profile suspended";
402
+ case "half-open":
403
+ return "; recovery attempt in progress";
404
+ case "closed":
405
+ return "; profile available";
406
+ default:
407
+ return "";
408
+ }
409
+ }
410
+
254
411
  // src/model/StoredValueStore.ts
255
412
  function normalizeRivetStoredValueKey(value) {
256
413
  if (typeof value !== "string" || !value.trim()) {
@@ -3017,6 +3174,7 @@ function isStringArray(value) {
3017
3174
  applyUiGraphWebAppStorageActionPatch,
3018
3175
  applyUiGraphWebAppStorageActionPatchAsync,
3019
3176
  applyUiGraphWebAppStoragePatch,
3177
+ buildAgentProfileAttemptInspectorRows,
3020
3178
  clearUiGraphChatSearchMatches,
3021
3179
  copyUiGraphText,
3022
3180
  createUiGraphActionExecutionController,
@@ -3031,6 +3189,9 @@ function isStringArray(value) {
3031
3189
  downloadUiGraphJsonOutput,
3032
3190
  encodeRivetWebAppStorageBinaryFrame,
3033
3191
  enhanceUiGraphChatJsonCodeBlocks,
3192
+ formatClassifierRequestCount,
3193
+ getClassifierRequestCount,
3194
+ getProfileAttemptOmissionNotice,
3034
3195
  getUiGraphActionState,
3035
3196
  getUiGraphChatDraftStateKey,
3036
3197
  getUiGraphChatMessagePresentations,
@@ -3046,6 +3207,7 @@ function isStringArray(value) {
3046
3207
  hasUiGraphChatPersistentStateChanged,
3047
3208
  highlightUiGraphChatSearchMatches,
3048
3209
  isAgentResponseTrace,
3210
+ isClassifierRequest,
3049
3211
  loadUiGraphChatPersistentState,
3050
3212
  loadUiGraphResponseTrace,
3051
3213
  loadUiGraphWebAppStorage,