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

63 commits

Author SHA1 Message Date
Ward Peeters
b2ce66cef8
chore: run lint-staged for root files and the 16 packages without a config (#29898)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-10 14:08:55 +01:00
Dane - AI (Mastra)
40a522c142
chore(deps): update build tools (#27997) 2026-10-22 14:33:21 +02:00
dane-ai-mastra[bot]
4c22623ea3 chore: version - exit prerelease mode 2026-10-21 11:26:39 +00:00
Max Katz
9a423dae48
refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
dane-ai-mastra[bot]
a15924e709 chore: version packages 2026-10-16 04:04:12 +00:00
dane-ai-mastra[bot]
8b35a6c1d6 chore: version - exit prerelease mode 2026-10-01 08:22:20 +00:00
dane-ai-mastra[bot]
b782191b6c chore: version packages 2026-09-30 16:07:15 +00:00
Ward Peeters
bc826e8fb1
refactor: use Web Crypto where synchronous contracts stay intact (#25462)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-30 09:45:11 +02:00
dane-ai-mastra[bot]
429d7b9f93 chore: version - exit prerelease mode 2026-09-22 10:43:03 +00:00
dane-ai-mastra[bot]
28f5aa46d1 chore: version packages 2026-09-19 04:05:35 +00:00
Tyler Barnes
8808c0e8da
fix(github-signals): resolve gitcrawl credentials from the gh CLI
An expired GitHub token exported in the environment made PR syncing fail with a 401, even when `gh` could still resolve a working credential. gitcrawl takes the first non-empty value of `GITHUB_TOKEN` and only finds out it is invalid when GitHub rejects it, so the stale value was sent on every call. That is easy to hit in a long-lived session, where a wrapper exports an installation token that expires after an hour and never refreshes.

Each sync now resolves a fresh credential from the `gh` CLI and passes it to gitcrawl, so the exported value is never consulted. `gh auth token` is asked with `GH_TOKEN` and `GITHUB_TOKEN` removed from the child environment — in every casing, since Windows treats environment names case-insensitively — because `gh` returns those variables verbatim and would otherwise hand back the same credential being replaced.

The author permission and GitHub app owner lookups use the same credential. Both spawn `gh` without options and inherited the same stale token: the app owner lookup swallowed the resulting 401 into `undefined`, which made authorization read as "not authorized" and silently disabled permission gating instead of reporting an error.

Verified against the real `gh` and `gitcrawl` binaries with a stale token exported, alongside focused unit tests, the package test suite, typecheck, lint, and format checks.
2026-09-18 14:43:06 -07:00
dane-ai-mastra[bot]
d530790829 chore: version packages 2026-09-17 16:05:14 +00:00
Tyler Barnes
4ab64af6a6
feat(github-signals): authorize bots by GitHub App ownership (#24246)
GitHub Signals can now accept comments from unlisted GitHub App bots
when the app is owned by the repository organization or by a user with
an authorized repository permission. Explicit ignore entries still win,
and failed or unsupported owner lookups remain denied.

This keeps `authorizedBots` as the explicit allowlist, reuses
`authorizedPermissions` for user app owners, and caches successful owner
lookups for 24 hours. It includes focused tests, documentation, and a
minor changeset.


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

GitHub Signals can now recognize comments from certain GitHub App bots
without listing every bot manually. It trusts apps owned by the
repository organization or by users with sufficient repository access,
while keeping explicit blocks effective.

## Changes

- Added `GithubAppOwnerResolver` to resolve GitHub App owners with `gh
api apps/{slug}`.
- Cached successful owner lookups for 24 hours.
- Authorized organization-owned apps when the owner matches the
repository organization.
- Authorized user-owned apps through `authorizedPermissions`.
- Preserved `authorizedBots` as the explicit allowlist.
- Applied explicit ignore entries before all other checks.
- Denied unresolved, unsupported, malformed, or failed owner lookups.
- Prevented stale polling generations from authorizing comments or
writing cache entries.
- Used `raw_json.submitted_at` for GitHub review timestamps when needed.
- Added focused tests for owner resolution, caching, authorization,
denial, cancellation, and review snapshots.
- Updated GitHub Signals documentation and added a changeset.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: remy-builder[bot] <4813995+remy-builder[bot]@users.noreply.github.com>
2026-09-16 22:54:32 -07:00
dane-ai-mastra[bot]
871bdaa595 chore: version - exit prerelease mode 2026-09-15 09:04:59 +00:00
dane-ai-mastra[bot]
2228df8a00 chore: version packages 2026-09-15 04:05:06 +00:00
Tyler Barnes
502ca89048
fix(notifications): mark viewed notifications seen and bound inbox listings (#23710)
The `notification_inbox` tool had no way for notifications to leave
`pending` unless the agent called `markSeen`/`dismiss` one id at a time.
Notifications that were only surfaced through a summary digest stayed
pending forever, so every `list` returned the whole backlog. In one live
session that was 96 GitHub records (~360KB of JSON) in a single tool
result, which pushed the thread straight past the observational-memory
threshold and forced a synchronous observation every turn.

Now viewing a notification counts as reading it. `list`, `read`, and
`search` mark the returned unread records seen, `list` defaults to
unread records and a page of 20, and the response reports `hasMore` and
`markedSeen`. Internal `metadata` / `payload` bookkeeping is dropped
from the agent-facing records.

Before, every call returned everything, forever:

```ts
await tool.execute({ action: 'list' });
// { notifications: [ /* all 96, full metadata, still pending */ ] }
await tool.execute({ action: 'list' });
// same 96 again
```

After, repeated lists drain the backlog:

```ts
await tool.execute({ action: 'list' });
// { notifications: [ /* 20, status: 'seen', no metadata/payload */ ], hasMore: true, markedSeen: 20 }
await tool.execute({ action: 'list' });
// { notifications: [ /* next 20 */ ], hasMore: true, markedSeen: 20 }
```

On the GitHub side, PR notification records were mirroring every
agent-facing field (title, state, comment excerpt, full check objects)
into `metadata.github` on top of `attributes`, roughly doubling each
record. `metadata.github` now only keeps the sync bookkeeping the change
detector needs. Check names live in `attributes` as flat strings since
signal attributes are rendered with `String(value)`, and failing checks
get a `failingCheckUrls` attribute so the agent can link to the run.
`GithubSignalAgent.sendNotificationSignal` is now typed with
`SendNotificationSignalInput` instead of `unknown` so a non-scalar
attribute fails typecheck.

```ts
attributes: {
  ciState: 'failure',
  failingChecks: 'Quality assurance',
  failingCheckUrls: 'Quality assurance: https://github.com/mastra-ai/mastra/actions/runs/1',
}
```

Tests cover the drain (25 pending → 20 + 5 disjoint pages → empty), the
`markedSeen` count when a status write fails, the stripped projection,
and that every GitHub notification attribute is a scalar. Verified with
`packages/core` notifications + agent-signals suites, `signals/github`,
and `mastracode/sdk` extra-tools, plus typecheck and lint on the touched
packages.


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

When an agent views notifications, the tool marks them as seen. It shows
unread notifications first, supports paging, and hides internal data
from agent responses.

## Changes

- Updated `notification_inbox`:
  - Defaults `list` to unread notifications.
  - Returns pages of 20 notifications.
  - Reports `hasMore` and `markedSeen`.
- Marks returned unread notifications as seen for `list`, `read`, and
`search`.
  - Requires a search query for `search`.
  - Requires a non-empty `id` for `markSeen`, `dismiss`, and `archive`.
  - Omits internal `metadata` and `payload` fields.
  - Reports only successfully updated notifications as seen.
- Updated GitHub notifications:
  - Stores agent-facing fields as scalar attributes.
  - Removes duplicated fields from `metadata.github`.
  - Adds `failingCheckUrls` for failed checks.
  - Preserves review-mode change-detection fields.
  - Uses the typed `SendNotificationSignalInput`.
- Added patch changesets for `@mastra/core` and
`@mastra/github-signals`.
- Expanded tests for pagination, backlog draining, status-write
failures, response projections, whitespace-only IDs, schema validation,
and GitHub attributes.
- Updated related SDK expectations and package test, typecheck, and lint
coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-14 13:11:35 -07:00
Tyler Barnes
2990bccd1c
fix(core): restore live signal delivery and AGENTS.md loading (#23554)
PR #23214 introduced a patch-level breaking change by suppressing
reactive and system-reminder events from live streams without an opt-in.
This restores the previous default and adds caller-local `hideSignals`
for streams, thread subscriptions, and memory recall. Model context,
storage, transforms, and other subscribers remain unchanged; recall
keeps its existing defaults. Shared execution options accept
`hideSignals` on `generate()` and `resumeGenerate()` without filtering
their results.

```ts
const output = await agent.stream('Review the changes', {
  hideSignals: ['reactive', 'system-reminder'],
});
```

Separately, fixes AGENTS.md discovery when completed tool results move
between message sets. Instruction lookup scans newest-first,
deduplicates covered paths, and preserves trusted-ref isolation across
filesystem aliases. Observational memory behavior is unchanged.

Verified with focused core, memory, SDK, and consumer suites; terminal
E2E checks for instruction loading and notifications; and clean-HEAD
CLI/built-package proofs for injection, live visibility, independent
filtering/replay, and recall. The latest cleanup additionally passes 214
focused runtime tests, type/parity checks, and the docs production
build, including regular/durable generate and resume no-op coverage.


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

Live streams now show important updates by default. Callers can hide all
or selected signal types without changing saved data, model context, or
generated results. The PR also improves `AGENTS.md` discovery when tool
results move or use filesystem aliases.

## Changes

- Restored `reactive` and `system-reminder` signals in live, replayed,
durable, and thread streams.
- Added caller-local `hideSignals` filtering for streams, thread
subscriptions, and `Memory.recall()`.
- Supported boolean and selected signal-type filters with legacy
signal-name normalization.
- Preserved unfiltered signals for model context, storage, transforms,
shared fanout, and aggregate results.
- Added `hideSignals` support to `generate()` and `resumeGenerate()`
without filtering their results.
- Preserved deprecated `includeSystemReminders` behavior and precedence
rules.
- Improved instruction discovery with newest-first scanning, moved
tool-result handling, path deduplication, filesystem identity
resolution, and trusted Git-reference paths.
- Added documentation and runtime, memory, SDK, type, CLI, terminal E2E,
built-package, and documentation coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-10 17:14:50 -07:00
Abhi Aiyer
4337eb6230
test: align signal expectations with hidden reminders (#23290)
## Summary

- update stale processor and GitHub Signal tests to stop expecting
reactive system reminders in live chunk streams
- update the CLI dev fixture for the current `statSync`-based entry-file
lookup
- align the Mastra Code goal-handoff E2E assertion with the rendered
plan UI

These test corrections unblock verification of #23189 without changing
its provider-metadata implementation.

## Test plan

- focused Core processor and workflow tests (172 passed)
- CLI unit suite (1,107 passed)
- GitHub Signals suite (104 passed)
- AI SDK helper tests (19 passed)
- Core MessageList v6 tests (25 passed)
- focused `plan-approval-goal-handoff` Mastra Code E2E (passed)
- Core, CLI, and Mastra Code typechecks
- Prettier, Oxlint, and `git diff --check`


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

## ELI5

This PR keeps tool information intact when messages travel between
Mastra and the AI SDK. It also updates tests and fixtures to match
current stream and UI behavior.

## Changes

- Preserve tool-result `providerMetadata`, including
`mastra.modelOutput`, across AI SDK v5 and v6 conversions.
- Merge tool-call and tool-result metadata, with result metadata taking
precedence.
- Detect v6 messages that contain `resultProviderMetadata`.
- Add regression tests for metadata preservation, merging, and omission
when absent.
- Add patch changesets for `@mastra/core` and `@mastra/ai-sdk`.
- Update processor and GitHub Signal tests to expect no reactive
`data-signal` stream chunks.
- Update the CLI development fixture for `statSync` file detection.
- Align the Mastra Code goal-handoff test with the current rendered plan
flow.
- Update the goal-step test to verify persisted feedback without live
signal output.

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

---------

Co-authored-by: Lucas Pradel <169302645+pradelgorithm@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-07 21:11:30 -07:00
dane-ai-mastra[bot]
c19a93b095 chore: version - exit prerelease mode 2026-09-03 04:02:53 +00:00
dane-ai-mastra[bot]
e6de774069 chore: version packages 2026-09-02 16:20:22 +00:00
Lennart
e983f74987
chore(*): Update/unify/add READMEs (#22858)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-09-02 14:36:59 +02:00
dane-ai-mastra[bot]
fc968c8a9b chore: version packages 2026-09-01 16:28:50 +00:00
Lennart
28ce924276
chore(*): Remove CHANGELOG.md from npm files (#22737) 2026-09-01 10:47:20 +02:00
dane-ai-mastra[bot]
2190302152
chore: version packages (alpha) (#22605)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 11:48:29 -07:00
Tyler Barnes
604da153fe
feat: add multi-PR GitHub signal subscriptions (#22407)
This adds multi-PR GitHub signal subscriptions so a thread can follow
several PRs at once from the TUI or through the GitHub signal tools.

The GitHub command now opens a small menu with subscribe, unsubscribe,
list, token, poll interval, sync, and debug actions. Subscribe uses a
picker with “my PRs” and repo search, supports space-to-select multiple
PRs, and shows a loading state while `gh pr list` runs. Existing inline
commands still work, including review/working mode:

```txt
/github subscribe mastra-ai/mastra#123 --mode review
/github unsubscribe mastra-ai/mastra#123
/github sync
/github debug
```

The agent tools now use a clearer batch shape instead of mixing legacy
top-level PR fields:

```json
{
  "prs": [
    { "owner": "mastra-ai", "repo": "mastra", "number": 123 },
    { "owner": "mastra-ai", "repo": "mastra", "number": 456 }
  ],
  "mode": "working"
}
```

Unsubscribe supports the same `prs` array or `all: true`. Stored
subscription data remains backward compatible, including older
subscriptions without a mode or dedupe key.

This also adds poll interval settings, shows `2 PRs` in the status line
when multiple PRs are followed, filters low-value bot comments like
CodeRabbit “review skipped”/change-stack noise, and avoids re-sending
the same latest comment notification when only PR bookkeeping changes.

Verified with focused provider, SDK, TUI, and GitHub e2e coverage after
rebasing onto latest main.

<img width="1952" height="826" alt="image (52)"
src="https://github.com/user-attachments/assets/9c0977a0-c9ab-490f-bdd5-3a02fe7a3c9b"
/>
<img width="1498" height="866" alt="image (53)"
src="https://github.com/user-attachments/assets/4abea093-43be-4fa8-8bd0-4abab7b66a00"
/>


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

This PR lets users track several GitHub pull requests at once. It adds
menus and search tools to manage subscriptions, reduces duplicate or
unhelpful notifications, and keeps existing subscriptions working.

## Changes

- Added multi-PR subscribe and unsubscribe support through GitHub tools
and TUI commands.
- Added GitHub Signals actions for subscribe, unsubscribe, list,
unsubscribe all, token help, poll interval, sync, and debug.
- Added a searchable PR picker with “My open PRs” and repository search
views.
- Added configurable polling intervals with validation and persistence.
- Added batch tool inputs through a `prs` array with per-PR results and
subscription summaries.
- Preserved legacy ownerless subscription IDs, inline commands, and
review/working modes.
- Rejected ambiguous ownerless legacy PR IDs when multiple
repository-qualified candidates exist.
- Filtered repetitive low-value bot comments.
- Prevented duplicate notifications for unchanged latest comments.
- Invalidated active polling before subscription updates and restarted
polling when subscriptions remained.
- Updated the status line to show one PR number or a count of active
subscriptions.
- Added provider, SDK, TUI, settings, and end-to-end coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-08-31 10:30:07 -07:00
dane-ai-mastra[bot]
3cd96a3c5a chore: version - exit prerelease mode 2026-08-26 10:43:02 +00:00
dane-ai-mastra[bot]
73fa1abed0
chore: version packages (alpha) (#22320)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-25 18:03:44 -07:00
Daniel Lew
15f92d02bc
feat: add intent-aware GitHub PR subscriptions (#21542)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-08-25 16:41:13 -04:00
dane-ai-mastra[bot]
387c6b7f5a chore: version - exit prerelease mode 2026-08-12 04:41:36 +00:00
dane-ai-mastra[bot]
361c421ca2 chore: version packages 2026-08-10 04:36:45 +00:00
Jamie Nichols
1315d8f17e
feat(mastracode): let plugins contribute processors and signal providers (#20848)
Co-authored-by: Mastra Code (anthropic/claude-opus-5) <noreply@mastra.ai>
2026-08-09 16:32:00 -07:00
Jamie Nichols
32980a3e24
fix: drive deferred notification stream options through the delivery policy (#21113)
Co-authored-by: Mastra Code (anthropic/claude-fable-5)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
2026-08-09 16:24:41 -07:00
dane-ai-mastra[bot]
ac0a3b8bcd
chore: version packages (alpha) (#20769)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-07 17:59:10 -07:00
Damien Schneider
b9dab92feb
chore(github-signals): format index.ts (#20986) 2026-08-07 14:08:51 -07:00
STN2H4
9168b80120
fix(github-signals): cancel stale polling side effects (#20593)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-08-07 13:25:44 -07:00
dane-ai-mastra[bot]
ca935ef6de chore: version - exit prerelease mode 2026-08-05 20:21:53 +00:00
Roamin
92be47fbd2
fix(core): stop @mastra/ai-sdk/ui crashing in browser bundles (#20760)
Co-authored-by: Mastra Code (anthropic/claude-fable-5)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
2026-08-05 12:54:21 -07:00
林SO
0c1b8405fd
fix(github-signals): suppress noisy activity notifications (#20736) 2026-08-05 11:13:59 -07:00
dane-ai-mastra[bot]
b4c8440eef chore: version - exit prerelease mode 2026-08-05 00:05:07 +00:00
dane-ai-mastra[bot]
c5984b48f8 chore: version packages 2026-07-31 05:11:36 +00:00
Shane Thomas
5cbfdaae75
fix(github-signals): resolve gitcrawl db path across platforms (#19465)
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
2026-07-30 21:58:37 +02:00
Ward Peeters
d271d37f30
chore: migrate package builds to tsdown (#19829)
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-07-28 12:32:21 +02:00
Ward Peeters
bdeaef58f0
chore: migrate linting to oxlint (#20173)
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-07-25 01:04:02 +02:00
Ward Peeters
3a507cbd42
chore: migrate repository formatting to oxfmt (#19807)
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-07-24 16:18:33 +02:00
Dane - AI (Mastra)
a4620cae04
chore(deps): update formatting & linting (#19388)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: wardpeet <ward@coding-tech.com>
2026-07-20 16:13:28 +02:00
dane-ai-mastra[bot]
57566498b5 chore: version - exit prerelease mode 2026-06-26 19:51:28 +00:00
dane-ai-mastra[bot]
fdbb7ea66d chore: version packages 2026-06-24 05:18:33 +00:00
Tyler Barnes
fbeda0c0f3
fix: preserve processor message boundaries (#18337)
## Summary

This PR fixes processor message reapplication so processors that return
a message array do not collapse assistant response boundaries when those
messages are written back to the agent message list.

The bug showed up with no-op `processOutputStep` processors running
alongside task state signals: reapplying the returned message array used
the normal message merge path, which could merge separate assistant
response messages together. That made later loop steps see stale
text/tool content from earlier steps.

Changes included here:

- Add a `merge: false` option to `MessageList.add()` and use it for
processor message-array reapply paths.
- Add AIMock regression coverage for no-op output step processors,
including TaskSignalProvider scenarios that previously replayed stale
step content.
- Update output processor unit expectations to preserve separate
assistant messages instead of relying on accidental re-merge behavior.
- Change GitHub signals' output-step processor to return `undefined`
when it only performs side effects, avoiding unnecessary
unchanged-message reapplication.
- Stabilize the GitHub polling inbox E2E assertion by checking the
visible tool result instead of shelling out to sqlite from the TUI.

## Test plan

- `pnpm exec vitest run
packages/core/src/loop/test-utils/aimock/scenarios/output-step-processor.scenario.test.ts
packages/core/src/processors/runner.test.ts --bail 1 --reporter=dot`
- `pnpm --filter @mastra/github-signals test -- --reporter=dot`
- `pnpm --filter ./packages/core check`

---------

Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
2026-06-23 22:00:33 -07:00
dane-ai-mastra[bot]
1556acd04c chore: version - exit prerelease mode 2026-06-24 04:07:33 +00:00
dane-ai-mastra[bot]
5f212aa373
chore: version packages (alpha) (#18189)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-22 14:23:33 +02:00