The template required uv (for the agent's `postinstall: uv sync`) and Docker
(for the threads infrastructure) but surfaced nothing until npm install errored
with `sh: uv: command not found`. Add a preflight script wired to preinstall
and predev that prints a clear message pointing at the install docs, plus
README updates calling out both prerequisites.
## What does this PR do?
Adds a `position?: \"left\" | \"right\"` prop to the v2 `CopilotSidebar`
(and the underlying `CopilotSidebarView`), letting consumers anchor the
sidebar to either side of the viewport. Defaults to `\"right\"` so
existing usage is unchanged.
```tsx
<CopilotSidebar position=\"left\" />
```
### What changes when `position` flips
- **Anchor:** `cpk:right-0` ↔ `cpk:left-0`
- **Border side:** `cpk:border-l` ↔ `cpk:border-r`
- **Off-screen translate (closed state):** `cpk:translate-x-full` ↔
`cpk:-translate-x-full`
- **Body push margin:** `document.body.style.marginInlineEnd` ↔
`marginInlineStart` (with the matching `transition` CSS property name)
- **Aside element:** picks up a `data-position` attribute for
styling/test hooks
`position` is in the `useLayoutEffect` deps, so toggling it at runtime
cleans up the prior side's body margin before applying the new one.
### Tests
New `CopilotSidebarView.position.test.tsx` (7 cases) —
default/right/left class assertions, off-screen translate direction, and
verification that the wrapper forwards through to the view. All 32
sidebar-area tests pass; full react-core suite (1167 tests) green with
no regressions.
### Storybook
Added `RightPosition` and `LeftPosition` stories under
`UI/CopilotSidebarView` for visual diffing.
## Related PRs and Issues
- N/A
## Checklist
- [x] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [ ] If the PR changes or adds functionality, I have updated the
relevant documentation
- [x] \"Allow edits by maintainers\" is checked
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The toggle button is hardcoded right-anchored (cpk:bottom-6 cpk:right-6).
When the sidebar sits on the left, the button should mirror to the left
so it lives behind/under the chat panel — otherwise it floats on the
opposite side from the sidebar it controls.
CopilotSidebarView now passes a position-aware className override into
the toggle slot (left-6 + right-auto, merged via tailwind-merge so the
default right-6 is dropped). Behavior on the right is unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Lets consumers anchor the v2 CopilotSidebar to either side of the
viewport instead of the hardcoded right side. The prop flips the fixed
anchor, the border side, the off-screen translate direction, and the
body push margin (marginInlineStart vs marginInlineEnd) so the layout
mirrors correctly. Defaults to "right" for backward compatibility.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary
- Extract `CopilotKitContext` and `useCopilotKit` into standalone
`context.ts` in react-core, enabling cross-platform reuse without web
dependencies
- Add new `@copilotkit/react-native` package with lightweight provider,
polyfills, and streaming fetch
- All hooks (`useAgent`, `useFrontendTool`, `useHumanInTheLoop`, etc.)
are re-exported directly from react-core — no reimplementation
## Motivation
CopilotKit's React hooks are platform-agnostic, but the barrel import in
`@copilotkit/react-core` pulls in web-only dependencies (Radix UI, Lit,
A2UI renderer, react-dom, CSS). This makes the package unusable in React
Native without extensive Metro shimming.
By extracting the React context into a standalone entry point
(`@copilotkit/react-core/v2/context`), the new
`@copilotkit/react-native` package can provide its own lightweight
provider while reusing all existing hooks.
## What's in `@copilotkit/react-native`
| Export | Description |
|--------|-------------|
| `CopilotKitProvider` | Lightweight provider — no DOM, CSS, Radix, Lit,
or A2UI deps |
| `installStreamingFetch()` | XHR-based streaming fetch for
`response.body.getReader()` support |
| `@copilotkit/react-native/polyfills` | All polyfills at once
(ReadableStream, TextEncoder, crypto, DOMException, window.location) |
| `@copilotkit/react-native/polyfills/*` | Granular per-polyfill imports
(`/streams`, `/encoding`, `/crypto`, `/dom`, `/location`) for users who
need to avoid overriding their own shims |
| `useAgent`, `useFrontendTool`, etc. | Re-exported from react-core
(shared context) |
## Usage
```tsx
// index.js (entry point, before other imports)
import "@copilotkit/react-native/polyfills";
import { installStreamingFetch } from "@copilotkit/react-native";
installStreamingFetch();
// App.tsx
import { CopilotKitProvider, useAgent, useCopilotKit } from "@copilotkit/react-native";
function App() {
return (
<CopilotKitProvider runtimeUrl="https://your-server/api/copilotkit">
<ChatScreen />
</CopilotKitProvider>
);
}
```
## Test plan
- [x] `nx run react-core:build` passes
- [x] `nx run @copilotkit/react-native:build` passes
- [x] `nx run react-core:test` — all 1153 tests pass
- [x] Manual test in React Native app (tested during development with
bare RN 0.84 project)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Bump @langchain/langgraph-cli from 1.2.1 to 2.0.0 in the langgraph-js
starter and showcase langgraph-typescript integration. The transitive
dep @langchain/langgraph-api@1.2.1 imports STREAM_EVENTS_V3_MODES from
@langchain/langgraph/web, but that symbol was never published in any
release of @langchain/langgraph (including 1.3.0 currently pinned).
langgraph-api@2.0.0 drops the broken import entirely.
## Summary
Replace the abrupt "cut in" with a 300ms fade + slide-from-bottom
entrance on each chat card so they feel connected to the streaming
response instead of popping in.
Follow-up polish on
[#4587](https://github.com/CopilotKit/CopilotKit/pull/4587).
## What changed
Added `animate-in fade-in slide-in-from-bottom-2 duration-300 ease-out`
to the root element of every tool render surface in the chat:
- `ToolCard` — `SpecializedToolCard` and `DefaultToolCard` (covers
`do_research`, `do_projections`, `navigate_and_filter`, dashboard ops,
`render_chat_visual`, etc.)
- `InlineChart` (both placeholder and rendered chart)
- `CashPositionCard` (both placeholder and full card)
- `InventoryReorderCard` (both placeholder and full card)
- `InvoiceApprovalCard` (both placeholder and full card)
## Why this approach
- **`tw-animate-css` is already imported** in
`examples/showcases/deep-agents-finance-erp/src/app/globals.css` — no
new dependencies.
- **Mount-time CSS animation, not Framer Motion** — the cards are
short-lived per turn and don't need orchestration; CSS keyframes resolve
to `animation-name: enter` exactly once on first paint and don't re-fire
on prop transitions, so swapping between `InProgress` and the populated
state stays smooth.
- 300ms `ease-out` matches the rest of the demo's transition timing.
## Test plan
- [x] Chat → "Cash Position" → cards slide+fade in (verified via
`getComputedStyle().animationName === "enter"`, `animationDuration ===
"0.3s"`).
- [x] Same animation fires for `do_research` / `do_projections` tool
cards, inline charts, approval cards, and inventory reorder cards.
- [x] No layout shift or jank in successive turns.
- [ ] Reviewer: visual verification on a non-mac browser if possible
(animation runs on standard CSS, but worth confirming).
## Notes
- No JS/runtime changes. Pure CSS class additions via Tailwind
utilities.
- Decoupled from the HITL fix in
[#4630](https://github.com/CopilotKit/CopilotKit/pull/4630) — landing
this independently is fine.
The previous commit bumped @langchain/langgraph to 1.3.0 but missed the
peer-dep ripple: langgraph 1.3.0 peers @langchain/core ^1.1.44. The agent
pinned core 1.1.41 and the root override pinned 1.0.1, both below the
required range, so npm install in the agent container failed with ERESOLVE.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@langchain/langgraph-api@1.2.1 (pulled transitively by langgraph-cli) imports
STREAM_EVENTS_V3_MODES from @langchain/langgraph/web, which only exists in
1.3.0. The starter's overrides + agent dep were pinning langgraph to 1.2.9,
causing the agent container to crash on startup with a SyntaxError. Bump
the override and the direct pin to 1.3.0, and pin @langchain/langgraph-cli
in the npx invocations so future cross-package drift in the LangChain
ecosystem cannot silently re-break this starter.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces canary @copilotkit/* (1.56.5-canary.1777671752) and the intelligence
composite RC tag (0.1.0-rc.16) with the just-released stable artifacts so users
cloning this starter get a reproducible configuration. Also aligns the
Dockerfile copilotkit Python pin (0.1.78) with apps/agent/pyproject.toml (0.1.86).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the abrupt "cut in" with a 300ms fade + slide-from-bottom
entrance on each chat card so they feel connected to the streaming
response instead of popping in.
Applied to all five tool render surfaces:
- ToolCard (Specialized + Default variants — do_research, do_projections,
navigate_and_filter, dashboard ops, render_chat_visual, etc.)
- InlineChart
- CashPositionCard
- InventoryReorderCard
- InvoiceApprovalCard
Uses tw-animate-css utilities (`animate-in fade-in slide-in-from-bottom-2
duration-300 ease-out`), already imported in globals.css — no new deps.
The agent's request_approval tool calls copilotkit_interrupt() which
raises GraphInterrupt and the runtime emits a CUSTOM { name:
"on_interrupt" } event. The previous useHumanInTheLoop hook only handles
frontend-executed tools and was ignoring those events, so the approval
card flashed in then vanished without ever exposing Approve/Reject.
- Switch to useInterrupt for the interrupt-driven flow
- Add a no-op useRenderTool for request_approval to suppress the
wildcard tool renderer (which would otherwise show a half-finished
generic card during streaming)
- JSON-parse event.value (the runtime delivers the interrupt payload as
a string, not an object — accessing properties directly silently
returns undefined and filters the interrupt out)
Reverts the cloning design from #3525 (useAgent per-thread clones, getThreadClone,
globalThreadCloneMap, cloneForThread) and #3630 (clone routing in activity renderers),
plus the inspector machinery that existed only to handle clones (onAgentRunStarted
subscriber + run-handler emissions from #3869, the connect-time emission from #3872,
and the agentRunThreadId map that read from it).
State-manager isClone composite-key path and SuggestionEngine consumerAgent param —
both added in #3525 to keep clones visible to bookkeeping — are gone too.
Restores agent.threadId = resolvedThreadId in CopilotChat (pre-#3525 behavior) and
swaps the inspector's agentRunThreadId map for a direct agent.threadId read.
Removes the DemoButtonAgent and /a2ui-demo page from the demo (added by #3630 as a
clone-fix repro).
Re-opens the original issue #2957 (CPK-7155): two CopilotChat instances with the same
agentId and different threadIds will share message state again. The follow-up is a
public registerProxiedAgent API so callers can opt into multiple frontend agents
proxying to the same runtime agent, without implicit per-thread cloning.
## What does this PR do?
Corrects scaffolded template instructions so generated projects match
their actual package scripts and runtime requirements. The updates
remove stale duplicate setup steps, fix provider environment examples,
align Python version and uv guidance, and document that the threads
template npm run dev starts its Docker Compose infrastructure.
## Related PRs and Issues
- Companion Intelligence CLI PR:
https://github.com/CopilotKit/Intelligence/pull/160
## Checklist
- [x] I have read the Contribution Guide
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [ ] Allow edits by maintainers is checked
## Summary
Polish pass on the deep-agents-finance-erp showcase to reduce visual
noise and make the chat surface feel more like a real assistant.
- **Persistent follow-up suggestion chips** above the input. The third
chip rotates based on the currently loaded dashboard so we never suggest
switching to the view the user is already on (e.g. on Cost Control the
chip becomes "Cash Flow Risk", on Cash Flow Risk it becomes "Cost
Control").
- **Hover-only assistant toolbar on the last turn.** The copy icon no
longer floats between tool-call cards mid-conversation; it only appears
on the latest assistant message and only when the user hovers it.
- **Cleaner research / projections tool render.** Replaced the raw
markdown-table preview under `do_research` / `do_projections` cards (`|
Metric | Amount | |---|---:|...`) with a "Completed data gathering" /
"Completed projections" status caption. Full results still available
behind the chevron expand.
- **Natural-language intent routing in the orchestrator prompt.**
Spending / cost / cash-flow / revenue / executive-overview questions now
resolve to `do_research` → `load_dashboard` against the matching
pre-built template (no `save_dashboard` + `manage_dashboard(reset)` +
`update_dashboard` churn). Approval-context invoice questions ("do we
have any invoices for approval", "what needs to be paid") route to
`request_approval(invoice_payment)` instead of just charting.
## Files
-
examples/showcases/deep-agents-finance-erp/src/components/layout/shell.tsx
— suggestion chips, hover-only toolbar wrapper, dashboard-aware rotation
-
examples/showcases/deep-agents-finance-erp/src/components/chat/tool-card.tsx
— clean status caption for do_research / do_projections
- examples/showcases/deep-agents-finance-erp/agent/prompts.py —
intent-mapping rules for dashboards and approvals
## Test plan
- [ ] Open the chat and send any message — verify three chips appear
above the input on the second turn (Cash Position Chart / Approve
Payments / dashboard suggestion).
- [ ] Click "Show me where the company is spending its money" — verify
agent only calls `do_research` then `load_dashboard("Cost Control")`, no
`update_dashboard` / `save_dashboard` / `manage_dashboard`.
- [ ] After Cost Control loads, verify the third chip rotates to "Cash
Flow Risk".
- [ ] Hover over an assistant message — copy/toolbar icons fade in only
on the latest turn.
- [ ] Trigger `do_research` and verify the tool card shows "Completed
data gathering" instead of raw markdown.
- [ ] Ask "Do we have any pending invoices for approval?" — verify the
approval HITL dialog renders.
- Persistent follow-up suggestion chips above the input; the third chip
rotates based on the currently loaded dashboard so we never suggest
switching to the dashboard the user is already viewing.
- Hide the assistant message toolbar except on hover and only on the
latest turn — drops the floating copy icon that previously appeared
mid-conversation between tool cards.
- Replace the raw markdown preview under do_research/do_projections
tool cards with a clean "Completed data gathering" status caption.
- Expand the orchestrator prompt with natural-language intent mapping
so spending / cash-flow / revenue / executive-overview questions
route to load_dashboard against the matching template (no save +
reset + update churn), and approval-context invoice queries route
to request_approval instead of just charting.
Add a zodState() helper that attaches a lazy `~standard.jsonSchema.input`
to a zod schema so LangGraph's StateSchema.getJsonSchema() emits the
field into the graph's output_schema. Without it, zod v4 fields carry
`~standard.validate` + `vendor` only, `isStandardJSONSchema` returns
false, and the field is silently dropped from output_schema — which in
turn causes the AG-UI LangGraphAgent proxy to filter the value out of
STATE_SNAPSHOT events on the wire, so the frontend never sees it even
though the underlying thread state has the data.
Apply zodState to the middleware's own `copilotkit` state field so it
surfaces in output_schema and export it for demos to use on custom
state fields (todos, documents, etc.).
Uses `z.toJSONSchema` when available (zod v4 subpath) and falls back to
an empty object, which is sufficient to make langgraph-api include the
key in output_schema.
Rewrite the langgraph-js agent to use `createAgent` from `langchain`
(matching langgraph-python) with `copilotkitMiddleware` and
`stateStreamingMiddleware` from `@copilotkit/sdk-js/langgraph-middlewares`.
Tools now use `ToolRuntime` for state and tool-call-id access. System
prompt inlined in `agent.ts`; drop the file-based `PROMPT.md`.
Replace the legacy single-stage Dockerfile with a Node-only two-stage
build that mirrors the langgraph-python Dockerfile (frontend build →
runner, HttpAgent route override for Docker, Turbopack→webpack).
Add JS-specific `entrypoint.sh` (launches `@langchain/langgraph-cli dev`
+ Next.js standalone) and `docker-compose.test.yml` (wget healthcheck
for the alpine-based agent image, STARTER=langgraph-js default). Both
added to the instance's `allowedDivergence` in the parity manifest.
Rewrite the README to drop Python/uv prerequisites and list the correct
TypeScript tool paths.
Two small changes to the parity tooling, surfaced while validating it on
the langgraph-fastapi port.
1. Drop the per-instance PROMPT.md file. The reference demo
(langgraph-python) does not load agent/PROMPT.md at runtime — it inlines
the prompt as a triple-string literal in agent/main.py. Syncing a
cosmetic PROMPT.md file to every instance created a contract the code
did not follow. Now:
- sync.ts no longer writes agent/PROMPT.md per instance.
- verify.ts greps the first non-blank line of _parity/canonical/PROMPT.md
against each instance's agent source. Inline the prompt string in
source; verifier passes.
- Deleted the now-orphaned PROMPT.md copy under langgraph-js/agent/.
2. Track Dockerfile, docker/Dockerfile.agent, and serve.py in the shared
verbatim-files list. These were previously silent "allowed divergence"
across all instances — any Docker or runtime-adapter drift shipped
unflagged. Now:
- Added to tracked.verbatimFiles in manifest.json.
- langgraph-js keeps them in allowedDivergence (Node-only stack, legit
difference from the Python-based reference).
- langgraph-fastapi drops them from allowedDivergence (same language
stack as the reference; Docker/serve.py should match).
README and the copilotkit-demo-parity skill updated to match the new
prompt contract. Verifier still supports `--target` and exits non-zero on
unexpected drift.
Align langgraph-js with examples/integrations/langgraph-python via the
parity tooling. Remove legacy app/ layout, adopt src/ layout, rewrite
the TS agent to expose the tracked tool surface (manage_todos,
get_todos, query_data, generate_a2ui, search_flights) and todos state,
and write the canonical PROMPT.md. Keeps LangGraphAgent + stategraph
runtime (allowed divergence per the manifest); brings deps,
Dockerfile.app, entrypoint, showcase metadata, and shared UI into
lockstep. Parity verifier: 88 ok / 0 error.
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.
Reverts the example-app integration that was used for local end-to-end
testing of the inspector against an intelligence-backed runtime. The
example app is not part of the pnpm workspace, ships its own
package-lock.json, and pulls @copilotkit/* from the npm registry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>