@mastra/memory 1.18.1-alpha.0 → 1.18.1

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 1.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added a public escape hatch so callers can supply an authoritative token estimate for file parts whose binary payload has been stripped before persistence (for example, files uploaded to cloud storage with a hidden reference token left in `data` and re-hydrated by LLM middleware before inference). ([#16565](https://github.com/mastra-ai/mastra/pull/16565))
8
+
9
+ For those pipelines TokenCounter has no on-device file size to measure, so Observational Memory thresholds and context budgets undercount large attachments. Callers can now stamp an estimate directly on the part:
10
+
11
+ ```ts
12
+ part.providerMetadata = {
13
+ mastra: {
14
+ tokenEstimate: { v: 0, source: 'client', key: 'client', tokens: 25_000 },
15
+ },
16
+ };
17
+ ```
18
+
19
+ When present, TokenCounter returns those tokens from both the sync and async paths and skips provider fetches. Invalid entries (NaN, negative, non-numeric) fall through to the default estimator. Parts without a client estimate are unaffected.
20
+
21
+ Related to https://github.com/mastra-ai/mastra/issues/16522
22
+
23
+ - Updated dependencies [[`20787de`](https://github.com/mastra-ai/mastra/commit/20787de5965234a1af28fe35f49437c537dbfa0d), [`784ad98`](https://github.com/mastra-ai/mastra/commit/784ad989549de91dc5d33ab8ef36caa6f7dcd34e), [`fceae1f`](https://github.com/mastra-ai/mastra/commit/fceae1f5f5db4722cb078a663c6eb4bd22944123), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`bf02acb`](https://github.com/mastra-ai/mastra/commit/bf02acbb8a6110f638ac844e89f1ebf04cb7fe74), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`bdb4cbf`](https://github.com/mastra-ai/mastra/commit/bdb4cbf8ba4b685d7481f28bb9dc3de6c79c9ed2), [`0fd3fbe`](https://github.com/mastra-ai/mastra/commit/0fd3fbe40fb63657aedd72f6e7b38c8e8ee6940d), [`f84447d`](https://github.com/mastra-ai/mastra/commit/f84447d6c80f3471836a9b300d246b331fb47e0d), [`a1a5b3e`](https://github.com/mastra-ai/mastra/commit/a1a5b3e42ab2ca5161ea21db59ebf28442680fa7), [`af84f57`](https://github.com/mastra-ai/mastra/commit/af84f571ed762e92e8e61c5f9a72363520914274), [`8b3c6f9`](https://github.com/mastra-ai/mastra/commit/8b3c6f90f7879833ba7d1bc70937e1d8f69d0804), [`fed0475`](https://github.com/mastra-ai/mastra/commit/fed0475ccfea31e4fc251469ac05640d0742c1f0), [`0d53730`](https://github.com/mastra-ai/mastra/commit/0d53730c1ed87ef80c87caa5701c4170ea8028e6), [`522f44d`](https://github.com/mastra-ai/mastra/commit/522f44d947214bfc06cff50599bae1ef3494880d)]:
24
+ - @mastra/core@1.34.0
25
+
3
26
  ## 1.18.1-alpha.0
4
27
 
5
28
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-memory
3
3
  description: Documentation for @mastra/memory. Use when working with @mastra/memory APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/memory"
6
- version: "1.18.1-alpha.0"
6
+ version: "1.18.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.18.1-alpha.0",
2
+ "version": "1.18.1",
3
3
  "package": "@mastra/memory",
4
4
  "exports": {
5
5
  "ModelByInputTokens": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/memory",
3
- "version": "1.18.1-alpha.0",
3
+ "version": "1.18.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -59,12 +59,12 @@
59
59
  "typescript-eslint": "^8.57.0",
60
60
  "vitest": "4.1.5",
61
61
  "zod": "^4.3.6",
62
- "@internal/ai-sdk-v4": "0.0.41",
63
- "@internal/ai-sdk-v5": "0.0.41",
64
- "@internal/ai-v6": "0.0.41",
65
- "@internal/lint": "0.0.94",
66
- "@internal/types-builder": "0.0.69",
67
- "@mastra/core": "1.34.0-alpha.1"
62
+ "@internal/ai-sdk-v4": "0.0.42",
63
+ "@internal/ai-sdk-v5": "0.0.42",
64
+ "@internal/types-builder": "0.0.70",
65
+ "@internal/ai-v6": "0.0.42",
66
+ "@internal/lint": "0.0.95",
67
+ "@mastra/core": "1.34.0"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@mastra/core": ">=1.4.1-0 <2.0.0-0",