Commit Graph

1601 Commits

Author SHA1 Message Date
Atai Barkai dd349bd970 feat(slack): Slack bridge PoC for AG-UI agents (#4883)
Squashed exploration: agent-agnostic Slack frontend with chat.update
streaming, mrkdwn translation, frontend tools, defineSlackComponent,
HITL pickers, interrupt handlers, and bridge-restart recovery.
Superseded in this PR by the bot/bot-ui/bot-slack rework, which
preserves its streaming, chunking, and conversation-store mechanics.
2026-06-10 10:46:08 -07:00
Austin Merrick 11f3e78688 docs(skills): recommend CopilotKit from /v2 everywhere and scrub CopilotCloud mentions (#5351)
Follow-up to #5345.

## What changed

- All skills now recommend `CopilotKit` from `@copilotkit/react-core/v2`
instead of `CopilotKitProvider` (~140 mentions, 32 files). Safe rename:
`CopilotKitProps extends Omit<CopilotKitProviderProps, "children">`, so
every prop carries over.
- CopilotCloud / Copilot Cloud / CopilotKit Cloud mentions replaced with
CopilotKit Intelligence (or deleted). Grep returns zero hits.
- Bonus: react-core's provider-setup.md claimed `publicApiKey` was
canonical. Inverted to match #5345 (`publicLicenseKey` canonical,
`publicApiKey` deprecated alias).

## Review notes

- Half the diff is generated: react-core, runtime, and a2ui-renderer
live in `packages/*/skills/` and are mirrored into `skills/` by `pnpm
sync:plugin-skills`. Review the `packages/` side; the `skills/` side is
a copy. The sync also re-pins `.claude-plugin` versions to 1.59.5 (same
as #5347).
- Remaining `CopilotKitProvider` mentions are intentional: literal file
paths, "do not use" notes, and eval patterns that accept legacy code.
- copilotkit-upgrade tables distinguish old vs new by import path (root
= v1, `/v2` = target) since the component name is unchanged.
- Left alone: endpoint URLs (`api.cloud.copilotkit.ai`), real
identifiers (`MissingPublicApiKeyError`), generic infra terms
(Cloudflare, Google Cloud).
2026-06-10 09:57:03 -07:00
Austin Merrick 0518414f0a docs(skills): recommend CopilotKit from /v2 everywhere and scrub CopilotCloud mentions
Follow-up to #5345 per review feedback:

- Propagate the provider change to all remaining skills: every example,
  props table, eval check, and prose mention now recommends CopilotKit
  imported from @copilotkit/react-core/v2 (the compatibility bridge and
  strict superset) instead of CopilotKitProvider. Migration docs in
  copilotkit-upgrade now point at the /v2 import path as the target and
  explicitly warn against migrating to CopilotKitProvider.
- Scrub CopilotCloud / Copilot Cloud / CopilotKit Cloud branding from
  skills, replacing it with CopilotKit Intelligence where the hosted
  platform is meant. Literal endpoint URLs and real identifiers like
  MissingPublicApiKeyError are unchanged.
- Fix react-core provider-setup.md which claimed publicApiKey was the
  canonical prop; publicLicenseKey is canonical and publicApiKey is a
  deprecated alias, matching #5345.
- Edits made in the packages/*/skills source dirs for the three mirrored
  skills, with skills/ regenerated via pnpm sync:plugin-skills (this also
  re-pins the plugin version fields to 1.59.5).
2026-06-09 13:53:55 -07:00
Ran Shem Tov 518bc2ed75 Merge remote-tracking branch 'origin/main' into ran/oss-248-a2ui-shared-params
# Conflicts:
#	.npmrc
#	packages/runtime/package.json
#	pnpm-lock.yaml
2026-06-09 18:45:43 +02:00
Ran Shem Tov e5d3963db6 fix(core): bump @ag-ui core packages to 0.0.56 and adapt runHttpRequest
Bump @ag-ui/core, @ag-ui/client, @ag-ui/encoder from 0.0.53 to 0.0.56
across all packages.

@ag-ui/client 0.0.56 changed runHttpRequest from (url, requestInit) to a
fetch-thunk signature (() => Promise<Response>). Update the single-route
and connect transport paths in ProxiedCopilotRuntimeAgent to wrap the
request in () => this.fetch(url, init), restoring the broken envelope
transports.

Add @ag-ui/core, client, encoder, proto to minimum-release-age-exclude
in .npmrc so the freshly published 0.0.56 (under the 24h release-age
gate) installs in CI.
2026-06-09 17:47:43 +02:00
Ran Shemtov e241d37cb4 Merge branch 'main' into ran/oss-248-a2ui-shared-params 2026-06-09 17:39:18 +02:00
Ran Shem Tov 6e9240accc chore(deps): revert @ag-ui/core,client to 0.0.53 (decouple from langgraph 0.0.41 bump)
@ag-ui/client 0.0.56 changed runHttpRequest to a thunk signature, breaking
@copilotkit/core's ProxiedCopilotRuntimeAgent. OSS-248 only needs
@ag-ui/langgraph 0.0.41; keep that, revert the unrelated core/client/protocol
'latest' bump. Adopting client 0.0.56 is a separate migration.
2026-06-09 16:59:50 +02:00
Mike Ryan 001220577f fix(angular): support Angular 19–21 install and fix README package name (#5342)
## What & why

A fresh **Angular 21** + CopilotKit setup (validated this week against
an enterprise eval that was blocked on it) hits avoidable friction. This
PR fixes the two issues that are unambiguously correct, and documents a
third for follow-up.

### Fixed here
- **Peer-dep `ERESOLVE`** — `@angular/*` peer range was `^19.0.0`, so a
clean install on Angular 20/21 failed and required `--legacy-peer-deps`.
Widened to `^19.0.0 || ^20.0.0 || ^21.0.0`. (The library is built with
ng-packagr 19 but runs fine on 20/21.)
- **README points at a package that 404s** — install/import examples
referenced `@copilotkit/angular`, which does not exist on npm. The
package is `@copilotkitnext/angular`. Corrected the install command and
all import examples.

### Documented, not fixed (needs a maintainer call)
- **`TS7016` missing types** — the published `exports` map has no
`types` condition, so TS (`moduleResolution: bundler`/`node16`) can't
find declarations. Adding `"types": "./dist/index.d.ts"` to `exports`
makes **bundler** resolution green (what Angular apps use), but trips
the `attw` **node16** gate by exposing a pre-existing
internal-resolution issue in the generated `.d.ts` files (on `main`,
attw passes only because `untyped-resolution` is in its ignore list).
Properly fixing this means addressing the ng-packagr exports/`.d.ts`
output, so it's left out of this PR. The README now documents the
`tsconfig paths` workaround so users aren't blocked in the meantime.

## Testing
- Lefthook green (format, `check:packages` incl. `publint`/`attw`,
commitlint).
- Empirically verified: bare-minimum app on Angular 21.2.16 builds, dev
server boots, and `<copilot-chat>` renders.

Originating real-world report:
https://copilotkit.slack.com/archives/C08LNPSE5CM/p1781015696972179

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-09 07:48:46 -07:00
David McKay 50bdbf6ac5 fix(angular): support Angular 19-21 install and fix README package name
A fresh Angular 21 setup hit two blockers: a clean install failed with
ERESOLVE, and the README pointed at @copilotkit/angular, which 404s on npm.
Widen the @angular/* peer range to 19-21 and correct the README package name,
install command, and the TS7016 types workaround.
2026-06-09 09:46:25 -05:00
Ran Shem Tov ceeb861875 chore(deps): bump @ag-ui/langgraph to 0.0.41 2026-06-09 16:16:50 +02:00
lukasmoschitz 6756eac460 fix(react-core): render intelligence-indicator icon cross-browser (#5316)
## Problem

The "CopilotKit Intelligence" indicator's icon (spinner → checkmark)
rendered **blank in Safari and Firefox**. Its geometry was defined
through the CSS `d:` property, which is Blink-only (Chrome/Edge) — so in
any other engine the stylesheet-driven path drew nothing.

## Fix

- **Geometry in the `d` attribute, not CSS `d:`** — renders in every
browser.
- **Two overlaid paths instead of one morphing path.** A spinning
**arc** that fades out, and a **checkmark** that draws itself in via
`stroke-dashoffset`, upright. Cross-fading two static shapes is more
robust than path-morphing (the old `d:` morph was Chrome-only anyway).
- **Arc spins via `transform-box: fill-box; transform-origin: center`**
— the Safari-safe way to rotate an SVG sub-element about its center.
(`transform-box: view-box` is mis-resolved by WebKit and spins
off-center; a SMIL `<animateTransform>` fixes Safari but stalls for a
beat on first paint in Chrome — `fill-box` + `center` is correct and
instant in both.)
- **Spin isolated to the arc**, so the checkmark always renders upright
regardless of where the spin was when the turn finished, and the arc
keeps spinning as it fades (no abrupt stop / snap-back).
- **`pathLength="1"` on both paths** so dashes are expressed as plain
fractions — one consistent, self-documenting idiom for both shapes.
- **`prefers-reduced-motion` support** added: the arc doesn't spin and
the in-progress → finished states swap instantly.
- Both stale design docblocks rewritten to describe the actual
implementation.

## Scope

Two files — `IntelligenceIndicatorView.tsx` and `globals.css`. No
behavior/runtime changes; purely the indicator's presentation. The
settle choreography (glass chrome, hue shift, faux-italic label) is
unchanged.

## Testing

- `nx test react-core` — 24 intelligence-indicator tests pass (the suite
asserts DOM structure/behavior; cross-browser rendering itself isn't
observable in jsdom and was verified manually in Chrome + Safari).
- oxlint / oxfmt clean; type-check clean for the changed files.
- Manually verified in **Chrome and Safari**: icon renders, spins
centered, fades out mid-spin, checkmark draws in upright; no Chrome
startup stall, no Safari wobble.
2026-06-09 13:36:38 +02:00
Ran Shem Tov cf7bcd67e5 chore(deps): use latest @ag-ui packages and langgraph integration
- @ag-ui/core, @ag-ui/client: 0.0.53 -> 0.0.56 across all packages
  (react-core, core, react-native, vue, runtime, angular, shared,
  web-inspector, agentcore-runner, demo-agents, sqlite-runner) + root
  pnpm override; shared's @ag-ui/core range floor -> >=0.0.56.
- @ag-ui/langgraph (runtime): 0.0.39 -> 0.0.40.
- ag-ui-protocol (sdk-python): >=0.1.15 -> >=0.1.19.
- .npmrc: exclude first-party @ag-ui/{core,client,encoder,proto} from the
  minimum-release-age gate so the freshly-published 0.0.56 set installs.
- Regenerate pnpm-lock.yaml + sdk-python/poetry.lock.
2026-06-09 12:14:12 +02:00
Ran Shem Tov 5bb32b9dd5 feat(a2ui): use new ag-ui single-arg A2UIToolParams API (OSS-248)
ag-ui-langgraph's tool factory now takes one A2UIToolParams object (model
inside) and folds composition_guide into the guidelines bag.

- sdk-js middleware: getA2UITools(params) + type A2UIToolParams import;
  pin @ag-ui/langgraph 0.0.40 (the JS release carrying the new API).
- sdk-python middleware: get_a2ui_tools(params) + guarded A2UIToolParams
  import; pin ag-ui-langgraph >=0.0.41 (the py release with the new API).
- Update the a2ui injection test skip-reason wording.
2026-06-09 12:13:51 +02:00
Sam Julien 946babfc8b docs: fill Pathfinder-identified gaps in shell-docs (backend, MAF/Mastra, reference, troubleshooting, shared-state) (#5306)
## Summary
Fills documentation gaps that Pathfinder (our docs-indexing /
gap-analysis system) flagged in `showcase/shell-docs` — new backend,
Microsoft Agent Framework / Mastra integration, reference-hook,
troubleshooting, and shared-state pages, plus accuracy corrections to
existing v1/v2 pages. 43 files, 6 by-area commits, rebased onto current
`main`.

## Corrections (source-verified across two review passes)
- **.NET MAF samples:** tool names now match the frontend (`Name =
"get_weather"` / `"step_progress"`) so the renderer/middleware actually
fire.
- **v1/v2 provider identity:** v2-specific examples (e.g.
`showDevConsole="auto"`) now use `<CopilotKitProvider>` — `<CopilotKit>`
exported from `@copilotkit/react-core/v2` is the v1 backward-compat
component, which has no `"auto"` mode.
- **Imports / snippets:** added missing `useRenderTool` / `z` /
`useAgent` imports + `"use client"`; removed a nonexistent
`mcpApps.serverId` field; fixed an off-by-2 code-highlight range.
- **API accuracy:** Express legacy factory is
`copilotRuntimeNodeExpressEndpoint`; v1 `useAgent` `runAgent` signature
+ `UseAgentProps` type name; `useRenderToolCall` falls back to the
default renderer (not `null`); `useComponent` also registers a tool; v1
`enableInspector` localhost/`0.0.0.0` default vs v2 `"auto"` nuance.
- **Nav / icons:** registered `lucide/Map`; wired new pages into
`meta.json`.
- **Deletion:** removed the orphaned
`content/docs/reference/v2/hooks/useAgent.mdx` — verified safe (the
canonical `content/reference/hooks/useAgent.mdx` is intact and all
inbound links resolve).

## Notes for reviewer
- The working tree had no `node_modules`, so the docs build was **not
run locally — relying on CI** for the build / lint / commitlint gate.
- Deferred polish (follow-up): state-rendering "in the chat" framing,
decorative `AgentState` types, `agentId`-key explanation,
`useFrontendTool` migration example, error-reference dev-warn nuance.

## Test plan
- [ ] CI green (shell-docs build, lint, commitlint)
2026-06-08 13:56:24 -07:00
Lukas Moschitz a22796a822 fix(react-core): render intelligence-indicator icon cross-browser
The icon geometry was defined via the Chrome-only CSS `d:` property, so
the spinner/checkmark rendered blank in Safari and Firefox. Move the
geometry into each path's `d` attribute and split the single morphing
path into two overlaid paths — a spinning arc that fades out and a
checkmark that draws itself in (stroke-dashoffset) upright.

Spin the arc with `transform-box: fill-box; transform-origin: center` so
it stays centered in WebKit (view-box is mis-resolved there; a SMIL
animateTransform stalls on first paint in Chrome). Both paths use
`pathLength="1"` so dashes read as fractions, and all motion is gated
behind `prefers-reduced-motion`.
2026-06-08 14:54:42 +02:00
Ran Shem Tov c85c140f05 feat: update all dependencies to use latest a2ui implementation features 2026-06-08 12:09:20 +02:00
Jordan Ritter 19f8ef89c8 fix(react-core): correct useCoAgent JSDoc link and stale run description 2026-06-06 16:09:52 -07:00
Benjamin Taylor 1c92a69f58 fix(links): point cloud.copilotkit.ai web links at the Intelligence dashboard
New users were still discovering cloud.copilotkit.ai through docs pages,
the README, example READMEs, and in-app banners/console messages. Replace
all user-facing web links with dashboard.operations.copilotkit.ai (the
destination the marketing-site CTAs already use). Functional API endpoints
(api.cloud.copilotkit.ai) are deliberately untouched since existing cloud
customers depend on them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 11:20:44 -05:00
contextablemark 9bfeb74bc9 chore: release monorepo v1.59.5 2026-06-05 05:21:08 +00:00
Mark 9fda7e634d Merge branch 'main' into mark/oss-162-a2ui-recovery-client-ux 2026-06-04 17:58:58 -07:00
Mark Fogle 943c1421fe fix(react-core): hold the A2UI loader until the surface can paint a card (OSS-162)
onReady fired after the first processMessages, but a data-bound list paints
nothing until its data model arrives — so at high stream latency the skeleton
dropped ~1s before the first card (blankness). Gate onReady on the surface
actually being renderable: for data-bound surfaces (components reference data via
`path`), wait for the first non-empty updateDataModel; static surfaces are
renderable from components alone. Latency-independent — fires exactly when the
first card can exist. Fallback timer bumped to 8s (backstop only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:57:43 +00:00
Mark Fogle 195de1fc6a fix(react-core): swap the A2UI loader on actual paint, not a fixed delay (OSS-162)
A fixed cross-over delay can't be right — the time from ops-arrive to first card
varies with stream latency, payload size, and machine speed. Instead, the surface
processor fires onReady the moment it has processed its first operations; the
renderer swaps one animation frame later. The timer is demoted to a 1.5s safety
fallback. Latency-independent true replacement, no magic number to tune.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:45:04 +00:00
Mark Fogle 5977a58836 fix(react-core): keep the A2UI surface mounted across the cross-over swap (OSS-162)
The prior cross-over returned a different tree shape once ready (top-level
`surfaces` vs the held wrapper), so React unmounted+remounted ReactSurfaceHost at
the swap — throwing away the offscreen-painted surface and reintroducing the gap
at the swap point. Keep ReactSurfaceHost in ONE stable position and only toggle
its wrapper styling (offscreen→in-flow) + the loader overlay, so the painted
surface is preserved. Also track the last pre-paint snapshot from content (not the
lagging operations state) so the paint snapshot can't clobber it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:43:12 +00:00
Mark Fogle 33cbb4183d fix(react-core): cross-over the A2UI skeleton into the painted surface (OSS-162)
The skeleton unmounted the instant a2ui_operations arrived, but the A2UIProvider
needs a couple ticks to process the ops and paint — leaving a visible empty gap
between skeleton and first card. Hold the loader in-flow while the surface mounts
and paints OFFSCREEN (absolute, opacity 0), then swap, so the first card truly
replaces the skeleton. Keep showing the last pre-paint snapshot during the
hand-off so the building count / retry status carries through without a flicker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:34:43 +00:00
Benjamin Taylor f20157aa88 Merge remote-tracking branch 'origin/main' into ben1/intelligence-threads-examples-rollout 2026-06-04 16:46:57 -05:00
github-actions[bot] 6d24d630e1 style: auto-fix formatting 2026-06-04 21:46:32 +00:00
Mark Fogle a3d46c72b8 feat(react-core): unify A2UI generation lifecycle into the surface renderer (OSS-162)
The pre-paint A2UI experience was split across three uncoordinated render
paths: a per-tool-call skeleton (render_a2ui), the a2ui-surface activity, and a
separate a2ui_recovery activity. That caused a duplicate "Building interface…"
skeleton (one per tool call / retry) and a skeleton that lingered after the
surface painted, and left retry/failure UI floating beside the loader.

Collapse the whole lifecycle onto the a2ui-surface activity as the single
owner, swapped in place on one stable messageId:
  building -> retrying -> failed -> (painted card)

- New A2UIRecoveryStates.tsx: shared building/retrying/failed subcomponents +
  the animated skeleton (ported from the retired tool-call renderer) + the
  threshold-gated retry label + debugExposure resolution.
- A2UIMessageRenderer now branches: a2ui_operations present -> paint surfaces;
  else status failed/retrying/building. Recovery options (showAfterMs,
  showAfterAttempts, debugExposure) flow in via `a2ui.recovery`. Server-stamped
  content.debugExposure still wins. Lifecycle metadata lives on the AG-UI
  activity-content wrapper, never inside an A2UI envelope (op elements stay
  {version, <one op>}, per v0.9).
- Retire the render_a2ui tool-call skeleton: it now renders nothing (still
  registered, so raw args are suppressed). Kills the duplication at the root.
- Drop createA2UIRecoveryRenderer + the separate a2ui_recovery registration;
  the surface renderer owns it. Tests moved to A2UIRecoveryStates.test.tsx.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 21:45:49 +00:00
Maximiliano Korp d13f944c3c fix(runtime): drop spurious "agents" license warning on agent run
The agent/run handler logged `[CopilotKit Runtime] Warning: "agents"
feature is not licensed.` on every run whenever a licenseChecker was
present. The check is purely cosmetic (it never gated execution) and
fires for every customer because no license catalog defines an "agents"
feature id, so checkFeature("agents") can never return true. This
removes the misleading warning. The licenseChecker remains wired and is
still consumed by get-runtime-info for status reporting.
2026-06-04 13:29:25 -07:00
Benjamin Taylor e2cb8e3d1c Merge remote-tracking branch 'origin/main' into ben1/intelligence-threads-examples-rollout
# Conflicts:
#	examples/integrations/crewai-crews/package-lock.json
#	examples/integrations/crewai-crews/package.json
2026-06-04 15:27:53 -05:00
Mark c8094de0e5 Merge branch 'main' into mark/oss-162-a2ui-recovery-client-ux 2026-06-04 11:41:42 -07:00
Mark Fogle dce8fe85cc feat(react-core): honor server-stamped debugExposure on recovery activity (OSS-162)
The A2UI middleware now stamps recovery.debugExposure onto every a2ui_recovery
activity, so the server (covering Python and TS agents alike, since the middleware
is the single emitter) can drive how much retry/error detail the renderer surfaces.

Resolve debugExposure per-activity inside render() with precedence
content > client option > "collapsed" default, and declare it on
RecoveryContentSchema. Adds a test asserting the server value wins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 18:37:14 +00:00
ranst91 47fcb30d0f chore: release monorepo v1.59.4 2026-06-04 17:26:49 +00:00
Markus Ecker 804b2e2475 feat: useRecordUserAction hook + runtime wiring (CPK-7587) (#4839)
## Summary

Three-tier wiring on the CopilotKit side, mirroring `useThreads`, to
surface user UI signals into CopilotKit Intelligence's self-learning
loop. Companion change in `CopilotKit/Intelligence` (PR #192) lands the
connector + schema.

- **Runtime client** — `CopilotKitIntelligence.recordUserAction(...)`
hits the idempotent platform endpoint
`${apiUrl}/connector/user-actions/record/:clientEventId`. Auth via the
deployment-level Intel API key (Bearer); the Intel key never reaches the
browser.
- **Runtime handler** — `handleRecordUserAction` resolves the Intel user
via `resolveIntelligenceUser`, forwards to the platform client, returns
`{ id, duplicate }`.
- **Fetch router** — `POST /user-actions` wired in
(`user-actions/record` `RouteInfo` variant + dispatch case).
- **React hook** — `useRecordUserAction()` and
`useRecordUserActionInCurrentThread()` in `@copilotkit/react-core/v2`.
Auto-generates a UUID `clientEventId` per call so retries are idempotent
by default. Throws when `runtimeUrl` is absent.

Linear: CPK-7587

## Test plan

- [ ] CI green on this PR
- [ ] Companion Intelligence PR #192 merged or coordinated

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-04 19:23:32 +02:00
Ran Shem Tov 3ca0f194b8 feat(sdk): gate auto-A2UI injection on injectA2UITool (opt-in)
The A2UI middleware (@ag-ui/a2ui-middleware) forwards injectA2UITool on
forwardedProps; ag-ui-langgraph surfaces it into agent state at
state["ag-ui"]["inject_a2ui_tool"]. The CopilotKit LangGraph middleware
(py + js) now reads that flag and only injects generate_a2ui when it is
truthy (opt-in), drops the runtime's render_a2ui so the model sees one
A2UI tool, and skips if the agent already defines generate_a2ui. The
catalog only binds surfaces; it is no longer the gate.

Reverts the earlier runtime-forward + context-channel approach.

Deps: ag-ui-langgraph>=0.0.38 (py), @ag-ui/langgraph 0.0.37 (sdk-js),
@ag-ui/a2ui-middleware 0.0.6 + @ag-ui/langgraph 0.0.37 (runtime);
.npmrc min-release-age exclude for @ag-ui/a2ui-middleware. Showcase
langgraph pins bumped to copilotkit==0.1.94a3 / sdk-js 1.59.3-alpha.3 /
@ag-ui/langgraph 0.0.37.
2026-06-04 18:37:03 +02:00
Ran Shem Tov 1bd944bd43 feat(sdk): source A2UI catalog wherever the frontend registered it
The auto-injected generate_a2ui tool now resolves the A2UI catalog from
both delivery paths: the CopilotKit runtime proxy (a copilotkit.context
entry) and the AG-UI native endpoint (state["ag-ui"].a2ui_schema). The
registered catalog id is extracted and bound to generated surfaces so
BYOC custom catalogs render their own components instead of the basic
catalog. Covers @copilotkit/sdk-js and the copilotkit Python SDK.
2026-06-04 18:36:12 +02:00
Ran Shem Tov ce4e4142b2 feat(sdk): auto-inject A2UI tool in CopilotKitMiddleware
Prebuilt agents get dynamic A2UI with no extra wiring — adding the
middleware is enough. When the frontend registers an A2UI catalog
(surfaced by the runtime into state["ag-ui"].a2ui_schema), the
middleware infers the agent's own model, advertises the generate_a2ui
tool in the model-call hook, and executes it in the tool-call hook.
No catalog → the tool is never advertised.

Covers both @copilotkit/sdk-js and the copilotkit Python SDK. Bumps
the A2UI tool-factory dependency to where get_a2ui_tools ships
(@ag-ui/langgraph 0.0.35, ag-ui-langgraph >=0.0.37).
2026-06-04 18:36:12 +02:00
Markus Ecker 4d324338ce feat(react-core): per-turn persistent intelligence indicator + finished tag
Render a per-turn persistent intelligence indicator that stays stable
across multi-step turns and settles into a "finished" tag. Splits the
component into IntelligenceIndicator (logic) + IntelligenceIndicatorView
(presentation), wires it into CopilotChatView / CopilotChatMessageView,
adds the slot styles to globals.css, and a Storybook story plus
timer-free logic tests.
2026-06-04 17:56:30 +02:00
Markus Ecker e5ae1b23b7 feat(react-core): useLearningContainers sets thread learning containers
Add `useLearningContainers` / `...InCurrentThread`, which emit
`set_learning_containers` annotations (defaulting to the `project`
container) for the active thread, and export the new hooks from the
react-core hooks barrel.
2026-06-04 17:56:29 +02:00
Markus Ecker 139ffcdd6a feat(react-core): useLearnFromUserAction records user actions via recordAnnotation
Add the `recordAnnotation` client (posts to the runtime `/annotate`
endpoint; no client-side userId) and the `useLearnFromUserAction` /
`...InCurrentThread` hooks that record `user_action` annotations for the
self-learning loop.
2026-06-04 17:56:29 +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
Markus Ecker c68be7ecbe feat(runtime): add /annotate endpoint and generalize intelligence client
Replace the user-actions-specific path with a general thread-event
annotation endpoint:

- Route `PUT /connector/annotate/:clientEventId` via fetch-router /
  fetch-handler / core hooks RouteInfo.
- `handleAnnotate` forwards `{ type, data, learningContainer }` to the
  Intelligence platform.
- `CopilotKitIntelligence.annotate()` (idempotent PUT) supersedes the
  prior `recordUserAction`; `AnnotateParams`/`AnnotateResponse` carry the
  event `type` (`user_action`, `set_learning_containers`, ...).

Also renames the `mcpServer` config flag to `enableEnterpriseLearning`
(`ɵisEnterpriseLearningEnabled()`), consumed by the enterprise-learning
attach in the following commit.
2026-06-04 17:56:29 +02:00
Benjamin Taylor 5071060eac Merge ben1/intelligence-threads-examples-rollout into codex/ent-734-strands-python
Conflict resolutions:
- contract test: keep the rollout's parameterized version and add
  strands-python to migratedIntegrations/appRoots (60/60 passing) in
  place of her bespoke MIGRATED_INSTANCES file
- parity manifest: rollout's version with strands' three threads-shield
  allowances removed (mirrors the langgraph-fastapi migration); parity
  verify green — strands now 88 tracked files, zero drift
- package-lock: regenerated at 1.59.3 (a2ui-renderer stays 1.56.5,
  the family-wide pin shared with the north-star)

Also rides: her react-core A2UIMessageRenderer test flake fix
(act -> waitFor), kept intentionally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:22:53 -05:00
lukasmoschitz 5de391fa27 fix(core): make setRuntimeTransport idempotent on the requested transport mode (#5179)
## Summary

`setRuntimeTransport` was not idempotent on the **requested** transport
mode. Auto-detect resolves the requested `"auto"` to a concrete
transport (`"rest"`/`"single"`) and writes that back to
`_runtimeTransport`; the guard then compared against that **resolved**
value. So re-applying the same requested mode — which the provider
effect does on **every render** — compared unequal and **re-ran the
entire `/info` handshake**, rebuilding the runtime agents mid-session.

When that re-sync lands during a turn, `useAgent` hands the UI a
freshly-rebuilt (empty) agent for a render, **blanking the whole
transcript** (and any per-message UI bound to it — e.g. the intelligence
indicator) until it replays.

## Fix

Track the **requested** mode separately (`_requestedTransport`) and
guard on it. Re-applying an unchanged requested transport — including
`"auto"` after auto-detect has resolved it — is now a no-op, so no
redundant `/info` re-sync fires.

## Tests

`packages/core/src/__tests__/agent-registry-resync.test.ts`: re-applying
`"auto"` after auto-detect resolves it does **not** refetch `/info`.

## Scope / risk

Touches only `packages/core` (`core/agent-registry.ts` + the test). **No
public API change.** Genuine transport *changes* still re-sync exactly
as before; only redundant re-applications of the same requested mode are
skipped.

> **Verified live:** this idempotency guard *alone* eliminates the
mid-turn re-sync in the e-commerce intelligence demo — instrumentation
shows no `/info` handshake fires during a turn, and the
transcript/indicator no longer flickers. (An earlier draft also made the
re-sync itself non-destructive as defense-in-depth; that was dropped
because, with this guard, no mid-turn re-sync occurs for it to protect
against.)
2026-06-04 11:56:47 +02:00
Mark 81e97e66e9 Merge branch 'main' into mark/oss-162-a2ui-recovery-client-ux 2026-06-03 23:26:36 -07:00
Jordan Ritter 8f9aeb8096 test(react-core): pin the Enter-vs-button routing contract while running
CopilotChatInput intentionally diverges while a run is in flight: Enter with
sendable text routes to SEND (the consecutive-interrupt unblock from #5195),
while the send/stop button always routes to STOP. Only a comment bound these
two behaviors together. Add a regression test asserting BOTH at once so a
future refactor cannot silently re-converge them (verified red against both a
button-sends-while-running and an Enter-also-stops mutation).
2026-06-03 19:47:38 -07:00
Jordan Ritter 32551f2bdb fix(react-core): type the active-run completion contract and serialize the suggestion send path
Replace the brittle `"activeRunCompletionPromise" in agent` probe + double
`as unknown as` casts in CopilotChat with a typed `RunCompletionAware`
contract plus an `isRunCompletionAware` type guard, both exported from core.
IntelligenceAgent now declares the property and implements the interface, so
the in-flight-run await is reachable without a cast and non-Intelligence
agents still degrade safely. Cast sites in the attachments/e2e tests and the
MockStepwiseAgent helper are updated to the typed accessor.

Factor the await-then-send logic into a shared `waitForActiveRunToSettle`
helper and call it from BOTH onSubmitInput and handleSelectSuggestion. This
closes the suggestion-path in-flight gap: selecting a suggestion mid-run no
longer pre-empts/aborts the active run (e.g. an interrupt RESUME) — the same
regression PR #5195 fixed for the typed-Enter path. Adds a red-green
regression test that parks the suggestion send on the in-flight promise.
2026-06-03 19:47:38 -07:00
Mark Fogle 51945013c2 feat(react-core): A2UI recovery status renderer (OSS-162)
Render the `a2ui_recovery` activity the middleware emits — as a pure DATA
CONTRACT, no @ag-ui/a2ui-toolkit dependency on the React client (mirrors how
a2ui-surface / a2ui_operations are consumed by activityType + content keys):

- createA2UIRecoveryRenderer() -> ReactActivityMessageRenderer for
  activityType "a2ui_recovery":
  - "retrying": a non-disruptive, collapsed "Retrying UI generation…" hint that
    only appears once perceptible (after showAfterMs, or once attempts cross
    showAfterAttempts) so a fast first retry never flashes; never replaces the
    surface, never shows noisy errors inline.
  - "failed": a clean, tasteful hard-failure message for end users, with the
    structured developer detail tucked into an expandable <details>.
  - "resolved"/unknown: renders nothing (the surface renderer owns the UI).
- Timing + debugExposure are client-configurable (A2UIRecoveryRendererOptions),
  surfaced via CopilotKitProvider's `a2ui.recovery`.
- Registered as a built-in renderer when runtime A2UI is enabled; exported.

7 renderer unit tests green (jsdom).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 21:57:10 +00:00
jpr5 be20a389cf chore: release monorepo v1.59.3 2026-06-03 14:53:22 -07:00
Jordan Ritter 63fd2f0b0f fix(react-core): route turn-2 Enter to send during interrupt-resume instead of aborting the run
On consecutive interrupts, pressing Enter for the second turn (turn-2) while
the resumed run from turn-1 was still in flight routed the keystroke to the
STOP action, aborting the in-flight resume instead of sending the new message.

The fix gates the Enter handler on `canSend` so a pending/running state no
longer maps Enter to STOP, and `onSubmitInput` now awaits the in-flight run's
completion before dispatching the queued message — the message is sent after
the current run finishes rather than aborting it.

Also hardens the queuing and attachment tests to cover the consecutive-
interrupt path and the send-after-run-completes behavior.
2026-06-03 14:36:05 -07:00
Martha Schumann e8eb68697f test(react-core): stabilize a2ui renderer test 2026-06-03 14:28:24 -07:00