[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-copilotkit-runtime":3,"mdc-i4zu2v-key":54,"related-org-copilotkit-runtime":1292,"related-repo-copilotkit-runtime":1463},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":49,"sourceUrl":52,"mdContent":53},"runtime","mount and configure CopilotRuntime servers","@copilotkit\u002Fruntime — mount a fetch-native CopilotRuntime on any JS server, wire middleware, pick an AgentRunner, instantiate BuiltInAgent (Factory Mode with TanStack AI is the preferred default) or plug in any of 12 external agent frameworks (Mastra, LangGraph, CrewAI Crews\u002FFlows, PydanticAI, ADK, LlamaIndex, Agno, AWS Strands, MS Agent Framework, AG2, A2A), enable Intelligence mode for durable threads + websocket, register server-side tools via defineTool, and wire voice transcription. Uses the fetch-based createCopilotRuntimeHandler primitive — the Express\u002FHono adapters are discouraged. Load the reference under references\u002F that matches your task.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"copilotkit","CopilotKit","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcopilotkit.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Backend","backend","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"JavaScript","javascript",{"name":21,"slug":22,"type":15},"Middleware","middleware",35928,"https:\u002F\u002Fgithub.com\u002FCopilotKit\u002FCopilotKit","2026-07-12T08:06:10.034875",null,4434,[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"agent","agent-native","agentic-ai","agents","ai","ai-agent","ai-assistant","assistant","assistant-chat-bots","copilot","copilot-chat","generative-ui","js","llm","nextjs","open-source","react","reactjs","ts","typescript",{"repoUrl":24,"stars":23,"forks":27,"topics":50,"description":51},[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"The Frontend Stack for Agents & Generative UI. React, Angular, Mobile, Slack, and more.  Makers of the AG-UI Protocol","https:\u002F\u002Fgithub.com\u002FCopilotKit\u002FCopilotKit\u002Ftree\u002FHEAD\u002Fskills\u002Fruntime","---\nname: runtime\ndescription: >\n  @copilotkit\u002Fruntime — mount a fetch-native CopilotRuntime on any JS server, wire\n  middleware, pick an AgentRunner, instantiate BuiltInAgent (Factory Mode with TanStack AI\n  is the preferred default) or plug in any of 12 external agent frameworks (Mastra,\n  LangGraph, CrewAI Crews\u002FFlows, PydanticAI, ADK, LlamaIndex, Agno, AWS Strands, MS Agent\n  Framework, AG2, A2A), enable Intelligence mode for durable threads + websocket,\n  register server-side tools via defineTool, and wire voice transcription. Uses the\n  fetch-based createCopilotRuntimeHandler primitive — the Express\u002FHono adapters are\n  discouraged. Load the reference under references\u002F that matches your task.\ntype: core\nlibrary: copilotkit\nlibrary_version: \"1.56.2\"\nrequires: []\nsources:\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Ffetch-handler.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Fruntime.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Fhooks.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Fmiddleware.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Frunner\u002Fagent-runner.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Frunner\u002Fin-memory.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Frunner\u002Fintelligence.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fintelligence-platform\u002Fclient.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Ftranscription-service\u002Ftranscription-service.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fhandlers\u002Fhandle-transcribe.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fagent\u002Findex.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fagent\u002Fconverters\u002Ftanstack.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fsqlite-runner\u002Fsrc\u002Fsqlite-runner.ts\"\n  - \"CopilotKit\u002FCopilotKit:packages\u002Fshared\u002Fsrc\u002Ftranscription-errors.ts\"\n---\n\n# CopilotKit Runtime\n\n`@copilotkit\u002Fruntime` is the server half of CopilotKit: it accepts AG-UI protocol\nrequests, dispatches them to an `AbstractAgent` (built-in or external), runs the\nstream through an `AgentRunner`, and responds as Server-Sent Events.\n\nThis SKILL.md is the **index**. Read the reference under `references\u002F` that matches\nyour task — do not try to absorb the whole package from this file.\n\n## Mental Model — the three dictionaries you hand to `CopilotRuntime`\n\n```ts\nnew CopilotRuntime({\n  agents, \u002F\u002F Record\u003Cstring, AbstractAgent>     — see wiring-external-agents or built-in-agent\n  runner, \u002F\u002F AgentRunner (optional)            — see agent-runners\n  intelligence, \u002F\u002F CopilotKitIntelligence (optional) — see intelligence-mode (auto-wires runner)\n  mcpApps, \u002F\u002F McpAppsConfig (optional)          — see wiring-mcp-apps-middleware\n  a2ui, \u002F\u002F A2UIConfig (optional)             — see packages\u002Fa2ui-renderer skill\n  hooks, \u002F\u002F { onRequest, onBeforeHandler }    — see middleware\n  beforeRequestMiddleware,\n  afterRequestMiddleware, \u002F\u002F legacy — see middleware\n  transcription, \u002F\u002F TranscriptionService (optional)  — see transcription\n});\n```\n\nYou then mount it:\n\n```ts\nimport { createCopilotRuntimeHandler } from \"@copilotkit\u002Fruntime\u002Fv2\";\nconst handler = createCopilotRuntimeHandler({\n  runtime,\n  basePath: \"\u002Fapi\u002Fcopilotkit\",\n});\nexport default { fetch: handler };\n```\n\n## When to load which reference\n\n| Task                                                                                                                                                                           | Reference                                                                                                                                                                                                                                                                                                                                          |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Mounting on any fetch-native server (Cloudflare Workers, Bun, Deno, Vercel Edge, Next.js App Router, React Router v7, TanStack Start) or delegating from Express\u002FNode          | `references\u002Fsetup-endpoint.md`                                                                                                                                                                                                                                                                                                                     |\n| Auth \u002F logging \u002F rate-limit \u002F request-scoped guards via `hooks.onRequest` \u002F `hooks.onBeforeHandler` (preferred) or legacy `beforeRequestMiddleware` \u002F `afterRequestMiddleware` | `references\u002Fmiddleware.md`                                                                                                                                                                                                                                                                                                                         |\n| Choosing between `InMemoryAgentRunner`, `SqliteAgentRunner`, or a custom subclass — including thread-locking semantics and the runner\u002FIntelligence mutual exclusion            | `references\u002Fagent-runners.md` (+ `-in-memory.md`, `-sqlite.md`, `-custom.md` for backend-specific detail)                                                                                                                                                                                                                                          |\n| Enabling durable threads + realtime websocket via CopilotKit Intelligence (a **managed service**, not self-hostable)                                                           | `references\u002Fintelligence-mode.md`                                                                                                                                                                                                                                                                                                                  |\n| Voice transcription — implementing a `TranscriptionService` subclass for the `\u002Ftranscribe` endpoint                                                                            | `references\u002Ftranscription.md`                                                                                                                                                                                                                                                                                                                      |\n| Instantiating `BuiltInAgent` — Simple Mode (classic) or Factory Mode with TanStack AI (preferred AG-UI-compliant default), AI SDK, or custom factory                           | `references\u002Fbuilt-in-agent.md` (+ `-factory-modes.md`, `-helper-utilities.md`, `-model-identifiers.md`)                                                                                                                                                                                                                                            |\n| Defining server-side tools via `defineTool` for `BuiltInAgent.config.tools` (Simple Mode only)                                                                                 | `references\u002Fserver-side-tools.md`                                                                                                                                                                                                                                                                                                                  |\n| Wiring an external agent framework into `CopilotRuntime({ agents })`                                                                                                           | `references\u002Fwiring-external-agents.md` (index) + per-framework refs (`wiring-mastra.md`, `wiring-langgraph.md`, `wiring-crewai-crews.md`, `wiring-crewai-flows.md`, `wiring-pydantic-ai.md`, `wiring-adk.md`, `wiring-llamaindex.md`, `wiring-agno.md`, `wiring-aws-strands.md`, `wiring-ms-agent-framework.md`, `wiring-ag2.md`, `wiring-a2a.md`) |\n| Wiring MCP Apps (runtime-level middleware, not an agent)                                                                                                                       | `references\u002Fwiring-mcp-apps-middleware.md`                                                                                                                                                                                                                                                                                                         |\n\n## Invariants and gotchas (load-once, before any reference)\n\n- `createCopilotRuntimeHandler` is the canonical primitive. `createCopilotExpressHandler` \u002F `createCopilotHonoHandler` exist but are **avoid at all costs** — delegate from Express\u002FHono routes to the fetch primitive instead.\n- `publicLicenseKey` is the canonical provider-side field. `publicApiKey` is a **deprecated alias** — expect to see it in legacy code, emit the canonical name in new code.\n- Intelligence mode auto-wires `IntelligenceAgentRunner`. Passing both `runner` and `intelligence` to `CopilotRuntime` is rejected at construction.\n- Intelligence mode targets the managed CopilotKit Intelligence service (`api.cloud.copilotkit.ai`) and is **not self-hostable**.\n- `hooks.onRequest` runs **before** `beforeRequestMiddleware` (hook-based middleware wins for Response short-circuits). `beforeRequestMiddleware` runs **after** `hooks.onRequest` (see `fetch-handler.ts:136-147`).\n- `identifyUser` (Intelligence) does **not** forward thrown `Response` objects — convert to 500. Gate auth rejection in `hooks.onRequest`, which does forward Responses.\n- `agents__unsafe_dev_only` and `selfManagedAgents` are dev-only aliases of each other; do not reach for them in production. Either signals that the SPA is in dev mode.\n\n## Reading order for a first-time reader\n\n1. `setup-endpoint` — the primitive.\n2. `built-in-agent` **or** pick one from `wiring-external-agents` — the agent.\n3. `agent-runners` — production persistence choice.\n4. Optional: `middleware`, `intelligence-mode`, `server-side-tools`, `transcription`.\n",{"data":55,"body":74},{"name":4,"description":6,"type":56,"library":8,"library_version":57,"requires":58,"sources":59},"core","1.56.2",[],[60,61,62,63,64,65,66,67,68,69,70,71,72,73],"CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Ffetch-handler.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Fruntime.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Fhooks.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fcore\u002Fmiddleware.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Frunner\u002Fagent-runner.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Frunner\u002Fin-memory.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Frunner\u002Fintelligence.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fintelligence-platform\u002Fclient.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Ftranscription-service\u002Ftranscription-service.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fv2\u002Fruntime\u002Fhandlers\u002Fhandle-transcribe.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fagent\u002Findex.ts","CopilotKit\u002FCopilotKit:packages\u002Fruntime\u002Fsrc\u002Fagent\u002Fconverters\u002Ftanstack.ts","CopilotKit\u002FCopilotKit:packages\u002Fsqlite-runner\u002Fsrc\u002Fsqlite-runner.ts","CopilotKit\u002FCopilotKit:packages\u002Fshared\u002Fsrc\u002Ftranscription-errors.ts",{"type":75,"children":76},"root",[77,86,115,136,149,367,372,552,558,969,975,1197,1203,1286],{"type":78,"tag":79,"props":80,"children":82},"element","h1",{"id":81},"copilotkit-runtime",[83],{"type":84,"value":85},"text","CopilotKit Runtime",{"type":78,"tag":87,"props":88,"children":89},"p",{},[90,97,99,105,107,113],{"type":78,"tag":91,"props":92,"children":94},"code",{"className":93},[],[95],{"type":84,"value":96},"@copilotkit\u002Fruntime",{"type":84,"value":98}," is the server half of CopilotKit: it accepts AG-UI protocol\nrequests, dispatches them to an ",{"type":78,"tag":91,"props":100,"children":102},{"className":101},[],[103],{"type":84,"value":104},"AbstractAgent",{"type":84,"value":106}," (built-in or external), runs the\nstream through an ",{"type":78,"tag":91,"props":108,"children":110},{"className":109},[],[111],{"type":84,"value":112},"AgentRunner",{"type":84,"value":114},", and responds as Server-Sent Events.",{"type":78,"tag":87,"props":116,"children":117},{},[118,120,126,128,134],{"type":84,"value":119},"This SKILL.md is the ",{"type":78,"tag":121,"props":122,"children":123},"strong",{},[124],{"type":84,"value":125},"index",{"type":84,"value":127},". Read the reference under ",{"type":78,"tag":91,"props":129,"children":131},{"className":130},[],[132],{"type":84,"value":133},"references\u002F",{"type":84,"value":135}," that matches\nyour task — do not try to absorb the whole package from this file.",{"type":78,"tag":137,"props":138,"children":140},"h2",{"id":139},"mental-model-the-three-dictionaries-you-hand-to-copilotruntime",[141,143],{"type":84,"value":142},"Mental Model — the three dictionaries you hand to ",{"type":78,"tag":91,"props":144,"children":146},{"className":145},[],[147],{"type":84,"value":148},"CopilotRuntime",{"type":78,"tag":150,"props":151,"children":155},"pre",{"className":152,"code":153,"language":47,"meta":154,"style":154},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","new CopilotRuntime({\n  agents, \u002F\u002F Record\u003Cstring, AbstractAgent>     — see wiring-external-agents or built-in-agent\n  runner, \u002F\u002F AgentRunner (optional)            — see agent-runners\n  intelligence, \u002F\u002F CopilotKitIntelligence (optional) — see intelligence-mode (auto-wires runner)\n  mcpApps, \u002F\u002F McpAppsConfig (optional)          — see wiring-mcp-apps-middleware\n  a2ui, \u002F\u002F A2UIConfig (optional)             — see packages\u002Fa2ui-renderer skill\n  hooks, \u002F\u002F { onRequest, onBeforeHandler }    — see middleware\n  beforeRequestMiddleware,\n  afterRequestMiddleware, \u002F\u002F legacy — see middleware\n  transcription, \u002F\u002F TranscriptionService (optional)  — see transcription\n});\n","",[156],{"type":78,"tag":91,"props":157,"children":158},{"__ignoreMap":154},[159,188,208,226,244,262,280,298,312,330,348],{"type":78,"tag":160,"props":161,"children":164},"span",{"class":162,"line":163},"line",1,[165,171,177,183],{"type":78,"tag":160,"props":166,"children":168},{"style":167},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[169],{"type":84,"value":170},"new",{"type":78,"tag":160,"props":172,"children":174},{"style":173},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[175],{"type":84,"value":176}," CopilotRuntime",{"type":78,"tag":160,"props":178,"children":180},{"style":179},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[181],{"type":84,"value":182},"(",{"type":78,"tag":160,"props":184,"children":185},{"style":167},[186],{"type":84,"value":187},"{\n",{"type":78,"tag":160,"props":189,"children":191},{"class":162,"line":190},2,[192,197,202],{"type":78,"tag":160,"props":193,"children":194},{"style":179},[195],{"type":84,"value":196},"  agents",{"type":78,"tag":160,"props":198,"children":199},{"style":167},[200],{"type":84,"value":201},",",{"type":78,"tag":160,"props":203,"children":205},{"style":204},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[206],{"type":84,"value":207}," \u002F\u002F Record\u003Cstring, AbstractAgent>     — see wiring-external-agents or built-in-agent\n",{"type":78,"tag":160,"props":209,"children":211},{"class":162,"line":210},3,[212,217,221],{"type":78,"tag":160,"props":213,"children":214},{"style":179},[215],{"type":84,"value":216},"  runner",{"type":78,"tag":160,"props":218,"children":219},{"style":167},[220],{"type":84,"value":201},{"type":78,"tag":160,"props":222,"children":223},{"style":204},[224],{"type":84,"value":225}," \u002F\u002F AgentRunner (optional)            — see agent-runners\n",{"type":78,"tag":160,"props":227,"children":229},{"class":162,"line":228},4,[230,235,239],{"type":78,"tag":160,"props":231,"children":232},{"style":179},[233],{"type":84,"value":234},"  intelligence",{"type":78,"tag":160,"props":236,"children":237},{"style":167},[238],{"type":84,"value":201},{"type":78,"tag":160,"props":240,"children":241},{"style":204},[242],{"type":84,"value":243}," \u002F\u002F CopilotKitIntelligence (optional) — see intelligence-mode (auto-wires runner)\n",{"type":78,"tag":160,"props":245,"children":247},{"class":162,"line":246},5,[248,253,257],{"type":78,"tag":160,"props":249,"children":250},{"style":179},[251],{"type":84,"value":252},"  mcpApps",{"type":78,"tag":160,"props":254,"children":255},{"style":167},[256],{"type":84,"value":201},{"type":78,"tag":160,"props":258,"children":259},{"style":204},[260],{"type":84,"value":261}," \u002F\u002F McpAppsConfig (optional)          — see wiring-mcp-apps-middleware\n",{"type":78,"tag":160,"props":263,"children":265},{"class":162,"line":264},6,[266,271,275],{"type":78,"tag":160,"props":267,"children":268},{"style":179},[269],{"type":84,"value":270},"  a2ui",{"type":78,"tag":160,"props":272,"children":273},{"style":167},[274],{"type":84,"value":201},{"type":78,"tag":160,"props":276,"children":277},{"style":204},[278],{"type":84,"value":279}," \u002F\u002F A2UIConfig (optional)             — see packages\u002Fa2ui-renderer skill\n",{"type":78,"tag":160,"props":281,"children":283},{"class":162,"line":282},7,[284,289,293],{"type":78,"tag":160,"props":285,"children":286},{"style":179},[287],{"type":84,"value":288},"  hooks",{"type":78,"tag":160,"props":290,"children":291},{"style":167},[292],{"type":84,"value":201},{"type":78,"tag":160,"props":294,"children":295},{"style":204},[296],{"type":84,"value":297}," \u002F\u002F { onRequest, onBeforeHandler }    — see middleware\n",{"type":78,"tag":160,"props":299,"children":301},{"class":162,"line":300},8,[302,307],{"type":78,"tag":160,"props":303,"children":304},{"style":179},[305],{"type":84,"value":306},"  beforeRequestMiddleware",{"type":78,"tag":160,"props":308,"children":309},{"style":167},[310],{"type":84,"value":311},",\n",{"type":78,"tag":160,"props":313,"children":315},{"class":162,"line":314},9,[316,321,325],{"type":78,"tag":160,"props":317,"children":318},{"style":179},[319],{"type":84,"value":320},"  afterRequestMiddleware",{"type":78,"tag":160,"props":322,"children":323},{"style":167},[324],{"type":84,"value":201},{"type":78,"tag":160,"props":326,"children":327},{"style":204},[328],{"type":84,"value":329}," \u002F\u002F legacy — see middleware\n",{"type":78,"tag":160,"props":331,"children":333},{"class":162,"line":332},10,[334,339,343],{"type":78,"tag":160,"props":335,"children":336},{"style":179},[337],{"type":84,"value":338},"  transcription",{"type":78,"tag":160,"props":340,"children":341},{"style":167},[342],{"type":84,"value":201},{"type":78,"tag":160,"props":344,"children":345},{"style":204},[346],{"type":84,"value":347}," \u002F\u002F TranscriptionService (optional)  — see transcription\n",{"type":78,"tag":160,"props":349,"children":351},{"class":162,"line":350},11,[352,357,362],{"type":78,"tag":160,"props":353,"children":354},{"style":167},[355],{"type":84,"value":356},"}",{"type":78,"tag":160,"props":358,"children":359},{"style":179},[360],{"type":84,"value":361},")",{"type":78,"tag":160,"props":363,"children":364},{"style":167},[365],{"type":84,"value":366},";\n",{"type":78,"tag":87,"props":368,"children":369},{},[370],{"type":84,"value":371},"You then mount it:",{"type":78,"tag":150,"props":373,"children":375},{"className":152,"code":374,"language":47,"meta":154,"style":154},"import { createCopilotRuntimeHandler } from \"@copilotkit\u002Fruntime\u002Fv2\";\nconst handler = createCopilotRuntimeHandler({\n  runtime,\n  basePath: \"\u002Fapi\u002Fcopilotkit\",\n});\nexport default { fetch: handler };\n",[376],{"type":78,"tag":91,"props":377,"children":378},{"__ignoreMap":154},[379,428,459,471,502,517],{"type":78,"tag":160,"props":380,"children":381},{"class":162,"line":163},[382,388,393,398,403,408,413,419,424],{"type":78,"tag":160,"props":383,"children":385},{"style":384},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[386],{"type":84,"value":387},"import",{"type":78,"tag":160,"props":389,"children":390},{"style":167},[391],{"type":84,"value":392}," {",{"type":78,"tag":160,"props":394,"children":395},{"style":179},[396],{"type":84,"value":397}," createCopilotRuntimeHandler",{"type":78,"tag":160,"props":399,"children":400},{"style":167},[401],{"type":84,"value":402}," }",{"type":78,"tag":160,"props":404,"children":405},{"style":384},[406],{"type":84,"value":407}," from",{"type":78,"tag":160,"props":409,"children":410},{"style":167},[411],{"type":84,"value":412}," \"",{"type":78,"tag":160,"props":414,"children":416},{"style":415},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[417],{"type":84,"value":418},"@copilotkit\u002Fruntime\u002Fv2",{"type":78,"tag":160,"props":420,"children":421},{"style":167},[422],{"type":84,"value":423},"\"",{"type":78,"tag":160,"props":425,"children":426},{"style":167},[427],{"type":84,"value":366},{"type":78,"tag":160,"props":429,"children":430},{"class":162,"line":190},[431,437,442,447,451,455],{"type":78,"tag":160,"props":432,"children":434},{"style":433},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[435],{"type":84,"value":436},"const",{"type":78,"tag":160,"props":438,"children":439},{"style":179},[440],{"type":84,"value":441}," handler ",{"type":78,"tag":160,"props":443,"children":444},{"style":167},[445],{"type":84,"value":446},"=",{"type":78,"tag":160,"props":448,"children":449},{"style":173},[450],{"type":84,"value":397},{"type":78,"tag":160,"props":452,"children":453},{"style":179},[454],{"type":84,"value":182},{"type":78,"tag":160,"props":456,"children":457},{"style":167},[458],{"type":84,"value":187},{"type":78,"tag":160,"props":460,"children":461},{"class":162,"line":210},[462,467],{"type":78,"tag":160,"props":463,"children":464},{"style":179},[465],{"type":84,"value":466},"  runtime",{"type":78,"tag":160,"props":468,"children":469},{"style":167},[470],{"type":84,"value":311},{"type":78,"tag":160,"props":472,"children":473},{"class":162,"line":228},[474,480,485,489,494,498],{"type":78,"tag":160,"props":475,"children":477},{"style":476},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[478],{"type":84,"value":479},"  basePath",{"type":78,"tag":160,"props":481,"children":482},{"style":167},[483],{"type":84,"value":484},":",{"type":78,"tag":160,"props":486,"children":487},{"style":167},[488],{"type":84,"value":412},{"type":78,"tag":160,"props":490,"children":491},{"style":415},[492],{"type":84,"value":493},"\u002Fapi\u002Fcopilotkit",{"type":78,"tag":160,"props":495,"children":496},{"style":167},[497],{"type":84,"value":423},{"type":78,"tag":160,"props":499,"children":500},{"style":167},[501],{"type":84,"value":311},{"type":78,"tag":160,"props":503,"children":504},{"class":162,"line":246},[505,509,513],{"type":78,"tag":160,"props":506,"children":507},{"style":167},[508],{"type":84,"value":356},{"type":78,"tag":160,"props":510,"children":511},{"style":179},[512],{"type":84,"value":361},{"type":78,"tag":160,"props":514,"children":515},{"style":167},[516],{"type":84,"value":366},{"type":78,"tag":160,"props":518,"children":519},{"class":162,"line":264},[520,525,530,534,539,543,547],{"type":78,"tag":160,"props":521,"children":522},{"style":384},[523],{"type":84,"value":524},"export",{"type":78,"tag":160,"props":526,"children":527},{"style":384},[528],{"type":84,"value":529}," default",{"type":78,"tag":160,"props":531,"children":532},{"style":167},[533],{"type":84,"value":392},{"type":78,"tag":160,"props":535,"children":536},{"style":476},[537],{"type":84,"value":538}," fetch",{"type":78,"tag":160,"props":540,"children":541},{"style":167},[542],{"type":84,"value":484},{"type":78,"tag":160,"props":544,"children":545},{"style":179},[546],{"type":84,"value":441},{"type":78,"tag":160,"props":548,"children":549},{"style":167},[550],{"type":84,"value":551},"};\n",{"type":78,"tag":137,"props":553,"children":555},{"id":554},"when-to-load-which-reference",[556],{"type":84,"value":557},"When to load which reference",{"type":78,"tag":559,"props":560,"children":561},"table",{},[562,581],{"type":78,"tag":563,"props":564,"children":565},"thead",{},[566],{"type":78,"tag":567,"props":568,"children":569},"tr",{},[570,576],{"type":78,"tag":571,"props":572,"children":573},"th",{},[574],{"type":84,"value":575},"Task",{"type":78,"tag":571,"props":577,"children":578},{},[579],{"type":84,"value":580},"Reference",{"type":78,"tag":582,"props":583,"children":584},"tbody",{},[585,603,649,706,730,763,810,843,952],{"type":78,"tag":567,"props":586,"children":587},{},[588,594],{"type":78,"tag":589,"props":590,"children":591},"td",{},[592],{"type":84,"value":593},"Mounting on any fetch-native server (Cloudflare Workers, Bun, Deno, Vercel Edge, Next.js App Router, React Router v7, TanStack Start) or delegating from Express\u002FNode",{"type":78,"tag":589,"props":595,"children":596},{},[597],{"type":78,"tag":91,"props":598,"children":600},{"className":599},[],[601],{"type":84,"value":602},"references\u002Fsetup-endpoint.md",{"type":78,"tag":567,"props":604,"children":605},{},[606,640],{"type":78,"tag":589,"props":607,"children":608},{},[609,611,617,619,625,627,633,634],{"type":84,"value":610},"Auth \u002F logging \u002F rate-limit \u002F request-scoped guards via ",{"type":78,"tag":91,"props":612,"children":614},{"className":613},[],[615],{"type":84,"value":616},"hooks.onRequest",{"type":84,"value":618}," \u002F ",{"type":78,"tag":91,"props":620,"children":622},{"className":621},[],[623],{"type":84,"value":624},"hooks.onBeforeHandler",{"type":84,"value":626}," (preferred) or legacy ",{"type":78,"tag":91,"props":628,"children":630},{"className":629},[],[631],{"type":84,"value":632},"beforeRequestMiddleware",{"type":84,"value":618},{"type":78,"tag":91,"props":635,"children":637},{"className":636},[],[638],{"type":84,"value":639},"afterRequestMiddleware",{"type":78,"tag":589,"props":641,"children":642},{},[643],{"type":78,"tag":91,"props":644,"children":646},{"className":645},[],[647],{"type":84,"value":648},"references\u002Fmiddleware.md",{"type":78,"tag":567,"props":650,"children":651},{},[652,673],{"type":78,"tag":589,"props":653,"children":654},{},[655,657,663,665,671],{"type":84,"value":656},"Choosing between ",{"type":78,"tag":91,"props":658,"children":660},{"className":659},[],[661],{"type":84,"value":662},"InMemoryAgentRunner",{"type":84,"value":664},", ",{"type":78,"tag":91,"props":666,"children":668},{"className":667},[],[669],{"type":84,"value":670},"SqliteAgentRunner",{"type":84,"value":672},", or a custom subclass — including thread-locking semantics and the runner\u002FIntelligence mutual exclusion",{"type":78,"tag":589,"props":674,"children":675},{},[676,682,684,690,691,697,698,704],{"type":78,"tag":91,"props":677,"children":679},{"className":678},[],[680],{"type":84,"value":681},"references\u002Fagent-runners.md",{"type":84,"value":683}," (+ ",{"type":78,"tag":91,"props":685,"children":687},{"className":686},[],[688],{"type":84,"value":689},"-in-memory.md",{"type":84,"value":664},{"type":78,"tag":91,"props":692,"children":694},{"className":693},[],[695],{"type":84,"value":696},"-sqlite.md",{"type":84,"value":664},{"type":78,"tag":91,"props":699,"children":701},{"className":700},[],[702],{"type":84,"value":703},"-custom.md",{"type":84,"value":705}," for backend-specific detail)",{"type":78,"tag":567,"props":707,"children":708},{},[709,721],{"type":78,"tag":589,"props":710,"children":711},{},[712,714,719],{"type":84,"value":713},"Enabling durable threads + realtime websocket via CopilotKit Intelligence (a ",{"type":78,"tag":121,"props":715,"children":716},{},[717],{"type":84,"value":718},"managed service",{"type":84,"value":720},", not self-hostable)",{"type":78,"tag":589,"props":722,"children":723},{},[724],{"type":78,"tag":91,"props":725,"children":727},{"className":726},[],[728],{"type":84,"value":729},"references\u002Fintelligence-mode.md",{"type":78,"tag":567,"props":731,"children":732},{},[733,754],{"type":78,"tag":589,"props":734,"children":735},{},[736,738,744,746,752],{"type":84,"value":737},"Voice transcription — implementing a ",{"type":78,"tag":91,"props":739,"children":741},{"className":740},[],[742],{"type":84,"value":743},"TranscriptionService",{"type":84,"value":745}," subclass for the ",{"type":78,"tag":91,"props":747,"children":749},{"className":748},[],[750],{"type":84,"value":751},"\u002Ftranscribe",{"type":84,"value":753}," endpoint",{"type":78,"tag":589,"props":755,"children":756},{},[757],{"type":78,"tag":91,"props":758,"children":760},{"className":759},[],[761],{"type":84,"value":762},"references\u002Ftranscription.md",{"type":78,"tag":567,"props":764,"children":765},{},[766,779],{"type":78,"tag":589,"props":767,"children":768},{},[769,771,777],{"type":84,"value":770},"Instantiating ",{"type":78,"tag":91,"props":772,"children":774},{"className":773},[],[775],{"type":84,"value":776},"BuiltInAgent",{"type":84,"value":778}," — Simple Mode (classic) or Factory Mode with TanStack AI (preferred AG-UI-compliant default), AI SDK, or custom factory",{"type":78,"tag":589,"props":780,"children":781},{},[782,788,789,795,796,802,803,809],{"type":78,"tag":91,"props":783,"children":785},{"className":784},[],[786],{"type":84,"value":787},"references\u002Fbuilt-in-agent.md",{"type":84,"value":683},{"type":78,"tag":91,"props":790,"children":792},{"className":791},[],[793],{"type":84,"value":794},"-factory-modes.md",{"type":84,"value":664},{"type":78,"tag":91,"props":797,"children":799},{"className":798},[],[800],{"type":84,"value":801},"-helper-utilities.md",{"type":84,"value":664},{"type":78,"tag":91,"props":804,"children":806},{"className":805},[],[807],{"type":84,"value":808},"-model-identifiers.md",{"type":84,"value":361},{"type":78,"tag":567,"props":811,"children":812},{},[813,834],{"type":78,"tag":589,"props":814,"children":815},{},[816,818,824,826,832],{"type":84,"value":817},"Defining server-side tools via ",{"type":78,"tag":91,"props":819,"children":821},{"className":820},[],[822],{"type":84,"value":823},"defineTool",{"type":84,"value":825}," for ",{"type":78,"tag":91,"props":827,"children":829},{"className":828},[],[830],{"type":84,"value":831},"BuiltInAgent.config.tools",{"type":84,"value":833}," (Simple Mode only)",{"type":78,"tag":589,"props":835,"children":836},{},[837],{"type":78,"tag":91,"props":838,"children":840},{"className":839},[],[841],{"type":84,"value":842},"references\u002Fserver-side-tools.md",{"type":78,"tag":567,"props":844,"children":845},{},[846,857],{"type":78,"tag":589,"props":847,"children":848},{},[849,851],{"type":84,"value":850},"Wiring an external agent framework into ",{"type":78,"tag":91,"props":852,"children":854},{"className":853},[],[855],{"type":84,"value":856},"CopilotRuntime({ agents })",{"type":78,"tag":589,"props":858,"children":859},{},[860,866,868,874,875,881,882,888,889,895,896,902,903,909,910,916,917,923,924,930,931,937,938,944,945,951],{"type":78,"tag":91,"props":861,"children":863},{"className":862},[],[864],{"type":84,"value":865},"references\u002Fwiring-external-agents.md",{"type":84,"value":867}," (index) + per-framework refs (",{"type":78,"tag":91,"props":869,"children":871},{"className":870},[],[872],{"type":84,"value":873},"wiring-mastra.md",{"type":84,"value":664},{"type":78,"tag":91,"props":876,"children":878},{"className":877},[],[879],{"type":84,"value":880},"wiring-langgraph.md",{"type":84,"value":664},{"type":78,"tag":91,"props":883,"children":885},{"className":884},[],[886],{"type":84,"value":887},"wiring-crewai-crews.md",{"type":84,"value":664},{"type":78,"tag":91,"props":890,"children":892},{"className":891},[],[893],{"type":84,"value":894},"wiring-crewai-flows.md",{"type":84,"value":664},{"type":78,"tag":91,"props":897,"children":899},{"className":898},[],[900],{"type":84,"value":901},"wiring-pydantic-ai.md",{"type":84,"value":664},{"type":78,"tag":91,"props":904,"children":906},{"className":905},[],[907],{"type":84,"value":908},"wiring-adk.md",{"type":84,"value":664},{"type":78,"tag":91,"props":911,"children":913},{"className":912},[],[914],{"type":84,"value":915},"wiring-llamaindex.md",{"type":84,"value":664},{"type":78,"tag":91,"props":918,"children":920},{"className":919},[],[921],{"type":84,"value":922},"wiring-agno.md",{"type":84,"value":664},{"type":78,"tag":91,"props":925,"children":927},{"className":926},[],[928],{"type":84,"value":929},"wiring-aws-strands.md",{"type":84,"value":664},{"type":78,"tag":91,"props":932,"children":934},{"className":933},[],[935],{"type":84,"value":936},"wiring-ms-agent-framework.md",{"type":84,"value":664},{"type":78,"tag":91,"props":939,"children":941},{"className":940},[],[942],{"type":84,"value":943},"wiring-ag2.md",{"type":84,"value":664},{"type":78,"tag":91,"props":946,"children":948},{"className":947},[],[949],{"type":84,"value":950},"wiring-a2a.md",{"type":84,"value":361},{"type":78,"tag":567,"props":953,"children":954},{},[955,960],{"type":78,"tag":589,"props":956,"children":957},{},[958],{"type":84,"value":959},"Wiring MCP Apps (runtime-level middleware, not an agent)",{"type":78,"tag":589,"props":961,"children":962},{},[963],{"type":78,"tag":91,"props":964,"children":966},{"className":965},[],[967],{"type":84,"value":968},"references\u002Fwiring-mcp-apps-middleware.md",{"type":78,"tag":137,"props":970,"children":972},{"id":971},"invariants-and-gotchas-load-once-before-any-reference",[973],{"type":84,"value":974},"Invariants and gotchas (load-once, before any reference)",{"type":78,"tag":976,"props":977,"children":978},"ul",{},[979,1013,1039,1075,1095,1146,1179],{"type":78,"tag":980,"props":981,"children":982},"li",{},[983,989,991,997,998,1004,1006,1011],{"type":78,"tag":91,"props":984,"children":986},{"className":985},[],[987],{"type":84,"value":988},"createCopilotRuntimeHandler",{"type":84,"value":990}," is the canonical primitive. ",{"type":78,"tag":91,"props":992,"children":994},{"className":993},[],[995],{"type":84,"value":996},"createCopilotExpressHandler",{"type":84,"value":618},{"type":78,"tag":91,"props":999,"children":1001},{"className":1000},[],[1002],{"type":84,"value":1003},"createCopilotHonoHandler",{"type":84,"value":1005}," exist but are ",{"type":78,"tag":121,"props":1007,"children":1008},{},[1009],{"type":84,"value":1010},"avoid at all costs",{"type":84,"value":1012}," — delegate from Express\u002FHono routes to the fetch primitive instead.",{"type":78,"tag":980,"props":1014,"children":1015},{},[1016,1022,1024,1030,1032,1037],{"type":78,"tag":91,"props":1017,"children":1019},{"className":1018},[],[1020],{"type":84,"value":1021},"publicLicenseKey",{"type":84,"value":1023}," is the canonical provider-side field. ",{"type":78,"tag":91,"props":1025,"children":1027},{"className":1026},[],[1028],{"type":84,"value":1029},"publicApiKey",{"type":84,"value":1031}," is a ",{"type":78,"tag":121,"props":1033,"children":1034},{},[1035],{"type":84,"value":1036},"deprecated alias",{"type":84,"value":1038}," — expect to see it in legacy code, emit the canonical name in new code.",{"type":78,"tag":980,"props":1040,"children":1041},{},[1042,1044,1050,1052,1058,1060,1066,1068,1073],{"type":84,"value":1043},"Intelligence mode auto-wires ",{"type":78,"tag":91,"props":1045,"children":1047},{"className":1046},[],[1048],{"type":84,"value":1049},"IntelligenceAgentRunner",{"type":84,"value":1051},". Passing both ",{"type":78,"tag":91,"props":1053,"children":1055},{"className":1054},[],[1056],{"type":84,"value":1057},"runner",{"type":84,"value":1059}," and ",{"type":78,"tag":91,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":84,"value":1065},"intelligence",{"type":84,"value":1067}," to ",{"type":78,"tag":91,"props":1069,"children":1071},{"className":1070},[],[1072],{"type":84,"value":148},{"type":84,"value":1074}," is rejected at construction.",{"type":78,"tag":980,"props":1076,"children":1077},{},[1078,1080,1086,1088,1093],{"type":84,"value":1079},"Intelligence mode targets the managed CopilotKit Intelligence service (",{"type":78,"tag":91,"props":1081,"children":1083},{"className":1082},[],[1084],{"type":84,"value":1085},"api.cloud.copilotkit.ai",{"type":84,"value":1087},") and is ",{"type":78,"tag":121,"props":1089,"children":1090},{},[1091],{"type":84,"value":1092},"not self-hostable",{"type":84,"value":1094},".",{"type":78,"tag":980,"props":1096,"children":1097},{},[1098,1103,1105,1110,1112,1117,1119,1124,1125,1130,1131,1136,1138,1144],{"type":78,"tag":91,"props":1099,"children":1101},{"className":1100},[],[1102],{"type":84,"value":616},{"type":84,"value":1104}," runs ",{"type":78,"tag":121,"props":1106,"children":1107},{},[1108],{"type":84,"value":1109},"before",{"type":84,"value":1111}," ",{"type":78,"tag":91,"props":1113,"children":1115},{"className":1114},[],[1116],{"type":84,"value":632},{"type":84,"value":1118}," (hook-based middleware wins for Response short-circuits). ",{"type":78,"tag":91,"props":1120,"children":1122},{"className":1121},[],[1123],{"type":84,"value":632},{"type":84,"value":1104},{"type":78,"tag":121,"props":1126,"children":1127},{},[1128],{"type":84,"value":1129},"after",{"type":84,"value":1111},{"type":78,"tag":91,"props":1132,"children":1134},{"className":1133},[],[1135],{"type":84,"value":616},{"type":84,"value":1137}," (see ",{"type":78,"tag":91,"props":1139,"children":1141},{"className":1140},[],[1142],{"type":84,"value":1143},"fetch-handler.ts:136-147",{"type":84,"value":1145},").",{"type":78,"tag":980,"props":1147,"children":1148},{},[1149,1155,1157,1162,1164,1170,1172,1177],{"type":78,"tag":91,"props":1150,"children":1152},{"className":1151},[],[1153],{"type":84,"value":1154},"identifyUser",{"type":84,"value":1156}," (Intelligence) does ",{"type":78,"tag":121,"props":1158,"children":1159},{},[1160],{"type":84,"value":1161},"not",{"type":84,"value":1163}," forward thrown ",{"type":78,"tag":91,"props":1165,"children":1167},{"className":1166},[],[1168],{"type":84,"value":1169},"Response",{"type":84,"value":1171}," objects — convert to 500. Gate auth rejection in ",{"type":78,"tag":91,"props":1173,"children":1175},{"className":1174},[],[1176],{"type":84,"value":616},{"type":84,"value":1178},", which does forward Responses.",{"type":78,"tag":980,"props":1180,"children":1181},{},[1182,1188,1189,1195],{"type":78,"tag":91,"props":1183,"children":1185},{"className":1184},[],[1186],{"type":84,"value":1187},"agents__unsafe_dev_only",{"type":84,"value":1059},{"type":78,"tag":91,"props":1190,"children":1192},{"className":1191},[],[1193],{"type":84,"value":1194},"selfManagedAgents",{"type":84,"value":1196}," are dev-only aliases of each other; do not reach for them in production. Either signals that the SPA is in dev mode.",{"type":78,"tag":137,"props":1198,"children":1200},{"id":1199},"reading-order-for-a-first-time-reader",[1201],{"type":84,"value":1202},"Reading order for a first-time reader",{"type":78,"tag":1204,"props":1205,"children":1206},"ol",{},[1207,1218,1243,1254],{"type":78,"tag":980,"props":1208,"children":1209},{},[1210,1216],{"type":78,"tag":91,"props":1211,"children":1213},{"className":1212},[],[1214],{"type":84,"value":1215},"setup-endpoint",{"type":84,"value":1217}," — the primitive.",{"type":78,"tag":980,"props":1219,"children":1220},{},[1221,1227,1228,1233,1235,1241],{"type":78,"tag":91,"props":1222,"children":1224},{"className":1223},[],[1225],{"type":84,"value":1226},"built-in-agent",{"type":84,"value":1111},{"type":78,"tag":121,"props":1229,"children":1230},{},[1231],{"type":84,"value":1232},"or",{"type":84,"value":1234}," pick one from ",{"type":78,"tag":91,"props":1236,"children":1238},{"className":1237},[],[1239],{"type":84,"value":1240},"wiring-external-agents",{"type":84,"value":1242}," — the agent.",{"type":78,"tag":980,"props":1244,"children":1245},{},[1246,1252],{"type":78,"tag":91,"props":1247,"children":1249},{"className":1248},[],[1250],{"type":84,"value":1251},"agent-runners",{"type":84,"value":1253}," — production persistence choice.",{"type":78,"tag":980,"props":1255,"children":1256},{},[1257,1259,1264,1265,1271,1272,1278,1279,1285],{"type":84,"value":1258},"Optional: ",{"type":78,"tag":91,"props":1260,"children":1262},{"className":1261},[],[1263],{"type":84,"value":22},{"type":84,"value":664},{"type":78,"tag":91,"props":1266,"children":1268},{"className":1267},[],[1269],{"type":84,"value":1270},"intelligence-mode",{"type":84,"value":664},{"type":78,"tag":91,"props":1273,"children":1275},{"className":1274},[],[1276],{"type":84,"value":1277},"server-side-tools",{"type":84,"value":664},{"type":78,"tag":91,"props":1280,"children":1282},{"className":1281},[],[1283],{"type":84,"value":1284},"transcription",{"type":84,"value":1094},{"type":78,"tag":1287,"props":1288,"children":1289},"style",{},[1290],{"type":84,"value":1291},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1293,"total":1462},[1294,1311,1328,1345,1357,1370,1383,1397,1409,1421,1436,1443],{"slug":1295,"name":1295,"fn":1296,"description":1297,"org":1298,"tags":1299,"stars":23,"repoUrl":24,"updatedAt":1310},"a2ui-renderer","render declarative agent UI surfaces","Render A2UI (Agent-to-UI declarative surfaces) in CopilotKit v2. Enable the runtime via CopilotRuntime({ a2ui: {...} }), then enable the provider via \u003CCopilotKit a2ui={{ theme }}>. Auto-activates via \u002Finfo — do NOT manually pass renderActivityMessages. createA2UIMessageRenderer ships from @copilotkit\u002Freact-core\u002Fv2; low-level primitives (A2UIProvider, A2UIRenderer, createCatalog) ship from @copilotkit\u002Fa2ui-renderer. Covers theme customization, createSurface dedup, action-bridge try\u002Ffinally cleanup. Load when an agent emits A2UI operations (createSurface \u002F updateComponents \u002F updateDataModel), when wiring a2ui on CopilotRuntime, or when styling A2UI surfaces.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1300,1301,1304,1307],{"name":9,"slug":8,"type":15},{"name":1302,"slug":1303,"type":15},"Design","design",{"name":1305,"slug":1306,"type":15},"Frontend","frontend",{"name":1308,"slug":1309,"type":15},"UI Components","ui-components","2026-07-12T08:06:36.722091",{"slug":1312,"name":1312,"fn":1313,"description":1314,"org":1315,"tags":1316,"stars":23,"repoUrl":24,"updatedAt":1327},"copilotkit-agui","build and debug CopilotKit agent backends","Use when building custom agent backends, implementing the AG-UI protocol, debugging streaming issues, or understanding how agents communicate with frontends. Covers event types, SSE transport, AbstractAgent\u002FHttpAgent patterns, state synchronization, tool calls, and human-in-the-loop flows.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1317,1319,1322,1323,1324],{"name":1318,"slug":32,"type":15},"Agents",{"name":1320,"slug":1321,"type":15},"API Development","api-development",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":1325,"slug":1326,"type":15},"Debugging","debugging","2026-07-12T08:06:22.179755",{"slug":1329,"name":1329,"fn":1330,"description":1331,"org":1332,"tags":1333,"stars":23,"repoUrl":24,"updatedAt":1344},"copilotkit-contribute","contribute to CopilotKit open-source project","Use when contributing to the CopilotKit open-source project — forking, cloning, setting up the monorepo, creating branches, running tests, and submitting pull requests against CopilotKit\u002FCopilotKit.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1334,1335,1338,1341],{"name":9,"slug":8,"type":15},{"name":1336,"slug":1337,"type":15},"Engineering","engineering",{"name":1339,"slug":1340,"type":15},"GitHub","github",{"name":1342,"slug":1343,"type":15},"Pull Requests","pull-requests","2026-07-12T08:06:30.102192",{"slug":1346,"name":1346,"fn":1347,"description":1348,"org":1349,"tags":1350,"stars":23,"repoUrl":24,"updatedAt":1356},"copilotkit-debug","diagnose and debug CopilotKit issues","Use when diagnosing CopilotKit issues -- runtime connectivity failures, agent not responding, streaming errors, tool execution problems, transcription failures, version mismatches, and AG-UI event tracing.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1351,1352,1353],{"name":9,"slug":8,"type":15},{"name":1325,"slug":1326,"type":15},{"name":1354,"slug":1355,"type":15},"Observability","observability","2026-07-12T08:06:23.407872",{"slug":1358,"name":1358,"fn":1359,"description":1360,"org":1361,"tags":1362,"stars":23,"repoUrl":24,"updatedAt":1369},"copilotkit-develop","build AI features with CopilotKit","Use when building AI-powered features with CopilotKit v2 -- adding chat interfaces, registering frontend tools, sharing application context with agents, handling agent interrupts, and working with the CopilotKit runtime.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1363,1364,1367,1368],{"name":1318,"slug":32,"type":15},{"name":1365,"slug":1366,"type":15},"AI Context","ai-context",{"name":9,"slug":8,"type":15},{"name":1305,"slug":1306,"type":15},"2026-07-12T08:06:28.856644",{"slug":1371,"name":1371,"fn":1372,"description":1373,"org":1374,"tags":1375,"stars":23,"repoUrl":24,"updatedAt":1382},"copilotkit-integrations","integrate agent frameworks into CopilotKit applications","Use when wiring an external agent framework (LangGraph, CrewAI, PydanticAI, Mastra, ADK, LlamaIndex, Agno, Strands, Microsoft Agent Framework, or others) into a CopilotKit application via the AG-UI protocol.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1376,1377,1378,1379],{"name":1318,"slug":32,"type":15},{"name":1320,"slug":1321,"type":15},{"name":9,"slug":8,"type":15},{"name":1380,"slug":1381,"type":15},"Integrations","integrations","2026-07-12T08:06:32.560054",{"slug":1384,"name":1384,"fn":1385,"description":1386,"org":1387,"tags":1388,"stars":23,"repoUrl":24,"updatedAt":1396},"copilotkit-self-update","update CopilotKit agent skills","Use when the user wants to update, refresh, or reinstall the CopilotKit agent SKILLS (the SKILL.md files that teach this agent about CopilotKit). NOT for updating the CopilotKit codebase or project — this is specifically about refreshing the skills\u002Fknowledge this agent has loaded. Triggers on \"update copilotkit skills\", \"update skills\", \"refresh skills\", \"skills are stale\", \"skills are outdated\", \"get latest skills\", \"my copilotkit knowledge is wrong\", \"copilotkit APIs changed\", \"skills seem old\", \"wrong API names\", \"reinstall skills\", \"skills not working right\", \"update your copilotkit knowledge\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1389,1390,1393],{"name":9,"slug":8,"type":15},{"name":1391,"slug":1392,"type":15},"Documentation","documentation",{"name":1394,"slug":1395,"type":15},"Productivity","productivity","2026-07-12T08:06:31.345052",{"slug":1398,"name":1398,"fn":1399,"description":1400,"org":1401,"tags":1402,"stars":23,"repoUrl":24,"updatedAt":1408},"copilotkit-setup","set up CopilotKit in projects","Use when adding CopilotKit to an existing project or bootstrapping a new CopilotKit project from scratch. Covers framework detection, package installation, runtime wiring, provider setup, and first working chat integration.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1403,1404,1405],{"name":9,"slug":8,"type":15},{"name":1305,"slug":1306,"type":15},{"name":1406,"slug":1407,"type":15},"Onboarding","onboarding","2026-07-12T08:06:25.534415",{"slug":1410,"name":1410,"fn":1411,"description":1412,"org":1413,"tags":1414,"stars":23,"repoUrl":24,"updatedAt":1420},"copilotkit-upgrade","migrate CopilotKit applications to v2","Use when migrating a CopilotKit v1 application to v2 -- updating package imports, replacing deprecated hooks and components, switching from GraphQL runtime to AG-UI protocol runtime, and resolving breaking API changes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1415,1416,1417],{"name":9,"slug":8,"type":15},{"name":1336,"slug":1337,"type":15},{"name":1418,"slug":1419,"type":15},"Migration","migration","2026-07-12T08:06:26.949801",{"slug":1422,"name":1422,"fn":1423,"description":1424,"org":1425,"tags":1426,"stars":23,"repoUrl":24,"updatedAt":1435},"react-core","integrate CopilotKit into React applications","@copilotkit\u002Freact-core — mount the CopilotKit provider (from @copilotkit\u002Freact-core\u002Fv2) in a Next.js App Router \u002F React Router v7 \u002F TanStack Start \u002F SPA app, drop in CopilotChat\u002FCopilotPopup\u002FCopilotSidebar (v2 chat components ship from react-core\u002Fv2 — NOT react-ui, which is CSS-only in v2), access and subscribe to agents with useAgent \u002F useAgentContext \u002F useCapabilities, switch between multiple agents, manage durable Intelligence threads with useThreads, register browser-side tools via useFrontendTool, render tool calls with useRenderTool \u002F useComponent \u002F useDefaultRenderTool, gate execution with useHumanInTheLoop, wire file attachments with useAttachments, configure suggestion pills, and register activity- and custom-message renderers. publicLicenseKey is canonical (publicApiKey is deprecated alias). Load the reference under references\u002F that matches your task.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1427,1428,1429,1432,1434],{"name":9,"slug":8,"type":15},{"name":1305,"slug":1306,"type":15},{"name":1430,"slug":1431,"type":15},"Next.js","next-js",{"name":1433,"slug":45,"type":15},"React",{"name":1308,"slug":1309,"type":15},"2026-07-12T08:06:15.72619",{"slug":4,"name":4,"fn":5,"description":6,"org":1437,"tags":1438,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1439,1440,1441,1442],{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},{"name":21,"slug":22,"type":15},{"slug":1444,"name":1445,"fn":1446,"description":1447,"org":1448,"tags":1449,"stars":1459,"repoUrl":1460,"updatedAt":1461},"advanced-visualization-techniques","Advanced Visualization Techniques","create advanced generative UI visualizations","UI mockups, dashboards, advanced interactivity, generative art, simulations, math visualizations, and design system rules for producing rich generateSandboxedUi output.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1450,1453,1454,1455,1458],{"name":1451,"slug":1452,"type":15},"Dashboards","dashboards",{"name":1302,"slug":1303,"type":15},{"name":1305,"slug":1306,"type":15},{"name":1456,"slug":1457,"type":15},"Generative Art","generative-art",{"name":1308,"slug":1309,"type":15},1440,"https:\u002F\u002Fgithub.com\u002FCopilotKit\u002FOpenGenerativeUI","2026-07-12T08:06:40.712754",14,{"items":1464,"total":350},[1465,1472,1480,1487,1493,1500,1507],{"slug":1295,"name":1295,"fn":1296,"description":1297,"org":1466,"tags":1467,"stars":23,"repoUrl":24,"updatedAt":1310},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1468,1469,1470,1471],{"name":9,"slug":8,"type":15},{"name":1302,"slug":1303,"type":15},{"name":1305,"slug":1306,"type":15},{"name":1308,"slug":1309,"type":15},{"slug":1312,"name":1312,"fn":1313,"description":1314,"org":1473,"tags":1474,"stars":23,"repoUrl":24,"updatedAt":1327},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1475,1476,1477,1478,1479],{"name":1318,"slug":32,"type":15},{"name":1320,"slug":1321,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":1325,"slug":1326,"type":15},{"slug":1329,"name":1329,"fn":1330,"description":1331,"org":1481,"tags":1482,"stars":23,"repoUrl":24,"updatedAt":1344},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1483,1484,1485,1486],{"name":9,"slug":8,"type":15},{"name":1336,"slug":1337,"type":15},{"name":1339,"slug":1340,"type":15},{"name":1342,"slug":1343,"type":15},{"slug":1346,"name":1346,"fn":1347,"description":1348,"org":1488,"tags":1489,"stars":23,"repoUrl":24,"updatedAt":1356},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1490,1491,1492],{"name":9,"slug":8,"type":15},{"name":1325,"slug":1326,"type":15},{"name":1354,"slug":1355,"type":15},{"slug":1358,"name":1358,"fn":1359,"description":1360,"org":1494,"tags":1495,"stars":23,"repoUrl":24,"updatedAt":1369},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1496,1497,1498,1499],{"name":1318,"slug":32,"type":15},{"name":1365,"slug":1366,"type":15},{"name":9,"slug":8,"type":15},{"name":1305,"slug":1306,"type":15},{"slug":1371,"name":1371,"fn":1372,"description":1373,"org":1501,"tags":1502,"stars":23,"repoUrl":24,"updatedAt":1382},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1503,1504,1505,1506],{"name":1318,"slug":32,"type":15},{"name":1320,"slug":1321,"type":15},{"name":9,"slug":8,"type":15},{"name":1380,"slug":1381,"type":15},{"slug":1384,"name":1384,"fn":1385,"description":1386,"org":1508,"tags":1509,"stars":23,"repoUrl":24,"updatedAt":1396},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1510,1511,1512],{"name":9,"slug":8,"type":15},{"name":1391,"slug":1392,"type":15},{"name":1394,"slug":1395,"type":15}]