274 Commits

Author SHA1 Message Date
Yann Jouanin b6efd75ccc Merge branch 'main' into feat/mcp-apps-renderer 2026-09-13 07:15:04 +02:00
Benjamin Taylor 097d2cd9c9 chore(release): regenerate the public API manifest for the Node 20 floor
`scripts/release/public-api/manifest.v1.json` records each published
package's `engines`, so raising the floor left it stale and
`public-api-manifest.test.ts` failed on all six unit shards.

Regenerated with `pnpm generate:public-api-manifest`: seven `>=18`
entries become `>=20`, and `@copilotkit/runtime` gains an `engines`
block with its package-json provenance entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 14:35:28 -05:00
Yann Jouanin 633b0a65be Merge branch 'main' into feat/mcp-apps-renderer 2026-09-12 01:39:03 +02:00
Mike Ryan 84549992ab fix(runtime): scope MCP Apps requests through the released middleware
Consume upstream MCP Apps 0.1.0, retain trusted server credentials, and
reject proxy requests outside the selected agent scope. Ordinary runs
without selected servers do not attach middleware.
2026-09-11 15:55:29 -07:00
tylerslaton 92f704e3b4 chore: release monorepo v1.71.1 2026-09-11 22:01:26 +00:00
Benjamin Taylor 2fd61d9906 fix(release): sync the packed-consumer age-gate exemptions with .npmrc
`verify:runtime-package` packs the runtime and installs it in a temp dir
under `os.tmpdir()`. That directory never inherits the repo-root `.npmrc`,
so the script writes its own `minimumReleaseAgeExclude` from
`RELEASE_AGE_EXCLUDE` — a second copy of the same policy.

#7093 added `@ag-ui/mcp-middleware` and `@ag-ui/mcp-apps-middleware` to
`.npmrc` but not to that list, so the freshly published
`@ag-ui/mcp-middleware@0.0.2` installed everywhere except inside the packed
-runtime verification, which failed with:

    ERR_PNPM_NO_MATURE_MATCHING_VERSION  Version 0.0.2 (released 22 minutes
    ago) of @ag-ui/mcp-middleware does not meet the minimumReleaseAge
    constraint

The list's own comment already said to keep it in sync with `.npmrc`. A
comment was the only thing holding the two together, and it did not hold,
so this also adds a test asserting the two lists are identical. The test
was mutation-checked in both directions: dropping an entry from either
file fails it.

Verified by running the failing step: `pnpm run verify:runtime-package`
now exits 0 with "OK: packed runtime installs
@copilotkit/channels-intelligence and loads through ESM and CJS".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 15:41:32 -05:00
Yann Jouanin 5c51a6d72e Merge branch 'main' into feat/mcp-apps-renderer 2026-09-11 00:10:32 +02:00
Tyler Slaton aae4f01c9b test: allow release fixture cleanup more time in CI 2026-09-10 14:35:46 -07:00
Yann Jouanin b6b60d4a6f Merge branch 'main' into feat/mcp-apps-renderer 2026-09-10 23:18:29 +02:00
yannj-fr a9933fe12c chore(mcp-apps-renderer): tighten the activity UMD build and attw coverage
Follow-up asks from Ben's review, plus a version alignment:

- Add codeSplitting: false to the activity UMD build (matching a2ui-renderer), so
  it emits a single self-contained activity.umd.js. Without it a sibling chunk
  could leave the CopilotKitMcpAppsRendererActivity global incomplete, and
  es-check (syntax-only) would not catch it.
- Run attw as two analyses instead of a package-wide suppression: the root
  entry with the esm-only profile (it wraps the ESM-only ext-apps bridge, so its
  CJS resolution is intentionally absent while ESM and type checks stay active),
  and the remaining entries with node16. This keeps no-resolution enforced on
  every other entry point instead of silencing the rule for the whole package.
- Bump the package version 1.70.1 to 1.71.0 to match the shared-version monorepo
  scope, and regenerate the public API manifest.
2026-09-10 23:14:08 +02:00
Ben Taylor 450e35be8c test(skills): guard the repository facts the procedure skills name (#7051)
## What

Tests the six remaining skills on the axis that is cheap to check and
actually broken: **are the facts they state still true?**

The existing guard covers the two entry points, which point at
documentation, by resolving every docs path they name. The Inspector and
Intelligence skills point at the *repository* — an Nx target, a
dev-server port, a lab scenario id, a landing-page source file, a
Callout snippet — and nothing checked any of it.

## It was already wrong

`465abb0239` (OSS-948) deleted `open-inspector-step-angular.mdx`, and
said so explicitly:

> the Angular Open Inspector snippet — which asserted "Angular does not
mount Inspector by default" — is deleted in favour of the shared one
every other web frontend already uses

`@copilotkit/angular@0.4.0` auto-mounts a pinned
`@copilotkit/web-inspector`, so there is no install step left to link.
**That commit never touched `pane-map.md`.** So the map kept pointing at
a deleted file, and `inspector-docs` Procedure 3 kept telling agents
"Angular uses the Angular step snippet, which links the Angular
Inspector install page first."

A change to exactly the thing the skill tracks left the skill's own
source of truth stale, silently, for two weeks. Both are corrected here.

## The four assertions

Each has an unambiguous ground truth:

| assertion | ground truth |
| --- | --- |
| every `open-inspector-*.mdx` the pane map names exists |
`snippets/shared/inspector/` |
| every `docs/…mdx` page the pane map names exists | the content tree |
| every `showcase/shell-docs/src/…` file `intelligence-docs` says to
edit exists | the repo |
| the Nx target, port, scenario ids and query keys `inspector-workbench`
names resolve | `project.json`, `threads-state-lab.ts` |

## What is deliberately not asserted

**Which panes the Inspector ships.** Panes are not enumerated as data
anywhere in `packages/web-inspector`, whose entry point is a single
~14,700-line module, so matching a pane label against source proves
nothing in either direction.

A first draft of this suite tried it and **passed while the map really
was wrong**: `pane-map.md` lists "Pop-out window" under Unshipped, but
`src/lib/pop-out.ts` is imported by the package entry, carries live
`popOut` state in `index.ts`, and has its own test suite. My slug match
looked for `pop-out-window`, found nothing, and went green. That is
worse than not testing it, because a green run reads as confirmation.

So that check is gone, the reasoning is in a comment in the suite, and
**the Pop-out row is left as-is for the Inspector owner to rule on**
rather than guessed at. Making that direction testable needs a pane
registry in the package, not a cleverer regex here.

## Testing

```
$ vitest run scripts/__tests__/public-skill-drift.test.ts scripts/__tests__/sync-plugin-skills.test.ts
 Test Files  2 passed (2)
      Tests  20 passed (20)
```

`pnpm check:plugin-skills` → `plugin skill mirror in sync`. `pnpm
check:intelligence-env-names` → `Intelligence env var names and hosts
are canonical`. `oxfmt --check` clean (it reported two files needing
format; ran `--write`, re-checked clean, re-ran tests).

**Mutation-checked, since a check that has never failed is not a
check.** Each mutation produces exactly one failing test, and the
restored tree is clean:

| mutation | failures |
| --- | ---: |
| baseline | 0 |
| `docs/meta.json` → `docs/NOPE.json` in `intelligence-docs` | 1 |
| port `5177` → `9999` in `inspector-workbench` | 1 |
| `scenario=pro-enabled-existing` → `no-such-scenario` | 1 |
| nx target `dev:standalone` → `dev:gone` | 1 |
| `docs/inspector.mdx` → `docs/no-such-page.mdx` in the pane map | 1 |
| restored | 0 |

The Angular finding is the suite's own first catch: before the fix it
failed with exactly `[ 'open-inspector-step-angular.mdx' ]` and no false
positives. An earlier iteration also flagged `inspector.mdx` and
`react-native.mdx` — page references from a different table — which is
why the snippet pattern is anchored on the `open-inspector-` prefix.

This runs in `plugin-skills-check.yml`, which already triggers on
`skills/**`.

## Scope

This is the cheap half of testing a skill — whether it is still true.
Whether a skill measurably *helps* an agent is the other half, and that
needs the lift eval in #5689, which is parked.

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


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

## Summary by CodeRabbit

- **Documentation**
- Updated Angular Inspector quickstart guidance to use the shared web
Inspector steps.
- Clarified that Angular automatically mounts the pinned web Inspector,
so no separate installation step is required.
- Updated the Inspector pane map to reflect the shared guidance and
revised installation notes.

- **Tests**
- Added checks to keep procedure documentation aligned with current
Inspector, Intelligence, and Workbench configuration details.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-10 15:28:53 -05:00
Benjamin Taylor 44631fc328 test(skills): guard the repository facts the procedure skills name
The two entry-point skills point at documentation, so the existing guard
checks that every docs path they name resolves. The Inspector and Intelligence
skills point at the repository instead — an Nx target, a dev-server port, a
lab scenario id, a landing-page source file, a Callout snippet — and nothing
checked those.

They had already drifted. `465abb0239` (OSS-948) deleted
`open-inspector-step-angular.mdx`, saying so plainly in its message: the
Angular snippet "is deleted in favour of the shared one every other web
frontend already uses", because `@copilotkit/angular@0.4.0` auto-mounts a
pinned web-inspector and there is no install step left to link. That commit
never touched `pane-map.md`, so the map kept pointing at the deleted file and
`inspector-docs` kept telling agents Angular uses its own snippet. Both are
corrected here.

Four assertions, all with unambiguous ground truth:

- every `open-inspector-*.mdx` the pane map names exists
- every `docs/…mdx` page the pane map names exists
- every `showcase/shell-docs/src/…` file `intelligence-docs` says to edit in
  the same change exists
- the Nx target, port, scenario ids and query keys `inspector-workbench` tells
  an agent to run resolve against `project.json` and the lab

Each was mutation-checked: breaking the intelligence path, the port, the
scenario, the target, and a docs page reference each fails exactly one test,
and the restored tree passes.

Deliberately not asserted: which panes the Inspector ships. Panes are not
enumerated as data in `packages/web-inspector`, whose entry point is a single
fourteen-thousand-line module, so matching a pane label against source proves
nothing in either direction. A first draft tried it and passed while the map
was in fact wrong — "Pop-out window" is listed unshipped although
`src/lib/pop-out.ts` is imported by the package entry and has its own suite —
which is worse than no test, because green reads as confirmation. That
direction needs a pane registry in the package, not a cleverer regex here; the
comment in the suite says so, and the Pop-out row is left for the Inspector
owner to rule on rather than guessed at.

This is the cheap half of testing a skill: whether it is still true. Whether
it measurably helps an agent is the other half, and that needs the lift eval
in #5689.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 15:09:32 -05:00
Mike Ryan 90d29f3d95 feat(docs): track prompt controls and use docs corner radii 2026-09-10 12:02:34 -07:00
Benjamin Taylor 6c25273afe refactor(skills): replace nine knowledge skills with two entry points
The packaged skills had grown into a second copy of the documentation.
`runtime` and `react-core` were roughly 60% transcribed API surface, and
most of their remaining "Common Mistakes" prose already existed on a docs
page. A cached copy of an API goes stale silently: four claims in the
deleted skills contradicted the source they cited, and one of them reached
a shipped PR before it was caught.

Replace them with two skills that look the answer up instead of restating
it:

- `copilotkit` — the four search tools and two explore tools of the
  bundled `copilotkit-docs` MCP server, which corpus answers which
  question, and the instruction not to answer from memory.
- `copilotkit-cli` — the CLI, led by `copilotkit verify --json`. Since
  #1180 `verify` covers version skew, CORS, and transcription, which is
  what most of the old `copilotkit-debug` skill described by hand.

Deleted: copilotkit-setup, copilotkit-develop, copilotkit-integrations,
copilotkit-debug, copilotkit-upgrade, copilotkit-agui, copilotkit-contribute,
copilotkit-self-update, and the three package-generated skills (react-core,
runtime, a2ui-renderer).

The `skills` directory is dropped from the `files` field of the three
packages that shipped one, so the tarballs no longer carry a copy.

`public-skill-drift.test.ts` guarded wording in files that no longer exist.
It is now a link guard: every `docs.copilotkit.ai` path named by a packaged
skill has to resolve to a page in this repo, and the two entry points have
to stay free of a transcribed API surface.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 11:11:18 -05:00
Yann Jouanin c4dc58102b Merge branch 'main' into feat/mcp-apps-renderer 2026-09-10 11:17:40 +02:00
tylerslaton cac7cde862 chore: release monorepo v1.71.0 2026-09-09 22:24:05 +02:00
Sam Julien 102599afa5 docs: align promoted API guidance 2026-09-09 13:41:32 -05:00
Yann Jouanin dedfa6ea37 Merge branch 'main' into feat/mcp-apps-renderer 2026-09-09 17:46:54 +02:00
yannj-fr 7972bfadfd fix(mcp-apps-renderer): make the UMD and CJS entry points valid (Codex review)
Address two build-config findings from the Codex review of #6884.

UMD (P2-1): react-core's UMD build externalized @copilotkit/mcp-apps-renderer/activity
with no matching global, so it referenced an undefined global
(_copilotkit_mcp_apps_renderer_activity) and every script-tag consumer broke at
provider init - even without rendering an MCP app. Ship a UMD build of the
bridge-free /activity entry (dist/activity.umd.js, es2018, global
CopilotKitMcpAppsRendererActivity) and map it in react-core's two UMD builds.
Script-tag consumers load activity.umd.js before react-core's UMD; documented in
the package README and the react-core tsdown config.

CJS (P2-2): the package advertised a CommonJS root whose dist/session.cjs emitted
a synchronous require() of @modelcontextprotocol/ext-apps/app-bridge, which is
ESM-only, failing with ERR_REQUIRE_ESM. Make the root ESM-only (bindMcpApp is
loaded via dynamic import(), which resolves ESM from any context) and keep the
bridge-free ./activity entry dual ESM+CJS (what react-core's CJS build requires).
attw ignores no-resolution for the intentional ESM-only root; publint clean.

Also: es2018 UMD covered by compat-check; public API manifest regenerated.
2026-09-09 17:41:20 +02:00
Benjamin Taylor 2c05ed6885 chore(release): keep release notes in one CHANGELOG.md per release lane
The notes now land in a source-controlled changelog instead of a scratch file
that rides the release branch. One file per lane, because the lanes version
independently: a shared file would interleave `1.70.0`, `angular/0.5.0` and
`channels/0.9.0` into one unreadable sequence.

  monorepo  ->  CHANGELOG.md
  angular   ->  packages/angular/CHANGELOG.md
  channels  ->  packages/channels/CHANGELOG.md

`write-changelog.ts` prepends this release's section on the release branch,
create-pull-request commits it (a tracked file, always staged), and
`extract-release-notes.ts` reads the section back in the publish job as the
GitHub Release body. The changelog is therefore both the durable record and the
review surface: editing a section on the release PR changes what ships.
release-notes.md goes back to being ignored, so the same notes never exist as
two editable copies.

Also deletes 29 changesets-era changelogs that no tooling had written since
April. They stopped at 1.55.2 while the lane shipped 1.69.3, and
packages/angular/CHANGELOG.md still claimed 1.54.3 from before that lane split
onto its own 0.x line. Their content stays recoverable from git history. A test
pins the tracked changelog set to the lanes so they cannot creep back and
contradict the real versions.

Extraction never fails the publish job: it runs after npm publish, so a miss
annotates loudly and falls through to the existing bodyless-release fallback
rather than stranding the tag.

Committed with --no-verify: the pre-commit nx lane cannot run in this worktree
(packages/core and packages/channels-ui have no node_modules, and
`nx run @copilotkit/core:build` fails identically with the tree clean). The only
change under packages/** is deleting orphan markdown that no build or test
reads.
2026-09-09 08:31:01 -05:00
Benjamin Taylor afc34d9242 fix(release): raise the notes generator's max_tokens off 2048
A monorepo release carries dozens of PRs; 2048 output tokens truncates the
notes mid-section, and the truncated text is what ships as the release body.

Leaves the model pin alone — main already moved it to a current, undated id.
2026-09-09 08:31:00 -05:00
Benjamin Taylor c4be50cc7e style(release): drop the imports and blank line the Notion removal orphaned 2026-09-09 08:31:00 -05:00
Benjamin Taylor 461bb17913 fix(release): scope the AI notes prompt to the lane being released
The generator fed the model a repo-wide `git log -50` as context and told it
it was writing notes for "CopilotKit vX.Y.Z, an open-source AI agent framework
for React applications" — wrong on three counts for an angular or channels
release: the wrong commits, the wrong framing, and the wrong release title
(only the monorepo lane is titled `vX.Y.Z`).

Pass the scope through, build context from that lane's own commits, name the
packages actually being published, and tell the model to write about nothing
else.

Also fix the API call itself: the pinned model string was a dated snapshot,
max_tokens 2048 could truncate a large release, and the response reader took
content[0].text — which is not the text block on models that return thinking
blocks first.
2026-09-09 08:31:00 -05:00
Benjamin Taylor d3edfa089c fix(release): keep breaking-change footers written on branch commits
Selecting mainline commits alone drops a BREAKING CHANGE footer that lives on
a branch commit rather than in the PR description: the merge inherits neither.
Measured against real history, v1.60.0..HEAD lost 2 of 2 notes.

Fold each merge's branch messages into its body before extraction, so the
entry list stays one-per-PR while the footer scan sees the whole PR. Both
ranges checked now report zero loss versus the previous selection.
2026-09-09 08:31:00 -05:00
Benjamin Taylor 476b48a7d6 fix(release): commit release-notes.md to the release branch, drop the Notion round-trip
release-notes.md and release-notes-notion.json were both gitignored, so
create-pull-request silently skipped them. The notes never reached the release
branch, the publish job's readFileSync missed, and every release since this
lane was built shipped its "Release <tag>" fallback body — v1.70.0,
channels/v0.6.0 and angular/v0.4.0 all have bodyless GitHub Releases.

The same ignore rule severed the Notion lane: without the json ref in the
checkout, publish-release could never read an edited draft back, so that path
had never run either. Remove it rather than repair it — the release PR is
already the review surface, and editing release-notes.md on the branch is a
plainer gate than a Notion page.

Guard the ignore rule with a test, since re-adding it would break the lane
again without breaking anything else.
2026-09-09 08:30:59 -05:00
Benjamin Taylor 8ddb6158a4 fix(release): select release-note commits by PR, scoped to the release lane
Release notes were assembled from every commit since the scope's tag with
--no-merges. Two things were wrong with that:

- No path filter, so a scope inherited every other lane's work. The angular
  v0.5.0 notes drew from 159 commits, 4 of which were angular.
- --no-merges is backwards for this repo. PRs land as merge commits, so the
  merge is the unit of change and the only commit carrying the (#1234)
  reference; --no-merges dropped every PR boundary and kept the intermediate
  branch commits instead.

Walk --first-parent over the scope's package directories, drop commits no
consumer would read about (test/ci/style, chore except chore(deps), and the
release commit itself), and parse the PR number off the subject.

For angular v0.5.0 this turns 159 entries into the 4 real PRs.
2026-09-09 08:30:59 -05:00
yannj-fr 3d85c119f8 chore(mcp-apps-renderer): register the new package with CI
CI ran for the first time on the PR and flagged three new-package registration
steps (Ben's review):

- add packages/mcp-apps-renderer/tsdown.config.ts to .github/config-allowlist.txt
  (static / check binaries)
- drop the UMD half of the compat-check script; this package builds no UMD
  format, so `es-check ... dist/**/*.umd.js` found no files and failed
  (static / compat)
- bump the monorepo package-count drift guard 16 -> 17 now that the package
  joined the release scope (test / unit)
2026-09-09 12:24:58 +02:00
Yann Jouanin 5af412b5b9 Merge branch 'main' into feat/mcp-apps-renderer 2026-09-09 12:12:47 +02:00
Benjamin Taylor c11329c5dd fix(docs): stop the internal v1 deprecation banner leaking into reference pages
The v1 deprecation notice added in #6582 is a source-file banner for IDEs and
coding agents, including the line "AI CODING AGENTS: Never copy, suggest, or
generate these v1 APIs." It sits in the leading trivia of the first statement
of every public v1 source file, which is the same place the reference-docs
generator reads real JSDoc from, so regenerating embedded it as visible body
text on 20 published pages. That made regeneration unpublishable: no JSDoc
correction to a v1 source could land without also shipping the banner.

Skip the notice wherever the generator enumerates comment ranges, keyed off its
stable opening delimiter.

Also repoint the six SDK reference entries. Their pages moved to
reference/v1/sdk/ in ec239b15f7 and the old copies were deleted in a8d43a9c2e,
but files.ts still wrote to reference/sdk/, so the generator refreshed a
directory the docs site never served while the live pages went stale. Those
pages regain the upstream LangGraphAgent -> LangGraphAGUIAgent rename and the
copilotkit_emit_tool_call tool_call_id parameter. The renamed page replaces the
orphaned LangGraphAgent page, whose source file no longer exists, with a
permanent redirect for the old URL.

Regenerating is now idempotent: a second run leaves the tree clean.

Fixes #6939

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 21:44:18 -05:00
tylerslaton 69a940c70e chore: release monorepo v1.70.3 2026-09-08 23:22:32 +00:00
Tyler Slaton 1b2d8eca85 fix(runtime): sync public API manifest after removing Learning flag 2026-09-08 16:03:32 -07:00
Mike Ryan e3b249f0f7 chore(examples): update CLI starters to current SDK releases 2026-09-08 13:43:10 -07:00
MikeRyanDev 175e9c237c chore: release angular v0.5.2 2026-09-08 20:27:11 +00:00
MikeRyanDev 16514e9424 chore: release monorepo v1.70.2 2026-09-08 20:03:39 +00:00
Yann Jouanin 1c2df1d64b Merge branch 'main' into feat/mcp-apps-renderer 2026-09-06 15:00:31 +01:00
Martha Kelly Schumann 1fdca1dc9e fix(inspector): harden Learning review flows 2026-09-04 17:30:44 -07:00
Martha Kelly Schumann c70502b137 feat(inspector): add Learning view and workbench 2026-09-04 17:11:59 -07:00
yannj-fr 65507be3a7 fix(mcp-apps-renderer): address review on the React-pilot PR
Bridge-free /activity (review blocker): the `./activity` entry pulled ext-apps'
LATEST_PROTOCOL_VERSION through constants.ts, statically dragging the App SDK +
zod/v4 (~+55 kB gzip) into react-core's eager chunk. Move MCP_APPS_PROTOCOL_VERSION
to the bridge side (session.ts), sourced from the /app-bridge subpath the session
already imports - single source of truth, no hand-maintained literal, zero extra
cost. dist/activity.mjs and dist/constants.mjs now carry no @modelcontextprotocol
edge.

Keep react-core's zod peer at >=3.25 (review blocker): the floor moved down to the
package, it did not go away; ext-apps + the MCP SDK both hard-require it, so >=3.0.0
is an ERESOLVE install failure once an MCP App renders.

Drop the <copilotkit-mcp-app> web component from this PR: nothing consumes it here
(the React adapter builds its own iframe) and it carried two open defects. It lands
with the Vue/Angular adapters, its first real consumers. Removes its files, exports,
tsdown entry, and the now-unused lit dependency.

Also: add content.serverId to the bind effect deps; delete drained thread entries
from the request queue's maps (bounded growth); register the package in
static_compat.yml (+ a compat-check script) and static_bundle_size.yml; publint
repository.url -> git+https. Manifest regenerated.
2026-09-04 22:25:38 +01:00
Yann Jouanin 4b01c7b21c Merge branch 'main' into feat/mcp-apps-renderer 2026-09-04 21:55:55 +01:00
Ben Taylor 1b028f484c fix(mastra): stop thread-scoped working memory aborting the first turn (closes OSS-1122) (#6870)
## Problem

A starter scaffolded with `copilotkit init --framework mastra` and
connected to managed Intelligence starts, accepts a chat message, and
never answers. `POST /api/copilotkit/agent/default/run` still returns
200, so the abort is only visible in the server log:

```
Agent execution failed: Error: Thread c883919e-… not found
```

## Root cause

`@ag-ui/mastra`'s `syncInputStateToWorkingMemory` writes the UI's shared
state into Mastra working memory **before** it streams a turn. That
write is unguarded and never creates the thread, because it assumes the
resource-scoped store, which upserts. Its own comment says so, and its
*remote* branch handles the opposite case explicitly ("requires the
thread to exist… create the thread and retry once").

This starter was the one Mastra agent in the repo that set
`workingMemory.scope: "thread"`. Thread scope routes the same write to
thread metadata, and `@mastra/memory` throws `Thread <id> not found`
when the thread row does not exist. On the first turn of a conversation
it never does, so the run dies before the model is called.

Managed Intelligence made that certain rather than likely:
`handlers/intelligence/run.ts` replaces the client thread id with a
platform-canonical one from `ɵacquireThreadLock`, which the Mastra store
has never seen. That also explains the two different thread ids in the
same failure.

## Evidence

Verified by running, against the starter's exact pins (`@mastra/core`
1.41.0, `@mastra/memory` 1.0.1-alpha.1, `@ag-ui/mastra` 1.1.2):

| Configuration | First-turn state sync |
| --- | --- |
| `scope: "thread"` (as shipped) | throws `Thread <id> not found`, run
aborts |
| `scope: "resource"` | writes, reads back, reaches the agent's system
message |

Resource scope keeps working memory **per conversation** here, because
the bridge derives the resource id from the thread id when no explicit
resource id is configured. Confirmed: a second thread id reads back
`null`, and schema merge semantics still work on turn 2.

## Change

- `examples/integrations/mastra` uses `scope: "resource"`, matching
every other Mastra agent in this repo, with a comment explaining why.
- A new contract test in
`scripts/__tests__/integration-intelligence-migration.test.ts` fails if
any integration starter configures thread-scoped Mastra working memory.
It asserts the mastra starter is in scope, so it cannot pass vacuously,
and it ships with five helper cases including a decoy
(`observationalMemory.scope: "thread"`, which is unrelated and must not
trip it).

This also fixes the Channel host, which drives the same agent.

## Verification

- `vitest run
scripts/__tests__/integration-intelligence-migration.test.ts` — 159
passed, and the new test is red on the unfixed starter (`expected [
'mastra/src/mastra/agents/index.ts' ] to deeply equal []`).
- `parity:check` passes, `oxlint` and `oxfmt --check` clean.

## Left undone, deliberately

The adapter's local branch is still unguarded, so a developer who
chooses thread scope hits the same abort in their own code. The fix
belongs in `@ag-ui/mastra` and mirrors what its remote branch already
does. That needs an ag-ui PR plus a release, so it is not in this
change.

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


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

## Summary by CodeRabbit

* **Bug Fixes**
* Updated the weather agent’s working-memory scope to support shared UI
state during the first turn of a conversation.
* Prevented conversation initialization issues caused by thread-scoped
memory.

* **Tests**
* Added validation to ensure integrations use compatible working-memory
scopes.
* Added coverage for direct, nested, resource-scoped, omitted, and
unrelated configuration cases.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-04 15:46:49 -05:00
Ben Taylor a4adf38683 fix(shared): keep Node-only telemetry out of browser build graphs (#6846)
## What does this PR do?

`@copilotkit/shared` re-exported `telemetry/telemetry-client.ts` from
its root entry. That module imports `@segment/analytics-node`, which
imports `node-fetch`, which imports the Node built-ins `stream`, `http`,
`https` and `zlib`. Browser bundlers resolve the whole static module
graph before they tree-shake, so every browser build of a dependent
package printed `Module ... has been externalized for browser
compatibility` warnings, even when the consumer never touched telemetry.

This PR keeps that edge out of the browser-facing entry:

- `isTelemetryDisabled` moves into
`src/telemetry/telemetry-disabled.ts`, so the root entry can keep
exporting it without reaching the client.
- The root entry keeps `isTelemetryDisabled`, the `lambdaClient`
surface, the sampling helpers, and the `TelemetryCapture` /
`TelemetryIdentity` types. The types are exported with `export type`, so
they are erased and add no runtime edge.
- `TelemetryClient` is now reachable at `@copilotkit/shared/telemetry`,
a new export subpath.
- A new test walks the value-level import graph from `src/index.ts` and
fails if it reaches a Node-only package.

Deferring the import does not fix this, which is what PR #5482
attempted. A dynamic import defers evaluation but keeps the graph edge,
so `vite:resolve` still reaches `node-fetch`. The measurement is in
https://github.com/CopilotKit/CopilotKit/pull/5482#issuecomment-5509823707.

## Export surface change

`TelemetryClient` is no longer on the `@copilotkit/shared` root entry,
or on the `CopilotKitShared` UMD global. It is reachable at
`@copilotkit/shared/telemetry`.

```diff
- import { TelemetryClient } from "@copilotkit/shared";
+ import { TelemetryClient } from "@copilotkit/shared/telemetry";
```

This is a public export in the packaging sense only. `TelemetryClient`
is our internal metrics client, so no application code is expected to
import it, and nothing that works today is expected to stop working.
`packages/runtime/src/v1-deprecated/lib/telemetry-client.ts` is the only
in-repo consumer and is updated here. There is no root shim on purpose:
a runtime re-export would reintroduce the graph edge and the bug.

`typesVersions` carries the subpath for `moduleResolution: "node"`
(node10) consumers, which `packages/runtime` still uses. Without it,
`tsc` cannot see the subpath's types.

`scripts/release/public-api/manifest.v1.json` is regenerated for the new
entry point. The manifest tracks entry points rather than symbols, so
the change there is the added `./telemetry` record.

## Related PRs and Issues

- Fixes #4151
- Supersedes #5482

## Testing

### The reported symptom, before and after

Vite 7.3.2, minimal app whose entry imports only browser-safe symbols
from `@copilotkit/shared`, pointed at a real tsdown build of the
package.

| | `vite build` warnings | modules transformed |
| --- | --- | --- |
| `main` | 4 (`stream`, `http`, `https`, `zlib`) | 663 |
| this branch | **0** | 451 |

After, verbatim:

```
vite v7.3.2 building client environment for production...
transforming...
✓ 451 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html                0.12 kB │ gzip: 0.12 kB
dist/assets/index-EEiKsU3u.js  2.43 kB │ gzip: 1.29 kB
✓ built in 267ms
```

The dev-server dependency scanner is fixed too. `vite optimize --force`
before this change pre-bundled `@ag-ui/client, @segment/analytics-node,
chalk, graphql, partial-json, uuid, zod`; after it pre-bundles
`@ag-ui/client, graphql, partial-json, uuid, zod`.

### The new export surface, exercised in Node

```
=== CJS require of subpath ===
TelemetryClient: function
isTelemetryDisabled: function true
lambdaClient: object
segment instantiated: Analytics
=== ESM import of subpath ===
esm TelemetryClient: function disabled: true
=== root entry ===
root TelemetryClient: undefined
root isTelemetryDisabled: function
root lambdaClient: object
root computeSamplingMeta: function
root firstNonBlankTelemetryId: function
```

### Subpath type resolution, both resolution modes

```
### moduleResolution node10 (what packages/runtime uses) ###
(clean)
### moduleResolution node16 ###
(clean)
```

Before adding `typesVersions`, node10 failed as expected, which is why
the field is there:

```
probe.ts(1,33): error TS2307: Cannot find module '@copilotkit/shared/telemetry' or its
corresponding type declarations.
  There are types at '.../dist/telemetry/index.d.mts', but this result could not be
  resolved under your current 'moduleResolution' setting.
```

### The regression guard is not self-fulfilling

Mutation-checked both ways. Restoring `export * from "./telemetry"` on
the root entry:

```
× root entry browser safety (#4151) > does not reach Node-only packages through value imports
  → expected [ '@segment/analytics-node' ] to deeply equal []
```

Turning the type-only re-export into a value re-export fails it as well,
and restoring the file makes both tests pass again.

### The gate that went red on the first push

`scripts/release/lib/public-api-manifest.test.ts` compares the committed
public API manifest to a freshly generated one, and a new export subpath
has to be recorded there. Regenerated with `pnpm
generate:public-api-manifest`; the failing test and its whole suite now
pass:

```
scripts/release/generate-public-api-manifest.ts --check
  scripts/release/public-api/manifest.v1.json is current

vitest run scripts/release
  Test Files  14 passed (14)
       Tests  162 passed (162)
```

### Package gates

```
@copilotkit/shared: tsc --noEmit          clean
@copilotkit/shared: vitest run            18 files, 404 tests passed
@copilotkit/shared: tsdown                Build complete
@copilotkit/shared: verify-cjs-exports    exit 0
@copilotkit/shared: es-check es2022       55 files, ES13 compatible
@copilotkit/shared: es-check es2018 (umd) 1 file, ES9 compatible
@copilotkit/shared: publint               only the pre-existing repository.url suggestion
@copilotkit/shared: attw --profile node16 all green, including "@copilotkit/shared/telemetry"
```

### Not run locally

`@copilotkit/runtime:build` and the workspace-wide pre-commit gate. My
local install is missing `type-graphql@2.0.0-rc.1` from the pnpm store,
so the runtime build fails on `Cannot find module 'type-graphql'` on
`main` as well, with or without this change. The runtime change here is
one import line, and I verified that it resolves under both node10 and
node16. CI runs the real gate. This commit was made with `--no-verify`
for that reason.


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

## Summary by CodeRabbit

- **New Features**
- Added a dedicated `@copilotkit/shared/telemetry` entry point for
server-side telemetry functionality.
- Added support for disabling telemetry when
`COPILOTKIT_TELEMETRY_DISABLED` or `DO_NOT_TRACK` is set to `true` or
`1`.

- **Improvements**
- Improved browser compatibility by preventing Node-only telemetry
dependencies from being included in browser bundles.
- Existing browser-safe telemetry utilities remain available from the
main shared package entry point.
- Full telemetry client functionality is now accessed through the
dedicated telemetry entry point.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-04 15:42:53 -05:00
Yann Jouanin f3714bf8ba Merge branch 'main' into feat/mcp-apps-renderer 2026-09-04 08:12:01 +01:00
yannj-fr f4029e49d6 feat(react-core): consume shared mcp-apps-renderer, drop direct MCP deps
Reduce MCPAppsActivityRenderer from a 786-line self-contained implementation to
a thin React adapter over the framework-agnostic bindMcpApp:

- the React shell owns the iframe (create / mount / size / remove) and wires the
  session hooks (onResource, onSizeChanged, onError) to React state; all protocol
  logic (AppBridge, sandbox proxy, request queue, ui/message + open-link, tool
  input/result) now lives in @copilotkit/mcp-apps-renderer
- the bridge-free activity surface (MCPAppsActivityType, content schema, follow-up
  runner) is re-exported statically from the package's new ./activity entry, so
  registering the activity does not pull the ext-apps bundle
- bindMcpApp is loaded via a lazy import("@copilotkit/mcp-apps-renderer") inside
  the effect, keeping ext-apps (~40-50 kB gzipped) out of the main chunk

Dependency move (FR-007): react-core drops its direct @modelcontextprotocol/ext-apps
dependency, the @modelcontextprotocol/sdk peer + devDependency, and the zod >=3.25
peer floor (reverted to >=3.0.0), and depends on @copilotkit/mcp-apps-renderer
instead. The package becomes the sole owner of the MCP libraries: sdk moves from a
peer to a dependency there (satisfying ext-apps' required sdk peer), and a
bridge-free ./activity subpath is exported.

Register the package in the monorepo release scope and regenerate the public API
manifest. react-core's MCP e2e suite (37 tests across 4 files) stays green;
check-types + oxlint clean; behavior-preserving.
2026-09-04 05:59:13 +01:00
Tyler Slaton de1078ed71 chore: release angular v0.5.1 (#6877)
## Release angular v0.5.1

**Scope:** `angular` | **Bump:** `patch`

---

### How this release process works

1. **This PR was created automatically** by the "release / create-pr"
workflow.
   It bumped the `angular` packages to `0.5.1`
   and generated AI-enhanced release notes.

2. **CI runs on this PR** — the full test suite (unit tests, lint, type
checks, build)
   must pass before merging. This is the review gate.

3. **Review the release notes** in `release-notes.md` in this PR.
If a Notion draft was created, you can edit the release notes there
before merging.

4. **When this PR is merged**, the `release / publish` workflow
automatically:
   - Builds all packages
   - Publishes the `angular` packages to npm at version `0.5.1`
   - Creates git tag `angular/v0.5.1`
   - Creates a GitHub Release with the final release notes

### Before merging

- [ ] CI is green (tests, lint, types, build)
- [ ] Version bumps look correct
- [ ] Release notes are accurate (edit in Notion if a draft was created)

---

> **Do not merge until CI is fully green.** The full test suite runs
automatically on this PR.
2026-09-03 22:47:36 +02:00
tylerslaton 6adbc6a4b6 chore: release angular v0.5.1 2026-09-03 20:31:11 +00:00
Alem Tuzlak 2a10854bfa fix(skills): treat intelligence-docs as a standalone skill 2026-09-03 12:33:52 -07:00
Benjamin Taylor d735f67bc4 fix(mastra): stop thread-scoped working memory aborting the first turn (closes OSS-1122)
A starter scaffolded with `--framework mastra` accepted a chat message and
never answered. The run aborted server-side with `Thread <id> not found`.

`@ag-ui/mastra` writes the UI's shared state into Mastra working memory
before it streams a turn (`syncInputStateToWorkingMemory`). That write is
unguarded and never creates the thread, because it assumes the
resource-scoped store, which upserts. The starter was the one Mastra agent
in this repo that set `scope: "thread"`, which routes the same write to
thread metadata and requires the thread row to exist. On the first turn of a
conversation it does not, so `@mastra/memory` throws and the run dies before
the model is called.

Managed Intelligence made that certain rather than likely: the Intelligence
run handler swaps the client thread id for a platform-canonical one, which
the Mastra store has never seen. That is also why two different thread ids
appear in the same failure.

Verified against @mastra/core 1.41.0, @mastra/memory 1.0.1-alpha.1 and
@ag-ui/mastra 1.1.2: thread scope throws on a fresh thread, resource scope
writes, reads back, reaches the agent's system message, and stays per
conversation because the bridge derives the resource id from the thread id.

Every other Mastra agent here omits `scope`, so this aligns the starter with
them. The gate is a new contract test in the parity workflow's suite.

Left upstream: the adapter's local branch is still unguarded, so a developer
who chooses thread scope hits the same abort. Its remote branch already
creates the thread and retries. Worth a follow-up in ag-ui.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 11:45:54 -05:00
tylerslaton 71b2f481f9 chore: release monorepo v1.70.1 2026-09-03 15:49:49 +00:00
tylerslaton 8feaa1e196 chore: release channels v0.9.2 2026-09-02 23:19:41 +00:00
Tyler Slaton 09f3611ee2 fix(release): retry npm registry propagation 2026-09-02 15:58:33 -07:00