mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
b53edc0a6e
The earlier commits in this PR taught `createCopilotEndpoint` paired with
`handle` from `hono/vercel`, and added `hono` to 20 install commands with a
callout explaining why readers must install it. Both were wrong, and the second
was a consequence of the first.
`createCopilotEndpoint` is a **deprecated alias**. This repo's own handler table
says so — `docs/backend/runtime-endpoints.mdx`:
| Deprecated | Use instead |
| `createCopilotEndpoint` | `createCopilotHonoHandler` |
| `createCopilotEndpointSingleRoute` | ... with mode: "single-route" |
`createCopilotRuntimeHandler` serves the same multi-route mode (it is the
default), returns a plain fetch handler, is not deprecated, and needs **no hono
at all**. So the route collapses to:
const handler = createCopilotRuntimeHandler({
runtime,
basePath: "/api/copilotkit",
});
export const GET = handler;
export const POST = handler;
`hono` was therefore an artifact of the shape, not a requirement of the library.
The install lines and the callout are reverted; nothing tells readers to install
it any more.
## Verified with hono deleted, not merely absent from package.json
`examples/shadcn` converted to this shape, `hono` removed from its
`package.json`, and `node_modules/hono` deleted outright so a hoisted copy could
not mask the result:
GET /api/copilotkit/info -> 200
POST /api/copilotkit/agent/default/run -> 200, chat turn rendered
tsc --noEmit / eslint / next build -> clean
next build route -> ƒ /api/copilotkit/[[...slug]]
The doctest sidecar drops `hono` too, so the CI gate now typechecks the
canonical snippet against `@copilotkit/runtime` alone — proof by construction
that the snippet needs nothing else.
pnpm tsx scripts/doc-tests/run.ts -> 2 passed, 0 failed
showcase/shell-docs: typecheck -> exit 0
showcase/shell-docs: build -> exit 0
structural audit: 31/31 mdx files, fence + JSX identical to HEAD
## Also corrected
`docs/backend/custom-agent.mdx` repeated the same incorrect transport claim the
earlier commit fixed in four other places ("Both `<CopilotKit>` and
`<CopilotKitProvider>` negotiate the transport when the prop is omitted").
Corrected to match released behaviour.
## Left alone deliberately
`snippets/shared/backend/custom-agent.mdx` and `docs/backend/custom-agent.mdx`
still call `createCopilotEndpoint` in three fences each, as
`export default copilotEndpoint` — the Hono-app deployment pattern rather than a
Next.js route handler. That predates this PR, the documented replacement is
`createCopilotHonoHandler`, and I have not run that shape. Recorded as follow-up
rather than guessed at. (The two files have also drifted from each other, which
is a separate problem.)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
47 lines
1.2 KiB
JSON
47 lines
1.2 KiB
JSON
{
|
|
"name": "shadcn-example",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"description": "CopilotKit useAgent chat example built with official ShadCN chat and chart components.",
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "eslint .",
|
|
"check-types": "tsc --noEmit -p tsconfig.json",
|
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
},
|
|
"dependencies": {
|
|
"@copilotkit/react-core": "1.68.3",
|
|
"@copilotkit/runtime": "1.68.3",
|
|
"@shadcn/react": "^0.1.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "2.1.1",
|
|
"lucide-react": "1.21.0",
|
|
"motion": "^12.42.0",
|
|
"next": "16.2.9",
|
|
"openai": "6.45.0",
|
|
"radix-ui": "^1.6.0",
|
|
"react": "19.2.3",
|
|
"react-dom": "19.2.3",
|
|
"recharts": "3.8.0",
|
|
"tailwind-merge": "3.6.0",
|
|
"zod": "3.25.76"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4.3.1",
|
|
"@types/node": "^20",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"eslint": "^9.39.2",
|
|
"eslint-config-next": "16.2.9",
|
|
"postcss": "^8.5.15",
|
|
"tailwindcss": "4.3.1",
|
|
"tw-animate-css": "^1.4.0",
|
|
"typescript": "^5.9.3",
|
|
"shadcn": "^4.12.0"
|
|
},
|
|
"packageManager": "pnpm@10.33.4"
|
|
}
|