@mastra/server 1.75.0-alpha.6 → 1.75.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 (122) hide show
  1. package/dist/{agents-kOz1lr_e.js → agents-BuKPiseS.js} +4 -2
  2. package/dist/agents-BuKPiseS.js.map +1 -0
  3. package/dist/{agents-DwJE1tsB.cjs → agents-COAEoXsc.cjs} +4 -2
  4. package/dist/agents-COAEoXsc.cjs.map +1 -0
  5. package/dist/{api-schema-manifest-BKsEMyEs.cjs → api-schema-manifest-D_esmkjG.cjs} +2 -2
  6. package/dist/{api-schema-manifest-BKsEMyEs.cjs.map → api-schema-manifest-D_esmkjG.cjs.map} +1 -1
  7. package/dist/{api-schema-manifest-KsETdHDS.js → api-schema-manifest-I5zotQbd.js} +2 -2
  8. package/dist/{api-schema-manifest-KsETdHDS.js.map → api-schema-manifest-I5zotQbd.js.map} +1 -1
  9. package/dist/{dist-D6XjxNT7.js → dist-DMtuYRLk.js} +117 -67
  10. package/dist/dist-DMtuYRLk.js.map +1 -0
  11. package/dist/{dist-Dz_c-SsY.cjs → dist-DpUNsgQx.cjs} +117 -67
  12. package/dist/dist-DpUNsgQx.cjs.map +1 -0
  13. package/dist/docs/SKILL.md +1 -1
  14. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  15. package/dist/{editor-builder-BLi1jvZd.js → editor-builder-CdLGv1Ka.js} +2 -2
  16. package/dist/{editor-builder-BLi1jvZd.js.map → editor-builder-CdLGv1Ka.js.map} +1 -1
  17. package/dist/{editor-builder-Dm6jviKJ.cjs → editor-builder-DJl5x_Kj.cjs} +2 -2
  18. package/dist/{editor-builder-Dm6jviKJ.cjs.map → editor-builder-DJl5x_Kj.cjs.map} +1 -1
  19. package/dist/{editor-builder-DrDs-t9i.cjs → editor-builder-DRlsFCN0.cjs} +2 -2
  20. package/dist/{editor-builder-DrDs-t9i.cjs.map → editor-builder-DRlsFCN0.cjs.map} +1 -1
  21. package/dist/{editor-builder-DJMAKDR5.js → editor-builder-DU3y5Ant.js} +2 -2
  22. package/dist/{editor-builder-DJMAKDR5.js.map → editor-builder-DU3y5Ant.js.map} +1 -1
  23. package/dist/{mcp-CzeJPT9B.js → mcp-BK6cmwww.js} +4 -2
  24. package/dist/{mcp-CzeJPT9B.js.map → mcp-BK6cmwww.js.map} +1 -1
  25. package/dist/{mcp-PvdJ7pkd.cjs → mcp-Jus386Vq.cjs} +4 -2
  26. package/dist/mcp-Jus386Vq.cjs.map +1 -0
  27. package/dist/{observability-new-endpoints-Kphyk3do.cjs → observability-new-endpoints-DBmaTpap.cjs} +2 -2
  28. package/dist/{observability-new-endpoints-Kphyk3do.cjs.map → observability-new-endpoints-DBmaTpap.cjs.map} +1 -1
  29. package/dist/{observability-new-endpoints-DQuhr8aL.js → observability-new-endpoints-wd_fs1mo.js} +2 -2
  30. package/dist/{observability-new-endpoints-DQuhr8aL.js.map → observability-new-endpoints-wd_fs1mo.js.map} +1 -1
  31. package/dist/{probe-image-size-CDCRrXNo.cjs → probe-image-size-DBGjhUtJ.cjs} +111 -161
  32. package/dist/probe-image-size-DBGjhUtJ.cjs.map +1 -0
  33. package/dist/{probe-image-size-Tf8sNZhU.js → probe-image-size-Dmoxv93t.js} +111 -161
  34. package/dist/probe-image-size-Dmoxv93t.js.map +1 -0
  35. package/dist/{routes-B_ehFjzs.js → routes-CdEBhq8U.js} +4 -4
  36. package/dist/{routes-B_ehFjzs.js.map → routes-CdEBhq8U.js.map} +1 -1
  37. package/dist/{routes-Op7uJGai.cjs → routes-CjpyDJjY.cjs} +4 -4
  38. package/dist/{routes-Op7uJGai.cjs.map → routes-CjpyDJjY.cjs.map} +1 -1
  39. package/dist/server/handlers/agent-builder.cjs +2 -2
  40. package/dist/server/handlers/agent-builder.js +2 -2
  41. package/dist/server/handlers/agent-controller.cjs +12 -9
  42. package/dist/server/handlers/agent-controller.cjs.map +1 -1
  43. package/dist/server/handlers/agent-controller.d.ts +8 -6
  44. package/dist/server/handlers/agent-controller.d.ts.map +1 -1
  45. package/dist/server/handlers/agent-controller.js +12 -9
  46. package/dist/server/handlers/agent-controller.js.map +1 -1
  47. package/dist/server/handlers/agents.cjs +1 -1
  48. package/dist/server/handlers/agents.d.ts +448 -0
  49. package/dist/server/handlers/agents.d.ts.map +1 -1
  50. package/dist/server/handlers/agents.js +1 -1
  51. package/dist/server/handlers/editor-builder.cjs +1 -1
  52. package/dist/server/handlers/editor-builder.js +1 -1
  53. package/dist/server/handlers/favorites-enrichment.cjs +1 -1
  54. package/dist/server/handlers/favorites-enrichment.js +1 -1
  55. package/dist/server/handlers/mcp.cjs +1 -1
  56. package/dist/server/handlers/mcp.d.ts +4 -0
  57. package/dist/server/handlers/mcp.d.ts.map +1 -1
  58. package/dist/server/handlers/mcp.js +1 -1
  59. package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
  60. package/dist/server/handlers/observability-new-endpoints.js +1 -1
  61. package/dist/server/handlers/observability.cjs +1 -1
  62. package/dist/server/handlers/observability.js +1 -1
  63. package/dist/server/handlers/plans.cjs +1 -1
  64. package/dist/server/handlers/plans.js +1 -1
  65. package/dist/server/handlers/stored-agent-favorites.cjs +1 -1
  66. package/dist/server/handlers/stored-agent-favorites.js +1 -1
  67. package/dist/server/handlers/stored-agents.cjs +1 -1
  68. package/dist/server/handlers/stored-agents.js +1 -1
  69. package/dist/server/handlers/stored-skill-favorites.cjs +1 -1
  70. package/dist/server/handlers/stored-skill-favorites.js +1 -1
  71. package/dist/server/handlers/stored-skills.cjs +1 -1
  72. package/dist/server/handlers/stored-skills.js +1 -1
  73. package/dist/server/handlers/system.cjs +5 -2
  74. package/dist/server/handlers/system.cjs.map +1 -1
  75. package/dist/server/handlers/system.d.ts +2 -0
  76. package/dist/server/handlers/system.d.ts.map +1 -1
  77. package/dist/server/handlers/system.js +5 -2
  78. package/dist/server/handlers/system.js.map +1 -1
  79. package/dist/server/handlers/tools.cjs +1 -1
  80. package/dist/server/handlers/tools.js +1 -1
  81. package/dist/server/handlers/workflow-builder.cjs +1 -1
  82. package/dist/server/handlers/workflow-builder.js +1 -1
  83. package/dist/server/handlers/workflows.cjs +1 -1
  84. package/dist/server/handlers/workflows.js +1 -1
  85. package/dist/server/schemas/agents.d.ts +4 -0
  86. package/dist/server/schemas/agents.d.ts.map +1 -1
  87. package/dist/server/schemas/index.cjs +4 -4
  88. package/dist/server/schemas/index.js +4 -4
  89. package/dist/server/schemas/mcp.d.ts +4 -0
  90. package/dist/server/schemas/mcp.d.ts.map +1 -1
  91. package/dist/server/schemas/system.d.ts +1 -0
  92. package/dist/server/schemas/system.d.ts.map +1 -1
  93. package/dist/server/server-adapter/index.cjs +1 -1
  94. package/dist/server/server-adapter/index.js +1 -1
  95. package/dist/server/server-adapter/routes/mcp.d.ts +4 -0
  96. package/dist/server/server-adapter/routes/mcp.d.ts.map +1 -1
  97. package/dist/server/server-adapter/routes/system.d.ts +2 -0
  98. package/dist/server/server-adapter/routes/system.d.ts.map +1 -1
  99. package/dist/{sync-BG15Yae1.js → sync-Ai_ZDz7U.js} +176 -132
  100. package/dist/sync-Ai_ZDz7U.js.map +1 -0
  101. package/dist/{sync-C4LbbSKR.cjs → sync-BrO5MtSe.cjs} +181 -131
  102. package/dist/sync-BrO5MtSe.cjs.map +1 -0
  103. package/dist/{system-Be5n6H_z.cjs → system-CycnKGR3.cjs} +3 -1
  104. package/dist/system-CycnKGR3.cjs.map +1 -0
  105. package/dist/{system-BtGAJr9R.js → system-Di2kpGTC.js} +3 -1
  106. package/dist/system-Di2kpGTC.js.map +1 -0
  107. package/dist/{workflow-builder-BSjQJCVD.cjs → workflow-builder-DYfgyaeB.cjs} +3 -3
  108. package/dist/{workflow-builder-BSjQJCVD.cjs.map → workflow-builder-DYfgyaeB.cjs.map} +1 -1
  109. package/dist/{workflow-builder-DJ48IzXQ.js → workflow-builder-DxQMzsT9.js} +3 -3
  110. package/dist/{workflow-builder-DJ48IzXQ.js.map → workflow-builder-DxQMzsT9.js.map} +1 -1
  111. package/package.json +8 -8
  112. package/dist/agents-DwJE1tsB.cjs.map +0 -1
  113. package/dist/agents-kOz1lr_e.js.map +0 -1
  114. package/dist/dist-D6XjxNT7.js.map +0 -1
  115. package/dist/dist-Dz_c-SsY.cjs.map +0 -1
  116. package/dist/mcp-PvdJ7pkd.cjs.map +0 -1
  117. package/dist/probe-image-size-CDCRrXNo.cjs.map +0 -1
  118. package/dist/probe-image-size-Tf8sNZhU.js.map +0 -1
  119. package/dist/sync-BG15Yae1.js.map +0 -1
  120. package/dist/sync-C4LbbSKR.cjs.map +0 -1
  121. package/dist/system-Be5n6H_z.cjs.map +0 -1
  122. package/dist/system-BtGAJr9R.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Bd6kNlEP.cjs");
2
2
  const require_schema_e0VHpMt0 = require("./schema-e0VHpMt0-BS9KHnuT.cjs");
3
3
  require("./schema-BVcoNfni.cjs");
4
- const require_sync$1 = require("./sync-C4LbbSKR.cjs");
4
+ const require_sync$1 = require("./sync-BrO5MtSe.cjs");
5
5
  const require_dist = require("./dist-Bw2XgCSY.cjs");
6
6
  let zod_v4 = require("zod/v4");
7
7
  zod_v4 = require_rolldown_runtime.__toESM(zod_v4, 1);
@@ -4637,7 +4637,7 @@ function splitLines(text) {
4637
4637
  return result;
4638
4638
  }
4639
4639
  //#endregion
4640
- //#region ../memory/dist/src-BPHEGTkT.js
4640
+ //#region ../memory/dist/src-yhShj4JX.js
4641
4641
  var __defProp$3 = Object.defineProperty;
4642
4642
  var __exportAll = (all, no_symbols) => {
4643
4643
  let target = {};
@@ -24560,8 +24560,9 @@ function stringifyToolResult(value) {
24560
24560
  }
24561
24561
  function resolveToolResultValue(part, invocationResult) {
24562
24562
  const mastraMetadata = part?.providerMetadata?.mastra;
24563
- if (mastraMetadata && typeof mastraMetadata === "object" && "modelOutput" in mastraMetadata) return {
24564
- value: mastraMetadata.modelOutput,
24563
+ const modelOutput = mastraMetadata && typeof mastraMetadata === "object" ? mastraMetadata.modelOutput : void 0;
24564
+ if (modelOutput != null) return {
24565
+ value: modelOutput,
24565
24566
  usingStoredModelOutput: true
24566
24567
  };
24567
24568
  return {
@@ -25602,7 +25603,7 @@ function buildMultiThreadObserverContextPrompt(existingObservations, threadOrder
25602
25603
  */
25603
25604
  function parseMultiThreadObserverOutput(output, extractors = []) {
25604
25605
  const threads = /* @__PURE__ */ new Map();
25605
- if (detectDegenerateRepetition(output)) return {
25606
+ if (detectDegenerateRepetition(sanitizeObservationLines(output))) return {
25606
25607
  threads,
25607
25608
  rawOutput: output,
25608
25609
  degenerate: true
@@ -25708,7 +25709,7 @@ function getStringExtractedValue$1(values, slug) {
25708
25709
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
25709
25710
  }
25710
25711
  function parseObserverOutput(output, extractors = []) {
25711
- if (detectDegenerateRepetition(output)) return {
25712
+ if (detectDegenerateRepetition(sanitizeObservationLines(output))) return {
25712
25713
  observations: "",
25713
25714
  rawOutput: output,
25714
25715
  degenerate: true
@@ -25771,6 +25772,34 @@ const MAX_OBSERVATION_LINE_CHARS = 1e4;
25771
25772
  */
25772
25773
  const MIN_DUPLICATE_LINE_CHARS = 24;
25773
25774
  /**
25775
+ * Collapse a run of back-to-back identical lines to a single line when that
25776
+ * run is the line's only occurrence and is no bigger than one maximum-length
25777
+ * observation line. A faithful summary of a repetitive tool loop (e.g. 30×
25778
+ * "pnpm --filter … build → ok") produces exactly that shape at any line
25779
+ * length. Loops are left intact: a model stuck on one line runs far past the
25780
+ * size bound, and a line that keeps recurring between other lines has more
25781
+ * than one run.
25782
+ */
25783
+ function collapseBoundedLineRuns(lines) {
25784
+ const runs = [];
25785
+ for (const line of lines) {
25786
+ const last = runs[runs.length - 1];
25787
+ if (last && last.line === line) last.count++;
25788
+ else runs.push({
25789
+ line,
25790
+ count: 1
25791
+ });
25792
+ }
25793
+ const runsPerLine = /* @__PURE__ */ new Map();
25794
+ for (const run of runs) runsPerLine.set(run.line, (runsPerLine.get(run.line) ?? 0) + 1);
25795
+ const result = [];
25796
+ for (const run of runs) {
25797
+ const collapse = runsPerLine.get(run.line) === 1 && run.count * (run.line.length + 1) <= MAX_OBSERVATION_LINE_CHARS;
25798
+ for (let j = 0; j < (collapse ? 1 : run.count); j++) result.push(run.line);
25799
+ }
25800
+ return result;
25801
+ }
25802
+ /**
25774
25803
  * Truncate individual observation lines that exceed the maximum length.
25775
25804
  */
25776
25805
  function sanitizeObservationLines(observations) {
@@ -25783,31 +25812,28 @@ function sanitizeObservationLines(observations) {
25783
25812
  }
25784
25813
  return changed ? lines.join("\n") : observations;
25785
25814
  }
25786
- /**
25787
- * Detect degenerate repetition in observer/reflector output.
25788
- * Returns true if the text contains suspicious levels of repeated content,
25789
- * which indicates an LLM repeat-penalty bug (e.g., Gemini Flash looping).
25790
- *
25791
- * Strategy: sample sequential chunks of the text and check if a high
25792
- * proportion are near-identical to previous chunks.
25793
- */
25794
- function detectDegenerateRepetition(text) {
25795
- if (!text || text.length < 2e3) return false;
25815
+ function analyzeDegenerateRepetition(text) {
25816
+ const lines = collapseBoundedLineRuns(text.split("\n"));
25817
+ const windowText = lines.filter((line) => line.trim().length >= MIN_DUPLICATE_LINE_CHARS && line.length <= MAX_OBSERVATION_LINE_CHARS).join("\n");
25796
25818
  const windowSize = 200;
25797
- const step = Math.max(1, Math.floor(text.length / 50));
25819
+ const step = Math.max(1, Math.floor(windowText.length / 50));
25798
25820
  const seen = /* @__PURE__ */ new Map();
25799
25821
  let duplicateWindows = 0;
25800
25822
  let totalWindows = 0;
25801
- for (let i = 0; i + windowSize <= text.length; i += step) {
25802
- const window = text.slice(i, i + windowSize);
25823
+ let topWindow = "";
25824
+ let topWindowCount = 0;
25825
+ for (let i = 0; i + windowSize <= windowText.length; i += step) {
25826
+ const window = windowText.slice(i, i + windowSize);
25803
25827
  totalWindows++;
25804
25828
  const count = (seen.get(window) ?? 0) + 1;
25805
25829
  seen.set(window, count);
25806
25830
  if (count > 1) duplicateWindows++;
25831
+ if (count > topWindowCount) {
25832
+ topWindowCount = count;
25833
+ topWindow = window;
25834
+ }
25807
25835
  }
25808
- if (totalWindows > 5 && duplicateWindows / totalWindows > .4) return true;
25809
- const lines = text.split("\n");
25810
- for (const line of lines) if (line.length > 5e4) return true;
25836
+ const windowFired = windowText.length >= 2e3 && totalWindows > 5 && duplicateWindows / totalWindows > .4;
25811
25837
  const seenLines = /* @__PURE__ */ new Map();
25812
25838
  let duplicateLines = 0;
25813
25839
  let totalCountedLines = 0;
@@ -25819,8 +25845,50 @@ function detectDegenerateRepetition(text) {
25819
25845
  seenLines.set(trimmed, count);
25820
25846
  if (count > 1) duplicateLines++;
25821
25847
  }
25822
- if (totalCountedLines >= 20 && duplicateLines / totalCountedLines > .5) return true;
25823
- return false;
25848
+ const lineFired = totalCountedLines >= 20 && duplicateLines / totalCountedLines > .5;
25849
+ let shortLineFired = false;
25850
+ let shortLineCounts = /* @__PURE__ */ new Map();
25851
+ const runExceedsBudget = () => {
25852
+ let repeatedShortChars = 0;
25853
+ for (const { count, chars } of shortLineCounts.values()) if (count > 1) repeatedShortChars += chars;
25854
+ return repeatedShortChars - 1 > MAX_OBSERVATION_LINE_CHARS;
25855
+ };
25856
+ for (const line of lines) {
25857
+ const trimmed = line.trim();
25858
+ if (!trimmed) continue;
25859
+ if (trimmed.length >= MIN_DUPLICATE_LINE_CHARS) {
25860
+ if (runExceedsBudget()) shortLineFired = true;
25861
+ shortLineCounts = /* @__PURE__ */ new Map();
25862
+ continue;
25863
+ }
25864
+ if (/^<\/?[A-Za-z][\w-]*(?:\s[^<>]*)?>$/.test(trimmed) || trimmed.startsWith("Date:")) continue;
25865
+ const entry = shortLineCounts.get(trimmed) ?? {
25866
+ count: 0,
25867
+ chars: 0
25868
+ };
25869
+ entry.count++;
25870
+ entry.chars += line.length + 1;
25871
+ shortLineCounts.set(trimmed, entry);
25872
+ }
25873
+ if (runExceedsBudget()) shortLineFired = true;
25874
+ const eligible = text.length >= 2e3;
25875
+ return {
25876
+ windowText,
25877
+ totalWindows,
25878
+ duplicateWindows,
25879
+ topWindow,
25880
+ topWindowCount,
25881
+ totalCountedLines,
25882
+ duplicateLines,
25883
+ windowFired: eligible && windowFired,
25884
+ lineFired: eligible && lineFired,
25885
+ shortLineFired: eligible && shortLineFired
25886
+ };
25887
+ }
25888
+ function detectDegenerateRepetition(text) {
25889
+ if (!text || text.length < 2e3) return false;
25890
+ const analysis = analyzeDegenerateRepetition(text);
25891
+ return analysis.windowFired || analysis.lineFired || analysis.shortLineFired;
25824
25892
  }
25825
25893
  /**
25826
25894
  * Build a single-line diagnostic description of output flagged by
@@ -25829,55 +25897,35 @@ function detectDegenerateRepetition(text) {
25829
25897
  * without it there is no way to tell a real repetition loop apart from a
25830
25898
  * detector false-positive on legitimately repetitive content.
25831
25899
  *
25832
- * Reuses the detector's sampling parameters (200-char windows, ~50 samples)
25833
- * so the reported duplicate ratio and most-repeated window match what
25834
- * triggered the detection. Snippets are JSON-escaped so the result stays on
25835
- * one line.
25900
+ * Runs the detector's analysis on the same sanitized text the detector judges
25901
+ * (giant lines truncated), so `strategy=` names what triggered the rejection.
25902
+ * For a short-line loop the window and line ratios read n/a or low, because
25903
+ * short lines are excluded from both. `length` and `longestLine` describe the
25904
+ * raw output. Snippets are JSON-escaped so the result stays on one line.
25836
25905
  */
25837
25906
  function describeDegenerateOutput(text, snippetChars = 400) {
25838
- const windowSize = 200;
25839
- const step = Math.max(1, Math.floor(text.length / 50));
25840
- const seen = /* @__PURE__ */ new Map();
25841
- let duplicateWindows = 0;
25842
- let totalWindows = 0;
25843
- for (let i = 0; i + windowSize <= text.length; i += step) {
25844
- const window = text.slice(i, i + windowSize);
25845
- totalWindows++;
25846
- const count = (seen.get(window) ?? 0) + 1;
25847
- seen.set(window, count);
25848
- if (count > 1) duplicateWindows++;
25849
- }
25850
- let topWindow = "";
25851
- let topCount = 0;
25852
- for (const [window, count] of seen) if (count > topCount) {
25853
- topCount = count;
25854
- topWindow = window;
25855
- }
25907
+ const a = analyzeDegenerateRepetition(sanitizeObservationLines(text));
25856
25908
  let longestLine = 0;
25857
- const seenLines = /* @__PURE__ */ new Map();
25858
- let duplicateLines = 0;
25859
- let totalCountedLines = 0;
25860
- for (const line of text.split("\n")) {
25861
- if (line.length > longestLine) longestLine = line.length;
25862
- const trimmed = line.trim();
25863
- if (trimmed.length < MIN_DUPLICATE_LINE_CHARS) continue;
25864
- totalCountedLines++;
25865
- const count = (seenLines.get(trimmed) ?? 0) + 1;
25866
- seenLines.set(trimmed, count);
25867
- if (count > 1) duplicateLines++;
25868
- }
25869
- const duplicateRatio = totalWindows > 0 ? (duplicateWindows / totalWindows).toFixed(2) : "n/a";
25870
- const duplicateLineRatio = totalCountedLines > 0 ? (duplicateLines / totalCountedLines).toFixed(2) : "n/a";
25909
+ for (const line of text.split("\n")) if (line.length > longestLine) longestLine = line.length;
25910
+ const fired = [
25911
+ a.windowFired && "window",
25912
+ a.lineFired && "duplicateLines",
25913
+ a.shortLineFired && "shortLineLoop"
25914
+ ].filter(Boolean).join("+") || "none";
25915
+ const duplicateRatio = a.totalWindows > 0 ? (a.duplicateWindows / a.totalWindows).toFixed(2) : "n/a";
25916
+ const duplicateLineRatio = a.totalCountedLines > 0 ? (a.duplicateLines / a.totalCountedLines).toFixed(2) : "n/a";
25871
25917
  const parts = [
25918
+ `strategy=${fired}`,
25872
25919
  `length=${text.length}`,
25873
- `sampledWindows=${totalWindows}`,
25920
+ `windowTextLength=${a.windowText.length}`,
25921
+ `sampledWindows=${a.totalWindows}`,
25874
25922
  `duplicateRatio=${duplicateRatio}`,
25875
25923
  `duplicateLineRatio=${duplicateLineRatio}`,
25876
- `countedLines=${totalCountedLines}`,
25924
+ `countedLines=${a.totalCountedLines}`,
25877
25925
  `longestLine=${longestLine}`,
25878
- `topWindowCount=${topCount}`
25926
+ `topWindowCount=${a.topWindowCount}`
25879
25927
  ];
25880
- if (topCount > 1) parts.push(`topWindow=${JSON.stringify(topWindow)}`);
25928
+ if (a.topWindowCount > 1) parts.push(`topWindow=${JSON.stringify(a.topWindow)}`);
25881
25929
  parts.push(`head=${JSON.stringify(text.slice(0, snippetChars))}`);
25882
25930
  if (text.length > snippetChars * 2) parts.push(`tail=${JSON.stringify(text.slice(-snippetChars))}`);
25883
25931
  return parts.join(" ");
@@ -26815,7 +26863,7 @@ async function resolveImageDimensionsAsync(part) {
26815
26863
  const url = resolveHttpAssetUrl(getObjectValue(part, "image") ?? getObjectValue(part, "data"));
26816
26864
  if (!url) return existing;
26817
26865
  try {
26818
- const probeImageSize = (await Promise.resolve().then(() => /* @__PURE__ */ require_rolldown_runtime.__toESM(require("./probe-image-size-CDCRrXNo.cjs").default, 1))).default;
26866
+ const probeImageSize = (await Promise.resolve().then(() => /* @__PURE__ */ require_rolldown_runtime.__toESM(require("./probe-image-size-DBGjhUtJ.cjs").default, 1))).default;
26819
26867
  const probed = await probeImageSize(url, {
26820
26868
  open_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
26821
26869
  response_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
@@ -30895,6 +30943,7 @@ function createObservationFailedMarker(params) {
30895
30943
  tokensAttempted: params.tokensAttempted,
30896
30944
  error: formatOmError(params.error),
30897
30945
  ...getOmFailureMetadata(params.error, params.failurePolicy ?? "abort"),
30946
+ ...params.retrying ? { retrying: true } : {},
30898
30947
  recordId: params.recordId,
30899
30948
  threadId: params.threadId
30900
30949
  }
@@ -33167,7 +33216,7 @@ function getStringExtractedValue(values, slug) {
33167
33216
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
33168
33217
  }
33169
33218
  function parseReflectorOutput(output, sourceObservations, extractors = []) {
33170
- if (detectDegenerateRepetition(output)) return {
33219
+ if (detectDegenerateRepetition(sanitizeObservationLines(output))) return {
33171
33220
  observations: "",
33172
33221
  degenerate: true
33173
33222
  };
@@ -33510,6 +33559,7 @@ var ReflectorRunner = class {
33510
33559
  startedAt: streamContext.startedAt,
33511
33560
  tokensAttempted: originalTokens,
33512
33561
  error: `Did not compress below threshold (${originalTokens} → ${reflectedTokens}, target: ${targetThreshold}), retrying at level ${currentLevel + 1}`,
33562
+ retrying: true,
33513
33563
  recordId: streamContext.recordId,
33514
33564
  threadId: streamContext.threadId
33515
33565
  });
@@ -50526,4 +50576,4 @@ const agentBuilderWorkflows = {
50526
50576
  //#endregion
50527
50577
  exports.agentBuilderWorkflows = agentBuilderWorkflows;
50528
50578
 
50529
- //# sourceMappingURL=dist-Dz_c-SsY.cjs.map
50579
+ //# sourceMappingURL=dist-DpUNsgQx.cjs.map