mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
361 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8d4abc4f88 |
chore(deps): Vanta 2026-11-12 — raise undici to 8.12.4 / 7.30.2 (#30205) | ||
|
|
c22107fce3 |
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.45 (#29844) | ||
|
|
94e5e0dbf2 |
chore(deps): security refresh for templates, examples and integration tests (Vanta) (#29453)
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Dependency updates Refs SEC-256, SEC-261, SEC-262, SEC-263 **2026-11-09:** merged `origin/main` into this branch with a merge commit (no rebase, no force-push). `main` already raised `better-auth` to `^1.7.18` (with its own changeset), so this branch now takes main's version and floors. The old 1.7.16 changeset is removed, and no `better-auth` change is left in this PR. | Package | Where | From → To | Advisory | |---|---|---|---| | chat | `template-genui-data-explorer`, `template-customer-refund-agent` lockfiles (via `@mastra/core`) | 4.41.1 / 4.39.0 → 4.44.0 | AIKIDO-2026-571219 (2026-11-09) | | `@hono/node-server` | `template-customer-refund-agent/client-demo-ui` direct pin | 2.1.5 → 2.1.6 (matches the template's existing 2.1.6 override) | GHSA-jpvv-r467-5p4w and related (2026-11-09) | | next | GenUI template, memory integration tests | 16.4.2/16.4.4 → 16.4.5 | Next.js advisories through 16.4.4 | | fastify | otel-bridge agent-hub | 5.12.6 → 5.12.8 | AIKIDO through 5.12.7 | | shell-quote / proxy-addr / image-size / `@hono/node-server` | MongoDB Bedrock template lockfiles | refreshed (1.12.0 / 2.0.8 / 2.0.4 / 2.1.6) | CVE-2026-102422, CVE-2026-90711, CVE-2025-71329/71330, CVE-2026-118663 | | @opentelemetry/auto-instrumentations-node | MongoDB Bedrock template | ^0.60.0 → ^0.75.0 | CVE-2026-44902 | Empty changeset (`vanta-2026-11-09-template-chat-4-44.md`), because this PR now changes only templates, examples, and integration tests. No published package changes. All versions used were published more than a day ago. No overrides were removed or lowered. Deferred (major-only or no fixed release): extract-zip@2.0.1 (no fix), deepmerge 4.3.1 (no fix), picomatch 4.0.7 (no fix), zod 3.25.76 (fix in 4.x), `@ai-sdk/provider-utils` 2.2.8/3.0.x (fix in 4.0.20+, AI SDK v4/v5 compat lines), ai 4.3.19/5.0.210 (fix in 5.0.52 / 6.0.170), `@azure/msal-node@5.6.0` (7.1.0), minimatch 9/10 (11.0.1), glob 10.5.0/13.0.6 (14.0.2; 13.0.7 is not listed as patched), openai 6.49.0 (7.5.0), `@bufbuild/protobuf@1.10.1` (2.12.1), got 15.1.0 (16.0.0), `@apidevtools/json-schema-ref-parser@11.9.3` (15.5.1), undici 6.29.1 (7.30.1), nanoid 3.3.20 (5.1.16). <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-e7dae54a-e16d-5b3a-ae5d-99ce740a451f?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-e7dae54a-e16d-5b3a-ae5d-99ce740a451f&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 This PR updates several third-party packages to newer versions. The updates include authentication fixes and security-related dependency updates. ## Changes - Updated `better-auth` to `1.7.16` in the workspace, authentication package, and agent example. Added a patch changeset for `@mastra/auth-better-auth` describing session and verification fixes. - Updated `next` to `16.4.5` in the memory integration tests and GenUI data explorer template. - Updated `fastify` to `5.12.8` in the OpenTelemetry bridge example. - Updated OpenTelemetry instrumentation and `zod` in the MongoDB Bedrock agent template. Added scoped `@ai-sdk/provider-utils` overrides and a `compression` override. - Updated the related pnpm and npm lockfiles. ## Validation Build and test results: not available. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: shreyas-mastra <shreyas-mastra@users.noreply.github.com> |
||
|
|
4bd4b7f48e |
chore(deps): update better-auth monorepo to v1.7.18 (#29714)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
|
|
21b6078016 |
feat(mcp-apps-components): draw a whole observability dashboard (#29645)
The observability MCP app used to draw a single widget picked from a few
hard-coded ones, which made it pretty limited on real data. It now draws
a whole dashboard (rows of KPIs, time series, tables and scores), using
the dashboard's default date preset and filters. Each widget loads and
fails on its own.
The model doesn't write the stored dashboard format directly. It writes
a simpler shape where each widget, read and column type is a key, and
each number holds the read it comes from, so nothing points at a query,
series or column by id and a dashboard can't reference something it
lacks. `toObservabilityDashboard` gathers the reads into shared queries,
fills in series keys, totals and default sort, assigns missing widget
ids, and checks the result against `dashboardDefinitionSchema`. A widget
without a `span` fills the row.
```ts
{
span: 6,
timeseries: {
chart: 'stackedBar',
format: 'count',
series: [
{
label: 'Runs',
color: 'green',
value: { metricTimeSeries: { name: ['mastra_agent_duration_ms'], aggregation: 'count' } },
},
],
},
}
```
The schema names the metrics Mastra records so the model doesn't guess
names that read as zero. `createObservabilityDashboardInputSchema({
metricNames })` narrows them to the project's own metrics. The example
server refreshes that list before each run and also exposes a discovery
tool for label keys and values.
```ts
import {
observabilityDashboardInputSchema,
observabilityDashboardOutputSchema,
toObservabilityDashboard,
} from '@mastra/mcp-apps-components';
createTool({
id: 'showObservabilityDashboard',
inputSchema: observabilityDashboardInputSchema,
outputSchema: observabilityDashboardOutputSchema,
execute: async input => toObservabilityDashboard(input),
});
```
Every widget on Studio's metrics dashboard round-trips through the new
shape. On three prompts, gpt-5.5 and gpt-5-mini render every dashboard.
gpt-5.4-mini still struggles with tables.
`@mastra/core` and `zod` are now peer dependencies. To test, run `pnpm
--filter @mastra/mcp-apps-components test`, or run `examples/agent` and
ask the observability agent for a dashboard in Studio.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR changes the observability app from showing one widget to showing
a full dashboard. Each widget can load or show an error on its own, so
one failing widget does not block the others.
## Summary
- Add schemas for model-authored dashboards with KPI, time-series,
table, and score widgets. Convert validated input into a stored
dashboard, sharing matching reads and filling in missing widget IDs and
spans.
- Update the app to render dashboard rows and apply the dashboard’s date
preset and default filters. Show widget-level errors independently.
- Add an example dashboard tool and observability discovery tool.
Support metric-name validation against a project’s catalog.
- Update documentation, exports, pin context, and peer dependencies.
Rename the app resource to `observabilityDashboardApp`.
- Add tests for dashboard schemas, conversion, rendering, widget
failures, date ranges, filters, and pinning.
**Diff:** 18 files changed; 1,938 lines added and 304 removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
d95e580fad |
feat(mcp-apps-components): add an observability widget MCP app (#29557)
Adds `observabilityWidgetApp`, an MCP app that draws one observability
dashboard widget (KPIs, time series…) right in the conversation. It
renders with playground-ui's `StatelessWidget`, so the chart looks and
behaves like the one on the Metrics dashboard.
The app runs sandboxed in the host's iframe and can't reach the Mastra
server, so it reads its data through an app-only `queryObservability`
tool taking `{ action, args }`, where `action` is a `MastraClient`
observability method. That tool lives in the server registering the app,
not in the package, so each deployment chooses its own endpoint and
credentials (local server or a hosted platform):
```ts
import { observabilityWidgetApp, QUERY_OBSERVABILITY_TOOL } from '@mastra/mcp-apps-components';
new MCPServer({
id: 'observability-mcp-server',
appResources: { 'ui://mastra/observability-widget': observabilityWidgetApp },
tools: {
showObservabilityWidget, // model-visible, returns { widget, datePreset }
[QUERY_OBSERVABILITY_TOOL]: queryObservability, // app-only, returns { data }
},
});
```
The app follows the host's light/dark theme. playground-ui exports
`emptyAnswer` so hosts can skip requests whose filters can never match
without calling the server. `examples/agent` gets a full reference
setup: an observability MCP server with preset widgets (overview,
agentRuns, tokenUsage, latency), a read-only `queryObservability` tool
and an observability agent.
Test plan: jsdom tests drive the app through a real MCP server and
`AppBridge`. They cover rendering the server's answer over the preset
window, a failed read, an invalid widget and the light theme. Another
test checks that the built resource is one self-contained HTML page. I
also checked it end to end in Studio against `examples/agent`: the agent
picks the right widget for the question, the chart shows live data and
the tool rejects unknown actions.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR lets a chat show one observability dashboard widget and fetch
its data through a tool provided by the host. Hosts can also let users
pin and unpin widgets, while keeping control of which widgets stay
pinned.
## Summary
- Adds `observabilityWidgetApp`, which renders a dashboard widget in a
sandboxed iframe. The app reads metrics through the server’s app-only
`queryObservability` tool and follows the host theme.
- Adds host integration for widget pinning. `observabilityWidgetPins`
provides pinned IDs to the matching app and forwards valid pin and unpin
updates to host callbacks.
- Extends `McpAppViewer` and the chat tool result flow to pass host
context and receive structured model-context updates.
- Exports `emptyAnswer` from playground-ui’s dashboard domain so callers
can represent requests that need no data.
- Adds an `examples/agent` setup with an observability MCP server, read
tool, agent, and preset widgets.
- Adds tests and documentation for widget rendering, data reads, host
context, and pinning.
**Change size:** 35 files changed; 1,501 lines added and 12 removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
9356f211f3 |
refactor(mcp-apps-components): restart on the MCP Apps spec with a greeting app (#29510)
`@mastra/mcp-apps-components` had grown its own layer on top of the [MCP Apps spec](https://github.com/modelcontextprotocol/ext-apps). The dashboard app read its data through a generic tool that ran the observability routes in-process, which required a Mastra instance and `@mastra/server`. Widget pinning depended on custom host-context keys, which only Studio understood, wired in through an `McpAppHostProvider` in `@mastra/playground-ui`. Every new app would have had to learn this layer, and none of it is part of the spec. This PR restarts the package on the spec alone, with a small app that uses every path an app needs: - **`greetingApp`** (package root) is a React app built into one self-contained HTML page. It reads its tool's arguments from `ui/notifications/tool-input` and gets its data by calling an app-only server tool (`visibility: ['app']`) with `callServerTool`. A button posts a reply to the conversation with `ui/message`. That's everything it does. - **The host writes both tools as regular Mastra tools**: the one the model calls to open the app, and the app-only one that returns the data. Data access and auth stay on the server, so the iframe needs no network access and can't see a token. The package has no peer dependencies anymore. - **Removed:** the dashboard app (`./dashboard-renderer`, `./observability-tools`), widget pinning, the `./host` entry, and `McpAppHostProvider` together with the `onModelContext` and `hostContext` props of `McpAppViewer`. MCP Apps in Studio work as they did before the provider was added. - `examples/agent` replaces the dashboard agent with a greeting agent. Its `getGreeting` tool calls a real remote API on the server side. The README, the MCP docs page and the changeset are updated. Before: ```ts import { dashboardRendererApp } from '@mastra/mcp-apps-components/dashboard-renderer'; import { observabilityAppTools } from '@mastra/mcp-apps-components/observability-tools'; new MCPServer({ appResources: { 'ui://mastra/dashboard': dashboardRendererApp() }, tools: { showDashboard, ...observabilityAppTools }, }); ``` After: ```ts import { greetingApp } from '@mastra/mcp-apps-components'; new MCPServer({ appResources: { 'ui://mastra/greeting': greetingApp }, tools: { showGreeting, getGreeting }, // getGreeting: mcp._meta.ui.visibility = ['app'] }); ``` The package is still in alpha, so the dashboard changesets that were never released are dropped instead of being reverted. ## Test plan - `@mastra/mcp-apps-components`: build, typecheck, lint, tests. - A real `MCPServer` serves the built page over Streamable HTTP. The test checks that the page is a single self-contained document. - The app is rendered against a real `AppBridge` relaying to that server. The tests check that the app greets the name from the tool input with the server's answer, posts the reply message, and shows the tool's error. - `@mastra/playground-ui`: typecheck and the `mcps`/`chat` tests (699 passing). - Manual check in Studio (`examples/agent`): "Greet Ada" opens the app, the app shows the greeting it got from `getGreeting`, and **Say hi back** posts "Ada says hi back!" to the chat, which the agent answers. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 This PR replaces the package’s dashboard app with a small greeting app. The app gets a name, asks the server for a greeting, and lets the user send a reply. ## Summary - Export `greetingApp` and `McpAppResource` from the package root. The app reads the opening tool’s input, calls an app-only server tool, and can send a message to the conversation. - Remove the dashboard renderer, its data and pinning tools, the host entry point, and the package’s custom app runtime. The package now has a single root export and no peer dependencies. - Replace the example dashboard agent and server with a greeting agent and MCP server. Update the README, MCP documentation, and changesets. - Remove Playground’s MCP App host provider and the `hostContext` and `onModelContext` viewer props. The viewer still supports model-context updates through `onUpdateModelContext`. ## Validation The supplied PR objectives report package build, typecheck, lint, and test checks, plus Playground typecheck and `mcps`/`chat` tests with 699 passing. They also report a manual Studio check. These results are not independently verified here. Current-head check results: not available. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
bfe3af4ae1 |
chore(deps): update better-auth monorepo to v1.7.15 (#29497) | ||
|
|
4bb378b97b |
feat(mcp-apps-components): ship one dashboard data tool with the app (#29491)
The dashboard MCP App used to need 11 route-specific tools
(`observabilityAppTools`) registered next to it, and their route list
was defined in the UI package. If you forgot them, the iframe loaded and
every widget failed with a generic error after a few retries.
This replaces them with a single app-only tool, `dashboardDataTool`,
which ships from the same entry point as the app:
```ts
import { dashboardDataTool, dashboardRendererApp } from '@mastra/mcp-apps-components/dashboard-renderer';
new MCPServer({
// ...
appResources: { 'ui://mastra/dashboard': dashboardRendererApp() },
tools: { showDashboard, dashboardDataTool },
});
```
Inside the iframe, each `MastraClient` read (for example
`getMetricAggregate`) becomes a call to that tool with a named
operation. The tool only answers the operations in
`DASHBOARD_DATA_OPERATIONS`, and it runs the matching observability
route in-process with `invokeRoute()` as the signed-in caller, so the
route's own validation, auth, RBAC and FGA checks still apply. Hosts
that want to answer reads themselves can use the exported contract
(`DASHBOARD_DATA_TOOL_NAME`, `DASHBOARD_DATA_OPERATIONS`,
`DASHBOARD_DATA_REQUESTS`, and the input and output schemas).
Widget errors are clearer now too. A missing tool answers 404 with how
to register it, and tool errors answer 400 with the route's message
instead of a serialized `MastraError`. `MastraClient` no longer retries
either one.
The `/observability-tools` entry point is removed, which breaks
compatibility for the alpha (the minor changeset shows the
before/after). This replaces #29449. #29456 will need a rebase onto
this, since `observability-fetch.ts` is gone.
Tested with the package's typecheck, lint and build, and 42 tests,
including integration tests that run a real Mastra server with auth/RBAC
over MCP HTTP, through `AppBridge` and `MastraClient` (allowed read,
403, missing tool, validation errors, no retries).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
The dashboard needs data to show charts and scores. This change gives it
one tool to request that data, while the server applies its existing
checks.
## Summary
- Replaces 11 observability tools with `dashboardDataTool`, which hosts
register alongside `dashboardRendererApp`.
- Defines 11 supported operations and exports the tool name, operation
list, request map, and input and output schemas from
`@mastra/mcp-apps-components/dashboard-renderer`.
- Runs supported requests through `invokeRoute()` with the caller’s
request context, so route validation and access checks apply. The tool
is visible to the app, not the model.
- Adds a fetch adapter that sends dashboard reads through the host’s MCP
connection. It identifies missing tools by JSON-RPC invalid-params code
`-32602`, returns registration guidance, and maps tool errors to HTTP
responses.
- Updates Studio to return JSON-RPC invalid-params errors for
unavailable or model-only tools.
- Removes the `@mastra/mcp-apps-components/observability-tools` package
entry point, breaking alpha compatibility.
## Validation
The PR objectives report that package typecheck, lint, build, and 42
tests passed. These results were not independently verified.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
d09fc6d279 |
fix(examples): point the dashboard agent at the port mastra dev bound (#29446)
The dashboard agent in `examples/agent` connects to its own MCP server over HTTP, but the URL was hardcoded to `localhost:4111`. If something else already holds 4111 (another example, another worktree), `mastra dev` moves to 4112+, the client hits the wrong server and gets a 404, and the agent ends up with no `showObservabilityDashboard` tool, so Studio never renders the dashboard MCP app. Before: ```ts const MASTRA_SERVER_URL = process.env.MASTRA_BASE_URL ?? 'http://localhost:4111'; ``` After (`mastra dev` passes the port it bound as `PORT`): ```ts const MASTRA_SERVER_URL = process.env.MASTRA_BASE_URL ?? `http://localhost:${process.env.PORT ?? 4111}`; ``` Tested by running `pnpm mastra dev` while 4111 was taken. The server fell back to 4112, the agent picked up the dashboard tool, and the chart rendered in Studio chat. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 The dashboard agent needs to connect to the same server that `mastra dev` starts. It now uses the server’s selected port, so the agent can find the dashboard tool even when port 4111 is already in use. ## Changes - `MASTRA_SERVER_URL` uses `MASTRA_BASE_URL` when set. - Otherwise, it uses `PORT`, with port 4111 as the fallback. - Updated the comment to explain that `mastra dev` passes its selected port through `PORT`. ## Testing The supplied context reports a manual check with port 4111 occupied. No automated tests were added. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
944d4bcb13 |
feat(mcp-apps-components): add prebuilt MCP Apps with a dashboard renderer (#29321)
This adds `@mastra/mcp-apps-components`, a package of prebuilt MCP Apps
you can serve from any `MCPServer`, plus the server and client changes
they need to read data safely as the signed-in user. Each app has its
own entry point (no root barrel). The first one is a dashboard renderer:
a tool returns a dashboard definition and the host renders it as live
observability charts.
```ts
import { MCPServer } from '@mastra/mcp';
import { dashboardRendererApp } from '@mastra/mcp-apps-components/dashboard-renderer';
import { observabilityAppTools } from '@mastra/mcp-apps-components/observability-tools';
new MCPServer({
id: 'dashboard-mcp-server',
name: 'Dashboard MCP Server',
version: '1.0.0',
appResources: { 'ui://mastra/dashboard': dashboardRendererApp() },
tools: { showObservabilityDashboard, ...observabilityAppTools },
});
```
## How it works
**The app.** A single self-contained HTML page, inlined into the
package's JS so it survives deployer bundling (Vercel, Netlify,
Cloudflare) with no file reads at runtime. Its iframe never reaches the
network: it reads data with `callServerTool` over the host's existing
MCP connection, so no CSP or `baseUrl` setup is needed. It follows the
host's light/dark theme. Drilldowns continue the conversation when the
host supports `ui/message`; on hosts that also support
`ui/update-model-context`, the app passes the exact filters as
structured context and posts a short prompt, otherwise it spells the
filters out in the message.
**Typed observability tools.** `observabilityAppTools` is 11 app-only
tools, one per read-only observability route the dashboard uses
(trace/span/metric/score aggregates, breakdowns, time series,
percentiles, and score listing). Each takes the route's own input schema
and runs the route in-process through the new `invokeRoute()`.
**`invokeRoute()` (`@mastra/server/server-adapter`).** Runs a JSON
server route in-process as the caller, with the same validation, RBAC
permission and FGA checks its HTTP endpoint applies on every adapter,
and returns `{ status, body }`. It does not re-authenticate: when auth
is configured, the request context must carry the user Mastra server
auth resolved, or the call gets a 401. Non-JSON routes throw, and
HTTP-only handler params (`request`, `registeredTools`, `taskStore`,
`routePrefix`) are not supplied.
**Caller identity in MCP tools.** MCP tools served over HTTP now see the
caller Mastra server auth resolved (user, permissions, roles, resource,
organization) in their `requestContext`, on Hono, Express, Fastify, Koa,
Elysia and NestJS. The server attaches it to the MCP request under a
symbol key, so it can only come from the server, never from
client-supplied auth claims.
**Hiding app-only tools.** `MCPClient.listTools()`/`listToolsets()` hide
tools marked `_meta.ui.visibility: ['app']` from agents.
**Studio host.** Studio advertises the host capabilities it handles
(tool calls, messages, model context), passes its theme, routes app tool
calls to the requested tool in the MCP tool playground, and refuses app
calls to model-only tools. App model context is added to the next user
message only, as a clearly delimited block of untrusted app data, never
as system instructions.
## Try it
`examples/agent` has a `dashboard-agent`. In Studio, try "Show me agent
runs over the last 7 days as a line chart".
## Docs
- New reference page for `invokeRoute()`.
- New "Use prebuilt Mastra apps" section in the MCP connections guide.
## Testing
- `invokeRoute` unit tests (auth, permission, validation, handler
errors, non-JSON routes).
- Shared MCP transport suite case, run on every adapter, checking tools
see the server-resolved user and permissions and unauthenticated calls
get 401.
- `observability-tools` tests through a real Hono server with auth and
RBAC: MCP calls, Studio relay, permission denial, invalid input, and a
bundled-consumer test for the inlined HTML.
- Playground and playground-ui tests for the app viewer and model
context handling.
- Manual Studio run: dashboard renders live data and drilldown sends the
context block with the next message.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR adds ready-made MCP apps, including a dashboard that shows
observability data. It also lets Studio display these apps and pass
their context to chat as untrusted user content.
## What changed
- Added `@mastra/mcp-apps-components` with a dashboard renderer and
app-only observability tools. The tools invoke server routes in-process
and use the routes’ validation and authorization checks.
- Added `invokeRoute()` for in-process execution of eligible JSON
routes.
- Updated MCP server adapters to pass trusted, server-resolved caller
identity to MCP tools. MCP client discovery filters app-only tools from
agent-facing listings.
- Updated Studio and the playground to render MCP apps, relay app tool
calls, provide host capabilities, restrict tool calls and links, and
attach app context to the next chat message.
- Added a dashboard agent example and documentation for MCP Apps and
`invokeRoute()`.
## Validation
The author reports tests for route invocation, observability tools, MCP
transports across all six adapters, and playground app and chat
behavior. The author also reports a manual Studio check. These results
were not independently verified.
The author reports that the npm reservation for
`@mastra/mcp-apps-components` remained open and required an npm
organization admin before merge.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
f0ad164646 |
chore(security): Vanta 2026-11-02 - @hono/node-server 2.1.6 (MCP SDK/templates), graphql-scalars 2.0.1, raw-body 4, jose 6 (overrides) (#29199) | ||
|
|
9ce7e350ea |
chore(deps): lock file maintenance (#29341)
Co-authored-by: wardpeet <ward@coding-tech.com> Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
c7d27f650b |
feat(editor): make model fallback lists editable and persistent (#27287)
Adds opt-in Editor ownership for static model fallback lists on
code-defined agents.
```ts
new Agent({
id: 'support-agent',
model: [
{ id: 'primary', model: 'openai/gpt-5.4-mini' },
{ id: 'fallback', model: 'anthropic/claude-sonnet-4-5' },
],
editor: { model: true },
})
```
Studio can reorder models, change provider/model selections, and enable
or disable entries. These changes follow the configured Editor
persistence workflow:
- Database-backed Editor storage creates versioned drafts that can be
published.
- Code-backed Editor storage saves overrides to the filesystem or
through the configured pull-request workflow.
Persisted entries include their order, provider, model ID, enabled
state, and `maxRetries`. Immutable model IDs reconnect stored values to
code-defined entries while preserving non-serializable code
configuration.
Function-valued model configurations remain code-owned and read-only in
Studio.
This also adds storage support, model-list persistence through the
existing server mutation routes, generated client types, regression
coverage, documentation, and a changeset.
Closes #27089.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This lets teams edit and save an agent’s model fallback list in Studio
without changing code. The feature is opt-in, so existing agents keep
their current behavior by default.
## Summary
- Added `editor: { model: true }` support for code-defined agents.
- Added persistent `modelList` storage with entry IDs, provider, model
ID, enabled state, and `maxRetries`.
- Applied stored overrides by matching immutable entry IDs while
preserving code-owned configuration.
- Persisted reorder and update actions through Editor drafts and
publishing workflows.
- Added filesystem, LibSQL, server route, export, versioning, and client
cache support.
- Kept function-valued model configurations code-owned and read-only in
Studio.
- Updated ownership logic, API schemas, client behavior, and
documentation.
- Added regression coverage for runtime overrides, persistence, exports,
ownership, draft activation, storage compatibility, and query
invalidation.
- Added changesets for the affected packages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
e35d500c14 |
chore(security): Vanta 2026-10-29 - systeminformation 5.33.16, re2js 2.8.8, provider-utils 3.0.42 (nested lockfiles) (#28852) | ||
|
|
9726ebcab4 |
chore(deps): update security updates [security] (#28238)
> [!NOTE] > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [fast-uri@>=4.0.0 <4.1.5](https://redirect.github.com/fastify/fast-uri) | pnpm-workspace.overrides | patch | [`4.2.1` → `4.2.3`](https://renovatebot.com/diffs/npm/fast-uri@>=4.0.0 <4.1.5/4.2.1/4.2.3) | | | [hono](https://hono.dev) ([source](https://redirect.github.com/honojs/hono)) | devDependencies | patch | [`4.13.11` → `4.13.12`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.12) | | | [ip-address@<10.7.1](https://redirect.github.com/beaugunderson/ip-address) | pnpm-workspace.overrides | patch | [`10.7.2` → `10.7.4`](https://renovatebot.com/diffs/npm/ip-address@<10.7.1/10.7.2/10.7.4) | | | [nodemailer](https://nodemailer.com/) ([source](https://redirect.github.com/nodemailer/nodemailer)) | dependencies | minor | [`^10.1.1` → `^10.2.1`](https://renovatebot.com/diffs/npm/nodemailer/10.1.1/10.2.1) | `10.3.0` | | [qs](https://redirect.github.com/ljharb/qs) | pnpm-workspace.overrides | patch | [`6.16.0` → `6.16.1`](https://renovatebot.com/diffs/npm/qs/6.16.0/6.16.1) | | | [qs@>=6.7.0 <6.16.0](https://redirect.github.com/ljharb/qs) | pnpm-workspace.overrides | patch | [`6.16.0` → `6.16.1`](https://renovatebot.com/diffs/npm/qs@>=6.7.0 <6.16.0/6.16.0/6.16.1) | | | [serialize-javascript@<7.0.5](https://redirect.github.com/yahoo/serialize-javascript) | pnpm-workspace.overrides | minor | [`^7.0.5` → `^7.1.4`](https://renovatebot.com/diffs/npm/serialize-javascript@<7.0.5/7.0.5/7.1.4) | | | [systeminformation@<5.32.0](https://systeminformation.io) ([source](https://redirect.github.com/sebhildebrandt/systeminformation)) | pnpm-workspace.overrides | patch | [`5.33.13` → `5.33.16`](https://renovatebot.com/diffs/npm/systeminformation@<5.32.0/5.33.13/5.33.16) | | | [zod](https://zod.dev) ([source](https://redirect.github.com/colinhacks/zod)) | dependencies | minor | [`^4.0.0` → `^4.6.7`](https://renovatebot.com/diffs/npm/zod/4.0.0/4.6.7) | | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/9505) for more information. --- ### fast-uri vulnerable to scheme injection via an unescaped first-segment colon in suffix references [CVE-2026-110725](https://nvd.nist.gov/vuln/detail/CVE-2026-110725) / [GHSA-333x-w4r6-6crp](https://redirect.github.com/advisories/GHSA-333x-w4r6-6crp) <details> <summary>More information</summary> #### Details ##### Impact `fast-uri`'s `serialize()`, `normalize()`, and `resolve()`, when called with the non-default option `reference: 'suffix'` on a reference that has no authority, emit a relative reference whose first path segment contains a bare colon without escaping it. RFC 3986 section 3.3 requires the first segment of a `path-noscheme` reference not to contain a colon, precisely because a bare colon makes the string reparse as an absolute URI with a scheme. `fast-uri`'s default serialization escapes that colon, but the suffix path does not. For example, `normalize('javascript:alert(1)', { reference: 'suffix' })` returns `javascript:alert(1)`, which reparses as a live `javascript:` scheme; `data:` and `vbscript:` behave the same. Applications that serialize or normalize a relative reference with `reference: 'suffix'` and then treat the result as a URI can turn inert input into a live `javascript:`, `data:`, or `vbscript:` URL (a cross-site scripting vector), and `equal()` can conflate a scheme-bearing reference with a relative one. Exposure is limited to applications that use the non-default `reference: 'suffix'` option. ##### Patches Upgrade to `fast-uri` `2.4.8`, `3.1.9`, or `4.2.3`. ##### Workarounds Do not use the `reference: 'suffix'` option on untrusted input. If suffix output is required, percent-encode a colon in the first path segment of the result before treating it as a URI. #### Severity - CVSS Score: 3.7 / 10 (Low) - Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N` #### References - [https://github.com/fastify/fast-uri/security/advisories/GHSA-333x-w4r6-6crp](https://redirect.github.com/fastify/fast-uri/security/advisories/GHSA-333x-w4r6-6crp) - [https://nvd.nist.gov/vuln/detail/CVE-2026-110725](https://nvd.nist.gov/vuln/detail/CVE-2026-110725) - [ |
||
|
|
f6cd11f348 |
chore(deps): lock file maintenance (#28672)
This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/9505) for more information. 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 6am on wednesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19--> --------- Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
07c1bf2362 |
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.42 (#28773) | ||
|
|
f2ad3844f3 |
chore(deps): update opentelemetry (#28581)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
29747ebd1d |
chore(deps): update better-auth monorepo to v1.7.13 (#28538)
This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [@better-auth/drizzle-adapter@<1.7.7](https://www.better-auth.com/docs/adapters/drizzle) ([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/drizzle-adapter)) | pnpm-workspace.overrides | patch | [`1.7.7` → `1.7.13`](https://renovatebot.com/diffs/npm/@better-auth%2fdrizzle-adapter@<1.7.7/1.7.7/1.7.13) | `1.7.14` | | [better-auth](https://better-auth.com) ([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth)) | pnpm-workspace.overrides | patch | [`^1.7.7` → `^1.7.13`](https://renovatebot.com/diffs/npm/better-auth/1.7.7/1.7.13) | `1.7.14` | | [better-auth](https://better-auth.com) ([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth)) | dependencies | patch | [`^1.7.12` → `^1.7.13`](https://renovatebot.com/diffs/npm/better-auth/1.7.12/1.7.13) | `1.7.14` | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/9505) for more information. --- ### Release Notes <details> <summary>better-auth/better-auth (@​better-auth/drizzle-adapter@<1.7.7)</summary> ### [`v1.7.13`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1713) [Compare Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.12...v1.7.13) ### [`v1.7.12`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1712) [Compare Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.11...v1.7.12) ### [`v1.7.11`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1711) [Compare Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.10...v1.7.11) ### [`v1.7.10`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1710) [Compare Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.9...v1.7.10) ### [`v1.7.9`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#179) [Compare Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.8...v1.7.9) ### [`v1.7.8`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#178) [Compare Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.7...v1.7.8) ##### Patch Changes - [#​11512](https://redirect.github.com/better-auth/better-auth/pull/11512) [`4175b34`]( |
||
|
|
e4d737bfe0 |
feat(playground-ui): make span details say what each span did (#28687)
The span details panel in Studio traces used to show raw input and output first, so you had to dig through JSON to understand what a span actually did. This reworks it so each span tells you up front. Each nested span now opens with a one-sentence summary naming who did what, e.g. "gpt-5-mini called weatherInfo, then wrote the answer", "Observational Memory loaded 2 earlier messages from memory into the conversation" or "Moderation left the system prompt and the conversation unchanged", tinted by outcome. Memory, workspace, skill and processor spans show exactly which messages they added or removed right inside that summary (including processors that edit the system prompt directly, which we now diff). Model spans list the tool calls they made in the summary, each opening on its input and result with the same rows as the chat. The root span skips the summary unless the run failed or was stopped, since its input and output already say it all. Every span now reads in the same order: changes, input, output, then error, tools, metadata and attributes. Metadata and attributes are folded by default as raw JSON. JSON views are no longer clipped behind an Expand button and instead open with top-level values folded; outputs with nothing to preview (like a step that only called tools) go straight to JSON. Section actions (Preview, JSON, copy) appear on hover or focus. Also adds `examples/agent/src/seed-history-traces.ts`, which clones recorded traces across the last 60 days with realistic volume and some failures, to populate the trace explorer and metrics locally. Tested with Vitest + MSW (traces and chat suites pass), typecheck and lint, and manually against real traces in Studio. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 The trace details panel now explains what each part of a run did, what changed, and which tools were called. A new script can add sample trace history from the past 60 days to local data. ## What changed - Added outcome summaries for model, tool, agent, processor, and streamed-output spans. Root spans show a summary only when a run fails or stops. - Added processor change details, including message mutations and system-prompt changes. Processor facts, such as phase and tripwire information, appear as labeled values. - Separated model tool calls from the tools offered to the model. Tool calls show their inputs and results in a read-only view. - Updated span panels to show sections in this order: changes, input, output, error, tools, metadata, and attributes. Metadata and attributes open as folded JSON. JSON views fold top-level values. - Added `examples/agent/src/seed-history-traces.ts` to clone trace data with new IDs and shifted timestamps, then seed spans, metrics, scores, and logs into DuckDB. The script defaults to 900 runs over 60 days and adds a higher failure rate during a simulated incident window. - Added and updated tests for outcome summaries, processor changes, payload rendering, and tool-call display. - Updated the Storybook build script to build `@mastra/ai-sdk` before building Storybook. ## Validation The PR objectives report passing Vitest and MSW trace and chat suites, typecheck, lint, and manual checks against real Studio traces. These results are author-reported; no test execution results were supplied. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
34983c9bbb |
chore(security): Vanta 2026-10-23/26 - storybook 9.1.21, body-parser, fast-uri, multer, serialize-javascript, zod pins, esbuild/bundle-name overrides (#28325)
## Update 2026-10-26 afternoon (Vanta pass) Added commit ` |
||
|
|
be82e8d1b5 |
security: Vanta remediation (2026-10-22 → 2026-10-23: storybook, vitest 4.1.12, toml 5.0.1, fastify, ip-address) (#28138) | ||
|
|
2f485b2d56 |
chore(deps): update security updates [security] (#28222) | ||
|
|
7c86dc176d |
feat(react,playground-ui): live-update the traces list with delta polling (#27967)
## Description
Auto-refresh in the traces explorer reloaded page 0 every 10 s. That
reset the keyset cursor chain, so pages you'd scrolled to were dropped
on every tick.
When the server reports the `deltaPolling` capability, the explorer now
polls `queryTraces({ mode: 'delta' })` and merges new or updated traces
into the list it already has. Loaded pages and scroll position survive
refreshes, and the infinite query only paginates. Without the
capability, nothing changes.
In `@mastra/react` this adds `useTraceQueryLatest`, which you render
next to `useTraceQuery` with the same `query` and `limit`:
```tsx
const { enabled: live } = useTraceQueryDeltaPollingAvailable();
const list = useTraceQuery({ query, limit });
useTraceQueryLatest({ query, limit, enabled: live, refetchInterval: 10_000 });
```
It bootstraps a cursor, drains `hasMore` in one poll, re-bootstraps on
409, and stops polling on 4xx/501. Merges keep the server's keyset order
and upsert by `traceId`. A trace that sorts past the last loaded row is
left to pagination while more pages remain. The cursor key leaves out
`orderBy`, so re-sorting keeps the cursor. `mergeTraceQueryDelta` and
`traceQueryKey` are exported too.
In the playground, delta polls need the exact same time range on every
poll. So a rolling window reaches 24 h ahead, and re-anchors when
filters or dates change. A tab left open past that horizon with no
filter change stops picking up new traces until a refresh.
Known gap: the cursor bootstrap runs in parallel with the first page, so
a trace that completes in the few milliseconds between the two can be
missed until a manual refresh. Bootstrapping before the first page would
close it; happy to do that here or in a follow-up.
## Related issue(s)
None yet.
## Type of change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have linked the related issue(s) in the description above
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
The traces list can now show new or changed traces without reloading
everything. It keeps loaded pages, pagination, and scroll position.
## What changed
- Added delta polling to `@mastra/react`.
- Added `useTraceQueryLatest`, `useTraceQueryDeltaPollingAvailable`,
`traceQueryKey`, and `mergeTraceQueryDelta`.
- Added cursor bootstrapping, batch draining, 409 recovery, retry
handling, and permanent-error handling.
- Updated the playground traces explorer to use delta polling when
supported.
- Preserved full-list refresh behavior when delta polling is
unavailable.
- Added stable time anchors for rolling and fixed trace filters.
- Set delta polling to 30 seconds.
- Re-sorted updated traces when their sort value changes.
- Added tests for capabilities, merging, polling, pagination, filtering,
sorting, and fallback behavior.
- Added a trace-seeding example and updated test fixtures.
## Known limitations
- A trace can be missed if it completes between cursor bootstrapping and
the first page request. A manual refresh is required.
- Rolling delta polling can stop finding new traces after the 24-hour
horizon. Refresh the tab to reset the window.
## Validation
Tests were added, but no test command or result was provided.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
4f60903242 |
chore(deps): lock file maintenance (#27013) | ||
|
|
f3cf77305f |
security: Vanta remediation (2026-10-20) (#27828) | ||
|
|
fa409d430b |
security: Vanta remediation pass 2026-10-14/15/19 (zod 4.6.7, @ai-sdk/provider-utils, @copilotkit template) (#27023) | ||
|
|
7aec8b0d95 |
security: Vanta remediation pass 2026-10-12 (better-auth, MCP SDK) (#26773)
## Summary Vanta remediation for 2026-10-12. Target list is today's live export (77 findings, 44 unique IDs). Platform findings are handled in mastra-ai/platform#3317. ### What changed | Package | From → To | Findings | Where | How | |---|---|---|---|---| | better-auth | 1.7.5 → 1.7.7 | AIKIDO-2026-373183 (Critical) | root + `examples/agent` | raise override `better-auth: ^1.7.7`; direct dep `@mastra/auth-better-auth` ^1.7.7 | | @better-auth/drizzle-adapter | 1.7.5 → 1.7.7 | AIKIDO-2026-261025 (Low) | root + `examples/agent` | floor `'@better-auth/drizzle-adapter@<1.7.7': 1.7.7` (also pulled by better-auth 1.7.7) | | @modelcontextprotocol/sdk | 1.31.0 → 1.32.1 | AIKIDO-2026-365378 (High), -156139, -344432 | root, nested locks, `scripts/gh-issue-triage` | raise floor to `<1.32.0 → 1.32.1`; bump direct pins/ranges | Nested `pnpm-workspace.yaml` floors raised in e2e-tests/*, examples/*, integration-tests, etc., and those lockfiles regenerated. Versions used were published >24h ago (minimumReleaseAge). Patch changeset included for published packages whose dependency ranges changed. Aikido lens on this branch: better-auth and MCP SDK findings are gone. OSV: handlebars already clear on main; remaining high are braces/extract-zip (no patch). ### Left as-is (no patch, or major-only) - extract-zip ≤2.0.1: no fix (overdue; removed by #25855 when that lands). Needs Vanta risk acceptance. - braces 3.0.3, sprintf-js 1.0.3/1.1.3: no patched release - postcss-selector-parser 6.x: @tailwindcss/typography pins 6.0.10 - katex 0.16: mermaid declares ^0.16.47 - @ag-ui/client 0.0.59: fix only in 1.0.0 (major). Parent `@copilotkit/channels-*` 0.11.0 pins 0.0.59 exactly (template-genui-data-explorer) - @hono/node-server 1.19 (fix 2.1.3), undici 6.29 (fix 7.23/8.10), raw-body 3 in templates (fix 4), bundle-name 3 (fix 4.1.1), got 15 (fix 16), zod 3.25 (fix 4.x), @bufbuild/protobuf 1.10 (fix 2.x), openai 6.49 (fix 7.x), jose 5.10 via @segment/analytics-node in template (fix 6.x), @ai-sdk/provider-utils 2.2.8 / 3.0.x Aikido ranges wanting 4.0.18+: major-only or scanner range noise Do not merge unless reviewed. No CI weakened. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR updates shared dependency versions so the project uses newer releases of Better Auth and the MCP SDK. It also updates workspace rules to keep older versions from being selected. ## Changes - Updated Better Auth requirements and workspace overrides to `^1.7.7`. - Updated `@modelcontextprotocol/sdk` requirements and overrides to `1.32.1` across affected packages and workspaces. - Added overrides for older `@better-auth/drizzle-adapter` versions to use `1.7.7`. - Added a patch changeset for `@mastra/auth-better-auth`, `@mastra/mcp-registry-registry`, and `@mastra/playground-ui`. Test results and review findings were not provided. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
ea7ca755a4 |
security: Vanta remediation pass 2026-10-07 (MCP SDK, sharp, hono) (#26260) | ||
|
|
bf0dd07091 |
security: Vanta remediation pass 2026-10-05 (#25966)
Update 2026-10-06 (commits added on this branch; origin/main merged in to clear the lockfile conflict) Dependabot opened new alerts overnight (4 critical). This pass adds: - braintrust ^3.24.0 -> ^3.36.0 in @mastra/braintrust. braintrust 3.27 pulled in simple-git 3.36.0, which has critical and high advisories (GHSA-x6jw-m9v5-85vh, GHSA-v5rq-49vh-5v5c via @simple-git/argv-parser 1.1.1, GHSA-858h-whjf-mvg5, GHSA-g4wm-2vf7-vfgr). Those are only fixed in simple-git 4. braintrust 3.36 no longer depends on simple-git, so simple-git drops out of the lockfile. @mastra/braintrust only uses initLogger and currentSpan. - wrangler ^4.110.0 -> ^4.147.0 (devDependency of @mastra/deployer-cloudflare, type-only import). This moves workerd 1.20260708.1 -> 1.20261001.1 on that chain (Aikido medium). workerd 1.20260714.1 is still there through the miniflare 4 devDependency in stores/cloudflare and stores/cloudflare-d1. - source-map-js 1.2.1 -> 1.2.2 (GHSA-68fv-2mgg-jv7q, high). Added the floor `source-map-js@>=1.0.0 <1.2.2: 1.2.2` in the root and in 15 nested pnpm workspaces (9 e2e projects, mastracode/web, otel-bridge agent-hub and hono-multi, agent-builder, mcp and memory integration-tests). postcss, css-tree, magicast and @tailwindcss/node all declare ^1.2.x. In the customer-refund template, a plain npm lock refresh was enough (no override). - postcss-selector-parser: raised the existing floor from `>=7.1.0 <7.1.3: 7.1.3` to `>=7.1.0 <7.1.6: 7.1.6` (GHSA-rj75-hqrm-r3gf, medium). - observability/_examples/otel-bridge/hono-multi: tsx catalog ^4.21.0 -> ^4.23.15. tsx 4.23 uses esbuild ~0.28, so esbuild 0.27.2 is gone (Aikido high and low, fixed in 0.28.1). - Changeset `.changeset/vanta-2026-10-06.md`: patch for @mastra/braintrust. Still not fixed (as of 2026-10-06) - sprintf-js 1.0.3/1.1.3 (GHSA-hp3w-g68c-fv3c): no patched release. - postcss-selector-parser 6.0.10/6.1.3: the fix is only in 7.1.6. @tailwindcss/typography 0.5.20 pins 6.0.10 exactly, and cssnano 6/postcss-calc 9 use ^6. - katex 0.16.47 (GHSA-238p-pmpm-9mq7, low): the fix is in 0.18.2. mermaid 12.1.0 still declares ^0.16.47. - http-cache-semantics: 4.3.0 is now older than 24h, but it still doesn't touch the max-stale path, and the advisory still lists no patched version. - braces 3.0.3 has no new release. - The rest of the deferred list below is unchanged. --- Vanta remediation for 2026-10-05. The finding list was rebuilt from GitHub Dependabot, OSV-scanner on every tracked lockfile, and Aikido intel (full intel.aikido.dev feed re-pulled today). It is not a Vanta export. What changed Package bumps - probe-image-size ^7.2.3 -> ^7.4.0 in @mastra/memory (GHSA-gjj5-9665-rwrc, high). - verdaccio ^6.10.4 -> ^6.10.5 in the 9 e2e projects. That moves @verdaccio/core to 8.3.2 and js-yaml 5.2.2 -> 5.4.1 (GHSA-r3ph-w7gj-g6xm, medium). - smol-toml 1.8.0 -> 1.9.0 pin in @mastra/code-sdk. Root lockfile refresh (no range changes) - serialize-javascript 7.0.5 -> 7.1.2, shell-quote 1.10.0 -> 1.12.0, ws 7.5.11 -> 7.5.13, enhanced-resolve -> 5.26.0, fs-extra 11.3.5 -> 11.4.1, @sinclair/typebox 0.27.8 -> 0.27.12, @zip.js/zip.js 2.8.26 -> 2.23.0, memfs/@jsonjoy.com/fs-snapshot 4.57.2 -> 4.80.0, @vue/* 3.5.38 -> 3.5.43. pnpm overrides, for parents that pin an exact vulnerable version. All stay in the same major. - modern-tar 0.7.7 (just-bash), smol-toml 1.9.0 (just-bash, @blaxel/core, @react-grab/cli, modal), strnum 2.4.2 (fast-xml-parser 5.10.1), inline-style-parser 0.2.9 (style-to-object 1.0.11), `@opentelemetry/configuration>yaml` 2.9.1 (sdk-node 0.221). Nested lockfiles - shell-quote floor raised from <1.10.0 to <1.11.0 in examples/agent, examples/voice-agent and otel-bridge/agent-hub. - yaml 2.9.0 -> 2.9.1 in e2e-tests/pkg-outputs, examples/durable-agents, mastracode/web, packages/mcp/integration-tests and the customer-refund template. - next 16.3.6 -> 16.3.8 in packages/memory/integration-tests. - customer-refund template: tinypool 2.1.0 -> 2.1.2 through an override scoped to oxfmt. oxfmt 0.59 pins it exactly, and bumping oxfmt would change the template's format check. Not fixed here - braces 3.0.3 (GHSA-vfj7-8cjw-p6xm) and http-cache-semantics 4.2.0 (GHSA-ch52-4w7c-c8xp): no patched release. http-cache-semantics 4.3.0 is outside the advisory range, but it doesn't change the max-stale code path, so bumping to it would only hide the alert. - extract-zip 2.0.1: no patched release. It comes from the webdriverio chain that #25855 removes. - workerd 1.20260708/1.20260714 (Aikido medium): miniflare 4.x stops at workerd 1.20260730. The fix needs miniflare 5, which is only published as an alpha. - Major-only: @ai-sdk/provider-utils 2.2.8 / ai 4.3.19 (AI SDK v4), @opentelemetry/core 1.30.1, esbuild 0.18/0.25/0.27.0 (convex pins 0.27.0 exactly), js-yaml 3, brace-expansion 1/2, uuid 11, zod 3, pino 8/9, undici 6, plus other Aikido lows. - websocket-driver 0.7.5: Aikido says the fix is 0.8.x, but no 0.8 is published on npm. The changeset is a patch for @mastra/memory and @mastra/code-sdk. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR updates several dependencies that have security fixes. It also adds version rules so nested projects use safer versions of related packages. ## Changes - Updates `probe-image-size` in `@mastra/memory` to `^7.4.0` and pins `smol-toml` in `@mastra/code-sdk` to `1.9.0`. - Updates Verdaccio to `^6.10.5` in nine end-to-end test projects. - Raises `shell-quote` overrides to `1.11.0` and adds overrides for transitive dependencies, including `yaml`, `source-map-js`, `postcss-selector-parser`, `modern-tar`, `smol-toml`, `strnum`, `inline-style-parser`, and `tinypool`. - Updates `braintrust` to `^3.36.0`, `wrangler` to `^4.147.0`, and `tsx` to `^4.23.15`. - Adds patch changesets for `@mastra/memory`, `@mastra/code-sdk`, and `@mastra/braintrust`. The changesets report no API changes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
4358322b7b |
chore(deps): override upstream-blocked vulnerable transitive deps (#25853) | ||
|
|
a12f927ace |
feat(playground): workspace page rebuilt around a WorkspaceTreeView file browser (#25700)
## Summary Replaces the Studio workspace page (file browser grid + Skills tab + separate skill detail page) with a single `WorkspaceTreeView` component from `@mastra/playground-ui`. **`WorkspaceTreeView` (playground-ui)** - Lazily loaded folder tree (DS `Tree`) with nested folder creation, delete, read-only paths, mount badges (provider icon, read-only lock, error alert), and auto-expansion to the active file. - Combined file + skill search (BM25/vector picked by the server). - File viewer: Markdown (YAML frontmatter shown as a code block), highlighted code, images, videos; overridable via `renderPreview`. - Controlled `activeFilePath` / `onActiveFileChange`; optional `addSkill` opens the skills.sh browser (dialog moved from playground). - Error notices by cause (401/403/404/501), empty state with "New folder" / "Add skill". **Workspace page (playground)** - One tree view instead of tabs; workspace selector moved to the header. - Old skill URLs redirect to the skill's `SKILL.md` in the viewer. - Page-level notices: `workspace.init()` required, and skills installed in `.agents/skills` but not discovered. - Update-all / remove skill wired through the tree. - Removed the now-unused FileBrowser, SkillsTable, SkillDetail, search panels and their hooks. **Shared fixes** - `PanelGroup` no longer animates from provisional sizes on first render. - `Tree.FolderContent` uses the fill animation so lazily loaded folders don't jump. ## Known gaps vs main - No tree sorting; `?path=` param not handled; large Markdown files with many code blocks still block the main thread while Shiki highlights (same as main). ## Test plan - [x] `pnpm --filter ./packages/playground-ui` vitest: workspace, Tree, resize (84 tests) - [x] `pnpm --filter ./packages/playground` vitest: workspace domain + page - [x] typecheck + eslint clean in both packages - [x] Manual in Studio against `examples/agent`: browse, open nested file via URL, search, create/delete folder, install a skill from skills.sh, notices (via intercepted responses), mobile/tablet/desktop ## Screenshots (Studio on :4111, `examples/agent`) **Skill opened from URL** — parents auto-expanded, frontmatter shown as YAML, "1 Skill" count : render system prompts as markdown and collapse long span payloads (#25571)
## Summary - **System prompts as markdown:** in trace previews (`AGENT_RUN`, `MODEL_STEP`, `MODEL_INFERENCE`, `MODEL_GENERATION` inputs), system messages showed raw markdown (`#`, `**`, `-`). They now go through the markdown renderer like other roles. The common indentation is removed first, so indented prompts don't turn into code blocks. - **Collapsible payload boxes:** every span Input/Output box, in both Preview and JSON, collapses past 220px with a bottom fade. An Expand/Collapse button sits in the section header. The fixed `max-h-[30vh]` inner scroll on JSON blocks is removed. - **Shared `CollapsibleBox` + `useCollapsibleBox`** (new DS component): the box measures its content, clips it and fades the bottom. The hook holds the state, so each consumer places its own expand button. `Plan` (submit_plan card) and span payload sections both use it. ## Test plan - [x] Tests for `CollapsibleBox` (fits, overflows, external toggle, custom height), `Plan` and span payloads pass - [x] Storybook story `Elements/CollapsibleBox` renders with the clipped fade and the Expand button - [x] `pnpm --filter ./packages/playground-ui typecheck` and lint - [ ] Manual: open a trace of an agent with markdown instructions. In Input › Preview, headings, bold and lists are formatted, and long boxes collapse and expand in both Preview and JSON <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 The Playground now shows system prompts with readable Markdown formatting. Long trace payloads start in a compact view, with a control to expand or collapse them. ## Changes - Dedent message text and render it as Markdown in trace previews. - Add shared `CollapsibleBox` and `useCollapsibleBox` APIs. Use them for span payloads and the `Plan` component. - Collapse span input and output at 220px. Show a bottom fade and an Expand/Collapse button when content is clipped or expanded. - Remove the 30vh scroll limit from JSON payloads. - Add tests for Markdown message rendering and collapsible content. ## Validation The PR objectives report passing tests for `CollapsibleBox`, `Plan`, and span payloads, the `Elements/CollapsibleBox` Storybook story, typecheck, and lint. Manual verification is unchecked. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
aeddbc9909 |
security: Vanta 2026-09-28 residuals (template proxy-addr, nested undici/next/shell-quote/form-data, OTEL, onnxruntime) (#25344) | ||
|
|
7b777d38d9 |
security: Vanta zero pass 2026-09-23 (grpc/compression/provider-utils floors) (#24848) | ||
|
|
adce402cd1 |
feat(playground): redesign the /new empty-state landing (#24809)
https://github.com/user-attachments/assets/2a9dc6b6-b8c3-4dd7-b79b-b8de48dec4ff ## Summary Before the first message, the agent chat page now reads as a landing rather than an empty chat: - **Greeting**: agent avatar (initial) above "What can **<agent name>** do for you today?", with the name as the only high-contrast part. - **Composer centered** under the greeting, and the **suggested prompts as a plain list** below it (ghost buttons, no cards). Prompt cap bumped 3 → 6; the chef example agent ships 6. - **Threads panel hidden** on `/new` when the agent has no threads yet; it appears after the first message. - **Landing-shaped skeleton** while the agent loads, so `/new` resolves in place instead of jumping from a docked-chat skeleton. - **Model picker skeleton** in the composer while providers load, so the action row no longer collapses/flashes. - **View transition** when leaving the landing after the first send: the composer glides to the dock. Only fires for a send (chat running); history loads on refresh / thread switch snap as before. Respects `prefers-reduced-motion`. ## Test plan - [x] `pnpm --filter ./packages/playground test` — new MSW coverage for landing (panel hidden, greeting, skeleton gating), model-picker skeleton, prompt stagger; typecheck + lint clean - [x] Manually verified on `examples/agent` (chef agent) at 390 / 820 / 1440 px, reduced-motion, and the first-send transition - [ ] Reviewer: refresh an existing thread and switch threads — composer must not slide <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 The `/new` page now gives users a clearer starting point before their first message. It shows an agent greeting, a message box, and suggested questions, with the threads panel adjusted to the agent’s available conversations. ## Changes - Redesigned the empty-thread landing with a centered composer and up to six suggested prompts in a vertical list. - Updated threads panel behavior for agents with and without memory. For agents with memory, the panel collapses on a threadless landing and reopens when a thread exists. - Added a landing-page loading skeleton and a composer skeleton while model providers load. - Added a first-send view transition and greeting and prompt animations. Reduced-motion preferences disable these animations. - Added and updated tests for landing states, suggested prompts, and the loading model picker. Test execution results were not provided. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
6c82d74c13 |
security: scrub nested proxy-addr@2.0.7 + floor @fastify/proxy-addr 5.1.1 (Vanta zero) (#24597)
## Summary - Scrub **all** nested `pnpm-lock.yaml` files that still pinned `proxy-addr@2.0.7` (e2e + examples), via nested `pnpm-workspace.yaml` / `package.json` overrides + lock regenerate. - Floor **`@fastify/proxy-addr@<=5.1.0 → 5.1.1`** (AIKIDO-2026-296561 / CVE-2026-92395) in root + nested otel-bridge examples. - Expand Vanta/Aikido floors (overrides allowed): `fast-uri` 3.1.8 / 4.2.1, `ip-address` 10.7.2, `compression` 1.8.2, `@fastify/busboy` 3.2.2, `@fastify/forwarded` 3.0.2, `systeminformation` 5.33.13, `tinypool` 2.1.2, `axios` 1.20.0, `better-auth` ^1.6.26, `jose` ≥4.14→6.2.12, `ajv` 8.20.0, `hono` <4.13.8→4.13.8, `zod` 4.x→4.6.5. ## Dependabot expectation after merge | Alert | Expectation | |---|---| | `extract-zip@2.0.1` (High ×2) | **Remain open** — no patched release (`<=2.0.1`). Pulled by `@puppeteer/browsers`. Residual; dismiss with “no patched release / transitive via puppeteer” or replace puppeteer browser fetch path later. | | `@ai-sdk/provider-utils` <3.0.28 (Low ×4) | **3.x/4.x/5.x lines already floored**. Residual on **`2.2.8`** in `packages/_vendored/ai_v4` + AI SDK v4 consumers — bumping to 3.x breaks AI SDK v4 contract. Keep / dismiss as risk-accepted until vendored AI SDK v4 is retired. | ## Residuals (mastra Aikido / intentional) - **`zod@3.25.76`** — AIKIDO fixes are 4.x-only; zod-v3 e2e + AI SDK v4 peers still need 3.x. - **`raw-body@2.5.3` / `3.0.2`** — only fix is 4.0.0 (major); leave until Express/body-parser adopt it. - **`undici@6.28.1` / `7.29.1`** — some AIKIDO IDs only fixed on newer majors; same-major already at current floors. - **`yargs@17.7.3`** — fix is 18.1.0 (major). - **`extract-zip@2.0.1`**, **`@ai-sdk/provider-utils@2.2.8`** — see Dependabot table. ## Test plan - [x] `pnpm install --frozen-lockfile` at repo root - [x] No `proxy-addr@2.0.7` in any lockfile on branch - [x] Root lock has `@fastify/proxy-addr@5.1.1` - [ ] Required CI green on this PR (do not merge) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR tells the project to use safer versions of several third-party packages. It also updates nested dependency locks so security scans no longer find the affected vulnerable versions. ## Summary - Added or updated pnpm overrides across the root project, e2e workspaces, examples, and OTEL bridge examples. - Removed references to `proxy-addr@2.0.7` from affected nested lockfiles. - Raised dependency floors for: - `@fastify/proxy-addr` - `fast-uri` - `ip-address` - `compression` - `@fastify/busboy` - `@fastify/forwarded` - `systeminformation` - `tinypool` - `axios` - `better-auth` - `jose` - `ajv` - `hono` - `zod` - Updated `minimumReleaseAgeExclude` entries for selected patched package versions. - Added workspace overrides for related transitive dependencies, including `qs`, `brace-expansion`, `nanoid`, `js-yaml`, `adm-zip`, and `image-size`. - Updated OTEL bridge build permissions for `esbuild` and `protobufjs`. - Residual findings remain for dependencies such as `extract-zip@2.0.1` and `@ai-sdk/provider-utils@2.2.8` because of compatibility or patch availability constraints. - Test results and CI completion status are not established by the supplied change summaries. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
2ea44c1b57 |
feat(mcp)!: adopt the native 2026-07-28 request lifecycle (#23876)
Co-authored-by: Mastra Code (anthropic/claude-fable-5-1) <noreply@mastra.ai> Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
ed68ec727a |
feat(playground): add readable trace payload previews (#24322)
Trace inputs and outputs now have read-only previews for messages, reasoning, tool calls, attachments, and interrupted runs. A JSON switch exposes the original payload, with consistent Shiki rendering across payloads, errors, metadata, and attributes. Unsupported shapes retain a JSON fallback, and recorded tools never expose execution or approval actions. Includes component tests and Storybook coverage for the panel and detail views, along with changesets. The branch also includes previously committed agent example dependency updates. Validation: 36 focused span-payload tests pass, playground-ui typecheck passes, and lint/pre-commit checks pass. Earlier iterations were also checked in Storybook across mobile, tablet, and desktop; the latest switch and spacing changes were covered by component tests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 The playground now shows trace data in a readable format. Users can switch to the original JSON, while recorded tool calls remain view-only. ## Changes - Added shared renderers for messages, reasoning, tool calls, results, attachments, model outputs, interruptions, tripwires, and errors. - Added rich/JSON views with consistent Shiki JSON highlighting. - Added JSON fallbacks for unsupported payloads. - Kept recorded tools read-only without execution, approval, or resume actions. - Added safe rendering for valid HTTP(S) media attachments. - Replaced trace input, output, error, metadata, and attribute sections with shared payload sections. - Added copy controls and panel/details layouts. - Added component tests, Storybook stories, and changesets. - Updated example dependencies and Storybook build configuration. ## Validation The supplied summary reports 36 focused span-payload tests, UI typechecking, lint, and pre-commit checks. Individual command results are not available. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
b1530d39f1 |
refactor(playground): reuse top-level lists in the agent Evals tabs (#24139)
The agent Evaluate page had its own hand-rolled tables for Datasets,
Experiments, Scorers and Review, each drifting from the top-level
`/datasets`, `/experiments`, `/scorers` and `/experiments/review-queue`
pages. This PR makes the four tabs render the same shared components, so
the agent view looks and behaves like the rest of Studio and there's one
place to fix things.
`DatasetsList`, `ExperimentsList` and `ScorersList` gain optional
`onSelect*` / `selected*Id` / `keyboardGlobal` props so they can drive a
side panel and tab-scoped keyboard roving instead of navigating.
`DatasetReview` gains an optional `onCreateScorer` prop for the
agent-only "Create Scorer" affordance. The legacy `ReviewQueueContext`
(an in-memory cache duplicating React Query state) is deleted along with
the agent-specific review hooks and the old 816-line
`AgentPlaygroundReview`.
```tsx
// agent-playground-evaluate.tsx (Review tab), after
<DatasetReview targetType="agent" targetId={agentId} detailPanelVariant="inline" onCreateScorer={handleCreateScorerFromFailures} />
```
Along the way: the scorer attach dialog now uses a combobox like the
dataset one, scorer actions are hidden with a hint for code-defined
agents, and `deleteExperiment` invalidates the agent experiments query.
Tested with the playground MSW suites (new cases for select mode and
`onCreateScorer`) and manually on the chef agent: send-to-review → item
appears, inline detail, mark as reviewed, Completed filter, Create
Scorer → Scorers tab; `/experiments/review-queue` unchanged.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
The agent evaluation and review tabs now reuse the same components as
the main Studio pages. This reduces duplicate code and keeps agent
workflows consistent with the rest of Studio.
## Changes
- Replaced agent-specific lists and review UI with shared
`ExperimentsList`, `DatasetsList`, `ScorersList`, and `DatasetReview`
components.
- Added optional row selection, selected-row highlighting, trailing
content, and scoped keyboard navigation to shared list components.
- Added `onCreateScorer` support to `DatasetReview`.
- Removed `ReviewQueueContext`, agent review hooks,
`AgentPlaygroundReview`, and `ReviewItemCard`.
- Added a combobox-based scorer attachment flow.
- Disabled scorer actions for code-defined agents and added an
explanatory hint.
- Invalidated the agent experiments query after deleting an experiment.
- Preserved standalone review discovery while allowing agent review to
use the parent experiment scope.
- Added a `RunExperimentButton` with the `R` keyboard shortcut.
- Added tests for selectable lists, scorer selection, scorer creation,
and experiment-scoped review behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
|
||
|
|
504702f481 |
feat(evals): Vitest integration for runEvals (@mastra/evals/vitest) (#22665)
Adds a new `@mastra/evals/vitest` subpath so `runEvals` evaluations run
as regular Vitest tests with real feedback in the runner output.
`vitest` (v3+) is an optional peer dependency — the root `@mastra/evals`
bundle is unaffected when Vitest isn't installed.
Setup in `vitest.config.ts` — the reporter is optional and opt-in;
without it the assertions still pass/fail tests normally, and it prints
nothing when a run contains no evals:
```ts
import { defineConfig } from 'vitest/config'
import { MastraEvalsReporter } from '@mastra/evals/vitest'
export default defineConfig({
test: {
reporters: ['default', new MastraEvalsReporter()],
setupFiles: ['@mastra/evals/vitest/setup'],
},
})
```
`expectItems` asserts over a whole dataset inside a regular `test()`.
Gates score each item 0/1, so `toPass(0.8)` requires at least 80% of
items to pass every gate (thresholds still apply to the average score):
```ts
import { test } from 'vitest'
import { expectItems } from '@mastra/evals/vitest'
test('capitals agent answers with the expected city', { timeout: 60_000 }, async () => {
await expectItems({
target: capitalsAgent,
data: [
{ input: 'What is the capital of France?', groundTruth: 'Paris' },
{ input: 'What is the capital of Japan?', groundTruth: 'Tokyo' },
{ input: 'What is the capital of Australia?', groundTruth: 'Canberra' },
],
gates: [containsGroundTruth],
scorers: [{ scorer: createKeywordCoverageScorer(), threshold: 0.4 }],
}).toPass(0.8)
})
```
`expectItem` is the single-item variant for matrix testing — one test
and one reporter entry per item:
```ts
test.for([
{ input: 'What is the capital of France?', groundTruth: 'Paris' },
{ input: 'What is the capital of Japan?', groundTruth: 'Tokyo' },
{ input: 'What is the capital of Australia?', groundTruth: 'Canberra' },
])('capitals agent: $input', { timeout: 60_000 }, async item => {
await expectItem({ target: capitalsAgent, data: item, gates: [containsGroundTruth] }).toPass()
})
```
Custom matchers are also available for direct `runEvals` calls
(`toHaveVerdict`, `toHaveScoreAbove`/`toHaveScoreBelow`, `toPassGates`,
`toPassThresholds`), registered via the setup file or
`registerEvalMatchers()`.
The reporter prints a per-test score table after the run:
```text
Mastra Evals
✓ capitals agent answers with the expected city (3 items)
contains-ground-truth (gate) 1.0 ✓
keyword-coverage-scorer (threshold: min 0.4) 1.0 ✓
Eval runs: 1 (1 passed)
```
Tested with unit tests on the assertions, matchers, and reporter
rendering (mock language model, no LLM calls), plus a live example in
`examples/agent` running against OpenAI. Docs page and changeset
included.
Co-Authored-By: Mastra Code (anthropic/claude-fable-5)
<noreply@mastra.ai>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR lets Vitest run Mastra evaluations as normal tests. It also
shows evaluation scores, pass rates, gates, and thresholds in test
output.
## Changes
- Added `@mastra/evals/vitest` and `@mastra/evals/vitest/setup` exports.
- Added `expectEvals` for dataset evaluations.
- Added `expectEval` for single-item and matrix evaluations.
- Added matchers for verdicts, scorer scores, gates, and thresholds.
- Added `MastraEvalsReporter` for per-test evaluation results.
- Added optional Vitest peer dependency support.
- Added Vitest setup utilities for matcher registration.
- Added target-specific `RunEvalsAgentConfig` and
`RunEvalsWorkflowConfig` types.
- Restricted workflow evaluation data to the correct target-specific
contract.
- Added tests for assertions, matchers, metadata, reporter output,
thresholds, gates, and type restrictions.
- Added documentation, an agent example, and a changeset.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
|
||
|
|
e28eba73e3 |
Compare two dataset experiments side by side in Studio (#22527)
**before** <img width="3840" height="2160" alt="CleanShot 2026-08-28 at 12 03 40@2x" src="https://github.com/user-attachments/assets/9d2d202f-2cd8-42c8-b2e6-502a3cad89b2" /> **after** <img width="3840" height="2160" alt="CleanShot 2026-08-28 at 12 03 59@2x" src="https://github.com/user-attachments/assets/82265184-eaab-4ab0-ab50-f36a4aaea225" /> ## Summary Comparing two experiments in Studio used to mean scrolling: a summary table on top, a flat list of items below, and a single detail panel that stacked the baseline result above the contender one. You could see two numbers, but never actually read *what changed* between the two runs. This replaces that page with a full-width comparison table. Every dataset item is its own row, with three columns: the item on the left, the baseline result in the middle, the contender result on the right. Because both sides render the exact same sections in the exact same order, a row reads as a diff. ## What you get - **One row per item** — no more selecting an item to see its detail. Everything is on screen and scannable. - **Baseline and contender columns** with output, per-scorer values and their reasons, run duration, errors, comment and metadata — all aligned line by line across the two sides. - **Score deltas** shown once, on the contender side, with system green/red and directional arrows so a regression is obvious at a glance. - **Collapsible sections** everywhere. Long outputs, item input and ground truth, metadata and comments can be folded away; the chevron doubles as the section marker. - **Column headers carry the experiment context** — target agent, dataset version (highlighted when the two experiments ran against different versions), run date, and an overall score summary — instead of a separate header block above the table. - **Links out** to the item page, the experiment page, the target agent and each scorer, so any cell is a jumping-off point. ## Notes The compare endpoint only returns outputs and score values, so the columns are enriched client-side by joining the per-experiment results and scores by item id. No backend change was needed. Along the way this also fixed a stale dataset-version cache after adding or deleting an item, and corrected the client-js typing of an experiment result error, which is a structured object rather than a string. ## Test plan - `pnpm --filter ./packages/playground test src/domains/datasets/components/experiments` — 40 tests covering the row join, the column headers, and the full page through MSW (loading, item missing from one side, metadata, scorer reasons, failed runs, item links). - `pnpm --filter ./packages/playground lint` and `tsc --noEmit` — clean. - Manually verified in Studio against two real experiments run on the same dataset, including a version mismatch between the two runs. 🤖 Generated with [Mastra Code](https://mastra.ai) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR adds a full-width view that compares two dataset experiments side by side. It shows matching items, outputs, scores, errors, and score changes, and warns when the experiments use different dataset versions. ## Changes - Replaced the previous comparison layout with an aligned baseline and contender table. - Added experiment and dataset links. - Added dataset-version mismatch indicators. - Added score averages, scorer reasons, and score deltas. - Added outputs, durations, errors, comments, and metadata. - Added collapsible input, ground truth, and payload sections. - Added loading and missing-item states. - Added copy actions and formatted JSON output. - Added client-side result joining by dataset item ID. - Fixed dataset-version query invalidation after item creation or deletion. - Corrected `DatasetExperimentResult.error` typing and made result scores optional. - Added deterministic example scorers for comparison testing. - Updated the comparison E2E assertion. - Added unit and MSW-backed tests for row joining, headers, loading, missing items, metadata, scorer reasons, errors, deltas, and links. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Mastra Code (anthropic/claude-opus-5) <noreply@mastra.ai> |
||
|
|
6bbe9ab7ec |
docs: document computer-use sandboxes and add an agent example (#21712)
## Summary - document workspace computer-use tools and the `SandboxComputer` capability - document Daytona desktop controls and the new E2B Desktop sandbox provider - add E2B Desktop to the integrations sidebar - add a provider-selectable computer-use agent example that defaults to Daytona and can use E2B Desktop through `COMPUTER_USE_PROVIDER=e2b-desktop` - keep sandbox credentials optional at startup so the rest of the agent example runs without Daytona or E2B keys This is the fourth PR in the computer-use stack and is based on #21707. ## Test plan - `pnpm run format:check` in `docs` - `pnpm run lint:remark` in `docs` - `pnpm run lint:vale:ai` in `docs` - `pnpm run validate:frontmatter` in `docs` - `pnpm run validate:reference-sidebar` in `docs` - `pnpm run validate:sidebar-docs` in `docs` - `pnpm run build` in `docs` - `pnpm install --ignore-workspace --frozen-lockfile` in `examples/agent` - verified Daytona and E2B Desktop each emit exactly 11 computer workspace tools - verified `OPENAI_API_KEY=test pnpm mastra dev` reaches Studio/API readiness without sandbox provider credentials ## Notes The full docs `pnpm run validate` command currently fails on a pre-existing stale `new` tag for the Regions sidebar entry. All validation commands relevant to these changed files pass. --------- Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
23e0be2613 |
feat: add submitted plan support to agent clients and Playground (#21658)
<img width="667" height="843" alt="Codex Image Aug 17, 2026, 06_30_39 PM" src="https://github.com/user-attachments/assets/cc300888-2a59-45a1-9982-0749e3e5ed9a" /> ## Summary - Add server and generated client support for reading submitted agent plans - Render submitted plans and plan approval cards in the Playground, including aliased tools - Resume legacy stream approvals with custom plan data - Add example agent configuration and coverage for client, server, hook, and UI behavior ## Testing - Added and updated Vitest unit and MSW integration tests - Added React Testing Library coverage for plan rendering and approval flows <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 Agents can save plans that users can open, review, approve, or reject. The server, clients, and Playground now share plan data and support older approval streams. ## What changed - Added an authenticated `GET /agents/:agentId/plans/file` route. - Added safe plan-path validation and workspace file loading. - Added `Agent.readPlan()` and related client types. - Added stable `submit_plan` tool identifiers to suspension and resume payloads. - Updated React approval handling to resume suspended streams with custom data. - Reset approval state when legacy stream resume requests fail. - Added Playground support for: - Loading submitted Markdown plans. - Rendering plan and approval cards. - Supporting standard and aliased `submit_plan` tools. - Handling plan loading, errors, expansion, approval, and rejection. - Updated plan card layout and button styling. - Added a Chef Agent example that writes plans to `.mastracode/plans/`. - Added server, client, React, Playground, and UI test coverage. - Added changesets for the affected packages. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
be3298b54d |
feat(playground): configure scorers per dataset item (#20034)
## Summary Final layer of the MASTRA-4510 stack. Depends on #20192. Adds Studio controls and documentation for per-item scorer selection. - Lets users inherit dataset scorers or enable an item-level override. - Supports selecting registered/stored scorers and explicitly selecting no scorers. - Shows the persisted scorer state in item detail and version views. - Resets scorer override state whenever the Add Item dialog closes. - Uses MSW tests through the real client and React Query path. - Documents run → item → dataset precedence, `[]` disable behavior, `null` inheritance, stale-ID isolation, and version snapshots. - Adds TypeScript scripts under `examples/agent` for seeding and exercising the same cases through public APIs. ## Test plan - `pnpm --filter ./packages/playground exec vitest run src/domains/datasets/components/__tests__/add-item-dialog.test.tsx src/domains/datasets/components/items/__tests__/dataset-item-panel.test.tsx` - `pnpm --filter ./packages/playground test:run` - `pnpm --filter ./packages/playground typecheck` - `pnpm --filter ./packages/playground build` - Docs format, Remark, build, and structural/link validation. - Typecheck `seed-item-scorers.ts` and `run-item-scorers.ts`. ## Stack Previous: #20192 This is PR 4 of 4 for MASTRA-4510. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 You can now choose which scorers run for each dataset item. You can use dataset defaults, choose specific scorers, or disable scoring for one item. ## Changes - Added scorer controls to the Add Item and Edit Item flows. - Added support for registered and stored scorers. - Added explicit empty selections to disable scoring. - Persisted scorer selections in item details and version views. - Added reset behavior when the Add Item dialog closes or is cancelled. - Updated scorer precedence and inheritance documentation. - Updated `addItem`, `addItems`, `updateItem`, and `startExperiment` API documentation. - Added MSW tests for inheritance, overrides, empty selections, cancellation, persistence, and scorer filtering. - Added public API examples for creating and running item scorer scenarios. - Added Playground changeset metadata. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: YJ <yj@example.com> Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com> |
||
|
|
fcd0667a4e |
refactor: rename Stored Workflows to Dynamic Workflows (#20938)
Co-authored-by: Abhi Aiyer <abhi@mastra.ai> |
||
|
|
fa9ed8e6ac |
docs: reorganize getting started documentation (#20620)
## Summary - reorganize the Get Started flow around creating, developing, and structuring a Mastra project - expand the Develop guide with Studio, AI-assisted development, project structure, and file-based agents - move Manual Install into Guides and Build with AI into Reference - update links, sidebars, feature versioning, and direct redirects for moved or removed pages ## Scope This is a content-only change. It does not modify documentation components, theme code, validation scripts, or tests. Redirects were regenerated and audited for duplicate sources, self-redirects, cycles, and redirect chains. ## Testing - `pnpm validate` - `pnpm lint:remark` - Vale on every changed documentation file - `pnpm build` - `pnpm test:navigation` - `pnpm test:smoke` - `pnpm test:og` The full local `pnpm lint:prose` command still reports four pre-existing findings in unrelated files; the PR-scoped CI docs lint passes. --------- Co-authored-by: Lennart <lekoarts@gmail.com> |
||
|
|
cc85af2425 |
fix(deps): update fast-uri (#20557)
Updates all tracked fast-uri resolutions to 3.1.5 to address CVE-2026-18446 and the earlier Aikido findings. Moves the agent-hub pnpm overrides into its workspace config so pnpm 11 enforces the security floor. Also refreshes the stale gh-issue-triage pnpm-lock to match its manifest. Validated frozen lockfile installs, the triage npm install, and the agent-hub tests. No related issue. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR updates `fast-uri` to a safer version that fixes security problems. It also moves dependency rules so pnpm 11 applies them correctly. ## Changes - Updated all tracked `fast-uri` resolutions to `3.1.5`. - Updated security override constraints from `<3.1.2` to `<3.1.5`. - Moved `agent-hub` pnpm overrides into `agent-hub/pnpm-workspace.yaml`. - Preserved local Mastra package links and dependency version overrides. - Excluded `fast-uri@3.1.5` from minimum release age checks. ## Validation - Ran frozen lockfile installs. - Ran the triage npm install. - Ran `agent-hub` tests. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
5faf93f03e |
Declarative, persistable workflow graphs: engine support, storage domain, and HTTP/client APIs (#20471)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai> Co-authored-by: NikAiyer <nick.aiyer@gmail.com> |