This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.
⚠️⚠️⚠️⚠️⚠️⚠️
# Releases
> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.
## @mastra/auth-auth0@1.3.0-alpha.0
## @mastra/auth-clerk@1.4.0-alpha.0
## @mastra/auth-okta@0.3.0-alpha.0
## @mastra/auth-supabase@1.2.0-alpha.0
## @mastra/client-js@1.60.0-alpha.13
## @mastra/auth@1.2.0-alpha.0
## @mastra/core@1.83.0-alpha.13
## @mastra/playground-ui@69.0.0-alpha.15
## @mastra/rag@2.8.0-alpha.3
## @mastra/server@1.83.0-alpha.13
## @mastra/server-adapters-test-suite@0.3.0-alpha.5
## @mastra/auth-better-auth@1.1.11-alpha.2
## @mastra/auth-cloud@1.2.9-alpha.0
## @mastra/auth-neon@0.3.6-alpha.1
## @mastra/auth-workos@1.6.9-alpha.0
## @mastra/discord@1.3.4-alpha.0
## @mastra/react@1.15.0-alpha.13
## @mastra/deployer-cloud@1.83.0-alpha.13
## @mastra/deployer-cloudflare@1.2.42-alpha.3
## @mastra/deployer-netlify@1.2.42-alpha.1
## @mastra/deployer-sandbox@0.3.27-alpha.1
## @mastra/deployer-vercel@1.2.42-alpha.1
## @mastra/longmemeval@1.1.42-alpha.13
## @mastra/opencode@0.1.42-alpha.13
## @mastra/factory@0.28.0-alpha.15
## create-factory@0.4.3-alpha.15
## @mastra/code-sdk@1.19.0-alpha.15
## mastracode@0.50.0-alpha.14
## @mastra/agent-builder@1.2.1-alpha.5
## mastra@1.39.0-alpha.15
## @mastra/connect@1.4.0-alpha.6
## @mastra/deployer@1.83.0-alpha.13
## @mastra/editor@0.17.1-alpha.7
## @mastra/mcp@2.9.0-alpha.5
## @mastra/mcp-docs-server@1.3.13-alpha.17
## @mastra/memory@1.41.1-alpha.5
## @mastra/schema-compat@1.4.0-alpha.2
## @mastra/elysia@0.1.23-alpha.13
## @mastra/express@1.5.27-alpha.13
## @mastra/fastify@1.5.27-alpha.13
## @mastra/hono@1.7.25-alpha.13
## @mastra/koa@1.7.27-alpha.13
## @mastra/nestjs@0.3.0-alpha.13
## @mastra/next@0.2.41-alpha.13
## @mastra/tanstack-start@0.2.41-alpha.13
## @mastra/voice-google-gemini-live@0.14.19-alpha.2
## @mastra/voice-openai-realtime@0.14.9-alpha.3
## @mastra/voice-xai-realtime@0.2.18-alpha.2
## @mastra/inngest@1.11.2-alpha.9
## @mastra/temporal@0.6.0-alpha.13
## create-mastra@1.39.0-alpha.15
## @internal/playground@1.39.0-alpha.15
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Dynamic agent config callbacks now get the authenticated end user as an
optional `user` argument, so you can personalize an agent without
digging auth keys out of `requestContext` yourself. It works in any
`DynamicArgument` callback: instructions, model, tools, memory,
workspace, processors, scorers, and so on.
```ts
import { Agent } from '@mastra/core/agent';
const supportAgent = new Agent({
id: 'support-agent',
instructions: ({ user }) =>
user ? `You are helping ${user.name ?? user.id}.` : 'You are a helpful assistant.',
model: ({ user }) => (user?.role === 'admin' ? 'openai/gpt-5' : 'openai/gpt-5-mini'),
tools: ({ user }) => (user ? { accountTool, ...(user.role === 'admin' ? { adminTool } : {}) } : {}),
memory: ({ user }) => (user ? userMemory : undefined),
});
```
`user` always has the same `MastraUser` shape, no matter which auth
provider you use, and it's `undefined` for unauthenticated requests:
```ts
import type { MastraUser } from '@mastra/core/types';
// { id: string; name?: string; email?: string; avatarUrl?: string; role?: string }
```
The server auth middleware builds it through a new overridable
`toMastraUser()` on `MastraAuthProvider`. The default handles common
shapes (`id`/`sub`/`userId`, `name`, `email`, `avatarUrl`/`picture`,
`role`), and JWT, Cloud, Supabase, Neon and Better Auth ship overrides
for their user objects. Custom providers can map their own shape:
```ts
import { MastraAuthProvider } from '@mastra/core/server';
import type { MastraUser } from '@mastra/core/types';
class MyAuth extends MastraAuthProvider<MyUser> {
async authenticateToken(token: string) { /* ... */ }
async authorizeUser(user: MyUser) { return true; }
toMastraUser(user: MyUser): MastraUser {
return { id: user.accountId, name: user.profile.displayName, role: user.permissions.primaryRole };
}
}
```
Inline auth configs can pass `toMastraUser` too. If the provider user
has no role and an RBAC provider is configured, the primary RBAC role
fills it in, so `user.role` also works with WorkOS, Okta, Google and
Neon. The raw provider user is still available when you need
provider-specific fields, and the new context key is reserved, so
clients can't spoof it through the request body:
```ts
instructions: ({ requestContext }) => {
const rawUser = requestContext.get('mastra__user'); // provider-specific object, unchanged
// ...
},
```
Dynamic `vectorStore` resolvers on RAG tools get `user` as well:
```ts
createVectorQueryTool({
indexName: 'docs',
model: embedder,
vectorStore: ({ user }) => (user ? tenantStores.get(user.id)! : sharedStore),
});
```
Inside core, every place that invoked a `DynamicArgument` callback
inline now goes through a single `resolveDynamicArgument` helper, which
reads the user from `requestContext` at call time. This is non-breaking:
callbacks get an extra optional field, providers get a method with a
working default. Requests served through an `MCPServer` don't get `user`
yet, since MCP builds its own request context; that's documented.
Tested with unit tests for the helper, normalization and each provider
override, middleware tests (inline config, provider role, RBAC role,
CompositeAuth ordering, unauthenticated), regression tests for the
migrated call sites, and an end-to-end test where an agent behind a fake
auth provider gets personalized instructions. Core, server, rag and the
touched auth packages typecheck clean, and their suites pass.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
When a signed-in user makes a request, configuration callbacks can now
use a standard set of details about that user. When a workflow resumes,
it uses the new request’s user details instead of restoring them from
the earlier run.
## Summary
- Added optional `user` data to `DynamicArgument` callbacks and RAG
vector-store resolvers. Callbacks can also use `getRequestUser()` to
read the normalized user from request context.
- Added the `MastraUser` type and `toMastraUser()` normalization hooks
for auth providers and inline auth configs. The server stores the
normalized user in a reserved request-context key and uses the primary
RBAC role when the user has no role.
- Updated core dynamic configuration paths to use the shared resolver.
Added user support to agent scopes and migrated A2A memory resolution.
- Added `withoutLiveRequestKeys()` to remove live authentication and
authorization data from saved context during workflow resume, restart,
and time travel. Saved non-authentication context, such as tenant data,
remains available.
- Added documentation and changesets. Raised relevant `@mastra/core`
peer dependency minimums to 1.81.0. MCPServer requests do not receive
the normalized `user`.
## Validation
The author reports passing typechecks and test suites across core,
server, RAG, and several auth packages. The author also reports three
failing Inngest tests and earlier failures in evented workflow and
scheduler tests, which reportedly fail the same way on comparison
sources. These results are author-reported and have not been
independently verified.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Moves shared auth interfaces, providers, sessions, and EE auth helpers
into @internal/auth so auth provider packages no longer depend on
@mastra/core. The existing @mastra/core auth imports still work through
re-export stubs.
Before:
```ts
import { MastraAuthProvider } from '@mastra/core/server';
```
After, internal auth providers use:
```ts
import { MastraAuthProvider } from '@internal/auth/provider';
```
Verified with focused auth builds, lint, typecheck, and tests.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR moves the shared “auth code” (providers, sessions, and
enterprise features) out of `@mastra/core` into a new `@internal/auth`
package so all auth providers can reuse the same implementation.
`@mastra/core` keeps re-export stubs for compatibility, and new
lint/build rules help ensure providers stop importing from
`@mastra/core` directly.
## What changed
- Extracted shared auth internals into `@internal/auth`:
- Auth provider base classes and shared options (`MastraAuthProvider`,
`CompositeAuth`, `SimpleAuth`)
- Session types/providers (`Session`, `MemorySessionProvider`,
`CookieSessionProvider`)
- SSO/credentials/user auth types
- Enterprise Edition auth helpers:
- License validation + caching
- Telemetry bridge + EE capability detection
- RBAC/ACL/FGA interfaces and utilities (including `StaticRBACProvider`,
`FGADeniedError`, and `buildCapabilities`)
- Updated auth provider packages to import shared interfaces/helpers
from `@internal/auth` instead of `@mastra/core`.
- Added `no-restricted-imports` ESLint rules across auth packages to
prevent importing `@mastra/core` (including subpaths), with guidance to
use `@internal/auth`.
- Updated manifests and build configs so auth packages depend on
`@internal/auth` and generate types from the new entrypoints (narrowing
`generateTypes` scope to `@internal/auth`).
- Added new internal package entrypoints:
- `@internal/auth`
- `@internal/auth/provider`
- `@internal/auth/session`
- `@internal/auth/ee`
- `@internal/auth/ee/capabilities`
- Kept backward compatibility by converting many `@mastra/core` auth
exports into re-export stubs that delegate to `@internal/auth`.
## Notable internal auth additions
- New provider system:
- `MastraAuthProvider`
- `CompositeAuth`
- `SimpleAuth`
- New session providers:
- `MemorySessionProvider`
- `CookieSessionProvider`
- New EE helpers:
- License validation client and helpers
- Telemetry bridge
- RBAC/ACL/FGA interfaces and utilities
- Default roles + permission matching
- `buildCapabilities` and `FGADeniedError`
## Follow-up: narrower EE symbol exposure
- Updated core re-export entrypoints to reduce unintended EE symbol
leakage from broad `@internal/auth/ee` re-exports (using the dedicated
`@internal/auth/ee/capabilities` entrypoint and more targeted
FGA-related re-exports).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
## Description
<!-- Required: Provide a brief description of the changes in this PR.
-->
## Related issue(s)
<!-- Required: Link to the issue(s) this PR addresses, e.g. with: Fixes
#123. PRs without linked issues may be closed. -->
## Type of change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] 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)
- [ ] 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
-->
## ELI5
This PR upgrades the Turbo monorepo build tool from version 2.9.6 to
2.9.12 and updates all configuration files across the entire codebase to
use the newer schema version that corresponds to this updated tool
version. Think of it like updating a recipe book to the latest version
and making sure all your cookbook references point to the new edition.
## Changes Summary
### Turbo Version Upgrade
- Updated root `package.json` `devDependencies`: `turbo` upgraded from
`^2.9.6` to `^2.9.12`
### Turbo Configuration Schema Updates
Updated the `$schema` field in 73 `turbo.json` configuration files
throughout the repository from the legacy
`https://turbo.build/schema.json` to the newer
`https://v2-9-16.turborepo.dev/schema.json`:
**Auth modules** (9 files): auth0, better-auth, clerk, cloud, firebase,
okta, studio, supabase, workos
**Client SDKs** (3 files): ai-sdk, client-js, react
**Deployers** (2 files): cloud, vercel
**Integrations** (3 files): brightdata, opencode, perplexity, tavily
**Observability** (11 files): arize, braintrust, datadog, laminar,
langfuse, langsmith, mastra, otel-bridge, otel-exporter, posthog, sentry
**Package modules** (19 files): _external-types, _internal-core,
agent-builder, auth, cli, codemod, core, create-mastra, deployer, evals,
fastembed, loggers, mcp, mcp-docs-server, mcp-registry-registry, memory,
playground, rag, schema-compat, server
**Data stores** (21 files): astra, chroma, clickhouse, cloudflare,
cloudflare-d1, convex, couchbase, duckdb, dynamodb, elasticsearch,
lance, libsql, mongodb, mssql, mysql, opensearch, pg, pinecone, qdrant,
redis, s3vectors, spanner, turbopuffer, upstash, vectorize
**Root configuration**: turbo.json
All other configuration content (extends, tasks, inputs/outputs) remains
unchanged across all files.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Moves Hono and hono-openapi out of @mastra/core runtime dependencies
while keeping their public types bundled in core declarations.
This should avoid duplicate Hono type instances for consumers without
requiring them to install Hono directly.
Before:
```ts
// Installing @mastra/core also installed Hono at runtime.
```
After:
```ts
// @mastra/core still exposes the same route and middleware types,
// but Hono is no longer installed as a runtime dependency.
```
Fixes#17405
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR stops bundling the Hono web framework inside `@mastra/core` and
related packages so projects only use one Hono installation provided by
the app, avoiding TypeScript type conflicts; `@mastra/core` still
exposes Hono-shaped types so existing code keeps working.
## Overview
- Moves Hono from runtime dependencies to dev/peer/dev-only entries so
`@mastra/core` no longer installs Hono at runtime but still includes
Hono types in generated declarations.
- Adds framework-agnostic request abstractions and helpers so auth
providers and server code accept both native Web Request and Hono-shaped
requests without requiring Hono at runtime.
- Reworks MCP and server modules to avoid leaking Hono runtime types
(e.g., Context) across package boundaries while preserving
Hono-compatible public types.
- Cleans up auth package manifests and implementations to remove runtime
Hono dependency and adopt the shared MastraAuthRequest surface.
## Key changes
- package metadata
- packages/core/package.json: removed hono and hono-openapi from runtime
deps; moved them to development/type-generation usage.
- Several auth packages (better-auth, cloud, okta, studio, workos):
removed hono from deps/devDeps/peerDeps where applicable.
- Build config
- packages/core/tsup.config.ts: added 'hono' and 'hono-openapi' to the
type-generation allowlist so their public types are emitted.
- New/shared request types & helpers
- packages/core/src/server/request-types.ts: introduces HonoRequestLike,
MastraAuthRequest (Request | HonoRequestLike), AuthenticateTokenFn,
AuthorizeUserFn, getRequestHeader, and getWebRequest.
- packages/core/src/server/index.ts: re-exports these types/helpers for
consumers.
- Auth API typing surface
- packages/core/src/server/auth.ts, types.ts, simple-auth.ts,
composite-auth.ts, and related tests: updated to use MastraAuthRequest
and the new callback types; tests updated to use real Web Request-based
mocks where appropriate.
- Auth provider implementations (auth/better-auth, auth/cloud,
auth/okta, auth/studio, auth/workos): updated to accept
MastraAuthRequest and use getRequestHeader/getWebRequest for
header/session access.
- MCP & server internals
- packages/core/src/mcp/types.ts: replaces Hono Context usage with a
HonoContextLike interface capturing only used shape.
- packages/mcp/src/server/server.ts and
packages/deployer/src/server/index.ts, plus server adapter code: added
local casting/adapters to keep runtime behavior while avoiding exported
Hono runtime types.
- packages/server/src/server/auth/helpers.ts and server-adapter: adapt
incoming requests to MastraAuthRequest and ensure middleware always
receives a normalized request.
- Types & tests
- Added type-test suite ensuring HonoRequest is assignable to the new
MastraAuthRequest-based provider types.
- Updated many tests to construct real Request objects and
MastraAuthRequest wrappers instead of Hono-specific mocks.
- Changeset
- .changeset/dull-papers-buy.md: documents removal of Hono runtime deps
and migration to framework-agnostic request types; triggers patch
releases.
## Impact
- Fixes `#17405` by preventing duplicate Hono instances and TypeScript
incompatibilities (e.g., conflicting Handler types).
- Consumers that use Hono should install it directly (peer dependency
semantics); consumers who do not use Hono are unaffected.
- Public type compatibility retained: Hono-shaped types remain available
through `@mastra/core`’s emitted declarations while runtime coupling to
Hono is removed.
Fixes `#17405`
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17410?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
## Summary
- Make `generateTypes` always validate generated declaration imports
against runtime dependencies, removing the opt-in
`validateRuntimeImports` option from all package tsup configs.
- Fix bundled declaration handling so API Extractor sees `.d.ts`
references instead of copied `.js` export targets.
- Align `@internal/external-types` bundled packages and metadata so its
generated rollup passes API Extractor.
## Test plan
- `node --check packages/_types-builder/src/index.js && node --check
packages/_types-builder/src/replace-types.js`
- `pnpm --filter @internal/external-types build:lib`
- `pnpm --filter @internal/external-types build`
- `pnpm --filter @internal/external-types lint`
- `pnpm --filter @mastra/fastembed build`
- `git diff --check`
## Notes
- `pnpm --filter @internal/external-types test` was not run because the
package has no matching test files.
- CodeRabbit CLI was available, but `coderabbit review --type
uncommitted --plain --no-color` timed out after 180s before returning
findings.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR makes TypeScript type validation **always happen** when building
packages, instead of being something teams could skip. It's like having
a mandatory safety check that ensures all the type information a package
exports only references dependencies it actually has—preventing broken
imports and confusing errors for users of the package.
## Summary
The PR enforces mandatory validation of generated TypeScript
declarations (`.d.ts` files) against runtime dependencies by removing
the optional `validateRuntimeImports` flag. All packages now always
validate their generated types.
## Key Changes
### Declaration Validation System
- **`packages/_types-builder/src/index.js`** (+116 lines) – Implements
`validateDeclarationRuntimeImports()` that scans generated `.d.ts` files
and rejects any import/export statements referencing packages not in the
package's `dependencies`, `peerDependencies`, `optionalDependencies`, or
bundled packages. Adds regex-based import specifier parsing, Node
built-in module detection, and error consolidation. Validates that all
type declarations only reference declared dependencies.
- **`packages/_types-builder/src/replace-types.js`** (+207 lines) –
Replaced streaming substring search with ts-morph-based declaration
rewriting. Now parses declarations to collect module specifiers from
import/export statements and `import("...")` type expressions, resolves
bundled package declarations using `resolve.exports` with `@types/*`
fallback, and copies resolved declarations into `dist/_types/<pkg>` with
rewritten module specifiers instead of appending `.js` extensions.
### Build Configuration Updates
- **122 `tsup.config.ts` files** across all package types (auth,
deployers, integrations, observability, stores, voice, workflows,
workspaces, client-sdks) – Updated `onSuccess` hooks to call
`generateTypes(process.cwd(), new Set())` or
`generateTypes(process.cwd(), new Set([packages]))` with explicit
dependency/bundled package sets instead of relying on defaults. This
removes the implicit `validateRuntimeImports` opt-in pattern.
### Bundled Package Declaration Handling
- **`packages/_external-types/api-extractor.json`** – Expanded
`bundledPackages` array to include `@ai-sdk/provider-utils`,
`@ai-sdk/ui-utils`, `@standard-schema/spec`, `eventsource-parser`,
`json-schema`, and `@opentelemetry/api` alongside `ai`.
- **`packages/_external-types/tsup.config.ts`** – Explicitly lists
bundled packages in `generateTypes()` call for proper type generation
and validation.
- **`packages/_external-types/src/index.ts`** – Added `@public` JSDoc
tag to `ProviderDefinedTool`.
### Dependency Adjustments
- **Auth packages** – Added `@mastra/core` peer dependency (`>=1.0.0-0
<2.0.0-0` or `>=1.32.0-0 <2.0.0-0`); some added `hono` peer dependency
(`^4.0.0`).
- **`packages/deployer/package.json`** – Moved `@hono/node-server` and
`@mastra/hono` from `devDependencies` to `dependencies`.
- **`packages/fastembed/tsup.config.ts`** – Updated to include
`@internal/ai-sdk-v4`, `@internal/ai-sdk-v5`, `@internal/ai-v6` in type
generation.
- **`packages/core/tsup.config.ts`** – Expanded dependency allowlist to
include `@ai-sdk/*`, `eventsource-parser`, and internal packages.
- **`packages/mcp/tsup.config.ts`** – Updated to generate types for
`hono` and `hono-mcp-server-sse-transport`.
- **`packages/schema-compat/package.json`** – Moved
`@standard-schema/spec`, `ajv`, `@types/json-schema` from
`devDependencies` to `dependencies`.
- **`packages/server/package.json`** – Moved `@mastra/schema-compat`
from `devDependencies` to `dependencies`.
- **`packages/_external-types/package.json`** – Added dev dependencies
for `@ai-sdk/ui-utils`, `@opentelemetry/api`, `@standard-schema/spec`,
`eventsource-parser`, `json-schema`.
- **Store packages** – Several added `zod` peer dependency (`^3.25.0 ||
^4.0.0`).
- **Server adapter packages** – `nestjs` added `zod` peer dependency;
`hono` added `hono` peer dependency; `server-adapters/hono/package.json`
added explicit `hono: ^4.12.8` peer dependency.
- **`deployers/netlify/package.json`** – Added `rollup` dependency
(`^4.0.0`).
- **`voice/cloudflare/package.json`** – Moved
`@cloudflare/workers-types` from `devDependencies` to `dependencies`.
- **`client-sdks/react/package.json`** – Added `@ai-sdk/react` and
`@assistant-ui/react` peer dependencies.
- **`stores/cloudflare-d1/package.json`** – Added
`@cloudflare/workers-types` peer dependency.
- **`observability/mastra/package.json`** – Added `zod` peer dependency.
### Path Resolution Updates
- **`client-sdks/react/src/agent/hooks.ts`** – Changed from `@/lib/...`
aliases to relative `../lib/...` imports.
- **`client-sdks/react/src/mastra-react-provider.tsx`** – Changed from
`@/` alias to relative path for `mastra-client-context` imports.
### Type Validation in MCP
- **`packages/mcp/src/server/server.ts`** – Made
`tool.parameters.validate()` and `tool.outputSchema.validate()` calls
awaited to handle async validators.
### JSON Schema Adapter
-
**`packages/schema-compat/src/standard-schema/adapters/json-schema.ts`**
– Updated Ajv import from `ajv/dist/2020` to `ajv/dist/2020.js`.
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/16752?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.
⚠️⚠️⚠️⚠️⚠️⚠️
# Releases
## @mastra/auth-studio@1.2.0-alpha.0
### Minor Changes
- Add configurable cookie domain support
([#14285](https://github.com/mastra-ai/mastra/pull/14285))
- Add `cookieDomain` option to `MastraAuthStudioOptions` for explicit
configuration
- Support `MASTRA_COOKIE_DOMAIN` environment variable as fallback
- Use hostname-based detection for auto-detecting `.mastra.ai` domain
(prevents false positives from malicious URLs)
- Maintain backward compatibility with existing `.mastra.ai`
auto-detection
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## @mastra/client-js@1.9.0-alpha.2
### Minor Changes
- 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)
([#14270](https://github.com/mastra-ai/mastra/pull/14270))
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## mastracode@0.9.0-alpha.2
### Minor Changes
- Improved MCP server management with interactive `/mcp` selector UI.
([#14377](https://github.com/mastra-ai/mastra/pull/14377))
- **Fixed stderr flooding** — MCP child process debug output no longer
corrupts the terminal. Server stderr is piped and buffered instead of
inherited.
- **Fixed console.info race condition** — MCP status messages now
display properly in the chat area instead of racing with TUI rendering.
- **Better error detection** — Failed MCP servers now correctly show as
failed instead of showing as connected with 0 tools.
- **Interactive `/mcp` command** — Replaces text-only output with a
navigable overlay (↑↓ to select, Enter for actions, Esc to close).
Sub-menus offer View tools, View error, View logs, and Reconnect per
server.
- **Per-server reconnect** — Reconnect individual servers from the
`/mcp` selector without restarting all connections.
- **Live status polling** — The `/mcp` selector auto-refreshes while
servers are still connecting.
- **Connecting state** — Servers show as 'connecting...' during initial
startup, visible via `/mcp`.
**Example**
```text
/mcp
```
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`dbb879a`](dbb879af0b),
[`b92d0c9`](b92d0c92ec),
[`8de3555`](8de355572c),
[`133ef20`](133ef20c39),
[`4444280`](4444280942)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/pg@1.8.1-alpha.0
- @mastra/libsql@1.7.1-alpha.0
- @mastra/memory@1.8.3-alpha.1
- @mastra/mcp@1.3.0-alpha.1
## @mastra/mcp@1.3.0-alpha.1
### Minor Changes
- Added new MCP client APIs for per-server control and diagnostics.
([#14377](https://github.com/mastra-ai/mastra/pull/14377))
- Added `reconnectServer(serverName)` to reconnect a single MCP server
without restarting all servers.
- Added `listToolsetsWithErrors()` to return both toolsets and
per-server errors.
- Added `getServerStderr(serverName)` to inspect piped stderr for stdio
servers.
**Example**
```ts
const { toolsets, errors } = await mcpClient.listToolsetsWithErrors();
await mcpClient.reconnectServer('slack');
const stderr = mcpClient.getServerStderr('slack');
```
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## @mastra/server@1.14.0-alpha.2
### Minor Changes
- 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)
([#14270](https://github.com/mastra-ai/mastra/pull/14270))
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## @mastra/auth-clerk@1.0.2-alpha.0
### Patch Changes
- Updated dependencies
\[[`6b7aa31`](6b7aa31e25)]:
- @mastra/auth@1.0.2-alpha.0
## @mastra/auth-cloud@1.1.2-alpha.0
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`6b7aa31`](6b7aa31e25)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/auth@1.0.2-alpha.0
## @mastra/auth-workos@1.1.2-alpha.0
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`6b7aa31`](6b7aa31e25)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/auth@1.0.2-alpha.0
## @mastra/react@0.2.15-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/client-js@1.9.0-alpha.2
## @mastra/deployer-cloud@1.14.0-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/deployer@1.14.0-alpha.2
## @mastra/deployer-cloudflare@1.1.12-alpha.1
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/deployer@1.14.0-alpha.2
## @mastra/deployer-netlify@1.0.16-alpha.1
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/deployer@1.14.0-alpha.2
## @mastra/deployer-vercel@1.1.6-alpha.1
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/deployer@1.14.0-alpha.2
## @mastra/longmemeval@1.0.17-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`dbb879a`](dbb879af0b),
[`b92d0c9`](b92d0c92ec),
[`8de3555`](8de355572c),
[`4444280`](4444280942)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/libsql@1.7.1-alpha.0
- @mastra/memory@1.8.3-alpha.1
## @mastra/opencode@0.0.14-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`dbb879a`](dbb879af0b),
[`b92d0c9`](b92d0c92ec),
[`8de3555`](8de355572c),
[`4444280`](4444280942)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/libsql@1.7.1-alpha.0
- @mastra/memory@1.8.3-alpha.1
## @mastra/agent-builder@1.0.16-alpha.1
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`dbb879a`](dbb879af0b),
[`b92d0c9`](b92d0c92ec),
[`8de3555`](8de355572c),
[`4444280`](4444280942)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/memory@1.8.3-alpha.1
## @mastra/auth@1.0.2-alpha.0
### Patch Changes
- Fixed Studio showing unauthenticated state when using `MastraJwtAuth`
with custom headers. `MastraJwtAuth` now implements the `IUserProvider`
interface (`getCurrentUser`/`getUser`), so the Studio capabilities
endpoint can resolve the authenticated user from the JWT Bearer token.
([#14411](https://github.com/mastra-ai/mastra/pull/14411))
Also added an optional `mapUser` option to customize how JWT claims are
mapped to user fields:
```typescript
new MastraJwtAuth({
secret: process.env.JWT_SECRET,
mapUser: payload => ({
id: payload.userId,
name: payload.displayName,
email: payload.mail,
}),
});
```
Closes#14350
## mastra@1.3.13-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/deployer@1.14.0-alpha.2
## @mastra/core@1.14.0-alpha.2
### Patch Changes
- Added dated message boundary delimiters when activating buffered
observations for improved cache stability.
([#14367](https://github.com/mastra-ai/mastra/pull/14367))
- Fixed provider-executed tool calls (e.g. Anthropic `web_search`) being
dropped or incorrectly persisted when deferred by the provider. Tool
call parts are now persisted in stream order, and deferred tool results
are correctly merged back into the originating message.
([#14282](https://github.com/mastra-ai/mastra/pull/14282))
- Added client/server body schemas for feedback and scores that omit the
timestamp field, allowing it to be set server-side
([#14270](https://github.com/mastra-ai/mastra/pull/14270))
## @mastra/deployer@1.14.0-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/server@1.14.0-alpha.2
## @mastra/editor@0.7.6-alpha.1
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`dbb879a`](dbb879af0b),
[`b92d0c9`](b92d0c92ec),
[`8de3555`](8de355572c),
[`133ef20`](133ef20c39),
[`4444280`](4444280942)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/memory@1.8.3-alpha.1
- @mastra/mcp@1.3.0-alpha.1
## @mastra/mcp-docs-server@1.1.14-alpha.3
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`133ef20`](133ef20c39)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/mcp@1.3.0-alpha.1
## @mastra/memory@1.8.3-alpha.1
### Patch Changes
- Fixed observational memory triggering observation while
provider-executed tool calls are still pending, which could split
messages and cause errors on follow-up turns.
([#14282](https://github.com/mastra-ai/mastra/pull/14282))
- Limit oversized observational-memory tool results before they reach
the observer. ([#14344](https://github.com/mastra-ai/mastra/pull/14344))
This strips large `encryptedContent` blobs and truncates remaining tool
result payloads to keep observer prompts and token estimates aligned
with what the model actually sees.
- Improved observational memory cache stability by splitting persisted
observations into separate prompt chunks using dated message boundary
delimiters. ([#14367](https://github.com/mastra-ai/mastra/pull/14367))
Added `getObservationsAsOf()` utility to retrieve the observations that
were active at a specific point in time. This enables filtering
observation history by message creation date.
```ts
import { getObservationsAsOf } from '@mastra/memory';
// Get observations that existed when a specific message was created
const observations = getObservationsAsOf(record.activeObservations,
message.createdAt);
```
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## @mastra/playground-ui@17.0.0-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/client-js@1.9.0-alpha.2
- @mastra/ai-sdk@1.1.4-alpha.0
- @mastra/react@0.2.15-alpha.2
## @mastra/express@1.2.5-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/server@1.14.0-alpha.2
## @mastra/fastify@1.2.5-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/server@1.14.0-alpha.2
## @mastra/hono@1.2.5-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/server@1.14.0-alpha.2
## @mastra/koa@1.3.5-alpha.2
### Patch Changes
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/server@1.14.0-alpha.2
## @mastra/libsql@1.7.1-alpha.0
### Patch Changes
- Added dated message boundary delimiters when activating buffered
observations for improved cache stability.
([#14367](https://github.com/mastra-ai/mastra/pull/14367))
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## @mastra/mongodb@1.5.6-alpha.0
### Patch Changes
- Added dated message boundary delimiters when activating buffered
observations for improved cache stability.
([#14367](https://github.com/mastra-ai/mastra/pull/14367))
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## @mastra/pg@1.8.1-alpha.0
### Patch Changes
- Added dated message boundary delimiters when activating buffered
observations for improved cache stability.
([#14367](https://github.com/mastra-ai/mastra/pull/14367))
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
## create-mastra@1.3.13-alpha.2
## @internal/playground@1.3.13-alpha.2
### Patch Changes
- Improved Studio reconnect behavior after dev server restarts by
spreading retry attempts over time to prevent many clients reconnecting
at once. Also fixed a memory leak from repeated event handler
registration during reconnects.
([#14284](https://github.com/mastra-ai/mastra/pull/14284))
- Fixed Studio protected-route layout behavior so unauthenticated users
no longer see the left sidebar. The auth prompt remains centered, and
sidebar navigation is restored immediately after authentication.
([#14317](https://github.com/mastra-ai/mastra/pull/14317))
- Studio sidebar navigation now respects RBAC read permissions for key
resources. When RBAC is enabled, users only see links they can read
(`agents`, `workflows`, `tools`, `mcps`, `processors`, `scorers`, and
`datasets`), while admin and wildcard permissions continue to see all
links. When RBAC is disabled, sidebar permission filtering is bypassed
and existing platform/CMS link gating behavior remains unchanged.
([#14381](https://github.com/mastra-ai/mastra/pull/14381))
- Updated dependencies
\[[`4444280`](4444280942),
[`dbb879a`](dbb879af0b),
[`8de3555`](8de355572c),
[`8de3555`](8de355572c)]:
- @mastra/core@1.14.0-alpha.2
- @mastra/client-js@1.9.0-alpha.2
- @mastra/react@0.2.15-alpha.2
- @mastra/playground-ui@17.0.0-alpha.2
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>