Skip to content

Commit 3a2eb01

Browse files
committed
fix(shell-docs): restore /v2 subpath on V2 canonical-form imports
The earlier V2 canonical sweep misread the brand-name guidance ("always CopilotKit") as a directive on import paths and stripped /v2 from @copilotkit/react-core specifiers. Inline review feedback clarified that guidance applied only to the component name. This restores "@copilotkit/react-core/v2" and "@copilotkit/react-core/v2/styles.css" across the docs sweep scope (now including 8 framework quickstarts inherited via rebase onto main); the <CopilotKit> rename and the drop of @copilotkit/react-ui from install commands are kept.
1 parent 942ace0 commit 3a2eb01

125 files changed

Lines changed: 308 additions & 308 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

showcase/shell-docs/src/content/docs/agentic-protocols/mcp.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ For further reading, check out the [Model Context Protocol](https://modelcontext
102102
```tsx
103103
"use client";
104104

105-
import { CopilotKit } from "@copilotkit/react-core";
105+
import { CopilotKit } from "@copilotkit/react-core/v2";
106106

107107
export default function App() {
108108
return (
@@ -122,7 +122,7 @@ For further reading, check out the [Model Context Protocol](https://modelcontext
122122
"use client";
123123

124124
import { useEffect } from "react";
125-
import { useCopilotKit } from "@copilotkit/react-core";
125+
import { useCopilotKit } from "@copilotkit/react-core/v2";
126126

127127
function McpServerManager() {
128128
const { setMcpServers } = useCopilotKit();
@@ -151,7 +151,7 @@ For further reading, check out the [Model Context Protocol](https://modelcontext
151151
```tsx
152152
"use client";
153153

154-
import { CopilotChat } from "@copilotkit/react-core";
154+
import { CopilotChat } from "@copilotkit/react-core/v2";
155155

156156
export default function ChatInterface() {
157157
return (
@@ -176,7 +176,7 @@ For further reading, check out the [Model Context Protocol](https://modelcontext
176176
import {
177177
useFrontendTool,
178178
CatchAllActionRenderProps,
179-
} from "@copilotkit/react-core";
179+
} from "@copilotkit/react-core/v2";
180180

181181
export function ToolRenderer() {
182182
useFrontendTool({
@@ -200,7 +200,7 @@ For further reading, check out the [Model Context Protocol](https://modelcontext
200200
```tsx
201201
"use client";
202202

203-
import { CopilotKit, CopilotChat } from "@copilotkit/react-core";
203+
import { CopilotKit, CopilotChat } from "@copilotkit/react-core/v2";
204204

205205
export default function Page() {
206206
return (

showcase/shell-docs/src/content/docs/auth.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you don't need any of those, skip auth entirely. The agent runs anonymously a
2525
Pass your token via the `headers` prop on `<CopilotKit>`. CopilotKit forwards every request with that header attached.
2626

2727
```tsx title="frontend/src/app/page.tsx"
28-
import { CopilotKit } from "@copilotkit/react-core";
28+
import { CopilotKit } from "@copilotkit/react-core/v2";
2929

3030
<CopilotKit
3131
runtimeUrl="/api/copilotkit"
@@ -84,7 +84,7 @@ export const GET = (req: NextRequest) => handler(req);
8484
Pass your token via the `properties` prop. CopilotKit forwards it to LangGraph as a Bearer token automatically.
8585

8686
```tsx title="frontend/src/app/page.tsx"
87-
import { CopilotKit } from "@copilotkit/react-core";
87+
import { CopilotKit } from "@copilotkit/react-core/v2";
8888

8989
<CopilotKit
9090
runtimeUrl="/api/copilotkit"
@@ -189,7 +189,7 @@ async def my_agent_node(state: AgentState, config: RunnableConfig):
189189
Pass your token via the `properties` prop. CopilotKit forwards it to AG2's `/chat` endpoint as a request header.
190190

191191
```tsx title="frontend/src/app/page.tsx"
192-
import { CopilotKit } from "@copilotkit/react-core";
192+
import { CopilotKit } from "@copilotkit/react-core/v2";
193193

194194
<CopilotKit
195195
runtimeUrl="/api/copilotkit"
@@ -274,7 +274,7 @@ def get_account_data(
274274
Microsoft Agent Framework's AG-UI host expects authentication on a request header rather than the runtime properties channel. Pass the token via `<CopilotKit headers={...}>`:
275275

276276
```tsx title="frontend/src/app/page.tsx"
277-
import { CopilotKit } from "@copilotkit/react-core";
277+
import { CopilotKit } from "@copilotkit/react-core/v2";
278278

279279
<CopilotKit
280280
runtimeUrl="/api/copilotkit"

showcase/shell-docs/src/content/docs/backend/ag-ui.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Everything in CopilotKit — messages, state updates, tool calls, and more — f
1313
The `useAgent` hook is your primary interface to the AG-UI agent powering your copilot. It returns an `AbstractAgent` from the AG-UI client library — the same base type that all AG-UI agents implement.
1414

1515
```tsx
16-
import { useAgent } from "@copilotkit/react-core";
16+
import { useAgent } from "@copilotkit/react-core/v2";
1717

1818
function MyComponent() {
1919
const { agent } = useAgent();
@@ -37,7 +37,7 @@ The returned `agent` is a standard AG-UI `AbstractAgent`. You can subscribe to i
3737
Every agent exposes a `subscribe` method that lets you listen for specific AG-UI events as they stream in. Each callback receives the event and the current agent state:
3838

3939
```tsx
40-
import { useAgent } from "@copilotkit/react-core";
40+
import { useAgent } from "@copilotkit/react-core/v2";
4141
import { useEffect } from "react";
4242

4343
function MyComponent() {

showcase/shell-docs/src/content/docs/backend/copilot-runtime.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const POST = async (req: NextRequest) => {
4040
Then point your frontend at the endpoint:
4141

4242
```tsx
43-
import { CopilotKit } from "@copilotkit/react-core";
43+
import { CopilotKit } from "@copilotkit/react-core/v2";
4444

4545
<CopilotKit runtimeUrl="/api/copilotkit">
4646
<YourApp />
@@ -115,7 +115,7 @@ a2ui: { agents: ["my-agent"] }
115115
On the frontend, the A2UI renderer activates automatically — no extra configuration needed. If you want to override the default theme, pass an `a2ui` prop to `<CopilotKit>`:
116116

117117
```tsx
118-
import { CopilotKit } from "@copilotkit/react-core";
118+
import { CopilotKit } from "@copilotkit/react-core/v2";
119119

120120
<CopilotKit runtimeUrl="/api/copilotkit" a2ui={{ theme: myCustomTheme }}>
121121
{children}
@@ -145,7 +145,7 @@ CopilotKit is built on the [AG-UI protocol](./ag-ui), which is an open standard.
145145

146146
```tsx
147147
import { HttpAgent } from "@ag-ui/client";
148-
import { CopilotKit } from "@copilotkit/react-core";
148+
import { CopilotKit } from "@copilotkit/react-core/v2";
149149

150150
const myAgent = new HttpAgent({
151151
url: "https://my-agent.example.com",

showcase/shell-docs/src/content/docs/custom-look-and-feel/css.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Once you've found the right variable, you can also apply the overrides inline
4545
via the `CopilotKitCSSProperties` helper:
4646

4747
```tsx
48-
import { CopilotKitCSSProperties } from "@copilotkit/react-core";
48+
import { CopilotKitCSSProperties } from "@copilotkit/react-core/v2";
4949

5050
<div
5151
style={

showcase/shell-docs/src/content/docs/custom-look-and-feel/reasoning-messages.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ receives these props:
7676
| `onClick` | `() => void` | Toggle handler (only present when `hasContent` is `true`) |
7777

7878
```tsx
79-
import { CopilotChat } from "@copilotkit/react-core";
80-
import "@copilotkit/react-core/styles.css";
79+
import { CopilotChat } from "@copilotkit/react-core/v2";
80+
import "@copilotkit/react-core/v2/styles.css";
8181

8282
function CustomHeader({
8383
isOpen,
@@ -178,9 +178,9 @@ without reimplementing them:
178178
```tsx
179179
import {
180180
CopilotChatReasoningMessage,
181-
} from "@copilotkit/react-core";
182-
import { CopilotChat } from "@copilotkit/react-core";
183-
import "@copilotkit/react-core/styles.css";
181+
} from "@copilotkit/react-core/v2";
182+
import { CopilotChat } from "@copilotkit/react-core/v2";
183+
import "@copilotkit/react-core/v2/styles.css";
184184

185185
function MyReasoningLayout(props: React.ComponentProps<typeof CopilotChatReasoningMessage>) {
186186
return (

showcase/shell-docs/src/content/docs/custom-look-and-feel/slots.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ is gone:
5555
The simplest way to customize a slot. Pass a Tailwind class string and it will be merged with the default component's classes.
5656

5757
```tsx title="page.tsx"
58-
import { CopilotChat } from "@copilotkit/react-core";
58+
import { CopilotChat } from "@copilotkit/react-core/v2";
5959

6060
export function Chat() {
6161
return (
@@ -86,7 +86,7 @@ Pass an object to override specific props on the default component. This is usef
8686
For full control, pass your own React component. It receives all the same props as the default component.
8787

8888
```tsx title="page.tsx"
89-
import { CopilotChat } from "@copilotkit/react-core";
89+
import { CopilotChat } from "@copilotkit/react-core/v2";
9090

9191
const CustomMessageView = ({ messages, isRunning }) => (
9292
<div className="space-y-4 p-6">

showcase/shell-docs/src/content/docs/deploy/agentcore.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ Browser → CopilotKit Runtime → AgentCore Runtime → your agent
272272
### Add the CopilotKit provider
273273

274274
```tsx title="app/layout.tsx"
275-
import { CopilotKit } from "@copilotkit/react-core";
276-
import "@copilotkit/react-core/styles.css";
275+
import { CopilotKit } from "@copilotkit/react-core/v2";
276+
import "@copilotkit/react-core/v2/styles.css";
277277

278278
export default function RootLayout({ children }: { children: React.ReactNode }) {
279279
return (
@@ -293,7 +293,7 @@ Browser → CopilotKit Runtime → AgentCore Runtime → your agent
293293
### Add the chat interface
294294

295295
```tsx title="app/page.tsx"
296-
import { CopilotSidebar } from "@copilotkit/react-core";
296+
import { CopilotSidebar } from "@copilotkit/react-core/v2";
297297

298298
export default function Page() {
299299
return (

showcase/shell-docs/src/content/docs/generative-ui/hashbrown.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
CopilotKit,
2727
CopilotChat,
2828
useConfigureSuggestions,
29-
} from "@copilotkit/react-core";
29+
} from "@copilotkit/react-core/v2";
3030
import { HashBrownAssistantMessage } from "./hashbrown-renderer";
3131

3232
export default function ByocHashbrownDemo() {

showcase/shell-docs/src/content/docs/generative-ui/json-render.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
CopilotKit,
2727
CopilotChat,
2828
useConfigureSuggestions,
29-
} from "@copilotkit/react-core";
29+
} from "@copilotkit/react-core/v2";
3030
import { JsonRenderAssistantMessage } from "./json-render-renderer";
3131

3232
export default function ByocJsonRenderDemo() {

0 commit comments

Comments
 (0)