@mastra/mcp-docs-server 1.0.0-beta.15 → 1.0.0-beta.16
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/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +40 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +166 -166
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Flance.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Freact.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +41 -41
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +27 -0
- package/.docs/raw/reference/client-js/workflows.mdx +15 -0
- package/.docs/raw/reference/storage/composite.mdx +223 -0
- package/.docs/raw/reference/tools/mcp-server.mdx +9 -0
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +51 -3
- package/.docs/raw/reference/workflows/run.mdx +8 -2
- package/CHANGELOG.md +8 -0
- package/package.json +5 -5
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/react-hooks
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6cbb549`](https://github.com/mastra-ai/mastra/commit/6cbb549475201a2fbf158f0fd7323f6495f46d08)]:
|
|
8
|
+
- @mastra/client-js@1.0.0-beta.16
|
|
9
|
+
|
|
3
10
|
## 0.1.0-beta.15
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -492,11 +499,4 @@
|
|
|
492
499
|
|
|
493
500
|
- Convert WorkflowWatchResult to WorkflowResult in workflow graph ([#8541](https://github.com/mastra-ai/mastra/pull/8541))
|
|
494
501
|
|
|
495
|
-
|
|
496
|
-
- @mastra/client-js@0.15.1-alpha.1
|
|
497
|
-
|
|
498
|
-
## 0.0.4-alpha.0
|
|
499
|
-
|
|
500
|
-
### Patch Changes
|
|
501
|
-
|
|
502
|
-
... 72 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 79 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix workflow observability view broken by invalid entityType parameter ([#11427](https://github.com/mastra-ai/mastra/pull/11427))
|
|
8
|
+
|
|
9
|
+
The UI workflow observability view was failing with a Zod validation error when trying to filter traces by workflow. The UI was sending `entityType=workflow`, but the backend's `EntityType` enum only accepts `workflow_run`.
|
|
10
|
+
|
|
11
|
+
**Root Cause**: The legacy value transformation was happening in the handler (after validation), but Zod validation occurred earlier in the request pipeline, rejecting the request before it could be transformed.
|
|
12
|
+
|
|
13
|
+
**Solution**:
|
|
14
|
+
- Added `z.preprocess()` to the query schema to transform `workflow` → `workflow_run` before validation
|
|
15
|
+
- Kept handler transformation for defense in depth
|
|
16
|
+
- Updated UI to use `EntityType.WORKFLOW_RUN` enum value for type safety
|
|
17
|
+
|
|
18
|
+
This maintains backward compatibility with legacy clients while fixing the validation error.
|
|
19
|
+
|
|
20
|
+
Fixes #11412
|
|
21
|
+
|
|
22
|
+
- Add storage composition to MastraStorage ([#11401](https://github.com/mastra-ai/mastra/pull/11401))
|
|
23
|
+
|
|
24
|
+
`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 different database for observability.
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
28
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from '@mastra/pg';
|
|
29
|
+
import { MemoryLibSQL } from '@mastra/libsql';
|
|
30
|
+
|
|
31
|
+
// Compose domains from different stores
|
|
32
|
+
const storage = new MastraStorage({
|
|
33
|
+
id: 'composite',
|
|
34
|
+
domains: {
|
|
35
|
+
memory: new MemoryLibSQL({ url: 'file:./local.db' }),
|
|
36
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
37
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Breaking changes:**
|
|
43
|
+
- `storage.supports` property no longer exists
|
|
44
|
+
- `StorageSupports` type is no longer exported from `@mastra/core/storage`
|
|
45
|
+
|
|
46
|
+
All stores now support the same features. For domain availability, use `getStore()`:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const store = await storage.getStore('memory');
|
|
50
|
+
if (store) {
|
|
51
|
+
// domain is available
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [[`3d93a15`](https://github.com/mastra-ai/mastra/commit/3d93a15796b158c617461c8b98bede476ebb43e2), [`efe406a`](https://github.com/mastra-ai/mastra/commit/efe406a1353c24993280ebc2ed61dd9f65b84b26), [`119e5c6`](https://github.com/mastra-ai/mastra/commit/119e5c65008f3e5cfca954eefc2eb85e3bf40da4), [`74e504a`](https://github.com/mastra-ai/mastra/commit/74e504a3b584eafd2f198001c6a113bbec589fd3), [`e33fdbd`](https://github.com/mastra-ai/mastra/commit/e33fdbd07b33920d81e823122331b0c0bee0bb59), [`929f69c`](https://github.com/mastra-ai/mastra/commit/929f69c3436fa20dd0f0e2f7ebe8270bd82a1529), [`8a73529`](https://github.com/mastra-ai/mastra/commit/8a73529ca01187f604b1f3019d0a725ac63ae55f)]:
|
|
56
|
+
- @mastra/core@1.0.0-beta.16
|
|
57
|
+
|
|
3
58
|
## 1.0.0-beta.15
|
|
4
59
|
|
|
5
60
|
### Minor Changes
|
|
@@ -444,59 +499,4 @@
|
|
|
444
499
|
|
|
445
500
|
- Allow direct access to server app handle directly from Mastra instance. ([#10598](https://github.com/mastra-ai/mastra/pull/10598))
|
|
446
501
|
|
|
447
|
-
|
|
448
|
-
// Before: HTTP request to localhost
|
|
449
|
-
const response = await fetch(`http://localhost:5000/api/tools`);
|
|
450
|
-
|
|
451
|
-
// After: Direct call via app.fetch()
|
|
452
|
-
const app = mastra.getServerApp<Hono>();
|
|
453
|
-
const response = await app.fetch(new Request('http://internal/api/tools'));
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
- Added `mastra.getServerApp<T>()` to access the underlying Hono/Express app
|
|
457
|
-
- Added `mastra.getMastraServer()` and `mastra.setMastraServer()` for adapter access
|
|
458
|
-
- Added `MastraServerBase` class in `@mastra/core/server` for adapter implementations
|
|
459
|
-
- Server adapters now auto-register with Mastra in their constructor
|
|
460
|
-
|
|
461
|
-
- fix(a2a): fix streaming and memory support for A2A protocol ([#10653](https://github.com/mastra-ai/mastra/pull/10653))
|
|
462
|
-
|
|
463
|
-
**Client (`@mastra/client-js`):**
|
|
464
|
-
- Fixed `sendStreamingMessage` to properly return a streaming response instead of attempting to parse it as JSON
|
|
465
|
-
|
|
466
|
-
**Server (`@mastra/server`):**
|
|
467
|
-
- Fixed A2A message handler to pass `contextId` as `threadId` for memory persistence across conversations
|
|
468
|
-
- Added support for user-provided `resourceId` via `params.metadata.resourceId` or `message.metadata.resourceId`, falling back to `agentId`
|
|
469
|
-
|
|
470
|
-
- Add stream data redaction to prevent sensitive information leaks in agent stream API responses. ([#10705](https://github.com/mastra-ai/mastra/pull/10705))
|
|
471
|
-
|
|
472
|
-
The `stream` API endpoint now automatically redacts `request` data from stream chunks (`step-start`, `step-finish`, `finish`) which could contain system prompts, tool definitions, and API keys. Redaction is enabled by default and can be disabled for debugging/internal services via `streamOptions.redact`.
|
|
473
|
-
|
|
474
|
-
- Updated dependencies [[`ac0d2f4`](https://github.com/mastra-ai/mastra/commit/ac0d2f4ff8831f72c1c66c2be809706d17f65789), [`1a0d3fc`](https://github.com/mastra-ai/mastra/commit/1a0d3fc811482c9c376cdf79ee615c23bae9b2d6), [`85a628b`](https://github.com/mastra-ai/mastra/commit/85a628b1224a8f64cd82ea7f033774bf22df7a7e), [`c237233`](https://github.com/mastra-ai/mastra/commit/c23723399ccedf7f5744b3f40997b79246bfbe64), [`15f9e21`](https://github.com/mastra-ai/mastra/commit/15f9e216177201ea6e3f6d0bfb063fcc0953444f), [`ff94dea`](https://github.com/mastra-ai/mastra/commit/ff94dea935f4e34545c63bcb6c29804732698809), [`5b2ff46`](https://github.com/mastra-ai/mastra/commit/5b2ff4651df70c146523a7fca773f8eb0a2272f8), [`db41688`](https://github.com/mastra-ai/mastra/commit/db4168806d007417e2e60b4f68656dca4e5f40c9), [`5ca599d`](https://github.com/mastra-ai/mastra/commit/5ca599d0bb59a1595f19f58473fcd67cc71cef58), [`bff1145`](https://github.com/mastra-ai/mastra/commit/bff114556b3cbadad9b2768488708f8ad0e91475), [`5c8ca24`](https://github.com/mastra-ai/mastra/commit/5c8ca247094e0cc2cdbd7137822fb47241f86e77), [`e191844`](https://github.com/mastra-ai/mastra/commit/e1918444ca3f80e82feef1dad506cd4ec6e2875f), [`22553f1`](https://github.com/mastra-ai/mastra/commit/22553f11c63ee5e966a9c034a349822249584691), [`7237163`](https://github.com/mastra-ai/mastra/commit/72371635dbf96a87df4b073cc48fc655afbdce3d), [`2500740`](https://github.com/mastra-ai/mastra/commit/2500740ea23da067d6e50ec71c625ab3ce275e64), [`873ecbb`](https://github.com/mastra-ai/mastra/commit/873ecbb517586aa17d2f1e99283755b3ebb2863f), [`4f9bbe5`](https://github.com/mastra-ai/mastra/commit/4f9bbe5968f42c86f4930b8193de3c3c17e5bd36), [`02e51fe`](https://github.com/mastra-ai/mastra/commit/02e51feddb3d4155cfbcc42624fd0d0970d032c0), [`8f3fa3a`](https://github.com/mastra-ai/mastra/commit/8f3fa3a652bb77da092f913ec51ae46e3a7e27dc), [`cd29ad2`](https://github.com/mastra-ai/mastra/commit/cd29ad23a255534e8191f249593849ed29160886), [`bdf4d8c`](https://github.com/mastra-ai/mastra/commit/bdf4d8cdc656d8a2c21d81834bfa3bfa70f56c16), [`854e3da`](https://github.com/mastra-ai/mastra/commit/854e3dad5daac17a91a20986399d3a51f54bf68b), [`ce18d38`](https://github.com/mastra-ai/mastra/commit/ce18d38678c65870350d123955014a8432075fd9), [`cccf9c8`](https://github.com/mastra-ai/mastra/commit/cccf9c8b2d2dfc1a5e63919395b83d78c89682a0), [`61a5705`](https://github.com/mastra-ai/mastra/commit/61a570551278b6743e64243b3ce7d73de915ca8a), [`db70a48`](https://github.com/mastra-ai/mastra/commit/db70a48aeeeeb8e5f92007e8ede52c364ce15287), [`f0fdc14`](https://github.com/mastra-ai/mastra/commit/f0fdc14ee233d619266b3d2bbdeea7d25cfc6d13), [`db18bc9`](https://github.com/mastra-ai/mastra/commit/db18bc9c3825e2c1a0ad9a183cc9935f6691bfa1), [`9b37b56`](https://github.com/mastra-ai/mastra/commit/9b37b565e1f2a76c24f728945cc740c2b09be9da), [`41a23c3`](https://github.com/mastra-ai/mastra/commit/41a23c32f9877d71810f37e24930515df2ff7a0f), [`5d171ad`](https://github.com/mastra-ai/mastra/commit/5d171ad9ef340387276b77c2bb3e83e83332d729), [`f03ae60`](https://github.com/mastra-ai/mastra/commit/f03ae60500fe350c9d828621006cdafe1975fdd8), [`d1e74a0`](https://github.com/mastra-ai/mastra/commit/d1e74a0a293866dece31022047f5dbab65a304d0), [`39e7869`](https://github.com/mastra-ai/mastra/commit/39e7869bc7d0ee391077ce291474d8a84eedccff), [`5761926`](https://github.com/mastra-ai/mastra/commit/57619260c4a2cdd598763abbacd90de594c6bc76), [`c900fdd`](https://github.com/mastra-ai/mastra/commit/c900fdd504c41348efdffb205cfe80d48c38fa33), [`604a79f`](https://github.com/mastra-ai/mastra/commit/604a79fecf276e26a54a3fe01bb94e65315d2e0e), [`887f0b4`](https://github.com/mastra-ai/mastra/commit/887f0b4746cdbd7cb7d6b17ac9f82aeb58037ea5), [`2562143`](https://github.com/mastra-ai/mastra/commit/256214336b4faa78646c9c1776612393790d8784), [`ef11a61`](https://github.com/mastra-ai/mastra/commit/ef11a61920fa0ed08a5b7ceedd192875af119749)]:
|
|
475
|
-
- @mastra/core@1.0.0-beta.6
|
|
476
|
-
|
|
477
|
-
## 1.0.0-beta.5
|
|
478
|
-
|
|
479
|
-
### Patch Changes
|
|
480
|
-
|
|
481
|
-
- Extract routing from @deployer/server into server adapter packages. ([#10263](https://github.com/mastra-ai/mastra/pull/10263))
|
|
482
|
-
New packages:
|
|
483
|
-
- @mastra/express
|
|
484
|
-
- @mastra/hono
|
|
485
|
-
|
|
486
|
-
These packages support mastra server routes on express and hono respectively.
|
|
487
|
-
Better abstractions will be built on top of these packages in the near future, enabling users to easily attach mastra routes to any existing server framework.
|
|
488
|
-
|
|
489
|
-
- Add timeTravel APIs and add timeTravel feature to studio ([#10361](https://github.com/mastra-ai/mastra/pull/10361))
|
|
490
|
-
|
|
491
|
-
- Fixed server handler bugs: filter parsing now handles colons in values (timestamps, URLs), dateRange validation now converts JSON strings to Date objects, deleteMessages schema accepts object forms, and added missing responseSchema for legacy stream route ([#10362](https://github.com/mastra-ai/mastra/pull/10362))
|
|
492
|
-
|
|
493
|
-
- Updated dependencies [[`21a15de`](https://github.com/mastra-ai/mastra/commit/21a15de369fe82aac26bb642ed7be73505475e8b), [`feb7ee4`](https://github.com/mastra-ai/mastra/commit/feb7ee4d09a75edb46c6669a3beaceec78811747), [`b0e2ea5`](https://github.com/mastra-ai/mastra/commit/b0e2ea5b52c40fae438b9e2f7baee6f0f89c5442), [`c456e01`](https://github.com/mastra-ai/mastra/commit/c456e0149e3c176afcefdbd9bb1d2c5917723725), [`ab035c2`](https://github.com/mastra-ai/mastra/commit/ab035c2ef6d8cc7bb25f06f1a38508bd9e6f126b), [`1a46a56`](https://github.com/mastra-ai/mastra/commit/1a46a566f45a3fcbadc1cf36bf86d351f264bfa3), [`3cf540b`](https://github.com/mastra-ai/mastra/commit/3cf540b9fbfea8f4fc8d3a2319a4e6c0b0cbfd52), [`1c6ce51`](https://github.com/mastra-ai/mastra/commit/1c6ce51f875915ab57fd36873623013699a2a65d), [`898a972`](https://github.com/mastra-ai/mastra/commit/898a9727d286c2510d6b702dfd367e6aaf5c6b0f), [`a97003a`](https://github.com/mastra-ai/mastra/commit/a97003aa1cf2f4022a41912324a1e77263b326b8), [`ccc141e`](https://github.com/mastra-ai/mastra/commit/ccc141ed27da0abc3a3fc28e9e5128152e8e37f4), [`fe3b897`](https://github.com/mastra-ai/mastra/commit/fe3b897c2ccbcd2b10e81b099438c7337feddf89), [`00123ba`](https://github.com/mastra-ai/mastra/commit/00123ba96dc9e5cd0b110420ebdba56d8f237b25), [`29c4309`](https://github.com/mastra-ai/mastra/commit/29c4309f818b24304c041bcb4a8f19b5f13f6b62), [`16785ce`](https://github.com/mastra-ai/mastra/commit/16785ced928f6f22638f4488cf8a125d99211799), [`de8239b`](https://github.com/mastra-ai/mastra/commit/de8239bdcb1d8c0cfa06da21f1569912a66bbc8a), [`b5e6cd7`](https://github.com/mastra-ai/mastra/commit/b5e6cd77fc8c8e64e0494c1d06cee3d84e795d1e), [`3759cb0`](https://github.com/mastra-ai/mastra/commit/3759cb064935b5f74c65ac2f52a1145f7352899d), [`651e772`](https://github.com/mastra-ai/mastra/commit/651e772eb1475fb13e126d3fcc01751297a88214), [`b61b93f`](https://github.com/mastra-ai/mastra/commit/b61b93f9e058b11dd2eec169853175d31dbdd567), [`bae33d9`](https://github.com/mastra-ai/mastra/commit/bae33d91a63fbb64d1e80519e1fc1acaed1e9013), [`c0b731f`](https://github.com/mastra-ai/mastra/commit/c0b731fb27d712dc8582e846df5c0332a6a0c5ba), [`43ca8f2`](https://github.com/mastra-ai/mastra/commit/43ca8f2c7334851cc7b4d3d2f037d8784bfbdd5f), [`2ca67cc`](https://github.com/mastra-ai/mastra/commit/2ca67cc3bb1f6a617353fdcab197d9efebe60d6f), [`9e67002`](https://github.com/mastra-ai/mastra/commit/9e67002b52c9be19936c420a489dbee9c5fd6a78), [`35edc49`](https://github.com/mastra-ai/mastra/commit/35edc49ac0556db609189641d6341e76771b81fc)]:
|
|
494
|
-
- @mastra/core@1.0.0-beta.5
|
|
495
|
-
|
|
496
|
-
## 1.0.0-beta.4
|
|
497
|
-
|
|
498
|
-
### Patch Changes
|
|
499
|
-
|
|
500
|
-
- Network handler now accesses thread and resource parameters from the nested memory object instead of directly from request body. ([#10294](https://github.com/mastra-ai/mastra/pull/10294))
|
|
501
|
-
|
|
502
|
-
... 4534 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 4589 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @mastra/upstash
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add storage composition to MastraStorage ([#11401](https://github.com/mastra-ai/mastra/pull/11401))
|
|
8
|
+
|
|
9
|
+
`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 different database for observability.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
13
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from '@mastra/pg';
|
|
14
|
+
import { MemoryLibSQL } from '@mastra/libsql';
|
|
15
|
+
|
|
16
|
+
// Compose domains from different stores
|
|
17
|
+
const storage = new MastraStorage({
|
|
18
|
+
id: 'composite',
|
|
19
|
+
domains: {
|
|
20
|
+
memory: new MemoryLibSQL({ url: 'file:./local.db' }),
|
|
21
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
22
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Breaking changes:**
|
|
28
|
+
- `storage.supports` property no longer exists
|
|
29
|
+
- `StorageSupports` type is no longer exported from `@mastra/core/storage`
|
|
30
|
+
|
|
31
|
+
All stores now support the same features. For domain availability, use `getStore()`:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
const store = await storage.getStore('memory');
|
|
35
|
+
if (store) {
|
|
36
|
+
// domain is available
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [[`3d93a15`](https://github.com/mastra-ai/mastra/commit/3d93a15796b158c617461c8b98bede476ebb43e2), [`efe406a`](https://github.com/mastra-ai/mastra/commit/efe406a1353c24993280ebc2ed61dd9f65b84b26), [`119e5c6`](https://github.com/mastra-ai/mastra/commit/119e5c65008f3e5cfca954eefc2eb85e3bf40da4), [`74e504a`](https://github.com/mastra-ai/mastra/commit/74e504a3b584eafd2f198001c6a113bbec589fd3), [`e33fdbd`](https://github.com/mastra-ai/mastra/commit/e33fdbd07b33920d81e823122331b0c0bee0bb59), [`929f69c`](https://github.com/mastra-ai/mastra/commit/929f69c3436fa20dd0f0e2f7ebe8270bd82a1529), [`8a73529`](https://github.com/mastra-ai/mastra/commit/8a73529ca01187f604b1f3019d0a725ac63ae55f)]:
|
|
41
|
+
- @mastra/core@1.0.0-beta.16
|
|
42
|
+
|
|
3
43
|
## 1.0.0-beta.8
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
|
@@ -458,45 +498,5 @@
|
|
|
458
498
|
|
|
459
499
|
- Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
|
|
460
500
|
|
|
461
|
-
- Add new list methods to storage API: `listMessages`, `listMessagesById`, `listThreadsByResourceId`, and `listWorkflowRuns`. Most methods are currently wrappers around existing methods. Full implementations will be added when migrating away from legacy methods. ([#9489](https://github.com/mastra-ai/mastra/pull/9489))
|
|
462
|
-
|
|
463
|
-
- Rename RuntimeContext to RequestContext ([#9511](https://github.com/mastra-ai/mastra/pull/9511))
|
|
464
|
-
|
|
465
|
-
- Implement listMessages API for replacing previous methods ([#9531](https://github.com/mastra-ai/mastra/pull/9531))
|
|
466
|
-
|
|
467
|
-
- Remove `getThreadsByResourceId` and `getThreadsByResourceIdPaginated` methods from storage interfaces in favor of `listThreadsByResourceId`. The new method uses `offset`/`limit` pagination and a nested `orderBy` object structure (`{ field, direction }`). ([#9536](https://github.com/mastra-ai/mastra/pull/9536))
|
|
468
|
-
|
|
469
|
-
- Remove `getMessagesById` method from storage interfaces in favor of `listMessagesById`. The new method only returns V2-format messages and removes the format parameter, simplifying the API surface. Users should migrate from `getMessagesById({ messageIds, format })` to `listMessagesById({ messageIds })`. ([#9534](https://github.com/mastra-ai/mastra/pull/9534))
|
|
470
|
-
|
|
471
|
-
- **BREAKING CHANGE**: Pagination APIs now use `page`/`perPage` instead of `offset`/`limit` ([#9592](https://github.com/mastra-ai/mastra/pull/9592))
|
|
472
|
-
|
|
473
|
-
All storage and memory pagination APIs have been updated to use `page` (0-indexed) and `perPage` instead of `offset` and `limit`, aligning with standard REST API patterns.
|
|
474
|
-
|
|
475
|
-
**Affected APIs:**
|
|
476
|
-
- `Memory.listThreadsByResourceId()`
|
|
477
|
-
- `Memory.listMessages()`
|
|
478
|
-
- `Storage.listWorkflowRuns()`
|
|
479
|
-
|
|
480
|
-
**Migration:**
|
|
481
|
-
|
|
482
|
-
```typescript
|
|
483
|
-
// Before
|
|
484
|
-
await memory.listThreadsByResourceId({
|
|
485
|
-
resourceId: 'user-123',
|
|
486
|
-
offset: 20,
|
|
487
|
-
limit: 10,
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
// After
|
|
491
|
-
await memory.listThreadsByResourceId({
|
|
492
|
-
resourceId: 'user-123',
|
|
493
|
-
page: 2, // page = Math.floor(offset / limit)
|
|
494
|
-
perPage: 10,
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
// Before
|
|
498
|
-
await memory.listMessages({
|
|
499
|
-
threadId: 'thread-456',
|
|
500
|
-
offset: 20,
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 2583 more lines hidden. See full changelog in package directory.
|
|
@@ -7,6 +7,33 @@ description: "Learn how to migrate storage-related changes when upgrading to v1.
|
|
|
7
7
|
|
|
8
8
|
Storage APIs have been standardized with consistent pagination and naming patterns across all methods.
|
|
9
9
|
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
### Storage composition in MastraStorage
|
|
13
|
+
|
|
14
|
+
`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.
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { MastraStorage } from "@mastra/core/storage";
|
|
18
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
19
|
+
import { MemoryLibSQL } from "@mastra/libsql";
|
|
20
|
+
import { Mastra } from "@mastra/core";
|
|
21
|
+
|
|
22
|
+
// Compose domains from different stores
|
|
23
|
+
const mastra = new Mastra({
|
|
24
|
+
storage: new MastraStorage({
|
|
25
|
+
id: "composite",
|
|
26
|
+
domains: {
|
|
27
|
+
memory: new MemoryLibSQL({ url: "file:./local.db" }),
|
|
28
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
29
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
See the [Storage Composition reference](/reference/v1/storage/composite) for more details.
|
|
36
|
+
|
|
10
37
|
## Changed
|
|
11
38
|
|
|
12
39
|
### Required `id` property for storage instances
|
|
@@ -145,6 +145,21 @@ await run.resume({
|
|
|
145
145
|
});
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
### cancel()
|
|
149
|
+
|
|
150
|
+
Cancel a running workflow:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
const run = await workflow.createRun({ runId: existingRunId });
|
|
154
|
+
|
|
155
|
+
const result = await run.cancel();
|
|
156
|
+
// Returns: { message: 'Workflow run canceled' }
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
This method stops any running steps and prevents subsequent steps from executing. Steps that check the `abortSignal` parameter can respond to cancellation by cleaning up resources (timeouts, network requests, etc.).
|
|
160
|
+
|
|
161
|
+
See the [Run.cancel()](/reference/v1/workflows/run-methods/cancel) reference for detailed information about how cancellation works and how to write steps that respond to cancellation.
|
|
162
|
+
|
|
148
163
|
### stream()
|
|
149
164
|
|
|
150
165
|
Stream workflow execution for real-time updates:
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Storage Composition | Storage"
|
|
3
|
+
description: Documentation for combining multiple storage backends in Mastra.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Storage Composition
|
|
7
|
+
|
|
8
|
+
MastraStorage can compose storage domains from different adapters. Use it when you need different databases for different purposes. For example, use LibSQL for memory and PostgreSQL for workflows.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
MastraStorage is included in `@mastra/core`:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @mastra/core@beta
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
You'll also need to install the storage adapters you want to compose:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @mastra/pg@beta @mastra/libsql@beta
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Basic composition
|
|
27
|
+
|
|
28
|
+
Import domain classes directly from each store package and compose them:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { MastraStorage } from "@mastra/core/storage";
|
|
32
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
33
|
+
import { MemoryLibSQL } from "@mastra/libsql";
|
|
34
|
+
import { Mastra } from "@mastra/core";
|
|
35
|
+
|
|
36
|
+
const mastra = new Mastra({
|
|
37
|
+
storage: new MastraStorage({
|
|
38
|
+
id: "composite",
|
|
39
|
+
domains: {
|
|
40
|
+
memory: new MemoryLibSQL({ url: "file:./local.db" }),
|
|
41
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
42
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### With a default storage
|
|
49
|
+
|
|
50
|
+
Use `default` to specify a fallback storage, then override specific domains:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { MastraStorage } from "@mastra/core/storage";
|
|
54
|
+
import { PostgresStore } from "@mastra/pg";
|
|
55
|
+
import { MemoryLibSQL } from "@mastra/libsql";
|
|
56
|
+
import { Mastra } from "@mastra/core";
|
|
57
|
+
|
|
58
|
+
const pgStore = new PostgresStore({
|
|
59
|
+
id: "pg",
|
|
60
|
+
connectionString: process.env.DATABASE_URL,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const mastra = new Mastra({
|
|
64
|
+
storage: new MastraStorage({
|
|
65
|
+
id: "composite",
|
|
66
|
+
default: pgStore,
|
|
67
|
+
domains: {
|
|
68
|
+
memory: new MemoryLibSQL({ url: "file:./local.db" }),
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Options
|
|
75
|
+
|
|
76
|
+
<PropertiesTable
|
|
77
|
+
content={[
|
|
78
|
+
{
|
|
79
|
+
name: "id",
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "Unique identifier for this storage instance.",
|
|
82
|
+
isOptional: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "default",
|
|
86
|
+
type: "MastraStorage",
|
|
87
|
+
description:
|
|
88
|
+
"Default storage adapter. Domains not explicitly specified in `domains` will use this storage's domains as fallbacks.",
|
|
89
|
+
isOptional: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "domains",
|
|
93
|
+
type: "object",
|
|
94
|
+
description:
|
|
95
|
+
"Individual domain overrides. Each domain can come from a different storage adapter. These take precedence over the default storage.",
|
|
96
|
+
isOptional: true,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "domains.memory",
|
|
100
|
+
type: "MemoryStorage",
|
|
101
|
+
description: "Storage for threads, messages, and resources.",
|
|
102
|
+
isOptional: true,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "domains.workflows",
|
|
106
|
+
type: "WorkflowsStorage",
|
|
107
|
+
description: "Storage for workflow snapshots.",
|
|
108
|
+
isOptional: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "domains.scores",
|
|
112
|
+
type: "ScoresStorage",
|
|
113
|
+
description: "Storage for evaluation scores.",
|
|
114
|
+
isOptional: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "domains.observability",
|
|
118
|
+
type: "ObservabilityStorage",
|
|
119
|
+
description: "Storage for traces and spans.",
|
|
120
|
+
isOptional: true,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "domains.agents",
|
|
124
|
+
type: "AgentsStorage",
|
|
125
|
+
description: "Storage for stored agent configurations.",
|
|
126
|
+
isOptional: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "disableInit",
|
|
130
|
+
type: "boolean",
|
|
131
|
+
description:
|
|
132
|
+
"When true, automatic initialization is disabled. You must call init() explicitly.",
|
|
133
|
+
isOptional: true,
|
|
134
|
+
},
|
|
135
|
+
]}
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
## Initialization
|
|
139
|
+
|
|
140
|
+
MastraStorage initializes each configured domain independently. When passed to the Mastra class, `init()` is called automatically:
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { MastraStorage } from "@mastra/core/storage";
|
|
144
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
145
|
+
import { Mastra } from "@mastra/core";
|
|
146
|
+
|
|
147
|
+
const storage = new MastraStorage({
|
|
148
|
+
id: "composite",
|
|
149
|
+
domains: {
|
|
150
|
+
memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
|
151
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
152
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const mastra = new Mastra({
|
|
157
|
+
storage, // init() called automatically
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If using storage directly, call `init()` explicitly:
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
const storage = new MastraStorage({
|
|
165
|
+
id: "composite",
|
|
166
|
+
domains: {
|
|
167
|
+
memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
await storage.init();
|
|
172
|
+
|
|
173
|
+
// Access domain-specific stores via getStore()
|
|
174
|
+
const memoryStore = await storage.getStore("memory");
|
|
175
|
+
const thread = await memoryStore?.getThreadById({ threadId: "..." });
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Use Cases
|
|
179
|
+
|
|
180
|
+
### Separate databases for different workloads
|
|
181
|
+
|
|
182
|
+
Use a local database for development while keeping production data in a managed service:
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
import { MastraStorage } from "@mastra/core/storage";
|
|
186
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
187
|
+
import { MemoryLibSQL } from "@mastra/libsql";
|
|
188
|
+
|
|
189
|
+
const storage = new MastraStorage({
|
|
190
|
+
id: "composite",
|
|
191
|
+
domains: {
|
|
192
|
+
// Use local SQLite for development, PostgreSQL for production
|
|
193
|
+
memory:
|
|
194
|
+
process.env.NODE_ENV === "development"
|
|
195
|
+
? new MemoryLibSQL({ url: "file:./dev.db" })
|
|
196
|
+
: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
|
197
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
198
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Specialized storage for observability
|
|
204
|
+
|
|
205
|
+
Use a time-series database for traces while keeping other data in PostgreSQL:
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
import { MastraStorage } from "@mastra/core/storage";
|
|
209
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
210
|
+
import { ObservabilityStorageClickhouse } from "@mastra/clickhouse";
|
|
211
|
+
|
|
212
|
+
const storage = new MastraStorage({
|
|
213
|
+
id: "composite",
|
|
214
|
+
domains: {
|
|
215
|
+
memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
|
216
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
217
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
218
|
+
observability: new ObservabilityStorageClickhouse({
|
|
219
|
+
url: process.env.CLICKHOUSE_URL,
|
|
220
|
+
}),
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
```
|
|
@@ -41,6 +41,8 @@ const server = new MCPServer({
|
|
|
41
41
|
id: "my-custom-server",
|
|
42
42
|
name: "My Custom Server",
|
|
43
43
|
version: "1.0.0",
|
|
44
|
+
description: "A server that provides weather data and agent capabilities",
|
|
45
|
+
instructions: "Use the available tools to help users with weather information and data processing tasks.",
|
|
44
46
|
tools: { weatherTool },
|
|
45
47
|
agents: { myAgent }, // this agent will become tool "ask_myAgent"
|
|
46
48
|
workflows: {
|
|
@@ -102,6 +104,13 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
|
|
|
102
104
|
isOptional: true,
|
|
103
105
|
description: "Optional description of what the MCP server does.",
|
|
104
106
|
},
|
|
107
|
+
{
|
|
108
|
+
name: "instructions",
|
|
109
|
+
type: "string",
|
|
110
|
+
isOptional: true,
|
|
111
|
+
description:
|
|
112
|
+
"Optional instructions describing how to use the server and its features.",
|
|
113
|
+
},
|
|
105
114
|
{
|
|
106
115
|
name: "repository",
|
|
107
116
|
type: "Repository", // { url: string; source: string; id: string; }
|
|
@@ -7,12 +7,15 @@ description: Documentation for the `Run.cancel()` method in workflows, which can
|
|
|
7
7
|
|
|
8
8
|
The `.cancel()` method cancels a workflow run, stopping execution and cleaning up resources.
|
|
9
9
|
|
|
10
|
+
This method aborts any running steps and updates the workflow status to 'canceled'. It works for both actively running workflows and suspended/waiting workflows.
|
|
11
|
+
|
|
10
12
|
## Usage example
|
|
11
13
|
|
|
12
14
|
```typescript
|
|
13
15
|
const run = await workflow.createRun();
|
|
14
16
|
|
|
15
17
|
await run.cancel();
|
|
18
|
+
// Returns: { message: 'Workflow run canceled' }
|
|
16
19
|
```
|
|
17
20
|
|
|
18
21
|
## Parameters
|
|
@@ -34,14 +37,31 @@ await run.cancel();
|
|
|
34
37
|
content={[
|
|
35
38
|
{
|
|
36
39
|
name: "result",
|
|
37
|
-
type: "Promise<
|
|
40
|
+
type: "Promise<{ message: string }>",
|
|
38
41
|
description:
|
|
39
|
-
"A promise that resolves
|
|
42
|
+
"A promise that resolves with { message: 'Workflow run canceled' } when cancellation succeeds",
|
|
40
43
|
},
|
|
41
44
|
]}
|
|
42
45
|
/>
|
|
43
46
|
|
|
44
|
-
##
|
|
47
|
+
## How cancellation works
|
|
48
|
+
|
|
49
|
+
When called, the workflow will:
|
|
50
|
+
1. **Trigger the abort signal** - Uses the standard Web API AbortSignal to notify running steps
|
|
51
|
+
2. **Prevent subsequent steps** - No further steps will be executed
|
|
52
|
+
|
|
53
|
+
## Abort signal behavior
|
|
54
|
+
|
|
55
|
+
Steps that check the `abortSignal` parameter can respond to cancellation:
|
|
56
|
+
- Steps can listen to the 'abort' event: `abortSignal.addEventListener('abort', callback)`
|
|
57
|
+
- Steps can check if already aborted: `if (abortSignal.aborted) { ... }`
|
|
58
|
+
- Useful for cancelling timeouts, network requests, or long-running operations
|
|
59
|
+
|
|
60
|
+
**Note:** Steps must actively check the abort signal to be canceled mid-execution. Steps that don't check the signal will run to completion, but subsequent steps won't execute.
|
|
61
|
+
|
|
62
|
+
## Extended usage examples
|
|
63
|
+
|
|
64
|
+
### Cancelling a workflow on error
|
|
45
65
|
|
|
46
66
|
```typescript
|
|
47
67
|
const run = await workflow.createRun();
|
|
@@ -53,6 +73,34 @@ try {
|
|
|
53
73
|
}
|
|
54
74
|
```
|
|
55
75
|
|
|
76
|
+
### Creating a step that responds to cancellation
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const step = createStep({
|
|
80
|
+
id: 'long-running-step',
|
|
81
|
+
execute: async ({ inputData, abortSignal, abort }) => {
|
|
82
|
+
const timeout = new Promise((resolve) => {
|
|
83
|
+
const timer = setTimeout(() => resolve('done'), 10000);
|
|
84
|
+
|
|
85
|
+
// Clean up if canceled
|
|
86
|
+
abortSignal.addEventListener('abort', () => {
|
|
87
|
+
clearTimeout(timer);
|
|
88
|
+
resolve('canceled');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const result = await timeout;
|
|
93
|
+
|
|
94
|
+
// Check if aborted after async operation
|
|
95
|
+
if (abortSignal.aborted) {
|
|
96
|
+
return abort(); // Stop execution
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return { result };
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
56
104
|
## Related
|
|
57
105
|
|
|
58
106
|
- [Workflows overview](/docs/v1/workflows/overview#running-workflows)
|
|
@@ -53,8 +53,8 @@ if (result.status === "suspended") {
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
name: "cancel",
|
|
56
|
-
type: "() => Promise<
|
|
57
|
-
description: "Cancels the workflow execution",
|
|
56
|
+
type: "() => Promise<{ message: string }>",
|
|
57
|
+
description: "Cancels the workflow execution, stopping any running steps and preventing subsequent steps from executing",
|
|
58
58
|
required: true,
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -102,6 +102,12 @@ A workflow run's `status` indicates its current execution state. The possible va
|
|
|
102
102
|
description:
|
|
103
103
|
"Workflow execution is paused waiting for resume, with suspended step information",
|
|
104
104
|
},
|
|
105
|
+
{
|
|
106
|
+
name: "canceled",
|
|
107
|
+
type: "string",
|
|
108
|
+
description:
|
|
109
|
+
"Workflow execution was canceled via the cancel() method, stopping any running steps and preventing subsequent steps from executing",
|
|
110
|
+
},
|
|
105
111
|
]}
|
|
106
112
|
/>
|
|
107
113
|
|