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

35 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]
5c87442ed7
chore: version packages (alpha) (#30203)
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>
2026-11-12 12:07:03 -08:00
arctic-char
c0d3bfdc43
feat: pass the authenticated user to DynamicArgument callbacks (#28612)
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>
2026-11-12 10:55:12 -05:00
dane-ai-mastra[bot]
f21e0742ce chore: version packages 2026-11-07 04:18:11 +00:00
mastra-platform[bot]
4045b99c0b
fix(auth-neon): support hosted Neon Auth and document integration (#29633)
## Summary
- Correct Neon Auth session, JWT, and credential flows for hosted Neon
projects; make Studio sign-in, sign-up, and sign-out functional.
- Resolve Neon organization membership roles for Mastra RBAC, with local
HTTP integration coverage and optional live-project testing.
- Add an auth integration guide and update the Neon reference
documentation.

Original contribution by Rishi Raj Jain; his commit authorship is
preserved.

## Test plan
- `pnpm --filter @mastra/auth-neon test` (17 passed)
- `pnpm --filter @mastra/auth-neon build`
- `pnpm --filter @mastra/auth-neon exec tsc --noEmit`
- `pnpm --filter @mastra/auth-neon lint`
- `pnpm --dir docs validate`
- `pnpm exec remark --no-stdout --frail --quiet
src/content/en/integrations/auth/neon.mdx
src/content/en/reference/auth/neon.mdx` (from docs/)

Live Neon project testing requires Neon credentials and was not rerun
here.

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

## ELI5

This change helps Mastra sign users in to hosted Neon Auth and keep
their sessions working. It also lets Neon organization membership affect
access and adds guides for setting up the integration.

## Summary

- Updated `@mastra/auth-neon` to support hosted Neon Auth endpoints, JWT
verification, session cookies, sign-in, sign-up, and sign-out.
- Added organization membership role lookup for RBAC, with a
configurable `getUserRoles` override.
- Added local integration tests and optional tests against a live Neon
project.
- Added a Neon integration guide and updated the Neon reference
documentation.
- Changed 14 files, with 1,331 lines added and 1,081 lines removed.

## Checks

Results for tests, build, typecheck, lint, and documentation checks on
the current head: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Rishi Raj Jain <jain71000@gmail.com>
Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-06 13:20:33 -08: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)
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]
429d7b9f93 chore: version - exit prerelease mode 2026-09-22 10:43:03 +00:00
dane-ai-mastra[bot]
adf6cc46fb chore: version packages 2026-09-16 04:05:24 +00:00
shreyas-mastra
164e197aa5
fix: bump vulnerable dependencies to patched releases (#24027)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-15 13:58:48 -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
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
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)
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]
7a8a8243bb chore: version - exit prerelease mode 2026-06-19 05:35:11 +00:00
dane-ai-mastra[bot]
faae1eb9e0
chore: version packages (alpha) (#18159)
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/acp@0.3.0-alpha.0


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


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


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


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


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


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


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


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


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


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


## @mastra/auth-studio@1.3.0-alpha.0


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


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


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


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


## @mastra/browser-firecrawl@0.2.0-alpha.0


## @mastra/stagehand@0.3.0-alpha.0


## @mastra/slack@1.4.0-alpha.0


## @mastra/ai-sdk@1.5.0-alpha.0


## @mastra/client-js@1.26.0-alpha.0


## @mastra/react@1.1.0-alpha.0


## @mastra/deployer-cloud@1.45.0-alpha.0


## @mastra/deployer-cloudflare@1.2.0-alpha.0


## @mastra/deployer-netlify@1.2.0-alpha.0


## @mastra/deployer-vercel@1.2.0-alpha.0


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


## @mastra/longmemeval@1.1.0-alpha.0


## @mastra/brightdata@0.3.0-alpha.0


## @mastra/opencode@0.1.0-alpha.0


## @mastra/perplexity@0.2.0-alpha.0


## @mastra/tavily@1.1.0-alpha.0


## mastracode@0.24.0-alpha.0


## @mastra/arize@1.3.0-alpha.0


## @mastra/arthur@0.4.0-alpha.0


## @mastra/braintrust@1.2.0-alpha.0


## @mastra/datadog@1.3.0-alpha.0


## @mastra/laminar@1.3.0-alpha.0


## @mastra/langfuse@1.4.0-alpha.0


## @mastra/langsmith@1.3.0-alpha.0


## @mastra/observability@1.15.0-alpha.0


## @mastra/otel-bridge@1.3.0-alpha.0


## @mastra/otel-exporter@1.3.0-alpha.0


## @mastra/posthog@1.1.0-alpha.0


## @mastra/sentry@1.2.0-alpha.0


## @mastra/agent-builder@1.1.0-alpha.0


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


## mastra@1.15.0-alpha.0


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


## @mastra/core@1.45.0-alpha.0


## create-mastra@1.15.0-alpha.0


## @mastra/deployer@1.45.0-alpha.0


## @mastra/editor@0.13.0-alpha.0


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


## @mastra/fastembed@1.2.0-alpha.0


## @mastra/loggers@1.2.0-alpha.0


## @mastra/mcp@1.11.0-alpha.0


## @mastra/mcp-docs-server@1.2.0-alpha.0


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


## @mastra/memory@1.21.0-alpha.0


## @mastra/playground-ui@35.0.0-alpha.0


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


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


## @mastra/server@1.45.0-alpha.0


## @mastra/google-cloud-pubsub@1.1.0-alpha.0


## @mastra/redis-streams@0.1.0-alpha.0


## @mastra/express@1.4.0-alpha.0


## @mastra/fastify@1.4.0-alpha.0


## @mastra/hono@1.5.0-alpha.0


## @mastra/koa@1.6.0-alpha.0


## @mastra/nestjs@0.2.0-alpha.0


## @mastra/github-signals@0.2.0-alpha.0


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


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


## @mastra/clickhouse@1.11.0-alpha.0


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


## @mastra/cloudflare-d1@1.1.0-alpha.0


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


## @mastra/couchbase@1.1.0-alpha.0


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


## @mastra/duckdb@1.5.0-alpha.0


## @mastra/dynamodb@1.1.0-alpha.0


## @mastra/elasticsearch@1.3.0-alpha.0


## @mastra/lance@1.1.0-alpha.0


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


## @mastra/mongodb@1.10.0-alpha.0


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


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


## @mastra/opensearch@1.1.0-alpha.0


## @mastra/pg@1.14.0-alpha.0


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


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


## @mastra/redis@1.2.0-alpha.0


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


## @mastra/spanner@1.2.0-alpha.0


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


## @mastra/upstash@1.2.0-alpha.0


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


## @mastra/inngest@1.6.0-alpha.0


## @mastra/temporal@0.2.0-alpha.0


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


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


## @mastra/azure@0.3.0-alpha.0


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


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


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


## @mastra/e2b@0.4.0-alpha.0


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


## @mastra/gcs@0.3.0-alpha.0


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


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


## @mastra/railway@0.2.0-alpha.0


## @mastra/s3@0.6.0-alpha.0


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


## @observability/test-utils@0.1.0-alpha.0


## @internal/core@0.1.0-alpha.0


## @internal/playground@1.15.0-alpha.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-18 21:19:03 -07:00
dane-ai-mastra[bot]
17f01b5d9d chore: version - exit prerelease mode 2026-06-18 14:09:51 +00:00
dane-ai-mastra[bot]
ad3243ab43
chore: version packages (alpha) (#18057)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-06-17 17:40:24 +02:00
dane-ai-mastra[bot]
90585396ea chore: version - exit prerelease mode 2026-06-17 04:24:24 +00:00
Dane - AI (Mastra)
a27d561d37
chore(deps): update build tools (#17657) 2026-06-15 13:37:09 +02:00
devin-ai-integration[bot]
ad61193668
feat(neon): add Neon Auth adapter (#17864)
## Description

Adds `@mastra/auth-neon` — an auth adapter for [Neon
Auth](https://neon.com/docs/auth/overview), the managed authentication
service built on Better Auth.

**Capabilities:**
- **JWT verification** via JWKS at `{baseUrl}/auth/jwks` (for API bearer
tokens)
- **Session cookie verification** via Neon Auth REST API `GET
/auth/get-session` (for Studio)
- **`ICredentialsProvider`** — email/password `signIn` / `signUp` via
`POST /auth/sign-in/email` and `POST /auth/sign-up/email`
- **`IUserProvider`** — `getCurrentUser` from session,
`getClearSessionHeaders` for logout
- **`ISessionProvider`** — session validate/refresh/destroy, cookie
management
- **`MastraRBACNeon`** — maps Neon Auth org roles
(`owner`/`admin`/`member`) → Mastra permissions via `roleMapping`, with
LRU cache (60s TTL, 1000 size)
- Configurable `sessionCookieName` (default `neonauth.session_token`),
`signUpEnabled`, and `jwksUrl` override

**Token flow in `authenticateToken`:**
1. Try JWKS JWT verification (stateless, fast)
2. If that fails, treat the token as a session cookie value → call Neon
Auth session endpoint

```typescript
import { MastraAuthNeon, MastraRBACNeon } from '@mastra/auth-neon';

const mastra = new Mastra({
  server: {
    auth: new MastraAuthNeon({
      baseUrl: process.env.NEON_AUTH_BASE_URL,
    }),
    rbac: new MastraRBACNeon({
      roleMapping: {
        owner: ['*'],
        admin: ['*'],
        member: ['agents:read', 'workflows:*'],
        _default: [],
      },
    }),
  },
});
```

Follows the WorkOS two-provider pattern. Uses `jose` for JWKS and native
`fetch` for session/credentials calls — no Neon SDK dependency.

## Related issue(s)

N/A — new feature request from Slack.

## 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

- [x] I have linked the related issue(s) in the description above
- [x] 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
- [x] I have addressed all Coderabbit comments on this PR

Link to Devin session:
https://app.devin.ai/sessions/c35e278ae67a460681b1b983177a1d58

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

## ELI5
This PR adds a plugin so Mastra can use Neon Auth to check who a user is
and whether they're logged in — it first tries a fast JWT check, and if
that fails it asks Neon Auth about the session cookie. That lets apps
offload login/session handling to Neon.

## Overview
Adds a new package `@mastra/auth-neon` that integrates Neon Auth (Better
Auth) with Mastra, providing JWKS/JWT verification, session management,
email/password credential flows, and an RBAC provider mapping Neon
organization roles to Mastra permissions.

## Key Features Implemented
- Two-stage authentication: attempt JWKS-based JWT verification
(stateless) then fall back to Neon session verification (GET
/auth/get-session).
- JWKS-based JWT verification (default {baseUrl}/auth/jwks) using jose
with remote JWKS.
- Session cookie verification for browser/Studio flows; configurable
sessionCookieName (default neonauth.session_token).
- Credentials provider: signIn (POST /auth/sign-in/email) and signUp
(POST /auth/sign-up/email) that return mapped EEUser + optional token
and parse Set-Cookie headers into cookies[]; non-OK responses propagate
endpoint error messages.
- Full ISessionProvider implementation: createSession (7-day expiry),
validateSession (via GET /auth/get-session), refreshSession (delegates
to validate), destroySession (no-op), cookie helpers
(getSessionIdFromRequest, getSessionHeaders, getClearSessionHeaders).
- RBAC provider (MastraRBACNeon): maps Neon roles to Mastra permission
patterns, supports custom role extraction hook, optional organization
scoping, and LRU caching with TTL and max size options.
- Configurable options: baseUrl (or env NEON_AUTH_BASE_URL), optional
jwksUrl override (NEON_AUTH_JWKS_URL), sessionCookieName, signUpEnabled,
and RBAC roleMapping/cache options.

## Implementation Details
- New package scaffold: package.json (ESM), tsup, tsconfigs, vitest
config, ESLint/lint-staged, CHANGELOG, README with examples and options.
- Main runtime exports in auth/neon/src/index.ts:
  - Types: NeonSessionResponse, NeonAuthUser.
  - Mapper: mapNeonUserToEEUser.
  - Options: MastraAuthNeonOptions.
- Class: MastraAuthNeon implementing IUserProvider<EEUser>,
ICredentialsProvider<EEUser>, ISessionProvider<Session>.
- Re-exports: MastraRBACNeon and its option types from ./rbac-provider.
- authenticateToken flow: verifyJwt → on success build NeonAuthUser from
JWT claims; on failure treat token as session cookie and call
fetchSession (GET /auth/get-session), preserving incoming Cookie header
and injecting token as the configured session cookie when needed.
- verifyJwt uses jose.createRemoteJWKSet and jwtVerify; fetchSession
returns typed session data only for OK responses containing both session
and user.
- signIn/signUp POST to Neon endpoints, map returned Neon user to
EEUser, return token and cookies if present; cookie parsing prefers
standard Set-Cookie retrieval with a comma-splitting fallback.
- RBAC implementation (auth/neon/src/rbac-provider.ts): getRoles uses
optional getUserRoles hook, a JWT fast-path, or Neon organization
memberships admin endpoint; fetch failures or invalid responses yield
empty roles. Caching implements LRU-like promotion and eviction.
- Minor security/tooling fix: replaced a trailing-slash regex with a
loop to avoid CodeQL catastrophic-regex alerts.

## Tests, Docs & Tooling
- Comprehensive unit tests added (auth/neon/src/index.test.ts) covering
JWKS/JWT flows, session fallback and headers/cookie behavior,
signIn/signUp wiring and error propagation, session provider methods,
RBAC behaviors and caching, and edge cases.
- README documents usage, options, two-stage auth flow, and
authorizeUser override example.
- Runtime dependency: jose; uses native fetch (no Neon SDK).

## Public API Changes / New Exports
- auth/neon/src/index.ts exports: NeonSessionResponse, NeonAuthUser,
mapNeonUserToEEUser, MastraAuthNeonOptions, class MastraAuthNeon, and
re-exports for MastraRBACNeon and its option types.
- auth/neon/src/rbac-provider.ts exports: NeonRoleMappingOptions,
MastraRBACNeonOptions, and class MastraRBACNeon implementing
IRBACProvider<NeonAuthUser>.

## Notes for Reviewers
- Verify correctness of JWT/session fallback behavior, cookie header
injection/preservation, and parsing of Set-Cookie headers.
- Confirm error handling for Neon endpoints
(sign-in/sign-up/get-session/organization membership) and that non-OK
responses surface useful messages.
- Review RBAC membership fetching, organization-scoping, cache
promotion/eviction, and behavior on network failures (should return
empty roles).
- Confirm package manifest (engine >=22.13.0, jose dependency, exports)
aligns with repo policies.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Abhi Aiyer <abhi@mastra.ai>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-06-11 21:25:12 -07:00