@bastani/atomic 0.9.73 → 0.9.74

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 (193) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/builtin/intercom/package.json +1 -1
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/package.json +1 -1
  5. package/dist/builtin/web-access/package.json +1 -1
  6. package/dist/builtin/workflows/CHANGELOG.md +32 -0
  7. package/dist/builtin/workflows/README.md +2 -2
  8. package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
  9. package/dist/builtin/workflows/builtin/{chunk-2377r57g.js → chunk-8kdrnrpa.js} +1 -1
  10. package/dist/builtin/workflows/builtin/{chunk-t8y25z1j.js → chunk-8ycbc76t.js} +1 -1
  11. package/dist/builtin/workflows/builtin/{chunk-vbrmytm5.js → chunk-a4fdm2cw.js} +1 -1
  12. package/dist/builtin/workflows/builtin/{chunk-9pjdp2td.js → chunk-d5cxskkp.js} +3 -3
  13. package/dist/builtin/workflows/builtin/{chunk-tpsw128z.js → chunk-d9pz64yp.js} +3 -3
  14. package/dist/builtin/workflows/builtin/{chunk-z0d03ktm.js → chunk-gp0s6m45.js} +1 -1
  15. package/dist/builtin/workflows/builtin/{chunk-4kygv34g.js → chunk-m8eg152f.js} +1 -1
  16. package/dist/builtin/workflows/builtin/{chunk-mswg7kc7.js → chunk-r39ypw6b.js} +1 -1
  17. package/dist/builtin/workflows/builtin/{chunk-q7dry6km.js → chunk-va2h64a6.js} +3 -3
  18. package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
  19. package/dist/builtin/workflows/builtin/goal.js +4 -4
  20. package/dist/builtin/workflows/builtin/index.js +9 -9
  21. package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
  22. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  23. package/dist/builtin/workflows/builtin/tournament.js +2 -2
  24. package/dist/builtin/workflows/package.json +1 -1
  25. package/dist/builtin/workflows/src/authoring.d.ts +2 -0
  26. package/dist/builtin/workflows/src/extension/index.bundle.mjs +403 -76
  27. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +387 -60
  28. package/dist/builtin/workflows/src/index.js +393 -62
  29. package/dist/builtin/workflows/src/local-worker-entry.mjs +387 -60
  30. package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +1 -0
  31. package/dist/builtin/workflows/src/shared/structured-output-errors.d.ts +50 -0
  32. package/dist/config.d.ts +2 -0
  33. package/dist/config.d.ts.map +1 -1
  34. package/dist/config.js +4 -0
  35. package/dist/config.js.map +1 -1
  36. package/dist/core/agent-session-background-compaction.d.ts.map +1 -1
  37. package/dist/core/agent-session-background-compaction.js +2 -1
  38. package/dist/core/agent-session-background-compaction.js.map +1 -1
  39. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  40. package/dist/core/agent-session-compaction.js +98 -4
  41. package/dist/core/agent-session-compaction.js.map +1 -1
  42. package/dist/core/agent-session-detached-tools.d.ts +20 -5
  43. package/dist/core/agent-session-detached-tools.d.ts.map +1 -1
  44. package/dist/core/agent-session-detached-tools.js +97 -21
  45. package/dist/core/agent-session-detached-tools.js.map +1 -1
  46. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  47. package/dist/core/agent-session-message-queue.js +2 -1
  48. package/dist/core/agent-session-message-queue.js.map +1 -1
  49. package/dist/core/agent-session-methods.d.ts +3 -1
  50. package/dist/core/agent-session-methods.d.ts.map +1 -1
  51. package/dist/core/agent-session-methods.js.map +1 -1
  52. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  53. package/dist/core/agent-session-persistent-custom-messages.js +12 -4
  54. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  55. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  56. package/dist/core/agent-session-prompt.js +33 -0
  57. package/dist/core/agent-session-prompt.js.map +1 -1
  58. package/dist/core/compaction/background-compaction.d.ts +11 -5
  59. package/dist/core/compaction/background-compaction.d.ts.map +1 -1
  60. package/dist/core/compaction/background-compaction.js +19 -10
  61. package/dist/core/compaction/background-compaction.js.map +1 -1
  62. package/dist/core/compaction/compaction-boundary.d.ts +10 -0
  63. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  64. package/dist/core/compaction/compaction-boundary.js +30 -2
  65. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  66. package/dist/core/compaction/compaction-runner.d.ts +7 -0
  67. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  68. package/dist/core/compaction/compaction-runner.js +13 -5
  69. package/dist/core/compaction/compaction-runner.js.map +1 -1
  70. package/dist/core/compaction/compaction-types.d.ts +1 -1
  71. package/dist/core/compaction/compaction-types.js +1 -1
  72. package/dist/core/compaction/compaction-types.js.map +1 -1
  73. package/dist/core/compaction/deleted-ranges.d.ts +17 -2
  74. package/dist/core/compaction/deleted-ranges.d.ts.map +1 -1
  75. package/dist/core/compaction/deleted-ranges.js +44 -5
  76. package/dist/core/compaction/deleted-ranges.js.map +1 -1
  77. package/dist/core/compaction/history-recall.d.ts +32 -0
  78. package/dist/core/compaction/history-recall.d.ts.map +1 -0
  79. package/dist/core/compaction/history-recall.js +275 -0
  80. package/dist/core/compaction/history-recall.js.map +1 -0
  81. package/dist/core/compaction/index.d.ts +2 -0
  82. package/dist/core/compaction/index.d.ts.map +1 -1
  83. package/dist/core/compaction/index.js +2 -0
  84. package/dist/core/compaction/index.js.map +1 -1
  85. package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
  86. package/dist/core/compaction/pi-summary-fallback.js +1 -0
  87. package/dist/core/compaction/pi-summary-fallback.js.map +1 -1
  88. package/dist/core/compaction/planner-outcome.d.ts +14 -0
  89. package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
  90. package/dist/core/compaction/planner-outcome.js +8 -0
  91. package/dist/core/compaction/planner-outcome.js.map +1 -1
  92. package/dist/core/compaction/range-planner-diagnostics.d.ts +35 -10
  93. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
  94. package/dist/core/compaction/range-planner-diagnostics.js +67 -24
  95. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
  96. package/dist/core/compaction/range-planner.d.ts +7 -4
  97. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  98. package/dist/core/compaction/range-planner.js +43 -19
  99. package/dist/core/compaction/range-planner.js.map +1 -1
  100. package/dist/core/compaction/refusal-recovery.d.ts +27 -0
  101. package/dist/core/compaction/refusal-recovery.d.ts.map +1 -0
  102. package/dist/core/compaction/refusal-recovery.js +65 -0
  103. package/dist/core/compaction/refusal-recovery.js.map +1 -0
  104. package/dist/core/compaction/region-trimming.d.ts +23 -0
  105. package/dist/core/compaction/region-trimming.d.ts.map +1 -1
  106. package/dist/core/compaction/region-trimming.js +59 -15
  107. package/dist/core/compaction/region-trimming.js.map +1 -1
  108. package/dist/core/compaction/structured-compaction-input.d.ts +19 -1
  109. package/dist/core/compaction/structured-compaction-input.d.ts.map +1 -1
  110. package/dist/core/compaction/structured-compaction-input.js +30 -17
  111. package/dist/core/compaction/structured-compaction-input.js.map +1 -1
  112. package/dist/core/compaction/transcript-serialization.d.ts +9 -3
  113. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  114. package/dist/core/compaction/transcript-serialization.js +18 -10
  115. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  116. package/dist/core/messages.d.ts +5 -1
  117. package/dist/core/messages.d.ts.map +1 -1
  118. package/dist/core/messages.js +21 -3
  119. package/dist/core/messages.js.map +1 -1
  120. package/dist/core/session-manager-core.js +1 -1
  121. package/dist/core/session-manager-core.js.map +1 -1
  122. package/dist/core/session-manager-history.d.ts +1 -1
  123. package/dist/core/session-manager-history.d.ts.map +1 -1
  124. package/dist/core/session-manager-history.js +2 -5
  125. package/dist/core/session-manager-history.js.map +1 -1
  126. package/dist/core/settings-defaults.d.ts +2 -0
  127. package/dist/core/settings-defaults.d.ts.map +1 -1
  128. package/dist/core/settings-defaults.js +2 -0
  129. package/dist/core/settings-defaults.js.map +1 -1
  130. package/dist/core/settings-manager-basic-accessors.d.ts +2 -0
  131. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  132. package/dist/core/settings-manager-basic-accessors.js +3 -0
  133. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  134. package/dist/core/settings-schema.d.ts +2 -0
  135. package/dist/core/settings-schema.d.ts.map +1 -1
  136. package/dist/core/settings-schema.js +4 -0
  137. package/dist/core/settings-schema.js.map +1 -1
  138. package/dist/core/storage/session/conformance.d.ts.map +1 -1
  139. package/dist/core/storage/session/conformance.js +12 -0
  140. package/dist/core/storage/session/conformance.js.map +1 -1
  141. package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -1
  142. package/dist/core/storage/session/jsonl-session-store.js +3 -0
  143. package/dist/core/storage/session/jsonl-session-store.js.map +1 -1
  144. package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -1
  145. package/dist/core/storage/session/legacy-session-store.js +3 -0
  146. package/dist/core/storage/session/legacy-session-store.js.map +1 -1
  147. package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
  148. package/dist/core/storage/session/memory-session-store.js +3 -0
  149. package/dist/core/storage/session/memory-session-store.js.map +1 -1
  150. package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
  151. package/dist/core/storage/session/sql-session-store.js +12 -3
  152. package/dist/core/storage/session/sql-session-store.js.map +1 -1
  153. package/dist/core/storage/session/types.d.ts +3 -0
  154. package/dist/core/storage/session/types.d.ts.map +1 -1
  155. package/dist/core/storage/session/types.js +3 -0
  156. package/dist/core/storage/session/types.js.map +1 -1
  157. package/dist/core/tools/history-protocol.d.ts +3 -0
  158. package/dist/core/tools/history-protocol.d.ts.map +1 -1
  159. package/dist/core/tools/history-protocol.js +7 -87
  160. package/dist/core/tools/history-protocol.js.map +1 -1
  161. package/dist/core/tools/history-transcript.d.ts +24 -0
  162. package/dist/core/tools/history-transcript.d.ts.map +1 -0
  163. package/dist/core/tools/history-transcript.js +110 -0
  164. package/dist/core/tools/history-transcript.js.map +1 -0
  165. package/dist/index.d.ts +1 -1
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js.map +1 -1
  168. package/dist/main-session.d.ts.map +1 -1
  169. package/dist/main-session.js +21 -5
  170. package/dist/main-session.js.map +1 -1
  171. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  172. package/dist/modes/interactive/components/compaction-boundary-message.js +7 -3
  173. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  174. package/dist/modes/interactive/interactive-render-chat.js +2 -2
  175. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  176. package/dist/session-id-target.d.ts +1 -0
  177. package/dist/session-id-target.d.ts.map +1 -1
  178. package/dist/session-id-target.js +3 -0
  179. package/dist/session-id-target.js.map +1 -1
  180. package/docs/compaction/reference.md +3 -2
  181. package/docs/compaction.md +35 -7
  182. package/docs/development.md +1 -1
  183. package/docs/sdk/reference.md +6 -5
  184. package/docs/sessions.md +3 -3
  185. package/docs/settings.md +3 -0
  186. package/docs/storage.md +2 -0
  187. package/docs/workflows/api-reference.md +15 -3
  188. package/docs/workflows/authoring.md +2 -2
  189. package/docs/workflows/operations.md +1 -0
  190. package/docs/workflows/reliable-design.md +1 -1
  191. package/npm-shrinkwrap.json +32 -32
  192. package/package.json +3 -3
  193. package/schemas/settings.schema.json +5 -0
@@ -5741,6 +5741,10 @@ function stageSessionExtensionRunner(current) {
5741
5741
  }
5742
5742
  return;
5743
5743
  }
5744
+ function stageSessionToolContext(session, toolCallId, signal) {
5745
+ const runner = session?.extensionRunner;
5746
+ return typeof runner?.createToolContext === "function" ? runner.createToolContext(toolCallId, signal) : undefined;
5747
+ }
5744
5748
  function shutdownStageSession(current) {
5745
5749
  if (!current)
5746
5750
  return Promise.resolve();
@@ -9936,7 +9940,7 @@ async function createTestAgentSession(_options) {
9936
9940
  compactedText: "[User]: retained",
9937
9941
  firstKeptEntryId: "kept",
9938
9942
  tokensBefore: 0,
9939
- promptVersion: 5,
9943
+ promptVersion: 6,
9940
9944
  parameters: { compression_ratio: 0.5, preserve_recent: 2, query: "auto-detected" },
9941
9945
  rung: "planned",
9942
9946
  stats: {
@@ -20212,6 +20216,82 @@ var init_run_eviction_errors = __esm(() => {
20212
20216
  };
20213
20217
  });
20214
20218
 
20219
+ // dist/builtin/workflows/src/shared/structured-output-errors.ts
20220
+ function isWorkflowStructuredOutputInferenceError(error) {
20221
+ return error instanceof WorkflowStructuredOutputInferenceError || hasIdentity(error, NAMES, CODES2);
20222
+ }
20223
+ function findWorkflowStructuredOutputInferenceError(error) {
20224
+ return causeChain(error).find(isWorkflowStructuredOutputInferenceError);
20225
+ }
20226
+ function deserializeWorkflowStructuredOutputInferenceError(serialized, cause) {
20227
+ if (!CODES2.has(serialized.code))
20228
+ return;
20229
+ const rebuilt = cause ?? (serialized.cause === undefined ? undefined : deserializeCause3(serialized.cause, 0));
20230
+ const error = new WorkflowStructuredOutputInferenceError(serialized.code, serialized.fields, rebuilt === undefined ? undefined : { cause: rebuilt });
20231
+ Object.defineProperty(error, "message", { value: serialized.message });
20232
+ return error;
20233
+ }
20234
+ function serializeCause5(cause, depth) {
20235
+ if (!(cause instanceof Error) || depth >= MAX_CAUSE_DEPTH)
20236
+ return { name: "Error", message: cause instanceof Error ? cause.message : String(cause) };
20237
+ const code = cause.code;
20238
+ return {
20239
+ name: cause.name,
20240
+ message: cause.message,
20241
+ ...typeof code === "string" ? { code } : {},
20242
+ ...cause.cause === undefined ? {} : { cause: serializeCause5(cause.cause, depth + 1) }
20243
+ };
20244
+ }
20245
+ function deserializeCause3(cause, depth) {
20246
+ const nested = cause.cause === undefined || depth >= MAX_CAUSE_DEPTH ? undefined : deserializeCause3(cause.cause, depth + 1);
20247
+ const error = new Error(cause.message, nested === undefined ? undefined : { cause: nested });
20248
+ error.name = cause.name;
20249
+ if (cause.code !== undefined)
20250
+ Object.assign(error, { code: cause.code });
20251
+ return error;
20252
+ }
20253
+ var NAME = "WorkflowStructuredOutputInferenceError", CODES2, NAMES, SUBJECTS, HINTS3, WorkflowStructuredOutputInferenceError;
20254
+ var init_structured_output_errors = __esm(() => {
20255
+ CODES2 = new Set([
20256
+ "auto-inference-failed",
20257
+ "tool-context-unavailable"
20258
+ ]);
20259
+ NAMES = new Set([NAME]);
20260
+ SUBJECTS = {
20261
+ "auto-inference-failed": "The automatic structured_output inference failed",
20262
+ "tool-context-unavailable": "The automatic structured_output inference could not start"
20263
+ };
20264
+ HINTS3 = {
20265
+ "auto-inference-failed": "The runtime falls back to corrective prompts. Check the decision model and its credentials (the decisionModel setting), raise the stage's schemaTimeoutMs for a slow model, or end the stage with the final answer its schema needs; the cause says what failed.",
20266
+ "tool-context-unavailable": "The runtime falls back to corrective prompts. Create the stage's session with the Atomic SDK, whose sessions expose the tool context the inference runs in."
20267
+ };
20268
+ WorkflowStructuredOutputInferenceError = class WorkflowStructuredOutputInferenceError extends Error {
20269
+ name = NAME;
20270
+ code;
20271
+ hint;
20272
+ retryable = false;
20273
+ fields;
20274
+ constructor(code, fields, options) {
20275
+ const hint = HINTS3[code];
20276
+ super(failureMessage(SUBJECTS[code], `stage "${fields.stageName}"`, code, hint), options);
20277
+ this.code = code;
20278
+ this.hint = hint;
20279
+ this.fields = fields;
20280
+ }
20281
+ toJSON() {
20282
+ return {
20283
+ name: this.name,
20284
+ code: this.code,
20285
+ message: this.message,
20286
+ hint: this.hint,
20287
+ retryable: this.retryable,
20288
+ fields: this.fields,
20289
+ ...this.cause === undefined ? {} : { cause: serializeCause5(this.cause, 0) }
20290
+ };
20291
+ }
20292
+ };
20293
+ });
20294
+
20215
20295
  // dist/builtin/workflows/src/shared/serializable-error-families.ts
20216
20296
  import {
20217
20297
  AgentRehydrateError,
@@ -20304,6 +20384,7 @@ var SERIALIZABLE_ERROR_FAMILIES, FAMILY_NAMES4;
20304
20384
  var init_serializable_error_families = __esm(() => {
20305
20385
  init_run_eviction_errors();
20306
20386
  init_stage_wait_errors();
20387
+ init_structured_output_errors();
20307
20388
  init_workflow_git_required_error();
20308
20389
  SERIALIZABLE_ERROR_FAMILIES = {
20309
20390
  "stage-wait": family({
@@ -20433,6 +20514,11 @@ var init_serializable_error_families = __esm(() => {
20433
20514
  return form;
20434
20515
  },
20435
20516
  rehydrate: rehydrateResumeError
20517
+ }),
20518
+ "structured-output": family({
20519
+ is: instanceOf(WorkflowStructuredOutputInferenceError),
20520
+ serialize: (error) => error.toJSON(),
20521
+ rehydrate: deserializeWorkflowStructuredOutputInferenceError
20436
20522
  })
20437
20523
  };
20438
20524
  FAMILY_NAMES4 = Object.keys(SERIALIZABLE_ERROR_FAMILIES);
@@ -64105,7 +64191,7 @@ Preserve every confirmed veto or blocking finding in remaining_work verbatim. Ex
64105
64191
  </decision_rules>
64106
64192
 
64107
64193
  <output_format>
64108
- Call structured_output with repair_guidance (a concise actionable repair plan) and remaining_work (the unresolved findings as strings). Never emit an approval or rejection decision. ${READABLE_REPORT}
64194
+ Report repair_guidance (a concise actionable repair plan) and remaining_work (the unresolved findings as strings). Never emit an approval or rejection decision. ${READABLE_REPORT}
64109
64195
  ${GROUNDED_REPORTING}
64110
64196
  </output_format>
64111
64197
 
@@ -64467,7 +64553,7 @@ async function warm_first_fan_out(ctx, steps, prefixKeyOf, options = {}) {
64467
64553
  throw warmFailure;
64468
64554
  return steps.map((_, index) => resultsByIndex.get(index)).filter((result) => result !== undefined);
64469
64555
  }
64470
- var MAX_INLINE_CANDIDATE_BYTES, DEFAULT_WARM_CONCURRENCY = 4, DEFAULT_OUTPUT_FORMAT = "Call structured_output with criterion_id, score (1–20), evidence, and findings containing finding and severity.";
64556
+ var MAX_INLINE_CANDIDATE_BYTES, DEFAULT_WARM_CONCURRENCY = 4, DEFAULT_OUTPUT_FORMAT = "Report criterion_id, score (1–20), evidence, and findings containing finding and severity.";
64471
64557
  var init_verification_prompts = __esm(() => {
64472
64558
  init_verification_criteria();
64473
64559
  MAX_INLINE_CANDIDATE_BYTES = 32 * 1024;
@@ -64560,7 +64646,7 @@ function stageName(cell, reaskWave) {
64560
64646
  return reaskWave === 0 ? cell.name : `${cell.name}-reask-${reaskWave}`;
64561
64647
  }
64562
64648
  function verifierOutputFormat(criterionId) {
64563
- return `Call structured_output with criterion_id (set to ${criterionId}), score (1–20), evidence (string array), and findings containing finding and severity (veto, blocking, or note).`;
64649
+ return `Report criterion_id (set to ${criterionId}), score (1–20), evidence (string array), and findings containing finding and severity (veto, blocking, or note).`;
64564
64650
  }
64565
64651
  function scoreStep(cell, reaskWave, head, criteriaPath) {
64566
64652
  const promptHead = {
@@ -65200,7 +65286,7 @@ Stop after every candidate is shortlisted once or recorded as discarded.
65200
65286
  </stop_rules>
65201
65287
 
65202
65288
  <output_format>
65203
- Call structured_output with shortlist (candidate artifact paths in ranked order) and discarded entries containing path and a concise, criteria-based reason.
65289
+ Report shortlist (candidate artifact paths in ranked order) and discarded entries containing path and a concise, criteria-based reason.
65204
65290
  </output_format>
65205
65291
 
65206
65292
  <objective>
@@ -65212,7 +65298,7 @@ function renderJudgePrompt(task, filterPath, shortlistSize, candidates = []) {
65212
65298
  task: `Rank at most ${shortlistSize} distinct candidate paths for: ${task}.`,
65213
65299
  groundTruthNote: `Read the filter report at ${filterPath} and every candidate path it references before judging.`,
65214
65300
  candidates,
65215
- outputFormat: "Call structured_output with shortlist (candidate paths in ranked order) and rationale (a concise, criteria-based explanation)."
65301
+ outputFormat: "Report shortlist (candidate paths in ranked order) and rationale (a concise, criteria-based explanation)."
65216
65302
  };
65217
65303
  const prompt = build_scoring_prompt(head, {
65218
65304
  id: "filtered_shortlist",
@@ -65422,16 +65508,14 @@ function stringifyStructuredOutputValue(value2) {
65422
65508
  throw new Error(`atomic-workflows: structured_output returned a non-serializable value: ${error instanceof Error ? error.message : String(error)}`);
65423
65509
  }
65424
65510
  }
65425
- function stageOptionsWithStructuredOutput(options, capture, executionCapture) {
65426
- if (!options?.schema || !capture)
65427
- return options;
65511
+ function createStageStructuredOutputTool(options, capture, executionCapture) {
65428
65512
  const structuredOutputTool = createStructuredOutputTool({
65429
65513
  schema: options.schema,
65430
65514
  capture,
65431
65515
  ...options.schemaTimeoutMs === undefined ? {} : { timeoutMs: options.schemaTimeoutMs }
65432
65516
  });
65433
65517
  const executeStructuredOutput = structuredOutputTool.execute;
65434
- const capturedStructuredOutputTool = {
65518
+ return {
65435
65519
  ...structuredOutputTool,
65436
65520
  async execute(...args) {
65437
65521
  const result = await executeStructuredOutput(...args);
@@ -65444,21 +65528,25 @@ function stageOptionsWithStructuredOutput(options, capture, executionCapture) {
65444
65528
  return result;
65445
65529
  }
65446
65530
  };
65531
+ }
65532
+ function stageOptionsWithStructuredOutput(options, structuredOutputTool) {
65533
+ if (!options?.schema || !structuredOutputTool)
65534
+ return options;
65447
65535
  const tools = options.tools === undefined ? options.noTools === "all" ? [STRUCTURED_OUTPUT_TOOL_NAME] : undefined : Array.from(new Set([...options.tools, STRUCTURED_OUTPUT_TOOL_NAME]));
65448
65536
  const excludedTools = options.excludedTools?.filter((toolName) => toolName !== STRUCTURED_OUTPUT_TOOL_NAME);
65449
65537
  return {
65450
65538
  ...options,
65451
65539
  ...tools !== undefined ? { tools } : {},
65452
65540
  ...excludedTools !== undefined ? { excludedTools } : {},
65453
- customTools: [...options.customTools ?? [], capturedStructuredOutputTool]
65541
+ customTools: [...options.customTools ?? [], structuredOutputTool]
65454
65542
  };
65455
65543
  }
65456
65544
  var STRUCTURED_OUTPUT_MAX_CORRECTIVE_PROMPTS = 3, STRUCTURED_OUTPUT_MISSING_ERROR = "atomic-workflows: stage configured with schema must finish by calling structured_output.", WorkflowStructuredOutputContractError, STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
65457
65545
  var init_stage_runner_structured_output = __esm(() => {
65458
65546
  WorkflowStructuredOutputContractError = class WorkflowStructuredOutputContractError extends Error {
65459
65547
  code = "ATOMIC_WORKFLOW_STRUCTURED_OUTPUT_CONTRACT";
65460
- constructor(message) {
65461
- super(message);
65548
+ constructor(message, options) {
65549
+ super(message, options);
65462
65550
  this.name = "WorkflowStructuredOutputContractError";
65463
65551
  }
65464
65552
  };
@@ -65567,7 +65655,7 @@ function build_progress_prompt(input) {
65567
65655
  ...input.checkpoints.map((checkpoint) => `- ${checkpoint}`),
65568
65656
  "</checkpoints>",
65569
65657
  "<output_format>",
65570
- `Return structured_output with scores: [{ checkpoint, score }], using integer scores from ${VERIFICATION_SCALE.min} through ${VERIFICATION_SCALE.max}.`,
65658
+ `Report scores: [{ checkpoint, score }], using integer scores from ${VERIFICATION_SCALE.min} through ${VERIFICATION_SCALE.max}.`,
65571
65659
  "</output_format>"
65572
65660
  ].join(`
65573
65661
  `);
@@ -66367,7 +66455,7 @@ Objective:
66367
66455
  ${context.objective}`,
66368
66456
  groundTruthNote: `The objective is the contract. Verify the finding against observed code, not reviewer narration.`,
66369
66457
  candidates: [candidate],
66370
- outputFormat: "Call structured_output with score (an integer from 1 to 20) and evidence (an array of observed, concise reasons)."
66458
+ outputFormat: "Report score (an integer from 1 to 20) and evidence (an array of observed, concise reasons)."
66371
66459
  };
66372
66460
  const prompt = build_scoring_prompt(head, {
66373
66461
  id: "finding_reverification",
@@ -72629,7 +72717,7 @@ var init_delivery_failure_reason = __esm(() => {
72629
72717
 
72630
72718
  // dist/builtin/intercom/broker/released-child-errors.ts
72631
72719
  function isReleasedChildErrorCode(value2) {
72632
- return CODES2.has(value2);
72720
+ return CODES3.has(value2);
72633
72721
  }
72634
72722
  function releasedChildErrorFor(refusal, options) {
72635
72723
  return refusal.code === "unknown_released_child" ? new UnknownReleasedChildError(refusal, options) : new ReleasedChildReservationError(refusal, options);
@@ -72640,7 +72728,7 @@ function rehydrateCause3(serialized, depth) {
72640
72728
  cause.name = serialized.name;
72641
72729
  return cause;
72642
72730
  }
72643
- var RELEASED_CHILD_ERROR_CODES, CODES2, HINTS3, BASE_NAME = "IntercomReleasedChildError", RESERVATION_NAME = "ReleasedChildReservationError", UNKNOWN_NAME = "UnknownReleasedChildError", IntercomReleasedChildError, ReleasedChildReservationError, UnknownReleasedChildError, NAMES, RESERVATION_NAMES, UNKNOWN_NAMES, MAX_CAUSE_DEPTH9 = 4;
72731
+ var RELEASED_CHILD_ERROR_CODES, CODES3, HINTS4, BASE_NAME = "IntercomReleasedChildError", RESERVATION_NAME = "ReleasedChildReservationError", UNKNOWN_NAME = "UnknownReleasedChildError", IntercomReleasedChildError, ReleasedChildReservationError, UnknownReleasedChildError, NAMES2, RESERVATION_NAMES, UNKNOWN_NAMES, MAX_CAUSE_DEPTH9 = 4;
72644
72732
  var init_released_child_errors = __esm(() => {
72645
72733
  RELEASED_CHILD_ERROR_CODES = [
72646
72734
  "invalid_frame",
@@ -72652,8 +72740,8 @@ var init_released_child_errors = __esm(() => {
72652
72740
  "not_owner",
72653
72741
  "group_not_allowed"
72654
72742
  ];
72655
- CODES2 = new Set(RELEASED_CHILD_ERROR_CODES);
72656
- HINTS3 = {
72743
+ CODES3 = new Set(RELEASED_CHILD_ERROR_CODES);
72744
+ HINTS4 = {
72657
72745
  invalid_frame: "Send between 1 and 500 children per frame, each with a child name and a boolean wake flag.",
72658
72746
  invalid_child_name: "Use the child's exact, non-empty name; the wildcard `*` names no child.",
72659
72747
  invalid_alias: "Reserve extra targets only as session ids, never as names.",
@@ -72671,11 +72759,11 @@ var init_released_child_errors = __esm(() => {
72671
72759
  retryable = false;
72672
72760
  constructor(refusal, options) {
72673
72761
  const subject = refusal.childName === undefined ? "request" : `child ${JSON.stringify(refusal.childName)}`;
72674
- super(`Released-child request refused: ${subject} (${refusal.code}). ${HINTS3[refusal.code]}`, options);
72762
+ super(`Released-child request refused: ${subject} (${refusal.code}). ${HINTS4[refusal.code]}`, options);
72675
72763
  this.code = refusal.code;
72676
72764
  if (refusal.childName !== undefined)
72677
72765
  this.childName = refusal.childName;
72678
- this.hint = HINTS3[refusal.code];
72766
+ this.hint = HINTS4[refusal.code];
72679
72767
  }
72680
72768
  };
72681
72769
  ReleasedChildReservationError = class ReleasedChildReservationError extends IntercomReleasedChildError {
@@ -72684,14 +72772,14 @@ var init_released_child_errors = __esm(() => {
72684
72772
  UnknownReleasedChildError = class UnknownReleasedChildError extends IntercomReleasedChildError {
72685
72773
  name = UNKNOWN_NAME;
72686
72774
  };
72687
- NAMES = new Set([BASE_NAME, RESERVATION_NAME, UNKNOWN_NAME]);
72775
+ NAMES2 = new Set([BASE_NAME, RESERVATION_NAME, UNKNOWN_NAME]);
72688
72776
  RESERVATION_NAMES = new Set([RESERVATION_NAME]);
72689
72777
  UNKNOWN_NAMES = new Set([UNKNOWN_NAME]);
72690
72778
  });
72691
72779
 
72692
72780
  // dist/builtin/intercom/broker/released-reply-errors.ts
72693
72781
  function isReleasedReplyErrorCode(value2) {
72694
- return CODES3.has(value2);
72782
+ return CODES4.has(value2);
72695
72783
  }
72696
72784
  function rehydrateIntercomReleasedReplyError(serialized) {
72697
72785
  const options = serialized.cause === undefined ? undefined : { cause: rehydrateCause3(serialized.cause, 1) };
@@ -72739,15 +72827,15 @@ function readSerializedIntercomReleasedReplyError(value2) {
72739
72827
  ...cause === undefined ? {} : { cause }
72740
72828
  };
72741
72829
  }
72742
- var RELEASED_REPLY_ERROR_CODES, CODES3, HINTS4, RETRYABLE, BASE_NAME2 = "IntercomReleasedReplyError", ANSWERED_NAME = "ReleasedReplyAnsweredError", IN_FLIGHT_NAME = "ReleasedReplyInFlightError", IntercomReleasedReplyError, ReleasedReplyAnsweredError, ReleasedReplyInFlightError, NAMES2, ANSWERED_NAMES, IN_FLIGHT_NAMES, MAX_CAUSE_DEPTH10 = 4, isWireObject = (value2) => typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
72830
+ var RELEASED_REPLY_ERROR_CODES, CODES4, HINTS5, RETRYABLE, BASE_NAME2 = "IntercomReleasedReplyError", ANSWERED_NAME = "ReleasedReplyAnsweredError", IN_FLIGHT_NAME = "ReleasedReplyInFlightError", IntercomReleasedReplyError, ReleasedReplyAnsweredError, ReleasedReplyInFlightError, NAMES3, ANSWERED_NAMES, IN_FLIGHT_NAMES, MAX_CAUSE_DEPTH10 = 4, isWireObject = (value2) => typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
72743
72831
  var init_released_reply_errors = __esm(() => {
72744
72832
  init_released_child_errors();
72745
72833
  RELEASED_REPLY_ERROR_CODES = [
72746
72834
  "released_reply_answered",
72747
72835
  "released_reply_in_flight"
72748
72836
  ];
72749
- CODES3 = new Set(RELEASED_REPLY_ERROR_CODES);
72750
- HINTS4 = {
72837
+ CODES4 = new Set(RELEASED_REPLY_ERROR_CODES);
72838
+ HINTS5 = {
72751
72839
  released_reply_answered: "The subagent's owner already took another reply to this question; do not send this one again, and send a new message if the subagent needs more.",
72752
72840
  released_reply_in_flight: "Another reply to this question is still being handed to the subagent's owner; wait, then reply again if the subagent still waits for an answer."
72753
72841
  };
@@ -72764,9 +72852,9 @@ var init_released_reply_errors = __esm(() => {
72764
72852
  questionId;
72765
72853
  childName;
72766
72854
  constructor(code, fields, options) {
72767
- super(`Reply to a released subagent refused: question ${JSON.stringify(fields.questionId)} of ${JSON.stringify(fields.childName)} (${code}). ${HINTS4[code]}`, options);
72855
+ super(`Reply to a released subagent refused: question ${JSON.stringify(fields.questionId)} of ${JSON.stringify(fields.childName)} (${code}). ${HINTS5[code]}`, options);
72768
72856
  this.code = code;
72769
- this.hint = HINTS4[code];
72857
+ this.hint = HINTS5[code];
72770
72858
  this.retryable = RETRYABLE[code];
72771
72859
  this.messageId = fields.messageId;
72772
72860
  this.questionId = fields.questionId;
@@ -72785,7 +72873,7 @@ var init_released_reply_errors = __esm(() => {
72785
72873
  super("released_reply_in_flight", fields, options);
72786
72874
  }
72787
72875
  };
72788
- NAMES2 = new Set([BASE_NAME2, ANSWERED_NAME, IN_FLIGHT_NAME]);
72876
+ NAMES3 = new Set([BASE_NAME2, ANSWERED_NAME, IN_FLIGHT_NAME]);
72789
72877
  ANSWERED_NAMES = new Set([ANSWERED_NAME]);
72790
72878
  IN_FLIGHT_NAMES = new Set([IN_FLIGHT_NAME]);
72791
72879
  });
@@ -85487,6 +85575,18 @@ class StageSessionPause {
85487
85575
  function storedTranscript(session) {
85488
85576
  return asAgentSession(session)?.sessionManager.buildSessionProjection().messages ?? session.messages;
85489
85577
  }
85578
+ function storedEntryCount(session) {
85579
+ return storedEntries(session)?.length;
85580
+ }
85581
+ function storedAssistantMessageSince(session, entryCount) {
85582
+ if (entryCount === undefined)
85583
+ return false;
85584
+ return storedEntries(session)?.slice(entryCount).some((entry) => entry.type === "message" && entry.message.role === "assistant") === true;
85585
+ }
85586
+ function storedEntries(session) {
85587
+ const manager = asAgentSession(session)?.sessionManager;
85588
+ return typeof manager?.getEntries === "function" ? manager.getEntries() : undefined;
85589
+ }
85490
85590
  function unansweredToolCallIds(messages) {
85491
85591
  let index = messages.length - 1;
85492
85592
  while (index >= 0 && messages[index]?.role !== "assistant")
@@ -85767,6 +85867,7 @@ import {
85767
85867
  AutoRoutingInferenceError,
85768
85868
  convertToLlm,
85769
85869
  currentWorktreeRootMappings,
85870
+ findToolDetachmentError,
85770
85871
  isExtensionStartupFailure,
85771
85872
  isTaskCleanupError as isTaskCleanupError2,
85772
85873
  isTransientExtensionStartupFailure as isTransientExtensionStartupFailure2,
@@ -85818,7 +85919,9 @@ function isSessionCreationPauseResult(value2) {
85818
85919
  return "kind" in value2 && value2.kind === "paused";
85819
85920
  }
85820
85921
  function resumeMessageOptions(sdkOptions) {
85821
- return { ...sdkOptions, expandPromptTemplates: false };
85922
+ const options = { ...sdkOptions, expandPromptTemplates: false };
85923
+ operatorMessageOptions.add(options);
85924
+ return options;
85822
85925
  }
85823
85926
  function stageUserMessageText(message) {
85824
85927
  if (message.role !== "user")
@@ -85997,6 +86100,16 @@ class StageSessionController {
85997
86100
  structuredOutputExecutionFailure() {
85998
86101
  return this.structuredOutputExecutionFailureValue;
85999
86102
  }
86103
+ stageCancellationSignal() {
86104
+ return this.residency.startupWait.signal;
86105
+ }
86106
+ stageToolContext(toolCallId, signal) {
86107
+ return stageSessionToolContext(this.session, toolCallId, signal);
86108
+ }
86109
+ recordStructuredOutputWarning(warning) {
86110
+ this.modelWarnings.push(warning);
86111
+ this.notifyModelFallbackMetaChange();
86112
+ }
86000
86113
  beginStructuredOutputCandidateCycle() {
86001
86114
  this.structuredOutputCycleAttemptMark = this.modelAttempts.length;
86002
86115
  }
@@ -86393,12 +86506,19 @@ class StageSessionController {
86393
86506
  const unanswered = new Set(unansweredToolCallIds(storedTranscript(session)));
86394
86507
  return awaited.filter((toolCallId) => unanswered.has(toolCallId));
86395
86508
  };
86396
- try {
86397
- await resume.call(session, results);
86398
- } catch (error) {
86399
- if (stageReopenFailureCause(error) === "transient" && unsaved().length > 0)
86400
- throw new DetachedResultsNotSaved(error);
86401
- throw error;
86509
+ for (;; ) {
86510
+ try {
86511
+ await resume.call(session, results);
86512
+ break;
86513
+ } catch (error) {
86514
+ if (findToolDetachmentError(error)?.code === "session-busy") {
86515
+ await this.untilSessionSettles(session);
86516
+ continue;
86517
+ }
86518
+ if (stageReopenFailureCause(error) === "transient" && unsaved().length > 0)
86519
+ throw new DetachedResultsNotSaved(error);
86520
+ throw error;
86521
+ }
86402
86522
  }
86403
86523
  const missing = asAgentSession(session) === undefined ? [] : unsaved();
86404
86524
  if (missing.length > 0)
@@ -86412,6 +86532,25 @@ class StageSessionController {
86412
86532
  }, { code: "results-not-saved" });
86413
86533
  this.opts.waiting?.resultsInTranscript();
86414
86534
  }
86535
+ async untilSessionSettles(session) {
86536
+ const settled = Promise.withResolvers();
86537
+ const unsubscribe = session.subscribe((event) => {
86538
+ if (event.type === "agent_settled")
86539
+ settled.resolve();
86540
+ });
86541
+ let timer;
86542
+ try {
86543
+ await raceAbort2(Promise.race([
86544
+ settled.promise,
86545
+ new Promise((resolve) => {
86546
+ timer = setTimeout(resolve, SESSION_SETTLE_POLL_MS);
86547
+ })
86548
+ ]), this.opts.signal);
86549
+ } finally {
86550
+ clearTimeout(timer);
86551
+ unsubscribe();
86552
+ }
86553
+ }
86415
86554
  throwUnlessResultsSaveRetries(failure, attempt, startedAt) {
86416
86555
  const { signal } = this.opts;
86417
86556
  if (signal?.aborted)
@@ -87455,6 +87594,10 @@ class StageSessionController {
87455
87594
  const continuationSession = retryableAgentSession(activeSession);
87456
87595
  const admittedMessages = activeSession.messages.length > messagesBeforeAttempt.length;
87457
87596
  const willRetry = decision !== undefined && !this.disposed && this.opts.signal?.aborted !== true && !this.capturedStructuredOutputForAttempt();
87597
+ if (willRetry && activeSession.isWaitingOnDetachedResults?.() === true) {
87598
+ this.reportHeldForDetachedResults(activeSession, "retry", error);
87599
+ return { terminalScanStartIndex: terminalScanStartIndex ?? messagesBeforeAttempt.length };
87600
+ }
87458
87601
  const willContinue = continuationSession !== undefined && admittedMessages;
87459
87602
  if (retryableFailure && willRetry) {
87460
87603
  this.artifactCapture.settleAttempt(false);
@@ -87505,6 +87648,18 @@ class StageSessionController {
87505
87648
  }
87506
87649
  }
87507
87650
  }
87651
+ reportHeldForDetachedResults(session, held, error) {
87652
+ const code = error?.code;
87653
+ reportDebug3("workflow", "stage-input-held-for-detached-results", {
87654
+ runId: this.opts.runId,
87655
+ stageId: this.opts.stageId,
87656
+ stageName: this.opts.stageName,
87657
+ sessionId: session.sessionId,
87658
+ held,
87659
+ ...error instanceof Error ? { errorName: error.name } : {},
87660
+ ...typeof code === "string" ? { errorCode: code } : {}
87661
+ });
87662
+ }
87508
87663
  workflowAbortReason() {
87509
87664
  const reason = this.opts.signal?.reason;
87510
87665
  if (reason instanceof Error || reason instanceof DOMException || typeof reason === "string")
@@ -88002,6 +88157,7 @@ class StageSessionController {
88002
88157
  continue;
88003
88158
  }
88004
88159
  const promptStartIndex = activeSession.messages.length;
88160
+ const promptStartEntries = storedEntryCount(activeSession);
88005
88161
  this.lastPromptStartIndex = promptStartIndex;
88006
88162
  this.unresolvedContextOverflowMessage = undefined;
88007
88163
  try {
@@ -88014,6 +88170,11 @@ class StageSessionController {
88014
88170
  if (nextText !== initialText)
88015
88171
  await activeSession.steer(nextText, undefined, { expandPromptTemplates: false });
88016
88172
  await this.continueFromResults(activeSession, activeSession.resumeDetachedTurn, detachedResults);
88173
+ } else if (activeSession.isWaitingOnDetachedResults?.() === true) {
88174
+ this.reportHeldForDetachedResults(activeSession, "prompt");
88175
+ if (nextOptions !== undefined && operatorMessageOptions.has(nextOptions))
88176
+ await activeSession.steer(nextText, undefined, { expandPromptTemplates: false });
88177
+ return { terminalScanStartIndex: promptStartIndex };
88017
88178
  } else
88018
88179
  await activeSession.prompt(nextText, nextOptions);
88019
88180
  const pendingPauseAfterPrompt = this.pauseControl.currentResume();
@@ -88028,7 +88189,7 @@ class StageSessionController {
88028
88189
  continue;
88029
88190
  }
88030
88191
  this.throwUnresolvedContextOverflowIfPresent();
88031
- this.throwIfEmptyCompletion(activeSession, promptStartIndex);
88192
+ this.throwIfEmptyCompletion(activeSession, promptStartIndex, promptStartEntries);
88032
88193
  return { terminalScanStartIndex: promptStartIndex };
88033
88194
  } catch (err) {
88034
88195
  if (err instanceof DetachedResultsNotSaved)
@@ -88244,11 +88405,13 @@ class StageSessionController {
88244
88405
  if (message !== undefined)
88245
88406
  throw unresolvedContextOverflowFailure(message);
88246
88407
  }
88247
- throwIfEmptyCompletion(activeSession, promptStartIndex) {
88408
+ throwIfEmptyCompletion(activeSession, promptStartIndex, promptStartEntries) {
88248
88409
  if (this.structuredOutputCapture === undefined || this.structuredOutputCapture.called)
88249
88410
  return;
88250
88411
  if (this.disposed || hasAssistantMessageSince(activeSession.messages, promptStartIndex))
88251
88412
  return;
88413
+ if (storedAssistantMessageSince(activeSession, promptStartEntries))
88414
+ return;
88252
88415
  if (this.opts.signal?.aborted)
88253
88416
  throw this.workflowAbortReason();
88254
88417
  if (this.residency.startupWait.signal.aborted)
@@ -88256,7 +88419,7 @@ class StageSessionController {
88256
88419
  throw new WorkflowPromptEmptyCompletionFailure;
88257
88420
  }
88258
88421
  }
88259
- var WORKFLOW_STAGE_CLOSED_FOR_GOOD_STATE = "atomic:workflow-stage-closed-for-good", WORKFLOW_STAGE_END_CHILDREN_STATE = "atomic:workflow-stage-end-children", StageSessionCreationCancelled, ThrownErrorRetryPaused, NO_TERMINATING_TOOL_CALLS;
88422
+ var WORKFLOW_STAGE_CLOSED_FOR_GOOD_STATE = "atomic:workflow-stage-closed-for-good", WORKFLOW_STAGE_END_CHILDREN_STATE = "atomic:workflow-stage-end-children", SESSION_SETTLE_POLL_MS = 50, StageSessionCreationCancelled, operatorMessageOptions, ThrownErrorRetryPaused, NO_TERMINATING_TOOL_CALLS;
88260
88423
  var init_stage_runner_controller = __esm(() => {
88261
88424
  init_stage_wait();
88262
88425
  init_stage_wait_errors();
@@ -88283,6 +88446,7 @@ var init_stage_runner_controller = __esm(() => {
88283
88446
  this.name = "StageSessionCreationCancelled";
88284
88447
  }
88285
88448
  };
88449
+ operatorMessageOptions = new WeakSet;
88286
88450
  ThrownErrorRetryPaused = class ThrownErrorRetryPaused extends Error {
88287
88451
  resume;
88288
88452
  constructor(resume) {
@@ -88460,12 +88624,13 @@ function validatePromptOutputOptions(outputOptions) {
88460
88624
  }
88461
88625
  }
88462
88626
  function stageOutputInstruction(outputOptions, hasStructuredOutput = false) {
88627
+ const closing = hasStructuredOutput ? STRUCTURED_OUTPUT_CLOSING_INSTRUCTION : "";
88463
88628
  if (typeof outputOptions.output !== "string" || outputOptions.output.length === 0)
88464
- return "";
88629
+ return closing;
88465
88630
  if (hasStructuredOutput) {
88466
88631
  return `
88467
88632
 
88468
- [This stage has two final output channels. In the same final assistant message, write the complete human-readable artifact as ordinary assistant text before calling structured_output. That text is saved verbatim as the artifact and is what later stages read; the structured_output tool infers the separate machine-readable result for workflow logic from its instructions and state. Do not replace the artifact text with JSON or a pointer to another file. Files you write yourself are not the artifact.]`;
88633
+ [This stage has two final output channels. In the same final assistant message, write the complete human-readable artifact as ordinary assistant text before calling structured_output. That text is saved verbatim as the artifact and is what later stages read; the structured_output tool infers the separate machine-readable result for workflow logic from its instructions and state. Do not replace the artifact text with JSON or a pointer to another file. Files you write yourself are not the artifact.]${closing}`;
88469
88634
  }
88470
88635
  return `
88471
88636
 
@@ -88508,12 +88673,135 @@ ${err instanceof Error ? err.message : String(err)}`;
88508
88673
 
88509
88674
  ${reference}`;
88510
88675
  }
88511
- var DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_MAX_OUTPUT_LINES = 5000;
88676
+ var DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_MAX_OUTPUT_LINES = 5000, STRUCTURED_OUTPUT_CLOSING_INSTRUCTION = `
88677
+
88678
+ [When your work is done, finish by calling the structured_output tool exactly once, with complete instructions and nonempty named state for this stage's result. Do not answer with plain JSON text.]`;
88512
88679
  var init_stage_runner_output = __esm(() => {
88513
88680
  init_workflow_artifacts();
88514
88681
  DEFAULT_MAX_OUTPUT_BYTES = 200 * 1024;
88515
88682
  });
88516
88683
 
88684
+ // dist/builtin/workflows/src/runs/foreground/stage-runner-structured-output-auto.ts
88685
+ import {
88686
+ findDecisionError,
88687
+ isDecisionOutputError
88688
+ } from "@bastani/atomic";
88689
+ function boundedText(text, limit) {
88690
+ if (text.length <= limit)
88691
+ return text;
88692
+ const head = Math.ceil(limit / 2);
88693
+ return `${text.slice(0, head)}
88694
+ [… ${text.length - limit} characters omitted …]
88695
+ ${text.slice(text.length - (limit - head))}`;
88696
+ }
88697
+ function conversationText(message) {
88698
+ if (message.role !== "user" && message.role !== "assistant")
88699
+ return;
88700
+ const text = extractMessageText(message).trim();
88701
+ return text.length === 0 ? undefined : { role: message.role, text };
88702
+ }
88703
+ function finalAssistantAnswer(messages, promptStartIndex) {
88704
+ for (let index = messages.length - 1;index >= promptStartIndex; index -= 1) {
88705
+ const message = messages[index];
88706
+ if (message.role !== "assistant")
88707
+ continue;
88708
+ const rawText = extractMessageText(message);
88709
+ if (rawText.trim().length > 0)
88710
+ return { index, rawText };
88711
+ }
88712
+ return;
88713
+ }
88714
+ function automaticStructuredOutputInput(input) {
88715
+ const { messages, promptStartIndex } = input;
88716
+ const final = finalAssistantAnswer(messages, promptStartIndex);
88717
+ if (final === undefined)
88718
+ return;
88719
+ const recent = [];
88720
+ for (let index = final.index - 1;index >= 0 && recent.length < AUTOMATIC_STRUCTURED_OUTPUT_TRANSCRIPT_MESSAGES; index -= 1) {
88721
+ const message = conversationText(messages[index]);
88722
+ if (message !== undefined)
88723
+ recent.unshift({
88724
+ role: message.role,
88725
+ text: boundedText(message.text, AUTOMATIC_STRUCTURED_OUTPUT_TEXT_CHARS)
88726
+ });
88727
+ }
88728
+ return {
88729
+ finalText: final.rawText,
88730
+ evidence: {
88731
+ stageTask: boundedText(input.stagePrompt, AUTOMATIC_STRUCTURED_OUTPUT_TEXT_CHARS),
88732
+ finalAssistantText: boundedText(final.rawText.trim(), AUTOMATIC_STRUCTURED_OUTPUT_TEXT_CHARS),
88733
+ recentTranscript: recent
88734
+ }
88735
+ };
88736
+ }
88737
+ function automaticStructuredOutputInstructions(schema) {
88738
+ const { title, description } = schema;
88739
+ const contract = [title, description].filter((part) => part !== undefined && part.trim().length > 0).join(": ");
88740
+ return [
88741
+ "Produce the machine-readable result this workflow stage was asked to return, as the registered result schema defines it.",
88742
+ "state.stageTask is the stage's task, state.finalAssistantText is the agent's final answer to it, and state.recentTranscript is the exchange that led to that answer.",
88743
+ "Report what the agent concluded. Do not redo the task, and do not invent facts the state does not contain.",
88744
+ ...contract.length === 0 ? [] : [`Result schema: ${contract}`]
88745
+ ].join(`
88746
+ `);
88747
+ }
88748
+ function failure3(code, fields, cause) {
88749
+ return {
88750
+ kind: "failed",
88751
+ error: new WorkflowStructuredOutputInferenceError(code, fields, cause === undefined ? undefined : { cause })
88752
+ };
88753
+ }
88754
+ async function runAutomaticStructuredOutput(input) {
88755
+ const { fields, signal } = input;
88756
+ const built = automaticStructuredOutputInput(input);
88757
+ if (built === undefined)
88758
+ return { kind: "skipped" };
88759
+ const { evidence, finalText } = built;
88760
+ let context;
88761
+ try {
88762
+ context = input.toolContext(fields.toolCallId, signal);
88763
+ } catch (error) {
88764
+ signal.throwIfAborted();
88765
+ return failure3("tool-context-unavailable", fields, error);
88766
+ }
88767
+ if (context === undefined)
88768
+ return failure3("tool-context-unavailable", fields);
88769
+ const params = {
88770
+ instructions: automaticStructuredOutputInstructions(input.schema),
88771
+ state: evidence
88772
+ };
88773
+ try {
88774
+ await input.tool.execute(fields.toolCallId, params, signal, undefined, context);
88775
+ } catch (error) {
88776
+ signal.throwIfAborted();
88777
+ return failure3("auto-inference-failed", fields, error);
88778
+ }
88779
+ return { kind: "captured", finalAssistantText: finalText };
88780
+ }
88781
+ function automaticInferenceExecutionFailure(error) {
88782
+ if (error.cause === undefined)
88783
+ return;
88784
+ const decision = findDecisionError(error.cause);
88785
+ if (decision !== undefined)
88786
+ return isDecisionOutputError(decision) ? undefined : errorMessage4(error.cause);
88787
+ const detail = errorMessage4(error.cause);
88788
+ return isStructuredOutputContractFailure(detail) ? undefined : detail;
88789
+ }
88790
+ function automaticInferenceWarning(error) {
88791
+ const cause = error.cause;
88792
+ const code = typeof cause === "object" && cause !== null ? cause.code : undefined;
88793
+ const name = cause instanceof Error ? cause.name : undefined;
88794
+ const reason = name === undefined ? "" : ` Cause: ${name}${typeof code === "string" ? ` (${code})` : ""}.`;
88795
+ return `[structured-output] ${error.message}${reason}`;
88796
+ }
88797
+ var AUTOMATIC_STRUCTURED_OUTPUT_TRANSCRIPT_MESSAGES = 6, AUTOMATIC_STRUCTURED_OUTPUT_TEXT_CHARS = 16000;
88798
+ var init_stage_runner_structured_output_auto = __esm(() => {
88799
+ init_structured_output_errors();
88800
+ init_model_fallback();
88801
+ init_stage_runner_messages();
88802
+ init_stage_runner_structured_output();
88803
+ });
88804
+
88517
88805
  // dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts
88518
88806
  import { createStructuredOutputCapture, runCallback as runCallback2 } from "@bastani/atomic";
88519
88807
  function createStageContext(opts) {
@@ -88521,7 +88809,8 @@ function createStageContext(opts) {
88521
88809
  const stageCwd = stageOptions?.cwd ?? stageOptions?.sessionManager?.getCwd() ?? agentSessionAdapterDefaultCwd(adapters.agentSession) ?? opts.defaultCwd ?? process.cwd();
88522
88810
  const structuredOutputCapture = stageOptions?.schema ? createStructuredOutputCapture() : undefined;
88523
88811
  const structuredOutputExecutionCapture = stageOptions?.schema ? {} : undefined;
88524
- const effectiveStageOptions = stageOptionsWithStructuredOutput(adapters.sessionStore === undefined || stageOptions?.sessionStore !== undefined || stageOptions?.sessionDir !== undefined || stageOptions?.sessionManager !== undefined ? stageOptions : { ...stageOptions, sessionStore: adapters.sessionStore }, structuredOutputCapture, structuredOutputExecutionCapture);
88812
+ const structuredOutputTool = stageOptions?.schema ? createStageStructuredOutputTool({ schema: stageOptions.schema, schemaTimeoutMs: stageOptions.schemaTimeoutMs }, structuredOutputCapture, structuredOutputExecutionCapture) : undefined;
88813
+ const effectiveStageOptions = stageOptionsWithStructuredOutput(adapters.sessionStore === undefined || stageOptions?.sessionStore !== undefined || stageOptions?.sessionDir !== undefined || stageOptions?.sessionManager !== undefined ? stageOptions : { ...stageOptions, sessionStore: adapters.sessionStore }, structuredOutputTool);
88525
88814
  const meta = {
88526
88815
  runId,
88527
88816
  stageId,
@@ -88541,6 +88830,23 @@ function createStageContext(opts) {
88541
88830
  let artifactClosed = false;
88542
88831
  let artifactText;
88543
88832
  let continuing = false;
88833
+ let automaticInferences = 0;
88834
+ let automaticArtifactText;
88835
+ let warnedInference = false;
88836
+ async function inferStructuredOutputAutomatically(stagePrompt) {
88837
+ automaticInferences += 1;
88838
+ return runAutomaticStructuredOutput({
88839
+ tool: structuredOutputTool,
88840
+ schema: stageOptions.schema,
88841
+ capture: structuredOutputCapture,
88842
+ stagePrompt,
88843
+ messages: controller.currentSession?.messages ?? [],
88844
+ promptStartIndex: controller.currentPromptStartIndex ?? 0,
88845
+ toolContext: (toolCallId, signal) => controller.stageToolContext(toolCallId, signal),
88846
+ signal: controller.stageCancellationSignal(),
88847
+ fields: { runId, stageId, stageName, toolCallId: `workflow-auto-structured-output-${automaticInferences}` }
88848
+ });
88849
+ }
88544
88850
  async function exportArtifact() {
88545
88851
  const text = assistantArtifactTextForGeneration(controller.outputGenerationMessages());
88546
88852
  if (text !== artifactText || lastFinalizedOutput === undefined) {
@@ -88600,6 +88906,7 @@ function createStageContext(opts) {
88600
88906
  if (structuredOutputCapture) {
88601
88907
  let structuredOutputError = STRUCTURED_OUTPUT_MISSING_ERROR;
88602
88908
  let executionFailure;
88909
+ let automaticInferenceFailure;
88603
88910
  while (!structuredOutputCapture.called) {
88604
88911
  let nextPrompt = promptText;
88605
88912
  let newSessionPrompt;
@@ -88608,12 +88915,25 @@ function createStageContext(opts) {
88608
88915
  while (!structuredOutputCapture.called) {
88609
88916
  controller.resetStructuredOutputToolError();
88610
88917
  await controller.promptWithFallback(nextPrompt, sdkOptions, undefined, newSessionPrompt, continuationText);
88918
+ if (structuredOutputCapture.called)
88919
+ break;
88920
+ const automatic = await inferStructuredOutputAutomatically(text);
88921
+ if (automatic.kind === "captured")
88922
+ automaticArtifactText = automatic.finalAssistantText;
88611
88923
  if (structuredOutputCapture.called)
88612
88924
  break;
88613
88925
  structuredOutputError = controller.structuredOutputFailureReason();
88614
88926
  executionFailure ??= controller.structuredOutputExecutionFailure();
88615
88927
  if (!isStructuredOutputContractFailure(structuredOutputError))
88616
88928
  executionFailure ??= structuredOutputError;
88929
+ if (automatic.kind === "failed") {
88930
+ automaticInferenceFailure = automatic.error;
88931
+ executionFailure ??= automaticInferenceExecutionFailure(automatic.error);
88932
+ if (automatic.error.code === "auto-inference-failed" && !warnedInference) {
88933
+ warnedInference = true;
88934
+ controller.recordStructuredOutputWarning(automaticInferenceWarning(automatic.error));
88935
+ }
88936
+ }
88617
88937
  if (correctiveAttempts >= STRUCTURED_OUTPUT_MAX_CORRECTIVE_PROMPTS)
88618
88938
  break;
88619
88939
  correctiveAttempts += 1;
@@ -88625,7 +88945,8 @@ ${nextPrompt}`;
88625
88945
  if (structuredOutputCapture.called)
88626
88946
  break;
88627
88947
  if (!await controller.failCandidateForStructuredOutputExhaustion(structuredOutputError)) {
88628
- throw executionFailure === undefined ? new WorkflowStructuredOutputContractError(structuredOutputError) : new Error(executionFailure);
88948
+ const failureOptions = automaticInferenceFailure === undefined ? undefined : { cause: automaticInferenceFailure };
88949
+ throw executionFailure === undefined ? new WorkflowStructuredOutputContractError(structuredOutputError, failureOptions) : new Error(executionFailure, failureOptions);
88629
88950
  }
88630
88951
  }
88631
88952
  const sessionMessages = controller.currentSession?.messages;
@@ -88633,7 +88954,7 @@ ${nextPrompt}`;
88633
88954
  if (executionSnapshot === undefined) {
88634
88955
  throw new Error("atomic-workflows: structured_output completed without an execution snapshot; the successful tool call could not be paired with its result.");
88635
88956
  }
88636
- const rawOutputText = hasOutputArtifact ? assistantArtifactTextForToolCall(sessionMessages ?? [], executionSnapshot.toolCallId) ?? "" : stringifyStructuredOutputValue(executionSnapshot.value);
88957
+ const rawOutputText = hasOutputArtifact ? automaticArtifactText ?? assistantArtifactTextForToolCall(sessionMessages ?? [], executionSnapshot.toolCallId) ?? "" : stringifyStructuredOutputValue(executionSnapshot.value);
88637
88958
  lastAssistantText = await finalizePromptOutput(rawOutputText, outputOptions, stageCwd, runId, sessionMessages);
88638
88959
  lastFinalizedOutput = lastAssistantText;
88639
88960
  lastFinalizedMessageCount = controller.currentSession?.messages.length;
@@ -88895,6 +89216,7 @@ var init_stage_runner_context = __esm(() => {
88895
89216
  init_stage_runner_output();
88896
89217
  init_stage_runner_session_options();
88897
89218
  init_stage_runner_structured_output();
89219
+ init_stage_runner_structured_output_auto();
88898
89220
  });
88899
89221
 
88900
89222
  // dist/builtin/workflows/src/runs/foreground/stage-runner.ts
@@ -93675,7 +93997,7 @@ var init_blocked_stage_close = __esm(() => {
93675
93997
 
93676
93998
  // dist/builtin/workflows/src/runs/foreground/readiness-decision.ts
93677
93999
  import {
93678
- findDecisionError,
94000
+ findDecisionError as findDecisionError2,
93679
94001
  isDecisionModelUnavailableError
93680
94002
  } from "@bastani/atomic";
93681
94003
  function readinessVerdict(result, thresholds = READINESS_DECISION_THRESHOLDS) {
@@ -93700,11 +94022,11 @@ function readinessDecisionRecord(verdict, model, at = Date.now()) {
93700
94022
  });
93701
94023
  }
93702
94024
  function decisionModelGivesNoProbabilities(error) {
93703
- const typed = findDecisionError(error);
94025
+ const typed = findDecisionError2(error);
93704
94026
  return isDecisionModelUnavailableError(typed) && typed.reason === "no-probabilities";
93705
94027
  }
93706
94028
  function readinessFailureRecord(error, at = Date.now()) {
93707
- const typed = findDecisionError(error);
94029
+ const typed = findDecisionError2(error);
93708
94030
  const named = error instanceof Error ? error : undefined;
93709
94031
  return Object.freeze({
93710
94032
  outcome: "asked",
@@ -98162,7 +98484,7 @@ import {
98162
98484
  resolveGitSync as resolveGitSync2,
98163
98485
  restoreRunWorktree
98164
98486
  } from "@bastani/atomic";
98165
- function failure3(error) {
98487
+ function failure4(error) {
98166
98488
  return error instanceof WorkerPlacementError ? serializeWorkerPlacementError(error) : { name: error.name, message: error.message };
98167
98489
  }
98168
98490
  function active(status) {
@@ -98283,7 +98605,7 @@ class WorkerHost {
98283
98605
  this.options = options;
98284
98606
  this.timer = setInterval(() => {
98285
98607
  this.polling ??= this.poll().catch((error) => {
98286
- this.lastDetach = failure3(error);
98608
+ this.lastDetach = failure4(error);
98287
98609
  }).finally(() => {
98288
98610
  this.polling = undefined;
98289
98611
  });
@@ -98329,7 +98651,7 @@ class WorkerHost {
98329
98651
  continue;
98330
98652
  this.satellites.delete(root);
98331
98653
  await satellite.coordinator.stopSatellite().catch((error) => {
98332
- this.lastDetach = failure3(error);
98654
+ this.lastDetach = failure4(error);
98333
98655
  });
98334
98656
  await satellite.coordinator.shutdown();
98335
98657
  }
@@ -98374,7 +98696,7 @@ class WorkerHost {
98374
98696
  satellite.yielding = true;
98375
98697
  this.yielded.set(root, now);
98376
98698
  satellite.attached.then(() => satellite.coordinator.drain()).catch((error) => {
98377
- this.lastDetach = failure3(error);
98699
+ this.lastDetach = failure4(error);
98378
98700
  }).finally(() => {
98379
98701
  satellite.detached = true;
98380
98702
  });
@@ -98419,15 +98741,15 @@ class WorkerHost {
98419
98741
  detached: (reason) => {
98420
98742
  satellite.detached = true;
98421
98743
  if (reason !== undefined)
98422
- this.lastDetach = failure3(reason);
98744
+ this.lastDetach = failure4(reason);
98423
98745
  },
98424
98746
  placementFailed: (error) => {
98425
- this.lastPlacementFailure = failure3(error);
98747
+ this.lastPlacementFailure = failure4(error);
98426
98748
  }
98427
98749
  }
98428
98750
  }).catch((error) => {
98429
98751
  satellite.detached = true;
98430
- this.lastDetach = failure3(error);
98752
+ this.lastDetach = failure4(error);
98431
98753
  });
98432
98754
  this.satellites.set(root.root, satellite);
98433
98755
  }
@@ -98459,7 +98781,7 @@ class WorkerHost {
98459
98781
  else if (this.draining && !this.stoppingNow)
98460
98782
  for (const satellite of this.satellites.values())
98461
98783
  satellite.coordinator.stopSatellite().catch((error) => {
98462
- this.lastDetach = failure3(error);
98784
+ this.lastDetach = failure4(error);
98463
98785
  });
98464
98786
  this.stoppingNow = true;
98465
98787
  return this.stopping;
@@ -98660,6 +98982,7 @@ __export(exports_sdk_surface, {
98660
98982
  WorkflowAdmissionError: () => WorkflowAdmissionError,
98661
98983
  WorkflowGitRequiredError: () => WorkflowGitRequiredError,
98662
98984
  WorkflowInfrastructureError: () => WorkflowInfrastructureError,
98985
+ WorkflowStructuredOutputInferenceError: () => WorkflowStructuredOutputInferenceError,
98663
98986
  WorkspaceBindingError: () => WorkspaceBindingError3,
98664
98987
  WorkspaceCollectionError: () => WorkspaceCollectionError,
98665
98988
  WorkspaceConfigError: () => WorkspaceConfigError,
@@ -98685,7 +99008,8 @@ __export(exports_sdk_surface, {
98685
99008
  deserializeRunEvictionError: () => deserializeRunEvictionError,
98686
99009
  deserializeStageWaitError: () => deserializeStageWaitError,
98687
99010
  deserializeSubscriptionError: () => deserializeSubscriptionError2,
98688
- findDecisionError: () => findDecisionError2,
99011
+ deserializeWorkflowStructuredOutputInferenceError: () => deserializeWorkflowStructuredOutputInferenceError,
99012
+ findDecisionError: () => findDecisionError3,
98689
99013
  findForkError: () => findForkError,
98690
99014
  findLocalWorkerPoolError: () => findLocalWorkerPoolError,
98691
99015
  findPossibleStagePredictionError: () => findPossibleStagePredictionError,
@@ -98693,6 +99017,7 @@ __export(exports_sdk_surface, {
98693
99017
  findStageWaitError: () => findStageWaitError,
98694
99018
  findSubscriptionError: () => findSubscriptionError,
98695
99019
  findWorkflowAdmissionError: () => findWorkflowAdmissionError,
99020
+ findWorkflowStructuredOutputInferenceError: () => findWorkflowStructuredOutputInferenceError,
98696
99021
  findWorkspaceError: () => findWorkspaceError2,
98697
99022
  forkRun: () => forkRun,
98698
99023
  githubChecks: () => githubChecks,
@@ -98703,7 +99028,7 @@ __export(exports_sdk_surface, {
98703
99028
  isDecisionConfigError: () => isDecisionConfigError,
98704
99029
  isDecisionError: () => isDecisionError,
98705
99030
  isDecisionModelUnavailableError: () => isDecisionModelUnavailableError2,
98706
- isDecisionOutputError: () => isDecisionOutputError,
99031
+ isDecisionOutputError: () => isDecisionOutputError2,
98707
99032
  isDecisionProviderError: () => isDecisionProviderError,
98708
99033
  isDecisionRequestError: () => isDecisionRequestError,
98709
99034
  isDecisionTimeoutError: () => isDecisionTimeoutError,
@@ -98786,6 +99111,7 @@ __export(exports_sdk_surface, {
98786
99111
  isWorkflowAdmissionError: () => isWorkflowAdmissionError,
98787
99112
  isWorkflowGitRequiredError: () => isWorkflowGitRequiredError,
98788
99113
  isWorkflowInfrastructureError: () => isWorkflowInfrastructureError,
99114
+ isWorkflowStructuredOutputInferenceError: () => isWorkflowStructuredOutputInferenceError,
98789
99115
  isWorkspace: () => isWorkspace2,
98790
99116
  isWorkspaceBindingError: () => isWorkspaceBindingError,
98791
99117
  isWorkspaceCollectionError: () => isWorkspaceCollectionError,
@@ -98857,7 +99183,7 @@ import {
98857
99183
  decide,
98858
99184
  deserializeSubscriptionError as deserializeSubscriptionError2,
98859
99185
  EventSourceError,
98860
- findDecisionError as findDecisionError2,
99186
+ findDecisionError as findDecisionError3,
98861
99187
  findSubscriptionError,
98862
99188
  findWorkspaceError as findWorkspaceError2,
98863
99189
  GitUnavailableError,
@@ -98868,7 +99194,7 @@ import {
98868
99194
  isDecisionConfigError,
98869
99195
  isDecisionError,
98870
99196
  isDecisionModelUnavailableError as isDecisionModelUnavailableError2,
98871
- isDecisionOutputError,
99197
+ isDecisionOutputError as isDecisionOutputError2,
98872
99198
  isDecisionProviderError,
98873
99199
  isDecisionRequestError,
98874
99200
  isDecisionTimeoutError,
@@ -98962,6 +99288,7 @@ var init_sdk_surface = __esm(() => {
98962
99288
  init_stage_wait_errors();
98963
99289
  init_stage_wake();
98964
99290
  init_store();
99291
+ init_structured_output_errors();
98965
99292
  init_types2();
98966
99293
  init_worker_pool_errors();
98967
99294
  init_workflow_git_required_error();
@@ -99094,6 +99421,7 @@ export {
99094
99421
  WorkflowAdmissionError,
99095
99422
  WorkflowGitRequiredError,
99096
99423
  WorkflowInfrastructureError,
99424
+ WorkflowStructuredOutputInferenceError,
99097
99425
  WorkspaceBindingError3 as WorkspaceBindingError,
99098
99426
  WorkspaceCollectionError,
99099
99427
  WorkspaceConfigError,
@@ -99119,7 +99447,8 @@ export {
99119
99447
  deserializeRunEvictionError,
99120
99448
  deserializeStageWaitError,
99121
99449
  deserializeSubscriptionError2 as deserializeSubscriptionError,
99122
- findDecisionError2 as findDecisionError,
99450
+ deserializeWorkflowStructuredOutputInferenceError,
99451
+ findDecisionError3 as findDecisionError,
99123
99452
  findForkError,
99124
99453
  findLocalWorkerPoolError,
99125
99454
  findPossibleStagePredictionError,
@@ -99127,6 +99456,7 @@ export {
99127
99456
  findStageWaitError,
99128
99457
  findSubscriptionError,
99129
99458
  findWorkflowAdmissionError,
99459
+ findWorkflowStructuredOutputInferenceError,
99130
99460
  findWorkspaceError2 as findWorkspaceError,
99131
99461
  forkRun,
99132
99462
  githubChecks,
@@ -99137,7 +99467,7 @@ export {
99137
99467
  isDecisionConfigError,
99138
99468
  isDecisionError,
99139
99469
  isDecisionModelUnavailableError2 as isDecisionModelUnavailableError,
99140
- isDecisionOutputError,
99470
+ isDecisionOutputError2 as isDecisionOutputError,
99141
99471
  isDecisionProviderError,
99142
99472
  isDecisionRequestError,
99143
99473
  isDecisionTimeoutError,
@@ -99220,6 +99550,7 @@ export {
99220
99550
  isWorkflowAdmissionError,
99221
99551
  isWorkflowGitRequiredError,
99222
99552
  isWorkflowInfrastructureError,
99553
+ isWorkflowStructuredOutputInferenceError,
99223
99554
  isWorkspace2 as isWorkspace,
99224
99555
  isWorkspaceBindingError,
99225
99556
  isWorkspaceCollectionError,