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

24 commits

Author SHA1 Message Date
Dane - AI (Mastra)
c22107fce3
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.45 (#29844) 2026-11-10 20:07:34 -08:00
Dane - AI (Mastra)
4bd4b7f48e
chore(deps): update better-auth monorepo to v1.7.18 (#29714)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-09 12:39:24 +01:00
Dane - AI (Mastra)
bfe3af4ae1
chore(deps): update better-auth monorepo to v1.7.15 (#29497) 2026-11-04 17:36:58 -08:00
Dane - AI (Mastra)
9ce7e350ea
chore(deps): lock file maintenance (#29341)
Co-authored-by: wardpeet <ward@coding-tech.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-04 15:03:55 +01:00
Dane - AI (Mastra)
f6cd11f348
chore(deps): lock file maintenance (#28672)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am on wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 10:02:15 +00:00
Dane - AI (Mastra)
07c1bf2362
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.42 (#28773) 2026-10-28 18:08:16 -07:00
Dane - AI (Mastra)
f2ad3844f3
chore(deps): update opentelemetry (#28581)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-28 16:48:54 -07:00
Dane - AI (Mastra)
29747ebd1d
chore(deps): update better-auth monorepo to v1.7.13 (#28538)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[@better-auth/drizzle-adapter@<1.7.7](https://www.better-auth.com/docs/adapters/drizzle)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/drizzle-adapter))
| pnpm-workspace.overrides | patch | [`1.7.7` →
`1.7.13`](https://renovatebot.com/diffs/npm/@better-auth%2fdrizzle-adapter@<1.7.7/1.7.7/1.7.13)
| `1.7.14` |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| pnpm-workspace.overrides | patch | [`^1.7.7` →
`^1.7.13`](https://renovatebot.com/diffs/npm/better-auth/1.7.7/1.7.13) |
`1.7.14` |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| dependencies | patch | [`^1.7.12` →
`^1.7.13`](https://renovatebot.com/diffs/npm/better-auth/1.7.12/1.7.13)
| `1.7.14` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### Release Notes

<details>
<summary>better-auth/better-auth
(@&#8203;better-auth/drizzle-adapter@<1.7.7)</summary>

###
[`v1.7.13`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1713)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.12...v1.7.13)

###
[`v1.7.12`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1712)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.11...v1.7.12)

###
[`v1.7.11`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1711)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.10...v1.7.11)

###
[`v1.7.10`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1710)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.9...v1.7.10)

###
[`v1.7.9`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#179)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.8...v1.7.9)

###
[`v1.7.8`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#178)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.7...v1.7.8)

##### Patch Changes

-
[#&#8203;11512](https://redirect.github.com/better-auth/better-auth/pull/11512)
[`4175b34`](4175b34a8f)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Align
the installed `@better-auth/utils` version with `better-call` while
accepting `^0.4.2 || ^0.5.0` across official package peers.

-
[#&#8203;11731](https://redirect.github.com/better-auth/better-auth/pull/11731)
[`0cfe07d`](0cfe07dccd)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Drizzle schemas that store dates in string columns now work:
`timestamp({ mode: "string" })`, MySQL `datetime({ mode: "string" })`,
and SQLite `text()`, including on Cloudflare D1. Before, the adapter
passed a JavaScript `Date` to those columns. Drivers such as
postgres-js, better-sqlite3 and D1 rejected it, so email sign-up, social
sign-in and session refresh failed. Filtering on those columns, for
example when listing sessions, failed the same way. Better Auth now
writes these dates as UTC text and reads a value without a time zone as
UTC.

If your server's time zone is not UTC and you use node-postgres or
mysql2 with a string column that has no time zone, existing rows were
written in the server's local time. They now read back shifted by the
server's UTC offset, so sessions and verification codes created before
the upgrade can expire early or late. Schemas generated by the CLI use
date columns and are unaffected.

</details>

<details>
<summary>better-auth/better-auth (better-auth)</summary>

###
[`v1.7.13`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1713)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.12...v1.7.13)

##### Patch Changes

-
[#&#8203;11985](https://redirect.github.com/better-auth/better-auth/pull/11985)
[`9cb95fe`](9cb95fe3d0)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Type
declarations no longer list type-only exports as values, so importing
one as a value now fails type checking instead of failing at runtime.

- Updated dependencies
\[[`2712441`](2712441e35),
[`1cf4b2c`](1cf4b2c8f5)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.13
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.13
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.13
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.13
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.13
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.13
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.13

###
[`v1.7.12`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1712)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.11...v1.7.12)

##### Patch Changes

-
[#&#8203;11925](https://redirect.github.com/better-auth/better-auth/pull/11925)
[`fb48619`](fb48619083)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - The JWT
plugin now verifies JWTs and session cookie-cache JWTs with the
algorithm of the stored key instead of the one named in the token
header, and logs a warning when it signs or verifies a JWT without an
issuer or audience.

-
[#&#8203;11924](https://redirect.github.com/better-auth/better-auth/pull/11924)
[`681aa5c`](681aa5c443)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
`auth.api.getSession()` now keeps the original database error as
`error.cause` when the session lookup fails, so server code can tell a
transient failure from a bug.

-
[#&#8203;11930](https://redirect.github.com/better-auth/better-auth/pull/11930)
[`b18e3b8`](b18e3b8fdf)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - OAuth
callbacks completed through the OAuth proxy now run the same checks as
the standard OAuth callback, including issuer and ID token nonce
validation.

- Updated dependencies
\[[`681aa5c`](681aa5c443),
[`4bc78ba`](4bc78baa83),
[`876608d`](876608da86),
[`083a743`](083a74329b),
[`492134a`](492134aeba)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.12
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.12
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.12
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.12
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.12
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.12
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.12

###
[`v1.7.11`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1711)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.10...v1.7.11)

##### Patch Changes

-
[#&#8203;10719](https://redirect.github.com/better-auth/better-auth/pull/10719)
[`bd65db0`](bd65db02c1)
Thanks [@&#8203;rendermani](https://redirect.github.com/rendermani)! -
Recognize PostgreSQL `int8` as a valid number type in migration diffs.
Kysely's introspector reports `pg_type.typname`, so Better Auth's own
`bigint` columns (such as the database-backed rate limiter's
`lastRequest`) came back as `int8` and were reported as a type mismatch
on every run.

-
[#&#8203;11521](https://redirect.github.com/better-auth/better-auth/pull/11521)
[`37a75c9`](37a75c95d1)
Thanks [@&#8203;aryan1306](https://redirect.github.com/aryan1306)! - Fix
database-backed rate limiting returning an excessively large
`X-Retry-After` header instead of the remaining seconds in the
rate-limit window.

- Updated dependencies
\[[`ce96569`](ce965696d1),
[`2f6ca3f`](2f6ca3f370),
[`dfd8dd2`](dfd8dd287a)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.11
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.11
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.11
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.11
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.11
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.11
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.11

###
[`v1.7.10`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1710)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.9...v1.7.10)

##### Patch Changes

-
[#&#8203;11393](https://redirect.github.com/better-auth/better-auth/pull/11393)
[`eebd47a`](eebd47a0e7)
Thanks [@&#8203;breken-ai](https://redirect.github.com/breken-ai)! - If
you use the `lastLoginMethod` plugin with `oneTap`, signing in through
Google One Tap now records `"google"`, the same value as signing in with
the Google button. Before, a One Tap sign-in recorded nothing: the
`better-auth.last_used_login_method` cookie kept its previous value or
stayed unset, and so did `user.lastLoginMethod` with `storeInDatabase`.

If your `customResolveMethod` includes a `/one-tap/callback` →
`"google"` workaround, remove that mapping; keep the resolver if it
handles other routes.

-
[#&#8203;11821](https://redirect.github.com/better-auth/better-auth/pull/11821)
[`09d07e6`](09d07e6fea)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- The Google One Tap prompt (`authClient.oneTap()` without `button`) no
longer calls `getSkippedReason()`, which Google's FedCM migration guide
says to remove. Before, it called it under any `promptOptions.fedCM`
setting.

A skipped prompt now ends the flow and calls `onPromptNotification`
right away instead of retrying. Google doesn't report why a prompt was
skipped, and a prompt the user closed stays hidden for Google's cooldown
period, so the retries could not bring it back. Dismissed prompts still
retry as before.

Google Identity Services still logs its FedCM migration warning, because
it does so whenever `prompt()` receives a listener. The plugin needs the
listener to track dismissals and skips, so the warning is expected and
safe to ignore.

-
[#&#8203;11819](https://redirect.github.com/better-auth/better-auth/pull/11819)
[`eaecb72`](eaecb7229e)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Google One Tap now applies your
`socialProviders.google.mapProfileToUser` and custom `getUserInfo`, the
same as the standard Google sign-in. Before, One Tap ignored both and
always stored the token's `name`, `email`, `email_verified`, and
`picture` claims.

If you configured either one, users created through One Tap now get the
fields it returns, including any extra fields such as a first name from
`given_name`. Returning users are updated from it on each One Tap
sign-in when `socialProviders.google.overrideUserInfoOnSignIn` is on,
and so are existing users that One Tap links when
`account.accountLinking.updateUserInfoOnLink` is on. Check that your
mapper suits One Tap users too.

If you set `socialProviders.google.overrideUserInfoOnSignIn`, One Tap
sign-ins now update returning users' name, image, and email from Google,
as the redirect sign-in already does.

Setups that configure none of these, including `oneTap({ clientId })`
with no Google provider, are unaffected.

-
[#&#8203;11820](https://redirect.github.com/better-auth/better-auth/pull/11820)
[`88c9a37`](88c9a37856)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- If you set `autoSelect` or `cancelOnTapOutside` on `oneTapClient()`,
the One Tap prompt and the Sign in with Google button now use them.
Before, only values passed to `authClient.oneTap()` took effect, so with
`autoSelect: true` on the plugin, returning users still had to pick an
account. Values passed to `oneTap()` still override the plugin's. Apps
that set these options only on `oneTap()`, or not at all, are
unaffected.

-
[#&#8203;11696](https://redirect.github.com/better-auth/better-auth/pull/11696)
[`0cf1f7c`](0cf1f7c6bc)
Thanks [@&#8203;drewsephski](https://redirect.github.com/drewsephski)! -
You can now import the One Tap plugin from
`better-auth/plugins/one-tap`, as you can for other plugins. Previously
this import failed with a "not exported" error. Imports from
`better-auth/plugins` and `better-auth/client/plugins` are unchanged.

-
[#&#8203;11822](https://redirect.github.com/better-auth/better-auth/pull/11822)
[`414e845`](414e845f12)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- You can now import the Captcha and OpenAPI plugins from
`better-auth/plugins/captcha` and `better-auth/plugins/open-api`, as you
can for other plugins. Previously these imports failed with a "not
exported" error. Imports from `better-auth/plugins` are unchanged.

If your TypeScript config uses `"moduleResolution": "node"` (or
`node10`), `better-auth/plugins/multi-session` and `better-auth/test`
now resolve their types. Previously TypeScript reported that it could
not find their declarations. Projects using `bundler`, `node16`, or
`nodenext` resolution are unaffected.

- Updated dependencies
\[[`fedd055`](fedd05586c),
[`bbd0a19`](bbd0a19c30),
[`99cdfe7`](99cdfe7c2e)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.10
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.10
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.10
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.10
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.10
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.10
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.10

###
[`v1.7.9`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#179)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.8...v1.7.9)

##### Patch Changes

-
[#&#8203;11766](https://redirect.github.com/better-auth/better-auth/pull/11766)
[`6edaa61`](6edaa61e62)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - An
`onAPIError.onError` handler that throws or rejects no longer fails the
request or causes an unhandled promise rejection. The error is logged
and the original error response is returned. Async handlers now finish
before the response is sent.

- Updated dependencies \[]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.9
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.9
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.9
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.9
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.9
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.9
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.9

###
[`v1.7.8`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#178)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.7...v1.7.8)

##### Patch Changes

-
[#&#8203;11512](https://redirect.github.com/better-auth/better-auth/pull/11512)
[`4175b34`](4175b34a8f)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Align
the installed `@better-auth/utils` version with `better-call` while
accepting `^0.4.2 || ^0.5.0` across official package peers.

-
[#&#8203;11565](https://redirect.github.com/better-auth/better-auth/pull/11565)
[`b1cfc1e`](b1cfc1ec1e)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Omit
non-returned custom fields from inferred output schema types.

-
[#&#8203;11540](https://redirect.github.com/better-auth/better-auth/pull/11540)
[`678c555`](678c555beb)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Align
cookie security attributes with RFC 6265bis.

-
[#&#8203;10591](https://redirect.github.com/better-auth/better-auth/pull/10591)
[`193efff`](193efff3d2)
Thanks [@&#8203;kdelay](https://redirect.github.com/kdelay)! - Expired
or revoked sessions now clear stale cookies when using `customSession`.

-
[#&#8203;11625](https://redirect.github.com/better-auth/better-auth/pull/11625)
[`369176e`](369176e7f6)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Fixed single-use checks for apps that set
`advanced.database.generateId: "uuid"`. Default id generation is
unaffected, and no migration is needed.

- On SQLite and MySQL, SAML sign-in, DPoP-bound requests checked against
the database replay store, `private_key_jwt` client authentication, and
magic link or email OTP sign-ins that adopt an unverified account failed
with a `NOT NULL` error on the `id` column. They now work. SIWE sign-in
ignored the `email` field and used the wallet-derived address; it now
uses the supplied email when no other account has it.
- On Postgres and MongoDB, a reused SAML assertion, DPoP proof, or
client assertion was accepted. Each one is now accepted only once.

With `generateId: "serial"`, behavior is unchanged: these checks need
string ids, and Better Auth now logs a warning the first time one of
these flows runs.

-
[#&#8203;11391](https://redirect.github.com/better-auth/better-auth/pull/11391)
[`352d04c`](352d04c8eb)
Thanks [@&#8203;breken-ai](https://redirect.github.com/breken-ai)! - Fix
`customSession` treating session lookup failures as signed-out users.
Server-side `getSession` now throws an API error, and HTTP clients
receive an error response.

-
[#&#8203;11750](https://redirect.github.com/better-auth/better-auth/pull/11750)
[`e9d9921`](e9d9921217)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Generic OAuth providers configured with `discoveryUrl` now recover
without a restart when discovery fails at startup. Since 1.7.3, a
provider whose discovery request failed at boot (for example, because
the identity provider was still starting) was skipped, and every sign-in
returned `PROVIDER_NOT_FOUND` until the app restarted. Better Auth now
retries discovery on the next sign-in, callback, or account-linking
request for that provider, and the provider works as soon as discovery
succeeds. While discovery keeps failing, sign-in and account linking
still return `PROVIDER_NOT_FOUND` and callbacks redirect with
`error=oauth_provider_not_found`, and each request may wait up to 10
seconds for the retry.

-
[#&#8203;11549](https://redirect.github.com/better-auth/better-auth/pull/11549)
[`1bd5c37`](1bd5c37884)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`lastLoginMethod` failing sign-in when `cookieName` or `maxAge` is
explicitly `undefined`.

-
[#&#8203;11174](https://redirect.github.com/better-auth/better-auth/pull/11174)
[`766cfb3`](766cfb3f42)
Thanks [@&#8203;Bekacru](https://redirect.github.com/Bekacru)! - Stop
double-decoding `callbackURL`, `newUserCallbackURL` and
`errorCallbackURL` on magic link verify so percent-encoded characters in
callback query params are preserved.

-
[#&#8203;11505](https://redirect.github.com/better-auth/better-auth/pull/11505)
[`c46992f`](c46992f6ce)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
Preserve the referenced model and field keys when generating Kysely
migrations, so custom table names that match another model key produce
the intended foreign keys.

-
[#&#8203;11718](https://redirect.github.com/better-auth/better-auth/pull/11718)
[`1d95ebf`](1d95ebf3fe)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
missing device sessions and failed automatic session switching after
cache eviction when `storeSessionInDatabase` is enabled and
`preserveSessionInDatabase` is disabled. Automatic switching now follows
the order of held sessions, and large lists or sessions whose users no
longer exist no longer cause valid sessions to disappear.

-
[#&#8203;10266](https://redirect.github.com/better-auth/better-auth/pull/10266)
[`c68b2cd`](c68b2cd8a5)
Thanks [@&#8203;shiminshen](https://redirect.github.com/shiminshen)! -
Projects that enable `exactOptionalPropertyTypes` can use the
`oauthProvider()` and `mcp()` plugins again. Since 1.7.0, adding either
plugin to `betterAuth()` failed to type-check with a TS2322 error.

-
[#&#8203;11637](https://redirect.github.com/better-auth/better-auth/pull/11637)
[`2627237`](2627237fae)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Projects using the organization plugin with `skipLibCheck: false` no
longer get `TS2536: Type '"role"' cannot be used to index type ...` from
`crud-members.d.mts`. The `role` returned by `getActiveMemberRole` is
now typed as the organization's role names directly. Projects with
`skipLibCheck: true` (the default in most templates) were unaffected.

-
[#&#8203;10866](https://redirect.github.com/better-auth/better-auth/pull/10866)
[`3d1f008`](3d1f008ae3)
Thanks [@&#8203;heliohm](https://redirect.github.com/heliohm)! - The
organization plugin no longer pulls every zod locale into server
bundles.

-
[#&#8203;11626](https://redirect.github.com/better-auth/better-auth/pull/11626)
[`67743ed`](67743ed6e8)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Password resets and password changes no longer keep the new password
when revoking the user's sessions fails. With
`revokeSessionsOnPasswordReset` or `revokeOtherSessions`, database
sessions are revoked and the password is saved in one transaction when
transactions are enabled for the adapter, so a failure leaves the old
password and sessions in place. Sessions in secondary storage are still
removed after commit, on a best-effort basis. This covers
`/reset-password`, the email OTP and phone number reset endpoints, and
`/change-password`. `onPasswordReset` now runs after sessions are
revoked, so a throwing callback no longer leaves them active, and a
callback that lists the user's sessions no longer sees the revoked ones.

-
[#&#8203;10698](https://redirect.github.com/better-auth/better-auth/pull/10698)
[`f0ce580`](f0ce580fbd)
Thanks
[@&#8203;jashkarangiya](https://redirect.github.com/jashkarangiya)! - If
you set the phone number plugin's `verifyOTP` option,
`/phone-number/reset-password` now checks the code with it, as
`/phone-number/verify` already does. Before, password reset always
compared the code with the one Better Auth generated, so apps that
verify codes through a provider such as Twilio Verify could not reset
passwords. If your `sendPasswordResetOTP` sends the code Better Auth
generates, make sure `verifyOTP` accepts that code. Apps that don't set
`verifyOTP` are unaffected.

-
[#&#8203;11646](https://redirect.github.com/better-auth/better-auth/pull/11646)
[`07a0938`](07a09389ef)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- A failed password reset no longer spends the reset link or OTP.
`/reset-password`, `/email-otp/reset-password` and
`/phone-number/reset-password` now check the token or code without
consuming it, validate and hash the new password, then consume it in the
same transaction as the session revocation and password write. A
rejected password, such as one refused by `haveIBeenPwned`, always
leaves the link or OTP usable. A later failure, such as a failed session
revocation or password write, also leaves it usable when the adapter's
transactions are enabled and verification values are stored in the
database (the default without secondary storage, or
`verification.storeInDatabase: true`). Wrong codes still count against
the OTP attempt limit.

-
[#&#8203;11643](https://redirect.github.com/better-auth/better-auth/pull/11643)
[`92dfcea`](92dfceaa14)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- A sign-up that fails after its session is created no longer leaves
that session in secondary storage. With `storeSessionInDatabase` enabled
and `preserveSessionInDatabase` off, the secondary-storage copy is
written only after the sign-up commits, and listing a user's sessions
now reads the database, so a session whose cached copy failed to write
is still listed and revoked. With other secondary-storage settings,
sign-up, passkey registration and SSO sign-in with `resolveUser` keep
the session write inside their transaction, so a storage failure rolls
back the new user, passkey or account instead of keeping them without a
session. A session revoked by a `session.create.after` database hook
also stays revoked.

-
[#&#8203;11488](https://redirect.github.com/better-auth/better-auth/pull/11488)
[`e15625f`](e15625ff38)
Thanks [@&#8203;Bekacru](https://redirect.github.com/Bekacru)! -
SvelteKit 3 projects can now install Better Auth without
`--legacy-peer-deps`. The `@sveltejs/kit` peer range now includes
`^3.0.0`; SvelteKit 2 projects are unaffected.

- Updated dependencies
\[[`4175b34`](4175b34a8f),
[`435645e`](435645e5eb),
[`369176e`](369176e7f6),
[`0cfe07d`](0cfe07dccd),
[`9904b29`](9904b29ece),
[`e78f15a`](e78f15aa31),
[`60525e0`](60525e08fd),
[`8133265`](813326536c),
[`ea85d13`](ea85d133d6),
[`916ef5c`](916ef5c530),
[`1d95ebf`](1d95ebf3fe),
[`6214610`](62146108c7),
[`67743ed`](67743ed6e8),
[`c46d2a6`](c46d2a6ac4),
[`92dfcea`](92dfceaa14),
[`a9f455d`](a9f455d586),
[`9725f1b`](9725f1b361)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.8
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.8
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.8
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.8
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.8
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.8
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.8

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am every weekday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODYuNCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5Mi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-28 19:24:36 +00:00
Dane - AI (Mastra)
82e82fb5a7
chore(deps): update security updates [security] (#27869)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-22 14:54:47 +02:00
Dane - AI (Mastra)
4f60903242
chore(deps): lock file maintenance (#27013) 2026-10-21 09:25:38 +02:00
shreyas-mastra
fa409d430b
security: Vanta remediation pass 2026-10-14/15/19 (zod 4.6.7, @ai-sdk/provider-utils, @copilotkit template) (#27023) 2026-10-19 11:32:32 -07:00
shreyas-mastra
7aec8b0d95
security: Vanta remediation pass 2026-10-12 (better-auth, MCP SDK) (#26773)
## Summary
Vanta remediation for 2026-10-12. Target list is today's live export (77
findings, 44 unique IDs). Platform findings are handled in
mastra-ai/platform#3317.

### What changed
| Package | From → To | Findings | Where | How |
|---|---|---|---|---|
| better-auth | 1.7.5 → 1.7.7 | AIKIDO-2026-373183 (Critical) | root +
`examples/agent` | raise override `better-auth: ^1.7.7`; direct dep
`@mastra/auth-better-auth` ^1.7.7 |
| @better-auth/drizzle-adapter | 1.7.5 → 1.7.7 | AIKIDO-2026-261025
(Low) | root + `examples/agent` | floor
`'@better-auth/drizzle-adapter@<1.7.7': 1.7.7` (also pulled by
better-auth 1.7.7) |
| @modelcontextprotocol/sdk | 1.31.0 → 1.32.1 | AIKIDO-2026-365378
(High), -156139, -344432 | root, nested locks, `scripts/gh-issue-triage`
| raise floor to `<1.32.0 → 1.32.1`; bump direct pins/ranges |

Nested `pnpm-workspace.yaml` floors raised in e2e-tests/*, examples/*,
integration-tests, etc., and those lockfiles regenerated. Versions used
were published >24h ago (minimumReleaseAge). Patch changeset included
for published packages whose dependency ranges changed.

Aikido lens on this branch: better-auth and MCP SDK findings are gone.
OSV: handlebars already clear on main; remaining high are
braces/extract-zip (no patch).

### Left as-is (no patch, or major-only)
- extract-zip ≤2.0.1: no fix (overdue; removed by #25855 when that
lands). Needs Vanta risk acceptance.
- braces 3.0.3, sprintf-js 1.0.3/1.1.3: no patched release
- postcss-selector-parser 6.x: @tailwindcss/typography pins 6.0.10
- katex 0.16: mermaid declares ^0.16.47
- @ag-ui/client 0.0.59: fix only in 1.0.0 (major). Parent
`@copilotkit/channels-*` 0.11.0 pins 0.0.59 exactly
(template-genui-data-explorer)
- @hono/node-server 1.19 (fix 2.1.3), undici 6.29 (fix 7.23/8.10),
raw-body 3 in templates (fix 4), bundle-name 3 (fix 4.1.1), got 15 (fix
16), zod 3.25 (fix 4.x), @bufbuild/protobuf 1.10 (fix 2.x), openai 6.49
(fix 7.x), jose 5.10 via @segment/analytics-node in template (fix 6.x),
@ai-sdk/provider-utils 2.2.8 / 3.0.x Aikido ranges wanting 4.0.18+:
major-only or scanner range noise

Do not merge unless reviewed. No CI weakened.


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

## ELI5

This PR updates shared dependency versions so the project uses newer
releases of Better Auth and the MCP SDK. It also updates workspace rules
to keep older versions from being selected.

## Changes

- Updated Better Auth requirements and workspace overrides to `^1.7.7`.
- Updated `@modelcontextprotocol/sdk` requirements and overrides to
`1.32.1` across affected packages and workspaces.
- Added overrides for older `@better-auth/drizzle-adapter` versions to
use `1.7.7`.
- Added a patch changeset for `@mastra/auth-better-auth`,
`@mastra/mcp-registry-registry`, and `@mastra/playground-ui`.

Test results and review findings were not provided.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-13 07:41:26 -07:00
Michael 'Misha' Nightingale
84143a892e
feat(livekit)!: prepare 0.5.0 with recording and speech metrics (#24674)
Prepare the LiveKit 0.5.0 release with opt-in call recording and Studio
playback. `dispatchVoiceSession()` and `liveKitConnectionRoute()` can
create a fresh room with LiveKit auto egress before dispatching the
agent. The recording route resolves an authorized trace to a short-lived
playback URL, and Studio exposes it through **Review Audio**.

```ts
await dispatchVoiceSession({
  roomName: `call-${crypto.randomUUID()}`,
  metadata: { agentId: 'support' },
  recording, // Server-side LiveKit output settings.
});
```

Recording review requires an explicit `authorize({ traceId, context })`
callback. Only `true` permits trace lookup and playback URL resolution;
missing policies fail at registration. Recording room conflicts return
HTTP 409. The example and documentation cover S3 configuration, scoped
permissions, consent, and recording lifecycle implications. Browser
recording creation and playback in the unauthenticated example require
an explicit local-demo opt-in and are disabled in production.

The browser-safe `@mastra/livekit/client` entry point provides
`getLiveKitRecording(client, traceId)`, preserving the client's
authentication and request configuration. Studio uses the supported
React hook subpaths from main.

The integration also adds common per-turn metrics, speech-flush
boundaries, and an `onSpeechComplete` hook. `onTurnComplete` retains its
generation-only behavior. Custom reply-generator consumers must handle
flush boundaries, and `MastraLLM` integrations should use
`mastraLLMNode`. Playback completion describes server delivery, not
proof that the listener heard the audio.

The VAD opt-out is fixed. LiveKit Agents 1.7.1 is the supported minimum
and migration target, with matching plugin peer ranges and upgrade
instructions. The planned stable release remains **0.5.0**.

### Validation

- All 280 LiveKit tests across 22 files passed.
- All 18 Studio voice and recording-review tests passed.
- A local synthetic probe passed 96 example route-policy cases covering
room creation, dispatch, unrecorded tokens, storage access, and denied
playback.
- LiveKit, React SDK, shared Studio UI, and production Studio builds
passed.
- LiveKit, Studio, and voice-agent example typechecks passed; focused
lint and documentation checks passed.
- Production bundle inspection confirmed that the recording client adds
no LiveKit server or worker modules to the browser bundle.
- Changeset planning retains the 0.5.0 release target.

The core working-memory configuration fix and its regression tests are
in #26090 for separate review.
2026-10-06 14:38:25 -07:00
shreyas-mastra
bf0dd07091
security: Vanta remediation pass 2026-10-05 (#25966)
Update 2026-10-06 (commits added on this branch; origin/main merged in
to clear the lockfile conflict)

Dependabot opened new alerts overnight (4 critical). This pass adds:
- braintrust ^3.24.0 -> ^3.36.0 in @mastra/braintrust. braintrust 3.27
pulled in simple-git 3.36.0, which has critical and high advisories
(GHSA-x6jw-m9v5-85vh, GHSA-v5rq-49vh-5v5c via @simple-git/argv-parser
1.1.1, GHSA-858h-whjf-mvg5, GHSA-g4wm-2vf7-vfgr). Those are only fixed
in simple-git 4. braintrust 3.36 no longer depends on simple-git, so
simple-git drops out of the lockfile. @mastra/braintrust only uses
initLogger and currentSpan.
- wrangler ^4.110.0 -> ^4.147.0 (devDependency of
@mastra/deployer-cloudflare, type-only import). This moves workerd
1.20260708.1 -> 1.20261001.1 on that chain (Aikido medium). workerd
1.20260714.1 is still there through the miniflare 4 devDependency in
stores/cloudflare and stores/cloudflare-d1.
- source-map-js 1.2.1 -> 1.2.2 (GHSA-68fv-2mgg-jv7q, high). Added the
floor `source-map-js@>=1.0.0 <1.2.2: 1.2.2` in the root and in 15 nested
pnpm workspaces (9 e2e projects, mastracode/web, otel-bridge agent-hub
and hono-multi, agent-builder, mcp and memory integration-tests).
postcss, css-tree, magicast and @tailwindcss/node all declare ^1.2.x. In
the customer-refund template, a plain npm lock refresh was enough (no
override).
- postcss-selector-parser: raised the existing floor from `>=7.1.0
<7.1.3: 7.1.3` to `>=7.1.0 <7.1.6: 7.1.6` (GHSA-rj75-hqrm-r3gf, medium).
- observability/_examples/otel-bridge/hono-multi: tsx catalog ^4.21.0 ->
^4.23.15. tsx 4.23 uses esbuild ~0.28, so esbuild 0.27.2 is gone (Aikido
high and low, fixed in 0.28.1).
- Changeset `.changeset/vanta-2026-10-06.md`: patch for
@mastra/braintrust.

Still not fixed (as of 2026-10-06)
- sprintf-js 1.0.3/1.1.3 (GHSA-hp3w-g68c-fv3c): no patched release.
- postcss-selector-parser 6.0.10/6.1.3: the fix is only in 7.1.6.
@tailwindcss/typography 0.5.20 pins 6.0.10 exactly, and cssnano
6/postcss-calc 9 use ^6.
- katex 0.16.47 (GHSA-238p-pmpm-9mq7, low): the fix is in 0.18.2.
mermaid 12.1.0 still declares ^0.16.47.
- http-cache-semantics: 4.3.0 is now older than 24h, but it still
doesn't touch the max-stale path, and the advisory still lists no
patched version.
- braces 3.0.3 has no new release.
- The rest of the deferred list below is unchanged.

---

Vanta remediation for 2026-10-05. The finding list was rebuilt from
GitHub Dependabot, OSV-scanner on every tracked lockfile, and Aikido
intel (full intel.aikido.dev feed re-pulled today). It is not a Vanta
export.

What changed

Package bumps
- probe-image-size ^7.2.3 -> ^7.4.0 in @mastra/memory
(GHSA-gjj5-9665-rwrc, high).
- verdaccio ^6.10.4 -> ^6.10.5 in the 9 e2e projects. That moves
@verdaccio/core to 8.3.2 and js-yaml 5.2.2 -> 5.4.1
(GHSA-r3ph-w7gj-g6xm, medium).
- smol-toml 1.8.0 -> 1.9.0 pin in @mastra/code-sdk.

Root lockfile refresh (no range changes)
- serialize-javascript 7.0.5 -> 7.1.2, shell-quote 1.10.0 -> 1.12.0, ws
7.5.11 -> 7.5.13, enhanced-resolve -> 5.26.0, fs-extra 11.3.5 -> 11.4.1,
@sinclair/typebox 0.27.8 -> 0.27.12, @zip.js/zip.js 2.8.26 -> 2.23.0,
memfs/@jsonjoy.com/fs-snapshot 4.57.2 -> 4.80.0, @vue/* 3.5.38 ->
3.5.43.

pnpm overrides, for parents that pin an exact vulnerable version. All
stay in the same major.
- modern-tar 0.7.7 (just-bash), smol-toml 1.9.0 (just-bash,
@blaxel/core, @react-grab/cli, modal), strnum 2.4.2 (fast-xml-parser
5.10.1), inline-style-parser 0.2.9 (style-to-object 1.0.11),
`@opentelemetry/configuration>yaml` 2.9.1 (sdk-node 0.221).

Nested lockfiles
- shell-quote floor raised from <1.10.0 to <1.11.0 in examples/agent,
examples/voice-agent and otel-bridge/agent-hub.
- yaml 2.9.0 -> 2.9.1 in e2e-tests/pkg-outputs, examples/durable-agents,
mastracode/web, packages/mcp/integration-tests and the customer-refund
template.
- next 16.3.6 -> 16.3.8 in packages/memory/integration-tests.
- customer-refund template: tinypool 2.1.0 -> 2.1.2 through an override
scoped to oxfmt. oxfmt 0.59 pins it exactly, and bumping oxfmt would
change the template's format check.

Not fixed here
- braces 3.0.3 (GHSA-vfj7-8cjw-p6xm) and http-cache-semantics 4.2.0
(GHSA-ch52-4w7c-c8xp): no patched release. http-cache-semantics 4.3.0 is
outside the advisory range, but it doesn't change the max-stale code
path, so bumping to it would only hide the alert.
- extract-zip 2.0.1: no patched release. It comes from the webdriverio
chain that #25855 removes.
- workerd 1.20260708/1.20260714 (Aikido medium): miniflare 4.x stops at
workerd 1.20260730. The fix needs miniflare 5, which is only published
as an alpha.
- Major-only: @ai-sdk/provider-utils 2.2.8 / ai 4.3.19 (AI SDK v4),
@opentelemetry/core 1.30.1, esbuild 0.18/0.25/0.27.0 (convex pins 0.27.0
exactly), js-yaml 3, brace-expansion 1/2, uuid 11, zod 3, pino 8/9,
undici 6, plus other Aikido lows.
- websocket-driver 0.7.5: Aikido says the fix is 0.8.x, but no 0.8 is
published on npm.

The changeset is a patch for @mastra/memory and @mastra/code-sdk.


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

This PR updates several dependencies that have security fixes. It also
adds version rules so nested projects use safer versions of related
packages.

## Changes

- Updates `probe-image-size` in `@mastra/memory` to `^7.4.0` and pins
`smol-toml` in `@mastra/code-sdk` to `1.9.0`.
- Updates Verdaccio to `^6.10.5` in nine end-to-end test projects.
- Raises `shell-quote` overrides to `1.11.0` and adds overrides for
transitive dependencies, including `yaml`, `source-map-js`,
`postcss-selector-parser`, `modern-tar`, `smol-toml`, `strnum`,
`inline-style-parser`, and `tinypool`.
- Updates `braintrust` to `^3.36.0`, `wrangler` to `^4.147.0`, and `tsx`
to `^4.23.15`.
- Adds patch changesets for `@mastra/memory`, `@mastra/code-sdk`, and
`@mastra/braintrust`. The changesets report no API changes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-06 10:35:09 -04:00
shreyas-mastra
4358322b7b
chore(deps): override upstream-blocked vulnerable transitive deps (#25853) 2026-10-02 18:03:50 -07:00
shreyas-mastra
aeddbc9909
security: Vanta 2026-09-28 residuals (template proxy-addr, nested undici/next/shell-quote/form-data, OTEL, onnxruntime) (#25344) 2026-09-28 10:45:13 -07:00
shreyas-mastra
7b777d38d9
security: Vanta zero pass 2026-09-23 (grpc/compression/provider-utils floors) (#24848) 2026-09-23 13:58:39 -07:00
Dane - AI (Mastra)
2592c7226a
chore(deps): lock file maintenance (#19457)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am on wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjMuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->
2026-07-17 20:28:50 +02:00
Lennart
3356bf3dd0
chore(docs): AX improvements (#19631) 2026-07-17 14:29:48 +02:00
Dane - AI (Mastra)
2e858270c6
chore(deps): lock file maintenance (#19080)
Co-authored-by: wardpeet <ward@coding-tech.com>
2026-07-13 23:54:17 +02:00
Marvin Frachet
f701530e7a
docs(react): add narrow API responsibility rule (#19336)
Adds a React best-practices rule for components, hooks, functions, and
utilities with oversized input or output APIs. It clarifies that
wrapping the same values in one object does not reduce responsibility
and shows how to split broad hooks into focused units composed at the
component level.\n\nThe rule catalog and quick reference now include the
new guidance and updated rule counts. Documentation structure, links,
counts, and fenced examples were validated.

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

This PR adds a new React “best practice” rule: if a
component/hook/function is taking in (or returning) too much at once,
you should split it into smaller, clearer pieces and then combine them
where it’s used. It also updates the rule catalog and adds a bit of
formatting/coverage cleanup in the voice-agent example tests.

## Changes

- Added a new React best-practices rule: `structure-narrow-apis` (“Keep
Input and Output APIs Narrow”) for components, hooks, functions, and
utilities.
- Clarified that wrapping unrelated things into a single
parameter/return object doesn’t truly narrow responsibility.
- Included incorrect vs. correct examples showing how to split an
oversized “mega-hook” into focused hooks and compose them in a
container/component.
- Updated the React best-practices rule catalog/quick reference (version
and rule/category counts), adding the new rule entry and revising totals
from 25 to 26 rules.
- Reformatted and lightly adjusted voice-agent example smoke coverage
and related example code without changing core behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-13 10:50:53 +02:00
Michael 'Misha' Litchev
25c1a4f6c0
feat(livekit): grouped worker configuration + MastraLLM plugin + voice-agent example (#19136)
## Description

This is the final PR of the stack split from #19019: memory
summarization (#19135, merged) → **livekit worker configuration +
MastraLLM plugin + voice-agent example (this PR)**. The example PR
(#19137) was consolidated into this one after review feedback landed, so
the package changes and the runnable example that exercises them ship
and get reviewed together.

> **Note for reviewers:** Tyler's split request listed the worker
`configuration` surface; the `MastraLLM` plugin work landed on the
original branch after that comment. Both are `@mastra/livekit` package
code, so they ride together here — happy to split the plugin into its
own 4th PR if you'd rather review it separately.

### `@mastra/livekit` — new grouped `configuration` worker option

One home for conversation & compliance policy on `createLiveKitWorker`,
so each control doesn't become another top-level option:

- **`configuration.greeting` — AI disclosure controls.** `text` spoken
at call start; `allowInterruptions: false` so a legally-required AI
disclosure plays through and can't be barged over (EU AI Act Art. 50);
`awaitPlayout: true` holds post-greeting work (persistence,
`onSessionStart`) until it finishes; `persist` saves it to the memory
thread; `repeatEvery`/`repeatText` re-disclose periodically on long
calls, spoken at the next turn boundary, never mid-sentence (CA SB
243-style requirements).
- **Per-tenant dynamic greeting.** `greeting.text` also accepts a
resolver `({ metadata, requestContext, roomName, ctx }) => string |
undefined`, resolved once per call *post-connect* — so one shared
multi-tenant agent opens with each tenant's own brand/disclosure
phrasing keyed off dispatch metadata / request context.
- **`configuration.stt` / `configuration.tts` — per-call resolvers.**
Pick the transcriber and voice per call — one voice or language per
tenant — falling back to the top-level `stt`/`tts` when they return
`undefined`.
- **`configuration.consentPolicy` — named consent model.** (Renamed from
`requireConsent` per review — it is declarative only; the worker
enforces nothing by itself.) Declares the data-use consents a call needs
as an extensible named set (starting with `summaryStorage`);
requirements are surfaced on `onCallEnd` for enforcement. Paired with
**`createConsentTool`** (new server-safe root export): captures each `{
item, granted }` decision at runtime with the caller identity from tool
context and hands it to an app-owned store.
- **`configuration.endCall` — agent-initiated hang-up.** Paired with
**`createEndCallTool`** (new server-safe root export). The worker waits
for the goodbye to finish playing out (`waitForAgentDoneSpeaking`,
capped by `maxWaitMs`), optionally speaks a non-interruptible closing
`message`, then deletes the room and shuts down the job — running
`onCallEnd` exactly as a caller hang-up does. Works on both the agent
and workflow reply paths.
- **Backwards compatible.** The released top-level `greeting` /
`persistGreeting` options remain as deprecated aliases;
`configuration.greeting` wins field-by-field.

### `@mastra/livekit/plugin` — `MastraLLM`, use Mastra as the LLM inside
a customer-owned LiveKit session

Until now, using Mastra for voice meant Mastra ran the *whole* call.
`MastraLLM` flips the ownership: the customer keeps their own LiveKit
`AgentSession` — their STT/TTS vendors, turn detection, deployment — and
drops Mastra into the LLM slot as a standard `llm.LLM` plugin.

- **New `@mastra/livekit/plugin` subpath export** (root stays
server-safe): `MastraLLM extends llm.LLM`, plugs straight into
`voice.AgentSession({ llm: new MastraLLM(...) })`.
- **Three interchangeable brain sources** (exactly one required):
`remote` (HTTP/SSE to a running Mastra server via
`createRemoteAgentReplyGenerator`, with abort propagation and
configurable timeouts), `agent` (in-process), or `generate` (fully
custom).
- **Mastra features surface cleanly:** thread/resource memory plumbed
per call; shared message ids dedupe what the server already persisted;
LiveKit-side `instructions` filtered rather than double-applied;
`memory` + LiveKit's preemptive generation guarded and documented.
- **Interrupted turns self-heal:** on barge-in the server skips
persisting the unheard reply; the plugin records only what the caller
actually heard, flags it interrupted, and reconciles it into memory on
the next turn.
- **Hooks:** `toolFeedback` (spoken filler while a tool runs),
`onToolCall`, `onTurnComplete` (per-turn
text/tool-calls/interrupted/usage, off the audio path).
`createLiveKitWorker` gained the same `onToolCall`/`onTurnComplete`
hooks, since both paths now share one reply seam.

### Drift fix vs the original branch

`main` bumped `@livekit/agents` 1.4.11 → 1.5.0 after #19019 branched.
1.5.0 turns `ToolContext` into a class that `AgentSession` always passes
to `llm.chat()` — `Object.keys()` on it saw only private fields, so
`MastraLLM`'s ignored-tools warning fired on every session (even
tool-less) with garbage names. Fixed in a dedicated commit (262d90d7fc):
tool names now come from the instance's `flatten()`, with plain-map
fallback for 1.4; two regression tests added.

## Scope

- All `integrations/livekit` changes: `configuration`
(greeting/consent/endCall/stt/tts), consent + end-call tools,
`MastraLLM` plugin, remote SSE transport, reply-seam hooks, README
- Docs: LiveKit voice guide (wrapper-vs-plugin comparison,
preemptive-generation warning) + full reference entries
- Changesets: 3 × `@mastra/livekit` minor (configuration, stt/tts
resolvers, plugin)

## Also included (consolidated from #19137)

- `examples/voice-agent`: permissive default worker + regulated demo
(consent-gated summarization) + customer-owned-session plugin worker
- `@mastra/memory` summarization — PR 1 (#19135); the README's
`memory.summarizeThread()` mentions depend on it, hence the stack order

## Verification

- `pnpm vitest run` in `integrations/livekit` — 186/186 passing across
15 files (was 184; +2 regression tests for the 1.5.0 ToolContext fix)
- `tsc --noEmit`, `pnpm build:lib`, `pnpm lint` — clean
- Verified live over LiveKit + Studio voice mode on the original branch:
disclosure playout, consent capture, agent-initiated hang-up, and the
plugin end-to-end against a remote Mastra server (barge-in
reconciliation, spoken tool feedback, `onTurnComplete` usage)

## Type of change

- [x] New feature (non-breaking change that adds functionality)
- [x] Documentation update

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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR upgrades the LiveKit voice agent so you can control—per call—how
it introduces itself, when/what consent it asks for, and how it ends
(including letting the agent hang up). It also adds a new
`@mastra/livekit/plugin` entry so customers can plug Mastra
(`MastraLLM`) into their own LiveKit `AgentSession`, plus tools to
record consent and trigger a safe end-call flow.

## Summary
- Updated `createLiveKitWorker` with a grouped per-call `configuration`
option for:
  - greeting / AI disclosure behavior,
  - consent via a named `consentPolicy` model,
  - optional agent-initiated hang-up via `endCall`,
- per-call `stt`/`tts` resolvers (run once per call) with fallback to
legacy top-level `stt`/`tts`.
- Kept legacy top-level `greeting` and `persistGreeting` as deprecated
aliases, with `configuration.greeting.*` taking precedence.
- Added new server-safe root exports:
- `createConsentTool` to record runtime consent decisions (including
caller identity fields) using schema validation and an `onGrant`
persistence callback.
- `createEndCallTool` to let the agent end the call after an optional
goodbye/closing workflow, while ensuring shutdown flow continues even if
bookkeeping fails (warns instead of breaking execution).
- Introduced `@mastra/livekit/plugin` with `MastraLLM`, a LiveKit
LLM-component for customer-owned `AgentSession`s, supporting exactly one
reply source: `remote`, `agent`, or `generate`.
- Includes remote HTTP/SSE reply generation, interrupted-turn
“self-healing” memory reconciliation, tool activity hooks
(`toolFeedback`, `onToolCall`, `onTurnComplete`), and token usage
surfaced via `result.usage`.
- Improved worker robustness and observability:
  - AI re-disclosure reminders,
  - mid-stream `onToolCall` notifications,
- stable message `id` propagation and filtering of LiveKit-injected
instruction messages,
  - wired `configuration.endCall` into the workflow reply path,
  - tightened watchdog + hook error handling, plus regression tests.
- Consolidated and refreshed `examples/voice-agent` (including new
regulated and plugin worker scripts) and updated LiveKit docs/reference
to reflect the new grouped configuration, `consentPolicy` rename, and
`@mastra/livekit/plugin` entrypoint.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 21:01:16 -07:00
Marvin Frachet
e6a087d975
refactor(mastracode): remove web memo hooks (#19107)
Replaces useCallback and useMemo usage in the Mastra Code web UI with
plain functions and per-render computations.

The agent controller client hook is now a service helper, and
effect-driven chat/session synchronization uses effect events so
callback identity is no longer required.

Verified with:
- pnpm --filter ./mastracode check
- pnpm --filter ./mastracode lint
- pnpm --filter ./mastracode exec vitest run --reporter=dot
- pnpm --filter ./mastracode web:ui:build

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR makes the Mastra Code web UI simpler by removing “remember this
across renders” React memo/callback patterns and instead using
straightforward per-render calculations. It also reorganizes
chat/session logic into smaller hooks/services so updates are driven
directly by current state, keeping streaming/SSE subscriptions stable
without relying on callback identity.

## Summary
- Removed most `useMemo`/`useCallback` usage across the web UI,
replacing them with plain inline calculations/functions.
- Replaced the old “agent controller session” hook usage with a service
+ smaller, purpose-built agent-controller hooks:
  - session init/sync/connection status
  - SSE event subscription + transcript hydration
  - thread message fetching/hydration
  - modes/models/settings/permissions fetching
- thread/goal/run mutations (send/steer/follow-up/abort/approve/respond)
- Refactored core chat UI components (`Composer`, `ComposerPanel`,
`ChatOverlays`, `ChatMessageList`, `ThreadPage`, `ThreadList`,
transcript components) to drive behavior via agent-controller
query/mutation hooks rather than `useChatSession()` methods.
- Updated chat/session synchronization to use effect-safe mechanisms
(`useEffectEvent`) so callback identity is no longer required.
- Moved thread switch logic to query + mutation flow with “latest
request” guarding; failures now route to `/new` with `routeErrorNotice`.
- Adjusted routing/tests to center on `/new` (draft) rather than
`/chat`, and updated MSW-driven tests accordingly.
- Updated agent-controller cache keying to include `projectPath` for
connection-state keys (to avoid unintended transcript-related refetch
side effects).
- Added infrastructure/support changes: agent-controller client helper
caching + enable/disable behavior, removed old query module, updated
markdown/toast/overlays utilities, and improved workspace project
`resourceId` resolution.

## Testing
- `pnpm --filter ./mastracode check`
- `pnpm --filter ./mastracode lint`
- `pnpm --filter ./mastracode exec vitest run --reporter=dot`
- `pnpm --filter ./mastracode web:ui:build`
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-07-08 14:11:18 +02:00
Shane Thomas
5e7f09c4b3
feat(livekit): add @mastra/livekit voice integration with Studio voice mode (#17896)
LiveKit runs the audio loop (WebRTC, streaming STT, semantic turn
detection, barge-in, TTS); the Mastra agent generates every reply with
its own model, tools, and memory via an llmNode bridge. Includes a
Studio voice mode (phone button, live captions, per-call memory
threads), a call-center example app, docs, and changesets.

**@mikhael28 -** Building on Shane's foundation, the integration picked
up several capabilities during development to bring it closer to
production-ready:

- **Workflow-driven replies.** Beyond the agent path, a turn's reply can
now be generated by a Mastra workflow that runs once to completion per
detected turn (`createWorkflowReplyGenerator`), with a
`pipeAgentReplyToWriter` helper that streams the agent's text *and*
forwards its tool calls into a workflow step. The workflow path is at
full feature parity with the agent path.
- **Per-turn and end-of-call lifecycle hooks.** `onTurnComplete` runs
after each reply finishes streaming (off the audio path,
fire-and-forget) and `onCallEnd` runs once when the call ends (awaited
within LiveKit's shutdown grace window). Together they give a clean seam
for memory maintenance, CRM writes, analytics, and flushing
observational memory once per call — none of it adding to the caller's
latency.
- **Voice-call observability.** Each session opens a root "voice call"
trace: LiveKit's STT/TTS/turn-detection/VAD metrics attach as child
spans, per-turn agent runs nest underneath, and the call closes with a
token/audio usage roll-up.
- **Working + observational memory showcase.** The example app
demonstrates layering per-caller working memory and observational memory
into a live voice agent, with a deterministic end-of-call reconciliation
pass.
- **Production hardening from review.** Config-validation guards
(mutually-exclusive reply sources, dispatch credential checks),
structured logging through the Mastra logger, backpressure and
cancellation safety on barge-in, and two full rounds of CodeRabbit
feedback addressed.

## 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 adds a “talk by phone” voice mode to Mastra Studio. When you
click the phone button, LiveKit handles the audio + live captions, and
Mastra decides what to say back—without waiting for the caller to finish
(you can interrupt/“barge in” mid-sentence).

## Overview
Introduces a new `@mastra/livekit` integration that turns Mastra agents
into realtime, interruptible voice agents by wiring LiveKit’s audio loop
(WebRTC, STT, VAD/turn detection, barge-in, TTS) to Mastra’s normal
reply generation. Studio/Playground adds a voice call UI with a phone
button, live captions, agent state indicators, and per-call “voice
thread” continuity alongside text chat.

## Core integration: `@mastra/livekit`
- **LiveKit ↔ Mastra bridge (`bridge.ts`)**: `MastraVoiceAgent` /
`createMastraVoiceAgent` streams Mastra outputs into LiveKit voice
responses, supports tool-call “spoken feedback”, and implements barge-in
by canceling/aborting the active Mastra generation.
- **Worker support (`worker.ts`, `worker-setup.ts`, `run.ts`)**:
`createLiveKitWorker` + `runLiveKitWorker` configure STT/TTS/VAD/turn
detection, end-of-utterance (turn) handling, optional greetings, and
per-call lifecycle hooks. When memory is enabled, the worker ensures a
dedicated voice thread and can persist spoken greetings.
- **Reply generation options (agent or workflow)**: per-turn replies can
be produced via a Mastra **agent stream** or a **workflow**
(run-to-completion per detected turn), with a shared generation seam for
streaming text + tool calls.
- **Server routing + dispatch**
- `liveKitConnectionRoute()` mints LiveKit connection-details tokens and
embeds typed session metadata (e.g., `agentId`, `threadId`,
`resourceId`).
- `dispatchVoiceSession()` programmatically creates LiveKit dispatches
(server-side), reading `LIVEKIT_*` env vars when not provided.
- **Session/message helpers**
- `metadata.ts` provides typed parse/serialize helpers for session
metadata.
- `messages.ts` converts LiveKit chat context into Mastra “turn”
messages and can extract only “new turns” to avoid duplicating persisted
history.
- `voice-thread.ts` creates/ensures the per-call “Voice call” memory
thread and persists the spoken greeting (skipping empty greetings).
- **Observability (`observability.ts`)**: optional voice-call tracing
with a root “voice call” span, nested turn metrics, and per-model usage
rollups.

## Studio/Playground voice mode (UI)
- Adds a voice domain with `useVoiceCall()` to fetch connection details,
connect to a LiveKit room, enable the microphone, and stream/aggregate
captions into UI state (with stale-async protection via epochs/abort).
- Adds:
  - `VoiceCallButton` (idle/connecting/active + start/stop)
  - `VoiceCallPanel` (agent state + latest user/agent caption)
- Wires the phone button into the chat composer so starting a call
refreshes the correct thread/messages and keeps voice + text in the same
memory continuity.

## Example app: Meridian Trades call center
Adds `examples/voice-agent`, a working call-center voice demo using
`@mastra/livekit`, including:
- A caller-facing `callCenterAgent` plus a fast `triageAgent` intent
classifier.
- Call-center CRM-style tools (customer lookup, availability,
booking/rescheduling/cancellation) and intake reconciliation.
- Two interchangeable voice worker entrypoints (agent-driven vs
workflow-driven) with feature parity.
- Seeded in-memory scheduling data, deterministic end-of-call
reconciliation, per-caller memory layers, and a single-file SQLite trace
output.

## Tests, docs, and release notes
- Adds unit tests for the LiveKit↔Mastra bridge (streaming, tool
feedback, barge-in/abort behavior), message extraction, session metadata
parsing/round-trips, route token minting, worker/session setup, workflow
reply generation, observability, and the Playground voice call
lifecycle.
- Adds LiveKit documentation (guide + API reference) and sidebar
entries.
- Adds Changesets for the new `@mastra/livekit` package and for Studio
voice mode changes (including new per-turn/per-call lifecycle hook
coverage).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: mikhael28 <mikhael@hey.com>
2026-07-06 07:56:07 -07:00