mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
31 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8d4abc4f88 |
chore(deps): Vanta 2026-11-12 — raise undici to 8.12.4 / 7.30.2 (#30205) | ||
|
|
c22107fce3 |
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.45 (#29844) | ||
|
|
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> |
||
|
|
bfe3af4ae1 |
chore(deps): update better-auth monorepo to v1.7.15 (#29497) | ||
|
|
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> |
||
|
|
655b19993f |
chore(security): Vanta 2026-10-30 - zod ^4.6.7, @hono/node-server 2.1.5 (direct bumps) (#28983)
## Vanta 2026-10-30 security fixes (consolidated)
Direct dependency bumps and lockfile updates only. **No
overrides/resolutions added or raised.** The earlier override-based
edits on this branch were reverted; those findings are deferred below.
| Package | From → To | Advisory | Where |
|---|---|---|---|
| zod | ^3.25.76 → ^4.6.7 | zod <4.6.6 (High; no fixed 3.x) |
`client-sdks/react` (dev), `deployers/cloudflare` (dev),
`server-adapters/nestjs` (dev), `packages/editor` (dev),
`packages/playground-ui` (dep), `packages/playground`,
`workflows/_test-utils`, `examples/{durable-agents,inngest}`,
`explorations/longmemeval`,
`observability/_examples/otel-bridge/agent-hub`, e2e fixtures/templates
(`experiment-worker/fixtures/*`, `deployers/template/cloudflare`,
`no-bundling/template`, agent-builder `minimal-mastra-project`) + root
`pnpm-lock.yaml` |
| @hono/node-server | 1.19.x / 2.1.1 → 2.1.5 | CVE-2026-118663 /
GHSA-rmxm-3fg6-px4f (Medium) | direct deps: `examples/agent-builder`,
`otel-bridge/hono-multi/service-{one,two,mastra}`,
`templates/template-customer-refund-agent/client-demo-ui`,
`templates/template-kyc-customer-onboarding`,
`templates/template-security-incident-triage` |
Peer ranges (`^3.25.0 || ^4.0.0`) are unchanged, so consumers are
unaffected. Changeset: patch for `@mastra/playground-ui` (runtime zod
dep).
Supersedes the zod parts of #28075 (that PR also raises a pnpm override
and rewrites the `zod-v3` compat aliases to v4, so it is left as-is for
maintainers).
### Deferred (needs override, upstream release, or is intentional)
- zod v3 compat aliases (`zod-v3` in `packages/core`,
`packages/schema-compat`, `e2e-tests/type-check/template`;
`e2e-tests/client-js/zod-v3`): intentional zod 3 test coverage; no fixed
3.x release. Needs a decision to drop/dismiss.
- zod 3.25.76 transitive via `@arcadeai/arcadejs`, `@mcp-ui/client`,
firecrawl, `agent-browser`, `zod-to-json-schema`, MCP SDK paths:
upstream pins; override-only.
- @hono/node-server 1.19.x transitive via `@modelcontextprotocol/sdk`
(root, `examples/agent`, `packages/mcp/integration-tests`), and npm
lockfiles of `scripts/gh-issue-triage` (existing override, left alone)
and the two templates: override-only.
- graphql-scalars, raw-body, jose (templates/scripts): override-only.
- @azure/msal-node <7.1.0: 6.0.1 via `@azure/identity@4.14.0` (fixed in
4.14.1, blocked by the 1-day `minimumReleaseAge`; lockfile refresh
tomorrow), 5.6.0 via `@microsoft/teams.apps` (no fixed release).
- @opentelemetry/core <2.8.0: via `@google-cloud/pubsub@5` (fix needs
pubsub 6 major).
- @ai-sdk/provider-utils 2.2.8 / ai 4.x: pinned vendored AI SDK v4 line;
no fixed release in that major.
- extract-zip, deepmerge: no patched version.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR updates Zod and `@hono/node-server` versions in selected
packages, examples, and templates to address security advisories. It
also updates playground form code to work with Zod 4.
## Changes
- Updates selected `zod` dependencies to `^4.6.7`.
- Updates selected `@hono/node-server` dependencies to `2.1.5`.
- Updates the playground form’s IP address and record validators for Zod
4.
- Maps a specific Zod validation error to the message `Required`.
- Adds a patch changeset for `@mastra/playground-ui`.
## Validation
Test results are not provided in the supplied change summary.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: shreyas-mastra <327047572+shreyas-mastra@users.noreply.github.com>
|
||
|
|
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> |
||
|
|
07c1bf2362 |
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.42 (#28773) | ||
|
|
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> |
||
|
|
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 (@​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 - [#​11512](https://redirect.github.com/better-auth/better-auth/pull/11512) [`4175b34`]( |
||
|
|
4f60903242 |
chore(deps): lock file maintenance (#27013) | ||
|
|
f3cf77305f |
security: Vanta remediation (2026-10-20) (#27828) | ||
|
|
fa409d430b |
security: Vanta remediation pass 2026-10-14/15/19 (zod 4.6.7, @ai-sdk/provider-utils, @copilotkit template) (#27023) | ||
|
|
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 --> |
||
|
|
ea7ca755a4 |
security: Vanta remediation pass 2026-10-07 (MCP SDK, sharp, hono) (#26260) | ||
|
|
4358322b7b |
chore(deps): override upstream-blocked vulnerable transitive deps (#25853) | ||
|
|
7b777d38d9 |
security: Vanta zero pass 2026-09-23 (grpc/compression/provider-utils floors) (#24848) | ||
|
|
a2c9876f0d |
security: Vanta direct-dependency bumps (no overrides) (#24308) | ||
|
|
af2a951469 |
fix: secure remaining example and Fastify dependencies (#22587)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
1aad6198fd |
chore(deps): lock file maintenance (#19903) | ||
|
|
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--> |
||
|
|
3356bf3dd0 |
chore(docs): AX improvements (#19631) | ||
|
|
2e858270c6 |
chore(deps): lock file maintenance (#19080)
Co-authored-by: wardpeet <ward@coding-tech.com> |
||
|
|
401e29d34b |
fix(ci): unbreak renovate PRs — cap cookie override and fix standalone package installs (#19249)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai> Co-authored-by: wardpeet <ward@coding-tech.com> |
||
|
|
fb8aea3842 |
fix: multi-tenant Composio tool auth for Agent Builder (#19144)
Co-authored-by: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai> |
||
|
|
e8eee50879 |
feat: Signals, live Entity-Learning data with entity filter, layout polish, and entity-aware navigation (#18699)
https://github.com/user-attachments/assets/dee31cb1-68ba-4a89-bd56-41fe9c6515f8 ## Summary Makes the Studio **Signals** page a live feature backed by the platform Entity-Learning API instead of hardcoded mock data. You can pick any entity reported by the platform (agents, tools, workflows, and more) and inspect that entity's signals, their clusters, traces, and the cluster scatter plot — all fetched live. ## What changed **Live data + entity filter** - Added an entity-type / entity filter bar at the top of the Signals page, mirroring the traces filter, so you can choose any supported entity on the server. - The overview loads each available signal's real clusters (topics) by entity id and organization id; the details page renders live topics, topic examples, and points directly with no mock/mapping layer. - The cluster scatter plot and sidebar swatches derive their colors from the same per-cluster source, so the chart and list stay in sync. **Gating change** - The Signals UI is now gated on the platform observability endpoint being configured, replacing the removed `MASTRA_SIGNALS_UI` flag. Studio's served HTML now exposes `MASTRA_ORGANIZATION_ID`, `MASTRA_PLATFORM_PROJECT_ID`, and `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` to the browser. Set `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` to enable Signals; leave it unset to hide it. **Layout & navigation polish** - Pinned the entity filter as a top bar with centered empty/loading/error states using the shared `EmptyState` component. - Added a 4-cell skeleton grid while a signal's clusters load, reserving badge height to avoid layout shift. - Clicking a cluster card opens its topic by default via a `topicId` query param threaded through the route adapters. - The Signals breadcrumb preserves the selected `entityType` / `entityId` query params when navigating back to the overview. ## Test plan - `pnpm --filter ./packages/playground-ui typecheck` — clean - `pnpm --filter ./packages/playground typecheck` — clean - `pnpm --filter ./packages/playground-ui test` — 546 tests pass (Signals overview, details, hooks, and entity-learning service suites included) - `pnpm --filter ./packages/playground test` — 1429 pass / 2 skipped, including the Signals route-adapter suite (7 tests) covering entity-aware navigation, topicId passthrough, and breadcrumb query-param preservation - Tests use the package-standard approach: real `@mastra/client-js` + React Query driven through MSW handlers and typed fixtures, no `vi.mock` of local hooks/services. Draft for review. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 The Signals page used to show pretend data. Now it pulls real “entity-learning” signals from your platform (plus charts and examples), and it only turns on when the platform observability endpoint is configured. ## Summary - Reworked the Signals UI to load live Entity-Learning data (entities, topics/clusters, topic examples, points, and scatter plot) instead of hardcoded mock data. - Added an agent (entity) filter and updated the overview to render topic-based cluster cards with loading/empty/error states. - Refactored the details view to be topic-driven: live topic examples/trace list, point-based chart/scatter rendering, shared cluster-color logic, a 4-cell cluster loading skeleton, and default opening via `topicId`. - Updated navigation and breadcrumbs so `entityType`/`entityId` and `topicId` query parameters are preserved when moving between overview, details, and back links. - Changed UI gating by removing the `MASTRA_SIGNALS_UI` flag and enabling the Signals route when `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` is configured; the browser now receives `MASTRA_ORGANIZATION_ID`, `MASTRA_PLATFORM_PROJECT_ID`, and `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT`. - Added the Entity-Learning integration layer (typed service), React Query hooks, and expanded test coverage for the new live flows and routing behaviors. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai> |
||
|
|
213feb87bf |
fix(core,schema-compat): resolve TS2589 type instantiation depth errors in workflows (#18608)
Co-authored-by: Mastra Code (alibaba-token-plan/glm-5.2) Co-authored-by: Mastra Code (alibaba-token-plan/glm-5.2) <noreply@mastra.ai> |
||
|
|
3515d9eba2 |
feat(playground): tool provider integrations UI (connections + picker + auto-pin) (#17223)
Draft for review. Stacked on top of `yj/v1-tool-provider-backend` (the
v1 ToolProvider backend extraction, which IS off `main`).
## Stack
```
origin/main
└── yj/v1-tool-provider-backend (1 commit — backend extraction, #TBD)
└── yj/playground-tool-provider-integrations-v2 (this PR, 5 commits)
```
## Commits (this PR)
1. `c0392cb92b` — feat(playground): MVP tool provider connections page +
builder integration
2. `08e6084965` — feat(tool-providers): PATCH endpoint to rename
connection labels
3. `823ffd32cb` — feat(playground): inline connection picker for
integration tools
4. `791d3a8e9a` — chore(tool-provider): document Composio SDK pin and
add debug logs
5. `e1f68596d6` — feat(playground): auto-pin freshly authorized
connection after OAuth
## What's in here
- `/integrations` page — list/create/disconnect tool provider
connections.
- Agent Builder tools picker — integration tool cards with inline
Connect button + `IntegrationConnectionPicker` beneath checked cards.
- Inline label editing via new `PATCH
/tool-providers/:providerId/connections/:connectionId`.
- Admin-only `authorId` display on connections (gated by
`tool-providers:admin`).
- Auto-pin: a freshly authorized connection gets pinned to the form
(from picker "Connect new", or from card "Connect" when the tool is
already checked).
- Composio SDK pinned to `^0.6.5` with a notes doc explaining why
(`.notes/composio-sdk-pinned-0.6.5.md`).
## Verification
- `pnpm --filter ./packages/playground typecheck` — 14 pre-existing
`DataList.RowWrapper` errors unrelated to this diff
(datasets/experiments/workspace pages); 0 errors in touched files.
- `pnpm --filter ./packages/playground build` — clean
- Focused tests: `tools.test.tsx` 13/18 pass (5 pre-existing
PointerEvent JSDOM flakes in filter-checkbox tests unrelated to this
PR), `integration-connection-picker.test.tsx` 11/11 pass.
## Notes for reviewer
- Base is `yj/v1-tool-provider-backend` so the review diff is just the 5
frontend commits. The backend branch is the v1 ToolProvider extraction
(#16934 carved out).
- Not for merge yet. Once approved, both branches land via separate PRs
into `main` (backend first).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR adds a simple UI so people building AI agents can connect
external services (like Gmail) from the Agent Builder and a new
Integrations page; when you authorize a connection in a popup it becomes
available and—if relevant—gets automatically pinned into the agent’s
settings.
## Overview
Frontend-only MVP wiring for tool-provider integrations: a new
/integrations page, integration tools shown in the Agent Builder picker
with inline connect/rename/disconnect flows, OAuth popup + polling, and
auto-pin behavior for newly authorized connections. Admins can view
grouped connections by author; non-admins see only their own connections
in the picker. The v1 ToolProvider backend branch must land first—this
PR is draft and not for merge yet.
## Key Features
- Integrations page (/integrations): select provider/toolkit, connect
via OAuth (optional label), list and disconnect connections; admin view
groups connections by author.
- Agent Builder picker: integration tool cards, toolkit filter pane with
per-toolkit connection controls, connection-name badges on cards, inline
rename (PATCH), manage dialog for multi-connection drill-down and
disconnect.
- Auto-pin: newly authorized connections are automatically pinned into
the agent form when relevant tools/toolkits are selected; connecting
from a checked tool pins the connection and may auto-check the tool.
- Picker scoping & admin UX: picker scoped to caller authorId so editors
see only their own connections; users with tool-providers:admin
permission see grouped/owned/shared views.
- Form/schema & persistence: toolProviders added to form schema with
cross-field validation; save flow includes toolProviders when present;
mappers support form↔stored round-trips.
## Technical Summary
- New pages/components: IntegrationsPage and supporting components
(ProviderToolkitSelector, ExistingConnectionsPanel,
ManageConnectionDialog/List/Form, ManageConnectionForm,
ManageConnectionList, TwoPanePickerSkeleton, ToolkitFilterPane,
ToolkitConnectionControl, ToolGrid, ToolCard, FilterableList, etc.).
- Hooks & client flows: useAllProviderTools, useAllConnections,
useExistingConnections, useAuthorize (OAuth popup + polling),
useDisconnectConnection, useUpdateConnection, useIsToolProviderAdmin,
useProviderToolkitGroups, useToolkitSelection, useToolSelection,
useDebouncedConnectionRename, and related re-exports.
- Schemas & mappers: toolProvidersFormSchema, validateToolProviders,
buildToolProvidersForSave, extractFormToolProviders;
AgentBuilderEditFormSchema extended with optional toolProviders and
superRefine validation; routeToolInputToFormKeys and
useSetAgentToolsTool updated to carry toolProvidersFragment.
- Types & SDK: AgentTool gains 'integration' type and integration fields
(providerId, toolkit, hasConnection, connectionLabels); client route
type PostToolProvidersProviderIdAuthorize_Body.connectionId made
optional; Composio SDK pinned to ^0.6.5; debug logs added for provider
resolution.
- UI/UX adjustments: AgentSelectableCard footer slot; picker/tabs/layout
tweaks and new two-pane picker skeleton for consistent loading UX.
- Tests & fixtures: many new/updated Vitest + RTL tests and MSW
fixtures/handlers for providers/toolkits/tools/connections; jsdom
PointerEvent→MouseEvent shims in tests; some hook tests skipped pending
harness adjustments; focused typecheck/build clean for touched files.
## Verification & Notes
- Focused typecheck/build for modified files is clean; tests
added/updated to exercise integration flows (not all existing tests
fully unskipped; some pre-existing JSDOM flakes noted).
- Base backend branch yj/v1-tool-provider-backend must land before
merging.
- This PR is draft and not-for-merge yet.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: YJ <yj@example.com>
Co-authored-by: Mastra Code (anthropic/claude-opus-4-7) <noreply@mastra.ai>
Co-authored-by: mfrachet <marvin@mastra.ai>
|
||
|
|
b3e9781a93 |
fix(client-js): keep client tools for signal continuations (#17593)
This fixes subscribed client-tool continuations when an agent calls
browser client tools across multiple rounds.
Before, the first signal run stored client tools under the initial run
id. When the server started a continuation with a new run id, the
browser could lose access to those client tools and stop at `finish:
tool-calls`.
```ts
run-initial -> client tool result -> run-continuation -> finish: tool-calls // browser has no clientTools
```
Now the client keeps the thread-scoped runtime options available before
sending the continuation result, so follow-up continuation runs can keep
executing client tools.
```ts
run-initial -> client tool result -> run-continuation -> client tool result -> ...
```
I also added a regression test for multiple subscribed client-tool
continuation rounds and documented that Agent Builder local testing
needs `pnpm build:cli` before restarting with `pnpm mastra dev`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
When a browser-based AI agent continued a conversation, it could lose
access to its special toolbox and stop working. This PR keeps the
toolbox available across continuation rounds so the agent can keep using
the tools in subsequent runs.
## Changes Overview
### Core Fix: Preserve Client Tools Across Continuations
- client-sdks/client-js/src/resources/agent.ts
- When a subscribed thread finishes with `tool-calls`, build a single
`continuationStreamOptions` from the active runtime options (including
processed `clientTools`, `requestContext`, and `memory` when `threadId`
exists).
- Persist that `continuationStreamOptions` into signal-runtime state via
`agent.setSignalRuntimeOptions` before sending approvals, and reuse the
same object when calling `agent.sendToolApproval`.
- On `sendToolApproval` failure, delete only the matching latest
thread-scoped runtime options (reference-aware cleanup) while still
removing run-scoped options in `finally`. This prevents losing client
tools across continuation run IDs.
### Test Coverage
- client-sdks/client-js/src/resources/agent.test.ts
- Added a Vitest regression test that simulates two subscribed
continuation cycles across separate run IDs and asserts:
- client tool `execute` is called for each continuation with the correct
per-run args,
- `sendToolApproval` is invoked for each continuation,
- emitted `tool-result` stream contains both tool-call IDs.
### Documentation
- examples/agent-builder/AGENTS.md
- Added local dev instructions: rebuild the CLI with `pnpm build:cli`
from the repo root before restarting the example with `pnpm mastra dev`
so local changes to the CLI are picked up.
### Release Notes
- .changeset/tiny-pianos-wave.md
- Bumps `@mastra/client-js` patch and documents the fix keeping client
tools available across subscribed continuation runs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
||
|
|
bea9a679f8 |
feat(playground,editor): Agent Builder shortcut, sidebar polish, and request-context defaults (#17109)
## What this PR ships This branch makes the Agent Builder reachable, well-integrated with Studio, and aware of the current user — so a fresh builder agent can immediately participate in request-context features without setup. It bundles several related improvements: 1. **Agent Builder shortcut in the Studio sidebar** so users can jump to the builder from anywhere in Studio. 2. **Agent Builder sidebar logo links back to `/agents`**, matching Studio's navigation expectations. 3. **`@mastra/editor` lets consumers override the `createBuilderAgent` constructor args** so embedders can customize how the builder agent is constructed. 4. **Agent Builder sidebar chrome aligned with Studio** (visual + layout parity). 5. **Changeset added** for the editor override capability. 6. **Builder chat passes the current user in its stream request context** so agent runs receive the authenticated user. 7. **Builder-created agents are born with a default `requestContextSchema`** describing a single `user` variable matching the `CurrentUser` shape, so downstream features (instruction interpolation, request-context presets, autocomplete) can read `user` from any builder agent without any UI step at creation time. Together, this means: a user can reach the builder from Studio, create an agent in one click, and immediately use `user` in the agent's instructions / request-context flows — no manual schema authoring required. ## Test plan - `pnpm --filter ./packages/playground typecheck` passes - New and existing vitest suites for the agent-builder starter and constants pass (8 tests across 2 files) - Manual: open Studio, click the new Agent Builder sidebar entry, create a new agent from the starter, then fetch the stored agent and confirm `requestContextSchema` contains a `user` object with the expected fields ## Notes - The default `requestContextSchema` only affects newly created builder agents. Existing agents and subsequent builder saves are not modified. - No new UI surface is introduced for the request-context default — it's a fixed schema applied at create time. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR makes the Agent Builder tool easier to find in Mastra Studio by adding a shortcut in the sidebar, and ensures agents created there automatically know who's using them so they can work with personalized features right away. --- ## Overview This PR enhances the Agent Builder's integration with Mastra Studio by making it discoverable via a sidebar shortcut, improving navigation consistency, enabling constructor-level customization, and ensuring builder-created agents come pre-configured with user-context awareness. ## Key Changes ### UI & Navigation Integration - Added an "Agent Builder" sidebar shortcut that conditionally appears based on user authentication and builder access permissions via new `useAgentBuilderSidebarVisibility` hook - Agent Builder sidebar logo now links to `/agents` to match Studio navigation patterns - Aligned Agent Builder sidebar layout and chrome (header/trigger UI) with Studio design conventions - Removed header controls from agents page that are now redundant with the sidebar navigation ### Agent Builder Constructor Enhancements - `createBuilderAgent()` in `@mastra/editor` now accepts an optional partial constructor argument, allowing embedders to override agent defaults (e.g., `model`, `instructions`) while preserving canonical `id`, `name`, and `description` - Agent constructor now explicitly includes the `workspace` binding - Published changeset documenting the new override capability ### Request Context & User Awareness - `StreamChatProvider` now reads the current authenticated user via `useCurrentUser()` and injects it into the request context before sending messages to agents, enabling agents to access caller identity - Newly created builder agents automatically receive a `DEFAULT_BUILDER_REQUEST_CONTEXT_SCHEMA` that defines a top-level `user` object matching the `CurrentUser` shape (`id`, `email`, `name`, `avatarUrl`, `roles`, `permissions`), with `id` as the only required field - Schema application is automatic at creation time with no new UI required; existing agents and subsequent saves remain unaffected ### Build & Workspace Integration - Updated `tsup.config.ts` to bundle the `src/ee/workspace` directory into `dist/ee/workspace` on successful build - Added comprehensive skill authoring documentation defining playbooks and quality standards for eight agent archetypes: generic-assistant, coding-agent, content-writer-agent, customer-support-agent, ops-automation-agent, research-agent, spreadsheet-agent, and a universal agent-prompt-quality-bar skill ### Auth & Permissions - Tightened example auth role mapping: member role in WorkOS RBAC now maps to empty permissions array instead of full access (`'*'`) ### Testing - Added comprehensive sidebar visibility tests via `AppSidebar` Vitest suite covering auth states, RBAC conditions, and permission checks - Added `DEFAULT_BUILDER_REQUEST_CONTEXT_SCHEMA` validation tests - Updated `StreamChatProvider` tests to properly seed React Query cache for `useCurrentUser` hook and register MSW handlers for auth endpoints - Updated agent-builder-starter tests to verify `requestContextSchema` is included in agent creation payload - Removed `AgentChatPanel` test file and simplified the component export to eliminate wrapper re-export ## Technical Details **Accessibility Control**: The Agent Builder sidebar link visibility is gated by auth capabilities and fine-grained permissions (`stored-agents:*` or `stored-agents:read`), mirroring root-layout access checks. **Schema Design**: The `DEFAULT_BUILDER_REQUEST_CONTEXT_SCHEMA` uses a JSON Schema-like structure ensuring newly created agents have a consistent, documented interface for accessing authenticated user information at runtime. **Build Configuration**: Workspace skills are now bundled with the editor package, making them available for builder runtime operations like skill discovery, reading, and quality validation. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17109?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 (anthropic/claude-opus-4-7) <noreply@mastra.ai> |
||
|
|
271d8917e4 |
feat(client-js,playground): port magnificent-marquess frontend stack (#17105)
## What Ports the scoped frontend stack from `yj/magnificent-marquess` onto `rain-purpose` as one reviewable PR, while preserving the newer client-tools-on-signals (#16540) and Agent Builder view/edit pages (#17104) work that already landed on `rain-purpose`. Also brings over `examples/agent-builder/` for end-to-end smoke testing. ## Scope **`@mastra/client-js`** - New `ToolProvider` resource + unit tests - `getModelPolicy` accessor on the root client - Regenerated route types **`@internal/playground`** - **Auth**: `route-permissions` module, `RoutePermissionGuard`, login layout, `ImpersonationBanner`, `RoleImpersonationProvider`, expanded user-menu - **Agent Builder routing**: agents / skills / infrastructure / favorite / library + create/edit/view all wired in `App.tsx`, `AgentBuilderRootLayout`, `RoutePermissionGuard` around the app outlet, `RoleImpersonationProvider` wrapping `PostHogProvider`, `StudioIndexRedirect` replacing the `/agents` home redirect - **Agents**: composer/model-switcher updates, browser-thumbnail/panel `hideSidebar` plumbing, channels/CMS sidebar tweaks, new `useUpdateSkill` MSW test - **LLM**: models/providers/provider-logo updates - **Misc**: `useRestoreFocus` hook, `studio-index-redirect`, nav-items entries, tsconfig path tweak, e2e auth login-flow + kitchen-sink fixture updates **`examples/agent-builder`** - New example app for smoke testing the Agent Builder routes locally ## Preserved from rain-purpose (explicitly NOT overwritten) - `client-sdks/client-js/src/resources/agent.{ts,test.ts}` - `client-sdks/react/src/agent/hooks.ts`, `package.json`, `vitest.config.ts`, `hooks.test.ts` - `packages/playground/src/services/mastra-runtime-provider.tsx` - `packages/playground/src/pages/agent-builder/agents/__tests__/{view,edit}.test.tsx` - `packages/playground/src/domains/builder.ts` (yj #17072 deletion skipped) ## Test plan - `pnpm --filter ./client-sdks/client-js test`: **491/491 passing** - New playground MSW + login-page tests: **13/13 passing** - `pnpm --filter ./packages/playground exec tsc -p tsconfig.app.json --noEmit`: same 46 pre-existing errors as `rain-purpose` HEAD; **zero new errors introduced** - Smoke test locally with `examples/agent-builder` to validate the new routes, route-permission guard, and role-impersonation banner <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR brings a sophisticated frontend system from another branch into the main codebase, adding support for role-based access controls, authentication, and an improved Agent Builder interface. It's like moving a fully furnished house into a new location while keeping all the original furniture that was already there. --- ## Overview Ports the `yj/magnificent-marquess` frontend stack onto `rain-purpose`, integrating route-based permission controls, role impersonation, enhanced authentication flows, and Agent Builder routing while preserving existing `client-tools-on-signals` and Agent Builder view/edit functionality. Includes a new `examples/agent-builder` app for local smoke testing. ## `@mastra/client-js` - **ToolProvider resource**: New resource type with unit tests - **getModelPolicy accessor**: Added to root client for admin model policy access - **Route types**: Regenerated for new endpoints ## `@internal/playground` ### Authentication & Permissions - **route-permissions module**: Centralized registry mapping Studio routes to required permissions with utilities for permission resolution and access determination - **RoutePermissionGuard**: New component gating route access based on user permissions, with deterministic redirects to `/agents` for viewers without `tools:read` - **Role impersonation**: `RoleImpersonationProvider`, `useRoleImpersonation` hook, and `ImpersonationBanner` component enabling admins to preview the app as different roles - **LoginLayout component**: Shared visual shell for auth pages - **Login flow tests**: E2E tests for unauthenticated redirects with credential submission and auth-disabled routes; parity tests for login/signup UI across auth capability modes ### Agent Builder Routing - **Route wiring**: Integrated agents/skills/infrastructure/favorite/library routes with create/edit/view flows in `App.tsx` and `AgentBuilderRootLayout` - **Layout guards**: Wrapped app outlet with `RoutePermissionGuard` and `PostHogProvider` with `RoleImpersonationProvider` - **Home redirect**: Replaced `/agents` redirect with `StudioIndexRedirect` for permission-aware home routing ### Agent Builder & Agents UI - **Model policy integration**: Composer and model-switcher components now respect admin model policies, showing "locked by admin" chips and stale-model warnings - **Browser sidebar control**: Added `hideSidebar` prop plumbing through `AgentChatPanelChat` → `BrowserThumbnailSlot` → `BrowserThumbnail` - **Skill editing**: `SkillEditDialog` refactored to support view/edit/create modes with optional chat-driven field population, file-tree editing for admins, and update mutations - **CMS sidebar feature-gating**: Sections now filtered by builder feature toggles - **Browser view refactoring**: `BrowserViewPanel` simplified to use `useRestoreFocus` hook and modal-only behavior - **Workspace selector**: Now conditionally rendered only when workspace options are available ### LLM & Providers - **Model/provider filtering**: Updated to incorporate builder admin policies via `useBuilderFilteredModels`/`useBuilderFilteredProviders` - **Provider logo styling**: Added optional `style` prop for custom CSS properties ### Hooks & Utilities - **useRestoreFocus**: New hook capturing and restoring focus when modal opens/closes - **useCanCreateAgent**: Moved to `agent-builder` domain for Agent Builder context - **useUpdateSkill**: MSW tests added for sparse PATCH request validation - **useStoredAgents**: Added model-policy error handling and cache invalidation for builder-settings ### Navigation & Layout - **Nav items refactoring**: Removed per-item permission fields; permission checks now centralized via `route-permissions` - **User menu expansion**: Added role-preview section with role-switching controls and visual active states - **ImpersonationBanner**: Displayed in both AppSidebar and AgentBuilderSidebar when impersonation is active - **useDefaultVisibility hook**: New utility for visibility state management - **Auth capabilities**: Added `availableRoles` field to `AuthenticatedCapabilities` for admin role-switching ### Configuration & Dev - **Dev script update**: `dev` script now runs Vite with `MASTRA_AUTO_DETECT_URL=true` - **Playwright auth tests**: Updated viewer-role E2E test to wait for deterministic redirects - **TypeScript**: Added kitchen-sink `MastraEditor` builder configuration with tools and avatar-upload features - **CSS**: Added `@keyframes shimmer-text` animation for text shimmer effects ## examples/agent-builder New example app for local Agent Builder smoke testing with: - **Mastra setup**: Configured with LibSQL storage, WorkOS authentication, RBAC provider with role-to-permissions mapping, Slack provider, and Stagehand browser support - **Agents**: `weatherAgent` with OpenAI `gpt-4o-mini` model - **Tools**: `weatherInfo`, `weatherTool`, `diceRoll`, `coinFlip`, `randomQuote` with Zod schemas - **Workflows**: `greetWorkflow` demonstrating step composition and Zod validation - **Workspace**: E2B sandbox with Git environment variable support - **Configuration**: Role-based builder with feature toggles, browser workspace via Stagehand, Composio tool provider, Swagger API docs, and observability with cloud exporters - **Dev setup**: pnpm-based with local workspace links to `@mastra/*` packages, MSW mocking, and `mastra:dev`/`mastra:build` commands ## Testing - **client-js tests**: 491/491 passing - **Playground tests**: 13/13 passing (new MSW + login-page tests) - **TypeScript**: 46 pre-existing errors, zero new errors - **Manual testing**: Examples/agent-builder smoke tests for routes, guards, and impersonation banner <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17105?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 (anthropic/claude-opus-4-7) <noreply@mastra.ai> |