@mastra/server 1.84.0-alpha.0 → 1.84.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/dist/{agent-builder-DWtgp1cb.cjs → agent-builder-CMAT5xu8.cjs} +2 -2
- package/dist/{agent-builder-DWtgp1cb.cjs.map → agent-builder-CMAT5xu8.cjs.map} +1 -1
- package/dist/{agent-builder-Ce1pjSjg.js → agent-builder-DYu--54x.js} +2 -2
- package/dist/{agent-builder-Ce1pjSjg.js.map → agent-builder-DYu--54x.js.map} +1 -1
- package/dist/{api-schema-manifest-DT9X0fAm.cjs → api-schema-manifest-DyOyIk-C.cjs} +2 -2
- package/dist/{api-schema-manifest-DT9X0fAm.cjs.map → api-schema-manifest-DyOyIk-C.cjs.map} +1 -1
- package/dist/{api-schema-manifest-CsTpd03O.js → api-schema-manifest-MtnJy994.js} +2 -2
- package/dist/{api-schema-manifest-CsTpd03O.js.map → api-schema-manifest-MtnJy994.js.map} +1 -1
- package/dist/{catalogue-CUJevxy3.js → catalogue-BdR5h6fv.js} +18 -25
- package/dist/catalogue-BdR5h6fv.js.map +1 -0
- package/dist/{catalogue-CGQdyojN.cjs → catalogue-oK_QSBRh.cjs} +18 -25
- package/dist/catalogue-oK_QSBRh.cjs.map +1 -0
- package/dist/{dist-C-Hmkkat.js → dist-4o3EGZcG.js} +25 -8
- package/dist/{dist-C-Hmkkat.js.map → dist-4o3EGZcG.js.map} +1 -1
- package/dist/dist-CecsVJCw.js +1 -0
- package/dist/{dist-DPgpEz_7.cjs → dist-DXhZqfZZ.cjs} +1 -1
- package/dist/{dist-Clh3uSOV.cjs → dist-p7VXVmE_.cjs} +25 -8
- package/dist/{dist-Clh3uSOV.cjs.map → dist-p7VXVmE_.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-server-server-adapters.md +1 -0
- package/dist/docs/references/docs-studio-knowledge.md +34 -0
- package/dist/{memory-CGlo-6_V.js → memory-0jB2EOKx.js} +81 -13
- package/dist/memory-0jB2EOKx.js.map +1 -0
- package/dist/{memory-CzSke9Em.cjs → memory-Dd7TpDfi.cjs} +86 -12
- package/dist/memory-Dd7TpDfi.cjs.map +1 -0
- package/dist/{probe-image-size-qOT5Pn0l.cjs → probe-image-size-DmttstPc.cjs} +2 -2
- package/dist/{probe-image-size-qOT5Pn0l.cjs.map → probe-image-size-DmttstPc.cjs.map} +1 -1
- package/dist/{probe-image-size-jA5gozO6.js → probe-image-size-IIGl_zRY.js} +2 -2
- package/dist/{probe-image-size-jA5gozO6.js.map → probe-image-size-IIGl_zRY.js.map} +1 -1
- package/dist/{routes-01JAJiMe.cjs → routes-6lsEmZwB.cjs} +5 -4
- package/dist/routes-6lsEmZwB.cjs.map +1 -0
- package/dist/{routes-CmkPohqd.js → routes-DAnFdADa.js} +5 -4
- package/dist/routes-DAnFdADa.js.map +1 -0
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/memory.cjs +2 -1
- package/dist/server/handlers/memory.d.ts +44 -0
- package/dist/server/handlers/memory.d.ts.map +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers.cjs +2 -2
- package/dist/server/handlers.js +2 -2
- package/dist/server/mcp/toolsets/memory.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +2 -2
- package/dist/server/server-adapter/index.js +2 -2
- package/dist/server/server-adapter/routes/fga-manifest.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/memory.d.ts +43 -0
- package/dist/server/server-adapter/routes/memory.d.ts.map +1 -1
- package/dist/{server-adapter-B7dLE5si.cjs → server-adapter-CbxRgDBh.cjs} +11 -2
- package/dist/{server-adapter-BywLWVKp.js.map → server-adapter-CbxRgDBh.cjs.map} +1 -1
- package/dist/{server-adapter-BywLWVKp.js → server-adapter-Dgy-iIqA.js} +11 -2
- package/dist/server-adapter-Dgy-iIqA.js.map +1 -0
- package/package.json +3 -3
- package/dist/catalogue-CGQdyojN.cjs.map +0 -1
- package/dist/catalogue-CUJevxy3.js.map +0 -1
- package/dist/dist-BVw6-hMs.js +0 -1
- package/dist/memory-CGlo-6_V.js.map +0 -1
- package/dist/memory-CzSke9Em.cjs.map +0 -1
- package/dist/routes-01JAJiMe.cjs.map +0 -1
- package/dist/routes-CmkPohqd.js.map +0 -1
- package/dist/server-adapter-B7dLE5si.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as openai } from "./dist-4o3EGZcG.js";
|
|
@@ -8654,7 +8654,7 @@ function splitLines(text) {
|
|
|
8654
8654
|
else result.push(result.pop().slice(0, -1));
|
|
8655
8655
|
return result;
|
|
8656
8656
|
}
|
|
8657
|
-
// ../memory/dist/src-
|
|
8657
|
+
// ../memory/dist/src-DGBUSKXy.js
|
|
8658
8658
|
var __defProp$3 = Object.defineProperty;
|
|
8659
8659
|
var __exportAll = (all, no_symbols) => {
|
|
8660
8660
|
let target = {};
|
|
@@ -35328,6 +35328,7 @@ function buildObserverHistoryMessage(messages, options) {
|
|
|
35328
35328
|
}
|
|
35329
35329
|
/** Truncate a string to maxLen characters, appending a note if truncated. */
|
|
35330
35330
|
function maybeTruncate(str, maxLen) {
|
|
35331
|
+
if (typeof str !== "string") return "";
|
|
35331
35332
|
if (!maxLen || str.length <= maxLen) return str;
|
|
35332
35333
|
const truncated = safeSlice(str, maxLen);
|
|
35333
35334
|
return `${truncated}\n... [truncated ${str.length - truncated.length} characters]`;
|
|
@@ -36582,6 +36583,19 @@ function buildEstimateKey(kind, text) {
|
|
|
36582
36583
|
function resolveEstimatorId() {
|
|
36583
36584
|
return "tokenx";
|
|
36584
36585
|
}
|
|
36586
|
+
const ATTACHMENT_CONTENT_PART_TYPES = /* @__PURE__ */ new Set([
|
|
36587
|
+
"image",
|
|
36588
|
+
"image-data",
|
|
36589
|
+
"media",
|
|
36590
|
+
"audio",
|
|
36591
|
+
"file-data"
|
|
36592
|
+
]);
|
|
36593
|
+
/** Mirrors the parts countMultimodalToolResultContent counts as attachments. */
|
|
36594
|
+
function isAttachmentContentPart(item) {
|
|
36595
|
+
if (!item || typeof item !== "object") return false;
|
|
36596
|
+
const contentPart = item;
|
|
36597
|
+
return ATTACHMENT_CONTENT_PART_TYPES.has(contentPart.type) && typeof contentPart.data === "string";
|
|
36598
|
+
}
|
|
36585
36599
|
function isTokenEstimateEntry(value) {
|
|
36586
36600
|
if (!value || typeof value !== "object") return false;
|
|
36587
36601
|
const entry = value;
|
|
@@ -36771,7 +36785,7 @@ async function resolveImageDimensionsAsync(part) {
|
|
|
36771
36785
|
const url = resolveHttpAssetUrl(getObjectValue(part, "image") ?? getObjectValue(part, "data"));
|
|
36772
36786
|
if (!url) return existing;
|
|
36773
36787
|
try {
|
|
36774
|
-
const probeImageSize = (await Promise.resolve().then(() => /* @__PURE__ */ require_rolldown_runtime.__toESM(require("./probe-image-size-
|
|
36788
|
+
const probeImageSize = (await Promise.resolve().then(() => /* @__PURE__ */ require_rolldown_runtime.__toESM(require("./probe-image-size-DmttstPc.cjs").default, 1))).default;
|
|
36775
36789
|
const probed = await probeImageSize(url, {
|
|
36776
36790
|
open_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
|
|
36777
36791
|
response_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
|
|
@@ -37374,12 +37388,12 @@ var TokenCounter = class TokenCounter {
|
|
|
37374
37388
|
}
|
|
37375
37389
|
countMultimodalToolResultContent(part, toolResult) {
|
|
37376
37390
|
if (!toolResult || typeof toolResult !== "object") return;
|
|
37391
|
+
const output = toolResult;
|
|
37392
|
+
const content = output.type === "content" && Array.isArray(output.value) ? output.value : output.content;
|
|
37393
|
+
if (!Array.isArray(content) || !content.some(isAttachmentContentPart)) return;
|
|
37377
37394
|
const resultKey = buildEstimateKey("tool-result-multimodal-content-source", JSON.stringify(toolResult));
|
|
37378
37395
|
const cached = this.multimodalToolResultCounts.get(part);
|
|
37379
37396
|
if (cached?.resultKey === resultKey) return cached.tokens;
|
|
37380
|
-
const output = toolResult;
|
|
37381
|
-
const content = output.type === "content" && Array.isArray(output.value) ? output.value : output.content;
|
|
37382
|
-
if (!Array.isArray(content)) return;
|
|
37383
37397
|
let hasAttachment = false;
|
|
37384
37398
|
let tokens = 0;
|
|
37385
37399
|
const cacheParts = [];
|
|
@@ -38226,7 +38240,10 @@ const __experimental_updateWorkingMemoryToolVNext = (config) => {
|
|
|
38226
38240
|
}
|
|
38227
38241
|
const workingMemory = workingMemoryInput.newMemory || "";
|
|
38228
38242
|
if (!workingMemoryInput.updateReason) workingMemoryInput.updateReason = `append-new-memory`;
|
|
38229
|
-
if (workingMemoryInput.searchString &&
|
|
38243
|
+
if (workingMemoryInput.searchString && scope === "resource" && workingMemoryInput.updateReason === `replace-irrelevant-memory`) return {
|
|
38244
|
+
success: false,
|
|
38245
|
+
reason: `working memory is shared across all conversations for this resource, so it can't be replaced just because it isn't relevant to this conversation. Use clarify-existing-memory to correct it, or append-new-memory to add to it.`
|
|
38246
|
+
};
|
|
38230
38247
|
if (workingMemoryInput.updateReason === `append-new-memory` && workingMemoryInput.searchString) workingMemoryInput.searchString = void 0;
|
|
38231
38248
|
if (workingMemoryInput.updateReason !== `append-new-memory` && !workingMemoryInput.searchString) return {
|
|
38232
38249
|
success: false,
|
|
@@ -52009,7 +52026,7 @@ const createModelInstance = async (provider, modelId, version = "v2") => {
|
|
|
52009
52026
|
try {
|
|
52010
52027
|
const providerFn = version === `v1` ? { v1: {
|
|
52011
52028
|
openai: async () => {
|
|
52012
|
-
const { openai } = await Promise.resolve().then(() => require("./dist-
|
|
52029
|
+
const { openai } = await Promise.resolve().then(() => require("./dist-DXhZqfZZ.cjs"));
|
|
52013
52030
|
return openai(modelId);
|
|
52014
52031
|
},
|
|
52015
52032
|
anthropic: async () => {
|
|
@@ -59839,4 +59856,4 @@ Object.defineProperty(exports, "require_webp", {
|
|
|
59839
59856
|
}
|
|
59840
59857
|
});
|
|
59841
59858
|
|
|
59842
|
-
//# sourceMappingURL=dist-
|
|
59859
|
+
//# sourceMappingURL=dist-p7VXVmE_.cjs.map
|