@mastra/server 1.16.0-alpha.5 → 1.16.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 +112 -0
- package/dist/{chunk-57IWHVDZ.js → chunk-R3IO7NKS.js} +3 -3
- package/dist/{chunk-57IWHVDZ.js.map → chunk-R3IO7NKS.js.map} +1 -1
- package/dist/{chunk-B4RWYKPG.cjs → chunk-VCBFCDP3.cjs} +3 -3
- package/dist/{chunk-B4RWYKPG.cjs.map → chunk-VCBFCDP3.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/handlers/agent-builder.cjs +16 -16
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers.cjs +2 -2
- package/dist/server/handlers.js +1 -1
- package/dist/server/server-adapter/index.cjs +16 -16
- package/dist/server/server-adapter/index.js +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,117 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added dataset-agent association and experiment status tracking for the Evaluate workflow. ([#14470](https://github.com/mastra-ai/mastra/pull/14470))
|
|
8
|
+
- **Dataset targeting**: Added `targetType` and `targetIds` fields to datasets, enabling association with agents, scorers, or workflows. Datasets can now be linked to multiple entities.
|
|
9
|
+
- **Experiment status**: Added `status` field to experiment results (`'needs-review'`, `'reviewed'`, `'complete'`) for review queue workflow.
|
|
10
|
+
- **Dataset experiment routes**: Added API endpoints for triggering experiments from a dataset with configurable target type and target ID.
|
|
11
|
+
- **LLM data generation**: Added endpoint for generating dataset items using an LLM with configurable count and prompt.
|
|
12
|
+
- **Failure analysis**: Added endpoint for clustering experiment failures and proposing tags using LLM analysis.
|
|
13
|
+
|
|
14
|
+
- Added `getAuthenticatedUser()` to `@mastra/server/auth` so server middleware can resolve the configured auth user without changing route auth behavior. ([#14458](https://github.com/mastra-ai/mastra/pull/14458))
|
|
15
|
+
|
|
16
|
+
**Example**
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { getAuthenticatedUser } from '@mastra/server/auth';
|
|
20
|
+
|
|
21
|
+
const user = await getAuthenticatedUser({
|
|
22
|
+
mastra,
|
|
23
|
+
token,
|
|
24
|
+
request: c.req.raw,
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Added new observability API endpoints and client methods for logs, scores, feedback, metrics (aggregate, breakdown, time series, percentiles), and discovery (metric names, label keys/values, entity types/names, service names, environments, tags) ([#14470](https://github.com/mastra-ai/mastra/pull/14470))
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Added agent version support for experiments. When triggering an experiment, you can now pass an `agentVersion` parameter to pin which agent version to use. The agent version is stored with the experiment and returned in experiment responses. ([#14562](https://github.com/mastra-ai/mastra/pull/14562))
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const client = new MastraClient();
|
|
36
|
+
|
|
37
|
+
await client.triggerDatasetExperiment({
|
|
38
|
+
datasetId: 'my-dataset',
|
|
39
|
+
targetType: 'agent',
|
|
40
|
+
targetId: 'my-agent',
|
|
41
|
+
version: 3, // pin to dataset version 3
|
|
42
|
+
agentVersion: 'ver_abc123', // pin to a specific agent version
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Add optional `?path=` query param to workspace skill routes for disambiguating same-named skills. ([#14430](https://github.com/mastra-ai/mastra/pull/14430))
|
|
47
|
+
|
|
48
|
+
Skill routes continue to use `:skillName` in the URL path (no breaking change). When two skills share the same name (e.g. from different directories), pass the optional `?path=` query parameter to select the exact skill:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
GET /workspaces/:workspaceId/skills/:skillName?path=skills/brand-guidelines
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`SkillMetadata` now includes a `path` field, and the `list()` method returns all same-named skills for disambiguation. The client SDK's `getSkill()` accepts an optional `skillPath` parameter for disambiguation.
|
|
55
|
+
|
|
56
|
+
- Updated skill search result types and query parameters to use `skillName`/`skillNames` instead of `skillPath`/`skillPaths` for consistency with the name-based public API. ([#14430](https://github.com/mastra-ai/mastra/pull/14430))
|
|
57
|
+
|
|
58
|
+
- Added storage type detection to the Metrics Dashboard. The `/system/packages` endpoint now returns `observabilityStorageType`, identifying the observability storage backend. The dashboard shows an empty state when the storage does not support metrics (e.g. PostgreSQL, LibSQL), and displays a warning when using in-memory storage since metrics are not persisted across server restarts. Also added a docs link button to the Metrics page header. ([#14620](https://github.com/mastra-ai/mastra/pull/14620))
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { MastraClient } from '@mastra/client-js';
|
|
62
|
+
|
|
63
|
+
const client = new MastraClient();
|
|
64
|
+
const system = await client.getSystemPackages();
|
|
65
|
+
|
|
66
|
+
// system.observabilityStorageType contains the class name of the observability store:
|
|
67
|
+
// - 'ObservabilityInMemory' → metrics work but are not persisted across restarts
|
|
68
|
+
// - 'ObservabilityPG', 'ObservabilityLibSQL', etc. → metrics not supported
|
|
69
|
+
|
|
70
|
+
if (system.observabilityStorageType === 'ObservabilityInMemory') {
|
|
71
|
+
console.warn('Metrics are not persisted — data will be lost on server restart.');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const SUPPORTED = new Set(['ObservabilityInMemory']);
|
|
75
|
+
if (!SUPPORTED.has(system.observabilityStorageType ?? '')) {
|
|
76
|
+
console.error('Metrics require in-memory observability storage.');
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- Fix Zod v3 and Zod v4 compatibility across public structured-output APIs. ([#14464](https://github.com/mastra-ai/mastra/pull/14464))
|
|
81
|
+
|
|
82
|
+
Mastra agent and client APIs accept schemas from either `zod/v3` or `zod/v4`, matching the documented peer dependency range and preserving TypeScript compatibility for both Zod versions.
|
|
83
|
+
|
|
84
|
+
- Added `ModelByInputTokens` in `@mastra/memory` for token-threshold-based model selection in Observational Memory. ([#14614](https://github.com/mastra-ai/mastra/pull/14614))
|
|
85
|
+
|
|
86
|
+
When configured, OM automatically selects different observer or reflector models based on the actual input token count at the time the OM call runs.
|
|
87
|
+
|
|
88
|
+
Example usage:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { Memory, ModelByInputTokens } from '@mastra/memory';
|
|
92
|
+
|
|
93
|
+
const memory = new Memory({
|
|
94
|
+
options: {
|
|
95
|
+
observationalMemory: {
|
|
96
|
+
model: new ModelByInputTokens({
|
|
97
|
+
upTo: {
|
|
98
|
+
10_000: 'google/gemini-2.5-flash',
|
|
99
|
+
40_000: 'openai/gpt-4o',
|
|
100
|
+
1_000_000: 'openai/gpt-4.5',
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The `upTo` keys are inclusive upper bounds. OM resolves the matching tier directly at the observer or reflector call site. If the input exceeds the largest configured threshold, OM throws an error.
|
|
109
|
+
|
|
110
|
+
Improved Observational Memory tracing so traces show the observer and reflector spans and make it easier to see which resolved model was used at runtime.
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [[`68ed4e9`](https://github.com/mastra-ai/mastra/commit/68ed4e9f118e8646b60a6112dabe854d0ef53902), [`085c1da`](https://github.com/mastra-ai/mastra/commit/085c1daf71b55a97b8ebad26623089e40055021c), [`be37de4`](https://github.com/mastra-ai/mastra/commit/be37de4391bd1d5486ce38efacbf00ca51637262), [`7dbd611`](https://github.com/mastra-ai/mastra/commit/7dbd611a85cb1e0c0a1581c57564268cb183d86e), [`f14604c`](https://github.com/mastra-ai/mastra/commit/f14604c7ef01ba794e1a8d5c7bae5415852aacec), [`4a75e10`](https://github.com/mastra-ai/mastra/commit/4a75e106bd31c283a1b3fe74c923610dcc46415b), [`f3ce603`](https://github.com/mastra-ai/mastra/commit/f3ce603fd76180f4a5be90b6dc786d389b6b3e98), [`423aa6f`](https://github.com/mastra-ai/mastra/commit/423aa6fd12406de6a1cc6b68e463d30af1d790fb), [`f21c626`](https://github.com/mastra-ai/mastra/commit/f21c6263789903ab9720b4d11373093298e97f15), [`41aee84`](https://github.com/mastra-ai/mastra/commit/41aee84561ceebe28bad1ecba8702d92838f67f0), [`2871451`](https://github.com/mastra-ai/mastra/commit/2871451703829aefa06c4a5d6eca7fd3731222ef), [`085c1da`](https://github.com/mastra-ai/mastra/commit/085c1daf71b55a97b8ebad26623089e40055021c), [`4bb5adc`](https://github.com/mastra-ai/mastra/commit/4bb5adc05c88e3a83fe1ea5ecb9eae6e17313124), [`4bb5adc`](https://github.com/mastra-ai/mastra/commit/4bb5adc05c88e3a83fe1ea5ecb9eae6e17313124), [`e06b520`](https://github.com/mastra-ai/mastra/commit/e06b520bdd5fdef844760c5e692c7852cbc5c240), [`d3930ea`](https://github.com/mastra-ai/mastra/commit/d3930eac51c30b0ecf7eaa54bb9430758b399777), [`dd9c4e0`](https://github.com/mastra-ai/mastra/commit/dd9c4e0a47962f1413e9b72114fcad912e19a0a6)]:
|
|
113
|
+
- @mastra/core@1.16.0
|
|
114
|
+
|
|
3
115
|
## 1.16.0-alpha.5
|
|
4
116
|
|
|
5
117
|
### Patch Changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __commonJS as __commonJS$3, require_token_error as require_token_error$2, __toESM as __toESM$3 } from './chunk-JWVHBH4H.js';
|
|
2
|
-
import { actionIdPathParams, actionRunPathParams, streamAgentBuilderBodySchema, startAsyncAgentBuilderBodySchema, resumeAgentBuilderBodySchema, streamLegacyAgentBuilderBodySchema } from './chunk-S7PYDU5I.js';
|
|
3
2
|
import { __commonJS as __commonJS$1, require_token_error, __toESM } from './chunk-BZZVTO7B.js';
|
|
4
3
|
import { __commonJS as __commonJS$2, require_token_error as require_token_error$1, __toESM as __toESM$1 } from './chunk-PWAXLHKP.js';
|
|
5
4
|
import { e, truncateStringByTokens, resolveToolResultValue, formatToolResultForObserver, estimateTokenCount } from './chunk-W2QMKHBI.js';
|
|
6
5
|
import { openai } from './chunk-PALNMAC6.js';
|
|
7
6
|
import { LIST_WORKFLOWS_ROUTE, GET_WORKFLOW_BY_ID_ROUTE, LIST_WORKFLOW_RUNS_ROUTE, GET_WORKFLOW_RUN_BY_ID_ROUTE, CREATE_WORKFLOW_RUN_ROUTE, STREAM_WORKFLOW_ROUTE, START_ASYNC_WORKFLOW_ROUTE, START_WORKFLOW_RUN_ROUTE, OBSERVE_STREAM_WORKFLOW_ROUTE, RESUME_ASYNC_WORKFLOW_ROUTE, RESUME_WORKFLOW_ROUTE, RESUME_STREAM_WORKFLOW_ROUTE, CANCEL_WORKFLOW_RUN_ROUTE, STREAM_LEGACY_WORKFLOW_ROUTE, OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE } from './chunk-G2ZZKKQI.js';
|
|
7
|
+
import { actionIdPathParams, actionRunPathParams, streamAgentBuilderBodySchema, startAsyncAgentBuilderBodySchema, resumeAgentBuilderBodySchema, streamLegacyAgentBuilderBodySchema } from './chunk-S7PYDU5I.js';
|
|
8
8
|
import { listWorkflowsResponseSchema, workflowInfoSchema, workflowRunsResponseSchema, listWorkflowRunsQuerySchema, workflowRunResultSchema, workflowRunResultQuerySchema, createWorkflowRunResponseSchema, workflowExecutionResultSchema, workflowControlResponseSchema } from './chunk-7X4P2I6L.js';
|
|
9
9
|
import { streamResponseSchema } from './chunk-V7EVEI4C.js';
|
|
10
10
|
import { WorkflowRegistry } from './chunk-RGI5IQDO.js';
|
|
@@ -29338,5 +29338,5 @@ var OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({
|
|
|
29338
29338
|
});
|
|
29339
29339
|
|
|
29340
29340
|
export { CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE, CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE, GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE, GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE, LIST_AGENT_BUILDER_ACTIONS_ROUTE, LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE, OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE, OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE, RESUME_AGENT_BUILDER_ACTION_ROUTE, RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE, RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE, START_AGENT_BUILDER_ACTION_RUN_ROUTE, START_ASYNC_AGENT_BUILDER_ACTION_ROUTE, STREAM_AGENT_BUILDER_ACTION_ROUTE, STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE, agent_builder_exports };
|
|
29341
|
-
//# sourceMappingURL=chunk-
|
|
29342
|
-
//# sourceMappingURL=chunk-
|
|
29341
|
+
//# sourceMappingURL=chunk-R3IO7NKS.js.map
|
|
29342
|
+
//# sourceMappingURL=chunk-R3IO7NKS.js.map
|