@mastra/core 1.3.0-alpha.2 → 1.3.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 +291 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-JQNREL64.js → chunk-3MJCJLZS.js} +4 -4
- package/dist/{chunk-JQNREL64.js.map → chunk-3MJCJLZS.js.map} +1 -1
- package/dist/{chunk-OV7OOUUR.js → chunk-44SUGDBR.js} +2 -2
- package/dist/{chunk-OV7OOUUR.js.map → chunk-44SUGDBR.js.map} +1 -1
- package/dist/{chunk-STKNQDVA.js → chunk-57QAF2ZQ.js} +3 -3
- package/dist/{chunk-STKNQDVA.js.map → chunk-57QAF2ZQ.js.map} +1 -1
- package/dist/{chunk-GZD6443M.cjs → chunk-C3XU7ZDC.cjs} +2 -2
- package/dist/{chunk-GZD6443M.cjs.map → chunk-C3XU7ZDC.cjs.map} +1 -1
- package/dist/{chunk-U2CABSMC.cjs → chunk-EH6SAGEO.cjs} +48 -48
- package/dist/{chunk-U2CABSMC.cjs.map → chunk-EH6SAGEO.cjs.map} +1 -1
- package/dist/{chunk-6TZKQI4R.cjs → chunk-EUG4AON3.cjs} +7 -7
- package/dist/{chunk-6TZKQI4R.cjs.map → chunk-EUG4AON3.cjs.map} +1 -1
- package/dist/{chunk-MOOJ3H3C.js → chunk-JNE2ABVB.js} +3 -3
- package/dist/{chunk-MOOJ3H3C.js.map → chunk-JNE2ABVB.js.map} +1 -1
- package/dist/{chunk-KL2JPSRX.js → chunk-KUTU2YZF.js} +4 -4
- package/dist/{chunk-KL2JPSRX.js.map → chunk-KUTU2YZF.js.map} +1 -1
- package/dist/{chunk-XQVYEOI7.cjs → chunk-NCC45KOB.cjs} +5 -5
- package/dist/{chunk-XQVYEOI7.cjs.map → chunk-NCC45KOB.cjs.map} +1 -1
- package/dist/{chunk-VVD56FI4.js → chunk-PHYJYZ32.js} +6 -6
- package/dist/{chunk-VVD56FI4.js.map → chunk-PHYJYZ32.js.map} +1 -1
- package/dist/{chunk-ZRUTE56J.js → chunk-SIZEIYNH.js} +35 -33
- package/dist/chunk-SIZEIYNH.js.map +1 -0
- package/dist/{chunk-JU6K7UDX.cjs → chunk-TERSHTY5.cjs} +9 -9
- package/dist/{chunk-JU6K7UDX.cjs.map → chunk-TERSHTY5.cjs.map} +1 -1
- package/dist/{chunk-D5JZT6EK.cjs → chunk-UHVG25VW.cjs} +13 -13
- package/dist/{chunk-D5JZT6EK.cjs.map → chunk-UHVG25VW.cjs.map} +1 -1
- package/dist/{chunk-FLHFB23E.cjs → chunk-YNXIGRQE.cjs} +36 -34
- package/dist/chunk-YNXIGRQE.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +257 -257
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/network/validation.d.ts +8 -0
- package/dist/loop/network/validation.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/processors/index.cjs +41 -41
- package/dist/processors/index.js +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/constants.cjs +27 -27
- package/dist/storage/constants.js +1 -1
- package/dist/storage/index.cjs +117 -117
- package/dist/storage/index.js +2 -2
- package/dist/storage/types.d.ts +2 -2
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +25 -25
- package/dist/workflows/index.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-FLHFB23E.cjs.map +0 -1
- package/dist/chunk-ZRUTE56J.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,296 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added mount support to workspaces, so you can combine multiple storage providers (S3, GCS, local disk, etc.) under a single directory tree. This lets agents access files from different sources through one unified filesystem. ([#12851](https://github.com/mastra-ai/mastra/pull/12851))
|
|
8
|
+
|
|
9
|
+
**Why:** Previously a workspace could only use one filesystem. With mounts, you can organize files from different providers under different paths — for example, S3 data at `/data` and GCS models at `/models` — without agents needing to know which provider backs each path.
|
|
10
|
+
|
|
11
|
+
**What's new:**
|
|
12
|
+
- Added `CompositeFilesystem` for combining multiple filesystems under one tree
|
|
13
|
+
- Added descriptive error types for sandbox and mount failures (e.g., `SandboxTimeoutError`, `MountError`)
|
|
14
|
+
- Improved `MastraFilesystem` and `MastraSandbox` base classes with safer concurrent lifecycle handling
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Workspace, CompositeFilesystem } from '@mastra/core/workspace';
|
|
18
|
+
|
|
19
|
+
// Mount multiple filesystems under one tree
|
|
20
|
+
const composite = new CompositeFilesystem({
|
|
21
|
+
mounts: {
|
|
22
|
+
'/data': s3Filesystem,
|
|
23
|
+
'/models': gcsFilesystem,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const workspace = new Workspace({
|
|
28
|
+
filesystem: composite,
|
|
29
|
+
sandbox: e2bSandbox,
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- Supporting work to allow for cloning agents via the client SDK ([#12796](https://github.com/mastra-ai/mastra/pull/12796))
|
|
34
|
+
|
|
35
|
+
- Added `requestContextSchema` and rule-based conditional fields for stored agents. ([#12896](https://github.com/mastra-ai/mastra/pull/12896))
|
|
36
|
+
|
|
37
|
+
Stored agent fields (`tools`, `model`, `workflows`, `agents`, `memory`, `scorers`, `inputProcessors`, `outputProcessors`, `defaultOptions`) can now be configured as conditional variants with rule groups that evaluate against request context at runtime. All matching variants accumulate — arrays are concatenated and objects are shallow-merged — so agents dynamically compose their configuration based on the incoming request context.
|
|
38
|
+
|
|
39
|
+
**New `requestContextSchema` field**
|
|
40
|
+
|
|
41
|
+
Stored agents now accept an optional `requestContextSchema` (JSON Schema) that is converted to a Zod schema and passed to the Agent constructor, enabling request context validation.
|
|
42
|
+
|
|
43
|
+
**Conditional field example**
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
await agentsStore.create({
|
|
47
|
+
agent: {
|
|
48
|
+
id: 'my-agent',
|
|
49
|
+
name: 'My Agent',
|
|
50
|
+
instructions: 'You are a helpful assistant',
|
|
51
|
+
model: { provider: 'openai', name: 'gpt-4' },
|
|
52
|
+
tools: [
|
|
53
|
+
{ value: { 'basic-tool': {} } },
|
|
54
|
+
{
|
|
55
|
+
value: { 'premium-tool': {} },
|
|
56
|
+
rules: {
|
|
57
|
+
operator: 'AND',
|
|
58
|
+
conditions: [{ field: 'tier', operator: 'equals', value: 'premium' }],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
requestContextSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: { tier: { type: 'string' } },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- Implement underlying storage changes to allow for dynamic instructions in stored agents (for `@mastra/editor`) ([#12776](https://github.com/mastra-ai/mastra/pull/12776))
|
|
71
|
+
|
|
72
|
+
- Add native `@ai-sdk/groq` support to model router. Groq models now use the official AI SDK package instead of falling back to OpenAI-compatible mode. ([#12741](https://github.com/mastra-ai/mastra/pull/12741))
|
|
73
|
+
|
|
74
|
+
- **Added stored scorer definitions, editor namespace pattern, and generic storage domains** ([#12846](https://github.com/mastra-ai/mastra/pull/12846))
|
|
75
|
+
- Added a new `scorer-definitions` storage domain for storing LLM-as-judge and preset scorer configurations in the database
|
|
76
|
+
- Introduced a `VersionedStorageDomain` generic base class that unifies `AgentsStorage`, `PromptBlocksStorage`, and `ScorerDefinitionsStorage` with shared CRUD methods (`create`, `getById`, `getByIdResolved`, `update`, `delete`, `list`, `listResolved`)
|
|
77
|
+
- Flattened stored scorer type system: replaced nested `preset`/`customLLMJudge` config with top-level `type`, `instructions`, `scoreRange`, and `presetConfig` fields
|
|
78
|
+
- Refactored `MastraEditor` to use a namespace pattern (`editor.agent.*`, `editor.scorer.*`, `editor.prompt.*`) backed by a `CrudEditorNamespace` base class with built-in caching and an `onCacheEvict` hook
|
|
79
|
+
- Added `rawConfig` support to `MastraBase` and `MastraScorer` via `toRawConfig()`, so hydrated primitives carry their stored configuration
|
|
80
|
+
- Added prompt block and scorer registration to the `Mastra` class (`addPromptBlock`, `removePromptBlock`, `addScorer`, `removeScorer`)
|
|
81
|
+
|
|
82
|
+
**Creating a stored scorer (LLM-as-judge):**
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const scorer = await editor.scorer.create({
|
|
86
|
+
id: 'my-scorer',
|
|
87
|
+
name: 'Response Quality',
|
|
88
|
+
type: 'llm-judge',
|
|
89
|
+
instructions: 'Evaluate the response for accuracy and helpfulness.',
|
|
90
|
+
model: { provider: 'openai', name: 'gpt-4o' },
|
|
91
|
+
scoreRange: { min: 0, max: 1 },
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Retrieving and resolving a stored scorer:**
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
// Fetch the stored definition from DB
|
|
99
|
+
const definition = await editor.scorer.getById('my-scorer');
|
|
100
|
+
|
|
101
|
+
// Resolve it into a runnable MastraScorer instance
|
|
102
|
+
const runnableScorer = editor.scorer.resolve(definition);
|
|
103
|
+
|
|
104
|
+
// Execute the scorer
|
|
105
|
+
const result = await runnableScorer.run({
|
|
106
|
+
input: 'What is the capital of France?',
|
|
107
|
+
output: 'The capital of France is Paris.',
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Editor namespace pattern (before/after):**
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
// Before
|
|
115
|
+
const agent = await editor.getStoredAgentById('abc');
|
|
116
|
+
const prompts = await editor.listPromptBlocks();
|
|
117
|
+
|
|
118
|
+
// After
|
|
119
|
+
const agent = await editor.agent.getById('abc');
|
|
120
|
+
const prompts = await editor.prompt.list();
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Generic storage domain methods (before/after):**
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
// Before
|
|
127
|
+
const store = storage.getStore('agents');
|
|
128
|
+
await store.createAgent({ agent: input });
|
|
129
|
+
await store.getAgentById({ id: 'abc' });
|
|
130
|
+
await store.deleteAgent({ id: 'abc' });
|
|
131
|
+
|
|
132
|
+
// After
|
|
133
|
+
const store = storage.getStore('agents');
|
|
134
|
+
await store.create({ agent: input });
|
|
135
|
+
await store.getById('abc');
|
|
136
|
+
await store.delete('abc');
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- Added mount status and error information to filesystem directory listings, so the UI can show whether each mount is healthy or has issues. Improved error handling when mount operations fail. Fixed tree formatter to use case-insensitive sorting to match native tree output. ([#12605](https://github.com/mastra-ai/mastra/pull/12605))
|
|
140
|
+
|
|
141
|
+
- Added workspace registration and tool context support. ([#12607](https://github.com/mastra-ai/mastra/pull/12607))
|
|
142
|
+
|
|
143
|
+
**Why** - Makes it easier to manage multiple workspaces at runtime and lets tools read/write files in the intended workspace.
|
|
144
|
+
|
|
145
|
+
**Workspace Registration** - Added a workspace registry so you can list and fetch workspaces by id with `addWorkspace()`, `getWorkspaceById()`, and `listWorkspaces()`. Agent workspaces are auto-registered when adding agents.
|
|
146
|
+
|
|
147
|
+
**Before**
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
const mastra = new Mastra({ workspace: myWorkspace });
|
|
151
|
+
// No way to look up workspaces by id or list all workspaces
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**After**
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
const mastra = new Mastra({ workspace: myWorkspace });
|
|
158
|
+
|
|
159
|
+
// Look up by id
|
|
160
|
+
const ws = mastra.getWorkspaceById('my-workspace');
|
|
161
|
+
|
|
162
|
+
// List all registered workspaces
|
|
163
|
+
const allWorkspaces = mastra.listWorkspaces();
|
|
164
|
+
|
|
165
|
+
// Register additional workspaces
|
|
166
|
+
mastra.addWorkspace(anotherWorkspace);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Tool Workspace Access** - Tools can access the workspace through `context.workspace` during execution, enabling filesystem and sandbox operations.
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
const myTool = createTool({
|
|
173
|
+
id: 'file-reader',
|
|
174
|
+
execute: async ({ context }) => {
|
|
175
|
+
const fs = context.workspace?.filesystem;
|
|
176
|
+
const content = await fs?.readFile('config.json');
|
|
177
|
+
return { content };
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Dynamic Workspace Configuration** - Workspace can be configured dynamically via agent config functions. Dynamically created workspaces are auto-registered with Mastra, making them available via `listWorkspaces()`.
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
const agent = new Agent({
|
|
186
|
+
workspace: ({ mastra, requestContext }) => {
|
|
187
|
+
// Return workspace dynamically based on context
|
|
188
|
+
const workspaceId = requestContext?.get('workspaceId') || 'default';
|
|
189
|
+
return mastra.getWorkspaceById(workspaceId);
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- Add tool description overrides for stored agents: ([#12794](https://github.com/mastra-ai/mastra/pull/12794))
|
|
195
|
+
- Changed stored agent `tools` field from `string[]` to `Record<string, { description?: string }>` to allow per-tool description overrides
|
|
196
|
+
- When a stored agent specifies a custom `description` for a tool, the override is applied at resolution time
|
|
197
|
+
- Updated server API schemas, client SDK types, and editor resolution logic accordingly
|
|
198
|
+
|
|
199
|
+
- **Breaking:** Removed `cloneAgent()` from the `Agent` class. Agent cloning is now handled by the editor package via `editor.agent.clone()`. ([#12904](https://github.com/mastra-ai/mastra/pull/12904))
|
|
200
|
+
|
|
201
|
+
If you were calling `agent.cloneAgent()` directly, use the editor's agent namespace instead:
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
// Before
|
|
205
|
+
const result = await agent.cloneAgent({ newId: 'my-clone' });
|
|
206
|
+
|
|
207
|
+
// After
|
|
208
|
+
const editor = mastra.getEditor();
|
|
209
|
+
const result = await editor.agent.clone(agent, { newId: 'my-clone' });
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Why:** The `Agent` class should not be responsible for storage serialization. The editor package already handles converting between runtime agents and stored configurations, so cloning belongs there.
|
|
213
|
+
|
|
214
|
+
**Added** `getConfiguredProcessorIds()` to the `Agent` class, which returns raw input/output processor IDs for the agent's configuration.
|
|
215
|
+
|
|
216
|
+
### Patch Changes
|
|
217
|
+
|
|
218
|
+
- Update provider registry and model documentation with latest models and providers ([`717ffab`](https://github.com/mastra-ai/mastra/commit/717ffab42cfd58ff723b5c19ada4939997773004))
|
|
219
|
+
|
|
220
|
+
- Fixed observational memory progress bars resetting to zero after agent responses finish. ([#12934](https://github.com/mastra-ai/mastra/pull/12934))
|
|
221
|
+
|
|
222
|
+
- Fixed issues with stored agents ([#12790](https://github.com/mastra-ai/mastra/pull/12790))
|
|
223
|
+
|
|
224
|
+
- Fixed sub-agent tool approval and suspend events not being surfaced to the parent agent stream. This enables proper suspend/resume workflows and approval handling when nested agents require tool approvals. ([#12732](https://github.com/mastra-ai/mastra/pull/12732))
|
|
225
|
+
|
|
226
|
+
Related to issue #12552.
|
|
227
|
+
|
|
228
|
+
- Fixed stale agent data in CMS pages by adding removeAgent method to Mastra and updating clearStoredAgentCache to clear both Editor cache and Mastra registry when stored agents are updated or deleted ([#12693](https://github.com/mastra-ai/mastra/pull/12693))
|
|
229
|
+
|
|
230
|
+
- Fixed stored scorers not being registered on the Mastra instance. Scorers created via the editor are now automatically discoverable through `mastra.getScorer()` and `mastra.getScorerById()`, matching the existing behavior of stored agents. Previously, stored scorers could only be resolved inline but were invisible to the runtime registry, causing lookups to fail. ([#12903](https://github.com/mastra-ai/mastra/pull/12903))
|
|
231
|
+
|
|
232
|
+
- Fixed `generateTitle` running on every conversation turn instead of only the first, which caused redundant title generation calls. This happened when `lastMessages` was disabled or set to `false`. Titles are now correctly generated only on the first turn. ([#12890](https://github.com/mastra-ai/mastra/pull/12890))
|
|
233
|
+
|
|
234
|
+
- Fixed workflow step errors not being propagated to the configured Mastra logger. The execution engine now properly propagates the Mastra logger through the inheritance chain, and the evented step executor logs errors with structured MastraError context (matching the default engine behavior). Closes #12793 ([#12834](https://github.com/mastra-ai/mastra/pull/12834))
|
|
235
|
+
|
|
236
|
+
- Update memory config and exports: ([#12704](https://github.com/mastra-ai/mastra/pull/12704))
|
|
237
|
+
- Updated `SerializedMemoryConfig` to allow `embedder?: EmbeddingModelId | string` for flexibility
|
|
238
|
+
- Exported `EMBEDDING_MODELS` and `EmbeddingModelInfo` for use in server endpoints
|
|
239
|
+
|
|
240
|
+
- Fixed a catch-22 where third-party AI SDK providers (like `ollama-ai-provider-v2`) were rejected by both `stream()` and `streamLegacy()` due to unrecognized `specificationVersion` values. ([#12856](https://github.com/mastra-ai/mastra/pull/12856))
|
|
241
|
+
|
|
242
|
+
When a model has a `specificationVersion` that isn't `'v1'`, `'v2'`, or `'v3'` (e.g., from a third-party provider), two fixes now apply:
|
|
243
|
+
1. **Auto-wrapping in `resolveModelConfig()`**: Models with unknown spec versions that have `doStream`/`doGenerate` methods are automatically wrapped as AI SDK v5 models, preventing the catch-22 entirely.
|
|
244
|
+
2. **Improved error messages**: If a model still reaches the version check, error messages now show the actual unrecognized `specificationVersion` instead of creating circular suggestions between `stream()` and `streamLegacy()`.
|
|
245
|
+
|
|
246
|
+
- Fixed routing output so users only see the final answer when routing handles a request directly. Previously, an internal routing explanation appeared before the answer and was duplicated. Fixes #12545. ([#12786](https://github.com/mastra-ai/mastra/pull/12786))
|
|
247
|
+
|
|
248
|
+
- Supporting changes for async buffering in observational memory, including new config options, streaming events, and UI markers. ([#12891](https://github.com/mastra-ai/mastra/pull/12891))
|
|
249
|
+
|
|
250
|
+
- Fixed an issue where processor retry (via `abort({ retry: true })` in `processOutputStep`) would send the rejected assistant response back to the LLM on retry. This confused models and often caused empty text responses. The rejected response is now removed from the message list before the retry iteration. ([#12799](https://github.com/mastra-ai/mastra/pull/12799))
|
|
251
|
+
|
|
252
|
+
- Fixed Moonshot AI (moonshotai and moonshotai-cn) models using the wrong base URL. The Anthropic-compatible endpoint was not being applied, causing API calls to fail with an upstream LLM error. ([#12750](https://github.com/mastra-ai/mastra/pull/12750))
|
|
253
|
+
|
|
254
|
+
- Fixed messages not being persisted to the database when using the stream-legacy endpoint. The thread is now saved to the database immediately when created, preventing a race condition where storage backends like PostgreSQL would reject message inserts because the thread didn't exist yet. Fixes #12566. ([#12774](https://github.com/mastra-ai/mastra/pull/12774))
|
|
255
|
+
|
|
256
|
+
- When calling `mastra.setLogger()`, memory instances were not being updated with the new logger. This caused memory-related errors to be logged via the default ConsoleLogger instead of the configured logger. ([#12905](https://github.com/mastra-ai/mastra/pull/12905))
|
|
257
|
+
|
|
258
|
+
- Fixed tool input validation failing when LLMs return stringified JSON for array or object parameters. Some models (e.g., GLM4.7) send `"[\"file.py\"]"` instead of `["file.py"]` for array fields, which caused Zod validation to reject the input. The validation pipeline now automatically detects and parses stringified JSON values when the schema expects an array or object. (GitHub #12757) ([#12771](https://github.com/mastra-ai/mastra/pull/12771))
|
|
259
|
+
|
|
260
|
+
- Fixed working memory tools being injected when no thread or resource context is provided. Made working memory tool execute scope-aware: thread-scoped requires threadId, resource-scoped requires resourceId (previously both were always required regardless of scope). ([#12831](https://github.com/mastra-ai/mastra/pull/12831))
|
|
261
|
+
|
|
262
|
+
- Fixed a crash when using agent workflows that have no input schema. Input now passes through on first invocation, so workflows run instead of failing. (#12739) ([#12785](https://github.com/mastra-ai/mastra/pull/12785))
|
|
263
|
+
|
|
264
|
+
- Fixes issue where client tools could not be used with agent.network(). Client tools configured in an agent's defaultOptions will now be available during network execution. ([#12821](https://github.com/mastra-ai/mastra/pull/12821))
|
|
265
|
+
|
|
266
|
+
Fixes #12752
|
|
267
|
+
|
|
268
|
+
- Steps now support an optional `metadata` property for storing arbitrary key-value data. This metadata is preserved through step serialization and is available in the workflow graph, enabling use cases like UI annotations or custom step categorization. ([#12861](https://github.com/mastra-ai/mastra/pull/12861))
|
|
269
|
+
|
|
270
|
+
```diff
|
|
271
|
+
import { createStep } from "@mastra/core/workflows";
|
|
272
|
+
import { z } from "zod";
|
|
273
|
+
|
|
274
|
+
const step = createStep({
|
|
275
|
+
//...step information
|
|
276
|
+
+ metadata: {
|
|
277
|
+
+ category: "orders",
|
|
278
|
+
+ priority: "high",
|
|
279
|
+
+ version: "1.0.0",
|
|
280
|
+
+ },
|
|
281
|
+
});
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Metadata values must be serializable (no functions or circular references).
|
|
285
|
+
|
|
286
|
+
- Fixed: You can now pass workflows with a `requestContextSchema` to the Mastra constructor without a type error. Related: #12773. ([#12857](https://github.com/mastra-ai/mastra/pull/12857))
|
|
287
|
+
|
|
288
|
+
- Fixed TypeScript type errors when using `.optional().default()` in workflow input schemas. Workflows with default values in their schemas no longer produce false type errors when chaining steps with `.then()`. Fixes #12634 ([#12778](https://github.com/mastra-ai/mastra/pull/12778))
|
|
289
|
+
|
|
290
|
+
- Fix setLogger to update workflow loggers ([#12889](https://github.com/mastra-ai/mastra/pull/12889))
|
|
291
|
+
|
|
292
|
+
When calling `mastra.setLogger()`, workflows were not being updated with the new logger. This caused workflow errors to be logged via the default ConsoleLogger instead of the configured logger (e.g., PinoLogger with HttpTransport), resulting in missing error logs in Cloud deployments.
|
|
293
|
+
|
|
3
294
|
## 1.3.0-alpha.2
|
|
4
295
|
|
|
5
296
|
### Patch Changes
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYNXIGRQE_cjs = require('../chunk-YNXIGRQE.cjs');
|
|
4
4
|
var chunkUE2G2LRP_cjs = require('../chunk-UE2G2LRP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Agent", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkYNXIGRQE_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TripWire", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkYNXIGRQE_cjs.TripWire; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "isSupportedLanguageModel", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkYNXIGRQE_cjs.isSupportedLanguageModel; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "resolveThreadIdFromArgs", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkYNXIGRQE_cjs.resolveThreadIdFromArgs; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkYNXIGRQE_cjs.supportedLanguageModelSpecifications; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkYNXIGRQE_cjs.tryGenerateWithJsonFallback; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "tryStreamWithJsonFallback", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkYNXIGRQE_cjs.tryStreamWithJsonFallback; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "MessageList", {
|
|
37
37
|
enumerable: true,
|
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-
|
|
1
|
+
export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-SIZEIYNH.js';
|
|
2
2
|
export { MessageList, TypeDetector, aiV5ModelMessageToV2PromptMessage, convertMessages } from '../chunk-ILQXPZCD.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validateStepInput, createDeprecationProxy, getStepResult, validateStepSuspendData, runCountDeprecationMessage, TripWire, createTimeTravelExecutionParams, validateStepResumeData, Workflow, isSupportedLanguageModel, ProcessorStepOutputSchema, ProcessorStepSchema, Run, WorkflowRunOutput, ExecutionEngine, cleanStepResult, hydrateSerializedStepErrors, Agent, ProcessorRunner } from './chunk-
|
|
1
|
+
import { validateStepInput, createDeprecationProxy, getStepResult, validateStepSuspendData, runCountDeprecationMessage, TripWire, createTimeTravelExecutionParams, validateStepResumeData, Workflow, isSupportedLanguageModel, ProcessorStepOutputSchema, ProcessorStepSchema, Run, WorkflowRunOutput, ExecutionEngine, cleanStepResult, hydrateSerializedStepErrors, Agent, ProcessorRunner } from './chunk-SIZEIYNH.js';
|
|
2
2
|
import { STREAM_FORMAT_SYMBOL, PUBSUB_SYMBOL } from './chunk-2QXNHEDL.js';
|
|
3
|
-
import { createPendingMarker } from './chunk-
|
|
3
|
+
import { createPendingMarker } from './chunk-JNE2ABVB.js';
|
|
4
4
|
import { MessageList } from './chunk-ILQXPZCD.js';
|
|
5
5
|
import { ToolStream } from './chunk-DD2VNRQM.js';
|
|
6
6
|
import { Tool } from './chunk-RS6CZXGA.js';
|
|
@@ -4427,5 +4427,5 @@ var EventedExecutionEngine = class extends ExecutionEngine {
|
|
|
4427
4427
|
};
|
|
4428
4428
|
|
|
4429
4429
|
export { EventedExecutionEngine, EventedRun, EventedWorkflow, StepExecutor, WorkflowEventProcessor, cloneStep, cloneWorkflow, createStep, createWorkflow };
|
|
4430
|
-
//# sourceMappingURL=chunk-
|
|
4431
|
-
//# sourceMappingURL=chunk-
|
|
4430
|
+
//# sourceMappingURL=chunk-3MJCJLZS.js.map
|
|
4431
|
+
//# sourceMappingURL=chunk-3MJCJLZS.js.map
|