@mastra/server 1.26.0-alpha.8 → 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.
- package/CHANGELOG.md +7 -0
- package/dist/{chunk-6F4GEWBN.cjs → chunk-6NM5GLTZ.cjs} +20 -20
- package/dist/{chunk-6F4GEWBN.cjs.map → chunk-6NM5GLTZ.cjs.map} +1 -1
- package/dist/{chunk-EOIQWP5O.cjs → chunk-BSW2G3CB.cjs} +3 -3
- package/dist/{chunk-EOIQWP5O.cjs.map → chunk-BSW2G3CB.cjs.map} +1 -1
- package/dist/{chunk-SKDQ4JE7.js → chunk-MY6TVQ24.js} +5 -5
- package/dist/{chunk-SKDQ4JE7.js.map → chunk-MY6TVQ24.js.map} +1 -1
- package/dist/{chunk-7ITX6ABS.js → chunk-WBPWUNCX.js} +3 -3
- package/dist/{chunk-7ITX6ABS.js.map → chunk-WBPWUNCX.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{observational-memory-WJ4BDRUP-GWOXZLOP.js → observational-memory-WJ4BDRUP-5X5ZOEK3.js} +3 -3
- package/dist/{observational-memory-WJ4BDRUP-GWOXZLOP.js.map → observational-memory-WJ4BDRUP-5X5ZOEK3.js.map} +1 -1
- package/dist/{observational-memory-WJ4BDRUP-N5A5UQWB.cjs → observational-memory-WJ4BDRUP-HNAWHGDZ.cjs} +26 -26
- package/dist/{observational-memory-WJ4BDRUP-N5A5UQWB.cjs.map → observational-memory-WJ4BDRUP-HNAWHGDZ.cjs.map} +1 -1
- package/dist/{probe-image-size-7HF7Q24F.cjs → probe-image-size-H2PYJKCK.cjs} +113 -12
- package/dist/probe-image-size-H2PYJKCK.cjs.map +1 -0
- package/dist/{probe-image-size-M5NYSF5D.js → probe-image-size-QWKVSEOF.js} +113 -12
- package/dist/probe-image-size-QWKVSEOF.js.map +1 -0
- package/dist/server/handlers/agent-builder.cjs +16 -16
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers.cjs +2 -2
- package/dist/server/handlers.js +1 -1
- package/dist/server/server-adapter/index.cjs +16 -16
- package/dist/server/server-adapter/index.js +1 -1
- package/package.json +6 -6
- package/dist/probe-image-size-7HF7Q24F.cjs.map +0 -1
- package/dist/probe-image-size-M5NYSF5D.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## 1.26.0-alpha.8
|
|
4
11
|
|
|
5
12
|
### 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
|
|
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 (
|
|
16403
|
-
const truncated =
|
|
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 } =
|
|
16455
|
+
const { value: resultValue } = chunkBSW2G3CB_cjs.resolveToolResultValue(
|
|
16456
16456
|
part,
|
|
16457
16457
|
inv.result
|
|
16458
16458
|
);
|
|
16459
|
-
const resultStr =
|
|
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 =
|
|
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 =
|
|
16564
|
+
let totalTokens = chunkBSW2G3CB_cjs.estimateTokenCount(text42);
|
|
16565
16565
|
if (totalTokens > options.maxTokens) {
|
|
16566
|
-
const truncated =
|
|
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 =
|
|
16578
|
-
const currentTokens =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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-WJ4BDRUP-
|
|
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;
|
|
@@ -19218,7 +19218,7 @@ Notes:
|
|
|
19218
19218
|
if (!effectiveConfig) return null;
|
|
19219
19219
|
const engine = await this.omEngine;
|
|
19220
19220
|
if (!engine) return null;
|
|
19221
|
-
const { ObservationalMemoryProcessor } = await import('./observational-memory-WJ4BDRUP-
|
|
19221
|
+
const { ObservationalMemoryProcessor } = await import('./observational-memory-WJ4BDRUP-HNAWHGDZ.cjs');
|
|
19222
19222
|
return new ObservationalMemoryProcessor(engine, this);
|
|
19223
19223
|
}
|
|
19224
19224
|
};
|
|
@@ -30438,5 +30438,5 @@ exports.START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = START_ASYNC_AGENT_BUILDER_ACTIO
|
|
|
30438
30438
|
exports.STREAM_AGENT_BUILDER_ACTION_ROUTE = STREAM_AGENT_BUILDER_ACTION_ROUTE;
|
|
30439
30439
|
exports.STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
|
|
30440
30440
|
exports.agent_builder_exports = agent_builder_exports;
|
|
30441
|
-
//# sourceMappingURL=chunk-
|
|
30442
|
-
//# sourceMappingURL=chunk-
|
|
30441
|
+
//# sourceMappingURL=chunk-6NM5GLTZ.cjs.map
|
|
30442
|
+
//# sourceMappingURL=chunk-6NM5GLTZ.cjs.map
|