77 Commits

Author SHA1 Message Date
Mark f1156c9125 fix(deps): patch eventsource so Bun stops breaking the runtime integration job (#6334)
## What

Fixes the intermittently-red `test / integration / runtime` **bun** leg.
Three commits, smallest blast radius first:

1. **`ci(runtime)`** — pin `bun-version` from `latest` to `1.3.14` so a
Bun release can't change module-resolution behaviour between runs. (Only
`bun-version: latest` in the repo.)
2. **`fix(deps)`** — **this is the actual fix.** Patch
`eventsource@3.0.7` to drop its `bun` export condition, via `pnpm patch`
+ `patchedDependencies`.
3. **`refactor(runtime)`** — module-graph hygiene: load the MCP SSE
transport lazily. Explicitly **not** a behaviour fix; commit 2 is.

## Root cause

```
TypeError: require() async module ".../eventsource@3.0.7/node_modules/eventsource/dist/index.js" is unsupported. use "await import()" instead.
    at .../@modelcontextprotocol/sdk/dist/cjs/client/sse.js:4:7
    at .../@ag-ui/mcp-apps-middleware/dist/index.js:1:983
    at processTicksAndRejections (unknown:7:39)
```

- `eventsource@3.0.7` maps its `bun` export condition to the **ESM**
build (`dist/index.js`). Bun resolves `bun` **before** `require`, so a
CJS `require("eventsource")` receives an async ESM module and throws.
The package ships a real CJS build (`dist/index.cjs`) behind `require`,
but Bun never reaches it.
- Two CJS consumers in our graph hit this: the MCP SDK's own
`dist/cjs/client/sse.js`, and `@ag-ui/mcp-apps-middleware@0.0.3` — a
CJS-only package (`main: ./dist/index.js`, no `exports`, no `type:
module`) that `require`s that SDK path unconditionally at module load.
- **Why intermittent:** it's a load-order race. If the ESM graph fully
evaluates `eventsource` first, the later CJS `require` can be served
synchronously and the run passes; otherwise it throws.

Dropping the `bun` key makes Bun fall through to `import` for ESM
consumers (same `dist/index.js` as before — no behaviour change) and to
`require` for CJS consumers (`dist/index.cjs`, which is what they need).
Only `bun` is touched; `deno`/`source`/`import`/`require`/`default` are
left alone.

**A version bump is not an alternative:** `eventsource@4.1.0` still
ships the same `bun` → ESM mapping.

## Patch diff

`patches/eventsource@3.0.7.patch` (header abridged — the file carries
the full rationale and an explicit deletion criterion so it doesn't
become permanent by accident):

```diff
# Drops the `bun` export condition from eventsource.
# ...
# DELETE THIS PATCH WHEN: eventsource drops the `bun` condition or points it at
# dist/index.cjs, OR Bun stops preferring `bun` over `require` for CJS requires.
diff --git a/package.json b/package.json
@@ -10,7 +10,6 @@
   "exports": {
     ".": {
       "deno": "./dist/index.js",
-      "bun": "./dist/index.js",
       "source": "./src/index.ts",
       "import": "./dist/index.js",
       "require": "./dist/index.cjs",
```

Root `package.json` gains:

```json
"patchedDependencies": { "eventsource@3.0.7": "patches/eventsource@3.0.7.patch" }
```

This repo had no `patches/` precedent (it uses `pnpm.overrides`), so
this sets one — hence the minimal one-line patch and the documented
removal criterion.

## Red-green proof

All four states. Local runs are the **same command on the same
machine**, differing only by whether the patch is applied. Bun 1.3.14,
macOS arm64, run from `packages/runtime`:

```sh
bun test src/v2/runtime/__tests__/integration/bun/bun-servers.integration.test.ts
```

A single green run proves nothing here — it's a race — so both local
states are N=20.

### 1. CI-RED

- This branch before the patch, run
[30835752558](https://github.com/CopilotKit/CopilotKit/actions/runs/30835752558)
@ `5456e308b9` — `runtime / node` success, **`runtime / bun` failure**:

```
4 | const eventsource_1 = require("eventsource");
TypeError: require() async module "/home/runner/work/CopilotKit/CopilotKit/node_modules/.pnpm/eventsource@3.0.7/node_modules/eventsource/dist/index.js" is unsupported. use "await import()" instead.
 0 pass
 1 fail
```

- Also on `main` @ `26a23bbf3a`, run
[30825667393](https://github.com/CopilotKit/CopilotKit/actions/runs/30825667393)
— same leg, same failure.

### 2. LOCAL-RED (eventsource UNPATCHED, N=20)

```
run  1:  72 pass  0 fail
run  2:   0 pass  1 fail
run  3:   0 pass  1 fail
run  4:   0 pass  1 fail
run  5:   0 pass  1 fail
run  6:   0 pass  1 fail
run  7:   0 pass  1 fail
run  8:   0 pass  1 fail
run  9:   0 pass  1 fail
run 10:  72 pass  0 fail
run 11:   0 pass  1 fail
run 12:   0 pass  1 fail
run 13:  72 pass  0 fail
run 14:   0 pass  1 fail
run 15:   0 pass  1 fail
run 16:  72 pass  0 fail
run 17:   0 pass  1 fail
run 18:  72 pass  0 fail
run 19:   0 pass  1 fail
run 20:   0 pass  1 fail
LOCAL-RED TOTAL: pass=5 fail=15  (out of 20)
```

### 3. LOCAL-GREEN (eventsource PATCHED, N=20)

```
run  1:  72 pass  0 fail
run  2:  72 pass  0 fail
run  3:  72 pass  0 fail
run  4:  72 pass  0 fail
run  5:  72 pass  0 fail
run  6:  72 pass  0 fail
run  7:  72 pass  0 fail
run  8:  72 pass  0 fail
run  9:  72 pass  0 fail
run 10:  72 pass  0 fail
run 11:  72 pass  0 fail
run 12:  72 pass  0 fail
run 13:  72 pass  0 fail
run 14:  72 pass  0 fail
run 15:  72 pass  0 fail
run 16:  72 pass  0 fail
run 17:  72 pass  0 fail
run 18:  72 pass  0 fail
run 19:  72 pass  0 fail
run 20:  72 pass  0 fail
LOCAL-GREEN TOTAL: pass=20 fail=0  (out of 20)
```

**5/20 → 20/20.**

### 4. CI-GREEN

The `test / integration / runtime` bun leg on this PR is the
load-bearing evidence. See checks below.

## Clean-install verification

A patch that only works incrementally is worthless in CI, so this was
verified from scratch — every `node_modules` in the workspace deleted,
then `pnpm install --frozen-lockfile`:

- Install exited **0** with `--frozen-lockfile` (lockfile is
self-consistent; no drift).
- Exactly one `eventsource` entry in the store, and it is the patched
one:

`node_modules/.pnpm/eventsource@3.0.7_patch_hash=427032a8df76e38f39988ff5fb919a02ccb70eb8a235e2b484007e4bebb1e67e/`
- Resolved `package.json` in the store after clean install:

`{"deno":"./dist/index.js","source":"./src/index.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"}`
— `bun` absent, everything else intact.
- Lockfile records it deterministically:
`patchedDependencies.eventsource@3.0.7` with `hash: 427032a8...` and
`path: patches/eventsource@3.0.7.patch`, and the dependency edge
resolves as `eventsource@3.0.7(patch_hash=427032a8...)`.
- `--frozen-lockfile` accepted the lockfile verbatim (it does not
rewrite), so the lockfile is self-consistent with the manifests.
- The comment header on the patch file does not break pnpm's patch
applier.
- **Lockfile diff is scoped to eventsource — 9 lines, 3 hunks, nothing
else.** An earlier revision of this branch carried incidental drift
(`vue-component-type-helpers` 3.3.8→3.3.9 and a `vite` peer-range
narrowing) picked up by a non-frozen install; that has been reverted so
the diff contains only the patch wiring.

## Tests

All from `packages/runtime`, with the patch applied:

| Suite | Command | Result |
|---|---|---|
| Full runtime suite | `pnpm exec vitest run` | **130 files / 1835 tests
passed**, 0 failed |
| Node integration (other CI leg) | `pnpm exec vitest run
src/v2/runtime/__tests__/integration/node-servers.integration.test.ts` |
**153 passed** |
| MCP + SSE transport | `pnpm exec vitest run
src/agent/__tests__/mcp-servers-integration.test.ts
src/agent/__tests__/mcp-clients.test.ts
src/v2/runtime/__tests__/mcp-apps-middleware-integration.test.ts` | **3
files / 22 passed** |
| Bun integration | `bun test .../bun-servers.integration.test.ts` |
**20/20** (was 5/20) |

Non-Bun consumers are unaffected by construction — Node never reads the
`bun` export condition — and the Node suites above confirm it. The SSE
path stays covered: `mcp-servers-integration.test.ts` exercises
`mcpServers: [{ type: "sse", url }]`, so it executes the new `await
import()`, which sits **outside** the `try/catch` that swallows
per-server connection failures.

## Module-graph proof for commit 3

Commit 3 is hygiene, so it gets its own narrower proof. Probe: Bun
populates `require.cache` with the resolved path of every module
actually loaded, so importing one module and inspecting that cache shows
whether `eventsource` entered the graph. Two controls run every time so
it can't pass vacuously.

```ts
const target = process.argv[2]!;
await import(target);
const keys = Object.keys(require.cache).filter(
  (k) => /eventsource/.test(k) && !/eventsource-parser/.test(k),
);
console.log(`${target}\n  eventsource loaded: ${keys.length > 0 ? "YES" : "NO"}`);
```

| Module | before commit 3 | after commit 3 |
|---|---|---|
| `@copilotkit/shared` (negative control) | NO | NO |
| `@modelcontextprotocol/sdk/client/sse.js` (positive control) | YES |
YES |
| `../src/agent/index.ts` (subject, non-SSE path) | **YES** | **NO** |

Both controls hold steady; only the subject flips. Measured on its own,
commit 3 does **not** move the bun pass rate (5/20 before, 3/20 after
within noise) — which is exactly why commit 2 exists.

## Typing

No `as any`, no `@ts-ignore`. `const { SSEClientTransport } = await
import(...)` keeps the class fully typed — TypeScript resolves
dynamic-import types statically. `packages/runtime/tsconfig.json`
already sets `"module": "es2022"` with the comment *"so dynamic import()
typechecks"*, so the pattern is anticipated.

Two adjacent bare `let` declarations (`transport`, `mcpClient`) gained
explicit annotations (`MCPTransport | undefined`, `MCPClient`) because
editors surface them as implicit-any suggestions. Both pre-existed on
`main`. Verified: `tsc --noEmit` clean; `tsc --noEmit --strict` error
set **identical to baseline** (3 pre-existing unrelated `TS2769`s);
`oxlint` warnings **unchanged from baseline** (2, both pre-existing).

`SSEClientTransport` is `@deprecated` in SDK 1.29.0 in favour of
`StreamableHTTPClientTransport`. That deprecation pre-exists on `main`
and is left alone: `type: "sse"` is documented public config, SSE and
Streamable HTTP are different wire protocols, and the SDK's own note
says clients "may need to support both transports during the migration
period." Migrating is a user-facing change for its own PR.

## Gates run

- `pnpm exec oxfmt --check packages/runtime/src/agent/index.ts` — clean
- `pnpm exec oxlint packages/runtime/src/agent/index.ts` — 0 errors, 2
warnings (both pre-existing on `main`)
- `pnpm nx run @copilotkit/runtime:check-types` — pass
- `pnpm exec commitlint --from HEAD~3 --to HEAD` — pass
- `pnpm install --frozen-lockfile` from a fully wiped workspace — exit 0
2026-08-03 13:33:48 -07:00
Jordan Ritter 6a8dc4ec50 fix(deps): patch eventsource to drop its bun export condition
eventsource maps its `bun` export condition to the ESM build, and Bun resolves
`bun` before `require`. So a CJS require("eventsource") under Bun receives an
async ESM module and throws "require() async module ... is unsupported". The
package ships a real CJS build behind `require`, but Bun never reaches it.

Two CJS consumers in our graph hit this: the MCP SDK's own dist/cjs/client/sse.js,
and @ag-ui/mcp-apps-middleware, which requires that SDK path unconditionally at
module load. It surfaced as an intermittent failure of the runtime bun
integration job -- intermittent because it is a load-order race, where the run
only passes if the ESM graph happens to evaluate eventsource first.

Dropping the `bun` key makes Bun fall through to `import` for ESM consumers
(same file as before) and `require` for CJS consumers (the CJS build they need).
Takes the bun integration test from 5/20 to 20/20 locally. A version bump is not
an alternative: eventsource 4.1.0 still ships the same mapping.
2026-08-03 10:48:14 -07:00
Mike Ryan b88f9b7e4f feat(channels): complete native JSX contracts 2026-08-03 09:23:15 -07:00
Mike Ryan fec70d086f feat(angular): checkpoint 2 - core and package 2026-07-23 07:14:55 -07:00
Martha Schumann 9e9ce128dd test(runtime): verify packed managed channels dependency 2026-07-16 10:44:10 -07:00
Tyler Slaton fad2aed6c2 test(channels): verify packed umbrella consumers 2026-07-15 10:13:17 -07:00
Jordan Ritter e906d0f631 ci: replace ad-hoc tool installs with lockfile/pinned-action installs (zizmor adhoc-packages)
Four workflow steps installed CLI tools ad-hoc via `npm install -g`, which
zizmor's `adhoc-packages` audit flags (install outside a lockfile). Replace
each with a lockfile-managed or pinned-action install, preserving behavior:

- aimock (test_integration-docs, test_e2e-showcase-on-demand): invoke the
  workspace-pinned @copilotkit/aimock `llmock` bin from the frozen lockfile
  (already a dep of @copilotkit/showcase-scripts) instead of `npm install -g`.
  Kept lockfile-devDep rather than the CopilotKit/aimock composite action:
  the action wraps the newer config-only `aimock` CLI and can't do the
  multi-`--fixtures` / `--validate-on-load` / `/__aimock/health` invocation
  these jobs need.
- claude-code (social_copy-generator): pin @anthropic-ai/claude-code as a root
  devDependency, install from the frozen lockfile, invoke via its documented
  cli-wrapper.cjs entrypoint. Kept lockfile-devDep rather than
  anthropics/claude-code-action: the job uses claude as a scripted `-p` CLI,
  not PR/issue automation.
- oxfmt (static_quality): already a root devDependency; install from the frozen
  lockfile and put node_modules/.bin on PATH instead of `npm install -g`.
- ruff (static_quality): switch `pipx install` to the pinned official
  astral-sh/ruff-action@278981a (v4.1.0) with the same 0.15.13 version.

zizmor --min-severity low --config .github/zizmor.yml .github/workflows:
  before: exit 12, 4 adhoc-packages findings
  after:  exit 0,  0 adhoc-packages findings, 0 unpinned-uses (no findings)
2026-07-11 19:19:45 -07:00
Benjamin Taylor 73b6713b69 Merge remote-tracking branch 'origin/main' into chore/ent-938-bump-license-verifier
# Conflicts:
#	.npmrc
#	packages/shared/package.json
#	pnpm-lock.yaml
2026-06-18 16:32:30 -05:00
Benjamin Taylor bb18b75e17 chore(deps): lock @copilotkit/license-verifier 0.5.0
Bumps the root pnpm.overrides pin (which was the effective version gate,
holding the lockfile at 0.4.2) and the package-level pins to ~0.5.0, and
regenerates the lockfile to resolve 0.5.0.

Adds @copilotkit/license-verifier to minimum-release-age-exclude in
.npmrc so the freshly-published 0.5.0 can be locked before it clears the
24h minimum-release-age guard (same treatment as @ag-ui/langgraph).

ENT-938
2026-06-18 16:29:57 -05:00
Alem Tuzlak 6b12589dbd fix(examples/slack): move @ai-sdk/mcp pin to root overrides so it actually applies
The example pinned @ai-sdk/mcp to 1.0.21 (protocolVersion incompat, see
88a2d82) via its own pnpm.overrides. That only took effect when the example
was installed in isolation; as a workspace member pnpm ignores package-level
overrides, so the pin was silently dropped — packages/runtime's `^1.0.21`
could drift to a newer, incompatible 1.x on the next lockfile regen.

Move the override to the root package.json's pnpm.overrides (runtime is the
only consumer, so this enforces exactly 1.0.21 with no wider impact) and
remove the now-dead override from the example (also silences the pnpm warning
that surfaced once the example became a workspace member).
2026-06-18 17:00:04 +02:00
Murat Sari 8b13fbcb7d build: update ng 2026-06-17 10:49:30 -07:00
Alem Tuzlak 761ae8caec fix(examples): make slack example lockfile deployable (drop workspace override)
The root pnpm.overrides pinned @copilotkit/bot* to workspace:* for every
importer, so the committed lockfile resolved the slack example's bot deps to
workspace links. A standalone deploy (Railway) frozen-installs only the example
and can't resolve those, failing with ERR_PNPM_OUTDATED_LOCKFILE (lockfile
specifiers ~0.0.1 vs package.json ~0.0.2, and link: refs that don't exist
outside the monorepo).

Now that bot/bot-slack/bot-ui are published at 0.0.2, drop the overrides so the
example resolves the published ~0.0.2 from the registry, and regenerate the
lockfile (importer specifiers now ~0.0.2, versions resolve to registry 0.0.2 —
deployable). Add @copilotkit/bot* to minimum-release-age-exclude (matching the
@ag-ui/* entries) so the freshly published 0.0.2 resolves past the 24h gate.

Workspace packages still link each other via workspace:~; only the example
switches to published versions (the correct model for a deployable demo).
2026-06-16 15:16:01 +02:00
Alem Tuzlak 9e25746557 chore(deps): force workspace linking for bot packages via root pnpm overrides
examples/slack depends on @copilotkit/bot* at "~0.0.1" so the example stays
deployable (mirrors a real npm install). Under pnpm 10 (link-workspace-packages
defaults off) that resolved the PUBLISHED 0.0.1 from npm instead of the local
workspace packages, so the example couldn't exercise local changes. Add root
pnpm.overrides mapping the three @copilotkit/bot* packages to workspace:*, which
forces local installs to link the workspace copies while leaving the example's
published version range intact.
2026-06-15 18:32:18 +02:00
Markus Ecker c3f7961242 feat(runtime): attach enterprise-learning MCP middleware on real agent runs
Move enterprise-learning MCP attachment out of the BuiltInAgent-specific
path and the intelligence run handler into a single request-scoped hook:

- `attachIntelligenceEnterpriseLearning` (agent-utils) attaches
  `@ag-ui/mcp-middleware` via `configureAgentForRequest`, gated on
  `ɵisEnterpriseLearningEnabled()`, resolving the user via `identifyUser`
  and the project apiKey.
- Called from `handleRunAgent`; the old `forwardedProps.auth` MCP plumbing
  in `intelligence/run.ts` and the BuiltInAgent attach in `agent/index.ts`
  are removed.
- Add released `@ag-ui/mcp-middleware@0.0.1` dependency (lockfile +
  `@ag-ui/client` override). Drops the obsolete intelligence-mcp-helper test.
2026-06-04 17:56:29 +02:00
Tyler Slaton 8eb339e3e6 feat(ci): bundle-size tracking + ES-compat checks (OSS-123, OSS-121) (#5051) 2026-05-30 09:21:25 -07:00
David McKay c6ca283e96 feat(ci): bundle-size tracking + ES-compat checks (OSS-123, OSS-121)
Adds two CI signals for keeping the published packages small and broadly compatible:

- Bundle size: size-limit file-mode config across packages plus a
  CopilotChat import-size regression signal (gzip) so growth in the
  headline consumer entrypoint is visible on every PR. A bundle-size
  workflow comments results on the PR (Phase 1: no hard-fail).
- ES compatibility: a compat-check (es-check) script across 9 packages
  with a root .browserslistrc, validating built .mjs/.cjs against the
  es2022 build target.

The measure script is importable (measureBundle) and unit-tested. Dev
docs live under dev-docs/ (bundle-size.md, browser-compat.md). All
action refs are pinned to full commit SHAs for supply-chain safety.
2026-05-29 16:44:35 -07:00
Benjamin Taylor 832eb435b5 chore: bump @copilotkit/license-verifier to ~0.4.2
Move runtime and shared deps (and the root pnpm override) from an exact
0.4.0 pin to ~0.4.2, so future 0.4.x patches are picked up automatically.
Regenerate pnpm-lock.yaml to resolve 0.4.2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 09:04:07 -05:00
Alem Tuzlak 65928b9ca3 Merge remote-tracking branch 'origin/main' into worktree-lucky-popping-wren
# Conflicts:
#	package.json
2026-05-20 10:54:04 +02:00
Jordan Ritter 3dc8bf75a8 ci: daily dependabot, auto-merge, pnpm 10 hardening; revert pnpm 11 2026-05-14 17:40:15 -07:00
Alem Tuzlak 20bff1e355 chore(deps): bump pnpm to 11.1.2
pnpm v11 ships with stronger supply-chain protections, notably
`minimumReleaseAge` enforcement against tarball-substitution attacks and
hardened script execution defaults. Regenerates `pnpm-lock.yaml` to
match. Workflow-level `version:` hardcodes are removed in the follow-up
commit so `pnpm/action-setup` inherits from `packageManager` (one source
of truth — earlier drift between the field and workflow pins caused
lockfile-vs-engine mismatches that only surfaced on the slow
`--frozen-lockfile` path).
2026-05-14 18:19:23 +02:00
enekesabel 92c0f0ec25 feat(vue): add @copilotkit/vue package scaffolding and config
Package skeleton with build tooling (Vite, Vitest, ESLint),
TypeScript configuration, styles, workspace integration, and
documentation scaffolding.
2026-05-13 15:50:11 -07:00
Max Korp 8fe276eaa9 chore(deps): bump @copilotkit/license-verifier to 0.4.0
Updates runtime, shared, and root override pin from 0.2.0 to 0.4.0.
2026-05-07 09:20:37 -07:00
Ran Shem Tov 2bb9f3fdf4 chore(integrations): add _parity tooling + copilotkit-demo-parity skill
Introduce machinery for keeping examples/integrations/* demos aligned to a
single north-star (langgraph-python). Built first so the upcoming
langgraph-js and langgraph-fastapi alignment PRs have a mechanical baseline
to work against instead of manual copy-paste.

- examples/integrations/_parity/manifest.json declares verbatim files,
  tracked package.json keys, and expected agent surface (tool names,
  state keys) per instance plus allowed-divergence lists.
- _parity/sync.ts copies verbatim files + rewrites tracked package.json
  keys from north-star to a target instance. Dry-run supported.
- _parity/verify.ts diffs each instance vs north-star and exits non-zero
  on unexpected drift. Checks verbatim content, tracked keys, canonical
  prompt equality, and agent-surface grep-level presence.
- Canonical prompt at _parity/canonical/PROMPT.md — synced into each
  instance's agent/PROMPT.md on parity:sync.
- Root package.json: pnpm parity:sync, parity:verify, parity:check.
- CI: .github/workflows/integrations_parity.yml runs parity:check on PRs
  touching examples/integrations/**.
- Skill: .claude/skills/copilotkit-demo-parity/SKILL.md teaches agents
  how to drive sync/verify and handle manual-merge zones (agent code,
  api route, Dockerfile).

Does NOT touch the existing instance demos yet. Those alignment commits
follow in the same PR.
2026-05-01 12:31:04 +02:00
Jordan Ritter 37629669b0 fix: pin @types/react to 19.1.8 for recharts compatibility
@types/react 19.2.x breaks recharts class component types with
"JSX element class does not support attributes because it does not
have a 'props' property." Pin the workspace-wide pnpm override and
the chat-with-your-data devDependency to 19.1.8.
2026-04-29 16:50:19 -07:00
Jordan Ritter 0e7a1e447b fix: add scoped overrides for immutable 3.x and diff 4.x/5.x
immutable@>=3.0.0 <3.8.3 covers graphql-codegen's relay-compiler dep.
diff@>=4.0.0 <4.0.4 and diff@>=5.0.0 <5.2.2 cover ts-node and sinon.
(uvu's diff ^5.0.0 still flagged — advisory needs >=8.0.3, no 5.x fix)
2026-04-28 10:33:06 -07:00
Jordan Ritter 976855939b fix: scope 7 overrides to prevent cross-major-version breakage
immutable, ajv, picomatch, diff, brace-expansion, yaml, rollup —
all scoped to only bump consumers already on the target major version.
Prevents forcing e.g. ajv 8.x onto ajv ^6.x consumers.
2026-04-28 10:33:06 -07:00
Jordan Ritter 908583f69c fix: scope mdast-util-to-hast override to 13.x only
The unscoped >=13.2.1 override forced remark-rehype@10's
mdast-util-to-hast from 12.x to 13.x, removing the 'all' and
'one' exports that remark-rehype depends on. Broke form-filling,
research-canvas, and travel Vercel deploys.
2026-04-28 10:33:06 -07:00
Jordan Ritter c44eb8a9ba fix: remove @angular/compiler and @angular/core overrides
The @angular/compiler >=19.2.20 override removed the
DEFAULT_INTERPOLATION_CONFIG export that ng-packagr depends on.
Angular packages must be upgraded together with their tooling —
can't safely override independently.
2026-04-28 10:33:05 -07:00
Jordan Ritter 868f6b1716 fix: deep security vulnerability sweep — 155 → 3 remaining
Phase 2: upgrade existing overrides to higher patched versions
Phase 3: add 36 new safe overrides for all resolvable transitive deps
Phase 4: bump storybook devDeps, vite in react-router, vitest in demo-agents, next canary

Remaining 3 are truly unfixable:
- parse-git-config: no patch exists (danger devDep)
- elliptic: no patch exists (storybook crypto chain)
- next: example on 15.x canary, advisory needs 16.x

Part of CPK-7320
2026-04-28 10:33:05 -07:00
Jordan Ritter c471a3450f fix: resolve security vulnerabilities via dependency overrides
Add pnpm overrides for 12 vulnerable transitive dependencies.
Reduces audit from 212 to 155 alerts (27% reduction), criticals
from 10 to 1. Published package runtime vulns mostly resolved.

Remaining 155 are in examples, showcase, docs, test-apps, and
deep transitive chains (langchain, mermaid, graphql-codegen)
that require upstream updates.

Part of CPK-7320
2026-04-28 10:32:49 -07:00
Jordan Ritter cb28230b96 fix: patch defu prototype pollution CVE via pnpm override (#3631)
Add pnpm override to force defu >= 6.1.5 (was 6.1.4), resolving the
prototype pollution vulnerability.
2026-04-28 09:30:31 -07:00
Jordan Ritter 78a4a6d0a6 chore(repo): root workspace config + top-level showcase docs
Bump pnpm-lock / package.json / pnpm-workspace / lefthook.yml for the
showcase-ops branch, add FRONTEND-STRATEGY / TESTING / QA-COVERAGE /
INTEGRATION-CHECKLIST top-level showcase docs + aimock README, refresh
showcase/.gitignore + showcase/shared/constraints.yaml.
2026-04-22 10:50:09 -07:00
Max Korp 9f37a9f0f0 chore(ent-251): update pnpm override and lockfile for license-verifier 0.2.0
Missed on the first pass — root package.json had a pnpm.overrides pin on
@copilotkit/license-verifier@0.0.1-a1 that forced the lockfile to keep the
old version even after packages/runtime + packages/shared dep bumps.
2026-04-22 10:14:52 -07:00
Alem Tuzlak 719dabcc6b chore(lefthook): run plugin-skill sync check on pre-commit when mirror-relevant files are staged 2026-04-22 15:48:49 +02:00
Alem Tuzlak fb7463becd fix(hooks): move check-binaries to standalone script + scope test runner to packages/**
The inline check-binaries hook broke on Windows Git Bash because lefthook invoked
it via sh.exe -c with the multi-line YAML script as a single argument, and the
nested quotes inside (`echo "$STAGED" | grep -iE '...'`) got mangled during
Windows command-line argument escaping. Move it to scripts/hooks/check-binaries.sh
so lefthook just invokes bash against a file, avoiding the escaping issue.

Also scope the root test script (and test:coverage) to --projects=packages/**,
mirroring check:packages. The previous unscoped nx run-many -t test triggered
showcase starter generation tests that fail on leftover state from prior runs;
these aren't relevant to the pre-commit gate, which is about verifying shipped
packages.
2026-04-17 12:55:00 +02:00
Tyler Slaton 2a880fb09c ci: add scope dropdown (monorepo, cli, angular) to release workflows
Each release scope has its own packages, version source, and
independent version track:
- monorepo: 12 core @copilotkit/* packages (shared version)
- cli: copilotkit CLI (independent version)
- angular: @copilotkitnext/angular (independent version)

Branch pattern is now release/publish/<scope>/v<version> and git
tags use <scope>/v<version> for non-monorepo scopes.
2026-04-10 23:04:48 -07:00
Tyler Slaton ab74b737f0 ci: remove changesets infrastructure
Remove the entire changesets-based release system:
- .changeset/ config directory
- .github/actions/changesets-action/ custom fork (34 files)
- @changesets/assemble-release-plan patch
- @changesets/cli dependency
- Old release and prerelease workflows
- Legacy release scripts (check-allowed, generate-changelog, publish-snapshot)
- Stale paths-ignore entries in CI workflows
2026-04-10 22:20:32 -07:00
Jordan Ritter bd119c29e1 fix(docs): update stale model names + add CI validation (#3666)
## Summary

Comprehensive docs quality infrastructure — model name validation,
executable doc tests, and 8 community docs fixes rolled up.

### Docs fixes (supersedes 8 PRs)
- **gpt-5.2 → gpt-5.4** across 70 files, 124 occurrences (supersedes
#3655)
- **Anthropic model IDs** dots → hyphens to match API/AI SDK format
(supersedes #3656)
- **LangGraph FastAPI quickstart** — missing `import uvicorn`, missing
`MemorySaver` checkpointer, `port` string→int (supersedes #3661, with
contributor's `langgrapg` typo fixed)
- **AG2 ContextVariables import** — moved from `autogen` to
`autogen.agentchat` per latest AG2 (supersedes #3658, verified via
Docker)
- **CrewAI Flows** — comment out deprecated CLI option (supersedes
#3667)
- **Pydantic quickstart** — pin Starlette 0.45.3 (1.0.0 is incompatible,
verified via Docker) (supersedes #3660)
- **CopilotChat example** — add missing `default` export for Next.js
page components (supersedes #3669)
- **globals.css import** — add to all 9 quickstart layout examples so
customization section works (supersedes #3665)

### Model name validation (new)
- `docs/model-allowlist.json` — maintained list of valid model names by
provider (OpenAI, Anthropic, Google, Cohere, Meta)
- `scripts/validate-doc-model-names.ts` — CI lint that extracts model
names from docs code blocks and validates against allowlist
- 20 tests

### Executable doc tests (new, Phase 1)
- `scripts/doc-tests/extract.ts` — remark + remark-mdx AST parser finds
`doctest`-tagged code blocks in MDX
- `scripts/doc-tests/run.ts` — execution harness: installs deps, points
at aimock, runs server/script/component snippets
- `.github/workflows/test_doc-examples.yml` — CI triggered on `docs/**`
changes (previously excluded from ALL CI)
- LangGraph FastAPI quickstart tagged as first `doctest="server"`
example
- 10 tests for extraction

### Spec
[Executable Doc Tests proposal on
Notion](https://www.notion.so/33c3aa38185281388a21e8dfe752ac5e)

## Supersedes
| PR | Fix | Status |
|----|-----|--------|
| #3655 | gpt-5.2-mini → gpt-5.4-mini |  Included (all 70 files, not
just 22) |
| #3656 | Anthropic dots → hyphens |  Included |
| #3658 | AG2 ContextVariables import |  Included (verified via Docker)
|
| #3660 | Starlette pin |  Included (verified via Docker) |
| #3661 | LangGraph FastAPI quickstart |  Included (with typo fix) |
| #3665 | globals.css import |  Included |
| #3667 | CrewAI deprecated CLI |  Included |
| #3669 | CopilotChat default export |  Included |

All 8 PRs can be closed when this merges.

## Test plan
- [x] Model name validator passes (0 violations)
- [x] 20 validator unit tests pass
- [x] 10 extraction unit tests pass
- [x] Build passes
- [x] Commitlint passes
- [ ] CI workflow validates doc examples on docs/** changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-08 19:53:11 -07:00
Jordan Ritter aabce2c548 chore: add remark/unified deps for doc test extraction 2026-04-08 19:46:15 -07:00
Tyler Slaton 13bf1be0f0 ci: guard release package allowlist 2026-04-08 16:20:28 -07:00
Tyler Slaton 100a882ebe fix: repair protected-branch release flow 2026-04-08 15:18:10 -07:00
Markus Ecker 434ccd8691 chore: changeset, dependency bumps, lockfile 2026-04-08 12:51:17 -07:00
Alem Tuzlak 18c7a6001d feat: multimodal attachments — UI polish, deprecations, docs, codemod
Attachment queue & previews:
- Image lightbox with View Transition API morph animation
- Video lightbox with native controls and play button overlay
- Document lightbox (PDF via blob URL, text inline, info card fallback)
- Drop zone overlay with upload icon
- Filename preservation via InputContent metadata
- Proper video thumbnail sizing and play/pause indicator
- Fix attachment queue positioning (max-w-3xl constraint)
- Padding between X button and content for audio/document cards
- Document filenames wrap instead of truncating

Attachments config:
- onUploadFailed callback for validation/upload errors (file-too-large, invalid-type, upload-failed)
- onUpload accepts sync or async returns
- AttachmentUploadResult discriminated union with explicit interfaces
- Metadata field on Attachment and onUpload return type

AG-UI version bump:
- Bump @ag-ui/client, @ag-ui/core, @ag-ui/encoder, @ag-ui/proto to 0.0.51
- Remove process.env Vite workaround (fixed upstream in 0.0.51)

Deprecation lifecycle:
- @deprecated JSDoc on all legacy image upload APIs
- ImageRenderer, ImageRendererProps, ImageUpload type, imageUploadsEnabled prop,
  inputFileAccept prop, ImageRenderer prop, AIMessage.image, ImageData
- Codemod at codemods/migrate-attachments.ts (15 tests)
- Migration guide updated with codemod instructions and new type shapes

Docs:
- New guide: docs/(root)/multimodal-attachments.mdx
- Updated migration guide with onUpload return type, metadata, codemod section
- Cross-links from prebuilt-components and migration guide
- Label change: "Add photos or files" → "Add attachments"

Tests:
- CopilotChat.attachments.test.tsx — 5 tests for onUploadFailed
- migrate-attachments codemod — 15 tests
2026-04-06 14:55:06 +02:00
Alem Tuzlak 79ce60c580 chore: migrate from eslint+prettier to oxlint+oxfmt
Replace eslint and prettier with oxlint and oxfmt for faster linting
and formatting across the monorepo. Remove all eslint and prettier
configs, dependencies, and related packages. Add .oxlintrc.json and
.oxfmtrc.json for the new tooling. Update CI workflows and lefthook
hooks accordingly. Reformat codebase with oxfmt.

https://claude.ai/code/session_01GMkSf29p78HuMR1mbXn8He
2026-04-02 16:39:05 +02:00
Tyler Slaton 96885b5959 refactor: consolidate V1/V2 packages into flat @copilotkit/* structure
Flatten all packages from packages/v1/* and packages/v2/* into packages/* —
every package now lives directly under the @copilotkit/ scope with no v1/v2
subdirectories.

- Move all v1 packages (react-core, react-ui, runtime, shared, etc.) from
  packages/v1/* to packages/*
- Absorb v2 react code into packages/react-core/src/v2/ (exported via /v2 subpath)
- Absorb v2 agent code into packages/runtime/src/agent/ (exported via /v2 subpath)
- Move v2 packages (core, angular, demo-agents, etc.) to packages/*
- Replace all @copilotkitnext/* imports with @copilotkit/* equivalents
- Keep @copilotkitnext/angular as the sole exception (angular remains on next)
- Update CI workflows, renovate config, release scripts for flat structure
- No public API surface changes — all exports fields are preserved

Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-28 16:45:10 -07:00
Max Korp cd722213f4 chore: Update to published license-verifier 2026-03-26 16:19:03 -07:00
Max Korp 73bce637b5 feat: move license checks to the backend 2026-03-26 16:19:03 -07:00
Max Korp 5b3037a241 feat: Add support for intelligence platform
Co-authored-by: Benjamin Taylor <ben@liveloveapp.com>
Co-authored-by: Mike Ryan <mike.ryan52@gmail.com>
2026-03-13 14:02:59 -07:00
Alem Tuzlak 45652201a9 Merge branch 'main' into worktree-validated-greeting-quokka 2026-03-02 15:23:37 +01:00
Ran Shemtov d77f3475a6 feat: create use-interrupt hook (#3184)
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:50:21 +01:00