Files
Benjamin Taylor b8c0ce99ed fix(deps): bump @ag-ui/core family 0.0.57 -> 0.0.58 (OSS-924)
Our packages pinned @ag-ui/{core,client,encoder,proto} exactly at 0.0.57.
@ag-ui/mastra@1.1.2 imports `tokenUsageFromAiSdkUsage`, which only exists
from @ag-ui/core@0.0.58, while declaring a loose `>=0.0.44` peer. Any app
that pins core to whatever our runtime pins therefore installs cleanly and
then fails at bundle time on a missing export.

0.0.58 is additive over 0.0.57 (TokenUsage schema + helpers, optional
`usage` field) plus one input-widening: TOOL_CALL_START.parentMessageId now
accepts null and coerces it to undefined instead of rejecting it.

That widening makes two channels-core negative-control tests stale. They
asserted that a null parentMessageId aborts a run when sanitizeAgentEventStream
is not applied -- the upstream bug the sanitizer works around. Core 0.0.58
fixes it upstream, so those runs now succeed; the tests are updated to assert
the new behavior. The sanitizer is kept: it normalizes null to "" whereas core
coerces to undefined, and it is public API.

Scope note: showcase/integrations and the examples that pin published
@copilotkit versions are deliberately NOT bumped. They have no @ag-ui
override, so raising only their direct pin would hoist 0.0.58 at the root
while @copilotkit/* keep nested 0.0.57 copies -- turning one coherent copy
into a split. They pick up 0.0.58 when they bump their @copilotkit pins.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 08:53:54 -05:00
..

@copilotkit/react-native

Headless React Native bindings for CopilotKit. Provides a lightweight provider and re-exports platform-agnostic hooks -- no DOM, CSS, or web framework dependencies. You build the chat UI with standard React Native components.

Installation

npm install @copilotkit/react-native

Polyfills

React Native's JS runtime (Hermes) lacks several Web APIs that CopilotKit depends on. Import the polyfills before any other code in your entry point:

// index.js
import "@copilotkit/react-native/polyfills";

import { AppRegistry } from "react-native";
import App from "./App";
import { name as appName } from "./app.json";

AppRegistry.registerComponent(appName, () => App);

If you already polyfill some of these APIs, you can import only what you need:

import "@copilotkit/react-native/polyfills/streams";
import "@copilotkit/react-native/polyfills/encoding";
import "@copilotkit/react-native/polyfills/crypto";
import "@copilotkit/react-native/polyfills/dom";
import "@copilotkit/react-native/polyfills/location";

Quick start

import {
  CopilotKitProvider,
  useAgent,
  useCopilotKit,
} from "@copilotkit/react-native";

export default function App() {
  return (
    <CopilotKitProvider runtimeUrl="https://your-server/api/copilotkit">
      <ChatScreen />
    </CopilotKitProvider>
  );
}

Re-exports hooks from @copilotkit/react-core: useAgent, useFrontendTool, useComponent, useHumanInTheLoop, useInterrupt, useSuggestions, useConfigureSuggestions, useAgentContext, useThreads, and useCopilotKit.

API Surface

The root import (@copilotkit/react-native) IS the v2 API. Unlike the web SDK which has /v2 subpath, React Native exports the v2 API directly from the package root.

Documentation

For full setup instructions, usage examples, and troubleshooting, see the React Native docs.