@copilotkit/react-core 1.71.0 → 1.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{copilotkit-B4Jb1QEy.cjs → copilotkit-BkVEkUS0.cjs} +5 -2
  2. package/dist/copilotkit-BkVEkUS0.cjs.map +1 -0
  3. package/dist/{copilotkit-snbJkMqQ.mjs → copilotkit-D5BTo0YG.mjs} +5 -2
  4. package/dist/copilotkit-D5BTo0YG.mjs.map +1 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/dist/index.umd.js +4 -1
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/v2/headless.cjs +4 -1
  10. package/dist/v2/headless.cjs.map +1 -1
  11. package/dist/v2/headless.mjs +4 -1
  12. package/dist/v2/headless.mjs.map +1 -1
  13. package/dist/v2/index.cjs +1 -1
  14. package/dist/v2/index.mjs +1 -1
  15. package/dist/v2/index.umd.js +4 -1
  16. package/dist/v2/index.umd.js.map +1 -1
  17. package/package.json +8 -9
  18. package/dist/copilotkit-B4Jb1QEy.cjs.map +0 -1
  19. package/dist/copilotkit-snbJkMqQ.mjs.map +0 -1
  20. package/skills/react-core/SKILL.md +0 -110
  21. package/skills/react-core/references/agent-access.md +0 -398
  22. package/skills/react-core/references/attachments.md +0 -311
  23. package/skills/react-core/references/capabilities.md +0 -138
  24. package/skills/react-core/references/chat-components.md +0 -246
  25. package/skills/react-core/references/client-side-tools.md +0 -358
  26. package/skills/react-core/references/custom-message-renderers.md +0 -223
  27. package/skills/react-core/references/debug-mode.md +0 -140
  28. package/skills/react-core/references/human-in-the-loop.md +0 -312
  29. package/skills/react-core/references/provider-setup.md +0 -358
  30. package/skills/react-core/references/rendering-activity-messages.md +0 -201
  31. package/skills/react-core/references/rendering-tool-calls.md +0 -319
  32. package/skills/react-core/references/suggestions.md +0 -211
  33. package/skills/react-core/references/switching-agents-recipes.md +0 -161
  34. package/skills/react-core/references/switching-agents.md +0 -240
  35. package/skills/react-core/references/threads.md +0 -289
@@ -1,311 +0,0 @@
1
- # CopilotKit Attachments (React)
2
-
3
- This skill builds on `copilotkit/provider-setup` and
4
- `copilotkit/chat-components`. `useAttachments` is exposed both as an opt-in
5
- prop on `<CopilotChat>` and as a direct hook for custom chat surfaces.
6
-
7
- ## Setup
8
-
9
- ### Easiest: turn attachments on via `<CopilotChat>`
10
-
11
- ```tsx
12
- "use client";
13
- import { CopilotChat } from "@copilotkit/react-core/v2";
14
- import "@copilotkit/react-core/v2/styles.css";
15
-
16
- export function ChatPanel() {
17
- return (
18
- <CopilotChat
19
- agentId="default"
20
- attachments={{
21
- enabled: true,
22
- accept: "image/*",
23
- maxSize: 10 * 1024 * 1024, // 10 MB
24
- onUploadFailed: ({ reason, file, message }) => {
25
- console.warn(`[attachments] ${reason}: ${file.name} — ${message}`);
26
- },
27
- }}
28
- />
29
- );
30
- }
31
- ```
32
-
33
- ### Direct hook usage for custom surfaces
34
-
35
- ```tsx
36
- "use client";
37
- import {
38
- useAttachments,
39
- useAgent,
40
- useCopilotKit,
41
- } from "@copilotkit/react-core/v2";
42
- import type { InputContent } from "@ag-ui/core";
43
-
44
- export function CustomChatInput() {
45
- const { agent } = useAgent({ agentId: "default" });
46
- const { copilotkit } = useCopilotKit();
47
- const {
48
- attachments,
49
- containerRef,
50
- fileInputRef,
51
- handleFileUpload,
52
- handleDragOver,
53
- handleDragLeave,
54
- handleDrop,
55
- removeAttachment,
56
- consumeAttachments,
57
- } = useAttachments({ config: { enabled: true, accept: "*/*" } });
58
-
59
- return (
60
- <div
61
- ref={containerRef}
62
- onDragOver={handleDragOver}
63
- onDragLeave={handleDragLeave}
64
- onDrop={handleDrop}
65
- >
66
- <input type="file" ref={fileInputRef} onChange={handleFileUpload} />
67
- {attachments.map((a) => (
68
- <button key={a.id} onClick={() => removeAttachment(a.id)}>
69
- {a.filename} ({a.status})
70
- </button>
71
- ))}
72
- <button
73
- onClick={async () => {
74
- const ready = consumeAttachments();
75
- // `ready` is Attachment[] — map each to an AG-UI InputContent part
76
- // before spreading into the message content array.
77
- const contentParts: InputContent[] = [
78
- { type: "text", text: "See attachments." },
79
- ...ready.map(
80
- (att) =>
81
- ({
82
- type: att.type,
83
- source: att.source,
84
- metadata: {
85
- ...(att.filename ? { filename: att.filename } : {}),
86
- ...att.metadata,
87
- },
88
- }) as InputContent,
89
- ),
90
- ];
91
- agent.addMessage({
92
- id: crypto.randomUUID(),
93
- role: "user",
94
- content: contentParts,
95
- });
96
- await copilotkit.runAgent({ agent });
97
- }}
98
- >
99
- Send
100
- </button>
101
- </div>
102
- );
103
- }
104
- ```
105
-
106
- `consumeAttachments()` returns the `Attachment[]` queue — each entry has
107
- `{ id, type, source, filename, status, metadata }` and is NOT a valid
108
- AG-UI content part. Map each attachment to an `InputContent` shape
109
- (`{ type, source, metadata }`) before spreading into a message's `content`
110
- array. See `packages/react-core/src/v2/components/chat/CopilotChat.tsx:247-268`
111
- for the canonical transform.
112
-
113
- ## Core Patterns
114
-
115
- ### Custom upload backend (S3 / presigned URL)
116
-
117
- `onUpload` replaces the default base64-inline strategy. Return an
118
- `Attachment.source` describing where the file lives.
119
-
120
- ```tsx
121
- useAttachments({
122
- config: {
123
- enabled: true,
124
- accept: "image/*,application/pdf",
125
- maxSize: 50 * 1024 * 1024,
126
- onUpload: async (file) => {
127
- const { url } = await fetch("/api/upload", {
128
- method: "POST",
129
- body: file,
130
- }).then((r) => r.json());
131
- return { type: "url", value: url, mimeType: file.type };
132
- },
133
- onUploadFailed: ({ reason, file, message }) => {
134
- toast.error(`${file.name}: ${message}`);
135
- },
136
- },
137
- });
138
- ```
139
-
140
- ### Upload concurrency
141
-
142
- Multi-file selections upload one file at a time by default, and the whole
143
- selection is queued as `status: "uploading"` right away. Raise
144
- `maxConcurrentUploads` to run several together — the rest then start as slots
145
- free up, `Infinity` lifts the limit, and `onUpload` may be called concurrently,
146
- so above `1` it must not assume the previous file finished. The pool is per hook,
147
- not per call, so a paste landing mid-upload shares the same slots instead of
148
- opening its own.
149
-
150
- ```tsx
151
- useAttachments({
152
- config: {
153
- enabled: true,
154
- maxConcurrentUploads: 6,
155
- onUpload: async (file) => uploadToStorage(file),
156
- },
157
- });
158
- ```
159
-
160
- ### Feedback on failed uploads
161
-
162
- ```tsx
163
- useAttachments({
164
- config: {
165
- enabled: true,
166
- maxSize: 5 * 1024 * 1024,
167
- onUploadFailed: ({ reason, file, message }) => {
168
- // reason: "file-too-large" | "invalid-type" | "upload-failed"
169
- toast.error(message);
170
- },
171
- },
172
- });
173
- ```
174
-
175
- ## Common Mistakes
176
-
177
- ### HIGH — Forgetting to call `consumeAttachments` on submit
178
-
179
- Wrong:
180
-
181
- ```tsx
182
- const { attachments } = useAttachments({ config: { enabled: true } });
183
- const onSubmit = () => {
184
- sendMessage({ text, attachments });
185
- // attachments queue never cleared — sticks around for the next message
186
- };
187
- ```
188
-
189
- Correct:
190
-
191
- ```tsx
192
- const { consumeAttachments } = useAttachments({ config: { enabled: true } });
193
- const onSubmit = () => {
194
- const ready = consumeAttachments();
195
- sendMessage({ text, attachments: ready });
196
- };
197
- ```
198
-
199
- `consumeAttachments()` returns ready attachments AND drains the internal
200
- queue. If you submit without calling it, attachments stay in state and
201
- accompany every subsequent message.
202
-
203
- Source: `packages/react-core/src/v2/hooks/use-attachments.tsx:40-46`
204
-
205
- ### HIGH — Passing `maxSize` in KB or MB
206
-
207
- Wrong:
208
-
209
- ```tsx
210
- useAttachments({ config: { enabled: true, maxSize: 10 } });
211
- // 10 bytes! Effectively blocks every file.
212
- ```
213
-
214
- Correct:
215
-
216
- ```tsx
217
- useAttachments({
218
- config: { enabled: true, maxSize: 10 * 1024 * 1024 }, // 10 MB
219
- });
220
- ```
221
-
222
- `maxSize` is bytes. The default is `20 * 1024 * 1024` (20 MB). Passing a
223
- small number without the multiplier silently rejects every file via
224
- `onUploadFailed({ reason: "file-too-large" })`.
225
-
226
- Source: `packages/react-core/src/v2/hooks/use-attachments.tsx:73-74`
227
-
228
- ### HIGH — Missing `containerRef` on the paste-scope element
229
-
230
- Wrong:
231
-
232
- ```tsx
233
- const { enabled } = useAttachments({ config: { enabled: true } });
234
- return (
235
- <div>
236
- <input type="text" />
237
- </div>
238
- ); // no containerRef attached
239
- ```
240
-
241
- Correct:
242
-
243
- ```tsx
244
- const { containerRef, handleDragOver, handleDrop } = useAttachments({
245
- config: { enabled: true },
246
- });
247
- return (
248
- <div ref={containerRef} onDragOver={handleDragOver} onDrop={handleDrop}>
249
- <input type="text" />
250
- </div>
251
- );
252
- ```
253
-
254
- Clipboard paste is scoped to the element `containerRef` points at. Without
255
- attaching the ref, `Ctrl+V` / `Cmd+V` never reaches the paste handler and
256
- users silently can't paste images from screenshots.
257
-
258
- Source: `packages/react-core/src/v2/hooks/use-attachments.tsx:207-239`
259
-
260
- ### MEDIUM — Using `imageUploadsEnabled` on `<CopilotChat>`
261
-
262
- Wrong:
263
-
264
- ```tsx
265
- <CopilotChat imageUploadsEnabled />
266
- ```
267
-
268
- Correct:
269
-
270
- ```tsx
271
- <CopilotChat
272
- attachments={{
273
- enabled: true,
274
- accept: "image/*",
275
- maxSize: 5 * 1024 * 1024,
276
- }}
277
- />
278
- ```
279
-
280
- `imageUploadsEnabled` was the v1 flag. v2 replaces it with the `attachments`
281
- config object, which is powered by `useAttachments` internally and supports
282
- any MIME type, not only images.
283
-
284
- Source: `docs/content/docs/(root)/migration-guides/migrate-attachments.mdx`
285
-
286
- ### MEDIUM — Ignoring `onUploadFailed`
287
-
288
- Wrong:
289
-
290
- ```tsx
291
- useAttachments({ config: { enabled: true } });
292
- // Rejected files silently disappear. User has no idea why.
293
- ```
294
-
295
- Correct:
296
-
297
- ```tsx
298
- useAttachments({
299
- config: {
300
- enabled: true,
301
- onUploadFailed: ({ reason, file, message }) => {
302
- toast.error(message);
303
- },
304
- },
305
- });
306
- ```
307
-
308
- Size violations, MIME mismatches, and `onUpload` throws all drop the file
309
- from the queue with no UI feedback unless `onUploadFailed` is wired.
310
-
311
- Source: `packages/react-core/src/v2/hooks/use-attachments.tsx:79-157`
@@ -1,138 +0,0 @@
1
- # CopilotKit Capabilities (React)
2
-
3
- This skill builds on `copilotkit/agent-access`. `useCapabilities` internally
4
- calls `useAgent` and reads the `capabilities` field populated from the
5
- runtime `/info` response.
6
-
7
- `AgentCapabilities` is from `@ag-ui/core`. The hook is synchronous — there
8
- is no loading state, but the value is `undefined` until the handshake
9
- completes.
10
-
11
- ## Setup
12
-
13
- ```tsx
14
- "use client";
15
- import { useCapabilities } from "@copilotkit/react-core/v2";
16
-
17
- export function VoiceButton() {
18
- const caps = useCapabilities(); // defaults to DEFAULT_AGENT_ID
19
-
20
- // Handshake pending — show a placeholder
21
- if (caps === undefined) return <div className="skeleton h-8 w-8" />;
22
-
23
- // Handshake complete — feature-gate
24
- if (!caps.transcription) return null;
25
-
26
- return <button>Record</button>;
27
- }
28
- ```
29
-
30
- ## Core Patterns
31
-
32
- ### Scope to a specific agent
33
-
34
- ```tsx
35
- const caps = useCapabilities("research");
36
- ```
37
-
38
- ### Feature-gate tools UI
39
-
40
- ```tsx
41
- const caps = useCapabilities("default");
42
-
43
- if (caps === undefined) return <ToolsSkeleton />;
44
- if (caps.tools?.supported === false) return null;
45
- return <ToolsPanel />;
46
- ```
47
-
48
- ### Narrow optional fields defensively
49
-
50
- `AgentCapabilities` is a partial declaration — fields may be absent when
51
- the agent opts not to declare them.
52
-
53
- ```tsx
54
- const caps = useCapabilities();
55
- const maxTokens = caps?.maxOutputTokens ?? "unknown";
56
- ```
57
-
58
- ## Common Mistakes
59
-
60
- ### HIGH — Treating `undefined` as "no capabilities"
61
-
62
- Wrong:
63
-
64
- ```tsx
65
- function VoiceButton() {
66
- const caps = useCapabilities();
67
- if (!caps?.transcription) return null; // hides button forever while handshake pending
68
- return <button>Record</button>;
69
- }
70
- ```
71
-
72
- Correct:
73
-
74
- ```tsx
75
- function VoiceButton() {
76
- const caps = useCapabilities();
77
- if (caps === undefined) return <div className="skeleton h-8 w-8" />;
78
- if (!caps.transcription) return null;
79
- return <button>Record</button>;
80
- }
81
- ```
82
-
83
- `useCapabilities` returns `undefined` until the runtime `/info` handshake
84
- completes. Treating `undefined` the same as `{ transcription: false }`
85
- hides features that should be visible post-handshake.
86
-
87
- Source: `packages/react-core/src/v2/hooks/use-capabilities.tsx:7-9`
88
-
89
- ### MEDIUM — Non-null assertion on optional fields
90
-
91
- Wrong:
92
-
93
- ```tsx
94
- const caps = useCapabilities();
95
- return <div>Max tokens: {caps!.maxOutputTokens}</div>;
96
- // Crashes if agent didn't declare capabilities, or didn't declare maxOutputTokens.
97
- ```
98
-
99
- Correct:
100
-
101
- ```tsx
102
- const caps = useCapabilities();
103
- return <div>Max tokens: {caps?.maxOutputTokens ?? "unknown"}</div>;
104
- ```
105
-
106
- `AgentCapabilities` is a partial declaration. Agents opt in to each
107
- capability, so every field is optional. Narrow before deref.
108
-
109
- Source: `packages/react-core/src/v2/hooks/use-capabilities.tsx:20-22`
110
-
111
- ### MEDIUM — Expecting deep merge from server-side `capabilities`
112
-
113
- Wrong:
114
-
115
- ```ts
116
- // Server:
117
- new BuiltInAgent({
118
- // ...
119
- capabilities: { tools: { supported: true } },
120
- });
121
- // Client expects caps.tools.clientProvided to still be set by the default
122
- ```
123
-
124
- Correct:
125
-
126
- ```ts
127
- // Server — provide full category:
128
- new BuiltInAgent({
129
- // ...
130
- capabilities: { tools: { supported: true, clientProvided: true } },
131
- });
132
- ```
133
-
134
- BuiltInAgent shallow-merges capabilities at the category level — providing
135
- `tools: {...}` replaces the whole category, not just the specified fields.
136
- The client then sees exactly what was declared.
137
-
138
- Source: `packages/runtime/src/agent/index.ts:821-829,883-887`
@@ -1,246 +0,0 @@
1
- # CopilotKit Chat Components (React)
2
-
3
- This skill builds on `copilotkit/provider-setup`. Read it first — every
4
- chat component must be inside the `CopilotKit` provider (from
5
- `@copilotkit/react-core/v2`).
6
-
7
- All chat components live on `@copilotkit/react-core/v2`. The legacy
8
- `@copilotkit/react-ui` package is v1-only; its `/v2` subpath is a CSS-only
9
- import.
10
-
11
- ## Setup
12
-
13
- ```tsx
14
- "use client";
15
- import { CopilotChat } from "@copilotkit/react-core/v2";
16
- import "@copilotkit/react-core/v2/styles.css";
17
-
18
- export function ChatPanel() {
19
- return <CopilotChat agentId="default" />;
20
- }
21
- ```
22
-
23
- `<CopilotChat>` manages messages, input, streaming, attachments, and
24
- suggestions internally via `useAgent`. You do not pass `messages` or
25
- `isRunning` — they are managed for you.
26
-
27
- ## Core Patterns
28
-
29
- ### Floating popup
30
-
31
- ```tsx
32
- import { CopilotPopup } from "@copilotkit/react-core/v2";
33
-
34
- <CopilotPopup agentId="default" defaultOpen={false} />;
35
- ```
36
-
37
- ### Persistent sidebar
38
-
39
- ```tsx
40
- import { CopilotSidebar } from "@copilotkit/react-core/v2";
41
-
42
- <CopilotSidebar agentId="default">
43
- <MainAppContent />
44
- </CopilotSidebar>;
45
- ```
46
-
47
- ### Headless composition with slot primitives
48
-
49
- Use `CopilotChatView` plus the individual slot components when you need
50
- full control over messages, input, or layout. This is the path when you
51
- want to manage `messages`/`isRunning` yourself.
52
-
53
- ```tsx
54
- import {
55
- CopilotChatView,
56
- useAgent,
57
- useCopilotKit,
58
- } from "@copilotkit/react-core/v2";
59
-
60
- export function HeadlessChat() {
61
- const { agent } = useAgent({ agentId: "default" });
62
- const { copilotkit } = useCopilotKit();
63
-
64
- return (
65
- <CopilotChatView
66
- messages={agent.messages}
67
- isRunning={agent.isRunning}
68
- onSubmitMessage={async (text) => {
69
- agent.addMessage({
70
- id: crypto.randomUUID(),
71
- role: "user",
72
- content: text,
73
- });
74
- await copilotkit.runAgent({ agent });
75
- }}
76
- >
77
- {({ messageView, input }) => (
78
- <>
79
- {messageView}
80
- {input}
81
- </>
82
- )}
83
- </CopilotChatView>
84
- );
85
- }
86
- ```
87
-
88
- ### Custom labels
89
-
90
- ```tsx
91
- <CopilotChat
92
- agentId="default"
93
- labels={{
94
- chatInputPlaceholder: "Ask about the data…",
95
- welcomeMessageText: "What would you like to analyze?",
96
- }}
97
- />
98
- ```
99
-
100
- ## Common Mistakes
101
-
102
- ### CRITICAL — Importing `CopilotPanel`
103
-
104
- Wrong:
105
-
106
- ```tsx
107
- import { CopilotPanel } from "@copilotkit/react-core/v2";
108
- ```
109
-
110
- Correct:
111
-
112
- ```tsx
113
- import {
114
- CopilotChat,
115
- CopilotPopup,
116
- CopilotSidebar,
117
- CopilotChatView,
118
- } from "@copilotkit/react-core/v2";
119
- ```
120
-
121
- `CopilotPanel` does not exist in v2 (or v1). This is a common hallucination.
122
- The four chat surfaces are `CopilotChat`, `CopilotPopup`, `CopilotSidebar`,
123
- and the headless `CopilotChatView`.
124
-
125
- Source: `packages/react-core/src/v2/components/chat/index.ts` (no `CopilotPanel` export)
126
-
127
- ### CRITICAL — Importing chat components from `@copilotkit/react-ui` in v2
128
-
129
- Wrong:
130
-
131
- ```tsx
132
- import { CopilotPopup } from "@copilotkit/react-ui";
133
- import "@copilotkit/react-ui/styles.css";
134
- ```
135
-
136
- Correct:
137
-
138
- ```tsx
139
- import { CopilotPopup } from "@copilotkit/react-core/v2";
140
- import "@copilotkit/react-core/v2/styles.css";
141
- ```
142
-
143
- `@copilotkit/react-ui` is v1 only. The v2 subpath of `react-ui` is a
144
- CSS-only import — the components are not there. All v2 chat components ship
145
- from `@copilotkit/react-core/v2`.
146
-
147
- Source: `packages/react-ui/src/v2/index.ts` (CSS-only); v2 migration guide
148
-
149
- ### HIGH — Passing `messages` or `isRunning` to `<CopilotChat>`
150
-
151
- Wrong:
152
-
153
- ```tsx
154
- <CopilotChat agentId="default" messages={myMessages} isRunning={busy} />
155
- ```
156
-
157
- Correct:
158
-
159
- ```tsx
160
- // CopilotChat manages messages and isRunning internally.
161
- <CopilotChat agentId="default" />
162
-
163
- // For manual control, drop down to headless CopilotChatView. Its `children`
164
- // is a render prop that receives the bound slot elements:
165
- <CopilotChatView
166
- messages={myMessages}
167
- isRunning={busy}
168
- onSubmitMessage={handleSubmit}
169
- >
170
- {({ messageView, input }) => (
171
- <>
172
- {messageView}
173
- {input}
174
- </>
175
- )}
176
- </CopilotChatView>
177
- ```
178
-
179
- `CopilotChatProps` explicitly `Omit`s `messages` and `isRunning` — passing
180
- them is a TypeScript error, and `<CopilotChat>` always reads from its
181
- internal `useAgent` call.
182
-
183
- Source: `packages/react-core/src/v2/components/chat/CopilotChat.tsx:37-52`
184
-
185
- ### MEDIUM — Two `<CopilotChat>` with the same `agentId` + `threadId`
186
-
187
- Wrong:
188
-
189
- ```tsx
190
- <CopilotChat agentId="research" threadId="t1" />
191
- <CopilotChat agentId="research" threadId="t1" />
192
- ```
193
-
194
- Correct:
195
-
196
- ```tsx
197
- // Either use distinct threadIds...
198
- <CopilotChat agentId="research" threadId="panel-a" />
199
- <CopilotChat agentId="research" threadId="panel-b" />
200
-
201
- // ...or mount only one <CopilotChat> instance per agent/thread.
202
- ```
203
-
204
- Both components resolve the same shared agent. `CopilotChat` binds with
205
- `useAgent({ agentId })` — the shared-instance shape — and then writes
206
- `agent.threadId` onto it. There is no per-thread clone, so two instances
207
- naming one `(agentId, threadId)` pair drive a single instance:
208
-
209
- - Each runs its own connect effect against that instance, so the same thread is
210
- connected twice.
211
- - Each assigns `agent.abortController`, so the later mount replaces the
212
- earlier one and unmounting either can abort the other's in-flight request.
213
- - Each calls `setMessages` on it, so whichever connect resolves last wins.
214
-
215
- The bookkeeping that would prevent this (`lastConnectedThreadId`,
216
- `activeConnectCountRef`) is per component, so it does not coordinate across
217
- two instances.
218
-
219
- See `agent-access` for the two shapes `useAgent` admits and which one owns a
220
- private instance.
221
-
222
- Source: `packages/react-core/src/v2/components/chat/CopilotChat.tsx:138-141`
223
- (the shared bind), `:395` (the threadId write), `:421-423` (the shared
224
- abortController), `:429` (the connect call), `:261-266` (the per-instance
225
- bookkeeping)
226
-
227
- ### MEDIUM — Missing the v2 CSS import
228
-
229
- Wrong:
230
-
231
- ```tsx
232
- import { CopilotChat } from "@copilotkit/react-core/v2";
233
- // …no styles imported
234
- ```
235
-
236
- Correct:
237
-
238
- ```tsx
239
- import { CopilotChat } from "@copilotkit/react-core/v2";
240
- import "@copilotkit/react-core/v2/styles.css";
241
- ```
242
-
243
- The chat components ship unstyled without the v2 stylesheet. Import it once
244
- at the root of the app or in the same file that sets up the provider.
245
-
246
- Source: `packages/react-core/src/v2/index.ts:3` (imports `./index.css`)