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

Compare commits

..

9 commits

Author SHA1 Message Date
mastra-platform[bot]
30852ab5fe
docs(client-js): align retry docs with the write default (#30435)
Co-authored-by: sdivyanshu90 <97019230+sdivyanshu90@users.noreply.github.com>
2026-11-17 09:22:33 +01:00
mastra-platform[bot]
657d2e2127
docs: clarify DurableAgent.abortThreadStream returns false while still forwarding the abort (#30439) 2026-11-17 09:01:13 +01:00
mastra-platform[bot]
cf6f1b0459
docs(otel): sort vendors alphabetically on OpenTelemetry integration page (#30670) 2026-11-17 08:58:25 +01:00
mastra-platform[bot]
3ff2824bd4
fix(factory-ui): show notification summaries as a readable inline line (#30662)
> Opened by @damien-schneider

## Description

When pending notifications are rolled into a summary, Factory chat
showed them as a row labeled "Notification summary" followed by the raw
summary text, e.g. `factory-session: 1`. The row also used the padded,
caption-sized activity style. It sat between inline signal lines like
"Factory sessions snapshot", so it looked out of place and read like
debug output.

The summary now renders like those inline lines and is built from the
structured fields every summary carries (`pending`, `bySource`,
`byPriority`):

- **Label and count:** "Notifications" followed by "1 new" / "4 new".
- **Sources:** one badge per source. With a single source it shows just
the name (`Factory session`). With several, each badge has its count
(`GitHub 3`, `My webhook 1`).
- **Source names:** a small map gives readable names for known sources
(`factory-session`, `github`, `gitlab`, `linear`, `jira`, `slack`). Any
other source shows its id in sentence case (`my-webhook` → "My
webhook"), so new sources need no code change.
- **Priority:** the bell is tinted only when something high or urgent is
pending.
- **Fallback:** a summary with no counts shows its original text.

The change is limited to `NotificationSummaryCard` in factory-ui. The
shared `NotificationActivity` component and individual notification rows
are unchanged.

## Test plan

- `TranscriptNotifications.msw.test.tsx` covers a single Factory session
summary (no raw `factory-session: 1` text), several sources including an
unmapped one, and the fallback with no counts.
- `pnpm typecheck`, oxlint and prettier pass on factory-ui.

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

ELI5: When many alerts are waiting, the app used to show a plain block
of raw text. Now it shows one short line that says how many are new and
where they came from.

## Summary

This PR changes how `NotificationSummaryCard` renders notification
summaries in factory-ui. The card now shows an inline activity line
instead of a padded row with raw summary text.

### Changes

**`TranscriptNotifications.tsx`** (+47/-2)

- Replaces the `NotificationActivity` call in `NotificationSummaryCard`
with an `Activity` line. The line contains a bell icon, a
"Notifications" label, and a status label.
- Shows `"<pending> new"` when `pending > 0` and at least one source has
a count above zero. Otherwise, shows `entry.message`.
- Adds one `Badge` per source with a positive count. With one source,
the badge shows the source name. With several sources, the badge shows
the name and count, for example `GitHub 3`.
- Tints the bell only when `byPriority` has an `urgent` or `high` count
above zero.
- Adds a `NOTIFICATION_SOURCE_NAMES` map for `factory-session`,
`github`, `gitlab`, `linear`, `jira`, and `slack`.
- Adds exported `notificationSourceName(source: string): string`. It
returns the mapped name for a known source. For an unknown source, it
replaces `-` and `_` with spaces and applies sentence case. An empty ID
is returned unchanged.
- Adds an own-key check when it looks up source names. IDs such as
`__proto__` do not match inherited object properties. These IDs use the
sentence-case fallback, so the component does not render an invalid
React child.
- Imports the `Activity`, `ActivityHeader`, `ActivityIcon`, and
`ActivityLabel` primitives and `Badge`.

**`TranscriptNotifications.msw.test.tsx`** (+67/-9)

- Replaces the test that checked for the summary under its own label.
- Adds a test for one pending `factory-session` notification. It checks
for `Notifications`, `1 new`, and `Factory session`. It checks that the
raw `factory-session: 1` text and any button are absent.
- Adds a test for multiple sources, including an unnamed source. It
checks the total and the per-source counts.
- Adds a test for a summary with no counts. It checks that the summary
message is shown.
- Adds a test that a source named `__proto__` displays as `Proto`.

### Scope

- The shared `NotificationActivity` component is not changed by this
diff.
- Individual notification rows are not changed by this diff.
- The diff touches only these two files under `mastracode/factory-ui/`.

### Verification

- The PR author reports that `pnpm typecheck`, oxlint, and prettier pass
on factory-ui. These results were not re-run for this summary.
- The new tests exist in the diff. Their pass or fail status was not
checked.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-16 23:52:44 -08:00
mastra-platform[bot]
4985b71a20
fix(playground-ui): run CodeDiff lines flush under the file header (#30668)
> Opened by @damien-schneider

## What

When the Factory changes panel stacks file diffs, a blank band shows
below each file's last line and above the next file's first line.
`@pierre/diffs` adds 8px of padding above the code, and by default it
always keeps room for a horizontal scrollbar under it. The design
system's `CodeDiff` places that code on the card fill, so both show up
as empty strips.

When a `CodeDiff` has a file header, it now sets a `data-header`
attribute. A matching rule in `code-diff.css`, next to the other
`--diffs-*` overrides, sets two of pierre's variables. pierre doesn't
set these itself, so the values reach the diff's shadow DOM:

- `--diffs-gap-block: 0px`: no padding above the first line or below the
last, and the "N unmodified lines" separators between hunks sit flush
too.
- `--diffs-overflow-override: auto`: the horizontal scrollbar only takes
room when lines overflow. Platforms with overlay scrollbars, like macOS,
reserve no room for it.

A `CodeDiff` without a header keeps its padding. That case is the
standalone diff in the observation detail view.

## Test plan

- [x] `vitest run src/ds/components/CodeDiff`: 6/6 pass
- [x] `oxlint` and `prettier --check` pass on the changed files
- [x] Storybook `Elements/CodeDiff` in Chromium with real scrollbars.
File list: 0px top and bottom padding and no scrollbar strip, where
before there was 8px of padding plus a 15px strip under every file. A
multi-hunk diff with overflowing lines: flush lines and separators, with
a scrollbar only on the diff that overflows. A diff without a header
keeps its 8px padding.
- [ ] Full `tsc` for `playground-ui` didn't finish in the sandbox. The
TSX change only adds a `data-header` attribute.


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

<!-- coderabbit-ai-generated:v1 -->

ELI5: When a code diff has a file name bar on top, the diff used to have
empty gaps. This change removes the gap under the bar. It also makes the
horizontal scrollbar appear only when the code is too wide.

## Summary

This change adjusts `CodeDiff` layout when a file header is present. The
outer container gets a `data-header` attribute. A CSS rule for that
attribute sets the block gap to `0px` and sets overflow to `auto`. Diffs
without a header are unchanged. A patch changeset for
`@mastra/playground-ui` documents the change.

## Changes

- `packages/playground-ui/src/ds/components/CodeDiff/code-diff.tsx`
(+5/-1): The root `div` sets `data-header` to an empty string when
`header` is provided. It sets the attribute to `undefined` otherwise.
The `ref` and class names are unchanged.
- `packages/playground-ui/src/ds/components/CodeDiff/code-diff.css`
(+7): Adds a comment and a `.code-diff[data-header]` rule. The rule sets
`--diffs-gap-block: 0px` and `--diffs-overflow-override: auto`.
- `.changeset/flush-diff-lines.md` (+5): Adds a patch entry for
`@mastra/playground-ui`. It states that headered diffs have no blank
band above the first line or below the last. It also states that the
horizontal scrollbar takes space only when lines overflow.

## Notes

- The diff does not set `padding-block: 0`, `scrollbar-width: thin`, or
any shadow-root selector. The PR objectives describe these, but the diff
does not contain them. This summary follows the diff.
- No exported or public declarations changed.
- Totals: 3 files changed, 17 lines added, 1 line removed.
- The PR objectives report that `vitest run src/ds/components/CodeDiff`
passed (6/6) and that `oxlint` and `prettier --check` passed. They also
report that full `tsc` did not finish. These results come from the PR
description. They were not re-run here.

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

---------

Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-16 23:51:12 -08:00
Eric Pinzur
135aa65c3c
fix(otel-bridge): deliver logs in apps on OpenTelemetry JS SDK 3 (#30546)
## Description

In an app on OpenTelemetry JS SDK 3, `OtelBridge` dropped every Mastra
log without an error. Spans were fine.

The bridge only looked for the app's global `LoggerProvider` in
`@opentelemetry/api-logs`. SDK 3 apps register theirs through `logs`
from `@opentelemetry/api` (1.10 and later), and the two registries don't
see each other, so the bridge got a no-op proxy.

The bridge now checks both registries on each log and each flush and
uses whichever holds a registered provider. SDK 2 apps keep working,
including when `@opentelemetry/api` 1.10 is installed next to SDK 2. A
provider registered after `new OtelBridge()` is picked up too. When
nothing is registered anywhere, the bridge says so once at debug level,
so a missing registration can be told apart from a bug.

```ts
// SDK 3 app
import { logs } from '@opentelemetry/api';
logs.setGlobalLoggerProvider(loggerProvider);

new OtelBridge(); // before: logs dropped. after: logs reach loggerProvider
```

Passing `new OtelBridge({ loggerProvider })` behaves as before.

The four new tests fail with the fix reverted. I also ran the built
bridge against the published `@opentelemetry/sdk-logs` 3.1.0 and
`@opentelemetry/api` 1.10.0 in a scratch project, and the log arrived
whether the provider was registered before or after the bridge was
constructed.

This does not move the package to SDK 3. That is tracked in #29696.

## Related issue(s)

Fixes #29695

## 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
- [ ] Test update

## Checklist

- [x] I have linked the related issue(s) in the description above
- [ ] 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

---
_Generated by [Claude
Code](https://claude.ai/code/session_018e9kMajbtR6UM1nrfYpvGa)_

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

<!-- coderabbit-ai-generated:v1 -->

**ELI5:** Mastra sends its logs through the app's OpenTelemetry setup.
On newer OpenTelemetry versions, the app registers its log sender in a
different place. Mastra looked only in the old place, so it lost every
log. This PR makes Mastra look in both places.

## Summary

This PR fixes `@mastra/otel-bridge` so it drops no logs in apps that use
OpenTelemetry JS SDK 3. The bridge now finds the global `LoggerProvider`
in either registry:

- `logs` from `@opentelemetry/api`, used by SDK 3 apps.
- `logs` from `@opentelemetry/api-logs`, used by SDK 2 apps.

### Changes

- **`observability/otel-bridge/src/bridge.ts`**
- Adds `globalLogsApis()`. It reads `logs` from the `@opentelemetry/api`
namespace object, not as a named import. This keeps the module linkable
on `@opentelemetry/api` versions below 1.10, which do not export `logs`.
The `api-logs` registry is always checked too.
- Adds `getGlobalLoggerProvider()`. It returns the first provider that
is not an unregistered proxy. It also returns whether a provider was
registered. The proxy check tests for a `_setDelegate` function.
- Adds `resolveLogger()`. When no `loggerProvider` is passed in config,
it re-reads the global provider on each log emit. This picks up
providers registered after the bridge is constructed. If the provider
changes, it rebuilds the logger.
- When no provider is registered, `resolveLogger()` writes one debug
message. The message is written once per bridge instance. It explains
how to register a provider or pass one to `new OtelBridge({
loggerProvider })`.
- `flush()` uses the same global lookup for the logger provider when no
`loggerProvider` is passed in config.
  - The constructor uses the same lookup for its initial logger.
- An explicit `loggerProvider` in config is unchanged. It is never
re-resolved.
- **`.changeset/quiet-logs-arrive.md`**: adds a patch changeset for
`@mastra/otel-bridge`.
- **`observability/otel-bridge/src/bridge.test.ts`**: adds tests. They
cover a provider registered through `@opentelemetry/api`, with
registration before and after bridge construction. They also cover
flushing that provider and the single debug message when no provider is
registered. The author reports that four new tests fail with the fix
reverted.

### Scope

- Only log delivery changes. Span handling is not changed.
- The package stays on the SDK 2 line. The move to SDK 3 is tracked
separately in `#29696`.
- The author reports a scratch-project check with
`@opentelemetry/sdk-logs` 3.1.0 and `@opentelemetry/api` 1.10.0. In that
check, the log arrived whether registration happened before or after
bridge construction. This check was not run in CI as part of this
review.

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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-17 12:52:26 +05:30
mastra-platform[bot]
c2fc2fca28
fix(factory): open the card's session from posted card links (#30666)
> Opened by @damien-schneider

## Summary

Factory card links that agents post (Slack replies, GitHub comments,
tool results like `factory_create_work_item` /
`factory_transition_work_item` / `factory_list_work_items`) opened the
board with `?item=<id>`. The UI treats that as a highlight on the board
list, so people landed on the list and had to find and click the card
again to reach its session.

`factoryWorkItemUrl()` now builds `/factories/<id>/cards/<workItemId>`.
That's the route a board click already uses: it redirects to the session
the card shows (the current phase's context, otherwise the most recently
visited one), or to a draft that starts one if the card has no session
yet. The `board` argument is gone because the card route resolves the
board on its own.

In-app board highlights (`?item=` from the attention list) stay as they
are.

## Test plan

- `mastracode/factory`: `links.test.ts`, `read-tools.test.ts`,
`work-item-tools.test.ts` updated to expect `/cards/<id>`. All 67 pass,
and `tsc --noEmit` is clean.
- `mastracode/factory-ui`: added a `CardDraftPage` MSW test showing that
`/cards/<id>` on a card with triage and work sessions, sitting in
Building, redirects to the work session's thread. The file's 12 tests
pass.


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

<!-- coderabbit-ai-generated:v1 -->

ELI5: When an agent posts a link to a work card, the link now opens that
card's work session. Before, it opened the board list. Readers now go
straight to the work they need.

## Summary

Posted card links now use the card route. `factoryWorkItemUrl()` returns
`/factories/<id>/cards/<workItemId>`. It no longer returns a board URL
with an `?item=<id>` query parameter.

The card route resolves the board, so the `board` input is removed from
`factoryWorkItemUrl()`. Its signature changes from `{ factoryProjectId,
board, workItemId }` to `{ factoryProjectId, workItemId }`.

The card route behaves as follows:
- It redirects to the session for the card's current phase when one
exists.
- If not, it redirects to the most recently visited session.
- If the card has no sessions, it opens a draft that starts a session.

### Changes by area

- **Link generation (`mastracode/factory/src/links.ts`):** Builds card
links from the project and work item IDs. The work item ID is
URL-encoded. The documentation describes the new routing.
- **Callers (`read-tools.ts`, `work-item-tools.ts`):** Stop passing the
board key to `factoryWorkItemUrl()`. Board-based stage validation and
transitions still use the work item's board.
- **Tests (`links.test.ts`, `read-tools.test.ts`,
`work-item-tools.test.ts`):** Expect `/cards/<id>` URLs. The
no-public-URL case expects `undefined`.
- **UI test
(`mastracode/factory-ui/src/ui/pages/__tests__/CardDraftPage.msw.test.tsx`):**
Adds a test. A card with `triage` and `work` sessions in the `execute`
stage redirects to the thread for the `work` session.
- **Changeset (`.changeset/card-links-open-session.md`):** Declares a
patch release for `@mastra/factory`.

Board highlights in the in-app attention list are unchanged.

### Scope

8 files changed, 47 lines added, 21 lines removed.

### Test status

The PR author reports these results. This summary does not verify them
against completed CI checks on the current head:
- `mastracode/factory`: 67 tests pass in the updated files. `tsc
--noEmit` is clean.
- `mastracode/factory-ui`: 12 tests in `CardDraftPage.msw.test.tsx`
pass.

### API impact

`factoryWorkItemUrl()` has a breaking signature change for direct
callers. The `board` input is removed. The changeset is a patch release.

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

Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-16 23:08:59 -08:00
Damien Schneider
ec3fd034e5
feat(factory): let org admins create skills for one Factory (#30647)
## Description

Factory could edit the skills an app already ships (#29042), but it
couldn't create new ones. Settings › Skills now has a **New skill**
button. An org admin enters a name, description and instructions, and
the skill belongs to that one Factory. No redeploy is needed. Agents
load it from their next session, and a board phase can run it as
`runner.skill`. Created skills show a **Custom** badge and can be edited
or deleted from the same dialog.

What changed:

- **Storage:**
- `factory_skill_overrides` gets an additive `kind` column (`edit` |
`created`). It defaults to `edit`, so existing rows keep working. I
checked that an existing Postgres table upgrades in place.
- `create()` and `updateCreated()` run under the existing revision-row
lock. A second create of a name returns null, and so does a save that
lands after a delete, so a late save doesn't bring the skill back.
- **Sessions:**
- Created skills come from the snapshot each workspace already loads for
edits, so there is no new query on the session path.
- `FactorySkillSource` serves a created skill when no code, folder or
built-in skill has a `SKILL.md` under that name. It also reserves the
name, so a repository skill with the same name stays hidden.
- A folder or file the app left behind under the name doesn't hide a
created skill.
  - Edits whose original skill was removed stay hidden, as before.
- **API:**
- `POST /web/factory/projects/:id/skills` with `{ name, content }`
creates a skill. It returns 409 `skill_exists` when an app skill or
another created skill already uses the name.
- `PUT /web/factory/projects/:id/skills/:name` updates a created skill,
and `DELETE` on the same path deletes one, returning `{ skill: null }`.
- Responses are built from the row that was written, not from a reread.
- Admins only. New audit actions: `factory.skill.created` and
`factory.skill.deleted`.
- **Boards:**
- Board validation and board problems count the project's created
skills, so a phase can run one.
- The board cache rechecks when the project's skill revision moves. If
the names can't be read, the boards still load, flag the skill as
missing, and aren't cached.
- A board *write* that can't read the names fails with the storage error
instead of `unknown_skill`.
- `upsertBoard()` checks each project listed in `projects`. A board for
`'all'` projects may only run app skills.
- **CLI:** new `mastra api factory skill create`. Route metadata is
regenerated.
- **UI:**
- New skill dialog, which reuses `SkillSimpleForm` with an editable name
and checks the name format client-side. The name is quoted in the
SKILL.md it writes, so names like `123` work.
  - **Custom** badge on the Skills page and the phase page.
  - **Delete** with an inline confirmation.

If an app later ships a skill with the same name, the app's skill takes
over the name and the Factory's text becomes an edit of it. It keeps
applying, the editor shows "original changed", and **Revert to
original** switches to the app's skill. Nothing is lost.

One review suggestion is deliberately not applied. CodeRabbit suggested
wiring the board cache's skill reader even when the `skill-overrides`
domain isn't ready at boot. Sessions get skill edits under the same
boot-time readiness check (`factory.ts`, where the workspace factory is
built). Changing only boards would let a board accept a skill that
sessions can't load, so both keep that check.

⚠️ **Before release:** `factory.skill.created` and
`factory.skill.deleted` must be registered in the WorkOS dashboard
(Audit Logs → Events), like the edit actions were.

## Related issue(s)

None. Follow-up to #29042 (skill edits) and #28823 (custom board
skills).

## 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)
- [x] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update

## Test plan

All new tests use real storage and real routes, with no mocked storage.
I checked that each fix's test fails without that fix.

- **Storage (LibSQL and Postgres):**
  - create once per name, including under concurrency
  - `updateCreated` refuses after a delete, and never touches edits
  - an orphaned edit gives way to a created skill
  - an existing table upgrades in place
- **Routes:**
  - create, update and delete, each with its audit event
  - 409 for app-skill and duplicate names
  - 400 for an invalid SKILL.md or name
  - 403 for non-admins, and 404 for another org's project
  - an all-digit name works
- responses stay correct when another admin deletes the skill
mid-request
  - a created skill becomes an edit once the app ships the same name
- **Sessions:**
- the creating project's sessions load the skill, and another project's
don't
  - a delete reaches new and reused workspaces
  - a repository skill with the same name is hidden
  - a leftover folder or stray file doesn't hide the created skill
- **Boards and `upsertBoard()`:**
- a phase running a created skill is accepted, and flagged missing after
a delete
  - a names read that fails once recovers on the next load
  - a write fails with the storage error
  - named projects are each checked, and `'all'` stays app-only
- **UI (MSW):**
- create sends the expected SKILL.md (quoted name) and shows **Custom**
- an invalid name keeps Create disabled, and a 409 message shows in the
dialog
  - non-admins get no button
  - delete asks for confirmation
- **Results:**
- `@mastra/factory`: `check` and `lint` pass, and 32 focused test files
(920 tests) pass.
- `factory-ui`: `typecheck`, `test:unit` and the skills and board-config
MSW tests pass.
  - CLI descriptor test passes.
  - Not tried in a running Factory in a browser yet.

## Checklist

- [ ] I have linked the related issue(s) in the description above
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR

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

https://claude.ai/code/session_01VhgyDSnuLvveDjDQduz1fT

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

<!-- coderabbit-ai-generated:v1 -->

ELI5: Organization admins can now create a new skill for one Factory
project without a new app release. Sessions and board phases can then
use that skill. Admins can also edit or delete it.

## Overview

This change adds Factory-scoped skills. Admins create them in the UI or
the CLI. A created skill belongs to one Factory project. Admins can edit
and delete it. The skill works in sessions, board phases, and board
validation.

## Storage

- `SkillOverridesStorage` adds a `kind` field to each record. Valid
values are `edit` and `created`. The database default is `edit`.
- `upsert` accepts an optional `kind`. The default is `edit`.
- The new `create` method stores a created skill with an empty
`baseHash`. If a created skill with the same name exists, `create`
returns `null` and does not change the revision. Otherwise, it replaces
any existing row and increments the project revision in one transaction.
- `updateCreated` saves changes only to an existing created skill.
Otherwise, it returns `null`.
- The audit `skill` action list adds `created` and `deleted`.

## Catalog and sessions

- `FactorySkillInfo.origin` adds the value `project`. It adds optional
`created` metadata with `updatedBy` and `updatedAt`.
- `listFactorySkills` includes created overrides whose names do not
match an original skill. It sorts the combined list by name.
- A name that matches an original skill appears as an edit to that
original skill.
- The new `projectSkillNamesOf` adapter returns the storage revision and
the created-skill names for a board scope.
- `workspace.ts` adds an optional `created` flag to
`FactorySkillOverride`. Created skills appear as directories that
contain `SKILL.md`. Created skill names are excluded from repository
skills.

## Boards

- `ProjectBoardCache` accepts a `projectSkills` provider. It stores the
skill revision with each board check. It rechecks board skill problems
when the revision changes.
- If reading project skill names fails, the cache logs one warning per
project. It compiles with an empty set. It records an unreadable
revision so the next load retries.
- `findBoardSkillProblems` accepts a `projectSkills` set. A runner skill
that matches a project skill name counts as found.
- `BoardWrites.validate` accepts an optional `projectSkills` set. Board
create, replace, and validate paths pass it.
- `MastraFactory.upsertBoard` checks each named project against that
project's skill names. A board for `'all'` projects can use only app
skills.
- `factory.ts` supplies the resolver only when the `skill-overrides`
storage domain is ready.

## API

- The new `skillCreate` route is `POST
/web/factory/projects/:id/skills`. Its body schema checks the name and
content.
- The create handler returns `409` when the name matches an original
skill or when storage reports a conflict. Otherwise, it returns `201`
with the catalog entry.
- Edit works for a skill that has an original or an existing override of
kind `created`.
- Revert of a created skill deletes it, audits `factory.skill.deleted`,
and returns `skill: null`.

## CLI

- `mastra api factory skill create` uses the `skillCreate` route and
requires JSON input.
- The `update` and `revert` descriptions now cover project-created
skills.

## Factory UI

- `FactorySkillsSection` shows a **New skill** button when `factoryId`
is set and `canEdit` is true. It shows a **Custom** badge for
`project`-origin skills. `PhaseConfig` shows the same badge.
- `FactorySkillEditorDialog` supports create and edit. Its `skill` prop
is optional. Names allow lowercase letters and digits separated by
single hyphens, up to 64 characters. The description must be nonempty
after trimming.
- For project-origin skills, the dialog offers delete with confirmation.
Confirming calls the edit mutation with `content: null`.
- `useFactorySkillCreateMutation` is added. The edit and create
mutations invalidate the skills and board catalog queries.

## Notes

- If an app later ships a skill with the same name, the app skill takes
over the name. The Factory text remains as an edit. Reverting it removes
the Factory text.
- `factory.skill.created` and `factory.skill.deleted` must be registered
in WorkOS before release. The PR objectives state this requirement. The
diff does not verify it.

## Test coverage

- Storage tests cover create, the duplicate case, kind preservation on
upsert, replacement of an edit, and six concurrent creates that yield
one result.
- Route tests cover creation and audit records, edit and delete of
created skills, conflicts, invalid content, permission checks, and
app-skill takeover.
- Workspace tests cover session visibility, reuse, other projects, and
deletion.
- Board tests cover unknown-skill refusal and recovery after creation or
deletion.
- UI MSW tests cover creation, invalid names, duplicate-name errors,
admin-only access, and confirmed deletion.
- The PR author reports these results. This review did not verify them
against the current head:
  - `@mastra/factory` `check` and `lint` pass.
  - Focused suites pass across 32 files and 911 tests.
  - `factory-ui` `typecheck` and `test:unit` pass (776 tests).
  - The CLI descriptor test passes.

## Review metrics

- Files changed: 28. Lines added: 1447. Lines removed: 163.
- Review findings: not available.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-16 23:08:01 -08:00
dane-ai-mastra[bot]
f346f6c4af
chore: version packages (alpha) (#30660)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @mastra/core@1.84.0-alpha.6

### Minor Changes

- Knowledge storage can supply scope declarations, access rules
included. ([#29428](https://github.com/mastra-ai/mastra/pull/29428))

A store returns declarations from `getScopeDeclarations()` (none by
default). Knowledge merges them under its config's: the config wins on a
key both declare, and a declaration that doesn't compile is skipped with
a warning. When stored scopes come from a skipped declaration, the
declaration check's error names that declaration and why it was skipped,
so it can be fixed in the store. The store's answer is reused for 30
seconds and read again after `renameScopeDeclaration`, so a declaration
the store adds, removes or changes (access rules included) applies
within that window without a store read on every call. Revoking access
through the store can therefore take up to 30 seconds to take effect.

  ```ts
  class ImportingKnowledgeStorage extends InMemoryKnowledgeStorage {
    override async getScopeDeclarations() {
      return {
        'imports:$name': {},
'linear:$account:$connection': { access: [{ principal: 'imports:all',
role: 'viewer' }] },
      };
    }
  }
  ```

Runs that hold `imports:all` then read every Linear connection's pages.
## @mastra/platform@0.1.0-alpha.1

### Minor Changes

- Added `PlatformBrowser`, a Stagehand browser backed by a Mastra
Platform browser session. By default it provisions a session with `POST
/v1/browsers/sessions` on the Platform and connects to the returned CDP
URL; pass `cdpUrl` to connect to a session you already provisioned, with
no token or API call. The access token falls back to
`MASTRA_PLATFORM_ACCESS_TOKEN` / `MASTRA_PLATFORM_SECRET_KEY`, the
project to `MASTRA_PROJECT_ID`, and the API URL to
`MASTRA_BROWSER_API_URL`. `@mastra/platform` now depends on
`@mastra/stagehand` at runtime.
([#29428](https://github.com/mastra-ai/mastra/pull/29428))

  ```ts
  import { PlatformBrowser } from '@mastra/platform';

const agent = new Agent({ name: 'browser-agent', model, browser: new
PlatformBrowser() });
  ```

- Added `@mastra/platform`: hosted Mastra Platform Memory and Knowledge
clients, with Platform Sandbox and Filesystem re-exported from
`@mastra/platform-workspace`. `PlatformMemory` is a drop-in `memory` for
`Agent` that loads observations and recent messages from a Platform
Memory instance and saves each turn back; observation and reflection run
on the Platform. `PlatformMemoryClient` exposes the same API directly.
Credentials fall back to `MASTRA_PLATFORM_ACCESS_TOKEN` /
`MASTRA_PLATFORM_SECRET_KEY`. `PlatformMemory` uses
`MASTRA_MEMORY_INSTANCE_ID`; `PlatformKnowledge` uses
`MASTRA_KNOWLEDGE_INSTANCE_ID`. `PlatformKnowledge` takes every scope
declaration and access rule from its instance, Memory's and Platform
importers' included, and has no `scopes` option. Agents read imported
pages when their runs hold the scope an importer's rule grants (for now
`imports:all`).
([#29428](https://github.com/mastra-ai/mastra/pull/29428))

  ```ts
import { PlatformMemory, PlatformKnowledge, PlatformSandbox,
PlatformFilesystem } from '@mastra/platform';

const agent = new Agent({ name: 'assistant', model, memory: new
PlatformMemory() });
  ```

### Patch Changes

- `PlatformKnowledge` now supports listing pins: `knowledge_pin` with
`kind: 'list'` pins a page's listing on hosted Knowledge instead of
refusing it as an old storage adapter.
([#29428](https://github.com/mastra-ai/mastra/pull/29428))

- `PlatformMemory` fixes for read-only runs and working memory:
([#29428](https://github.com/mastra-ai/mastra/pull/29428))

- A read-only run (`memory: { options: { readOnly: true } }`) now sees
the thread's observations and unobserved messages, read through the
Memory instance's read-only context route. Before, it got no stored
context at all. It still saves nothing and starts no observation.
- The `workingMemory` option now delivers what it says: `readonly` and
`tool` add the resource's stored working memory to each run's prompt,
read fresh each run; `tool` also tells the agent to update it with
`updateWorkingMemory`; `off` leaves it out. Before, stored working
memory never reached the prompt in any mode.

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6

See [release notes](https://github.com/mastra-ai/mastra/releases) for
published changes.
## @mastra/client-js@1.60.1-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
## @mastra/react@1.15.1-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/client-js@1.60.1-alpha.6
## @mastra/deployer-cloud@1.84.0-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/deployer@1.84.0-alpha.6
## @mastra/longmemeval@1.1.43-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
## @mastra/opencode@0.1.43-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
## @mastra/factory@0.29.0-alpha.7

### Patch Changes

- The **Activity** sort in the Factory sidebar now orders sessions that
share a status by their last update instead of their creation date, the
same as **Last updated** does. An older session that was updated since
no longer sinks below a newer one that was left alone.
([#30656](https://github.com/mastra-ai/mastra/pull/30656))

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/code-sdk@1.19.1-alpha.7
## create-factory@0.5.0-alpha.6

### Patch Changes

- Updated dependencies
[[`bfcb0f7`](bfcb0f738d),
[`383a19d`](383a19d047)]:
  - mastra@1.40.0-alpha.6
## @mastra/code-sdk@1.19.1-alpha.7

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/client-js@1.60.1-alpha.6
## mastracode@0.50.1-alpha.7

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/code-sdk@1.19.1-alpha.7
## mastra@1.40.0-alpha.6

### Patch Changes

- The Factory sidebar now groups sessions by board and shows a second
line under each session by default, with when it last changed and its
pull request. Turn on **Compact view** or set **Group** to **None** in
the sidebar's properties menu to get one line per session or a single
list back. Settings you already changed keep their values; the rest
follow the new defaults.
([#30656](https://github.com/mastra-ai/mastra/pull/30656))

- Factory **Settings** now shows theme and completion sound on **My
account**, next to your profile and log out, instead of on a separate
**Preferences** page. Settings opens on **My account**, and old
Preferences links go there.
([#30658](https://github.com/mastra-ai/mastra/pull/30658))

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/deployer@1.84.0-alpha.6
## @mastra/deployer@1.84.0-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/mcp-docs-server@1.3.14-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
## @mastra/playground-ui@69.1.0-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/client-js@1.60.1-alpha.6
  - @mastra/react@1.15.1-alpha.6
## @mastra/server@1.84.0-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
## @mastra/elysia@0.1.24-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/express@1.5.28-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/fastify@1.5.28-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/hono@1.7.26-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/koa@1.7.28-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/nestjs@0.3.1-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/next@0.2.42-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/hono@1.7.26-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/tanstack-start@0.2.42-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/hono@1.7.26-alpha.6
  - @mastra/server@1.84.0-alpha.6
## @mastra/temporal@0.6.1-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/deployer@1.84.0-alpha.6
## create-mastra@1.40.0-alpha.6


## @internal/playground@1.40.0-alpha.6

### Patch Changes

- Updated dependencies
[[`0eb407e`](0eb407ebcc)]:
  - @mastra/core@1.84.0-alpha.6
  - @mastra/client-js@1.60.1-alpha.6
  - @mastra/react@1.15.1-alpha.6
  - @mastra/playground-ui@69.1.0-alpha.6

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-17 00:01:31 -07:00
107 changed files with 2292 additions and 501 deletions

Some files were not shown because too many files have changed in this diff Show more