0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
Commit graph

82 commits

Author SHA1 Message Date
dane-ai-mastra[bot]
d60ba71be0 chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
dane-ai-mastra[bot]
779d2875b1
chore: version packages (alpha) (#29912)
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-studio@1.4.0-alpha.1


## @mastra/factory@0.28.0-alpha.5


## @mastra/mcp-apps-components@0.1.0-alpha.5


## @mastra/playground-ui@69.0.0-alpha.6


## @mastra/client-js@1.60.0-alpha.5


## @mastra/react@1.15.0-alpha.5


## @mastra/deployer-cloud@1.83.0-alpha.5


## @mastra/longmemeval@1.1.42-alpha.5


## @mastra/opencode@0.1.42-alpha.5


## create-factory@0.4.3-alpha.5


## @mastra/code-sdk@1.19.0-alpha.5


## mastracode@0.50.0-alpha.5


## @mastra/agent-builder@1.2.1-alpha.2


## mastra@1.39.0-alpha.5


## @mastra/core@1.83.0-alpha.5


## @mastra/deployer@1.83.0-alpha.5


## @mastra/editor@0.17.1-alpha.3


## @mastra/mcp@2.9.0-alpha.2


## @mastra/mcp-docs-server@1.3.13-alpha.8


## @mastra/memory@1.41.1-alpha.2


## @mastra/rag@2.7.3-alpha.1


## @mastra/server@1.83.0-alpha.5


## @mastra/elysia@0.1.23-alpha.5


## @mastra/express@1.5.27-alpha.5


## @mastra/fastify@1.5.27-alpha.5


## @mastra/hono@1.7.25-alpha.5


## @mastra/koa@1.7.27-alpha.5


## @mastra/nestjs@0.3.0-alpha.5


## @mastra/next@0.2.41-alpha.5


## @mastra/server-adapters-test-suite@0.3.0-alpha.2


## @mastra/tanstack-start@0.2.41-alpha.5


## @mastra/libsql@1.30.0-alpha.2


## @mastra/turso@0.1.21-alpha.2


## @mastra/inngest@1.11.2-alpha.3


## @mastra/temporal@0.6.0-alpha.5


## create-mastra@1.39.0-alpha.5


## @internal/playground@1.39.0-alpha.5

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 10:50:08 -08:00
Max Katz
b3801a79d3
feat(factory): default new factories to the Mastra Gateway (#29183)
New factories can run on the Mastra Gateway in one click instead of
bringing provider keys. Factory already signs users in with their Mastra
account, so **Connect Mastra Gateway** creates a gateway key on the
user's Mastra organization (as that user) and stores it with the
Factory's model credentials. Every `mastra/...` model then runs on the
organization's Mastra credits, and new setups start on Claude Opus 5.5.

The gateway option says what it bills and how much is left. At $0,
Factory says so where you pick the model, in Settings and on a failed
run, with **Add credits** opening the organization's add-credits page on
Mastra in a new tab (the same page the CLI uses). The balance is read
again when you come back to Factory.

## Before / After

Dark mode, local Factory signed in through local Platform. Before is
`main`.

**Choosing a provider**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/9ba10a45-e43b-48c6-87ab-2093cc7bbd87"
width="420"> | <img
src="https://github.com/user-attachments/assets/51510a44-6023-4c75-ab81-42fceeb7c5de"
width="420"><br>Onboarding |
| <img
src="https://github.com/user-attachments/assets/2f5ebaab-990c-4ac6-8db2-af64bbc74c4e"
width="420"> | <img
src="https://github.com/user-attachments/assets/8696d2fd-b1f2-4b07-83bf-496de71cc538"
width="420"><br>New factory palette |
| <img
src="https://github.com/user-attachments/assets/c2493dd8-16b6-49be-8bcf-ee0b1a5974ee"
width="420"> | <img
src="https://github.com/user-attachments/assets/61b3447e-a5eb-4ca5-b928-50252c516019"
width="420"><br>Settings › Models › Add provider |
| <img
src="https://github.com/user-attachments/assets/022cb25b-de82-4834-abaf-ec76ca07b5d6"
width="420"> | <img
src="https://github.com/user-attachments/assets/a924bee2-1d76-4719-9e2c-90c86a6bd2e7"
width="420"><br>Settings, connected |

**After connecting, and at $0** (the $0 balance is stubbed locally)

| With credits | No credits left |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/a60e9bd2-bc0e-4db2-a252-b2c3fe084314"
width="420"><br>Starts on Claude Opus 5.5 | <img
src="https://github.com/user-attachments/assets/d3bce67b-3e8a-401f-80c6-63a4e7ac4d14"
width="420"><br>Add credits opens Mastra in a new tab, Continue stays
enabled |
| <img
src="https://github.com/user-attachments/assets/9f3d0b6d-1c16-4476-ac7b-fa113e0f3238"
width="420"><br>The option at $0, before connecting | <img
src="https://github.com/user-attachments/assets/f402c60d-db14-4247-9370-1ac439cdce03"
width="420"><br>Settings |
| <img
src="https://github.com/user-attachments/assets/4b58590b-80d9-427c-999e-b11576231efe"
width="420"><br>New factory palette | <img
src="https://github.com/user-attachments/assets/c60c0556-e7a6-451e-bc54-83c46646c776"
width="420"><br>A run at $0 (from Damien's stubbed run) |

## What changed

- `POST /web/config/providers/mastra/connect` creates the key on Mastra
as the signed-in user (new `MastraAuthStudio.fetchAsRequestUser`), only
when their Mastra session is on the Factory's organization, and stores
it as the scope's `mastra-gateway` credential (org-wide for admins, or
personal). Keys are labeled `Factory · Shared` or `Factory · <email>`.
`GET .../mastra/credits` reads the balance the way the dashboard does.
- Model resolution uses the tenant's own gateway key for `mastra/...`
models (the server key still works as before), web search included. The
catalog lists the gateway's models once a scope has a key.
- UI: the gateway is listed first under Recommended in onboarding, the
new factory palette and Settings, with its billing line; one-row "No
gateway credits left" warning; a gateway-specific run error for the
gateway's 402. Members who aren't Mastra admins are told to ask an
admin.

No Platform changes.

## Scope

- Adding credits happens on Mastra, not inside Factory. A shared credits
component for both is a separate piece of work.
- Factory gets its key from Gateway project provisioning
(`/v1/gateway/projects/provision`), the same v1 project key the CLI
creates, because organization (v2) keys aren't released yet. Each
connect creates a small `Factory · …` project on Mastra, and removing
the gateway in Factory doesn't revoke its key there.
- Not covered: orgs that bring their own provider keys to the gateway
(no credits needed) still see the $0 warning.
- Not verified: a model run through the hosted gateway with a key
Factory created (a local Platform key isn't valid there). Everything up
to the model call was run against local Platform.

## Testing

1. Sign in to Factory with a Mastra account. On a fresh org,
`/onboarding` › company account › Model shows Mastra Gateway with the
balance; **Connect Mastra Gateway** goes to the model picker on Claude
Opus 5.5.
2. Mastra shows a new `Factory · Shared` key; Settings › Models shows
Mastra Gateway · Key saved and `mastra/...` models in the pickers.
3. With $0, the model step, Settings and the new factory palette show
"No gateway credits left"; **Add credits** opens
`projects.mastra.ai/add-credits/<org>` in a new tab, and the warning
clears after adding credits and coming back.
4. A run on a gateway model at $0 shows "Out of Mastra Gateway credits"
with Add credits, Continue and Change model.

Fixes PLTFRM-2941



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## ELI5

Factory users can connect Mastra Gateway and use their organization’s
Mastra credits to run models. Factory shows the available balance and
provides guidance when credits run out.

## What changed

- Added Mastra Gateway connection options to onboarding, Factory
creation, and provider settings.
- Set Claude Opus 5.5 as the preferred model for new Gateway setups.
- Added credit balance details, zero-credit warnings, an Add credits
action, and guidance for members who cannot add credits.
- Added Gateway-specific run errors and recovery options for exhausted
credits.
- Added Factory routes to create user- or organization-scoped Gateway
credentials and read credit balances. Removing a credential in Factory
does not revoke the Mastra key.
- Updated model routing so `mastra/...` models use a tenant’s stored
Gateway key when available, with the server key as fallback.
- Updated Gateway routing to skip custom-provider lookup when a model
uses Mastra Gateway.
- Added `MastraAuthStudio.fetchAsRequestUser` and Factory route support
for Platform requests made as the signed-in user.

## Validation

The PR description reports tests with a stubbed API and route tests. It
does not report verification against a live Mastra Platform or Stripe.
CI and build results are not available.

## Scope

44 files changed: 1,377 lines added and 59 removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Damien Schneider <damien.schneider01@gmail.com>
2026-11-10 20:19:40 +04:00
dane-ai-mastra[bot]
f21e0742ce chore: version packages 2026-11-07 04:18:11 +00:00
Damien Schneider
cb2b399294
perf(factory-ui): load each page's data and code alongside the sign-in check (#29434)
## Description

Opening a Factory page used to run its waits one after another. First
`/auth/me`, then `/web/factory/projects`, then the page's code, then the
page's own requests: the sidebar's sessions, boards, work items and
decisions, and the board's intake settings and connection status. All of
those only need the Factory id from the URL, or the Factory list.

Now React Router loaders (`src/ui/routeLoaders.ts`) start them. When a
route is entered, its loader starts the queries its element reads and
returns without waiting. It uses the same `queryOptions` as the hook
that reads the data, so the component finds the request already in
flight. The router runs every matched route's loader at once.

- **Under `RootGuards`** (a pathless route): the Factory list.
`RootGuards` still renders in the first frame, and `AuthGuard` sends
`/auth/me` itself. It refetches on every mount to watch the session, so
prefetching the check could fetch it twice.
- **`FactoryLayout`:** session runs, once the list shows the Factory has
a linked repository. That's the same `hasLinkedRepository` rule the
layout uses.
- **`AppLayout`, outside Settings:** the sidebar's features, boards,
sessions, work items, decisions and active runs. Settings uses the same
`isSettingsPath` rule as the sidebar.
- **Work, Review and custom boards:** intake config, intake bindings,
and the GitHub, GitLab, Linear, Jira and incident.io statuses, once the
Factory has a linked repository.
- **Lazy pages:** their code. Rules also starts its decisions for the
current `?group=`, and the new-session routes start the composer's
project, default model and providers.

Some requests stay with the components that read them, so the router
never copies a component's logic. These are the ones keyed by another
response or by state a component resolves:
- the board's issue and PR lists, recent activity and label routes;
- the composer's model list;
- the chat permissions;
- each Settings section's data;
- the feed stream.

Loaders run only when their route is entered. By the next navigation the
components are mounted and fetch for themselves in the same render.
Gating, layouts and screens are unchanged. Without the new `services`
argument, as in most tests, `createAppRoutes()` declares no loaders.

React best practices: shared query options guard a missing id with
`skipToken`, not `enabled` and `id!` (`prefetchQuery` ignores
`enabled`). There are no `as` casts, and loaders return nothing instead
of `null`. `main.tsx` builds one `ApiConfig` for both the router and
`ApiConfigProvider`, which now takes it as `config`. The API client
reads the global `fetch` per request instead of capturing it when the
client is created.

**`@mastra/auth-studio`:** concurrent verifications of the same session
cookie now share one call to the platform's `/auth/me`. With the startup
requests leaving together, each used to verify the cookie on its own.
With an expired session, each also tried to refresh it with the same
refresh token, so every request but the first failed. The merge is keyed
by the cookie, so only requests carrying the identical cookie share an
answer. Each request still gets its own renewed `Set-Cookie`. This is
tested against a real HTTP server that refuses a reused refresh token.

**Access:** prefetching changes when the browser asks, not what it may
receive. Every prefetched Factory endpoint goes through the auth gate
(401 when signed out). It resolves the caller's organization and looks
the Factory up within it (`projects.get({ orgId, id })`), returning 404
otherwise. The sessions list also filters private sessions by viewer.
Nothing renders before both checks pass.

I measured in Chromium against the built app, from when the startup
script finishes running. `/auth/me` starts at the same time as on
`main`. The Factory list starts during the startup script instead of 640
ms after it. The sidebar's requests start with it instead of after both
checks. The routes manifest is unchanged, and the startup bundle grows
by 0.8 KB gzipped.

`AppStartup.msw.test.tsx` drives the real routes, query client and
loaders with a repository-linked Factory. It covers Work, Review, a
custom board, Rules, new and draft sessions, Settings, a Factory without
a repository, and a link without a Factory. On each it checks three
things: nothing starts after `/auth/me` answers except the requests
listed above, nothing is sent twice, and every prefetched query is read
by the page. It also checks that a visitor who signs in from another tab
never sees "Unable to load your factories". I broke the loaders seven
ways and each one made it fail. It passed 20 runs out of 20.

The full MSW suite passes except 5 tests that fail on `main` too
(`BoardPageProviderFacts`, `SessionsSectionGroups`, `KnowledgePage`).
factory-ui unit tests (585) and the `auth-studio` suite (140) pass.

## Related issue(s)

No issue. Follow-up to https://github.com/mastra-ai/mastra/pull/29322.

## Type of change

- [x] 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
- [x] 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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01VhgyDUZnNc7MLonrGJtR33

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## ELI5

The app starts loading page code and data while it checks whether the
user is signed in. This can reduce the wait before a page is ready.
Concurrent requests that use the same session cookie can share one
sign-in check, while each request still gets its own renewed cookie.

## What changed

- Added route loaders that start page preloads and data queries on route
entry without waiting for them to finish. Loaders do not revalidate;
page components continue to manage their data.
- Added shared query-option builders so loaders and page hooks use the
same query definitions.
- Added prefetching for Factory data, sidebar data, board intake
settings and connection status, composer data, and Rules decisions.
Loaders skip requests when required IDs or repository information are
missing. Sidebar prefetching is skipped on Settings paths.
- Kept `/auth/me` out of the loaders because `AuthGuard` checks it on
mount.
- Updated API configuration so the app shares one config between the
router and API provider.
- Encoded Factory IDs in the board catalog URL.
- Coalesced concurrent session checks for the same credential. Added
tests for concurrent verification and cookie renewal.
- Added changeset notes for the Factory startup loading changes and the
auth-studio session-check fix.

## Validation

The PR description reports 20 successful runs of
`AppStartup.msw.test.tsx`, 585 passing factory-ui unit tests, and 140
passing auth-studio tests. It also reports five failures in the full MSW
suite, which the author says also occur on `main`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-05 16:46:42 +01:00
dane-ai-mastra[bot]
6a191d46dc chore: version - exit prerelease mode 2026-10-28 13:15:52 +00:00
dane-ai-mastra[bot]
2c646b53d0
chore: version packages (alpha) (#28399)
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/factory@0.25.0-alpha.5


## @mastra/langsmith@1.4.0-alpha.2


## @mastra/connect@1.2.0-alpha.2


## @mastra/core@1.80.0-alpha.4


## @mastra/playground-ui@66.0.0-alpha.4


## @mastra/acp@0.4.4-alpha.0


## @mastra/claude@0.3.4-alpha.0


## @mastra/cursor@0.3.4-alpha.0


## @mastra/openai@1.1.4-alpha.0


## @mastra/auth-auth0@1.2.6-alpha.0


## @mastra/auth-better-auth@1.1.9-alpha.0


## @mastra/auth-clerk@1.3.2-alpha.0


## @mastra/auth-cloud@1.2.8-alpha.0


## @mastra/auth-firebase@1.1.5-alpha.0


## @mastra/auth-google@0.1.7-alpha.0


## @mastra/auth-neon@0.3.5-alpha.0


## @mastra/auth-okta@0.2.6-alpha.0


## @mastra/auth-studio@1.3.11-alpha.1


## @mastra/auth-supabase@1.1.6-alpha.0


## @mastra/auth-workos@1.6.8-alpha.0


## @mastra/agent-browser@0.5.5-alpha.0


## @mastra/browser-viewer@0.2.6-alpha.0


## @mastra/browser-firecrawl@0.2.5-alpha.1


## @mastra/stagehand@0.3.7-alpha.1


## @mastra/discord@1.3.2-alpha.0


## @mastra/slack@1.8.0-alpha.1


## @mastra/teams@0.1.3-alpha.0


## @mastra/telegram@0.2.4-alpha.0


## @mastra/client-js@1.57.0-alpha.4


## @mastra/react@1.13.0-alpha.4


## @mastra/isolated-vm@0.1.4-alpha.0


## @mastra/quickjs@0.1.5-alpha.0


## @mastra/deployer-cloud@1.80.0-alpha.4


## @mastra/deployer-cloudflare@1.2.39-alpha.1


## @mastra/deployer-netlify@1.2.39-alpha.1


## @mastra/deployer-sandbox@0.3.24-alpha.1


## @mastra/deployer-vercel@1.2.39-alpha.1


## @mastra/voyageai@0.4.3-alpha.0


## @mastra/longmemeval@1.1.39-alpha.4


## @mastra/livekit@0.5.2-alpha.0


## @mastra/opencode@0.1.39-alpha.4


## @mastra/parallel@0.1.4-alpha.0


## create-factory@0.3.1-alpha.4


## @mastra/code-sdk@1.15.1-alpha.5


## mastracode@0.48.1-alpha.4


## @mastra/arize@1.3.27-alpha.2


## @mastra/arthur@0.4.27-alpha.2


## @mastra/braintrust@1.3.24-alpha.2


## @mastra/datadog@1.4.19-alpha.2


## @mastra/deepeval@0.1.21-alpha.2


## @mastra/laminar@1.3.29-alpha.2


## @mastra/langfuse@1.6.3-alpha.2


## @mastra/observability@1.21.1-alpha.2


## @mastra/otel-bridge@1.5.19-alpha.2


## @mastra/otel-exporter@1.4.10-alpha.2


## @mastra/posthog@1.4.4-alpha.2


## @mastra/sentry@1.2.29-alpha.2


## @mastra/agent-builder@1.1.31-alpha.2


## @mastra/auth@1.1.5-alpha.0


## mastra@1.36.0-alpha.4


## @mastra/codemod@1.1.8-alpha.0


## create-mastra@1.36.0-alpha.4


## @mastra/deployer@1.80.0-alpha.4


## @mastra/editor@0.16.5-alpha.2


## @mastra/evals@1.10.9-alpha.0


## @mastra/fastembed@1.3.5-alpha.2


## @mastra/loggers@1.3.10-alpha.1


## @mastra/mcp@2.6.0-alpha.1


## @mastra/mcp-docs-server@1.3.10-alpha.7


## @mastra/mcp-registry-registry@1.1.7-alpha.0


## @mastra/memory@1.39.1-alpha.2


## @mastra/rag@2.7.1-alpha.0


## @mastra/schema-compat@1.3.17-alpha.0


## @mastra/server@1.80.0-alpha.4


## @mastra/google-cloud-pubsub@1.1.5-alpha.1


## @mastra/redis-streams@0.6.5-alpha.1


## @mastra/valkey-streams@0.5.7-alpha.1


## @mastra/elysia@0.1.20-alpha.4


## @mastra/express@1.5.24-alpha.4


## @mastra/fastify@1.5.24-alpha.4


## @mastra/hono@1.7.22-alpha.4


## @mastra/koa@1.7.24-alpha.4


## @mastra/nestjs@0.2.39-alpha.4


## @mastra/next@0.2.38-alpha.4


## @mastra/server-adapters-test-suite@0.1.4-alpha.2


## @mastra/tanstack-start@0.2.38-alpha.4


## @mastra/astra@1.1.3-alpha.0


## @mastra/azure-ai-search@0.1.2-alpha.1


## @mastra/chroma@1.1.5-alpha.0


## @mastra/clickhouse@1.27.0-alpha.1


## @mastra/cloudflare@1.7.6-alpha.0


## @mastra/cloudflare-d1@1.4.5-alpha.1


## @mastra/convex@1.7.6-alpha.0


## @mastra/couchbase@1.1.4-alpha.1


## @mastra/dsql@1.5.5-alpha.0


## @mastra/duckdb@1.16.0-alpha.1


## @mastra/dynamodb@1.4.5-alpha.1


## @mastra/elasticsearch@1.4.6-alpha.1


## @mastra/lance@1.5.2-alpha.1


## @mastra/libsql@1.27.1-alpha.0


## @mastra/mongodb@1.24.1-alpha.1


## @mastra/mssql@1.10.6-alpha.0


## @mastra/mysql@0.14.1-alpha.0


## @mastra/opensearch@1.1.4-alpha.1


## @mastra/oracledb@0.5.5-alpha.0


## @mastra/pg@1.33.0-alpha.2


## @mastra/pinecone@1.1.3-alpha.0


## @mastra/qdrant@1.1.6-alpha.0


## @mastra/redis@1.4.12-alpha.1


## @mastra/s3vectors@1.1.5-alpha.0


## @mastra/spanner@1.10.1-alpha.1


## @mastra/turbopuffer@1.2.3-alpha.0


## @mastra/turso@0.1.18-alpha.0


## @mastra/upstash@1.5.5-alpha.1


## @mastra/valkey@0.2.8-alpha.1


## @mastra/vectorize@1.1.4-alpha.0


## @mastra/weaviate@0.1.4-alpha.0


## @mastra/voice-aws-nova-sonic@0.2.6-alpha.0


## @mastra/voice-azure@0.12.3-alpha.0


## @mastra/voice-cloudflare@0.13.4-alpha.0


## @mastra/voice-deepgram@0.13.3-alpha.0


## @mastra/voice-elevenlabs@0.13.3-alpha.0


## @mastra/voice-gladia@0.13.3-alpha.0


## @mastra/voice-google@0.14.4-alpha.0


## @mastra/voice-google-gemini-live@0.14.18-alpha.0


## @mastra/voice-inworld@0.4.6-alpha.0


## @mastra/voice-mistral@0.1.3-alpha.0


## @mastra/voice-modelslab@0.2.3-alpha.0


## @mastra/voice-murf@0.13.3-alpha.0


## @mastra/voice-openai@0.13.4-alpha.0


## @mastra/voice-openai-realtime@0.14.8-alpha.0


## @mastra/voice-playai@0.13.3-alpha.0


## @mastra/voice-sarvam@1.1.4-alpha.0


## @mastra/voice-speechify@0.14.3-alpha.0


## @mastra/voice-xai-realtime@0.2.17-alpha.0


## @mastra/inngest@1.10.8-alpha.3


## @mastra/temporal@0.4.18-alpha.4


## @mastra/agentcore@0.5.3-alpha.0


## @mastra/agentfs@0.2.3-alpha.0


## @mastra/apple-container@0.5.2-alpha.0


## @mastra/archil@0.3.2-alpha.0


## @mastra/azure@0.3.3-alpha.1


## @mastra/blaxel@0.10.2-alpha.0


## @mastra/cloudflare-sandbox@0.5.4-alpha.0


## @mastra/daytona@0.11.4-alpha.0


## @mastra/docker@0.12.1-alpha.0


## @mastra/e2b@0.15.1-alpha.1


## @mastra/e2b-desktop@0.1.10-alpha.1


## @mastra/files-sdk@0.3.3-alpha.0


## @mastra/gcs@0.3.5-alpha.1


## @mastra/google-drive@0.2.4-alpha.0


## @mastra/mesa@0.3.3-alpha.0


## @mastra/modal@0.7.3-alpha.0


## @mastra/platform-workspace@1.10.0-alpha.1


## @mastra/railway@0.10.2-alpha.1


## @mastra/s3@0.6.5-alpha.1


## @mastra/sprites@0.1.2-alpha.0


## @mastra/vercel@1.6.2-alpha.0


## @internal/playground@1.36.0-alpha.4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-26 13:49:15 -07:00
Ward Peeters
ce5d4731ee
chore(deps): update dependencies across the monorepo (#28417)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-26 16:59:30 +01:00
dane-ai-mastra[bot]
dacb190944
chore: version packages (alpha) (#28009)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-23 13:57:18 +02:00
shreyas-mastra
2ac8cf1435
fix(auth-studio): issue host-only Studio session cookie (#28168) 2026-10-22 13:32:45 -04:00
Dane - AI (Mastra)
40a522c142
chore(deps): update build tools (#27997) 2026-10-22 14:33:21 +02:00
dane-ai-mastra[bot]
4c22623ea3 chore: version - exit prerelease mode 2026-10-21 11:26:39 +00:00
Max Katz
9a423dae48
refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
dane-ai-mastra[bot]
a15924e709 chore: version packages 2026-10-16 04:04:12 +00:00
dane-ai-mastra[bot]
81299c921d chore: version - exit prerelease mode 2026-10-11 16:59:51 +00:00
dane-ai-mastra[bot]
1a363be7df chore: version packages 2026-10-09 04:08:19 +00:00
Ryan Hansen
9a511a4ff5
fix(auth-studio): keep Studio/Factory sessions alive for the full session length (#26447)
## Problem

Users of deployed Studios and Factories (e.g. Shipyard) get signed out
roughly once a day, even while active. Reported as FACT-382: an idle
Factory tab that, on the next click, landed on the login screen.

Verified against Shipyard (prod) on 2026-10-08:

- The `wos-session` cookie on `*.mastra.cloud` expires exactly **24h
after sign-in**. `MastraAuthStudio` hardcoded `Max-Age=86400`. Our
WorkOS config allows a 14-day max session with a 5-day inactivity
timeout.
- Nothing ever extended that cookie. 19 Factory requests over ~9
minutes, past the 5-minute access-token expiry, returned **zero
`Set-Cookie`**.
- The shared API *does* renew the session on `/auth/me` and returns a
new cookie. `MastraAuthStudio` discarded it, and it was scoped to
`mastra.ai`, which browsers on `*.mastra.cloud` reject anyway.
- Even a forwarded cookie wouldn't reach the browser on most paths:
- Platform-deployed Studios wrap the provider in `CompositeAuth`, which
didn't pass provider headers through.
- Factory authenticates every request in its own auth gate, which
doesn't implement session refresh.
- 122 of Factory's 161 routes are declared `requiresAuth: false` and
authenticate in the handler via `ensureFactoryAuthUser`. The framework
skips user middleware on those routes (`skipIfFrameworkPublic`, #20989),
so the gate never runs there either.

## Changes

- **`@mastra/auth-studio`**
- The session lifetime is configurable via `sessionMaxAgeSeconds` or
`MASTRA_SESSION_MAX_AGE`, default **14 days**. It applies to the cookie
`Max-Age` and every `Session.expiresAt`. It's configurable rather than a
constant because deployed Studios pin framework versions and Platform
needs to control the value.
  - When `/auth/me` returns a renewed cookie, the provider:
- re-issues it with the deployment's own cookie attributes (domain,
Secure, Max-Age)
    - invalidates the 30s verification-cache entry for the old cookie
- remembers the renewed cookie (not the used-up one) for organization
calls such as `ensureOrganization`
- exposes it through a new optional
`consumePendingResponseHeaders(request)` hook
- `getCurrentUser` passes the request through, so renewals on that path
are captured too.
- **`@mastra/server`**
- The auth middleware merges pending provider headers into the response,
including after its own refresh-and-retry, where it reads them from the
retry request.
- The public `GET /auth/me` route forwards them too, since the
middleware skips public routes.
- **`CompositeAuth`** (`@mastra/core`) delegates
`consumePendingResponseHeaders` to inner providers and merges the
results.
- **`@mastra/factory`**: both the auth gate and `ensureFactoryAuthUser`
forward pending headers, so gated and `requiresAuth: false` routes both
renew the cookie.

All forwarding is optional-chained and wrapped in try/catch, so any mix
of package versions is safe, and a failure to forward headers can never
turn into a 401.

## Testing

### Unit
Every new behavior has a regression test that fails without its change.

| Package | Result | New coverage |
|---|---|---|
| auth-studio | 125/125 | domain rewrite (`Domain=mastra.ai` →
`.mastra.cloud`); max-age option, env var, invalid-env fallback; cache
invalidation on rotation; renewed cookie used for org calls;
`getCurrentUser` exposes the renewal |
| server auth helpers | 95/95 | headers stashed against the raw Request
are emitted via the adapted request; renewal during the post-refresh
retry is forwarded; a throwing hook doesn't break auth |
| server auth handlers | 27/27 | `GET /auth/me` forwards pending
headers; a throwing hook still returns the user |
| `CompositeAuth` | 8/8 | delegation and merging; a throwing inner
provider is ignored |
| Factory auth | 56/56 | gate forwarding; `ensureFactoryAuthUser`
forwarding on an ungated route; a throwing hook still returns 200 |

A harness against the real `@mastra/deployer` Hono server with the
snapshot Factory auth confirmed the `requiresAuth: false` gap, and that
the `ensureFactoryAuthUser` change closes it.

### Staging (snapshot `0.0.0-fix-set-cookie-20261008222303`)

Factory deployed to staging Platform with this PR's snapshot.

- **Sign-in:** the cookie's Expires was ~14 days out (was 24h on
Shipyard).
- **After the 5-minute access-token expiry:**

  ```
  GET /web/factory/projects → 200
set-cookie: wos-session=…; HttpOnly; SameSite=Lax; Path=/;
Max-Age=1209600; Secure; Domain=.mastra.cloud
  ```

| Route (after access-token expiry) | Previous snapshot (gate only) |
This PR |
|---|---|---|
| `/web/factory/projects` (most-polled) | ❌ | ✅ |
| `/web/gitlab/issues`, `/web/gitlab/subscriptions` | ❌ | ✅ |
| `/web/audit/portal-link`, `/web/custom-jira`, `/web/custom/status` | ✅
| ✅ |
| `/api/agents`, `/api/workflows` | ✅ | ✅ |

Not renewed, and not needed:
- `/` is the SPA shell. It loads without auth, and the API calls it
makes do the renewing.
- Two GitLab routes returned 502 because the test Factory has no GitLab
connection.

## Follow-ups

- A Platform PR to set `MASTRA_SESSION_MAX_AGE` on Studio/Factory
deploys, so Platform controls the value.
- The Factory gate should return 503 instead of a sign-out on
verification errors or timeouts.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5

Studio and Factory users could be signed out even when they were still
using the service. This change lets Studio sessions last longer and
sends renewed login cookies back to the browser so users can stay signed
in.

## Summary

- Set the default Studio session lifetime to 14 days. Configure it with
`sessionMaxAgeSeconds` or `MASTRA_SESSION_MAX_AGE`.
- When `/auth/me` renews a `wos-session` cookie, reissue it with the
deployment’s cookie attributes and invalidate the old cookie’s
verification-cache entry.
- Add `consumePendingResponseHeaders` to expose renewed cookies. Forward
pending headers through server auth middleware, `CompositeAuth`, Factory
auth paths, and the public `GET /auth/me` route.
- Ignore errors from the optional header-forwarding hook so they do not
block authentication.
- Add tests for session lifetime configuration, cookie rotation, cache
invalidation, and header forwarding.

## Validation

The supplied PR summary reports passing tests: auth-studio 125/125,
server auth helpers 95/95, server auth handlers 27/27, `CompositeAuth`
8/8, and Factory auth 56/56. It also reports a staging Factory probe and
a harness using the real `@mastra/deployer` Hono server. 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>
2026-10-08 17:16:21 -07:00
dane-ai-mastra[bot]
8b35a6c1d6 chore: version - exit prerelease mode 2026-10-01 08:22:20 +00:00
dane-ai-mastra[bot]
de967f00ab chore: version packages 2026-10-01 04:06:35 +00:00
arctic-char
7b3ddfad10
fix(auth-studio): fall back to .mastra-project.json for organizationId (#25583)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-30 10:01:38 -07:00
dane-ai-mastra[bot]
a436d6c513 chore: version - exit prerelease mode 2026-09-23 09:15:38 +00:00
dane-ai-mastra[bot]
b6df015ee8 chore: version packages 2026-09-22 16:05:21 +00:00
Ward Peeters
ac05f2d7fc
refactor(auth): adopt Web Crypto without async API breaks (#24583) 2026-09-22 15:57:49 +02:00
dane-ai-mastra[bot]
871bdaa595 chore: version - exit prerelease mode 2026-09-15 09:04:59 +00:00
dane-ai-mastra[bot]
6b2880d169 chore: version packages 2026-09-10 22:05:14 +00:00
Damien Schneider
f0e51bbc09
fix(auth-studio): pinned deployments serve members in the pinned org (#23427)
**─────── TLDR ───────**
> A deployment pinned to an organization now serves every member in that
organization, instead of whichever organization their shared Mastra
session cookie was last signed into.

Every deployment on `*.mastra.cloud` shares one `wos-session` cookie,
and its sealed session carries a single active organization: the one
written by the last sign-in anywhere. The provider only checked that the
pinned organization was among the user's memberships, then handed back
the cookie's organization, role and permissions. My personal factory,
pinned to one organization, ran as Mastra Internal and graded my
Provider access rights by my role there: the minute I was made admin of
Mastra Internal, Org-wide settings appeared on that other factory too.

The blast radius differs by product. In the factory every org-scoped row
is keyed by the same cookie organization the admin check reads, so an
admin of another organization never touches the pinned organization's
rows; they get a phantom tenant of their own, and legitimate admins
whose cookie sits elsewhere lose their settings and sessions from view.
In a deployed Studio the role drives RBAC and the project's data is not
keyed by organization, so a member whose cookie sits on an organization
they administer gets `admin: ['*']` on the pinned project instead of the
member's read, execute and workflow-write set. Non-members of the pinned
organization were and remain rejected.

### Behavior changed

member whose session cookie sits on another organization, opening a
pinned deployment
&nbsp;&nbsp;├─ **was** — served in the cookie's organization, with that
organization's role and permissions
&nbsp;&nbsp;└─ **now** — served in the pinned organization, with their
role there; one `/auth/orgs` read, cached with the session

bearer token on a pinned deployment
&nbsp;&nbsp;├─ **was** — verified without an organization, so the
token's default organization came back
&nbsp;&nbsp;└─ **now** — verified with `x-organization-id`, so the
shared API answers for the pinned organization or refuses

signing in to any other `*.mastra.cloud` deployment
&nbsp;&nbsp;├─ **was** — silently changed which organization this
deployment served you in
&nbsp;&nbsp;└─ **now** — no effect here

non-member of the pinned organization
&nbsp;&nbsp;└─ **unchanged** — rejected

### Decisions

- **permissions dropped when re-homing** — they belong to the cookie's
organization and `/auth/orgs` does not return them; RBAC derives
permissions from the role anyway
- **a failed `/auth/orgs` read serves the member without a role for one
cache window (30 s)** — fail-closed on admin, no sign-out on a blip;
throw instead if you would rather 401

### Watch

> [!WARNING]
> Org-wide provider credentials saved on a pinned factory while it ran
as another organization sit under that organization's tenant key; once
this ships they <mark>look gone until re-entered</mark> under the pinned
organization. Personal credentials are keyed by user and unaffected.

### Not verified

- [ ] `x-organization-id` on `/auth/verify` against the running shared
API — the platform's `verifyBearerContext` on main reads it, answers for
that organization or refuses a non-member; TLS to the API fails from my
machine, so it is traced in source, not exercised

---

> ██████████████████ **tests** `+47 −11` — 52% of the additions
> ██████████████ **source** `+36 −21`
> ██ **changeset** `+5`
> █ **docs** `+3 −2` — `.env.schema` wording


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## ELI5

Pinned deployments now use the pinned organization for login checks
instead of relying on a shared cookie. This prevents sign-ins on another
deployment from changing which organization the pinned deployment
serves.

## Changes

- Re-homed session users to `MASTRA_ORGANIZATION_ID` when they belong to
the pinned organization.
- Used the member role from the pinned organization.
- Rejected users who are not members of the pinned organization.
- Verified bearer tokens with the pinned organization through
`x-organization-id`.
- Cached membership lookups for 30 seconds.
- Preserved fail-closed admin behavior when membership lookups fail.
- Added tests for cookie sessions, bearer tokens, roles, caching, and
organization isolation.
- Updated `MASTRA_ORGANIZATION_ID` documentation.
- Added a patch changeset for `@mastra/auth-studio`.

Organization-scoped provider credentials saved under another
organization may need to be entered again.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-10 10:37:37 -07:00
dane-ai-mastra[bot]
c19a93b095 chore: version - exit prerelease mode 2026-09-03 04:02:53 +00:00
dane-ai-mastra[bot]
e6de774069 chore: version packages 2026-09-02 16:20:22 +00:00
Lennart
e983f74987
chore(*): Update/unify/add READMEs (#22858)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-09-02 14:36:59 +02:00
dane-ai-mastra[bot]
fc968c8a9b chore: version packages 2026-09-01 16:28:50 +00:00
Lennart
28ce924276
chore(*): Remove CHANGELOG.md from npm files (#22737) 2026-09-01 10:47:20 +02:00
dane-ai-mastra[bot]
c23d44525c chore: version - exit prerelease mode 2026-08-19 03:57:12 +00:00
dane-ai-mastra[bot]
c0ea826233 chore: version packages 2026-08-14 16:17:57 +00:00
Lawrence
8a4a4af313
fix(auth): harden getRequestHeader for Express requests (#21261)
Co-authored-by: Lawrence Millard <l@millard.ink>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 08:29:23 -07:00
dane-ai-mastra[bot]
162f3da717 chore: version - exit prerelease mode 2026-07-28 23:00:57 +00:00
Ward Peeters
d271d37f30
chore: migrate package builds to tsdown (#19829)
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-07-28 12:32:21 +02:00
dane-ai-mastra[bot]
301c98ab75 chore: version packages 2026-07-28 05:02:45 +00:00
arctic-char
2624b7ecad
Speed up Factory hot paths: auth caching, parallel repo sync, workspace dedup, bounded lease scans (#20261)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
2026-07-27 22:45:24 +02:00
Ward Peeters
bdeaef58f0
chore: migrate linting to oxlint (#20173)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-07-25 01:04:02 +02:00
Ward Peeters
3a507cbd42
chore: migrate repository formatting to oxfmt (#19807)
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-07-24 16:18:33 +02:00
dane-ai-mastra[bot]
79ee78c5b1 chore: version - exit prerelease mode 2026-07-23 03:17:19 +00:00
dane-ai-mastra[bot]
3ad2bdc181 chore: version packages 2026-07-22 16:34:47 +00:00
Ryan Hansen
b87e4cad9a
fix(auth-studio): default shared API URL to platform.mastra.ai (#19958)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
2026-07-22 15:24:30 +01:00
dane-ai-mastra[bot]
a0e5190c70 chore: version packages 2026-07-21 16:35:55 +00:00
Ryan Hansen
d2a51c13c9
Wire MastraAuthStudio into mastracode-web for platform-deferred identity (#19858)
## Summary

Enables mastracode-web to defer identity to a Mastra platform API
(`platform.mastra.ai` or a local equivalent) instead of owning its own
WorkOS credentials. A new env var, `MASTRA_SHARED_API_URL`, selects
`MastraAuthStudio` as the auth provider and places it ahead of
`WORKOS_*` / `BETTER_AUTH_SECRET` in the mastracode-web env precedence
chain.

Along the way, this PR:

- Implements `IOrganizationsProvider` on `MastraAuthStudio` so
platform-deferred hosts get personal-org bootstrap and admin checks —
matching what `MastraAuthWorkos` and `MastraAuthBetterAuth` already
provide. The new methods proxy through the shared API's existing
`/auth/me`, `/auth/orgs`, and `POST /auth/orgs` endpoints. Since those
endpoints are cookie-authenticated but the interface only hands us a
`userId`, the provider caches each user's sealed session cookie inside
`verifySessionCookie` (LRU-bounded at 1000 users).
- Fixes two bugs in mastracode-web's provider-neutral auth gate that
blocked the end-to-end sign-in flow with any SSO provider that lacks a
self-configured redirect URI / self-populated session cookies:
1. **Empty `redirect_uri` in the login redirect.** The SSO login handler
was passing an empty string to `provider.getLoginUrl`, expecting
providers to fall back to a configured URI. `MastraAuthWorkos` has such
a fallback; `MastraAuthStudio` does not (its only URL config is the
shared API, not this deployment's public URL). The handler now derives
the callback URL from `MASTRACODE_PUBLIC_URL` via `getPublicUrl()`.
2. **Missing session-provider fallback in the callback handler.** The
SSO callback only forwarded `result.cookies` and ignored the
`ISessionProvider` fallback that the core `packages/server`
`/auth/callback` handler uses. That fallback is required for providers
that return `tokens` but leave cookie construction to
`getSessionHeaders` (so the cookie can be scoped correctly per
deployment via `MASTRA_COOKIE_DOMAIN` / auto-detection). The
mastracode-web handler now mirrors the core server logic.

Env schema updated so `varlock` passes `MASTRA_SHARED_API_URL`,
`MASTRA_ORGANIZATION_ID`, and `MASTRA_COOKIE_DOMAIN` through to the
runtime.

## Test plan

- `pnpm --filter @mastra/auth-studio test` — 95 tests pass (11 new for
`IOrganizationsProvider`, session-cookie cache, and admin-role
resolution).
- `pnpm --filter mastracode-web exec vitest run
src/web/auth-seam.test.ts src/web/auth.test.ts` — 49 tests pass.
- Typecheck: `pnpm --filter @mastra/auth-studio` (`tsc --noEmit`) and
`pnpm --filter mastracode-web` (`tsc --noEmit`) both clean.
- End-to-end manual verification in local dev with
`MASTRA_SHARED_API_URL=http://localhost:3010/v1` pointed at a platform
API: full WorkOS sign-in flow completes, `wos-session` cookie sets on
`localhost`, `/auth/me` returns the signed-in user, personal-org
bootstrap fires for users with no org.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5

MastraCode can now let the Mastra platform handle sign-in and figure out
which organization you should use for the web app—so you don’t need
separate WorkOS/better-auth wiring. It also fixes the SSO callback so
the app sets the right cookies/sessions reliably.

## What changed

- Platform-first auth integration (highest precedence)
- Added `MastraAuthStudio` into `mastracode-web` so identity can be
delegated to the Mastra platform when `MASTRA_SHARED_API_URL` is set
(taking precedence over WorkOS/better-auth).
  - Extended `mastracode-web/.env.schema` with:
    - `MASTRA_SHARED_API_URL`
    - `MASTRA_ORGANIZATION_ID` (optional org pin)
- `MASTRA_COOKIE_DOMAIN` (optional sealed-session cookie parent domain)
- Added `@mastra/auth-studio` as a workspace dependency and included
`./auth/studio` in the `mastracode-web` prebuild turbo filter.

- `MastraAuthStudio` now provides organizations via shared API + cached
sealed session cookies
  - `MastraAuthStudio` implements `IOrganizationsProvider`:
    - `ensureOrganization(userId)`
- Uses a bounded per-user cache of sealed session cookies (up to 1,000
users) seeded during session verification.
- Returns `undefined` when there’s no cached cookie or on any shared
API/bootstrapping failure.
- Uses `/auth/me.active.organizationId` when present; otherwise falls
back to the first `memberOrgIds` entry.
- If the user has no memberships, creates a personal org via `POST
/auth/orgs` (and returns `undefined` if creation fails).
- Deduplicates concurrent “bootstrap personal org” calls per user so
only one `POST /auth/orgs` occurs; later callers re-run if the in-flight
attempt is released.
    - `isOrganizationAdmin(organizationId, userId)`
- Returns `false` when there’s no cached cookie or if the shared API
throws.
- Fast-paths via `/auth/me` when the requested org is the active org.
- Otherwise queries per-org roles via `/auth/orgs` (returns `false` when
the target org is missing).
      - Treats `admin` and `owner` as admin-equivalent.
- `verifySessionCookie` now stores the validated sealed cookie into the
per-user cache for later org-provider calls.

- Web auth wiring changes (`mastracode-web`)
- Removed direct WorkOS/better-auth provider branching from
`mastracode/web/src/mastra/index.ts`.
  - `MastraFactory` default behavior:
- If `auth` is omitted, it constructs the default `MastraAuthStudio`
provider.
    - `auth: null` explicitly disables auth (open-server behavior).
- Frontend/dev injection and route/middleware gating now key off
`MASTRACODE_AUTH_DISABLED=1`.

- Correct SSO callback handling + safer cookie scoping
- Fixed SSO redirect/callback URL derivation by deriving the login
redirect URI from the deployment public origin (`getPublicUrl()`).
  - Updated callback handling to support both:
- `handleCallback` returning explicit `cookies` (sets `Set-Cookie`), and
- `ISessionProvider` returning `tokens` (creates a server-side session
and applies returned session headers).
- Added conservative cookie-domain fallback logic for the default
`MastraAuthStudio` using `publicUrl`, returning host-only cookies for
`localhost`, IP literals, unparseable URLs, and out-of-scope hosts;
deriving `.<parent>` for known platform parent domains (e.g.,
`mastra.cloud`/`mastra.ai`).

- Tests + release metadata
- Added extensive `MastraAuthStudio` organization provider tests
(bootstrap/role checks, failure cases, cached-cookie behavior, and
concurrency dedupe/retry).
- Updated `MastraFactory.prepare` tests to cover `auth` omitted vs
`auth: null`, `/auth/*` route seeding behavior, and cookie-domain edge
cases.
- Updated TUI e2e login-refresh assertion to expect the default
`anthropic/claude-fable-5` model instead of `anthropic/claude-opus-4-7`.
- Changesets added to publish patch releases for `@mastra/auth-studio`
reflecting the personal-org creation behavior and ensureOrganization
concurrency deduping.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (anthropic/claude-opus-4-7) <noreply@mastra.ai>
2026-07-21 17:06:37 +01:00
Dane - AI (Mastra)
a4620cae04
chore(deps): update formatting & linting (#19388)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: wardpeet <ward@coding-tech.com>
2026-07-20 16:13:28 +02:00
Dane - AI (Mastra)
0532405a28
chore(deps): update build tools (#18043) 2026-07-14 23:01:34 +02:00
dane-ai-mastra[bot]
57566498b5 chore: version - exit prerelease mode 2026-06-26 19:51:28 +00:00
dane-ai-mastra[bot]
52c463a246
chore: version packages (alpha) (#18427)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-25 16:04:31 +02:00
Ward Peeters
5c0df776c4
refactor(auth): extract shared auth internals (#17142)
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>
2026-06-25 11:30:05 +02:00