@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,170 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `onError` hook to server configuration for custom error handling. ([#11403](https://github.com/mastra-ai/mastra/pull/11403))
|
|
8
|
+
|
|
9
|
+
You can now provide a custom error handler through the Mastra server config to catch errors, format responses, or send them to external services like Sentry:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
13
|
+
|
|
14
|
+
const mastra = new Mastra({
|
|
15
|
+
server: {
|
|
16
|
+
onError: (err, c) => {
|
|
17
|
+
// Send to Sentry
|
|
18
|
+
Sentry.captureException(err);
|
|
19
|
+
|
|
20
|
+
// Return custom formatted response
|
|
21
|
+
return c.json(
|
|
22
|
+
{
|
|
23
|
+
error: err.message,
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
},
|
|
26
|
+
500,
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If no `onError` is provided, the default error handler is used.
|
|
34
|
+
|
|
35
|
+
Fixes #9610
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- fix(observability): start MODEL_STEP span at beginning of LLM execution ([#11409](https://github.com/mastra-ai/mastra/pull/11409))
|
|
40
|
+
|
|
41
|
+
The MODEL_STEP span was being created when the step-start chunk arrived (after the model API call completed), causing the span's startTime to be close to its endTime instead of accurately reflecting when the step began.
|
|
42
|
+
|
|
43
|
+
This fix ensures MODEL_STEP spans capture the full duration of each LLM execution step, including the API call latency, by starting the span at the beginning of the step execution rather than when the response starts streaming.
|
|
44
|
+
|
|
45
|
+
Fixes #11271
|
|
46
|
+
|
|
47
|
+
- Fixed inline type narrowing for `tool.execute()` return type when using `outputSchema`. ([#11420](https://github.com/mastra-ai/mastra/pull/11420))
|
|
48
|
+
|
|
49
|
+
**Problem:** When calling `tool.execute()`, TypeScript couldn't narrow the `ValidationError | OutputType` union after checking `'error' in result && result.error`, causing type errors when accessing output properties.
|
|
50
|
+
|
|
51
|
+
**Solution:**
|
|
52
|
+
- Added `{ error?: never }` to the success type, enabling proper discriminated union narrowing
|
|
53
|
+
- Simplified `createTool` generics so `inputData` is correctly typed based on `inputSchema`
|
|
54
|
+
|
|
55
|
+
**Note:** Tool output schemas should not use `error` as a field name since it's reserved for ValidationError discrimination. Use `errorMessage` or similar instead.
|
|
56
|
+
|
|
57
|
+
**Usage:**
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
const result = await myTool.execute({ firstName: 'Hans' });
|
|
61
|
+
|
|
62
|
+
if ('error' in result && result.error) {
|
|
63
|
+
console.error('Validation failed:', result.message);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ✅ TypeScript now correctly narrows result
|
|
68
|
+
return { fullName: result.fullName };
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- Add support for `instructions` field in MCPServer ([#11421](https://github.com/mastra-ai/mastra/pull/11421))
|
|
72
|
+
|
|
73
|
+
Implements the official MCP specification's `instructions` field, which allows MCP servers to provide system-wide prompts that are automatically sent to clients during initialization. This eliminates the need for per-project configuration files (like AGENTS.md) by centralizing the system prompt in the server definition.
|
|
74
|
+
|
|
75
|
+
**What's New:**
|
|
76
|
+
- Added `instructions` optional field to `MCPServerConfig` type
|
|
77
|
+
- Instructions are passed to the underlying MCP SDK Server during initialization
|
|
78
|
+
- Instructions are sent to clients in the `InitializeResult` response
|
|
79
|
+
- Fully compatible with all MCP clients (Cursor, Windsurf, Claude Desktop, etc.)
|
|
80
|
+
|
|
81
|
+
**Example Usage:**
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const server = new MCPServer({
|
|
85
|
+
name: 'GitHub MCP Server',
|
|
86
|
+
version: '1.0.0',
|
|
87
|
+
instructions:
|
|
88
|
+
'Use the available tools to help users manage GitHub repositories, issues, and pull requests. Always search before creating to avoid duplicates.',
|
|
89
|
+
tools: { searchIssues, createIssue, listPRs },
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- Add storage composition to MastraStorage ([#11401](https://github.com/mastra-ai/mastra/pull/11401))
|
|
94
|
+
|
|
95
|
+
`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.
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
99
|
+
import { MemoryPG, WorkflowsPG, ScoresPG } from '@mastra/pg';
|
|
100
|
+
import { MemoryLibSQL } from '@mastra/libsql';
|
|
101
|
+
|
|
102
|
+
// Compose domains from different stores
|
|
103
|
+
const storage = new MastraStorage({
|
|
104
|
+
id: 'composite',
|
|
105
|
+
domains: {
|
|
106
|
+
memory: new MemoryLibSQL({ url: 'file:./local.db' }),
|
|
107
|
+
workflows: new WorkflowsPG({ connectionString: process.env.DATABASE_URL }),
|
|
108
|
+
scores: new ScoresPG({ connectionString: process.env.DATABASE_URL }),
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Breaking changes:**
|
|
114
|
+
- `storage.supports` property no longer exists
|
|
115
|
+
- `StorageSupports` type is no longer exported from `@mastra/core/storage`
|
|
116
|
+
|
|
117
|
+
All stores now support the same features. For domain availability, use `getStore()`:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
const store = await storage.getStore('memory');
|
|
121
|
+
if (store) {
|
|
122
|
+
// domain is available
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- Fix various places in core package where we were logging with console.error instead of the mastra logger. ([#11425](https://github.com/mastra-ai/mastra/pull/11425))
|
|
127
|
+
|
|
128
|
+
- fix(workflows): ensure writer.custom() bubbles up from nested workflows and loops ([#11422](https://github.com/mastra-ai/mastra/pull/11422))
|
|
129
|
+
|
|
130
|
+
Previously, when using `writer.custom()` in steps within nested sub-workflows or loops (like `dountil`), the custom data events would not properly bubble up to the top-level workflow stream. This fix ensures that custom events are now correctly propagated through the nested workflow hierarchy without modification, allowing them to be consumed at the top level.
|
|
131
|
+
|
|
132
|
+
This brings workflows in line with the existing behavior for agents, where custom data chunks properly bubble up through sub-agent execution.
|
|
133
|
+
|
|
134
|
+
**What changed:**
|
|
135
|
+
- Modified the `nestedWatchCb` function in workflow event handling to detect and preserve `data-*` custom events
|
|
136
|
+
- Custom events now bubble up directly without being wrapped or modified
|
|
137
|
+
- Regular workflow events continue to work as before with proper step ID prefixing
|
|
138
|
+
|
|
139
|
+
**Example:**
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
const subStep = createStep({
|
|
143
|
+
id: 'subStep',
|
|
144
|
+
execute: async ({ writer }) => {
|
|
145
|
+
await writer.custom({
|
|
146
|
+
type: 'custom-progress',
|
|
147
|
+
data: { status: 'processing' },
|
|
148
|
+
});
|
|
149
|
+
return { result: 'done' };
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const subWorkflow = createWorkflow({ id: 'sub' }).then(subStep).commit();
|
|
154
|
+
|
|
155
|
+
const topWorkflow = createWorkflow({ id: 'top' }).then(subWorkflow).commit();
|
|
156
|
+
|
|
157
|
+
const run = await topWorkflow.createRun();
|
|
158
|
+
const stream = run.stream({ inputData: {} });
|
|
159
|
+
|
|
160
|
+
// Custom events from subStep now properly appear in the top-level stream
|
|
161
|
+
for await (const event of stream) {
|
|
162
|
+
if (event.type === 'custom-progress') {
|
|
163
|
+
console.log(event.data); // { status: 'processing' }
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
3
168
|
## 1.0.0-beta.15
|
|
4
169
|
|
|
5
170
|
### Minor Changes
|
|
@@ -333,170 +498,5 @@
|
|
|
333
498
|
|
|
334
499
|
**Examples that now work:**
|
|
335
500
|
|
|
336
|
-
```typescript
|
|
337
|
-
// Model config headers
|
|
338
|
-
new Agent({
|
|
339
|
-
model: {
|
|
340
|
-
id: 'anthropic/claude-4-5-sonnet',
|
|
341
|
-
headers: { 'anthropic-beta': 'context-1m-2025-08-07' },
|
|
342
|
-
},
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
// Runtime headers override config
|
|
346
|
-
agent.generate('...', {
|
|
347
|
-
modelSettings: { headers: { 'x-custom': 'runtime-value' } },
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
// Provider-level headers preserved
|
|
351
|
-
const openai = createOpenAI({ headers: { 'openai-organization': 'org-123' } });
|
|
352
|
-
new Agent({ model: openai('gpt-4o-mini') });
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
- Fixed AbortSignal not propagating from parent workflows to nested sub-workflows in the evented workflow engine. ([#11142](https://github.com/mastra-ai/mastra/pull/11142))
|
|
356
|
-
|
|
357
|
-
Previously, canceling a parent workflow did not stop nested sub-workflows, causing them to continue running and consuming resources after the parent was canceled.
|
|
358
|
-
|
|
359
|
-
Now, when you cancel a parent workflow, all nested sub-workflows are automatically canceled as well, ensuring clean termination of the entire workflow tree.
|
|
360
|
-
|
|
361
|
-
**Example:**
|
|
362
|
-
|
|
363
|
-
```typescript
|
|
364
|
-
const parentWorkflow = createWorkflow({ id: 'parent-workflow' }).then(someStep).then(nestedChildWorkflow).commit();
|
|
365
|
-
|
|
366
|
-
const run = await parentWorkflow.createRun();
|
|
367
|
-
const resultPromise = run.start({ inputData: { value: 5 } });
|
|
368
|
-
|
|
369
|
-
// Cancel the parent workflow - nested workflows will also be canceled
|
|
370
|
-
await run.cancel();
|
|
371
|
-
// or use: run.abortController.abort();
|
|
372
|
-
|
|
373
|
-
const result = await resultPromise;
|
|
374
|
-
// result.status === 'canceled'
|
|
375
|
-
// All nested child workflows are also canceled
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
Related to #11063
|
|
379
|
-
|
|
380
|
-
- Fix empty overrideScorers causing error instead of skipping scoring ([#11257](https://github.com/mastra-ai/mastra/pull/11257))
|
|
381
|
-
|
|
382
|
-
When `overrideScorers` was passed as an empty object `{}`, the agent would throw a "No scorers found" error. Now an empty object explicitly skips scoring, while `undefined` continues to use default scorers.
|
|
383
|
-
|
|
384
|
-
- feat: Add field filtering and nested workflow control to workflow execution result endpoint ([#11246](https://github.com/mastra-ai/mastra/pull/11246))
|
|
385
|
-
|
|
386
|
-
Adds two optional query parameters to `/api/workflows/:workflowId/runs/:runId/execution-result` endpoint:
|
|
387
|
-
- `fields`: Request only specific fields (e.g., `status`, `result`, `error`)
|
|
388
|
-
- `withNestedWorkflows`: Control whether to fetch nested workflow data
|
|
389
|
-
|
|
390
|
-
This significantly reduces response payload size and improves response times for large workflows.
|
|
391
|
-
|
|
392
|
-
## Server Endpoint Usage
|
|
393
|
-
|
|
394
|
-
```http
|
|
395
|
-
# Get only status (minimal payload - fastest)
|
|
396
|
-
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status
|
|
397
|
-
|
|
398
|
-
# Get status and result
|
|
399
|
-
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,result
|
|
400
|
-
|
|
401
|
-
# Get all fields but without nested workflow data (faster)
|
|
402
|
-
GET /api/workflows/:workflowId/runs/:runId/execution-result?withNestedWorkflows=false
|
|
403
|
-
|
|
404
|
-
# Get only specific fields without nested workflow data
|
|
405
|
-
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,steps&withNestedWorkflows=false
|
|
406
|
-
|
|
407
|
-
# Get full data (default behavior)
|
|
408
|
-
GET /api/workflows/:workflowId/runs/:runId/execution-result
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
## Client SDK Usage
|
|
412
|
-
|
|
413
|
-
```typescript
|
|
414
|
-
import { MastraClient } from '@mastra/client-js';
|
|
415
|
-
|
|
416
|
-
const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
|
|
417
|
-
const workflow = client.getWorkflow('myWorkflow');
|
|
418
|
-
|
|
419
|
-
// Get only status (minimal payload - fastest)
|
|
420
|
-
const statusOnly = await workflow.runExecutionResult(runId, {
|
|
421
|
-
fields: ['status'],
|
|
422
|
-
});
|
|
423
|
-
console.log(statusOnly.status); // 'success' | 'failed' | 'running' | etc.
|
|
424
|
-
|
|
425
|
-
// Get status and result
|
|
426
|
-
const statusAndResult = await workflow.runExecutionResult(runId, {
|
|
427
|
-
fields: ['status', 'result'],
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
// Get all fields but without nested workflow data (faster)
|
|
431
|
-
const resultWithoutNested = await workflow.runExecutionResult(runId, {
|
|
432
|
-
withNestedWorkflows: false,
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
// Get specific fields without nested workflow data
|
|
436
|
-
const optimized = await workflow.runExecutionResult(runId, {
|
|
437
|
-
fields: ['status', 'steps'],
|
|
438
|
-
withNestedWorkflows: false,
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
// Get full execution result (default behavior)
|
|
442
|
-
const fullResult = await workflow.runExecutionResult(runId);
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
## Core API Changes
|
|
446
|
-
|
|
447
|
-
The `Workflow.getWorkflowRunExecutionResult` method now accepts an options object:
|
|
448
|
-
|
|
449
|
-
```typescript
|
|
450
|
-
await workflow.getWorkflowRunExecutionResult(runId, {
|
|
451
|
-
withNestedWorkflows: false, // default: true, set to false to skip nested workflow data
|
|
452
|
-
fields: ['status', 'result'], // optional field filtering
|
|
453
|
-
});
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
## Inngest Compatibility
|
|
457
|
-
|
|
458
|
-
The `@mastra/inngest` package has been updated to use the new options object API. This is a non-breaking internal change - no action required from inngest workflow users.
|
|
459
|
-
|
|
460
|
-
## Performance Impact
|
|
461
|
-
|
|
462
|
-
For workflows with large step outputs:
|
|
463
|
-
- Requesting only `status`: ~99% reduction in payload size
|
|
464
|
-
- Requesting `status,result,error`: ~95% reduction in payload size
|
|
465
|
-
- Using `withNestedWorkflows=false`: Avoids expensive nested workflow data fetching
|
|
466
|
-
- Combining both: Maximum performance optimization
|
|
467
|
-
|
|
468
|
-
- Removed a debug log that printed large Zod schemas, resulting in cleaner console output when using agents with memory enabled. ([#11279](https://github.com/mastra-ai/mastra/pull/11279))
|
|
469
|
-
|
|
470
|
-
- Set `externals: true` as the default for `mastra build` and cloud-deployer to reduce bundle issues with native dependencies. ([`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119))
|
|
471
|
-
|
|
472
|
-
**Note:** If you previously relied on the default bundling behavior (all dependencies bundled), you can explicitly set `externals: false` in your bundler configuration.
|
|
473
|
-
|
|
474
|
-
- Fix delayed promises rejecting when stream suspends on tool-call-approval ([#11278](https://github.com/mastra-ai/mastra/pull/11278))
|
|
475
|
-
|
|
476
|
-
When a stream ends in suspended state (e.g., requiring tool approval), the delayed promises like `toolResults`, `toolCalls`, `text`, etc. now resolve with partial results instead of rejecting with an error. This allows consumers to access data that was produced before the suspension.
|
|
477
|
-
|
|
478
|
-
Also improves generic type inference for `LLMStepResult` and related types throughout the streaming infrastructure.
|
|
479
|
-
|
|
480
|
-
## 1.0.0-beta.13
|
|
481
|
-
|
|
482
|
-
### Patch Changes
|
|
483
|
-
|
|
484
|
-
- Add `onFinish` and `onError` lifecycle callbacks to workflow options ([#11200](https://github.com/mastra-ai/mastra/pull/11200))
|
|
485
|
-
|
|
486
|
-
Workflows now support lifecycle callbacks for server-side handling of workflow completion and errors:
|
|
487
|
-
- `onFinish`: Called when workflow completes with any status (success, failed, suspended, tripwire)
|
|
488
|
-
- `onError`: Called only when workflow fails (failed or tripwire status)
|
|
489
|
-
|
|
490
|
-
```typescript
|
|
491
|
-
const workflow = createWorkflow({
|
|
492
|
-
id: 'my-workflow',
|
|
493
|
-
inputSchema: z.object({ ... }),
|
|
494
|
-
outputSchema: z.object({ ... }),
|
|
495
|
-
options: {
|
|
496
|
-
onFinish: async (result) => {
|
|
497
|
-
// Handle any workflow completion
|
|
498
|
-
await updateJobStatus(result.status);
|
|
499
|
-
},
|
|
500
|
-
onError: async (errorInfo) => {
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 6961 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/deployer-cloud
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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)]:
|
|
8
|
+
- @mastra/core@1.0.0-beta.16
|
|
9
|
+
- @mastra/deployer@1.0.0-beta.16
|
|
10
|
+
|
|
3
11
|
## 1.0.0-beta.15
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -490,13 +498,5 @@
|
|
|
490
498
|
|
|
491
499
|
- Fix peer deps ([#8134](https://github.com/mastra-ai/mastra/pull/8134))
|
|
492
500
|
|
|
493
|
-
- Update peer deps ([#8276](https://github.com/mastra-ai/mastra/pull/8276))
|
|
494
|
-
|
|
495
|
-
- Updated dependencies [[`5089c84`](https://github.com/mastra-ai/mastra/commit/5089c84a2f535ad12e79b5aa524ad7d8ca5e2b4c), [`5c98f03`](https://github.com/mastra-ai/mastra/commit/5c98f03ae76d9a93cd6be206b4abb7bf186b3163), [`57b75b0`](https://github.com/mastra-ai/mastra/commit/57b75b01c0c64d91c50d7384c700afda89456fe8), [`4c5e65d`](https://github.com/mastra-ai/mastra/commit/4c5e65de746fbdab23eb6072cb999f4c7aeef9f3), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`57b6dd5`](https://github.com/mastra-ai/mastra/commit/57b6dd50f9e6d92c0ed3e7199e6a92752025e3a1), [`a7243e2`](https://github.com/mastra-ai/mastra/commit/a7243e2e58762667a6e3921e755e89d6bb0a3282), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`7fceb0a`](https://github.com/mastra-ai/mastra/commit/7fceb0a327d678e812f90f5387c5bc4f38bd039e), [`df64f9e`](https://github.com/mastra-ai/mastra/commit/df64f9ef814916fff9baedd861c988084e7c41de), [`809eea0`](https://github.com/mastra-ai/mastra/commit/809eea092fa80c3f69b9eaf078d843b57fd2a88e), [`683e5a1`](https://github.com/mastra-ai/mastra/commit/683e5a1466e48b686825b2c11f84680f296138e4), [`3679378`](https://github.com/mastra-ai/mastra/commit/3679378673350aa314741dc826f837b1984149bc), [`7775bc2`](https://github.com/mastra-ai/mastra/commit/7775bc20bb1ad1ab24797fb420e4f96c65b0d8ec), [`db1891a`](https://github.com/mastra-ai/mastra/commit/db1891a4707443720b7cd8a260dc7e1d49b3609c), [`e8f379d`](https://github.com/mastra-ai/mastra/commit/e8f379d390efa264c4e0874f9ac0cf8839b07777), [`652066b`](https://github.com/mastra-ai/mastra/commit/652066bd1efc6bb6813ba950ed1d7573e8b7d9d4), [`ea8d386`](https://github.com/mastra-ai/mastra/commit/ea8d386cd8c5593664515fd5770c06bf2aa980ef), [`c2a4919`](https://github.com/mastra-ai/mastra/commit/c2a4919ba6797d8bdb1509e02287496eef69303e), [`6f67656`](https://github.com/mastra-ai/mastra/commit/6f676562276926e2982401574d1e07157579be30), [`0130986`](https://github.com/mastra-ai/mastra/commit/0130986fc62d0edcc626dd593282661dbb9af141), [`5dc8e9a`](https://github.com/mastra-ai/mastra/commit/5dc8e9a7f8472298cd3d4e8a0cf6d265529f287d)]:
|
|
496
|
-
- @mastra/deployer@0.19.0-alpha.1
|
|
497
|
-
- @mastra/core@0.19.0-alpha.1
|
|
498
|
-
- @mastra/loggers@0.10.14-alpha.0
|
|
499
|
-
|
|
500
|
-
## 0.18.1-alpha.0
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 551 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `onError` hook to server configuration for custom error handling. ([#11403](https://github.com/mastra-ai/mastra/pull/11403))
|
|
8
|
+
|
|
9
|
+
You can now provide a custom error handler through the Mastra server config to catch errors, format responses, or send them to external services like Sentry:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
13
|
+
|
|
14
|
+
const mastra = new Mastra({
|
|
15
|
+
server: {
|
|
16
|
+
onError: (err, c) => {
|
|
17
|
+
// Send to Sentry
|
|
18
|
+
Sentry.captureException(err);
|
|
19
|
+
|
|
20
|
+
// Return custom formatted response
|
|
21
|
+
return c.json(
|
|
22
|
+
{
|
|
23
|
+
error: err.message,
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
},
|
|
26
|
+
500,
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If no `onError` is provided, the default error handler is used.
|
|
34
|
+
|
|
35
|
+
Fixes #9610
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 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), [`0ff9edd`](https://github.com/mastra-ai/mastra/commit/0ff9edda410f5eadb6e73f5cadc4bf82a51c3bce), [`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)]:
|
|
40
|
+
- @mastra/core@1.0.0-beta.16
|
|
41
|
+
- @mastra/server@1.0.0-beta.16
|
|
42
|
+
|
|
3
43
|
## 1.0.0-beta.15
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
|
@@ -458,45 +498,5 @@
|
|
|
458
498
|
await storage.listWorkflowRuns({
|
|
459
499
|
workflowName: 'my-workflow',
|
|
460
500
|
offset: 20,
|
|
461
|
-
limit: 10,
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
// After
|
|
465
|
-
await storage.listWorkflowRuns({
|
|
466
|
-
workflowName: 'my-workflow',
|
|
467
|
-
page: 2,
|
|
468
|
-
perPage: 10,
|
|
469
|
-
});
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
**Additional improvements:**
|
|
473
|
-
- Added validation for negative `page` values in all storage implementations
|
|
474
|
-
- Improved `perPage` validation to handle edge cases (negative values, `0`, `false`)
|
|
475
|
-
- Added reusable query parser utilities for consistent validation in handlers
|
|
476
|
-
|
|
477
|
-
- ```([#9709](https://github.com/mastra-ai/mastra/pull/9709))
|
|
478
|
-
import { Mastra } from '@mastra/core';
|
|
479
|
-
import { Observability } from '@mastra/observability'; // Explicit import
|
|
480
|
-
|
|
481
|
-
const mastra = new Mastra({
|
|
482
|
-
...other_config,
|
|
483
|
-
observability: new Observability({
|
|
484
|
-
default: { enabled: true }
|
|
485
|
-
}) // Instance
|
|
486
|
-
});
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
Instead of:
|
|
490
|
-
|
|
491
|
-
```
|
|
492
|
-
import { Mastra } from '@mastra/core';
|
|
493
|
-
import '@mastra/observability/init'; // Explicit import
|
|
494
|
-
|
|
495
|
-
const mastra = new Mastra({
|
|
496
|
-
...other_config,
|
|
497
|
-
observability: {
|
|
498
|
-
default: { enabled: true }
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 5254 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @mastra/dynamodb
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.8
|
|
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.7
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
|
@@ -459,44 +499,4 @@
|
|
|
459
499
|
|
|
460
500
|
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.
|
|
461
501
|
|
|
462
|
-
|
|
463
|
-
- `Memory.listThreadsByResourceId()`
|
|
464
|
-
- `Memory.listMessages()`
|
|
465
|
-
- `Storage.listWorkflowRuns()`
|
|
466
|
-
|
|
467
|
-
**Migration:**
|
|
468
|
-
|
|
469
|
-
```typescript
|
|
470
|
-
// Before
|
|
471
|
-
await memory.listThreadsByResourceId({
|
|
472
|
-
resourceId: 'user-123',
|
|
473
|
-
offset: 20,
|
|
474
|
-
limit: 10,
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
// After
|
|
478
|
-
await memory.listThreadsByResourceId({
|
|
479
|
-
resourceId: 'user-123',
|
|
480
|
-
page: 2, // page = Math.floor(offset / limit)
|
|
481
|
-
perPage: 10,
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
// Before
|
|
485
|
-
await memory.listMessages({
|
|
486
|
-
threadId: 'thread-456',
|
|
487
|
-
offset: 20,
|
|
488
|
-
limit: 10,
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
// After
|
|
492
|
-
await memory.listMessages({
|
|
493
|
-
threadId: 'thread-456',
|
|
494
|
-
page: 2,
|
|
495
|
-
perPage: 10,
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
// Before
|
|
499
|
-
await storage.listWorkflowRuns({
|
|
500
|
-
workflowName: 'my-workflow',
|
|
501
|
-
|
|
502
|
-
... 1093 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 1133 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @mastra/lance
|
|
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
|
- 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))
|
|
460
500
|
|
|
461
|
-
- Rename RuntimeContext to RequestContext ([#9511](https://github.com/mastra-ai/mastra/pull/9511))
|
|
462
|
-
|
|
463
|
-
- Implement listMessages API for replacing previous methods ([#9531](https://github.com/mastra-ai/mastra/pull/9531))
|
|
464
|
-
|
|
465
|
-
- 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))
|
|
466
|
-
|
|
467
|
-
- 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))
|
|
468
|
-
|
|
469
|
-
- **BREAKING CHANGE**: Pagination APIs now use `page`/`perPage` instead of `offset`/`limit` ([#9592](https://github.com/mastra-ai/mastra/pull/9592))
|
|
470
|
-
|
|
471
|
-
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.
|
|
472
|
-
|
|
473
|
-
**Affected APIs:**
|
|
474
|
-
- `Memory.listThreadsByResourceId()`
|
|
475
|
-
- `Memory.listMessages()`
|
|
476
|
-
- `Storage.listWorkflowRuns()`
|
|
477
|
-
|
|
478
|
-
**Migration:**
|
|
479
|
-
|
|
480
|
-
```typescript
|
|
481
|
-
// Before
|
|
482
|
-
await memory.listThreadsByResourceId({
|
|
483
|
-
resourceId: 'user-123',
|
|
484
|
-
offset: 20,
|
|
485
|
-
limit: 10,
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
// After
|
|
489
|
-
await memory.listThreadsByResourceId({
|
|
490
|
-
resourceId: 'user-123',
|
|
491
|
-
page: 2, // page = Math.floor(offset / limit)
|
|
492
|
-
perPage: 10,
|
|
493
|
-
});
|
|
494
|
-
|
|
495
|
-
// Before
|
|
496
|
-
await memory.listMessages({
|
|
497
|
-
threadId: 'thread-456',
|
|
498
|
-
offset: 20,
|
|
499
|
-
limit: 10,
|
|
500
|
-
});
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 769 more lines hidden. See full changelog in package directory.
|