@mastra/mcp-docs-server 1.0.0-beta.25 → 1.0.0-beta.27

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 (36) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fplayground.md +20 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +59 -59
  3. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +17 -17
  4. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +34 -34
  5. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +34 -34
  6. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
  7. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +42 -42
  8. package/.docs/organized/changelogs/%40mastra%2Fcore.md +41 -41
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +17 -17
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +17 -17
  11. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +34 -34
  12. package/.docs/organized/changelogs/%40mastra%2Flance.md +34 -34
  13. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +59 -59
  14. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +15 -15
  15. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +59 -59
  16. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +59 -59
  17. package/.docs/organized/changelogs/%40mastra%2Fpg.md +59 -59
  18. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +22 -22
  19. package/.docs/organized/changelogs/%40mastra%2Freact.md +18 -18
  20. package/.docs/organized/changelogs/%40mastra%2Fserver.md +17 -17
  21. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +34 -34
  22. package/.docs/organized/changelogs/create-mastra.md +5 -5
  23. package/.docs/organized/changelogs/mastra.md +35 -35
  24. package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +15 -1
  25. package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +88 -4
  26. package/.docs/raw/memory/storage.mdx +3 -3
  27. package/.docs/raw/reference/cli/mastra.mdx +20 -4
  28. package/.docs/raw/reference/configuration.mdx +1 -1
  29. package/.docs/raw/reference/core/getStorage.mdx +1 -1
  30. package/.docs/raw/reference/core/mastra-class.mdx +1 -1
  31. package/.docs/raw/reference/core/setStorage.mdx +2 -2
  32. package/.docs/raw/reference/memory/memory-class.mdx +1 -1
  33. package/.docs/raw/reference/storage/composite.mdx +16 -16
  34. package/CHANGELOG.md +14 -0
  35. package/dist/stdio.js +2 -2
  36. package/package.json +3 -3
@@ -1,5 +1,63 @@
1
1
  # @mastra/pg
2
2
 
3
+ ## 1.0.0-beta.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed duplicate spans migration issue across all storage backends. When upgrading from older versions, existing duplicate (traceId, spanId) combinations in the spans table could prevent the unique constraint from being created. The migration deduplicates spans before adding the constraint. ([#12073](https://github.com/mastra-ai/mastra/pull/12073))
8
+
9
+ **Deduplication rules (in priority order):**
10
+ 1. Keep completed spans (those with `endedAt` set) over incomplete spans
11
+ 2. Among spans with the same completion status, keep the one with the newest `updatedAt`
12
+ 3. Use `createdAt` as the final tiebreaker
13
+
14
+ **What changed:**
15
+ - Added `migrateSpans()` method to observability stores for manual migration
16
+ - Added `checkSpansMigrationStatus()` method to check if migration is needed
17
+ - All stores use optimized single-query deduplication to avoid memory issues on large tables
18
+
19
+ **Usage example:**
20
+
21
+ ```typescript
22
+ const observability = await storage.getStore('observability');
23
+ const status = await observability.checkSpansMigrationStatus();
24
+ if (status.needsMigration) {
25
+ const result = await observability.migrateSpans();
26
+ console.log(`Migration complete: ${result.duplicatesRemoved} duplicates removed`);
27
+ }
28
+ ```
29
+
30
+ Fixes #11840
31
+
32
+ - Renamed MastraStorage to MastraCompositeStore for better clarity. The old MastraStorage name remains available as a deprecated alias for backward compatibility, but will be removed in a future version. ([#12093](https://github.com/mastra-ai/mastra/pull/12093))
33
+
34
+ **Migration:**
35
+
36
+ Update your imports and usage:
37
+
38
+ ```typescript
39
+ // Before
40
+ import { MastraStorage } from '@mastra/core/storage';
41
+
42
+ const storage = new MastraStorage({
43
+ id: 'composite',
44
+ domains: { ... }
45
+ });
46
+
47
+ // After
48
+ import { MastraCompositeStore } from '@mastra/core/storage';
49
+
50
+ const storage = new MastraCompositeStore({
51
+ id: 'composite',
52
+ domains: { ... }
53
+ });
54
+ ```
55
+
56
+ The new name better reflects that this is a composite storage implementation that routes different domains (workflows, traces, messages) to different underlying stores, avoiding confusion with the general "Mastra Storage" concept.
57
+
58
+ - Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac), [`ffa553a`](https://github.com/mastra-ai/mastra/commit/ffa553a3edc1bd17d73669fba66d6b6f4ac10897)]:
59
+ - @mastra/core@1.0.0-beta.26
60
+
3
61
  ## 1.0.0-beta.14
4
62
 
5
63
  ### Patch Changes
@@ -440,63 +498,5 @@
440
498
  await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
441
499
 
442
500
  const observability = await storage.getStore('observability');
443
- await observability?.createSpan(span);
444
- ```
445
-
446
- ### Available Domains
447
- - **`memory`**: Thread and message operations (`getThreadById`, `saveThread`, `saveMessages`, etc.)
448
- - **`workflows`**: Workflow state persistence (`persistWorkflowSnapshot`, `loadWorkflowSnapshot`, `getWorkflowRunById`, etc.)
449
- - **`scores`**: Evaluation scores (`saveScore`, `listScoresByScorerId`, etc.)
450
- - **`observability`**: Tracing and spans (`createSpan`, `updateSpan`, `getTrace`, etc.)
451
- - **`agents`**: Stored agent configurations (`createAgent`, `getAgentById`, `listAgents`, etc.)
452
-
453
- ### Breaking Changes
454
- - Passthrough methods have been removed from `MastraStorage` base class
455
- - All storage adapters now require accessing domains via `getStore()`
456
- - The `stores` property on storage instances is now the canonical way to access domain storage
457
-
458
- ### Internal Changes
459
- - Each storage adapter now initializes domain-specific stores in its constructor
460
- - Domain stores share database connections and handle their own table initialization
461
-
462
- - Unified observability schema with entity-based span identification ([#11132](https://github.com/mastra-ai/mastra/pull/11132))
463
-
464
- ## What changed
465
-
466
- Spans now use a unified identification model with `entityId`, `entityType`, and `entityName` instead of separate `agentId`, `toolId`, `workflowId` fields.
467
-
468
- **Before:**
469
-
470
- ```typescript
471
- // Old span structure
472
- span.agentId; // 'my-agent'
473
- span.toolId; // undefined
474
- span.workflowId; // undefined
475
- ```
476
-
477
- **After:**
478
-
479
- ```typescript
480
- // New span structure
481
- span.entityType; // EntityType.AGENT
482
- span.entityId; // 'my-agent'
483
- span.entityName; // 'My Agent'
484
- ```
485
-
486
- ## New `listTraces()` API
487
-
488
- Query traces with filtering, pagination, and sorting:
489
-
490
- ```typescript
491
- const { spans, pagination } = await storage.listTraces({
492
- filters: {
493
- entityType: EntityType.AGENT,
494
- entityId: 'my-agent',
495
- userId: 'user-123',
496
- environment: 'production',
497
- status: TraceStatus.SUCCESS,
498
- startedAt: { start: new Date('2024-01-01'), end: new Date('2024-01-31') },
499
- },
500
- pagination: { page: 0, perPage: 50 },
501
501
 
502
- ... 3421 more lines hidden. See full changelog in package directory.
502
+ ... 3479 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,26 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 7.0.0-beta.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`50fd320`](https://github.com/mastra-ai/mastra/commit/50fd320003d0d93831c230ef531bef41f5ba7b3a)]:
8
+ - @mastra/core@1.0.0-beta.27
9
+ - @mastra/client-js@1.0.0-beta.27
10
+ - @mastra/react@0.1.0-beta.27
11
+
12
+ ## 7.0.0-beta.26
13
+
14
+ ### Patch Changes
15
+
16
+ - Fixed scorer eligibility check in observability to also check span.entityType field ([#12078](https://github.com/mastra-ai/mastra/pull/12078))
17
+
18
+ - Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac), [`ffa553a`](https://github.com/mastra-ai/mastra/commit/ffa553a3edc1bd17d73669fba66d6b6f4ac10897)]:
19
+ - @mastra/client-js@1.0.0-beta.26
20
+ - @mastra/core@1.0.0-beta.26
21
+ - @mastra/react@0.1.0-beta.26
22
+ - @mastra/ai-sdk@1.0.0-beta.16
23
+
3
24
  ## 7.0.0-beta.25
4
25
 
5
26
  ### Patch Changes
@@ -477,26 +498,5 @@
477
498
  Agents can now use `LanguageModelV3` models from AI SDK v6 beta providers like `@ai-sdk/openai@^3.0.0-beta`.
478
499
 
479
500
  **New features:**
480
- - Usage normalization: V3's nested usage format is normalized to Mastra's flat format with `reasoningTokens`, `cachedInputTokens`, and raw data preserved in a `raw` field
481
-
482
- **Backward compatible:** All existing V1 and V2 models continue to work unchanged.
483
-
484
- - Updated dependencies [[`4f94ed8`](https://github.com/mastra-ai/mastra/commit/4f94ed8177abfde3ec536e3574883e075423350c), [`ac3cc23`](https://github.com/mastra-ai/mastra/commit/ac3cc2397d1966bc0fc2736a223abc449d3c7719), [`a86f4df`](https://github.com/mastra-ai/mastra/commit/a86f4df0407311e0d2ea49b9a541f0938810d6a9), [`029540c`](https://github.com/mastra-ai/mastra/commit/029540ca1e582fc2dd8d288ecd4a9b0f31a954ef), [`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`01b20fe`](https://github.com/mastra-ai/mastra/commit/01b20fefb7c67c2b7d79417598ef4e60256d1225), [`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119), [`b7b0930`](https://github.com/mastra-ai/mastra/commit/b7b0930dbe72eade8d3882992f2f2db53220e4eb), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
485
- - @mastra/core@1.0.0-beta.14
486
- - @mastra/ai-sdk@1.0.0-beta.10
487
- - @mastra/client-js@1.0.0-beta.14
488
- - @mastra/react@0.1.0-beta.14
489
-
490
- ## 7.0.0-beta.13
491
-
492
- ### Patch Changes
493
-
494
- - Updated dependencies [[`919a22b`](https://github.com/mastra-ai/mastra/commit/919a22b25876f9ed5891efe5facbe682c30ff497)]:
495
- - @mastra/core@1.0.0-beta.13
496
- - @mastra/client-js@1.0.0-beta.13
497
- - @mastra/react@0.1.0-beta.13
498
-
499
- ## 7.0.0-beta.12
500
-
501
501
 
502
- ... 4777 more lines hidden. See full changelog in package directory.
502
+ ... 4798 more lines hidden. See full changelog in package directory.
@@ -1,6 +1,20 @@
1
- # @mastra/react-hooks
1
+ # @mastra/react
2
2
 
3
- ## 1.0.0-beta.25
3
+ ## 0.1.0-beta.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @mastra/client-js@1.0.0-beta.27
9
+
10
+ ## 0.1.0-beta.26
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac)]:
15
+ - @mastra/client-js@1.0.0-beta.26
16
+
17
+ ## 0.1.0-beta.25
4
18
 
5
19
  ### Minor Changes
6
20
 
@@ -57,7 +71,7 @@
57
71
  - Updated dependencies [[`ed3e3dd`](https://github.com/mastra-ai/mastra/commit/ed3e3ddec69d564fe2b125e083437f76331f1283), [`47b1c16`](https://github.com/mastra-ai/mastra/commit/47b1c16a01c7ffb6765fe1e499b49092f8b7eba3), [`9312dcd`](https://github.com/mastra-ai/mastra/commit/9312dcd1c6f5b321929e7d382e763d95fdc030f5)]:
58
72
  - @mastra/client-js@1.0.0-beta.25
59
73
 
60
- ## 1.0.0-beta.24
74
+ ## 0.1.0-beta.23
61
75
 
62
76
  ### Major Changes
63
77
 
@@ -484,19 +498,5 @@
484
498
  - Updated dependencies [[`3852192`](https://github.com/mastra-ai/mastra/commit/3852192c81b2a4f1f883f17d80ce50e0c60dba55), [`fec5129`](https://github.com/mastra-ai/mastra/commit/fec5129de7fc64423ea03661a56cef31dc747a0d), [`3443770`](https://github.com/mastra-ai/mastra/commit/3443770662df8eb24c9df3589b2792d78cfcb811), [`f0a07e0`](https://github.com/mastra-ai/mastra/commit/f0a07e0111b3307c5fabfa4094c5c2cfb734fbe6), [`aaa40e7`](https://github.com/mastra-ai/mastra/commit/aaa40e788628b319baa8e889407d11ad626547fa), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`5948e6a`](https://github.com/mastra-ai/mastra/commit/5948e6a5146c83666ba3f294b2be576c82a513fb), [`dff01d8`](https://github.com/mastra-ai/mastra/commit/dff01d81ce1f4e4087cfac20fa868e6db138dd14), [`b7de533`](https://github.com/mastra-ai/mastra/commit/b7de53361667eb51fefd89fcaed924f3c57cee8d), [`7051bf3`](https://github.com/mastra-ai/mastra/commit/7051bf38b3b122a069008f861f7bfc004a6d9f6e), [`1ee3411`](https://github.com/mastra-ai/mastra/commit/1ee34113192b11aa8bcdd8d9d5830ae13254b345), [`0793497`](https://github.com/mastra-ai/mastra/commit/079349753620c40246ffd673e3f9d7d9820beff3), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`f93d992`](https://github.com/mastra-ai/mastra/commit/f93d992a37d5431ab4a71246835d403ef7c4ce85), [`c576fc0`](https://github.com/mastra-ai/mastra/commit/c576fc0b100b2085afded91a37c97a0ea0ec09c7), [`9f4a683`](https://github.com/mastra-ai/mastra/commit/9f4a6833e88b52574665c028fd5508ad5c2f6004), [`ea0b8de`](https://github.com/mastra-ai/mastra/commit/ea0b8dec0d4bc86a72a7e75b2f56c6017c58786d), [`eb09742`](https://github.com/mastra-ai/mastra/commit/eb09742197f66c4c38154c3beec78313e69760b2), [`a1bd7b8`](https://github.com/mastra-ai/mastra/commit/a1bd7b8571db16b94eb01588f451a74758c96d65), [`0633100`](https://github.com/mastra-ai/mastra/commit/0633100a911ad22f5256471bdf753da21c104742), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`519d9e6`](https://github.com/mastra-ai/mastra/commit/519d9e6d31910457c54bdae8b7b7cb3a69f41831), [`844ea5d`](https://github.com/mastra-ai/mastra/commit/844ea5dc0c248961e7bf73629ae7dcff503e853c), [`dfe3f8c`](https://github.com/mastra-ai/mastra/commit/dfe3f8c7376ffe159236819e19ca522143c1f972), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`e8dcd71`](https://github.com/mastra-ai/mastra/commit/e8dcd71fa5e473c8ba1d6dad99eef182d20a0491), [`63f2f18`](https://github.com/mastra-ai/mastra/commit/63f2f1863dffe3ad23221d0660ed4e4f2b81789d), [`c23200d`](https://github.com/mastra-ai/mastra/commit/c23200ddfd60830effb39329674ba4ca93be6aac), [`363284b`](https://github.com/mastra-ai/mastra/commit/363284bb974e850f06f40f89a28c79d9f432d7e4), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`b7959e6`](https://github.com/mastra-ai/mastra/commit/b7959e6e25a46b480f9ea2217c4c6c588c423791), [`0bddc6d`](https://github.com/mastra-ai/mastra/commit/0bddc6d8dbd6f6008c0cba2e4960a2da75a55af1), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9), [`c218bd3`](https://github.com/mastra-ai/mastra/commit/c218bd3759e32423735b04843a09404572631014)]:
485
499
  - @mastra/client-js@1.0.0-beta.0
486
500
 
487
- ## 0.0.10
488
-
489
- ### Patch Changes
490
-
491
- - Updated dependencies []:
492
- - @mastra/client-js@0.16.4
493
-
494
- ## 0.0.10-alpha.0
495
-
496
- ### Patch Changes
497
-
498
- - Updated dependencies []:
499
- - @mastra/client-js@0.16.4-alpha.0
500
-
501
501
 
502
- ... 286 more lines hidden. See full changelog in package directory.
502
+ ... 300 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,21 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 1.0.0-beta.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`50fd320`](https://github.com/mastra-ai/mastra/commit/50fd320003d0d93831c230ef531bef41f5ba7b3a)]:
8
+ - @mastra/core@1.0.0-beta.27
9
+
10
+ ## 1.0.0-beta.26
11
+
12
+ ### Patch Changes
13
+
14
+ - Improve type handling with Zod ([#12091](https://github.com/mastra-ai/mastra/pull/12091))
15
+
16
+ - Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac), [`ffa553a`](https://github.com/mastra-ai/mastra/commit/ffa553a3edc1bd17d73669fba66d6b6f4ac10897)]:
17
+ - @mastra/core@1.0.0-beta.26
18
+
3
19
  ## 1.0.0-beta.25
4
20
 
5
21
  ### Minor Changes
@@ -483,20 +499,4 @@
483
499
 
484
500
  ## Backward compatibility
485
501
 
486
- The legacy `getTraces()` method continues to work. When you pass `name: "agent run: my-agent"`, it automatically transforms to `entityId: "my-agent", entityType: AGENT`.
487
-
488
- ## Migration
489
-
490
- **Automatic:** SQL-based stores (PostgreSQL, LibSQL, MSSQL) automatically add new columns to existing `spans` tables on initialization. Existing data is preserved with new columns set to `NULL`.
491
-
492
- **No action required:** Your existing code continues to work. Adopt the new fields and `listTraces()` API at your convenience.
493
-
494
- ### Patch Changes
495
-
496
- - Refactor storage architecture to use domain-specific stores via `getStore()` pattern ([#11361](https://github.com/mastra-ai/mastra/pull/11361))
497
-
498
- ### Summary
499
-
500
- This release introduces a new storage architecture that replaces passthrough methods on `MastraStorage` with domain-specific storage interfaces accessed via `getStore()`. This change reduces code duplication across storage adapters and provides a cleaner, more modular API.
501
-
502
- ... 4961 more lines hidden. See full changelog in package directory.
502
+ ... 4977 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,38 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 1.0.0-beta.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Renamed MastraStorage to MastraCompositeStore for better clarity. The old MastraStorage name remains available as a deprecated alias for backward compatibility, but will be removed in a future version. ([#12093](https://github.com/mastra-ai/mastra/pull/12093))
8
+
9
+ **Migration:**
10
+
11
+ Update your imports and usage:
12
+
13
+ ```typescript
14
+ // Before
15
+ import { MastraStorage } from '@mastra/core/storage';
16
+
17
+ const storage = new MastraStorage({
18
+ id: 'composite',
19
+ domains: { ... }
20
+ });
21
+
22
+ // After
23
+ import { MastraCompositeStore } from '@mastra/core/storage';
24
+
25
+ const storage = new MastraCompositeStore({
26
+ id: 'composite',
27
+ domains: { ... }
28
+ });
29
+ ```
30
+
31
+ The new name better reflects that this is a composite storage implementation that routes different domains (workflows, traces, messages) to different underlying stores, avoiding confusion with the general "Mastra Storage" concept.
32
+
33
+ - Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac), [`ffa553a`](https://github.com/mastra-ai/mastra/commit/ffa553a3edc1bd17d73669fba66d6b6f4ac10897)]:
34
+ - @mastra/core@1.0.0-beta.26
35
+
3
36
  ## 1.0.0-beta.12
4
37
 
5
38
  ### Patch Changes
@@ -466,37 +499,4 @@
466
499
 
467
500
  **Type change:** `WorkflowState.error` and `WorkflowRunState.error` types changed from `string | Error` to `SerializedError`.
468
501
 
469
- Other changes:
470
- - Added `UpdateWorkflowStateOptions` type for workflow state updates
471
-
472
- - Updated dependencies [[`d5ed981`](https://github.com/mastra-ai/mastra/commit/d5ed981c8701c1b8a27a5f35a9a2f7d9244e695f), [`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd), [`b760b73`](https://github.com/mastra-ai/mastra/commit/b760b731aca7c8a3f041f61d57a7f125ae9cb215), [`695a621`](https://github.com/mastra-ai/mastra/commit/695a621528bdabeb87f83c2277cf2bb084c7f2b4), [`2b459f4`](https://github.com/mastra-ai/mastra/commit/2b459f466fd91688eeb2a44801dc23f7f8a887ab), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`09e4bae`](https://github.com/mastra-ai/mastra/commit/09e4bae18dd5357d2ae078a4a95a2af32168ab08), [`24b76d8`](https://github.com/mastra-ai/mastra/commit/24b76d8e17656269c8ed09a0c038adb9cc2ae95a), [`243a823`](https://github.com/mastra-ai/mastra/commit/243a8239c5906f5c94e4f78b54676793f7510ae3), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`c61fac3`](https://github.com/mastra-ai/mastra/commit/c61fac3add96f0dcce0208c07415279e2537eb62), [`6f14f70`](https://github.com/mastra-ai/mastra/commit/6f14f706ccaaf81b69544b6c1b75ab66a41e5317), [`09e4bae`](https://github.com/mastra-ai/mastra/commit/09e4bae18dd5357d2ae078a4a95a2af32168ab08), [`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f), [`2a53598`](https://github.com/mastra-ai/mastra/commit/2a53598c6d8cfeb904a7fc74e57e526d751c8fa6), [`c7cd3c7`](https://github.com/mastra-ai/mastra/commit/c7cd3c7a187d7aaf79e2ca139de328bf609a14b4), [`847c212`](https://github.com/mastra-ai/mastra/commit/847c212caba7df0d6f2fc756b494ac3c75c3720d), [`6f941c4`](https://github.com/mastra-ai/mastra/commit/6f941c438ca5f578619788acc7608fc2e23bd176)]:
473
- - @mastra/core@1.0.0-beta.12
474
-
475
- ## 1.0.0-beta.6
476
-
477
- ### Patch Changes
478
-
479
- - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
480
-
481
- ```typescript
482
- await workflow.deleteWorkflowRunById(runId);
483
- ```
484
-
485
- - Updated dependencies [[`edb07e4`](https://github.com/mastra-ai/mastra/commit/edb07e49283e0c28bd094a60e03439bf6ecf0221), [`b7e17d3`](https://github.com/mastra-ai/mastra/commit/b7e17d3f5390bb5a71efc112204413656fcdc18d), [`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d), [`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932), [`4f0331a`](https://github.com/mastra-ai/mastra/commit/4f0331a79bf6eb5ee598a5086e55de4b5a0ada03), [`8a000da`](https://github.com/mastra-ai/mastra/commit/8a000da0c09c679a2312f6b3aa05b2ca78ca7393)]:
486
- - @mastra/core@1.0.0-beta.10
487
-
488
- ## 1.0.0-beta.5
489
-
490
- ### Patch Changes
491
-
492
- - Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
493
-
494
- **What Changed**
495
- - saveScore now correctly returns scores that can be retrieved with getScoreById
496
- - Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
497
-
498
- **Impact**
499
- Previously, calling getScoreById after saveScore would return null because the generated ID wasn't persisted to the database. This is now fixed across all store implementations, ensuring consistent behavior and data integrity.
500
-
501
-
502
- ... 2783 more lines hidden. See full changelog in package directory.
502
+ ... 2816 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,9 @@
1
1
  # create-mastra
2
2
 
3
+ ## 1.0.0-beta.19
4
+
5
+ ## 1.0.0-beta.18
6
+
3
7
  ## 1.0.0-beta.17
4
8
 
5
9
  ## 1.0.0-beta.16
@@ -494,9 +498,5 @@
494
498
 
495
499
  ### Patch Changes
496
500
 
497
- - Fix getting tool link path from agent in playground ui tools page ([#8135](https://github.com/mastra-ai/mastra/pull/8135))
498
-
499
- ## 0.13.2-alpha.3
500
-
501
501
 
502
- ... 1747 more lines hidden. See full changelog in package directory.
502
+ ... 1751 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,39 @@
1
1
  # mastra
2
2
 
3
+ ## 1.0.0-beta.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed migration CLI failing with MIGRATION_REQUIRED error during Mastra import. Added MASTRA_DISABLE_STORAGE_INIT environment variable to skip auto-initialization of storage, allowing the migration command to import user's Mastra config without triggering the migration check. Also improved the migration prompt display to show warning messages before the confirmation dialog. ([#12100](https://github.com/mastra-ai/mastra/pull/12100))
8
+
9
+ - Updated dependencies [[`50fd320`](https://github.com/mastra-ai/mastra/commit/50fd320003d0d93831c230ef531bef41f5ba7b3a)]:
10
+ - @mastra/core@1.0.0-beta.27
11
+ - @mastra/deployer@1.0.0-beta.27
12
+
13
+ ## 1.0.0-beta.18
14
+
15
+ ### Minor Changes
16
+
17
+ - Added `mastra migrate` CLI command to manually run storage migrations. This command bundles and executes the migration script against your configured storage backend, deduplicating spans and adding unique constraints. Useful when upgrading from older versions that may have duplicate (traceId, spanId) entries. ([#12073](https://github.com/mastra-ai/mastra/pull/12073))
18
+
19
+ **Usage:**
20
+
21
+ ```bash
22
+ npx mastra migrate
23
+ ```
24
+
25
+ **Options:**
26
+ - `-d, --dir <path>` - Path to your Mastra folder (default: `src/mastra`)
27
+ - `-r, --root <path>` - Path to your root folder
28
+ - `-e, --env <env>` - Custom env file to include
29
+ - `--debug` - Enable debug logs
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac), [`ffa553a`](https://github.com/mastra-ai/mastra/commit/ffa553a3edc1bd17d73669fba66d6b6f4ac10897)]:
34
+ - @mastra/core@1.0.0-beta.26
35
+ - @mastra/deployer@1.0.0-beta.26
36
+
3
37
  ## 1.0.0-beta.17
4
38
 
5
39
  ### Patch Changes
@@ -465,38 +499,4 @@
465
499
 
466
500
  ## 0.17.2
467
501
 
468
- ### Patch Changes
469
-
470
- - Fix a bug where `mastra init` didn't work correctly when core dependencies were missing in the project ([#9070](https://github.com/mastra-ai/mastra/pull/9070))
471
-
472
- - Updated dependencies [[`69ff5d5`](https://github.com/mastra-ai/mastra/commit/69ff5d58e4bc4054ce76bbb25a8fa5d3177c49ea)]:
473
- - @mastra/deployer@0.22.1
474
- - @mastra/core@0.22.1
475
-
476
- ## 0.17.2-alpha.0
477
-
478
- ### Patch Changes
479
-
480
- - Fix a bug where `mastra init` didn't work correctly when core dependencies were missing in the project ([#9070](https://github.com/mastra-ai/mastra/pull/9070))
481
-
482
- - Updated dependencies [[`69ff5d5`](https://github.com/mastra-ai/mastra/commit/69ff5d58e4bc4054ce76bbb25a8fa5d3177c49ea)]:
483
- - @mastra/deployer@0.22.1-alpha.0
484
- - @mastra/core@0.22.1-alpha.0
485
-
486
- ## 0.17.1
487
-
488
- ### Patch Changes
489
-
490
- - Add scorers to the default weather agent in the create command. ([#9042](https://github.com/mastra-ai/mastra/pull/9042))
491
-
492
- - Fix tool result in playground ([#9087](https://github.com/mastra-ai/mastra/pull/9087))
493
-
494
- - Use newer model id for anthropic during `create-mastra` ([#8996](https://github.com/mastra-ai/mastra/pull/8996))
495
-
496
- - Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
497
-
498
- - Updated dependencies [[`25305a2`](https://github.com/mastra-ai/mastra/commit/25305a2af1acf77cc2ac9237774ecd7d3caa31a1), [`c67ca32`](https://github.com/mastra-ai/mastra/commit/c67ca32e3c2cf69bfc146580770c720220ca44ac), [`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec), [`dbc9e12`](https://github.com/mastra-ai/mastra/commit/dbc9e1216ba575ba59ead4afb727a01215f7de4f), [`99e41b9`](https://github.com/mastra-ai/mastra/commit/99e41b94957cdd25137d3ac12e94e8b21aa01b68), [`c28833c`](https://github.com/mastra-ai/mastra/commit/c28833c5b6d8e10eeffd7f7d39129d53b8bca240), [`8ea07b4`](https://github.com/mastra-ai/mastra/commit/8ea07b4bdc73e4218437dbb6dcb0f4b23e745a44), [`ba201b8`](https://github.com/mastra-ai/mastra/commit/ba201b8f8feac4c72350f2dbd52c13c7297ba7b0), [`f053e89`](https://github.com/mastra-ai/mastra/commit/f053e89160dbd0bd3333fc3492f68231b5c7c349), [`4fc4136`](https://github.com/mastra-ai/mastra/commit/4fc413652866a8d2240694fddb2562e9edbb70df), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`d10baf5`](https://github.com/mastra-ai/mastra/commit/d10baf5a3c924f2a6654e23a3e318ed03f189b76), [`038c55a`](https://github.com/mastra-ai/mastra/commit/038c55a7090fc1b1513a966386d3072617f836ac), [`1eb156a`](https://github.com/mastra-ai/mastra/commit/1eb156ace499b34ab48bf23fb16f1affe6bb9c1c), [`182f045`](https://github.com/mastra-ai/mastra/commit/182f0458f25bd70aa774e64fd923c8a483eddbf1), [`9a1a485`](https://github.com/mastra-ai/mastra/commit/9a1a4859b855e37239f652bf14b1ecd1029b8c4e), [`9257233`](https://github.com/mastra-ai/mastra/commit/9257233c4ffce09b2bedc2a9adbd70d7a83fa8e2), [`7620d2b`](https://github.com/mastra-ai/mastra/commit/7620d2bddeb4fae4c3c0a0b4e672969795fca11a), [`b2365f0`](https://github.com/mastra-ai/mastra/commit/b2365f038dd4c5f06400428b224af963f399ad50), [`0f1a4c9`](https://github.com/mastra-ai/mastra/commit/0f1a4c984fb4b104b2f0b63ba18c9fa77f567700), [`9029ba3`](https://github.com/mastra-ai/mastra/commit/9029ba34459c8859fed4c6b73efd8e2d0021e7ba), [`426cc56`](https://github.com/mastra-ai/mastra/commit/426cc561c85ae76a112ded2385532a91f9f9f074), [`00931fb`](https://github.com/mastra-ai/mastra/commit/00931fb1a21aa42c4fbc20c2c40dd62466b8fc8f), [`e473bfe`](https://github.com/mastra-ai/mastra/commit/e473bfe416c0b8e876973c2b6a6f13c394b7a93f), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`8ea07b4`](https://github.com/mastra-ai/mastra/commit/8ea07b4bdc73e4218437dbb6dcb0f4b23e745a44), [`084afad`](https://github.com/mastra-ai/mastra/commit/084afadff49b168d8b6104b43c77cecc96c48ac2), [`2db6160`](https://github.com/mastra-ai/mastra/commit/2db6160e2022ff8827c15d30157e684683b934b5), [`8aeea37`](https://github.com/mastra-ai/mastra/commit/8aeea37efdde347c635a67fed56794943b7f74ec), [`02fe153`](https://github.com/mastra-ai/mastra/commit/02fe15351d6021d214da48ec982a0e9e4150bcee), [`648e2ca`](https://github.com/mastra-ai/mastra/commit/648e2ca42da54838c6ccbdaadc6fadd808fa6b86), [`74567b3`](https://github.com/mastra-ai/mastra/commit/74567b3d237ae3915cd0bca3cf55fa0a64e4e4a4), [`b65c5e0`](https://github.com/mastra-ai/mastra/commit/b65c5e0fe6f3c390a9a8bbcf69304d972c3a4afb), [`15a1733`](https://github.com/mastra-ai/mastra/commit/15a1733074cee8bd37370e1af34cd818e89fa7ac), [`fc2a774`](https://github.com/mastra-ai/mastra/commit/fc2a77468981aaddc3e77f83f0c4ad4a4af140da), [`4e08933`](https://github.com/mastra-ai/mastra/commit/4e08933625464dfde178347af5b6278fcf34188e), [`10188d6`](https://github.com/mastra-ai/mastra/commit/10188d632a729010441f9c7e2a41eab60afccb23)]:
499
- - @mastra/deployer@0.22.0
500
- - @mastra/core@0.22.0
501
-
502
- ... 6543 more lines hidden. See full changelog in package directory.
502
+ ... 6577 more lines hidden. See full changelog in package directory.
@@ -5,7 +5,21 @@ description: "Learn how to migrate CLI changes when upgrading to v1."
5
5
 
6
6
  # CLI
7
7
 
8
- The CLI has been simplified by removing deployment commands, configuration flags, and starter files.
8
+ The CLI has been simplified by removing deployment commands, configuration flags, and starter files. A new migration command has been added to help with database schema upgrades.
9
+
10
+ ## Added
11
+
12
+ ### `mastra migrate` command
13
+
14
+ A new `mastra migrate` command helps run database migrations when upgrading Mastra versions. This is particularly useful when upgrading from older versions that may have data incompatibilities.
15
+
16
+ ```bash
17
+ npx mastra migrate
18
+ ```
19
+
20
+ The command bundles your project, connects to your configured storage, and runs any necessary migrations. Currently supports migrating duplicate spans entries that may prevent unique constraint creation.
21
+
22
+ See the [Storage migration guide](/guides/v1/migrations/upgrade-to-v1/storage#duplicate-spans-migration) for details on when this migration is needed.
9
23
 
10
24
  ## Removed
11
25
 
@@ -30,6 +30,60 @@ UPDATE mastra_scorers SET "requestContext" = "runtimeContext" WHERE "runtimeCont
30
30
  ALTER TABLE mastra_scorers DROP COLUMN "runtimeContext";
31
31
  ```
32
32
 
33
+ ### Duplicate spans migration
34
+
35
+ If you're upgrading from an older version of Mastra, you may have duplicate `(traceId, spanId)` entries in your `mastra_spans` table. V1 adds a unique constraint on these columns to ensure data integrity, but this constraint cannot be added if duplicates exist.
36
+
37
+ :::note[Who needs this migration]
38
+ Only if you have existing spans data from Mastra versions prior to v1 and encounter errors about duplicate key violations or constraint creation failures.
39
+ :::
40
+
41
+ :::important[What breaks without it]
42
+ The storage initialization may fail when trying to add the unique constraint, or you may see errors like "duplicate key value violates unique constraint".
43
+ :::
44
+
45
+ **Option 1: Use the CLI (Recommended)**
46
+
47
+ Run the migration command which automatically deduplicates spans and adds the constraint:
48
+
49
+ ```bash
50
+ npx mastra migrate
51
+ ```
52
+
53
+ The CLI bundles your project, connects to your configured storage, and runs the migration. It keeps the most complete record (based on `endTime` and attributes) when removing duplicates.
54
+
55
+ **Option 2: Manual SQL (PostgreSQL)**
56
+
57
+ If you prefer to run the migration manually:
58
+
59
+ ```sql
60
+ -- Remove duplicates, keeping the most complete record
61
+ DELETE FROM mastra_spans a USING mastra_spans b
62
+ WHERE a.ctid < b.ctid
63
+ AND a."traceId" = b."traceId"
64
+ AND a."spanId" = b."spanId";
65
+
66
+ -- Add the unique constraint
67
+ ALTER TABLE mastra_spans ADD CONSTRAINT mastra_spans_trace_span_unique UNIQUE ("traceId", "spanId");
68
+ ```
69
+
70
+ **Option 3: Manual migration (Other databases)**
71
+
72
+ For ClickHouse, LibSQL, MongoDB, or MSSQL, use the programmatic API:
73
+
74
+ ```typescript
75
+ const storage = mastra.getStorage();
76
+ const observabilityStore = await storage.getStore('observability');
77
+
78
+ // Check if migration is needed
79
+ const status = await observabilityStore?.checkSpansMigrationStatus();
80
+ console.log(status);
81
+
82
+ // Run the migration
83
+ const result = await observabilityStore?.migrateSpans();
84
+ console.log(result);
85
+ ```
86
+
33
87
  ### JSON columns (TEXT → JSONB)
34
88
 
35
89
  **PostgreSQL only.** The `metadata` column in `mastra_threads` and `snapshot` column in `mastra_workflow_snapshot` changed from TEXT to JSONB.
@@ -50,19 +104,19 @@ USING snapshot::jsonb;
50
104
 
51
105
  ## Added
52
106
 
53
- ### Storage composition in MastraStorage
107
+ ### Storage composition in MastraCompositeStore
54
108
 
55
- `MastraStorage` can now compose storage domains from different adapters. Use it when you need different databases for different purposes - for example, PostgreSQL for memory and workflows, but a specialized database for observability.
109
+ `MastraCompositeStore` can now compose storage domains from different adapters. Use it when you need different databases for different purposes - for example, PostgreSQL for memory and workflows, but a specialized database for observability.
56
110
 
57
111
  ```typescript
58
- import { MastraStorage } from "@mastra/core/storage";
112
+ import { MastraCompositeStore } from "@mastra/core/storage";
59
113
  import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
60
114
  import { MemoryLibSQL } from "@mastra/libsql";
61
115
  import { Mastra } from "@mastra/core";
62
116
 
63
117
  // Compose domains from different stores
64
118
  const mastra = new Mastra({
65
- storage: new MastraStorage({
119
+ storage: new MastraCompositeStore({
66
120
  id: "composite",
67
121
  domains: {
68
122
  memory: new MemoryLibSQL({ url: "file:./local.db" }),
@@ -77,6 +131,36 @@ See the [Storage Composition reference](/reference/v1/storage/composite) for mor
77
131
 
78
132
  ## Changed
79
133
 
134
+ ### `MastraStorage` renamed to `MastraCompositeStore`
135
+
136
+ The `MastraStorage` class has been renamed to `MastraCompositeStore` to better reflect its role as a composite storage implementation that routes different domains to different underlying stores. This avoids confusion with the general "Mastra Storage" concept (the `storage` property on the Mastra instance).
137
+
138
+ The old `MastraStorage` name remains available as a deprecated alias for backward compatibility, but will be removed in a future version.
139
+
140
+ To migrate, update your imports and instantiation:
141
+
142
+ ```diff
143
+ - import { MastraStorage } from "@mastra/core/storage";
144
+ + import { MastraCompositeStore } from "@mastra/core/storage";
145
+ import { MemoryLibSQL } from "@mastra/libsql";
146
+ import { WorkflowsPG } from "@mastra/pg";
147
+
148
+ export const mastra = new Mastra({
149
+ - storage: new MastraStorage({
150
+ + storage: new MastraCompositeStore({
151
+ id: "composite",
152
+ domains: {
153
+ memory: new MemoryLibSQL({ url: "file:./memory.db" }),
154
+ workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
155
+ },
156
+ }),
157
+ });
158
+ ```
159
+
160
+ :::note
161
+ If you're using a single store implementation (like `PostgresStore` or `LibSQLStore`) directly, no changes are needed. This only affects code that explicitly uses `MastraStorage` for composite storage.
162
+ :::
163
+
80
164
  ### Required `id` property for storage instances
81
165
 
82
166
  Storage instances now require an `id` property. This unique identifier is used for tracking and managing storage instances within Mastra. The `id` should be a descriptive, unique string for each storage instance in your application.
@@ -74,17 +74,17 @@ This is useful when all primitives share the same storage backend and have simil
74
74
 
75
75
  #### Composite storage
76
76
 
77
- Add storage to your Mastra instance using `MastraStorage` and configure individual storage domains to use different storage providers.
77
+ Add storage to your Mastra instance using `MastraCompositeStore` and configure individual storage domains to use different storage providers.
78
78
 
79
79
  ```typescript title="src/mastra/index.ts"
80
80
  import { Mastra } from "@mastra/core";
81
- import { MastraStorage } from "@mastra/core/storage";
81
+ import { MastraCompositeStore } from "@mastra/core/storage";
82
82
  import { MemoryLibSQL } from "@mastra/libsql";
83
83
  import { WorkflowsPG } from "@mastra/pg";
84
84
  import { ObservabilityStorageClickhouse } from "@mastra/clickhouse";
85
85
 
86
86
  export const mastra = new Mastra({
87
- storage: new MastraStorage({
87
+ storage: new MastraCompositeStore({
88
88
  id: "composite",
89
89
  domains: {
90
90
  memory: new MemoryLibSQL({ url: "file:./memory.db" }),