Factory's `dev:ui` and `factory:dev` commands build `@mastra/react`
initially but omit its watcher. Add `client-sdks/react` to the existing
Turbo filters and use the same build-before-watch ordering already
configured for Playground UI.
Validated both entrypoints with Turbo's dry run, including initial-build
ordering. Ran the actual React SDK watch command through Studio and
Factory's Vite configurations in Chromium: three consecutive component
edits per app rendered with the counter retained at 2 and no
edit-triggered page reloads. Targeted type-aware lint, types, formatting
and diff checks passed. API/Docker services were not started.
The redundant script-selection test is removed. Shared UI chunk
identities and Factory's Vite alignment are handled separately in draft
PR #27654; this change can be reviewed and merged independently.
Fixes#27656.
Follow-up to [chore(lint): require import type for type-only
imports](https://github.com/mastra-ai/mastra/pull/27642). Its new rules
flagged errors in Factory UI that CI never caught: Turbo's `lint` cache
key only covers each package's own files, so changing the root
`oxlint.config.ts` kept serving cached passes. The errors themselves are
now fixed on main ([fix(factory-ui): clarify board layout and filter
controls](https://github.com/mastra-ai/mastra/pull/27660),
[fix(playground): resolve lint and schema type
errors](https://github.com/mastra-ai/mastra/pull/27665)); this PR fixes
the cache key so the next lint config change re-lints every package.
## What changed
- `turbo.json`: the `lint` task's inputs now include
`$TURBO_ROOT$/oxlint.config.ts`.
## Scope
Known gaps, not handled here:
- Studio (`@internal/playground`) is still excluded from `pnpm lint`
(since #18428). Only the lint-staged pre-commit hook lints it.
- The lint cache key still ignores the oxlint version and the types of
dependencies, which type-aware rules read. Bumping oxlint or changing a
dependency's types won't re-lint dependent packages.
## Testing
1. `pnpm exec turbo run lint --filter @internal/factory-ui --dry=json`
lists `../../oxlint.config.ts` as an input, and editing the root config
changes the task hash.
2. `pnpm turbo --filter "!./examples/**/*" --filter "!./docs/**/*"
--filter "!./explorations/**/*" --filter "!@internal/playground" lint
--force` passes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
Turbo checks a list of files to decide whether it can reuse a lint
result. This change adds the root Oxlint config to that list, so changes
to the config trigger lint again.
## Changes
- Added `$TURBO_ROOT$/oxlint.config.ts` to the `lint` task inputs in
`turbo.json`.
- Kept the `lint` task’s `dependsOn` value empty.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Editing a design-system component while running `pnpm dev:ui` now shows
up in the Factory UI on its own, instead of staying invisible until you
remember to rebuild playground-ui by hand.
Before, `dev:ui` ran turbo with a filter on factory-ui only, so
playground-ui got built once through `^build` and then never again.
Every subpath of the package resolves to `dist`, so nothing you typed in
`src` reached the browser. I added the package to the filter, which
starts its `vite build --watch` alongside the app. `pnpm dev:playground`
shares the same `dev` script, so the studio gets everything below too.
That watch was paying ~7s of `vite-plugin-dts` on every keystroke, for
declarations that do not change shape while you iterate on styles. Its
`dev` script now runs `--mode development` and the config only registers
dts in production, so a rebuild went from ~9s to ~1.5s. Skipping the
plugin is not enough on its own: Vite empties `dist` on the first watch
build, which would delete the 1285 declarations `^build` had just
written and drop factory-ui to implicit `any`. So the dev build leaves
the output directory alone and layers fresh JS over what is already
there.
Leaving `dist` alone needed two things around it. Turbo had no edge
between `playground-ui#dev` and `playground-ui#build` — they were
siblings, so two processes could write the same output paths at once,
and nothing enforced the "layers over a real build" assumption the
design rests on. The scoped task now depends on that build, which costs
no wall-clock because factory-ui's `dev` already waited for it. And that
build does not always prune: on a cache hit turbo restores its recorded
outputs without removing anything else, so both the orphaned
content-hashed chunks — one save on a shared primitive like Button
leaves ~1 MB of them — and the bundle of a component you deleted can
survive into the next session. So the watch drops everything but
`*.d.ts` before it starts. That cannot leave a hole: a development build
emits the same 1536 entry files, 308 shared chunks and 15 stylesheets as
a production one, only without declarations.
`build` and `build:publish` are untouched: they still empty `dist`, emit
`.d.ts` and fail on type errors, which I checked by running a normal
build after the change. Three trades remain inside a dev session.
Declarations are frozen at the last real build, so a new prop on a DS
component needs a `pnpm --filter @mastra/playground-ui build` before
factory-ui sees it. A component you delete keeps resolving from its
stale bundle until you restart the watch. And because each edit changes
a module URL, Vite answers with a full page reload rather than a React
refresh, so component state resets.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
When design-system code changes, `playground-ui` now rebuilds
automatically. Development rebuilds are faster because they skip
declaration files, while production builds still create them.
## Changes
- Added `playground-ui` to the `dev:ui` Turbo workflow.
- Enabled Vite watch mode with `--mode development`.
- Refactored entry discovery to support nested source files and
component folders with `index.ts`.
- Excluded tests, stories, and root barrel files from library entries.
- Skipped declaration generation during development builds.
- Preserved existing declarations in `dist` during watch builds.
- Preserved declaration generation and type checking for production
builds.
- Added patch changesets for `@mastra/playground-ui` and
`@mastra/factory`.
## Validation
- Reduced development rebuild time from approximately 9 seconds to 1.5
seconds.
## Notes
- Shared chunk changes trigger full page reloads instead of React
refreshes.
- Removed Tailwind classes may remain in `dist/style.css` until a clean
build.
- Declaration changes require a separate `playground-ui` build.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Lint and format checks in CI were running as two sequential steps in the
same job. This moves the Prettier check into the root `lint` script so
Turbo runs ESLint and Prettier in a single invocation and schedules them
concurrently.
Before, CI had two steps:
```yaml
- run: pnpm turbo --filter ... lint
- run: pnpm prettier --check . '!docs/**/*' ...
```
Now it's one:
```yaml
- run: pnpm lint
```
Local `pnpm lint` and CI now run the exact same command. The root `lint`
script also picks up the `!./explorations/**/*` filter so it matches
what CI was already checking. `pnpm format` runs ESLint autofix then
Prettier write sequentially via `pnpm` to avoid concurrent file writes.
No changeset since this is CI/turbo tooling only and touches no
published package.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This change makes the code checks and formatting use one shared command
instead of separate ones. It also makes formatting safer by doing the
fixes one after the other, so they don’t try to change the same files at
the same time.
## Summary
- Simplified CI linting to run `pnpm lint` in a single step instead of
separate Turbo lint and Prettier check commands.
- Aligned local linting with CI by moving the Prettier check into the
root `lint` flow and adding the `!./explorations/**/*` exclusion.
- Reworked formatting so ESLint autofix and Prettier write run
sequentially via separate pnpm scripts, avoiding concurrent file writes.
- Added matching Turbo tasks for the new lint/format script split, with
caching disabled for file-checking and file-writing tasks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Mastra Code (alibaba-token-plan/glm-5.2) <noreply@mastra.ai>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
## Description
<!-- Required: Provide a brief description of the changes in this PR.
-->
## Related issue(s)
<!-- Required: Link to the issue(s) this PR addresses, e.g. with: Fixes
#123. PRs without linked issues may be closed. -->
## Type of change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have linked the related issue(s) in the description above
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR upgrades the Turbo monorepo build tool from version 2.9.6 to
2.9.12 and updates all configuration files across the entire codebase to
use the newer schema version that corresponds to this updated tool
version. Think of it like updating a recipe book to the latest version
and making sure all your cookbook references point to the new edition.
## Changes Summary
### Turbo Version Upgrade
- Updated root `package.json` `devDependencies`: `turbo` upgraded from
`^2.9.6` to `^2.9.12`
### Turbo Configuration Schema Updates
Updated the `$schema` field in 73 `turbo.json` configuration files
throughout the repository from the legacy
`https://turbo.build/schema.json` to the newer
`https://v2-9-16.turborepo.dev/schema.json`:
**Auth modules** (9 files): auth0, better-auth, clerk, cloud, firebase,
okta, studio, supabase, workos
**Client SDKs** (3 files): ai-sdk, client-js, react
**Deployers** (2 files): cloud, vercel
**Integrations** (3 files): brightdata, opencode, perplexity, tavily
**Observability** (11 files): arize, braintrust, datadog, laminar,
langfuse, langsmith, mastra, otel-bridge, otel-exporter, posthog, sentry
**Package modules** (19 files): _external-types, _internal-core,
agent-builder, auth, cli, codemod, core, create-mastra, deployer, evals,
fastembed, loggers, mcp, mcp-docs-server, mcp-registry-registry, memory,
playground, rag, schema-compat, server
**Data stores** (21 files): astra, chroma, clickhouse, cloudflare,
cloudflare-d1, convex, couchbase, duckdb, dynamodb, elasticsearch,
lance, libsql, mongodb, mssql, mysql, opensearch, pg, pinecone, qdrant,
redis, s3vectors, spanner, turbopuffer, upstash, vectorize
**Root configuration**: turbo.json
All other configuration content (extends, tasks, inputs/outputs) remains
unchanged across all files.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Adds a Playground `tsc --noEmit` typecheck script and wires it into the
Quality Assurance workflow so TypeScript errors are caught outside the
Vite/esbuild build. Fixes the Playground type errors exposed by the new
gate, including route/component props, dataset editor payload typing,
memory/template/runtime typing, and shared Playground UI declaration
props. Validated with Playground typecheck, Playground lint, Playground
UI lint, Playground UI build, and `git diff --check`.
## Related Issue(s)
Fixes#15972
## Type of Change
- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [x] Test update
## Checklist
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR makes the Playground run TypeScript's full type checker in CI so
TypeScript mistakes are caught before merging, and fixes the type errors
the new check found across Playground, Playground UI, client, and server
types.
---
## Overview
Adds a Playground `typecheck` script (tsc --noEmit), wires it into CI
(lint workflow + Turborepo), and backfills ~50+ TypeScript fixes so the
Playground typecheck passes. Updates shared Playground UI types and
related client/server schemas/types to keep the codebase type-safe.
## CI / Workflow
- .github/workflows/lint.yml: Adds a Typecheck step that runs `pnpm
turbo --filter ./packages/playground typecheck`.
- turbo.json: Adds a `typecheck` task (dependsOn: ["^build"]).
- packages/playground/turbo.json: Playground build now depends on
`typecheck`.
## Build / Typecheck config
- packages/playground/package.json: Adds `"typecheck": "tsc --noEmit -p
tsconfig.typecheck.json"` and some @types dev deps.
- packages/playground/tsconfig.typecheck.json: New config extending
tsconfig.app.json and excluding stories/tests.
## Type & Component Fixes
- Standardized React type usage (use of `import type`, ReactNode,
CSSProperties, HTMLAttributes/ThHTMLAttributes).
- Playground UI component prop typings updated: Table, Txt (adds
optional title), Icon, and others.
- Normalized handlers and signatures (CodeEditor onChange accepts
string|undefined -> '' conversion; explicit MouseEvent and boolean
typings; LoaderFunctionArgs for route loaders).
- Swapped some local component imports to `@mastra/playground-ui` types
(SchemaField) to centralize types.
- Minor UI/typing adjustments across many Playground components
(memoization, error normalization, prop additions).
## Data / Domain Typing Changes
- Introduced `expectedTrajectory` into dataset item types and
history/hooks; dataset edit/save flow updated to parse/submit it
conditionally.
- Template components: added optional props (imageURL, runId,
workflowInfo, linkComponent).
- Observational memory logic refined: an `observationalMemory` object is
treated as enabled unless explicitly `enabled: false`.
## API / Client / Server typings
- packages/server/src/server/schemas/agents.ts: providerSchema extended
with `envVar: string | string[]`, `connected: boolean`, optional
`docUrl`, and `models: string[]`.
- packages/server/src/server/schemas/datasets.ts:
itemVersionResponseSchema adds `expectedTrajectory?: unknown`.
- client-sdks/client-js: widened `Provider.envVar` and added
`expectedTrajectory?: unknown` in generated/handwritten types.
## Release / Changesets
- Changesets updated to publish patch bumps for @mastra/playground-ui,
@mastra/client-js, @mastra/server, and related internal packages.
## Miscellaneous
- Removed unused PDF extraction stub.
- Small nonfunctional tweaks (ScorerVersionCombobox variant, minor
refactors).
- Validated by: Playground typecheck, Playground lint, Playground UI
lint, Playground UI build, and `git diff --check`.
## Related Issue
Fixes#15972
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Ward Peeters <ward@coding-tech.com>
Remove GITHUB_REF_NAME from turbo.json globalEnv and workflow env blocks
where it was used solely for Turbo cache scoping. Vercel Remote Cache is
content-addressed, so this manual scoping is unnecessary and was causing
cache misses between Prebuild and downstream workflow_run jobs.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated continuous integration workflow configurations to streamline
environment variable handling across multiple test and build pipelines.
* Updated build tool configuration to remove unused environment variable
declarations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Created @mastra/editor package for managing and resolving stored agent
configurations
This major addition introduces the editor package, which provides a
complete solution for storing, versioning, and instantiating agent
configurations from a database. The editor seamlessly integrates with
Mastra's storage layer to enable dynamic agent management.
**Key Features:**
- **Agent Storage & Retrieval**: Store complete agent configurations
including instructions, model settings, tools, workflows, nested agents,
scorers, processors, and memory configuration
- **Version Management**: Create and manage multiple versions of agents,
with support for activating specific versions
- **Dependency Resolution**: Automatically resolves and instantiates all
agent dependencies (tools, workflows, sub-agents, etc.) from the Mastra
registry
- **Caching**: Built-in caching for improved performance when repeatedly
accessing stored agents
- **Type Safety**: Full TypeScript support with proper typing for stored
configurations
**Usage Example:**
```typescript
import { MastraEditor } from '@mastra/editor';
import { Mastra } from '@mastra/core';
// Initialize editor with Mastra
const mastra = new Mastra({
/* config */
editor: new MastraEditor();
});
// Store an agent configuration
const agentId = await mastra.storage.stores?.agents?.createAgent({
name: 'customer-support',
instructions: 'Help customers with inquiries',
model: { provider: 'openai', name: 'gpt-4' },
tools: ['search-kb', 'create-ticket'],
workflows: ['escalation-flow'],
memory: { vector: 'pinecone-db' },
});
// Retrieve and use the stored agent
const agent = await mastra.getEditor()?.getStoredAgentById(agentId);
const response = await agent?.generate('How do I reset my password?');
// List all stored agents
const agents = await mastra.getEditor()?.listStoredAgents({ pageSize: 10 });
```
**Storage Improvements:**
- Fixed JSONB handling in LibSQL, PostgreSQL, and MongoDB adapters
- Improved agent resolution queries to properly merge version data
- Enhanced type safety for serialized configurations
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* MastraEditor: store, version, retrieve, and instantiate agents with
dependency resolution, version activation, pagination, caching, and
raw/instantiated outputs; editor can register with Mastra and manage
per-agent caches. Exposed types for serialized memory and default
options; Agent source flag.
* **Bug Fixes**
* Improved version fallback, safer JSONB handling across adapters, and
guarded editor-based lookups to avoid crashes when editor is absent.
* **Tests / CI**
* New unit/integration tests for editor and a dedicated CI workflow;
added test:editor script.
* **Documentation**
* Initial editor CHANGELOG entry.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code <noreply@mastra.ai>
## Description
Fix the dev:playground command at root
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
## Description
dev playground from root and remove the uneeded vite react app entry
point
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## 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
- [x] Code refactoring
- [ ] Performance improvement
- [ ] 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