@mastra/server 1.33.0-alpha.0 → 1.33.0-alpha.2
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 +14 -0
- package/dist/{chunk-F35U36E2.cjs → chunk-44K6EWHN.cjs} +20 -20
- package/dist/{chunk-F35U36E2.cjs.map → chunk-44K6EWHN.cjs.map} +1 -1
- package/dist/{chunk-ZW7DMFEG.cjs → chunk-BBX7Q7UG.cjs} +79 -4
- package/dist/chunk-BBX7Q7UG.cjs.map +1 -0
- package/dist/{chunk-MQVBXOMA.js → chunk-DTCRA7JS.js} +5 -5
- package/dist/{chunk-MQVBXOMA.js.map → chunk-DTCRA7JS.js.map} +1 -1
- package/dist/{chunk-4HRTLLE6.js → chunk-S65AMBAF.js} +79 -4
- package/dist/chunk-S65AMBAF.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{observational-memory-FBBKXNO5-I7J47ELO.js → observational-memory-KH7G7Y6B-QKEOJZME.js} +3 -3
- package/dist/{observational-memory-FBBKXNO5-I7J47ELO.js.map → observational-memory-KH7G7Y6B-QKEOJZME.js.map} +1 -1
- package/dist/{observational-memory-FBBKXNO5-3V6BP5K3.cjs → observational-memory-KH7G7Y6B-Y3XQXW3K.cjs} +26 -26
- package/dist/{observational-memory-FBBKXNO5-3V6BP5K3.cjs.map → observational-memory-KH7G7Y6B-Y3XQXW3K.cjs.map} +1 -1
- 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 +3 -3
- package/dist/chunk-4HRTLLE6.js.map +0 -1
- package/dist/chunk-ZW7DMFEG.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 1.33.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`d1fdbd0`](https://github.com/mastra-ai/mastra/commit/d1fdbd012add5623cb7e6b7f882b605ab358bbb4), [`d91ebe2`](https://github.com/mastra-ai/mastra/commit/d91ebe28ee065d8f2ed6df741c3c07f58d359529)]:
|
|
8
|
+
- @mastra/core@1.33.0-alpha.2
|
|
9
|
+
|
|
10
|
+
## 1.33.0-alpha.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`dccd8f1`](https://github.com/mastra-ai/mastra/commit/dccd8f1f8b8f1ad203b77556207e5529567c616d)]:
|
|
15
|
+
- @mastra/core@1.33.0-alpha.1
|
|
16
|
+
|
|
3
17
|
## 1.33.0-alpha.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkURRUDXO5_cjs = require('./chunk-URRUDXO5.cjs');
|
|
4
4
|
var chunkSEAOI56Z_cjs = require('./chunk-SEAOI56Z.cjs');
|
|
5
5
|
var chunkTF7NSMHW_cjs = require('./chunk-TF7NSMHW.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkBBX7Q7UG_cjs = require('./chunk-BBX7Q7UG.cjs');
|
|
7
7
|
var chunkR2ODPDKE_cjs = require('./chunk-R2ODPDKE.cjs');
|
|
8
8
|
var chunkGUWIV3ZN_cjs = require('./chunk-GUWIV3ZN.cjs');
|
|
9
9
|
var chunkK7IVZQKI_cjs = require('./chunk-K7IVZQKI.cjs');
|
|
@@ -16675,8 +16675,8 @@ function formatTimestamp(date) {
|
|
|
16675
16675
|
return date.toISOString().replace("T", " ").replace(/\.\d{3}Z$/, "Z");
|
|
16676
16676
|
}
|
|
16677
16677
|
function truncateByTokens(text42, maxTokens, hint) {
|
|
16678
|
-
if (
|
|
16679
|
-
const truncated =
|
|
16678
|
+
if (chunkBBX7Q7UG_cjs.estimateTokenCount(text42) <= maxTokens) return { text: text42, wasTruncated: false };
|
|
16679
|
+
const truncated = chunkBBX7Q7UG_cjs.truncateStringByTokens(text42, maxTokens);
|
|
16680
16680
|
const suffix = hint ? ` [${hint} for more]` : "";
|
|
16681
16681
|
return { text: truncated + suffix, wasTruncated: true };
|
|
16682
16682
|
}
|
|
@@ -16728,11 +16728,11 @@ ${JSON.stringify(inv.args, null, 2)}`;
|
|
|
16728
16728
|
});
|
|
16729
16729
|
}
|
|
16730
16730
|
if (inv.state === "result") {
|
|
16731
|
-
const { value: resultValue } =
|
|
16731
|
+
const { value: resultValue } = chunkBBX7Q7UG_cjs.resolveToolResultValue(
|
|
16732
16732
|
part,
|
|
16733
16733
|
inv.result
|
|
16734
16734
|
);
|
|
16735
|
-
const resultStr =
|
|
16735
|
+
const resultStr = chunkBBX7Q7UG_cjs.formatToolResultForObserver(resultValue, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
|
|
16736
16736
|
const fullText = `[Tool Result: ${inv.toolName}]
|
|
16737
16737
|
${resultStr}`;
|
|
16738
16738
|
parts.push(makePart(msg, i, "tool-result", fullText, detail, inv.toolName));
|
|
@@ -16759,7 +16759,7 @@ ${typeof rawArgs === "string" ? rawArgs : JSON.stringify(rawArgs, null, 2)}`;
|
|
|
16759
16759
|
const toolName = part.toolName;
|
|
16760
16760
|
if (toolName) {
|
|
16761
16761
|
const rawResult = part.output ?? part.result;
|
|
16762
|
-
const resultStr =
|
|
16762
|
+
const resultStr = chunkBBX7Q7UG_cjs.formatToolResultForObserver(rawResult, { maxTokens: HIGH_DETAIL_TOOL_RESULT_TOKENS });
|
|
16763
16763
|
const fullText = `[Tool Result: ${toolName}]
|
|
16764
16764
|
${resultStr}`;
|
|
16765
16765
|
parts.push(makePart(msg, i, "tool-result", fullText, detail, toolName));
|
|
@@ -16837,9 +16837,9 @@ function expandPriority(part) {
|
|
|
16837
16837
|
}
|
|
16838
16838
|
function renderFormattedParts(parts, timestamps, options) {
|
|
16839
16839
|
const text42 = buildRenderedText(parts, timestamps);
|
|
16840
|
-
let totalTokens =
|
|
16840
|
+
let totalTokens = chunkBBX7Q7UG_cjs.estimateTokenCount(text42);
|
|
16841
16841
|
if (totalTokens > options.maxTokens) {
|
|
16842
|
-
const truncated =
|
|
16842
|
+
const truncated = chunkBBX7Q7UG_cjs.truncateStringByTokens(text42, options.maxTokens);
|
|
16843
16843
|
return { text: truncated, truncated: true, tokenOffset: totalTokens - options.maxTokens };
|
|
16844
16844
|
}
|
|
16845
16845
|
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));
|
|
@@ -16850,8 +16850,8 @@ function renderFormattedParts(parts, timestamps, options) {
|
|
|
16850
16850
|
for (const { part, index } of truncatedIndices) {
|
|
16851
16851
|
if (remaining <= 0) break;
|
|
16852
16852
|
const maxTokens = expandLimit(part);
|
|
16853
|
-
const fullTokens =
|
|
16854
|
-
const currentTokens =
|
|
16853
|
+
const fullTokens = chunkBBX7Q7UG_cjs.estimateTokenCount(part.fullText);
|
|
16854
|
+
const currentTokens = chunkBBX7Q7UG_cjs.estimateTokenCount(part.text);
|
|
16855
16855
|
const targetTokens = Math.min(fullTokens, maxTokens);
|
|
16856
16856
|
const delta = targetTokens - currentTokens;
|
|
16857
16857
|
if (delta <= 0) continue;
|
|
@@ -16862,17 +16862,17 @@ function renderFormattedParts(parts, timestamps, options) {
|
|
|
16862
16862
|
const expandedLimit = Math.min(currentTokens + remaining, maxTokens);
|
|
16863
16863
|
const hint = `recall cursor="${part.messageId}" partIndex=${part.partIndex} detail="high"`;
|
|
16864
16864
|
const { text: expanded2 } = truncateByTokens(part.fullText, expandedLimit, hint);
|
|
16865
|
-
const expandedDelta =
|
|
16865
|
+
const expandedDelta = chunkBBX7Q7UG_cjs.estimateTokenCount(expanded2) - currentTokens;
|
|
16866
16866
|
parts[index] = { ...part, text: expanded2 };
|
|
16867
16867
|
remaining -= expandedDelta;
|
|
16868
16868
|
}
|
|
16869
16869
|
}
|
|
16870
16870
|
const expanded = buildRenderedText(parts, timestamps);
|
|
16871
|
-
const expandedTokens =
|
|
16871
|
+
const expandedTokens = chunkBBX7Q7UG_cjs.estimateTokenCount(expanded);
|
|
16872
16872
|
if (expandedTokens <= options.maxTokens) {
|
|
16873
16873
|
return { text: expanded, truncated: false, tokenOffset: 0 };
|
|
16874
16874
|
}
|
|
16875
|
-
const hardTruncated =
|
|
16875
|
+
const hardTruncated = chunkBBX7Q7UG_cjs.truncateStringByTokens(expanded, options.maxTokens);
|
|
16876
16876
|
return { text: hardTruncated, truncated: true, tokenOffset: expandedTokens - options.maxTokens };
|
|
16877
16877
|
}
|
|
16878
16878
|
async function recallPart({
|
|
@@ -16923,7 +16923,7 @@ async function recallPart({
|
|
|
16923
16923
|
|
|
16924
16924
|
`;
|
|
16925
16925
|
const fallbackText = `${fallbackNote}${firstNextPart.text}`;
|
|
16926
|
-
const truncatedText2 =
|
|
16926
|
+
const truncatedText2 = chunkBBX7Q7UG_cjs.truncateStringByTokens(fallbackText, maxTokens);
|
|
16927
16927
|
const wasTruncated2 = truncatedText2 !== fallbackText;
|
|
16928
16928
|
return {
|
|
16929
16929
|
text: truncatedText2,
|
|
@@ -16938,7 +16938,7 @@ async function recallPart({
|
|
|
16938
16938
|
}
|
|
16939
16939
|
throw new Error(`Part index ${partIndex} not found in message ${cursor}. Available indices: ${availableIndices}`);
|
|
16940
16940
|
}
|
|
16941
|
-
const truncatedText =
|
|
16941
|
+
const truncatedText = chunkBBX7Q7UG_cjs.truncateStringByTokens(target.text, maxTokens);
|
|
16942
16942
|
const wasTruncated = truncatedText !== target.text;
|
|
16943
16943
|
return {
|
|
16944
16944
|
text: truncatedText,
|
|
@@ -18244,7 +18244,7 @@ ${workingMemory}`;
|
|
|
18244
18244
|
}
|
|
18245
18245
|
return chunks;
|
|
18246
18246
|
}
|
|
18247
|
-
hasher =
|
|
18247
|
+
hasher = chunkBBX7Q7UG_cjs.e();
|
|
18248
18248
|
// embedding is computationally expensive so cache content -> embeddings/chunks
|
|
18249
18249
|
embeddingCache = /* @__PURE__ */ new Map();
|
|
18250
18250
|
firstEmbed;
|
|
@@ -18646,7 +18646,7 @@ ${workingMemory}`;
|
|
|
18646
18646
|
"Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
|
|
18647
18647
|
);
|
|
18648
18648
|
}
|
|
18649
|
-
const { ObservationalMemory: OMClass } = await import('./observational-memory-
|
|
18649
|
+
const { ObservationalMemory: OMClass } = await import('./observational-memory-KH7G7Y6B-Y3XQXW3K.cjs');
|
|
18650
18650
|
const onIndexObservations = this.hasRetrievalSearch(omConfig.retrieval) ? async (observation) => {
|
|
18651
18651
|
await this.indexObservation(observation);
|
|
18652
18652
|
} : void 0;
|
|
@@ -19572,7 +19572,7 @@ Notes:
|
|
|
19572
19572
|
if (!effectiveConfig) return null;
|
|
19573
19573
|
const engine = await this.omEngine;
|
|
19574
19574
|
if (!engine) return null;
|
|
19575
|
-
const { ObservationalMemoryProcessor } = await import('./observational-memory-
|
|
19575
|
+
const { ObservationalMemoryProcessor } = await import('./observational-memory-KH7G7Y6B-Y3XQXW3K.cjs');
|
|
19576
19576
|
return new ObservationalMemoryProcessor(engine, this, {
|
|
19577
19577
|
temporalMarkers: effectiveConfig.temporalMarkers
|
|
19578
19578
|
});
|
|
@@ -30885,5 +30885,5 @@ exports.START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = START_ASYNC_AGENT_BUILDER_ACTIO
|
|
|
30885
30885
|
exports.STREAM_AGENT_BUILDER_ACTION_ROUTE = STREAM_AGENT_BUILDER_ACTION_ROUTE;
|
|
30886
30886
|
exports.STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
|
|
30887
30887
|
exports.agent_builder_exports = agent_builder_exports;
|
|
30888
|
-
//# sourceMappingURL=chunk-
|
|
30889
|
-
//# sourceMappingURL=chunk-
|
|
30888
|
+
//# sourceMappingURL=chunk-44K6EWHN.cjs.map
|
|
30889
|
+
//# sourceMappingURL=chunk-44K6EWHN.cjs.map
|