v1.59.4

AppFlowy-IO/AppFlowyv1.59.4Jun 4, 2026by github-actions[bot]

AI Summary

A patch release introducing Intelligence learning annotations, automatic A2UI tool injection, and persistent chat indicators.

Key Highlights

  • Added user-action learning hooks for recording UI actions
  • Added `/annotate` endpoint and Enterprise Learning MCP wiring
  • Automatic A2UI tool injection via LangGraph middleware
  • Persistent Intelligence indicator added to chat history

New Features

  • User-action learning hooks
  • /annotate endpoint
  • Automatic A2UI tool injection
  • Persistent Intelligence indicator

Full Release Notes

# CopilotKit v1.59.4

A patch release on the `1.59` line. Adds the first client/runtime pieces for Intelligence learning annotations, wires opt-in automatic A2UI tool injection through LangGraph middleware, gives Intelligence runs a persistent chat indicator, and makes release notifications deterministic.

## Install

```bash
npm install @copilotkit/react-core@1.59.4 @copilotkit/react-ui@1.59.4 @copilotkit/runtime@1.59.4
```

## Features

- **`@copilotkit/react-core`: user-action learning hooks** — Adds `useLearnFromUserAction`, `useLearningContainers`, and current-thread variants. Apps can record UI actions and set the learning containers associated with a thread through the app's CopilotKit runtime; the browser talks to `POST /annotate`, while the runtime resolves the Intelligence user and keeps the Intelligence API key server-side. ([#4839](https://github.com/CopilotKit/CopilotKit/pull/4839))

  ```tsx
  const learnFromUserAction = useLearnFromUserAction();

  await learnFromUserAction({
    threadId,
    title: "Renamed project",
    data: { previous: "Old name", next: "New name" },
  });
  ```

- **`@copilotkit/runtime`: `/annotate` endpoint and Enterprise Learning MCP wiring** — Adds the runtime-side annotation handler, request validation, platform error forwarding for 4xx responses, and `CopilotKitIntelligence` user resolution for annotation writes. When Enterprise Learning is enabled, real agent runs also receive the Intelligence MCP middleware with per-request auth headers, making the knowledge-base tools available through the same AG-UI middleware pipeline as other MCP tools. ([#4839](https://github.com/CopilotKit/CopilotKit/pull/4839))

- **`@copilotkit/sdk-js`: automatic A2UI tool injection for LangGraph middleware** — `CopilotKitMiddleware` can now auto-inject the A2UI generation tool when the frontend registered an A2UI catalog and the runtime opted into `injectA2UITool`. The middleware finds the catalog from either AG-UI state or CopilotKit runtime context, binds generated surfaces back to the catalog ID, and avoids advertising the tool when the client has not provided a renderable catalog. ([#5161](https://github.com/CopilotKit/CopilotKit/pull/5161))

- **`@copilotkit/react-core`: persistent Intelligence indicator** — Chat now shows a per-turn Intelligence indicator when the knowledge-base tool is used. It suppresses replay flashes with a grace window, shows an in-progress state while the tool call is unresolved, and settles into a quiet finished tag in message history instead of disappearing after the run completes. ([#4839](https://github.com/CopilotKit/CopilotKit/pull/4839))

## Fixes

- **`@copilotkit/core`: runtime transport switching is idempotent** — `setRuntimeTransport` now no-ops when the requested transport mode is already active. This avoids unnecessary agent resets and subscriber churn during repeated configuration passes where the app reaffirms the same runtime transport rather than actually switching modes. ([#5179](https://github.com/CopilotKit/CopilotKit/pull/5179))

- **Examples: Intelligence threads rollout backed out for stability** — The initial ENT-679 Intelligence threads example rollout was reverted before this release so published examples stayed on the known-good path while the follow-up rollout was prepared. ([#5217](https://github.com/CopilotKit/CopilotKit/pull/5217))

## Docs

- **`@copilotkit/core` API reference** — Adds reference documentation for the core package and exposes `@copilotkit/core` in the reference SDK picker, making the lower-level APIs easier to discover alongside the React and runtime references. ([#5154](https://github.com/CopilotKit/CopilotKit/pull/5154))

## Build / packaging

- **Automated release notifications** — Adds a tested release-notification builder that produces one concise engineering-channel message for successful stable publishes, with guards for dry runs, skipped lanes, canaries, failures, and missing release URLs. ([#5220](https://github.com/CopilotKit/CopilotKit/pull/5220))

## Packages republished at `1.59.4`

`@copilotkit/runtime`, `@copilotkit/react-core`, `@copilotkit/react-ui`, `@copilotkit/react-native`, `@copilotkit/core`, `@copilotkit/shared`, `@copilotkit/runtime-client-gql`, `@copilotkit/sdk-js`, `@copilotkit/voice`, `@copilotkit/web-inspector`, `@copilotkit/a2ui-renderer`, `@copilotkit/react-textarea`, `@copilotkit/sqlite-runner`, `@copilotkit/agentcore-runner`, and `@copilotkit/vue`.