Skip to content

Commit bc65153

Browse files
committed
docs(shell-docs): add intro sentences before code examples that directly follow headings
1 parent 795b0a9 commit bc65153

11 files changed

Lines changed: 46 additions & 0 deletions

File tree

showcase/shell-docs/src/content/docs/generative-ui/mcp-apps.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ The middleware supports two transport types:
5353

5454
### HTTP
5555

56+
Use this format to connect to an MCP server that accepts standard HTTP requests:
57+
5658
```typescript
5759
{
5860
type: "http",
@@ -63,6 +65,8 @@ The middleware supports two transport types:
6365

6466
### SSE
6567

68+
Use this format to connect to an MCP server that streams events over a persistent connection:
69+
6670
```typescript
6771
{
6872
type: "sse",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ auto-registered by `CopilotKitProvider`, so no extra wiring is needed.
3030

3131
### Enable it in the runtime
3232

33+
Add `OpenGenerativeUIMiddleware` to your runtime configuration:
34+
3335
<Snippet region="minimal-runtime-flag" />
3436

3537
The `OpenGenerativeUIMiddleware` then converts the agent's streamed
@@ -39,6 +41,8 @@ sandboxed iframe.
3941

4042
### Drop `<CopilotChat />` into the page
4143

44+
Wrap your app in `CopilotKitProvider` and render `<CopilotChat>` — no extra props needed:
45+
4246
<Snippet region="minimal-provider-setup" />
4347

4448
That's it. Ask the agent "build me a simple greeting card" to see HTML

showcase/shell-docs/src/content/docs/prebuilt-components/chat.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ choosing:
4646

4747
## Code example
4848

49+
The minimal component needed to render an in-page chat:
50+
4951
```tsx title="page.tsx"
5052
// [!code word:CopilotChat]
5153
import { CopilotChat } from "@copilotkit/react-core/v2";

showcase/shell-docs/src/content/docs/unselected/coding-agents.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Point your editor's MCP configuration at that URL — that's the whole setup.
3737
<Step>
3838
### Add the server
3939

40+
Paste the following into your `mcp.json` to register the CopilotKit MCP server:
41+
4042
```json
4143
{
4244
"mcpServers": {
@@ -59,6 +61,8 @@ Save the file — Cursor picks up the new server automatically.
5961
<Step>
6062
### Register the server
6163

64+
Run the following command to add the CopilotKit MCP server over HTTP:
65+
6266
```bash
6367
claude mcp add --transport http copilotkit-mcp https://mcp.copilotkit.ai/mcp
6468
```
@@ -67,6 +71,8 @@ claude mcp add --transport http copilotkit-mcp https://mcp.copilotkit.ai/mcp
6771
<Step>
6872
### Verify
6973

74+
Confirm the server registered successfully:
75+
7076
```bash
7177
claude mcp list
7278
```

showcase/shell-docs/src/content/docs/unselected/generative-ui/a2ui.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ That tree lives in `backend/schemas/flight_schema.json`. Components without data
104104

105105
### Building the catalog
106106

107+
Define the React components for each primitive type and assemble them into a catalog. The A2UI binder uses this catalog to resolve schema nodes to components at render time:
108+
107109
<Snippet region="definitions-types" cell="a2ui-fixed-schema" />
108110

109111
<Snippet region="renderers-tsx" cell="a2ui-fixed-schema" />
@@ -112,6 +114,8 @@ That tree lives in `backend/schemas/flight_schema.json`. Components without data
112114

113115
### Wiring the schema + tool
114116

117+
Load the schema file and register the tool that emits render operations. The agent calls this tool with structured data; A2UI resolves each field against the schema and passes typed props to your components:
118+
115119
<Snippet region="backend-schema-json-load" cell="a2ui-fixed-schema" />
116120

117121
<Snippet region="backend-render-operations" cell="a2ui-fixed-schema" />

showcase/shell-docs/src/content/docs/unselected/generative-ui/your-components/display-only.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The `name` you pass to `useComponent` is what the agent sees as the tool name. M
4040

4141
## Minimal example
4242

43+
The following registers a display tool and wires it to a React component. When the agent emits that tool call, CopilotKit resolves the arguments against the Zod schema and passes them as typed props:
44+
4345
```tsx title="page.tsx"
4446
import { z } from "zod";
4547
import { useComponent } from "@copilotkit/react-core/v2";

showcase/shell-docs/src/content/docs/unselected/prebuilt-components/chat.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ choosing:
4747

4848
## Code example
4949

50+
The minimal component needed to render an in-page chat:
51+
5052
```tsx title="page.tsx"
5153
// [!code word:CopilotChat]
5254
import { CopilotChat } from "@copilotkit/react-core/v2";

showcase/shell-docs/src/content/docs/unselected/premium/headless-ui.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Fully Headless UI is an **Early Access** Premium feature. Grab a free `publicLic
2727
<Step>
2828
### Create a new application
2929

30+
Scaffold a new CopilotKit project using the CLI:
31+
3032
```bash
3133
npx copilotkit@latest create
3234
```
@@ -35,6 +37,8 @@ npx copilotkit@latest create
3537
<Step>
3638
### Wire your CopilotKit provider with a license key
3739

40+
Wrap your root layout with `CopilotKitProvider` and pass in your public license key:
41+
3842
```tsx title="src/app/layout.tsx"
3943
<CopilotKitProvider publicLicenseKey="your-free-public-license-key">
4044
{children}
@@ -45,6 +49,8 @@ npx copilotkit@latest create
4549
<Step>
4650
### Build a headless chat component
4751

52+
Use `useCopilotChatHeadless_c` to access messages, a send function, and loading state, then wire them to your own UI:
53+
4854
```tsx title="src/app/page.tsx"
4955
"use client";
5056
import { useState } from "react";
@@ -103,6 +109,8 @@ You can render generative UI either via `useFrontendTool` / `useComponent`, or b
103109

104110
### With `useFrontendTool`
105111

112+
Register a frontend tool and attach a render function. CopilotKit inserts your component wherever that tool call appears in the message stream:
113+
106114
```tsx title="src/app/components/chat.tsx"
107115
import { useFrontendTool } from "@copilotkit/react-core/v2";
108116

@@ -173,6 +181,8 @@ CopilotKit's suggestions give users a list of generated or static prompts. The h
173181

174182
### Generating suggestions
175183

184+
Use `useCopilotChatSuggestions` to generate and display prompt suggestions in your headless UI:
185+
176186
```tsx title="src/app/components/chat.tsx"
177187
import {
178188
useCopilotChatHeadless_c,

showcase/shell-docs/src/content/docs/unselected/premium/observability.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ interface CopilotErrorEvent {
135135

136136
### Sentry
137137

138+
Forward error events to Sentry using its `captureException` API:
139+
138140
```tsx
139141
import * as Sentry from "@sentry/react";
140142

@@ -161,6 +163,8 @@ import * as Sentry from "@sentry/react";
161163

162164
### Custom analytics
163165

166+
Route all CopilotKit events to your analytics pipeline via the `onError` callback:
167+
164168
```tsx
165169
<CopilotKitProvider
166170
publicLicenseKey={process.env.NEXT_PUBLIC_COPILOTKIT_LICENSE_KEY}
@@ -183,6 +187,8 @@ import * as Sentry from "@sentry/react";
183187

184188
### Development
185189

190+
Enable the dev console and attach lightweight logging hooks for local iteration:
191+
186192
```tsx
187193
<CopilotKitProvider
188194
runtimeUrl="http://localhost:3000/api/copilotkit"
@@ -201,6 +207,8 @@ import * as Sentry from "@sentry/react";
201207

202208
### Production
203209

210+
Disable the dev console and route errors to your logging and monitoring services:
211+
204212
```tsx
205213
<CopilotKitProvider
206214
runtimeUrl="https://your-app.com/api/copilotkit"

showcase/shell-docs/src/content/docs/unselected/premium/overview.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ From the left nav in the Copilot Cloud dashboard.
6060
<Step>
6161
### Use it in your provider
6262

63+
Pass your public license key to `CopilotKitProvider`:
64+
6365
```tsx title="app/layout.tsx"
6466
<CopilotKitProvider publicLicenseKey="your-public-license-key">
6567
{children}

0 commit comments

Comments
 (0)