@mastra/server 1.4.0-alpha.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +155 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,160 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added REST API routes for Datasets and Experiments. New endpoints under `/datasets` for full CRUD on datasets, items, versions, experiments, and experiment results. Includes batch operations and experiment comparison. ([#12747](https://github.com/mastra-ai/mastra/pull/12747))
|
|
8
|
+
|
|
9
|
+
- Added observational memory configuration support for stored agents. When creating or editing a stored agent in the playground, you can now enable observational memory and configure its settings including model provider/name, scope (thread or resource), share token budget, and detailed observer/reflector parameters like token limits, buffer settings, and blocking thresholds. The configuration is serialized as part of the agent's memory config and round-trips through storage. ([#12962](https://github.com/mastra-ai/mastra/pull/12962))
|
|
10
|
+
|
|
11
|
+
**Example usage in the playground:**
|
|
12
|
+
|
|
13
|
+
Enable the Observational Memory toggle in the Memory section, then configure:
|
|
14
|
+
- Top-level model (provider + model) used by both observer and reflector
|
|
15
|
+
- Scope: `thread` (per-conversation) or `resource` (shared across threads)
|
|
16
|
+
- Expand **Observer** or **Reflector** sections to override models and tune token budgets
|
|
17
|
+
|
|
18
|
+
**Programmatic usage via client SDK:**
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
await client.createStoredAgent({
|
|
22
|
+
name: 'My Agent',
|
|
23
|
+
// ...other config
|
|
24
|
+
memory: {
|
|
25
|
+
observationalMemory: true, // enable with defaults
|
|
26
|
+
options: { lastMessages: 40 },
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Or with custom configuration:
|
|
31
|
+
await client.createStoredAgent({
|
|
32
|
+
name: 'My Agent',
|
|
33
|
+
memory: {
|
|
34
|
+
observationalMemory: {
|
|
35
|
+
model: 'google/gemini-2.5-flash',
|
|
36
|
+
scope: 'resource',
|
|
37
|
+
shareTokenBudget: true,
|
|
38
|
+
observation: { messageTokens: 50000 },
|
|
39
|
+
reflection: { observationTokens: 60000 },
|
|
40
|
+
},
|
|
41
|
+
options: { lastMessages: 40 },
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Programmatic usage via editor:**
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
await editor.agent.create({
|
|
50
|
+
name: 'My Agent',
|
|
51
|
+
// ...other config
|
|
52
|
+
memory: {
|
|
53
|
+
observationalMemory: true, // enable with defaults
|
|
54
|
+
options: { lastMessages: 40 },
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Or with custom configuration:
|
|
59
|
+
await editor.agent.create({
|
|
60
|
+
name: 'My Agent',
|
|
61
|
+
memory: {
|
|
62
|
+
observationalMemory: {
|
|
63
|
+
model: 'google/gemini-2.5-flash',
|
|
64
|
+
scope: 'resource',
|
|
65
|
+
shareTokenBudget: true,
|
|
66
|
+
observation: { messageTokens: 50000 },
|
|
67
|
+
reflection: { observationTokens: 60000 },
|
|
68
|
+
},
|
|
69
|
+
options: { lastMessages: 40 },
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Fixed the /api/tools endpoint returning an empty list even when tools are registered on the Mastra instance. Closes #12983 ([#13008](https://github.com/mastra-ai/mastra/pull/13008))
|
|
77
|
+
|
|
78
|
+
- Fixed custom API routes registered via `registerApiRoute()` being silently ignored by Koa, Express, Fastify, and Hono server adapters. Routes previously appeared in the OpenAPI spec but returned 404 at runtime. Custom routes now work correctly across all server adapters. ([#12960](https://github.com/mastra-ai/mastra/pull/12960))
|
|
79
|
+
|
|
80
|
+
**Example:**
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import Koa from 'koa';
|
|
84
|
+
import { Mastra } from '@mastra/core';
|
|
85
|
+
import { registerApiRoute } from '@mastra/core/server';
|
|
86
|
+
import { MastraServer } from '@mastra/koa';
|
|
87
|
+
|
|
88
|
+
const mastra = new Mastra({
|
|
89
|
+
server: {
|
|
90
|
+
apiRoutes: [
|
|
91
|
+
registerApiRoute('/hello', {
|
|
92
|
+
method: 'GET',
|
|
93
|
+
handler: async c => c.json({ message: 'Hello!' }),
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const app = new Koa();
|
|
100
|
+
const server = new MastraServer({ app, mastra });
|
|
101
|
+
await server.init();
|
|
102
|
+
// GET /hello now returns 200 instead of 404
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- Added API routes for stored MCP clients and tool provider discovery. ([#12974](https://github.com/mastra-ai/mastra/pull/12974))
|
|
106
|
+
|
|
107
|
+
**Stored MCP Client Routes**
|
|
108
|
+
|
|
109
|
+
New REST endpoints for managing stored MCP client configurations:
|
|
110
|
+
- `GET /api/stored-mcp-clients` — List all stored MCP clients
|
|
111
|
+
- `GET /api/stored-mcp-clients/:id` — Get a specific MCP client
|
|
112
|
+
- `POST /api/stored-mcp-clients` — Create a new MCP client
|
|
113
|
+
- `PATCH /api/stored-mcp-clients/:id` — Update an existing MCP client
|
|
114
|
+
- `DELETE /api/stored-mcp-clients/:id` — Delete an MCP client
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
// Create a stored MCP client
|
|
118
|
+
const response = await fetch('/api/stored-mcp-clients', {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
body: JSON.stringify({
|
|
121
|
+
id: 'my-mcp-client',
|
|
122
|
+
name: 'My MCP Client',
|
|
123
|
+
servers: {
|
|
124
|
+
'github-server': { url: 'https://mcp.github.com/sse' },
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Tool Provider Routes**
|
|
131
|
+
|
|
132
|
+
New REST endpoints for browsing registered tool providers and their tools:
|
|
133
|
+
- `GET /api/tool-providers` — List all registered tool providers with metadata
|
|
134
|
+
- `GET /api/tool-providers/:providerId/toolkits` — List toolkits for a provider
|
|
135
|
+
- `GET /api/tool-providers/:providerId/tools` — List tools (with optional toolkit/search filtering)
|
|
136
|
+
- `GET /api/tool-providers/:providerId/tools/:toolSlug/schema` — Get input schema for a tool
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
// List all registered tool providers
|
|
140
|
+
const providers = await fetch('/api/tool-providers');
|
|
141
|
+
|
|
142
|
+
// Browse tools in a specific toolkit
|
|
143
|
+
const tools = await fetch('/api/tool-providers/composio/tools?toolkit=github');
|
|
144
|
+
|
|
145
|
+
// Get schema for a specific tool
|
|
146
|
+
const schema = await fetch('/api/tool-providers/composio/tools/GITHUB_LIST_ISSUES/schema');
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Updated stored agent schemas to include `mcpClients` and `integrationTools` conditional fields, and updated agent version tracking accordingly.
|
|
150
|
+
|
|
151
|
+
- Fixed requestContextSchema missing from the agent list API response. Agents with a requestContextSchema now correctly include it when listed via GET /agents. ([#12954](https://github.com/mastra-ai/mastra/pull/12954))
|
|
152
|
+
|
|
153
|
+
- Expose filesystem info from getInfo() in the GET /api/workspaces/:id API response, including provider type, status, readOnly, and provider-specific metadata. ([#12971](https://github.com/mastra-ai/mastra/pull/12971))
|
|
154
|
+
|
|
155
|
+
- Updated dependencies [[`7ef618f`](https://github.com/mastra-ai/mastra/commit/7ef618f3c49c27e2f6b27d7f564c557c0734325b), [`b373564`](https://github.com/mastra-ai/mastra/commit/b37356491d43b4d53067f10cb669abaf2502f218), [`927c2af`](https://github.com/mastra-ai/mastra/commit/927c2af9792286c122e04409efce0f3c804f777f), [`b896b41`](https://github.com/mastra-ai/mastra/commit/b896b41343de7fcc14442fb40fe82d189e65bbe2), [`6415277`](https://github.com/mastra-ai/mastra/commit/6415277a438faa00db2af850ead5dee25f40c428), [`0831bbb`](https://github.com/mastra-ai/mastra/commit/0831bbb5bc750c18e9b22b45f18687c964b70828), [`63f7eda`](https://github.com/mastra-ai/mastra/commit/63f7eda605eb3e0c8c35ee3912ffe7c999c69f69), [`a5b67a3`](https://github.com/mastra-ai/mastra/commit/a5b67a3589a74415feb663a55d1858324a2afde9), [`877b02c`](https://github.com/mastra-ai/mastra/commit/877b02cdbb15e199184c7f2b8f217be8d3ebada7), [`7567222`](https://github.com/mastra-ai/mastra/commit/7567222b1366f0d39980594792dd9d5060bfe2ab), [`af71458`](https://github.com/mastra-ai/mastra/commit/af71458e3b566f09c11d0e5a0a836dc818e7a24a), [`eb36bd8`](https://github.com/mastra-ai/mastra/commit/eb36bd8c52fcd6ec9674ac3b7a6412405b5983e1), [`3cbf121`](https://github.com/mastra-ai/mastra/commit/3cbf121f55418141924754a83102aade89835947)]:
|
|
156
|
+
- @mastra/core@1.4.0
|
|
157
|
+
|
|
3
158
|
## 1.4.0-alpha.0
|
|
4
159
|
|
|
5
160
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/server",
|
|
3
|
-
"version": "1.4.0
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"typescript": "^5.9.3",
|
|
93
93
|
"vitest": "4.0.16",
|
|
94
94
|
"zod": "^3.25.76",
|
|
95
|
-
"@internal/lint": "0.0.
|
|
96
|
-
"@internal/
|
|
97
|
-
"@internal/
|
|
98
|
-
"@mastra/agent-builder": "1.0.4
|
|
99
|
-
"@mastra/core": "1.4.0
|
|
95
|
+
"@internal/lint": "0.0.59",
|
|
96
|
+
"@internal/types-builder": "0.0.34",
|
|
97
|
+
"@internal/storage-test-utils": "0.0.55",
|
|
98
|
+
"@mastra/agent-builder": "1.0.4",
|
|
99
|
+
"@mastra/core": "1.4.0"
|
|
100
100
|
},
|
|
101
101
|
"homepage": "https://mastra.ai",
|
|
102
102
|
"repository": {
|