@mastra/server 1.26.0-alpha.3 → 1.26.0-alpha.9

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 (32) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{chunk-JPJIWO77.cjs → chunk-6NM5GLTZ.cjs} +21 -20
  3. package/dist/chunk-6NM5GLTZ.cjs.map +1 -0
  4. package/dist/{chunk-6BU7KZ4V.cjs → chunk-BSW2G3CB.cjs} +149 -16
  5. package/dist/chunk-BSW2G3CB.cjs.map +1 -0
  6. package/dist/{chunk-HJPGS5RB.js → chunk-MY6TVQ24.js} +6 -5
  7. package/dist/chunk-MY6TVQ24.js.map +1 -0
  8. package/dist/{chunk-E5CLWABD.js → chunk-WBPWUNCX.js} +149 -16
  9. package/dist/chunk-WBPWUNCX.js.map +1 -0
  10. package/dist/docs/SKILL.md +1 -1
  11. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  12. package/dist/{observational-memory-WWAB2MMI-KKIU253X.js → observational-memory-WJ4BDRUP-5X5ZOEK3.js} +3 -3
  13. package/dist/{observational-memory-WWAB2MMI-KKIU253X.js.map → observational-memory-WJ4BDRUP-5X5ZOEK3.js.map} +1 -1
  14. package/dist/{observational-memory-WWAB2MMI-K5GMD4T5.cjs → observational-memory-WJ4BDRUP-HNAWHGDZ.cjs} +26 -26
  15. package/dist/{observational-memory-WWAB2MMI-K5GMD4T5.cjs.map → observational-memory-WJ4BDRUP-HNAWHGDZ.cjs.map} +1 -1
  16. package/dist/{probe-image-size-7HF7Q24F.cjs → probe-image-size-H2PYJKCK.cjs} +113 -12
  17. package/dist/probe-image-size-H2PYJKCK.cjs.map +1 -0
  18. package/dist/{probe-image-size-M5NYSF5D.js → probe-image-size-QWKVSEOF.js} +113 -12
  19. package/dist/probe-image-size-QWKVSEOF.js.map +1 -0
  20. package/dist/server/handlers/agent-builder.cjs +16 -16
  21. package/dist/server/handlers/agent-builder.js +1 -1
  22. package/dist/server/handlers.cjs +2 -2
  23. package/dist/server/handlers.js +1 -1
  24. package/dist/server/server-adapter/index.cjs +16 -16
  25. package/dist/server/server-adapter/index.js +1 -1
  26. package/package.json +6 -6
  27. package/dist/chunk-6BU7KZ4V.cjs.map +0 -1
  28. package/dist/chunk-E5CLWABD.js.map +0 -1
  29. package/dist/chunk-HJPGS5RB.js.map +0 -1
  30. package/dist/chunk-JPJIWO77.cjs.map +0 -1
  31. package/dist/probe-image-size-7HF7Q24F.cjs.map +0 -1
  32. package/dist/probe-image-size-M5NYSF5D.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 1.26.0-alpha.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`16e34ca`](https://github.com/mastra-ai/mastra/commit/16e34caa98b9a114b17a6125e4e3fd87f169d0d0)]:
8
+ - @mastra/core@1.26.0-alpha.9
9
+
10
+ ## 1.26.0-alpha.8
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`1bd5104`](https://github.com/mastra-ai/mastra/commit/1bd51048b6da93507276d6623e3fd96a9e1a8944)]:
15
+ - @mastra/core@1.26.0-alpha.8
16
+
17
+ ## 1.26.0-alpha.7
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`8786a61`](https://github.com/mastra-ai/mastra/commit/8786a61fa54ba265f85eeff9985ca39863d18bb6), [`8fb2405`](https://github.com/mastra-ai/mastra/commit/8fb2405138f2d208b7962ad03f121ca25bcc28c5)]:
22
+ - @mastra/core@1.26.0-alpha.7
23
+
24
+ ## 1.26.0-alpha.6
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [[`6315317`](https://github.com/mastra-ai/mastra/commit/63153175fe9a7b224e5be7c209bbebc01dd9b0d5), [`9d3b24b`](https://github.com/mastra-ai/mastra/commit/9d3b24b19407ae9c09586cf7766d38dc4dff4a69)]:
29
+ - @mastra/core@1.26.0-alpha.6
30
+
31
+ ## 1.26.0-alpha.5
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [[`92dcf02`](https://github.com/mastra-ai/mastra/commit/92dcf029294210ac91b090900c1a0555a425c57a)]:
36
+ - @mastra/core@1.26.0-alpha.5
37
+
38
+ ## 1.26.0-alpha.4
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [[`0474c2b`](https://github.com/mastra-ai/mastra/commit/0474c2b2e7c7e1ad8691dca031284841391ff1ef), [`f607106`](https://github.com/mastra-ai/mastra/commit/f607106854c6416c4a07d4082604b9f66d047221), [`62919a6`](https://github.com/mastra-ai/mastra/commit/62919a6ee0fbf3779ad21a97b1ec6696515d5104), [`0fd90a2`](https://github.com/mastra-ai/mastra/commit/0fd90a215caf5fca8099c15a67ca03e4427747a3)]:
43
+ - @mastra/core@1.26.0-alpha.4
44
+
3
45
  ## 1.26.0-alpha.3
4
46
 
5
47
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  var chunk5N66PU3H_cjs = require('./chunk-5N66PU3H.cjs');
4
4
  var chunkEXKS4QPI_cjs = require('./chunk-EXKS4QPI.cjs');
5
5
  var chunkFPURK3UW_cjs = require('./chunk-FPURK3UW.cjs');
6
- var chunk6BU7KZ4V_cjs = require('./chunk-6BU7KZ4V.cjs');
6
+ var chunkBSW2G3CB_cjs = require('./chunk-BSW2G3CB.cjs');
7
7
  var chunkR2ODPDKE_cjs = require('./chunk-R2ODPDKE.cjs');
8
8
  var chunk5ZIB34RZ_cjs = require('./chunk-5ZIB34RZ.cjs');
9
9
  var chunkDOHUOYZS_cjs = require('./chunk-DOHUOYZS.cjs');
@@ -16399,8 +16399,8 @@ function formatTimestamp(date) {
16399
16399
  return date.toISOString().replace("T", " ").replace(/\.\d{3}Z$/, "Z");
16400
16400
  }
16401
16401
  function truncateByTokens(text42, maxTokens, hint) {
16402
- if (chunk6BU7KZ4V_cjs.estimateTokenCount(text42) <= maxTokens) return { text: text42, wasTruncated: false };
16403
- const truncated = chunk6BU7KZ4V_cjs.truncateStringByTokens(text42, maxTokens);
16402
+ if (chunkBSW2G3CB_cjs.estimateTokenCount(text42) <= maxTokens) return { text: text42, wasTruncated: false };
16403
+ const truncated = chunkBSW2G3CB_cjs.truncateStringByTokens(text42, maxTokens);
16404
16404
  const suffix = hint ? ` [${hint} for more]` : "";
16405
16405
  return { text: truncated + suffix, wasTruncated: true };
16406
16406
  }
@@ -16452,11 +16452,11 @@ ${JSON.stringify(inv.args, null, 2)}`;
16452
16452
  });
16453
16453
  }
16454
16454
  if (inv.state === "result") {
16455
- const { value: resultValue } = chunk6BU7KZ4V_cjs.resolveToolResultValue(
16455
+ const { value: resultValue } = chunkBSW2G3CB_cjs.resolveToolResultValue(
16456
16456
  part,
16457
16457
  inv.result
16458
16458
  );
16459
- const resultStr = chunk6BU7KZ4V_cjs.formatToolResultForObserver(resultValue, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
16459
+ const resultStr = chunkBSW2G3CB_cjs.formatToolResultForObserver(resultValue, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
16460
16460
  const fullText = `[Tool Result: ${inv.toolName}]
16461
16461
  ${resultStr}`;
16462
16462
  parts.push(makePart(msg, i, "tool-result", fullText, detail, inv.toolName));
@@ -16483,7 +16483,7 @@ ${typeof rawArgs === "string" ? rawArgs : JSON.stringify(rawArgs, null, 2)}`;
16483
16483
  const toolName = part.toolName;
16484
16484
  if (toolName) {
16485
16485
  const rawResult = part.output ?? part.result;
16486
- const resultStr = chunk6BU7KZ4V_cjs.formatToolResultForObserver(rawResult, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
16486
+ const resultStr = chunkBSW2G3CB_cjs.formatToolResultForObserver(rawResult, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
16487
16487
  const fullText = `[Tool Result: ${toolName}]
16488
16488
  ${resultStr}`;
16489
16489
  parts.push(makePart(msg, i, "tool-result", fullText, detail, toolName));
@@ -16561,9 +16561,9 @@ function expandPriority(part) {
16561
16561
  }
16562
16562
  function renderFormattedParts(parts, timestamps, options) {
16563
16563
  const text42 = buildRenderedText(parts, timestamps);
16564
- let totalTokens = chunk6BU7KZ4V_cjs.estimateTokenCount(text42);
16564
+ let totalTokens = chunkBSW2G3CB_cjs.estimateTokenCount(text42);
16565
16565
  if (totalTokens > options.maxTokens) {
16566
- const truncated = chunk6BU7KZ4V_cjs.truncateStringByTokens(text42, options.maxTokens);
16566
+ const truncated = chunkBSW2G3CB_cjs.truncateStringByTokens(text42, options.maxTokens);
16567
16567
  return { text: truncated, truncated: true, tokenOffset: totalTokens - options.maxTokens };
16568
16568
  }
16569
16569
  const truncatedIndices = parts.map((p, i) => ({ part: p, index: i })).filter(({ part }) => part.text !== part.fullText).sort((a, b) => expandPriority(a.part) - expandPriority(b.part));
@@ -16574,8 +16574,8 @@ function renderFormattedParts(parts, timestamps, options) {
16574
16574
  for (const { part, index } of truncatedIndices) {
16575
16575
  if (remaining <= 0) break;
16576
16576
  const maxTokens = expandLimit(part);
16577
- const fullTokens = chunk6BU7KZ4V_cjs.estimateTokenCount(part.fullText);
16578
- const currentTokens = chunk6BU7KZ4V_cjs.estimateTokenCount(part.text);
16577
+ const fullTokens = chunkBSW2G3CB_cjs.estimateTokenCount(part.fullText);
16578
+ const currentTokens = chunkBSW2G3CB_cjs.estimateTokenCount(part.text);
16579
16579
  const targetTokens = Math.min(fullTokens, maxTokens);
16580
16580
  const delta = targetTokens - currentTokens;
16581
16581
  if (delta <= 0) continue;
@@ -16586,17 +16586,17 @@ function renderFormattedParts(parts, timestamps, options) {
16586
16586
  const expandedLimit = Math.min(currentTokens + remaining, maxTokens);
16587
16587
  const hint = `recall cursor="${part.messageId}" partIndex=${part.partIndex} detail="high"`;
16588
16588
  const { text: expanded2 } = truncateByTokens(part.fullText, expandedLimit, hint);
16589
- const expandedDelta = chunk6BU7KZ4V_cjs.estimateTokenCount(expanded2) - currentTokens;
16589
+ const expandedDelta = chunkBSW2G3CB_cjs.estimateTokenCount(expanded2) - currentTokens;
16590
16590
  parts[index] = { ...part, text: expanded2 };
16591
16591
  remaining -= expandedDelta;
16592
16592
  }
16593
16593
  }
16594
16594
  const expanded = buildRenderedText(parts, timestamps);
16595
- const expandedTokens = chunk6BU7KZ4V_cjs.estimateTokenCount(expanded);
16595
+ const expandedTokens = chunkBSW2G3CB_cjs.estimateTokenCount(expanded);
16596
16596
  if (expandedTokens <= options.maxTokens) {
16597
16597
  return { text: expanded, truncated: false, tokenOffset: 0 };
16598
16598
  }
16599
- const hardTruncated = chunk6BU7KZ4V_cjs.truncateStringByTokens(expanded, options.maxTokens);
16599
+ const hardTruncated = chunkBSW2G3CB_cjs.truncateStringByTokens(expanded, options.maxTokens);
16600
16600
  return { text: hardTruncated, truncated: true, tokenOffset: expandedTokens - options.maxTokens };
16601
16601
  }
16602
16602
  async function recallPart({
@@ -16647,7 +16647,7 @@ async function recallPart({
16647
16647
 
16648
16648
  `;
16649
16649
  const fallbackText = `${fallbackNote}${firstNextPart.text}`;
16650
- const truncatedText2 = chunk6BU7KZ4V_cjs.truncateStringByTokens(fallbackText, maxTokens);
16650
+ const truncatedText2 = chunkBSW2G3CB_cjs.truncateStringByTokens(fallbackText, maxTokens);
16651
16651
  const wasTruncated2 = truncatedText2 !== fallbackText;
16652
16652
  return {
16653
16653
  text: truncatedText2,
@@ -16662,7 +16662,7 @@ async function recallPart({
16662
16662
  }
16663
16663
  throw new Error(`Part index ${partIndex} not found in message ${cursor}. Available indices: ${availableIndices}`);
16664
16664
  }
16665
- const truncatedText = chunk6BU7KZ4V_cjs.truncateStringByTokens(target.text, maxTokens);
16665
+ const truncatedText = chunkBSW2G3CB_cjs.truncateStringByTokens(target.text, maxTokens);
16666
16666
  const wasTruncated = truncatedText !== target.text;
16667
16667
  return {
16668
16668
  text: truncatedText,
@@ -17891,7 +17891,7 @@ ${workingMemory}`;
17891
17891
  }
17892
17892
  return chunks;
17893
17893
  }
17894
- hasher = chunk6BU7KZ4V_cjs.e();
17894
+ hasher = chunkBSW2G3CB_cjs.e();
17895
17895
  // embedding is computationally expensive so cache content -> embeddings/chunks
17896
17896
  embeddingCache = /* @__PURE__ */ new Map();
17897
17897
  firstEmbed;
@@ -18293,7 +18293,7 @@ ${workingMemory}`;
18293
18293
  "Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
18294
18294
  );
18295
18295
  }
18296
- const { ObservationalMemory: OMClass } = await import('./observational-memory-WWAB2MMI-K5GMD4T5.cjs');
18296
+ const { ObservationalMemory: OMClass } = await import('./observational-memory-WJ4BDRUP-HNAWHGDZ.cjs');
18297
18297
  const onIndexObservations = this.hasRetrievalSearch(omConfig.retrieval) ? async (observation) => {
18298
18298
  await this.indexObservation(observation);
18299
18299
  } : void 0;
@@ -18302,6 +18302,7 @@ ${workingMemory}`;
18302
18302
  scope: omConfig.scope,
18303
18303
  retrieval: omConfig.retrieval,
18304
18304
  activateAfterIdle: omConfig.activateAfterIdle,
18305
+ activateOnProviderChange: omConfig.activateOnProviderChange,
18305
18306
  shareTokenBudget: omConfig.shareTokenBudget,
18306
18307
  model: omConfig.model,
18307
18308
  onIndexObservations,
@@ -19217,7 +19218,7 @@ Notes:
19217
19218
  if (!effectiveConfig) return null;
19218
19219
  const engine = await this.omEngine;
19219
19220
  if (!engine) return null;
19220
- const { ObservationalMemoryProcessor } = await import('./observational-memory-WWAB2MMI-K5GMD4T5.cjs');
19221
+ const { ObservationalMemoryProcessor } = await import('./observational-memory-WJ4BDRUP-HNAWHGDZ.cjs');
19221
19222
  return new ObservationalMemoryProcessor(engine, this);
19222
19223
  }
19223
19224
  };
@@ -30437,5 +30438,5 @@ exports.START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = START_ASYNC_AGENT_BUILDER_ACTIO
30437
30438
  exports.STREAM_AGENT_BUILDER_ACTION_ROUTE = STREAM_AGENT_BUILDER_ACTION_ROUTE;
30438
30439
  exports.STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
30439
30440
  exports.agent_builder_exports = agent_builder_exports;
30440
- //# sourceMappingURL=chunk-JPJIWO77.cjs.map
30441
- //# sourceMappingURL=chunk-JPJIWO77.cjs.map
30441
+ //# sourceMappingURL=chunk-6NM5GLTZ.cjs.map
30442
+ //# sourceMappingURL=chunk-6NM5GLTZ.cjs.map