mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
20 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ce5d4731ee |
chore(deps): update dependencies across the monorepo (#28417)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
164e197aa5 |
fix: bump vulnerable dependencies to patched releases (#24027)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> |
||
|
|
3a507cbd42 |
chore: migrate repository formatting to oxfmt (#19807)
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai> |
||
|
|
b44fed7da6 |
chore(deps): update e2e tests (major) (#17968)
> ℹ️ **Note** > > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [@hono/node-server](https://redirect.github.com/honojs/node-server) | dependencies | major | [`^1.19.14` → `^2.0.8`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.19.14/2.0.8) | `2.0.9` | | [date-fns](https://redirect.github.com/date-fns/date-fns) | dependencies | major | [`2.30.0` → `4.4.0`](https://renovatebot.com/diffs/npm/date-fns/2.30.0/4.4.0) | | | [form-data](https://redirect.github.com/form-data/form-data) | dependencies | major | [`^2.5.6` → `^4.0.6`](https://renovatebot.com/diffs/npm/form-data/2.5.6/4.0.6) | | | [round-to](https://redirect.github.com/sindresorhus/round-to) | dependencies | major | [`^6.0.0` → `^7.0.0`](https://renovatebot.com/diffs/npm/round-to/6.0.0/7.0.0) | | | [verdaccio-auth-memory](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio/tree/HEAD/packages/plugins/auth-memory)) | devDependencies | major | [`^10.3.3` → `^13.0.3`](https://renovatebot.com/diffs/npm/verdaccio-auth-memory/10.3.3/13.0.3) | | | [verdaccio-auth-memory](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio/tree/HEAD/packages/plugins/auth-memory)) | dependencies | major | [`^10.3.3` → `^13.0.3`](https://renovatebot.com/diffs/npm/verdaccio-auth-memory/10.3.3/13.0.3) | | --- ### Release Notes <details> <summary>honojs/node-server (@​hono/node-server)</summary> ### [`v2.0.8`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.8) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.6...v2.0.8) #### What's Changed - ci(release): add `--no-git-checks` option for `pnpm stage publish` by [@​yusukebe](https://redirect.github.com/yusukebe) in [#​369](https://redirect.github.com/honojs/node-server/pull/369) **Full Changelog**: <https://github.com/honojs/node-server/compare/v2.0.7...v2.0.8> ### [`v2.0.6`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.6) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.5...v2.0.6) #### What's Changed - ci: publish to npm from CI with OIDC trusted publishing and bump `np` by [@​yusukebe](https://redirect.github.com/yusukebe) in [#​361](https://redirect.github.com/honojs/node-server/pull/361) - ci: use npm Staged publishing by [@​yusukebe](https://redirect.github.com/yusukebe) in [#​364](https://redirect.github.com/honojs/node-server/pull/364) - fix: preserve status and statusText when cloning a Response with liveheaders by [@​usualoma](https://redirect.github.com/usualoma) in [#​363](https://redirect.github.com/honojs/node-server/pull/363) **Full Changelog**: <https://github.com/honojs/node-server/compare/v2.0.5...v2.0.6> ### [`v2.0.5`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.5) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.4...v2.0.5) #### Security Fix Fixed a security issue in Serve Static Middleware where prefix-mounted middleware could be bypassed on Windows. This only affects applications running on Windows that use Serve Static Middleware. Affected users are encouraged to upgrade to this version. See GHSA-frvp-7c67-39w9 for details. ### [`v2.0.4`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.4) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.3...v2.0.4) #### What's Changed - fix: stub ws types to prevent them leaking in public types by [@​BlankParticle](https://redirect.github.com/BlankParticle) in [#​359](https://redirect.github.com/honojs/node-server/pull/359) **Full Changelog**: <https://github.com/honojs/node-server/compare/v2.0.3...v2.0.4> ### [`v2.0.3`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.3) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.2...v2.0.3) #### What's Changed - chore(ci): update GitHub Actions versions by [@​BlankParticle](https://redirect.github.com/BlankParticle) in [#​352](https://redirect.github.com/honojs/node-server/pull/352) - docs: Align the `ServeStaticOptions` comment with the current spec by [@​kakkokari-gtyih](https://redirect.github.com/kakkokari-gtyih) in [#​356](https://redirect.github.com/honojs/node-server/pull/356) - fix: preserve headers mutated after raw Response construction by [@​abdulmunimjemal](https://redirect.github.com/abdulmunimjemal) in [#​357](https://redirect.github.com/honojs/node-server/pull/357) #### New Contributors - [@​kakkokari-gtyih](https://redirect.github.com/kakkokari-gtyih) made their first contribution in [#​356](https://redirect.github.com/honojs/node-server/pull/356) - [@​abdulmunimjemal](https://redirect.github.com/abdulmunimjemal) made their first contribution in [#​357](https://redirect.github.com/honojs/node-server/pull/357) **Full Changelog**: <https://github.com/honojs/node-server/compare/v2.0.2...v2.0.3> ### [`v2.0.2`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.2) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.1...v2.0.2) #### What's Changed - fix(serve-static): stop using file birthtime for Date header by [@​usualoma](https://redirect.github.com/usualoma) in [#​350](https://redirect.github.com/honojs/node-server/pull/350) - fix: handle serveStatic stream fallback backpressure by [@​usualoma](https://redirect.github.com/usualoma) in [#​351](https://redirect.github.com/honojs/node-server/pull/351) **Full Changelog**: <https://github.com/honojs/node-server/compare/v2.0.1...v2.0.2> ### [`v2.0.1`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.1) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v2.0.0...v2.0.1) #### What's Changed - fix: forward Hono response headers during WebSocket upgrade by [@​gentamura](https://redirect.github.com/gentamura) in [#​346](https://redirect.github.com/honojs/node-server/pull/346) #### New Contributors - [@​gentamura](https://redirect.github.com/gentamura) made their first contribution in [#​346](https://redirect.github.com/honojs/node-server/pull/346) **Full Changelog**: <https://github.com/honojs/node-server/compare/v2.0.0...v2.0.1> ### [`v2.0.0`](https://redirect.github.com/honojs/node-server/releases/tag/v2.0.0) [Compare Source](https://redirect.github.com/honojs/node-server/compare/v1.19.14...v2.0.0) Now, we release the second major version of the Hono Node.js adapter 🎉 🎉 🎉 #### The Hono Node.js adapter is now up to 2.3x faster v2 of the [Hono Node.js adapter](https://redirect.github.com/honojs/node-server) reaches **up to 2.3x the throughput of v1** — that's the peak number, measured on the body-parsing scenario of [`bun-http-framework-benchmark`](https://redirect.github.com/SaltyAom/bun-http-framework-benchmark). The other scenarios (Ping, Query) get a smaller but real boost too. Install or upgrade with: ```bash npm i @​hono/node-server@latest ``` #### v2 The Node.js adapter is going through a major version bump to v2. That said, the public API stays the same — the headline of this release is the large performance improvement described above. #### What does the Node.js adapter do? A quick refresher on what the Node.js adapter actually does — it exists so that Hono applications can run on Node.js. Hono is built on the Web Standards APIs, but you cannot serve those directly from Node.js. The adapter bridges the Web Standards APIs and the Node.js APIs, which is what lets a Hono app — and more generally a Web-Standards-style app — run on top of Node.js. If you write the following code and run `node ./index.js`, a server starts up on `localhost:3000`. And it really is plain Node.js underneath. ```ts import { Hono } from 'hono' import { serve } from '@​hono/node-server' const app = new Hono() app.get('/', (c) => c.text('Hello World!')) serve(app) ``` #### The early performance story The very first implementation of the Node.js adapter looked roughly like this in pseudocode: ```ts export const getRequestListener = (fetchCallback: FetchCallback) => { return async (incoming: IncomingMessage, outgoing: ServerResponse) => { const method = incoming.method || 'GET' const url = `http://${incoming.headers.host}${incoming.url}` // ... const init = { method: method, headers: headerRecord, } // app is a Hono application const res = await app.fetch(new Request(url, init)) const buffer = await res.arrayBuffer() outgoing.writeHead(res.status, resHeaderRecord) outgoing.end(new Uint8Array(buffer)) } } ``` So the flow was: - a request comes in as an `IncomingMessage` - it gets converted into a `Request` object and handed to the app - the `Response` returned by the app is written back to the outgoing `ServerResponse` In diagram form: ``` IncomingMessage => Request => app => Response => ServerResponse ``` This is, frankly, inefficient. So whenever Hono went head-to-head with other Node.js frameworks we kept losing — all we could do was shrug and say "well, it's slow on Node.js." #### Introducing LightweightRequest / LightweightResponse The huge step forward that fixed this was a legendary PR from [@​usualoma](https://redirect.github.com/usualoma): [#​95](https://redirect.github.com/honojs/node-server/pull/95) It made things up to **2.7x faster**.  I previously wrote about this in detail in this post: <https://zenn.dev/yusukebe/articles/7ac501716ae1f7?locale=en> In short, the trick is wonderfully simple. It just follows the golden rule of performance tuning: *don't do work you don't have to do*. Lightweight versions of `Request` and `Response` are constructed and used first — and that path is fast. Only when something actually needs the contents of the `Request`, e.g. when you call `req.json()`, does a real `new Request()` get instantiated under the hood and used from then on. The result is fast, and behavior stays correct. #### …but body parsing was still slow "Fast" here was for a very simple "Hello World" benchmark — a GET that just returns text. There are many ways to benchmark, but the one we tend to reach for is this: <https://github.com/SaltyAom/bun-http-framework-benchmark> It tests three scenarios: **Ping**, **Query**, and **Body**. Let's pit Hono against the major Node.js frameworks:  As you can see, the **Body** case is very slow. The handler being measured is essentially this: ```ts import { Hono } from 'hono' import { serve } from '@​hono/node-server' const app = new Hono() app.post('/json', async (c) => { const data = await c.req.json() return c.json(data) }) serve(app) ``` `c.req.json()` is the slow part. The reason is well understood: inside the Node.js adapter, when `json()` is called the LightweightRequest path can't be used, so a real `new Request()` ends up being constructed. #### perf: optimize request body reading The 2.3x figure above comes from one PR specifically — [PR #​301](https://redirect.github.com/honojs/node-server/pull/301) by [@​mgcrea](https://redirect.github.com/mgcrea): The PR bundles a few changes, but the key one is *"optimize request body reading"*. Quoting from the PR description: > The fix overrides `text()`, `json()`, `arrayBuffer()`, and `blob()` on the request prototype to read directly from the Node.js `IncomingMessage` using event-based I/O. In other words, in the `json()` case above, we no longer convert into a `Request` at all — we read the body straight off the Node.js APIs. A classic fast path. That alone gives a large jump in body-parsing throughput. The same PR also includes two other tuning improvements: - **URL construction fast-path** — skip building a `URL` object except in edge cases - **`buildOutgoingHttpHeaders` optimization** — skip the `set-cookie` header comparison when there are no cookies v2 ships several other performance PRs as well — `newHeadersFromIncoming` and signal fast-paths, `Response` fast-paths and `responseViaCache` improvements, method-key caching, a regex-based `buildUrl` rewrite, and more (see the full list below). They all add up, but [#​301](https://redirect.github.com/honojs/node-server/issues/301) is by far the largest single contributor, which is why it gets the spotlight here. #### v2 performance Now let's measure the final v2 build. First, comparing against the v1 Node.js adapter. `dev` here is v2. **Body** improves by 2.3x, and the other scenarios get faster too:  Next, the same comparison against other frameworks. With the **Body** score jumping, Hono passes Koa and Fastify and **takes first place**:  > \[!CAUTION] > **Updated**: The h3 entry in the earlier framework comparison was an older snapshot. Its successor [`srvx`](https://redirect.github.com/h3js/srvx) now ships a `FastResponse` mode, and in srvx's own benchmark ([h3js/srvx/test/bench-node](https://redirect.github.com/h3js/srvx/tree/main/test/bench-node)) `srvx-fast` (≈68,560 req/sec) beats `hono-fast` (≈59,477 req/sec). The methodology is different from the benchmarks above, but worth being upfront: with `FastResponse` enabled, `srvx` is faster than Hono v2 in that setup. #### Breaking changes There are two breaking changes in v2. ##### Dropped support for Node.js v18 Node.js v18 reached end-of-life, so v2 requires **Node.js v20 or later**. ##### Removed the Vercel adapter The Vercel adapter (`@hono/node-server/vercel`) has been removed. It is no longer needed for Vercel's modern runtimes, so the recommendation is to deploy without it. If you still need the previous behavior, the old adapter was a one-liner on top of `getRequestListener` and you can write the same thing in your own project: ```ts import type { Hono } from 'hono' import { getRequestListener } from '@​hono/node-server' export const handle = (app: Hono) => { return getRequestListener(app.fetch) } ``` Then use it the same way you used `handle` from `@hono/node-server/vercel` before. #### All changes A full list of what landed in [PR #​316](https://redirect.github.com/honojs/node-server/pull/316). ##### Performance - perf: optimize request body reading and URL construction ([#​301](https://redirect.github.com/honojs/node-server/pull/301)) by [@​mgcrea](https://redirect.github.com/mgcrea) - perf: optimize `buildOutgoingHttpHeaders` for the common case ([#​301](https://redirect.github.com/honojs/node-server/pull/301)) by [@​mgcrea](https://redirect.github.com/mgcrea) - perf(request): cache method key ([#​319](https://redirect.github.com/honojs/node-server/pull/319)) by [@​yusukebe](https://redirect.github.com/yusukebe) - perf(url): mark host with port `:` as safe host ([#​320](https://redirect.github.com/honojs/node-server/pull/320)) by [@​yusukebe](https://redirect.github.com/yusukebe) - perf(request): optimize `newHeadersFromIncoming` and signal fast-path ([#​332](https://redirect.github.com/honojs/node-server/pull/332)) by [@​GavinMeierSonos](https://redirect.github.com/GavinMeierSonos) - perf(response, listener): `Response` fast-paths and `responseViaCache` improvements ([#​333](https://redirect.github.com/honojs/node-server/pull/333)) by [@​GavinMeierSonos](https://redirect.github.com/GavinMeierSonos) - perf: replace `Uint8Array` lookup tables with regex in `buildUrl` ([#​345](https://redirect.github.com/honojs/node-server/pull/345)) by [@​usualoma](https://redirect.github.com/usualoma) ##### Features - feat: first-class support for WebSockets ([#​328](https://redirect.github.com/honojs/node-server/pull/328)) by [@​BlankParticle](https://redirect.github.com/BlankParticle) ##### Breaking changes - feat: end support for Node.js v18 ([#​317](https://redirect.github.com/honojs/node-server/pull/317)) by [@​yusukebe](https://redirect.github.com/yusukebe) - feat!: obsolete the Vercel adapter ([#​335](https://redirect.github.com/honojs/node-server/pull/335)) by [@​yusukebe](https://redirect.github.com/yusukebe) ##### Fixes & refactors - fix: more strictly determine when `new URL()` should be used ([#​310](https://redirect.github.com/honojs/node-server/pull/310)) by [@​usualoma](https://redirect.github.com/usualoma) - refactor: improved compatibility with the Web Standard `Request` object ([#​311](https://redirect.github.com/honojs/node-server/pull/311)) by [@​usualoma](https://redirect.github.com/usualoma) - fix(request): return an error object instead of throwing ([#​318](https://redirect.github.com/honojs/node-server/pull/318)) by [@​usualoma](https://redirect.github.com/usualoma) - refactor: improve handling of null body in response ([#​341](https://redirect.github.com/honojs/node-server/pull/341)) by [@​usualoma](https://redirect.github.com/usualoma) - fix: ensure close handler is attached for `Blob`/`ReadableStream` cacheable responses ([#​342](https://redirect.github.com/honojs/node-server/pull/342)) by [@​usualoma](https://redirect.github.com/usualoma) - fix: improve `Response.json()` and `Response.redirect()` spec compliance and efficiency ([#​343](https://redirect.github.com/honojs/node-server/pull/343)) by [@​usualoma](https://redirect.github.com/usualoma) ##### Build & tooling - build: migrate from tsup to tsdown ([#​302](https://redirect.github.com/honojs/node-server/pull/302)) by [@​tommy-ish](https://redirect.github.com/tommy-ish) - feat(test): migrate Jest to Vitest ([#​303](https://redirect.github.com/honojs/node-server/pull/303)) by [@​koralle](https://redirect.github.com/koralle) - fix: only build exported entrypoints ([#​323](https://redirect.github.com/honojs/node-server/pull/323)) by [@​BlankParticle](https://redirect.github.com/BlankParticle) - chore: add `type: module` to `package.json` ([#​336](https://redirect.github.com/honojs/node-server/pull/336)) by [@​yusukebe](https://redirect.github.com/yusukebe) #### Wrap-up So that's v2 of the Node.js adapter — significantly faster, with the same API. Just upgrading should give you a real performance boost. No more "Hono is slow on Node.js" excuses. Please use Hono — fast not only on Cloudflare, Bun, and Deno, but now also on Node.js. </details> <details> <summary>date-fns/date-fns (date-fns)</summary> ### [`v4.4.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v4.4.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v4.3.0...v4.4.0) This release revisits the approach to CDN usage and introduces a new package, `@date-fns/cdn` and deprecates the `date-fns` CDN scripts. It allowed reducing the zipped package size from `5.83 MB` down to `3.96 MB` without introducing any breaking changes. In `v5.0.0-alpha.0` where CDN scripts are completely removed from `date-fns` the change is more significant and brings the zipped package size down to `2.89 MB`. It is just the first step in optimizing the package size. Expect further size reduction in the future v4 and v5 versions. ##### Changed - **DEPRECATED**: The `date-fns` CDN scripts are now deprecated and will be removed in the next major release. Please switch to the new `@date-fns/cdn` package for CDN usage. - Removed CDN source maps to reduce the package size. If you rely on them, please switch to the new `@date-fns/cdn` package that still includes them. ### [`v4.3.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v4.3.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v4.2.1...v4.3.0) Kudos to [@​ImRodry](https://redirect.github.com/ImRodry) and [@​puneetdixit200](https://redirect.github.com/puneetdixit200) for their contributions. ##### Fixed - Fixed missing modularized optimization fallback ([for Next.js and others](https://x.com/kossnocorp/status/1731181274579325260)). See [#​4193](https://x.com/kossnocorp/status/1731181274579325260). - Fixed `pt` locale first day of week to be Sunday. See [#​4195](https://redirect.github.com/date-fns/date-fns/pull/4195) by [@​ImRodry](https://redirect.github.com/ImRodry). - Fixed `zh-CN`, `zh-HK`, and `zh-TW` locale month parsing for October, November, and December. See [#​4194](https://redirect.github.com/date-fns/date-fns/pull/4194) by [@​puneetdixit200](https://redirect.github.com/puneetdixit200). ### [`v4.2.1`](https://redirect.github.com/date-fns/date-fns/releases/tag/v4.2.1) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v4.2.0...v4.2.1) ##### Fixed - Fixed type definitions missing in v4.2.0 due to TypeScript misconfiguration. ### [`v4.2.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v4.2.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v4.1.0...v4.2.0) This is a minor release in all senses, it only includes documentation updates (first of many) that points to the new [You Don't Need date-fns\*](https://date-fns.org/you-dont-need-date-fns) page. \* Not really ##### Changed - Added Temporal API references to the JSDoc annotations of `add`, `addBusinessDays`, and `addDays`. ### [`v4.1.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v4.1.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v4.0.0...v4.1.0) This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs. Make sure also upgrade `TZDate` to v1.0.2 as it [includes a bunch of critical bug fixes](https://redirect.github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14). ##### Fixed - Fixed internal `constructFrom` throwing an exception on `null` arguments. While `null` isn't allowed, the functions should rather return `Invalid Date` or `NaN` in such cases. See [#​3885](https://redirect.github.com/date-fns/date-fns/issues/3885). ##### Added - Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#​3886](https://redirect.github.com/date-fns/date-fns/issues/3886). ### [`v4.0.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v4.0.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v3.6.0...v4.0.0) I have great news! First, ten years after its release, date-fns finally gets first-class time zone support. Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward. [Read more about the release in the announcement blog post](https://blog.date-fns.org/v40-with-time-zone-support/). \- [Sasha @​kossnocorp](https://twitter.com/kossnocorp) ##### Added - Added time zones support via [`@date-fns/tz`](https://redirect.github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://redirect.github.com/date-fns/tz) for the details about the API. - All relevant functions now accept the context `in` option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone: ```ts import { addDays, startOfDay } from "date-fns"; import { tz } from "@​date-fns/tz"; startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") })); //=> "2024-09-16T00:00:00.000+08:00" ``` In the example, `addDays` will get the current date and time in Singapore and add 5 days to it. `startOfDay` will inherit the date type and return the start of the day in Singapore. ##### Changed - The function arguments, as well as `Interval`'s `start` and `end`, now can be of different types, allowing you to mix `UTCDate`, `TZDate`, `Date`, and other extensions, as well as primitives (strings and numbers). The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context `in` option or the first encountered argument object type. The `Interval`'s `start` and `end` will be considered separately, starting from `start`. In the given example, the result will be in the `TZDate` as the first argument is a number, and the `start` takes precedence over the `end`. ```ts clamp(Date.now(), { start: new TZDate(start, "Asia/Singapore"), end: new UTCDate(), }); //=> TZDate ``` - **BREAKING**: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you run the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://redirect.github.com/date-fns/date-fns/issues/new). - **BREAKING**: The package is now ESM-first. CommonJS is still supported, and it should not affect most users, but it might break in certain environments. If you encounter any issues, please [report them](https://redirect.github.com/date-fns/date-fns/issues/new). ##### Fixed - Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE. ### [`v3.6.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v3.6.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v3.5.0...v3.6.0) On this release worked [@​kossnocorp](https://redirect.github.com/kossnocorp) and [@​world1dan](https://redirect.github.com/world1dan). Also, thanks to [@​seated](https://redirect.github.com/seated) [for sponsoring me](https://redirect.github.com/sponsors/kossnocorp). ##### Fixed - [Fixed weeks in the Belarisuan locale's `formatDistance`.](https://redirect.github.com/date-fns/date-fns/pull/3720) ##### Added - [Added CDN versions of modules compatible with older browsers.](https://redirect.github.com/date-fns/date-fns/pull/3737) [See the CDN guide.](https://date-fns.org/docs/CDN) ### [`v3.5.0`](https://redirect.github.com/date-fns/date-fns/releases/tag/v3.5.0) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v3.4.0...v3.5.0) Kudos to [@​fturmel](https://redirect.github.com/fturmel), [@​kossnocorp](https://redirect.github.com/kossnocorp), [@​makstyle119](https://redirect.github.com/makstyle119), [@​tan75](https://redirect.github.com/tan75), [@​marcreichel](https://redirect.github.com/marcreichel), [@​tareknatsheh](https://redirect.github.com/tareknatsheh) and [@​audunru](https://redirect.github.com/audunru) for working on the release. Also, thanks to [@​seated](https://redirect.github.com/seated) [for sponsoring me](https://redirect.github.com/sponsors/kossnocorp). ##### Fixed - [Fixed functions that use current date internally and made them work with date extensions like `UTCDate`.](https://redirect.github.com/date-fns/date-fns/issues/3730) - [Fixed `daysToWeeks` returning negative 0.]( |
||
|
|
e05265308a |
test: fix msw resolution, stale LLM recordings, and keyless client-js E2E failures (#19424)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai> |
||
|
|
93a74f0e64 |
chore(deps): update e2e tests (#17150)
> ℹ️ **Note** > > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [@ai-sdk/openai](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai/tree/HEAD/packages/openai)) | dependencies | patch | [`^2.0.89` → `^2.0.110`](https://renovatebot.com/diffs/npm/@ai-sdk%2fopenai/2.0.89/2.0.110) | `2.0.111` | | [@ast-grep/napi](https://ast-grep.github.io) ([source](https://redirect.github.com/ast-grep/ast-grep)) | dependencies | minor | [`^0.40.0` → `^0.44.1`](https://renovatebot.com/diffs/npm/@ast-grep%2fnapi/0.40.0/0.44.1) | | | [@hono/node-server](https://redirect.github.com/honojs/node-server) | dependencies | patch | [`^1.19.11` → `^1.19.14`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.19.14/1.19.14) | | | [form-data](https://redirect.github.com/form-data/form-data) | dependencies | patch | [`^2.5.5` → `^2.5.6`](https://renovatebot.com/diffs/npm/form-data/2.5.6/2.5.6) | | | [form-data](https://redirect.github.com/form-data/form-data) | dependencies | patch | [`^2.5.4` → `^2.5.6`](https://renovatebot.com/diffs/npm/form-data/2.5.6/2.5.6) | | | [get-port](https://redirect.github.com/sindresorhus/get-port) | devDependencies | patch | [`^7.1.0` → `^7.2.0`](https://renovatebot.com/diffs/npm/get-port/7.2.0/7.2.0) | | | [get-port](https://redirect.github.com/sindresorhus/get-port) | devDependencies | minor | [`^7.1.0` → `^7.2.0`](https://renovatebot.com/diffs/npm/get-port/7.1.0/7.2.0) | | | [get-port](https://redirect.github.com/sindresorhus/get-port) | dependencies | minor | [`^7.1.0` → `^7.2.0`](https://renovatebot.com/diffs/npm/get-port/7.1.0/7.2.0) | | | [get-port](https://redirect.github.com/sindresorhus/get-port) | dependencies | patch | [`^7.1.0` → `^7.2.0`](https://renovatebot.com/diffs/npm/get-port/7.2.0/7.2.0) | | | [hono](https://hono.dev) ([source](https://redirect.github.com/honojs/hono)) | dependencies | patch | [`^4.12.25` → `^4.12.29`](https://renovatebot.com/diffs/npm/hono/4.12.25/4.12.29) | `4.12.30` | | [hono](https://hono.dev) ([source](https://redirect.github.com/honojs/hono)) | dependencies | patch | [`^4.12.8` → `^4.12.29`](https://renovatebot.com/diffs/npm/hono/4.12.25/4.12.29) | `4.12.30` | | [tinyglobby](https://superchupu.dev/tinyglobby) ([source](https://redirect.github.com/SuperchupuDev/tinyglobby)) | devDependencies | patch | [`^0.2.16` → `^0.2.17`](https://renovatebot.com/diffs/npm/tinyglobby/0.2.17/0.2.17) | | | [tinyglobby](https://superchupu.dev/tinyglobby) ([source](https://redirect.github.com/SuperchupuDev/tinyglobby)) | dependencies | patch | [`^0.2.16` → `^0.2.17`](https://renovatebot.com/diffs/npm/tinyglobby/0.2.17/0.2.17) | | | [tinyrainbow](https://redirect.github.com/tinylibs/tinyrainbow) | dependencies | minor | [`^3.0.3` → `^3.1.0`](https://renovatebot.com/diffs/npm/tinyrainbow/3.0.3/3.1.0) | | | [verdaccio](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio)) | devDependencies | patch | [`^6.2.5` → `^6.7.4`](https://renovatebot.com/diffs/npm/verdaccio/6.7.4/6.7.4) | `6.8.0` | | [verdaccio](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio)) | devDependencies | minor | [`^6.3.2` → `^6.7.4`](https://renovatebot.com/diffs/npm/verdaccio/6.6.0/6.7.4) | `6.8.0` | | [verdaccio](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio)) | dependencies | patch | [`^6.2.5` → `^6.7.4`](https://renovatebot.com/diffs/npm/verdaccio/6.7.4/6.7.4) | `6.8.0` | | [verdaccio-auth-memory](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio/tree/HEAD/packages/plugins/auth-memory)) | devDependencies | patch | [`^10.3.1` → `^10.3.3`](https://renovatebot.com/diffs/npm/verdaccio-auth-memory/10.3.3/10.3.3) | | | [verdaccio-auth-memory](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio/tree/HEAD/packages/plugins/auth-memory)) | devDependencies | patch | [`^10.3.1` → `^10.3.3`](https://renovatebot.com/diffs/npm/verdaccio-auth-memory/10.3.1/10.3.3) | | | [verdaccio-auth-memory](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio/tree/HEAD/packages/plugins/auth-memory)) | dependencies | patch | [`^10.3.1` → `^10.3.3`](https://renovatebot.com/diffs/npm/verdaccio-auth-memory/10.3.3/10.3.3) | | | [wrangler](https://redirect.github.com/cloudflare/workers-sdk) ([source](https://redirect.github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler)) | devDependencies | minor | [`^4.61.1` → `^4.110.0`](https://renovatebot.com/diffs/npm/wrangler/4.61.1/4.110.0) | | --- ### Release Notes <details> <summary>vercel/ai (@​ai-sdk/openai)</summary> ### [`v2.0.110`](https://redirect.github.com/vercel/ai/releases/tag/%40ai-sdk/openai%402.0.110) [Compare Source](https://redirect.github.com/vercel/ai/compare/@ai-sdk/openai@2.0.109...@ai-sdk/openai@2.0.110) ##### Patch Changes - Updated dependencies \[[`b85c4fb`]( |
||
|
|
493a328f43 |
feat(core): run agentic loop on the evented workflow engine (#16796)
## Summary - Migrates the agent's internal agentic loop onto the evented workflow engine. Each LLM call and tool call now runs as a workflow step, sharing suspend/resume and observability with the rest of the workflow system. No user-visible behavior change yet — this is the structural prerequisite for future durability and event-based observability features. - Fixes a nested-workflow bug where `resumeLabel` wasn't propagated up through a parent's suspendedPaths, so resuming a nested workflow by label silently failed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ELI5: This change moves the agent's internal loop to run as a series of steps in the evented workflow engine so each model call and tool call is tracked like a tiny workflow. That makes suspend/resume, observability, and future durability much easier and also fixes a bug that broke resuming nested workflows by label. - What it does - Migrates the agentic loop so each LLM and tool call executes as evented workflow steps (uses createEventedWorkflow / createEventedWorkflow factory). - Agents can run without a user-provided Mastra by creating a lazily-initialized ephemeral Mastra (InMemoryStore + EventEmitterPubSub) and starting ephemeral workers on first use. - Adds a per-run runScope (PrepareStreamRunScope) to thread non-JSON-safe runtime state (MessageList, processorStates, convertedTools, loopOptions) across prepare-stream workflow steps instead of passing those objects through step inputs/outputs. - Introduces runId-scoped internal workflow registration/unregistration to avoid collisions for concurrent/nested runs. - Bug fixes / behavioral corrections - Fixes nested-workflow resume-by-label: resumeLabel is propagated through parent suspendedPaths and nested suspend metadata so resuming a nested workflow by label works reliably. - Preserves and aggregates suspendPayloads (not just resumeLabels) across suspended foreach iterations and when storage persistence is skipped/absent. - Ensures persisted snapshots are retained for pending/paused/suspended states (not only suspended). - Tightens internal workflow lookup to prefer runId-scoped internal workflow instances, preventing wrong closure/registration resolution in nested/concurrent cases. - Implementation details / notable API surface changes - New helper: createEventedWorkflow(...) exported from workflows entrypoint (throws if evented factory not loaded). - Mastra changes: - Defaults to InMemoryStore when storage not provided (with warning) and augments the store. - Internal workflow registry supports runId-scoped keys; added __unregisterInternalWorkflow and updated __registerInternalWorkflow / __hasInternalWorkflow / __getInternalWorkflow signatures. - Evented processor and execution engine: - Nested workflow resolution now passes runId to getNestedWorkflow and resolveWorkflow. - Workflow event processor rebuilt resumeLabels and suspend payload propagation; adjusted foreach aggregation and merge behavior when storage updates are absent. - In-memory workflow storage replaced JSON-serialize deep-copy with a cycle-safe deep clone preserving Dates, Errors, Maps/Sets, prototypes, typed arrays, etc. - Tests / tooling - Added suspend/resume test to validate resuming a suspended nested workflow step by label and updated many tests to run against an evented Mastra (InMemoryStore + EventEmitterPubSub) with worker lifecycle management helpers (createTestMastra, start/stop workers). - Multiple test updates to use real InMemoryStore + evented pubsub instead of mocked storage or missing worker lifecycles. - Minor / UX - Updated background-task generated system prompt to clarify _background behavior and placeholder result guidance. - stream/loop runtime: distinguishes "pre-run" queued signals from normal "pending" signals and exposes drainPendingSignals(runId, scope?) with scope 'pending'|'pre-run'; stream lifecycle registers/unregisters run-scoped internal workflows to prevent leakage on suspend. - Risk / review notes - Structural and high-impact refactor touching core agent loop, workflow engine integration, storage cloning, and Mastra internals—review effort: high in multiple areas (agent, workflows, mastra, storage, evented processor). <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/16796?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Mastra Code (anthropic/claude-opus-4-6) <noreply@mastra.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> |
||
|
|
97b974e292 |
chore: add missing lint-staged configs (#17220)
This fills in missing package-local lint-staged configs so staged files
in those workspaces get formatted/fixed before CI catches import
ordering.
It also switches the Husky hook to Corepack so the hook can resolve the
repo's pnpm version consistently. On my machine, plain `pnpm` was
failing in the hook env and the fallback made the hook silently skip
lint-staged.
Before:
```sh
pnpm --version || exit 0
pnpm lint-staged --quiet
```
After:
```sh
corepack pnpm@10.29.3 --version || exit 0
corepack pnpm@10.29.3 lint-staged --quiet
```
I checked workspace coverage and verified package-local lint-staged runs
cleanly against the branch diff with:
```sh
corepack pnpm@10.29.3 exec lint-staged --diff HEAD --quiet
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR makes sure every package in the repo automatically formats and
fixes staged files before you commit, and it makes the pre-commit hook
run a specific, consistent pnpm version so those fixes actually run
reliably.
## Changes to Pre-Commit Hook
- Updated .husky/pre-commit to run pnpm via Corepack with an explicit
pin: corepack pnpm@10.29.3 --version || exit 0 and corepack pnpm@10.29.3
lint-staged --quiet (replacing plain pnpm). This ensures the hook
resolves the repository's pnpm version consistently and prevents
lint-staged from being skipped in environments where a global pnpm may
be absent or incompatible.
## Workspace Package lint-staged Configs
- Added package-local lint-staged configuration files
(lint-staged.config.js or .mjs) across ~40+ workspace packages and
subpackages.
- Two consistent patterns applied:
- TypeScript/TSX-focused packages: run eslint --fix --max-warnings=0
then prettier --write on *.{ts,tsx}, and run prettier --write on
*.{js,jsx} and *.{json,md,yml,yaml}.
- Prettier-only packages (test-utils and simpler packages): run prettier
--write for *.{ts,tsx,js,jsx,json,md,yml,yaml}.
- These package-local configs ensure staged files within each workspace
are formatted and lint-fixed (including TS import ordering via eslint
--fix) before commit, reducing CI failures and manual formatting fixes.
## Other Notes
- Author verified workspace coverage and confirmed package-local
lint-staged runs cleanly against the branch diff using: corepack
pnpm@10.29.3 exec lint-staged --diff HEAD --quiet.
- Commit message notes an adjustment to align with pnpm 11 in a
follow-up commit (chore: align lint-staged hook with pnpm 11).
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17220?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
|
||
|
|
50f5884b41 |
draft: Add MastraPlatformExporter and MastraStorageExporter, deprecate CloudExporter and DefaultExporter (#16223)
## Description
Renames two built-in observability exporters in `@mastra/observability`
to clearer names that better describe what they do. Both renames use a
**duplicate-and-deprecate** pattern: the original classes are preserved
unchanged (same exporter `name` strings, same error IDs, same runtime
behavior) and marked `@deprecated`; the new classes ship in their own
files with updated identifiers.
| Old | New |
| - | - |
| `CloudExporter` | `MastraPlatformExporter` |
| `DefaultExporter` | `MastraStorageExporter` |
This means existing imports keep working without modification, and any
monitoring rules or dashboards matching the old `CLOUD_EXPORTER_*` error
IDs / `mastra-cloud-observability-exporter` name /
`mastra-default-observability-exporter` name keep firing until users
migrate.
### What changed
- **New classes**:
- `MastraPlatformExporter` in
`observability/mastra/src/exporters/mastra-platform.ts` (uses
`MASTRA_PLATFORM_EXPORTER_*` error IDs and `mastra-platform-exporter`
name).
- `MastraStorageExporter` in
`observability/mastra/src/exporters/mastra-storage.ts` (uses
`mastra-storage-exporter` name).
- Each has its own test file (`mastra-platform.test.ts`,
`mastra-storage.test.ts`).
- **Deprecated classes** in `cloud.ts` and `default.ts` — implementation
byte-identical to the previous release, but now carry `@deprecated`
JSDoc pointing at the new classes. The deprecated reference doc pages
stay at their original URLs
(`/reference/observability/tracing/exporters/cloud-exporter` and
`/.../default-exporter`) so existing bookmarks keep working.
- **Public exports**: all four classes (and their config interfaces) are
exported from `@mastra/observability`.
- **Internal callers** updated to use the new classes: the deprecated
`default` observability config in `default.ts`, the `mastracode` runtime
bootstrap, the `mastra` CLI `init` template, and `@mastra/core` JSDoc
and bootstrap warning messages.
- **Templates and examples**: all 11 templates, the `agent-v6` and
`agent` examples, the `e2e-tests/no-bundling` and `e2e-tests/client-js`
fixtures, and the `examples/inngest` README now use the new classes.
- **Docs**: every overview page, exporter page, processor page,
migration guide, storage reference page, and tracing reference page now
recommends the new classes. Two doc pages were renamed (`cloud.mdx` →
`mastra-platform.mdx`, `default.mdx` → `mastra-storage.mdx`) with
permanent redirects from the old URLs in `docs/vercel.json`. Sidebars
now list both deprecated reference pages alongside the new ones; the
deprecated entries get a `(deprecated)` label and a
`sidebar-item-deprecated` className hook.
- **Codemod**: added `MastraPlatformExporter` and `MastraStorageExporter
→ @mastra/observability` mappings alongside the existing `CloudExporter`
/ `DefaultExporter` entries.
### Trade-off
Each pair of files (`cloud.ts` / `mastra-platform.ts`, `default.ts` /
`mastra-storage.ts`) is ~99% identical today. Bug fixes to the new
classes will not auto-apply to the deprecated ones — but since the
deprecated classes are now frozen for back-compat, that's the intended
outcome until they're removed in a future major.
### Migration
```ts
// Before
import { Observability, DefaultExporter, CloudExporter, SensitiveDataFilter } from '@mastra/observability'
new Observability({
configs: {
default: {
serviceName: 'my-app',
exporters: [new DefaultExporter(), new CloudExporter()],
spanOutputProcessors: [new SensitiveDataFilter()],
},
},
})
// After
import { Observability, MastraStorageExporter, MastraPlatformExporter, SensitiveDataFilter } from '@mastra/observability'
new Observability({
configs: {
default: {
serviceName: 'my-app',
exporters: [new MastraStorageExporter(), new MastraPlatformExporter()],
spanOutputProcessors: [new SensitiveDataFilter()],
},
},
})
```
Constructor signatures, environment variables
(`MASTRA_CLOUD_ACCESS_TOKEN`, `MASTRA_PROJECT_ID`,
`MASTRA_CLOUD_TRACES_ENDPOINT`), and runtime behavior are all unchanged.
Update monitoring rules that match on `CLOUD_EXPORTER_*` IDs,
`mastra-cloud-observability-exporter`, or
`mastra-default-observability-exporter` when you migrate — the new
classes use `MASTRA_PLATFORM_EXPORTER_*`, `mastra-platform-exporter`,
and `mastra-storage-exporter`.
## Type of Change
- [x] New feature (non-breaking change that adds functionality)
- [x] Documentation update
- [x] Code refactoring
## Checklist
- [x] Documentation updated (overview, reference, migration guides,
dedicated exporter pages)
- [x] Tests added for the new classes (`mastra-platform.test.ts`,
`mastra-storage.test.ts`); existing `cloud.test.ts` and
`default.test.ts` retained unchanged for the deprecated classes
- [x] Backward compatibility preserved: `CloudExporter` and
`DefaultExporter` keep their original error IDs, exporter `name`, and
runtime behavior
https://claude.ai/code/session_014DDGpY9LbumVTqdWX5aGmr
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
8f6b65181d |
fix(client-js): align Vector return types with server (#16036)
## Description
Aligns three Vector resource return types in `@mastra/client-js` with
what the server actually returns. The previous types described shapes
that did not exist on the wire, leading to silent runtime failures with
no TypeScript errors.
- Changed `vector.getIndexes()` from `Promise<{ indexes: string[] }>` to
`Promise<string[]>`
- Changed `vector.upsert()` from `Promise<string[]>` to `Promise<{ ids:
string[] }>`
- Changed `vector.query()` from `Promise<QueryVectorResponse>` to
`Promise<QueryResult[]>`
- Updated the public `QueryVectorResponse` type from `{ results:
QueryResult[] }` to a `QueryResult[]` alias so external imports still
resolve
- Fixed unit-test mocks in `vector.test.ts` to match real server
response shapes, closing the loophole that hid the bug at unit level
- Removed `: any` casts and `TODO(#15089)` workarounds in
`e2e-tests/client-js/_test-utils/src/vector-tests.ts`
- Server is unchanged — alignment was done on the SDK side to preserve
the public HTTP contract
## Related Issue(s)
Fixes #15089
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR fixes the client library so its TypeScript types match what the
server actually sends. Previously the SDK promised different shapes than
the server returned, causing runtime crashes; now the SDK types and
tests reflect the real responses.
## Changes
### Method Return Type Corrections
- getIndexes(): Promise<{ indexes: string[] }> → Promise<string[]>
- upsert(): Promise<string[]> → Promise<{ ids: string[] }>
- query(): Promise<QueryVectorResponse> → Promise<QueryResult[]>
### Type Definition Updates
- client-sdks/client-js/src/types.ts: `QueryVectorResponse` changed from
`interface { results: QueryResult[] }` to `export type
QueryVectorResponse = QueryResult[]` (keeps external imports resolvable
while matching server shape).
### Tests and E2E Test Utilities
- client-sdks/client-js/src/resources/vector.test.ts: mocked fetch
payloads and assertions updated to the real server response shapes for
getIndexes, upsert, and query.
- e2e-tests/client-js/_test-utils/src/vector-tests.ts: removed `: any`
casts and TODO(#15089) workarounds so inferred types reflect corrected
SDK types.
### Release Notes / Changeset
- .changeset/vector-sdk-return-types.md added documenting the breaking
changes with before/after examples and referencing issue #15089.
## Breaking Changes
- This is a breaking change for @mastra/client-js: consumers must update
call sites that expected the old wrapped/ unwrapped shapes (e.g., stop
using `result.indexes` and use the array directly, handle `{ ids:
string[] }` for upsert, treat query responses as an array).
## Server Compatibility
- No server changes: the SDK is updated to match the existing server
HTTP responses (non-breaking to the server/API).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
||
|
|
ec3253e9bb |
feat(e2e): add client-js e2e tests for agents, memory, workflows, tools, and vectors (#13081)
## Description Adds end-to-end tests for `@mastra/client-js` that validate the full stack: **MastraClient → Hono Server → LibSQL Storage**. Following the existing `createObservabilityTests()` factory pattern, this PR adds test factories for the remaining coverage areas: - **`agent-tests.ts`** — list agents, get agent details, error handling for non-existent agents - **`memory-tests.ts`** — create/get/update/delete threads, save and list messages - **`workflow-tests.ts`** — list workflows, get details, create and execute runs - **`tool-tests.ts`** — list tools, get details, execute tools, invalid input handling - **`vector-tests.ts`** — create/delete indexes, upsert vectors, query by similarity All new tests use **no LLM calls** — they rely on simple compute-only operations (math, string concat) and in-memory LibSQL storage for fast, isolated execution. ### Changes - Extended `server-setup.ts` with Memory, Workflows, Tools, and Vector configurations - Added 5 new test factory files in `_test-utils/src/` - Added corresponding test files in both `zod-v3/` and `zod-v4/` variants - Updated `_test-utils/src/index.ts` to export new factories - Added `@mastra/memory` dependency to `_test-utils/package.json` ## Related Issue(s) Fixes #11342 ## 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 - [x] Test update ## Checklist - [ ] 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 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Expanded end-to-end coverage with reusable suites for agents, memory, tools, vectors, and workflows. * Registered Zod v3 and v4 test runs and added reusable test harnesses for each area. * **Chores** * Extended test infrastructure to support memory, vector, tool, and workflow scenarios and exports. * Cleaned up test bootstrapping/typing and added runtime test setup and teardown improvements. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: intojhanurag <aojharaj2004@gmail.com> |
||
|
|
8de355572c |
Adds new endpoints to server & client for metrics, logs, scores, and feedbacks. (#14270) | ||
|
|
bbcbbce4f0 |
chore: update dependencies and fix mcp build for @modelcontextprotocol/sdk@1.27.1 (#14260)
Co-authored-by: Mastra Code (anthropic/claude-opus-4-6) <noreply@mastra.ai> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> |
||
|
|
7f9081bc32 | chore: version - exit prerelease mode | ||
|
|
7e331464c9 |
chore(deps): update e2e tests (#11589)
This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [@ai-sdk/openai](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai)) | dependencies | patch | [`^2.0.44` -> `^2.0.89`](https://renovatebot.com/diffs/npm/@ai-sdk%2fopenai/2.0.44/2.0.89) | | | [@hono/node-server](https://redirect.github.com/honojs/node-server) | dependencies | patch | [`^1.14.3` -> `^1.19.9`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.19.6/1.19.9) | | | [ai](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai)) | dependencies | patch | [`^5.0.101` -> `^5.0.124`](https://renovatebot.com/diffs/npm/ai/5.0.101/5.0.124) | `5.0.126` (+1) | | [execa](https://redirect.github.com/sindresorhus/execa) | devDependencies | patch | [`^9.6.0` -> `^9.6.1`](https://renovatebot.com/diffs/npm/execa/9.6.1/9.6.1) | | | [globby](https://redirect.github.com/sindresorhus/globby) | devDependencies | patch | [`^16.0.0` -> `^16.1.0`](https://renovatebot.com/diffs/npm/globby/16.1.0/16.1.0) | | | [globby](https://redirect.github.com/sindresorhus/globby) | devDependencies | minor | [`^16.0.0` -> `^16.1.0`](https://renovatebot.com/diffs/npm/globby/16.0.0/16.1.0) | | | [hono](https://hono.dev) ([source](https://redirect.github.com/honojs/hono)) | dependencies | minor | [`^4.9.10` -> `^4.11.7`](https://renovatebot.com/diffs/npm/hono/4.9.10/4.11.7) | | | [hono](https://hono.dev) ([source](https://redirect.github.com/honojs/hono)) | dependencies | patch | [`^4.6.0` -> `^4.11.7`](https://renovatebot.com/diffs/npm/hono/4.11.4/4.11.7) | | | [lodash](https://lodash.com/) ([source](https://redirect.github.com/lodash/lodash)) | dependencies | patch | [`^4.17.21` -> `^4.17.23`](https://renovatebot.com/diffs/npm/lodash/4.17.21/4.17.23) | | | [openai-v4](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai)) | dependencies | minor | [`^1.0.0` -> `^1.3.24`](https://renovatebot.com/diffs/npm/openai-v4/1.0.0/1.3.24) | | | [openai-v5](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai)) | dependencies | patch | [`^2.0.0` -> `^2.0.89`](https://renovatebot.com/diffs/npm/openai-v5/2.0.0/2.0.89) | | | [unicorn-magic](https://redirect.github.com/sindresorhus/unicorn-magic) | dependencies | minor | [`0.3.0` -> `0.4.0`](https://renovatebot.com/diffs/npm/unicorn-magic/0.3.0/0.4.0) | | | [verdaccio](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio)) | devDependencies | patch | [`^6.2.0` -> `^6.2.5`](https://renovatebot.com/diffs/npm/verdaccio/6.2.4/6.2.5) | | | [verdaccio](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio)) | devDependencies | patch | [`^6.2.2` -> `^6.2.5`](https://renovatebot.com/diffs/npm/verdaccio/6.2.4/6.2.5) | | | [verdaccio](https://verdaccio.org) ([source](https://redirect.github.com/verdaccio/verdaccio)) | devDependencies | patch | [`^6.2.4` -> `^6.2.5`](https://renovatebot.com/diffs/npm/verdaccio/6.2.4/6.2.5) | | | [wrangler](https://redirect.github.com/cloudflare/workers-sdk) ([source](https://redirect.github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler)) | devDependencies | minor | [`^4.42.1` -> `^4.61.1`](https://renovatebot.com/diffs/npm/wrangler/4.42.1/4.61.1) | `4.63.0` (+1) | --- ### Release Notes <details> <summary>vercel/ai (@​ai-sdk/openai)</summary> ### [`v2.0.89`](https://redirect.github.com/vercel/ai/releases/tag/%40ai-sdk/openai%402.0.89) [Compare Source](https://redirect.github.com/vercel/ai/compare/@ai-sdk/openai@2.0.88...@ai-sdk/openai@2.0.89) ##### Patch Changes - [`4953414`]( |
||
|
|
c3892d9c9d |
fix(e2e): fix client-js observability tests (#12355)
Fixes the client-js e2e tests that were failing:
- **zod-v3**: 12/15 tests failed (no traces returned)
- **zod-v4**: 2/15 tests failed (entityId filter tests)
Two issues fixed:
1. The test agent had `id: 'test-agent'` but `name: 'testAgent'`. When
filtering by `entityId`, the tests used the name but spans record the
id. Changed id to match name.
2. The 1s wait wasn't enough for the batch-with-updates strategy (5s
flush interval) to persist traces. Increased to 5s.
All 15 tests now pass in both zod-v3 and zod-v4.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Updated test infrastructure timing and configuration to improve test
reliability and consistency.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
||
|
|
acb2a31ae3 |
fix(ci): prevent turbo cache contamination and OOM errors (#12337)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
5678965ff9 |
chore(docs): Update msg format on .generate()/.stream() (#12049) | ||
|
|
42bdc2348b |
Fix failing client JS e2e tests on CI (#11827)
## Description
The MastraServer.init() method only registers built-in SERVER_ROUTES,
not custom routes from mastra.server.apiRoutes. This caused the
/e2e/reset-storage endpoint to return 404 in CI.
Fix by manually registering custom routes (similar to how the deployer
does it) before calling registerRoutes(). This ensures the reset-storage
endpoint is available for clearing observability storage between tests.
No changset required.
## Related Issue(s)
## 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
- [X] Test update
## Checklist
- [ ] 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
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Refactored test server initialization to implement explicit middleware
registration and improved custom API route handling through separate
registration of dynamic and built-in routes.
* **Refactor**
* Updated server setup sequence to separate middleware registration from
route handling for better control and maintainability of the
initialization process.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
e649f2e816 |
added new client-js e2e tests (#11721)
## Description Added new `client-js` e2e tests, which run against both zod v3 & v4 dependencies. They test client->server->storage. Currently these only test observability endpoints, but we should add more coverage soon. These were used to diagnose and fix an issue with the API parsing complex query params here: https://github.com/mastra-ai/mastra/pull/11711/changes#diff-a85fa6725ca52eb46a715cf3f03348d150e15bcb1158d6bfe64f847ebae89f79 No changeset required. ## Related Issue(s) ## 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 - [X] Test update ## Checklist - [ ] 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 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Added a client-JS E2E workflow job and integrated it into success/failure pipelines. * Registered three new workspace packages, added a top-level script to run client-JS E2E tests, and pinned Zod versions via overrides. * **Tests** * Added shared test utilities for observability and server setup. * Added full end-to-end suites for Zod v3 and Zod v4 with configs and setup harnesses. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com> |