[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-copilotkit-copilotkit-channels":3,"mdc-d308yr-key":53,"related-repo-copilotkit-copilotkit-channels":3480,"related-org-copilotkit-copilotkit-channels":3579},{"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":48,"sourceUrl":51,"mdContent":52},"copilotkit-channels","configure CopilotKit intelligence channels","Use for the CODE half of a managed Intelligence Channel with Slack or Microsoft Teams: customising the Channel a CLI-scaffolded project already ships, or — for a project the CLI did not generate — writing the Channel declaration, the long-running host, and the awaited activation call. Teams provider setup is in scope, because the CLI or dashboard wizard performs it. Creating a Slack app for the first time is not: if no Slack app exists yet, use setup-slack-channel for the provider half and return here for the code.\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,14,17,20],{"name":9,"slug":8,"type":13},"tag",{"name":15,"slug":16,"type":13},"Microsoft Teams","microsoft-teams",{"name":18,"slug":19,"type":13},"Agents","agents",{"name":21,"slug":22,"type":13},"Slack","slack",35928,"https:\u002F\u002Fgithub.com\u002FCopilotKit\u002FCopilotKit","2026-08-04T05:59:05.179484",null,4434,[29,30,31,19,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"agent","agent-native","agentic-ai","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":49,"description":50},[29,30,31,19,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"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\u002Fcopilotkit-channels","---\nname: copilotkit-channels\ndescription: >\n  Use for the CODE half of a managed Intelligence Channel with Slack or Microsoft\n  Teams: customising the Channel a CLI-scaffolded project already ships, or — for a\n  project the CLI did not generate — writing the Channel declaration, the\n  long-running host, and the awaited activation call. Teams provider setup is in\n  scope, because the CLI or dashboard wizard performs it. Creating a Slack app for\n  the first time is not: if no Slack app exists yet, use setup-slack-channel for\n  the provider half and return here for the code.\nversion: 1.1.0\n---\n\n# CopilotKit Channels\n\nManaged Channels let an agent answer in Slack or Microsoft Teams. Intelligence owns the provider edge — signed ingress, egress, credential storage — and delivers turns to your runtime over its realtime transport.\n\n## Scope\n\nThis skill covers **managed Intelligence Channels**: `CopilotIntelligenceRuntime`, app-api Channel resources, and the realtime gateway.\n\nIt does **not** cover the self-hosted `@copilotkit\u002Fchannels` provider adapters (`@copilotkit\u002Fchannels-slack`, `-teams`, `-discord`, `-telegram`, `-whatsapp`). Those hold provider credentials in your process and talk to the provider directly. Both products use the words \"channels\" and \"Slack\", so confirm which one the user means before wiring anything. If they want to hold their own Slack tokens and run their own ingress, they want the adapter packages, not this skill.\n\n## Decide which path you are on first\n\nEverything below depends on this, and getting it wrong produces a project with two Channel declarations that fight over one Channel.\n\n**Look for `channel-host.mts` at the project root.**\n\n| It is there                                                                                                                                                                             | It is not                                                                                                                    |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| The project was scaffolded by `npx copilotkit init`. The code half is **already done** — go to \"Customising a scaffolded Channel\". Do not write a new host or a second `createChannel`. | The project predates the Channel, or was not made by the CLI. Go to \"Wiring a project the CLI did not generate\", at the end. |\n\nThe scaffolded path is the one exercised end to end. Wiring an existing project is supported and works, but it is less trodden: the CLI reads source it did not generate, so a project laid out unusually may get a `status` leg reported as `undetermined` rather than a confident answer. That is deliberate — an unsure answer beats a wrong one — but verify the wiring yourself there rather than trusting a green report.\n\n## A Channel has two halves\n\nA Channel only works when both are correct, and each half is invisible from the other:\n\n1. **The provider half** — an app registered with Slack or Microsoft, credentials stored server-side, ingress pointed at Intelligence. Three entry points converge on it: `npx copilotkit init` guides a new project, `npx copilotkit channels add` handles an existing project or agent, and the dashboard wizard works in a browser. A new Teams app begins with the browser-created draft and uses one of the two paths below.\n2. **The code half** — a long-running runtime that declares the Channel and awaits activation. A scaffolded project **already has this**; for anything else, it is what this skill writes.\n\nThe most confusing failure in this product is a correct provider half with a missing code half: the app serves HTTP normally, reports no error, shows an encouraging badge in the dashboard, and answers nothing. Nothing in the browser can diagnose it, because the missing piece is in the source tree.\n\n### Teams provider setup has two peer paths\n\nFor Teams, create the durable Channel draft in Intelligence before provisioning Microsoft resources. The browser then offers:\n\n- **Fast CLI setup (recommended):** copy the fully scoped command from the draft:\n\n  ```bash\n  npx copilotkit@latest channels add --project-id \u003Cproject-id> --channel-id \u003Cchannel-id> --adapter teams --provision\n  ```\n\n  It works outside a repository, reuses the CopilotKit login, confirms the Microsoft tenant, creates one single-tenant Teams-managed app, and sends the generated secret directly to encrypted Intelligence storage. It does not print the secret, write provider environment files, or modify runtime code.\n\n- **Guided manual setup:** use Teams Developer Portal and Microsoft Entra, enter write-only credentials, and download the finished package from the browser. The normal path does not need Azure Bot and never asks the user to edit `manifest.json`.\n\nBoth paths use the same durable setup state and can replace one another mid-setup. `Files.ReadWrite.All` administrator consent and one **Add to a team** installation are required. A non-admin pause is a successful `blocked` outcome with one approval link and the same resume command; rerunning it must reuse the existing Microsoft app.\n\nCustom icon and package bytes stay in browser\u002FCLI memory or a temporary local directory. Never send them to Intelligence, Redis, or another relay. If an attempt stops before upload, require the user to select custom icons again (or explicitly choose the default kite) and delete every temporary copy on exit.\n\nTreat **Created and installed** narrowly: the Microsoft app exists, encrypted credentials are stored, file and Team message access are approved, and a Team installation was recorded. It is not proof that this runtime is online or that a message was delivered.\n\n## Customising a scaffolded Channel\n\nA scaffolded project ships three files, and only one of them is yours to change:\n\n| File                               | What it is                                                    | Change it?                                                  |\n| ---------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------- |\n| `channels.mts`                     | The Channel: its name resolution, its agent, and its handlers | **Yes — this is where customisation goes**                  |\n| `channel-host.mts`                 | The process that owns the Channel's lifetime                  | No. It is identical in every starter and for every provider |\n| `src\u002Fagent.ts` (or `app\u002Fagent.ts`) | The agent both the web route and the Channel serve            | Only to change the agent itself                             |\n\nRun it with:\n\n```bash\nnpm run channel\n```\n\nIt prints `Channel \"\u003Cname>\" is online` when the gateway connection is live, or `declared but no provider is attached yet` when the provider half is unfinished — which is a waiting state, not an error.\n\n### What to change, and where\n\nEverything happens inside `createDefaultChannel` in `channels.mts`, on the `channel` object before it is returned:\n\n```typescript\n\u002F\u002F Reply to a thread the bot is mentioned in, in addition to the messages it\n\u002F\u002F already handles. Registering onMention does NOT replace onMessage: a\n\u002F\u002F non-mention turn is only ever dispatched to message handlers, so removing\n\u002F\u002F onMessage makes the bot silent in DMs and on 1:1 platforms.\nchannel.onMention(async ({ thread, message }) => {\n  \u002F* ... *\u002F\n});\n\n\u002F\u002F Act on a reaction. `added` distinguishes an added emoji from a removed one,\n\u002F\u002F and `thread` is the conversation it happened in.\nchannel.onReaction(async ({ thread, emoji, added }) => {\n  \u002F* ... *\u002F\n});\n```\n\n`onCommand` is deliberately absent from this list. Managed Slack Channels are events-only — there is no managed slash-command ingress — so registering one produces a handler nothing will ever call.\n\nPer-provider tools and context (`defaultSlackTools`, `defaultSlackContext`) are a deliberate omission from the scaffold, not an oversight: importing them makes the file provider-specific, and the scaffolded Channel is not. Add them here when the project only ever targets one provider.\n\n### Two things not to do to a scaffolded project\n\n- **Do not add a second `createChannel`.** The host resolves exactly one Channel name from `.copilotkit\u002Fchannels.json` and refuses to start when several are declared. A second declaration in source does not produce a second bot; it produces a project that will not boot.\n- **Do not move the Channel into the Next.js route.** That route is serverless and cannot hold a connection open. The separate host exists for that reason.\n\n## Verify — either path\n\n```bash\nnpx copilotkit channels status\n```\n\nThat compares three things that must agree — the declared configuration, the project source, and the server — and names whichever is missing. Then:\n\n1. Start the long-running host — `npm run channel` in a scaffolded project. It should log the activation.\n2. In Slack, invite the app to a channel (`channels status` prints the invite command with the right handle). In Teams, provider setup must already record **Add to a team**; do not substitute a personal-only install.\n3. Send a real mention or direct message. You should get a reply.\n\nIf nothing happens and there is no error, check in this order: is `activateChannels: false` set anywhere; on a deferring mount, is `ready()` awaited; is `intelligence` passed (not a `runner`); is the realtime URL correct; on Slack, was the app **reinstalled** after creation and the bot invited.\n\n\"Reinstalled\" is not a typo. Slack installs the app when it creates it, with two of its scopes, and only a reinstall grants the rest — see \"Online, silent, and nothing in the log at all\" below.\n\nDo not report a Channel as working because credentials were stored. A stored adapter proves the credentials are real — the server probed them — and nothing more. It does not prove the app is installed, that a channel was invited, or that a runtime is connected.\n\n### Online, but silent — a different failure\n\nThat checklist only covers a Channel that never connected. If the host logs `Channel \"\u003Cname>\" is online` and the bot still says nothing, the code half is **fine** — activation succeeded — and every item above will come back correct. Walking the list again is wasted time.\n\nLook in the host's own output for:\n\n```\n{ meta: { deliveryId: 'dlv_...', errorCategory: 'validation' } } channel delivery claim or join failed\n```\n\nThat is the runtime rejecting the turn the server sent it, at the join boundary, before any handler runs. Nothing is posted back to the provider on this path, which is why it looks like silence rather than an error.\n\nThe usual cause is a **version disagreement between the installed `@copilotkit\u002Fchannels-*` packages and the Intelligence deployment serving them**. The runtime validates each delivery strictly — exact field sets, not a loose subset — so a client expecting a field its server does not yet send fails every turn of that kind, while a Channel that never receives one (Teams-only, or an idle Slack app) looks perfectly healthy.\n\nSo:\n\n1. Note the installed versions: `npm ls @copilotkit\u002Fruntime @copilotkit\u002Fchannels`.\n2. Compare them with the Intelligence deployment. On hosted Intelligence, a canary or prerelease client can run ahead of what is deployed. On self-hosted, the deployment is usually the one that lags.\n3. Move them onto matching lines. Pinning the client to a prerelease is the common way into this state.\n\n`errorCategory` is a classification, not the message — the underlying error text is deliberately not logged, so the category plus this note is the whole signal you get.\n\n### Online, silent, and nothing in the log at all — a short-scoped Slack token\n\nIf the host logs online, the bot says nothing, and there is **no delivery line of any kind** in its output, the turn never reached you: Slack never sent it. On Slack that is almost always a bot token that was copied too early.\n\nCreating a Slack app from a manifest **installs it**, and that install grants only two scopes — `channels:history` and `chat:write`. The manifest's declared scopes reach the app's configuration but not the grant, which is what Slack's yellow \"you've changed the permission scopes\" banner is reporting. One **Reinstall to Workspace → Allow** raises the grant to the full set.\n\nA token copied before that reinstall is the trap, because every check still passes:\n\n- `auth.test` succeeds, so attaching stores it and reports the adapter healthy.\n- `chat:write` is present, so the bot can post — it is not obviously broken.\n- `app_mentions:read` is absent, so Slack never delivers `app_mention`, and no handler ever runs.\n\nThe result is a Channel that is genuinely online and structurally deaf. Distinguishing it from the version disagreement above is easy once you know to look: that failure logs a rejected delivery, this one logs nothing, because there is nothing to reject.\n\nFix it by reinstalling the Slack app, copying the reissued Bot User OAuth Token — reinstalling issues a new one — and rotating the stored credential (`npx copilotkit channels rotate \u003Cname> --adapter slack`).\n\nIntelligence now refuses a short-scoped token when it is pasted, with `CHANNEL_ADAPTER_SLACK_TOKEN_SCOPES_INCOMPLETE`, and names the missing scopes. Treat that error as this problem caught early rather than as a setup failure. A Channel attached before that check existed can still be sitting in this state, and only a rotation clears it.\n\nIf a reinstall does not fix it, the app predates the current manifest and its stored configuration is short too: paste the current manifest into **App Manifest** in the Slack app, then reinstall.\n\n## Wiring a project the CLI did not generate\n\nEverything from here down is the hand-wiring path — the less-trodden one. If `channel-host.mts` exists, you are in the wrong section.\n\n### Prerequisites\n\nA scaffolded project satisfies all four of these already. Before starting, confirm all four. Stop and fix any that fail — each one produces a silent failure rather than an error.\n\n1. **The Intelligence runtime is wired.** `channels` is not available in SSE mode; the type is `channels?: undefined` there. If the project still constructs `CopilotRuntime` with a `runner` and no `intelligence`, do the managed Intelligence step in the **copilotkit-setup** skill first.\n2. **A long-running host.** Activation opens a persistent connection, so the process has to outlive a request. A Next.js route handler on serverless, a Lambda, or an edge function cannot host a Channel. See \"Deployment shape\" below.\n3. **The hosted environment values are set** — the project API key, and the realtime URL if you are overriding defaults.\n4. **The provider half exists, or is in progress.** The two halves can be done in either order; a Channel simply does not answer until both are done.\n\n### Step 1: Install\n\n```bash\nnpm install @copilotkit\u002Fchannels\n```\n\n`@copilotkit\u002Fchannels` provides `createChannel`. The managed transport itself is built into `@copilotkit\u002Fruntime` — there is no separate adapter package to install for the managed path, and no provider credentials in your process.\n\n### Step 2: Declare the Channel\n\nThe Channel's `name` is chosen here, in code. It is the project-unique identifier the runtime uses to derive the managed Channel's activation config — project id, adapter, socket URL and auth — so you supply none of those.\n\n```typescript\nimport { createChannel } from \"@copilotkit\u002Fchannels\";\n\nconst support = createChannel({\n  \u002F\u002F Must match the Channel name configured on the provider half.\n  \u002F\u002F Lowercase kebab-case, unique within the project.\n  name: \"support\",\n  agent: (threadId) => {\n    const agent = new MyAgent();\n    agent.threadId = threadId;\n    return agent;\n  },\n});\n\nsupport.onMention(async ({ thread, message }) => {\n  await thread.runAgent({\n    \u002F\u002F Channel history does NOT include the in-flight turn, so pass the current\n    \u002F\u002F message explicitly -- otherwise the agent runs with zero messages.\n    prompt: message.contentParts?.length ? message.contentParts : message.text,\n  });\n});\n```\n\nThe agent is **framework-agnostic**: `agent` accepts any AG-UI `AbstractAgent`, including a remote one. A Python or .NET agent stays exactly where it is and a small TypeScript host proxies to it — adopting Channels never means porting an agent.\n\n### Step 3: Pass the Channel to the runtime\n\n```typescript\nimport { CopilotRuntime, CopilotKitIntelligence } from \"@copilotkit\u002Fruntime\u002Fv2\";\n\nconst intelligence = new CopilotKitIntelligence({\n  apiKey: process.env.COPILOTKIT_API_KEY!,\n});\n\nconst runtime = new CopilotRuntime({\n  \u002F\u002F A Channel supplies its own agent, so runtime-hosted agents are optional here.\n  agents: {},\n  intelligence,\n  identifyUser: (request) => resolveUserFromSession(request),\n  channels: [support],\n});\n```\n\n### Step 4: Mount a long-running host\n\n```typescript\nimport { createServer } from \"node:http\";\nimport { createCopilotNodeListener } from \"@copilotkit\u002Fruntime\u002Fv2\u002Fnode\";\n\nconst listener = createCopilotNodeListener({\n  runtime,\n  basePath: \"\u002Fapi\u002Fcopilotkit\",\n});\n\ncreateServer(listener).listen(Number(process.env.PORT ?? 8300));\n\n\u002F\u002F Optional on this mount, and worth doing: it turns a failed activation into a\n\u002F\u002F startup failure instead of a line in the logs.\nawait listener.channels.ready({ timeoutMs: 30_000 });\n```\n\n#### Whether you must call `ready()` depends on the mount\n\nThis is the single most misunderstood thing about Channels. Activation is **not** lazy everywhere.\n\n| Mount                                         | Activation                          | Is `ready()` required?   |\n| --------------------------------------------- | ----------------------------------- | ------------------------ |\n| `createCopilotNodeListener`                   | Starts when the listener is created | No — await it to observe |\n| `createCopilotExpressHandler`                 | Starts when the router is created   | No — await it to observe |\n| `createCopilotHonoHandler`                    | Deferred to the first `ready()`     | **Yes**                  |\n| `createCopilotRuntimeHandler` (generic fetch) | Deferred to the first `ready()`     | **Yes**                  |\n| any mount with `activateChannels: false`      | None; no control surface, no socket | Nothing will connect     |\n\nThe two lifecycle-owning wrappers start on their own because they own their process lifetime — a declared Channel connects because it was declared, and there is no incantation to forget. The fetch and hono handlers defer on purpose: they are the serverless and edge entry points, where an isolate freezes and recycles per request and separate cold starts would mint competing listeners for the same Channel.\n\nSo the silent failure — a process that serves HTTP, looks healthy, and answers nothing — happens on a **deferring** mount when nothing ever calls `ready()`. On a node or express host, a missing `ready()` is not that failure.\n\nTwo details either way:\n\n- `ready()` is **one-shot** and idempotent. It settles on the initial activation outcome, so awaiting it after an auto-start observes that activation rather than triggering a second one. It can resolve as `setup_required`, which means activation settled — not that delivery is healthy. Treat only `status().overall === \"online\"` as connected.\n- Pair activation with shutdown so a redeploy releases the connection cleanly:\n\n  ```typescript\n  process.on(\"SIGTERM\", async () => {\n    await listener.channels.stop();\n    process.exit(0);\n  });\n  ```\n\n### Deployment shape\n\nDeciding whether the project already has a long-running host is the judgement this skill exists to make. Detect the framework first (see the **copilotkit-setup** skill's `references\u002Fframework-detection.md`), then:\n\n| What the project runs today                    | What to do                                                       |\n| ---------------------------------------------- | ---------------------------------------------------------------- |\n| A standalone Node\u002FExpress\u002FHono server          | Declare the Channel on the runtime it already has                |\n| Next.js on Vercel, Lambda, or an edge function | Add a **separate** long-running process for the Channel          |\n| A Python or .NET agent                         | Leave it alone; add a small TypeScript channel host that proxies |\n\nA separate process is **not** mandated. If the project already runs a long-running runtime — one serving a React UI, for instance — that same runtime can declare Channels. A second process is required only when the existing runtime is serverless.\n\nWhen a separate host is needed, it is a small program: the runtime, the Channel, and the awaited ready call. It does not need to serve the UI, and it does not need an HTTP server at all — nothing calls it. The gateway connection is outbound, and holding it open is what keeps the process alive. The scaffolded `channel-host.mts` is exactly this, and is worth reading as the reference implementation even when writing one by hand.\n\n## Never do these\n\n- **Do not write provider credentials into the project** for a managed Channel. Intelligence stores them server-side; the runtime never reads them. If the project holds a Slack bot token for a managed Channel, something is wired wrong.\n- **Do not put a Channel on a serverless route handler.** It will appear to deploy and never connect.\n- **Do not assume `ready()` is required, or that it is optional.** Check the mount. Telling someone to add a call they do not need is as unhelpful as omitting one they do.\n- **Do not pass `runner` alongside `intelligence`.** That is what silently keeps threads in memory.\n- **Do not hand-wire a Channel into a scaffolded project.** If `channel-host.mts` is present the code half is done; adding a second declaration stops the host from booting rather than adding a bot.\n- **Do not invent Channel infrastructure ids.** Project, adapter, and channel ids are derived from the Intelligence config plus the Channel `name`.\n- **Do not send Teams icon or package bytes through Intelligence.** Browser-generated artifacts stay local to the active attempt and are discarded afterward.\n- **Do not use Azure Bot for normal managed Teams setup.** The launch path is Teams Developer Portal plus Entra, or the Teams-managed Fast CLI path.\n- **Do not call a Teams Channel working because setup says Created and installed.** Provider completion and runtime\u002Fmessage health are separate axes.\n",{"data":54,"body":56},{"name":4,"description":6,"version":55},"1.1.0",{"type":57,"children":58},"root",[59,67,73,80,102,159,165,170,186,250,271,277,282,329,334,341,346,486,514,519,531,537,542,647,652,677,698,704,732,983,994,1014,1020,1057,1063,1091,1096,1136,1180,1185,1190,1196,1215,1220,1230,1235,1255,1260,1285,1296,1302,1314,1349,1354,1397,1402,1415,1428,1440,1446,1458,1464,1469,1557,1563,1587,1612,1618,1631,2124,2150,2156,2462,2468,2816,2830,2841,3001,3006,3032,3037,3226,3232,3251,3319,3330,3342,3348,3474],{"type":60,"tag":61,"props":62,"children":63},"element","h1",{"id":4},[64],{"type":65,"value":66},"text","CopilotKit Channels",{"type":60,"tag":68,"props":69,"children":70},"p",{},[71],{"type":65,"value":72},"Managed Channels let an agent answer in Slack or Microsoft Teams. Intelligence owns the provider edge — signed ingress, egress, credential storage — and delivers turns to your runtime over its realtime transport.",{"type":60,"tag":74,"props":75,"children":77},"h2",{"id":76},"scope",[78],{"type":65,"value":79},"Scope",{"type":60,"tag":68,"props":81,"children":82},{},[83,85,91,93,100],{"type":65,"value":84},"This skill covers ",{"type":60,"tag":86,"props":87,"children":88},"strong",{},[89],{"type":65,"value":90},"managed Intelligence Channels",{"type":65,"value":92},": ",{"type":60,"tag":94,"props":95,"children":97},"code",{"className":96},[],[98],{"type":65,"value":99},"CopilotIntelligenceRuntime",{"type":65,"value":101},", app-api Channel resources, and the realtime gateway.",{"type":60,"tag":68,"props":103,"children":104},{},[105,107,112,114,120,122,128,130,136,137,143,144,150,151,157],{"type":65,"value":106},"It does ",{"type":60,"tag":86,"props":108,"children":109},{},[110],{"type":65,"value":111},"not",{"type":65,"value":113}," cover the self-hosted ",{"type":60,"tag":94,"props":115,"children":117},{"className":116},[],[118],{"type":65,"value":119},"@copilotkit\u002Fchannels",{"type":65,"value":121}," provider adapters (",{"type":60,"tag":94,"props":123,"children":125},{"className":124},[],[126],{"type":65,"value":127},"@copilotkit\u002Fchannels-slack",{"type":65,"value":129},", ",{"type":60,"tag":94,"props":131,"children":133},{"className":132},[],[134],{"type":65,"value":135},"-teams",{"type":65,"value":129},{"type":60,"tag":94,"props":138,"children":140},{"className":139},[],[141],{"type":65,"value":142},"-discord",{"type":65,"value":129},{"type":60,"tag":94,"props":145,"children":147},{"className":146},[],[148],{"type":65,"value":149},"-telegram",{"type":65,"value":129},{"type":60,"tag":94,"props":152,"children":154},{"className":153},[],[155],{"type":65,"value":156},"-whatsapp",{"type":65,"value":158},"). Those hold provider credentials in your process and talk to the provider directly. Both products use the words \"channels\" and \"Slack\", so confirm which one the user means before wiring anything. If they want to hold their own Slack tokens and run their own ingress, they want the adapter packages, not this skill.",{"type":60,"tag":74,"props":160,"children":162},{"id":161},"decide-which-path-you-are-on-first",[163],{"type":65,"value":164},"Decide which path you are on first",{"type":60,"tag":68,"props":166,"children":167},{},[168],{"type":65,"value":169},"Everything below depends on this, and getting it wrong produces a project with two Channel declarations that fight over one Channel.",{"type":60,"tag":68,"props":171,"children":172},{},[173],{"type":60,"tag":86,"props":174,"children":175},{},[176,178,184],{"type":65,"value":177},"Look for ",{"type":60,"tag":94,"props":179,"children":181},{"className":180},[],[182],{"type":65,"value":183},"channel-host.mts",{"type":65,"value":185}," at the project root.",{"type":60,"tag":187,"props":188,"children":189},"table",{},[190,209],{"type":60,"tag":191,"props":192,"children":193},"thead",{},[194],{"type":60,"tag":195,"props":196,"children":197},"tr",{},[198,204],{"type":60,"tag":199,"props":200,"children":201},"th",{},[202],{"type":65,"value":203},"It is there",{"type":60,"tag":199,"props":205,"children":206},{},[207],{"type":65,"value":208},"It is not",{"type":60,"tag":210,"props":211,"children":212},"tbody",{},[213],{"type":60,"tag":195,"props":214,"children":215},{},[216,245],{"type":60,"tag":217,"props":218,"children":219},"td",{},[220,222,228,230,235,237,243],{"type":65,"value":221},"The project was scaffolded by ",{"type":60,"tag":94,"props":223,"children":225},{"className":224},[],[226],{"type":65,"value":227},"npx copilotkit init",{"type":65,"value":229},". The code half is ",{"type":60,"tag":86,"props":231,"children":232},{},[233],{"type":65,"value":234},"already done",{"type":65,"value":236}," — go to \"Customising a scaffolded Channel\". Do not write a new host or a second ",{"type":60,"tag":94,"props":238,"children":240},{"className":239},[],[241],{"type":65,"value":242},"createChannel",{"type":65,"value":244},".",{"type":60,"tag":217,"props":246,"children":247},{},[248],{"type":65,"value":249},"The project predates the Channel, or was not made by the CLI. Go to \"Wiring a project the CLI did not generate\", at the end.",{"type":60,"tag":68,"props":251,"children":252},{},[253,255,261,263,269],{"type":65,"value":254},"The scaffolded path is the one exercised end to end. Wiring an existing project is supported and works, but it is less trodden: the CLI reads source it did not generate, so a project laid out unusually may get a ",{"type":60,"tag":94,"props":256,"children":258},{"className":257},[],[259],{"type":65,"value":260},"status",{"type":65,"value":262}," leg reported as ",{"type":60,"tag":94,"props":264,"children":266},{"className":265},[],[267],{"type":65,"value":268},"undetermined",{"type":65,"value":270}," rather than a confident answer. That is deliberate — an unsure answer beats a wrong one — but verify the wiring yourself there rather than trusting a green report.",{"type":60,"tag":74,"props":272,"children":274},{"id":273},"a-channel-has-two-halves",[275],{"type":65,"value":276},"A Channel has two halves",{"type":60,"tag":68,"props":278,"children":279},{},[280],{"type":65,"value":281},"A Channel only works when both are correct, and each half is invisible from the other:",{"type":60,"tag":283,"props":284,"children":285},"ol",{},[286,312],{"type":60,"tag":287,"props":288,"children":289},"li",{},[290,295,297,302,304,310],{"type":60,"tag":86,"props":291,"children":292},{},[293],{"type":65,"value":294},"The provider half",{"type":65,"value":296}," — an app registered with Slack or Microsoft, credentials stored server-side, ingress pointed at Intelligence. Three entry points converge on it: ",{"type":60,"tag":94,"props":298,"children":300},{"className":299},[],[301],{"type":65,"value":227},{"type":65,"value":303}," guides a new project, ",{"type":60,"tag":94,"props":305,"children":307},{"className":306},[],[308],{"type":65,"value":309},"npx copilotkit channels add",{"type":65,"value":311}," handles an existing project or agent, and the dashboard wizard works in a browser. A new Teams app begins with the browser-created draft and uses one of the two paths below.",{"type":60,"tag":287,"props":313,"children":314},{},[315,320,322,327],{"type":60,"tag":86,"props":316,"children":317},{},[318],{"type":65,"value":319},"The code half",{"type":65,"value":321}," — a long-running runtime that declares the Channel and awaits activation. A scaffolded project ",{"type":60,"tag":86,"props":323,"children":324},{},[325],{"type":65,"value":326},"already has this",{"type":65,"value":328},"; for anything else, it is what this skill writes.",{"type":60,"tag":68,"props":330,"children":331},{},[332],{"type":65,"value":333},"The most confusing failure in this product is a correct provider half with a missing code half: the app serves HTTP normally, reports no error, shows an encouraging badge in the dashboard, and answers nothing. Nothing in the browser can diagnose it, because the missing piece is in the source tree.",{"type":60,"tag":335,"props":336,"children":338},"h3",{"id":337},"teams-provider-setup-has-two-peer-paths",[339],{"type":65,"value":340},"Teams provider setup has two peer paths",{"type":60,"tag":68,"props":342,"children":343},{},[344],{"type":65,"value":345},"For Teams, create the durable Channel draft in Intelligence before provisioning Microsoft resources. The browser then offers:",{"type":60,"tag":347,"props":348,"children":349},"ul",{},[350,469],{"type":60,"tag":287,"props":351,"children":352},{},[353,358,360,463,467],{"type":60,"tag":86,"props":354,"children":355},{},[356],{"type":65,"value":357},"Fast CLI setup (recommended):",{"type":65,"value":359}," copy the fully scoped command from the draft:",{"type":60,"tag":361,"props":362,"children":367},"pre",{"className":363,"code":364,"language":365,"meta":366,"style":366},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npx copilotkit@latest channels add --project-id \u003Cproject-id> --channel-id \u003Cchannel-id> --adapter teams --provision\n","bash","",[368],{"type":60,"tag":94,"props":369,"children":370},{"__ignoreMap":366},[371],{"type":60,"tag":372,"props":373,"children":376},"span",{"class":374,"line":375},"line",1,[377,383,389,394,399,404,410,415,421,426,431,435,440,444,448,453,458],{"type":60,"tag":372,"props":378,"children":380},{"style":379},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[381],{"type":65,"value":382},"npx",{"type":60,"tag":372,"props":384,"children":386},{"style":385},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[387],{"type":65,"value":388}," copilotkit@latest",{"type":60,"tag":372,"props":390,"children":391},{"style":385},[392],{"type":65,"value":393}," channels",{"type":60,"tag":372,"props":395,"children":396},{"style":385},[397],{"type":65,"value":398}," add",{"type":60,"tag":372,"props":400,"children":401},{"style":385},[402],{"type":65,"value":403}," --project-id",{"type":60,"tag":372,"props":405,"children":407},{"style":406},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[408],{"type":65,"value":409}," \u003C",{"type":60,"tag":372,"props":411,"children":412},{"style":385},[413],{"type":65,"value":414},"project-i",{"type":60,"tag":372,"props":416,"children":418},{"style":417},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[419],{"type":65,"value":420},"d",{"type":60,"tag":372,"props":422,"children":423},{"style":406},[424],{"type":65,"value":425},">",{"type":60,"tag":372,"props":427,"children":428},{"style":385},[429],{"type":65,"value":430}," --channel-id",{"type":60,"tag":372,"props":432,"children":433},{"style":406},[434],{"type":65,"value":409},{"type":60,"tag":372,"props":436,"children":437},{"style":385},[438],{"type":65,"value":439},"channel-i",{"type":60,"tag":372,"props":441,"children":442},{"style":417},[443],{"type":65,"value":420},{"type":60,"tag":372,"props":445,"children":446},{"style":406},[447],{"type":65,"value":425},{"type":60,"tag":372,"props":449,"children":450},{"style":385},[451],{"type":65,"value":452}," --adapter",{"type":60,"tag":372,"props":454,"children":455},{"style":385},[456],{"type":65,"value":457}," teams",{"type":60,"tag":372,"props":459,"children":460},{"style":385},[461],{"type":65,"value":462}," --provision\n",{"type":60,"tag":464,"props":465,"children":466},"br",{},[],{"type":65,"value":468},"It works outside a repository, reuses the CopilotKit login, confirms the Microsoft tenant, creates one single-tenant Teams-managed app, and sends the generated secret directly to encrypted Intelligence storage. It does not print the secret, write provider environment files, or modify runtime code.",{"type":60,"tag":287,"props":470,"children":471},{},[472,477,479,485],{"type":60,"tag":86,"props":473,"children":474},{},[475],{"type":65,"value":476},"Guided manual setup:",{"type":65,"value":478}," use Teams Developer Portal and Microsoft Entra, enter write-only credentials, and download the finished package from the browser. The normal path does not need Azure Bot and never asks the user to edit ",{"type":60,"tag":94,"props":480,"children":482},{"className":481},[],[483],{"type":65,"value":484},"manifest.json",{"type":65,"value":244},{"type":60,"tag":68,"props":487,"children":488},{},[489,491,497,499,504,506,512],{"type":65,"value":490},"Both paths use the same durable setup state and can replace one another mid-setup. ",{"type":60,"tag":94,"props":492,"children":494},{"className":493},[],[495],{"type":65,"value":496},"Files.ReadWrite.All",{"type":65,"value":498}," administrator consent and one ",{"type":60,"tag":86,"props":500,"children":501},{},[502],{"type":65,"value":503},"Add to a team",{"type":65,"value":505}," installation are required. A non-admin pause is a successful ",{"type":60,"tag":94,"props":507,"children":509},{"className":508},[],[510],{"type":65,"value":511},"blocked",{"type":65,"value":513}," outcome with one approval link and the same resume command; rerunning it must reuse the existing Microsoft app.",{"type":60,"tag":68,"props":515,"children":516},{},[517],{"type":65,"value":518},"Custom icon and package bytes stay in browser\u002FCLI memory or a temporary local directory. Never send them to Intelligence, Redis, or another relay. If an attempt stops before upload, require the user to select custom icons again (or explicitly choose the default kite) and delete every temporary copy on exit.",{"type":60,"tag":68,"props":520,"children":521},{},[522,524,529],{"type":65,"value":523},"Treat ",{"type":60,"tag":86,"props":525,"children":526},{},[527],{"type":65,"value":528},"Created and installed",{"type":65,"value":530}," narrowly: the Microsoft app exists, encrypted credentials are stored, file and Team message access are approved, and a Team installation was recorded. It is not proof that this runtime is online or that a message was delivered.",{"type":60,"tag":74,"props":532,"children":534},{"id":533},"customising-a-scaffolded-channel",[535],{"type":65,"value":536},"Customising a scaffolded Channel",{"type":60,"tag":68,"props":538,"children":539},{},[540],{"type":65,"value":541},"A scaffolded project ships three files, and only one of them is yours to change:",{"type":60,"tag":187,"props":543,"children":544},{},[545,566],{"type":60,"tag":191,"props":546,"children":547},{},[548],{"type":60,"tag":195,"props":549,"children":550},{},[551,556,561],{"type":60,"tag":199,"props":552,"children":553},{},[554],{"type":65,"value":555},"File",{"type":60,"tag":199,"props":557,"children":558},{},[559],{"type":65,"value":560},"What it is",{"type":60,"tag":199,"props":562,"children":563},{},[564],{"type":65,"value":565},"Change it?",{"type":60,"tag":210,"props":567,"children":568},{},[569,594,615],{"type":60,"tag":195,"props":570,"children":571},{},[572,581,586],{"type":60,"tag":217,"props":573,"children":574},{},[575],{"type":60,"tag":94,"props":576,"children":578},{"className":577},[],[579],{"type":65,"value":580},"channels.mts",{"type":60,"tag":217,"props":582,"children":583},{},[584],{"type":65,"value":585},"The Channel: its name resolution, its agent, and its handlers",{"type":60,"tag":217,"props":587,"children":588},{},[589],{"type":60,"tag":86,"props":590,"children":591},{},[592],{"type":65,"value":593},"Yes — this is where customisation goes",{"type":60,"tag":195,"props":595,"children":596},{},[597,605,610],{"type":60,"tag":217,"props":598,"children":599},{},[600],{"type":60,"tag":94,"props":601,"children":603},{"className":602},[],[604],{"type":65,"value":183},{"type":60,"tag":217,"props":606,"children":607},{},[608],{"type":65,"value":609},"The process that owns the Channel's lifetime",{"type":60,"tag":217,"props":611,"children":612},{},[613],{"type":65,"value":614},"No. It is identical in every starter and for every provider",{"type":60,"tag":195,"props":616,"children":617},{},[618,637,642],{"type":60,"tag":217,"props":619,"children":620},{},[621,627,629,635],{"type":60,"tag":94,"props":622,"children":624},{"className":623},[],[625],{"type":65,"value":626},"src\u002Fagent.ts",{"type":65,"value":628}," (or ",{"type":60,"tag":94,"props":630,"children":632},{"className":631},[],[633],{"type":65,"value":634},"app\u002Fagent.ts",{"type":65,"value":636},")",{"type":60,"tag":217,"props":638,"children":639},{},[640],{"type":65,"value":641},"The agent both the web route and the Channel serve",{"type":60,"tag":217,"props":643,"children":644},{},[645],{"type":65,"value":646},"Only to change the agent itself",{"type":60,"tag":68,"props":648,"children":649},{},[650],{"type":65,"value":651},"Run it with:",{"type":60,"tag":361,"props":653,"children":655},{"className":363,"code":654,"language":365,"meta":366,"style":366},"npm run channel\n",[656],{"type":60,"tag":94,"props":657,"children":658},{"__ignoreMap":366},[659],{"type":60,"tag":372,"props":660,"children":661},{"class":374,"line":375},[662,667,672],{"type":60,"tag":372,"props":663,"children":664},{"style":379},[665],{"type":65,"value":666},"npm",{"type":60,"tag":372,"props":668,"children":669},{"style":385},[670],{"type":65,"value":671}," run",{"type":60,"tag":372,"props":673,"children":674},{"style":385},[675],{"type":65,"value":676}," channel\n",{"type":60,"tag":68,"props":678,"children":679},{},[680,682,688,690,696],{"type":65,"value":681},"It prints ",{"type":60,"tag":94,"props":683,"children":685},{"className":684},[],[686],{"type":65,"value":687},"Channel \"\u003Cname>\" is online",{"type":65,"value":689}," when the gateway connection is live, or ",{"type":60,"tag":94,"props":691,"children":693},{"className":692},[],[694],{"type":65,"value":695},"declared but no provider is attached yet",{"type":65,"value":697}," when the provider half is unfinished — which is a waiting state, not an error.",{"type":60,"tag":335,"props":699,"children":701},{"id":700},"what-to-change-and-where",[702],{"type":65,"value":703},"What to change, and where",{"type":60,"tag":68,"props":705,"children":706},{},[707,709,715,717,722,724,730],{"type":65,"value":708},"Everything happens inside ",{"type":60,"tag":94,"props":710,"children":712},{"className":711},[],[713],{"type":65,"value":714},"createDefaultChannel",{"type":65,"value":716}," in ",{"type":60,"tag":94,"props":718,"children":720},{"className":719},[],[721],{"type":65,"value":580},{"type":65,"value":723},", on the ",{"type":60,"tag":94,"props":725,"children":727},{"className":726},[],[728],{"type":65,"value":729},"channel",{"type":65,"value":731}," object before it is returned:",{"type":60,"tag":361,"props":733,"children":736},{"className":734,"code":735,"language":47,"meta":366,"style":366},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Reply to a thread the bot is mentioned in, in addition to the messages it\n\u002F\u002F already handles. Registering onMention does NOT replace onMessage: a\n\u002F\u002F non-mention turn is only ever dispatched to message handlers, so removing\n\u002F\u002F onMessage makes the bot silent in DMs and on 1:1 platforms.\nchannel.onMention(async ({ thread, message }) => {\n  \u002F* ... *\u002F\n});\n\n\u002F\u002F Act on a reaction. `added` distinguishes an added emoji from a removed one,\n\u002F\u002F and `thread` is the conversation it happened in.\nchannel.onReaction(async ({ thread, emoji, added }) => {\n  \u002F* ... *\u002F\n});\n",[737],{"type":60,"tag":94,"props":738,"children":739},{"__ignoreMap":366},[740,749,758,767,776,841,850,868,878,887,896,959,967],{"type":60,"tag":372,"props":741,"children":742},{"class":374,"line":375},[743],{"type":60,"tag":372,"props":744,"children":746},{"style":745},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[747],{"type":65,"value":748},"\u002F\u002F Reply to a thread the bot is mentioned in, in addition to the messages it\n",{"type":60,"tag":372,"props":750,"children":752},{"class":374,"line":751},2,[753],{"type":60,"tag":372,"props":754,"children":755},{"style":745},[756],{"type":65,"value":757},"\u002F\u002F already handles. Registering onMention does NOT replace onMessage: a\n",{"type":60,"tag":372,"props":759,"children":761},{"class":374,"line":760},3,[762],{"type":60,"tag":372,"props":763,"children":764},{"style":745},[765],{"type":65,"value":766},"\u002F\u002F non-mention turn is only ever dispatched to message handlers, so removing\n",{"type":60,"tag":372,"props":768,"children":770},{"class":374,"line":769},4,[771],{"type":60,"tag":372,"props":772,"children":773},{"style":745},[774],{"type":65,"value":775},"\u002F\u002F onMessage makes the bot silent in DMs and on 1:1 platforms.\n",{"type":60,"tag":372,"props":777,"children":779},{"class":374,"line":778},5,[780,784,788,794,799,805,810,816,821,826,831,836],{"type":60,"tag":372,"props":781,"children":782},{"style":417},[783],{"type":65,"value":729},{"type":60,"tag":372,"props":785,"children":786},{"style":406},[787],{"type":65,"value":244},{"type":60,"tag":372,"props":789,"children":791},{"style":790},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[792],{"type":65,"value":793},"onMention",{"type":60,"tag":372,"props":795,"children":796},{"style":417},[797],{"type":65,"value":798},"(",{"type":60,"tag":372,"props":800,"children":802},{"style":801},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[803],{"type":65,"value":804},"async",{"type":60,"tag":372,"props":806,"children":807},{"style":406},[808],{"type":65,"value":809}," ({",{"type":60,"tag":372,"props":811,"children":813},{"style":812},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[814],{"type":65,"value":815}," thread",{"type":60,"tag":372,"props":817,"children":818},{"style":406},[819],{"type":65,"value":820},",",{"type":60,"tag":372,"props":822,"children":823},{"style":812},[824],{"type":65,"value":825}," message",{"type":60,"tag":372,"props":827,"children":828},{"style":406},[829],{"type":65,"value":830}," })",{"type":60,"tag":372,"props":832,"children":833},{"style":801},[834],{"type":65,"value":835}," =>",{"type":60,"tag":372,"props":837,"children":838},{"style":406},[839],{"type":65,"value":840}," {\n",{"type":60,"tag":372,"props":842,"children":844},{"class":374,"line":843},6,[845],{"type":60,"tag":372,"props":846,"children":847},{"style":745},[848],{"type":65,"value":849},"  \u002F* ... *\u002F\n",{"type":60,"tag":372,"props":851,"children":853},{"class":374,"line":852},7,[854,859,863],{"type":60,"tag":372,"props":855,"children":856},{"style":406},[857],{"type":65,"value":858},"}",{"type":60,"tag":372,"props":860,"children":861},{"style":417},[862],{"type":65,"value":636},{"type":60,"tag":372,"props":864,"children":865},{"style":406},[866],{"type":65,"value":867},";\n",{"type":60,"tag":372,"props":869,"children":871},{"class":374,"line":870},8,[872],{"type":60,"tag":372,"props":873,"children":875},{"emptyLinePlaceholder":874},true,[876],{"type":65,"value":877},"\n",{"type":60,"tag":372,"props":879,"children":881},{"class":374,"line":880},9,[882],{"type":60,"tag":372,"props":883,"children":884},{"style":745},[885],{"type":65,"value":886},"\u002F\u002F Act on a reaction. `added` distinguishes an added emoji from a removed one,\n",{"type":60,"tag":372,"props":888,"children":890},{"class":374,"line":889},10,[891],{"type":60,"tag":372,"props":892,"children":893},{"style":745},[894],{"type":65,"value":895},"\u002F\u002F and `thread` is the conversation it happened in.\n",{"type":60,"tag":372,"props":897,"children":899},{"class":374,"line":898},11,[900,904,908,913,917,921,925,929,933,938,942,947,951,955],{"type":60,"tag":372,"props":901,"children":902},{"style":417},[903],{"type":65,"value":729},{"type":60,"tag":372,"props":905,"children":906},{"style":406},[907],{"type":65,"value":244},{"type":60,"tag":372,"props":909,"children":910},{"style":790},[911],{"type":65,"value":912},"onReaction",{"type":60,"tag":372,"props":914,"children":915},{"style":417},[916],{"type":65,"value":798},{"type":60,"tag":372,"props":918,"children":919},{"style":801},[920],{"type":65,"value":804},{"type":60,"tag":372,"props":922,"children":923},{"style":406},[924],{"type":65,"value":809},{"type":60,"tag":372,"props":926,"children":927},{"style":812},[928],{"type":65,"value":815},{"type":60,"tag":372,"props":930,"children":931},{"style":406},[932],{"type":65,"value":820},{"type":60,"tag":372,"props":934,"children":935},{"style":812},[936],{"type":65,"value":937}," emoji",{"type":60,"tag":372,"props":939,"children":940},{"style":406},[941],{"type":65,"value":820},{"type":60,"tag":372,"props":943,"children":944},{"style":812},[945],{"type":65,"value":946}," added",{"type":60,"tag":372,"props":948,"children":949},{"style":406},[950],{"type":65,"value":830},{"type":60,"tag":372,"props":952,"children":953},{"style":801},[954],{"type":65,"value":835},{"type":60,"tag":372,"props":956,"children":957},{"style":406},[958],{"type":65,"value":840},{"type":60,"tag":372,"props":960,"children":962},{"class":374,"line":961},12,[963],{"type":60,"tag":372,"props":964,"children":965},{"style":745},[966],{"type":65,"value":849},{"type":60,"tag":372,"props":968,"children":970},{"class":374,"line":969},13,[971,975,979],{"type":60,"tag":372,"props":972,"children":973},{"style":406},[974],{"type":65,"value":858},{"type":60,"tag":372,"props":976,"children":977},{"style":417},[978],{"type":65,"value":636},{"type":60,"tag":372,"props":980,"children":981},{"style":406},[982],{"type":65,"value":867},{"type":60,"tag":68,"props":984,"children":985},{},[986,992],{"type":60,"tag":94,"props":987,"children":989},{"className":988},[],[990],{"type":65,"value":991},"onCommand",{"type":65,"value":993}," is deliberately absent from this list. Managed Slack Channels are events-only — there is no managed slash-command ingress — so registering one produces a handler nothing will ever call.",{"type":60,"tag":68,"props":995,"children":996},{},[997,999,1005,1006,1012],{"type":65,"value":998},"Per-provider tools and context (",{"type":60,"tag":94,"props":1000,"children":1002},{"className":1001},[],[1003],{"type":65,"value":1004},"defaultSlackTools",{"type":65,"value":129},{"type":60,"tag":94,"props":1007,"children":1009},{"className":1008},[],[1010],{"type":65,"value":1011},"defaultSlackContext",{"type":65,"value":1013},") are a deliberate omission from the scaffold, not an oversight: importing them makes the file provider-specific, and the scaffolded Channel is not. Add them here when the project only ever targets one provider.",{"type":60,"tag":335,"props":1015,"children":1017},{"id":1016},"two-things-not-to-do-to-a-scaffolded-project",[1018],{"type":65,"value":1019},"Two things not to do to a scaffolded project",{"type":60,"tag":347,"props":1021,"children":1022},{},[1023,1047],{"type":60,"tag":287,"props":1024,"children":1025},{},[1026,1037,1039,1045],{"type":60,"tag":86,"props":1027,"children":1028},{},[1029,1031,1036],{"type":65,"value":1030},"Do not add a second ",{"type":60,"tag":94,"props":1032,"children":1034},{"className":1033},[],[1035],{"type":65,"value":242},{"type":65,"value":244},{"type":65,"value":1038}," The host resolves exactly one Channel name from ",{"type":60,"tag":94,"props":1040,"children":1042},{"className":1041},[],[1043],{"type":65,"value":1044},".copilotkit\u002Fchannels.json",{"type":65,"value":1046}," and refuses to start when several are declared. A second declaration in source does not produce a second bot; it produces a project that will not boot.",{"type":60,"tag":287,"props":1048,"children":1049},{},[1050,1055],{"type":60,"tag":86,"props":1051,"children":1052},{},[1053],{"type":65,"value":1054},"Do not move the Channel into the Next.js route.",{"type":65,"value":1056}," That route is serverless and cannot hold a connection open. The separate host exists for that reason.",{"type":60,"tag":74,"props":1058,"children":1060},{"id":1059},"verify-either-path",[1061],{"type":65,"value":1062},"Verify — either path",{"type":60,"tag":361,"props":1064,"children":1066},{"className":363,"code":1065,"language":365,"meta":366,"style":366},"npx copilotkit channels status\n",[1067],{"type":60,"tag":94,"props":1068,"children":1069},{"__ignoreMap":366},[1070],{"type":60,"tag":372,"props":1071,"children":1072},{"class":374,"line":375},[1073,1077,1082,1086],{"type":60,"tag":372,"props":1074,"children":1075},{"style":379},[1076],{"type":65,"value":382},{"type":60,"tag":372,"props":1078,"children":1079},{"style":385},[1080],{"type":65,"value":1081}," copilotkit",{"type":60,"tag":372,"props":1083,"children":1084},{"style":385},[1085],{"type":65,"value":393},{"type":60,"tag":372,"props":1087,"children":1088},{"style":385},[1089],{"type":65,"value":1090}," status\n",{"type":60,"tag":68,"props":1092,"children":1093},{},[1094],{"type":65,"value":1095},"That compares three things that must agree — the declared configuration, the project source, and the server — and names whichever is missing. Then:",{"type":60,"tag":283,"props":1097,"children":1098},{},[1099,1112,1131],{"type":60,"tag":287,"props":1100,"children":1101},{},[1102,1104,1110],{"type":65,"value":1103},"Start the long-running host — ",{"type":60,"tag":94,"props":1105,"children":1107},{"className":1106},[],[1108],{"type":65,"value":1109},"npm run channel",{"type":65,"value":1111}," in a scaffolded project. It should log the activation.",{"type":60,"tag":287,"props":1113,"children":1114},{},[1115,1117,1123,1125,1129],{"type":65,"value":1116},"In Slack, invite the app to a channel (",{"type":60,"tag":94,"props":1118,"children":1120},{"className":1119},[],[1121],{"type":65,"value":1122},"channels status",{"type":65,"value":1124}," prints the invite command with the right handle). In Teams, provider setup must already record ",{"type":60,"tag":86,"props":1126,"children":1127},{},[1128],{"type":65,"value":503},{"type":65,"value":1130},"; do not substitute a personal-only install.",{"type":60,"tag":287,"props":1132,"children":1133},{},[1134],{"type":65,"value":1135},"Send a real mention or direct message. You should get a reply.",{"type":60,"tag":68,"props":1137,"children":1138},{},[1139,1141,1147,1149,1155,1157,1163,1165,1171,1173,1178],{"type":65,"value":1140},"If nothing happens and there is no error, check in this order: is ",{"type":60,"tag":94,"props":1142,"children":1144},{"className":1143},[],[1145],{"type":65,"value":1146},"activateChannels: false",{"type":65,"value":1148}," set anywhere; on a deferring mount, is ",{"type":60,"tag":94,"props":1150,"children":1152},{"className":1151},[],[1153],{"type":65,"value":1154},"ready()",{"type":65,"value":1156}," awaited; is ",{"type":60,"tag":94,"props":1158,"children":1160},{"className":1159},[],[1161],{"type":65,"value":1162},"intelligence",{"type":65,"value":1164}," passed (not a ",{"type":60,"tag":94,"props":1166,"children":1168},{"className":1167},[],[1169],{"type":65,"value":1170},"runner",{"type":65,"value":1172},"); is the realtime URL correct; on Slack, was the app ",{"type":60,"tag":86,"props":1174,"children":1175},{},[1176],{"type":65,"value":1177},"reinstalled",{"type":65,"value":1179}," after creation and the bot invited.",{"type":60,"tag":68,"props":1181,"children":1182},{},[1183],{"type":65,"value":1184},"\"Reinstalled\" is not a typo. Slack installs the app when it creates it, with two of its scopes, and only a reinstall grants the rest — see \"Online, silent, and nothing in the log at all\" below.",{"type":60,"tag":68,"props":1186,"children":1187},{},[1188],{"type":65,"value":1189},"Do not report a Channel as working because credentials were stored. A stored adapter proves the credentials are real — the server probed them — and nothing more. It does not prove the app is installed, that a channel was invited, or that a runtime is connected.",{"type":60,"tag":335,"props":1191,"children":1193},{"id":1192},"online-but-silent-a-different-failure",[1194],{"type":65,"value":1195},"Online, but silent — a different failure",{"type":60,"tag":68,"props":1197,"children":1198},{},[1199,1201,1206,1208,1213],{"type":65,"value":1200},"That checklist only covers a Channel that never connected. If the host logs ",{"type":60,"tag":94,"props":1202,"children":1204},{"className":1203},[],[1205],{"type":65,"value":687},{"type":65,"value":1207}," and the bot still says nothing, the code half is ",{"type":60,"tag":86,"props":1209,"children":1210},{},[1211],{"type":65,"value":1212},"fine",{"type":65,"value":1214}," — activation succeeded — and every item above will come back correct. Walking the list again is wasted time.",{"type":60,"tag":68,"props":1216,"children":1217},{},[1218],{"type":65,"value":1219},"Look in the host's own output for:",{"type":60,"tag":361,"props":1221,"children":1225},{"className":1222,"code":1224,"language":65},[1223],"language-text","{ meta: { deliveryId: 'dlv_...', errorCategory: 'validation' } } channel delivery claim or join failed\n",[1226],{"type":60,"tag":94,"props":1227,"children":1228},{"__ignoreMap":366},[1229],{"type":65,"value":1224},{"type":60,"tag":68,"props":1231,"children":1232},{},[1233],{"type":65,"value":1234},"That is the runtime rejecting the turn the server sent it, at the join boundary, before any handler runs. Nothing is posted back to the provider on this path, which is why it looks like silence rather than an error.",{"type":60,"tag":68,"props":1236,"children":1237},{},[1238,1240,1253],{"type":65,"value":1239},"The usual cause is a ",{"type":60,"tag":86,"props":1241,"children":1242},{},[1243,1245,1251],{"type":65,"value":1244},"version disagreement between the installed ",{"type":60,"tag":94,"props":1246,"children":1248},{"className":1247},[],[1249],{"type":65,"value":1250},"@copilotkit\u002Fchannels-*",{"type":65,"value":1252}," packages and the Intelligence deployment serving them",{"type":65,"value":1254},". The runtime validates each delivery strictly — exact field sets, not a loose subset — so a client expecting a field its server does not yet send fails every turn of that kind, while a Channel that never receives one (Teams-only, or an idle Slack app) looks perfectly healthy.",{"type":60,"tag":68,"props":1256,"children":1257},{},[1258],{"type":65,"value":1259},"So:",{"type":60,"tag":283,"props":1261,"children":1262},{},[1263,1275,1280],{"type":60,"tag":287,"props":1264,"children":1265},{},[1266,1268,1274],{"type":65,"value":1267},"Note the installed versions: ",{"type":60,"tag":94,"props":1269,"children":1271},{"className":1270},[],[1272],{"type":65,"value":1273},"npm ls @copilotkit\u002Fruntime @copilotkit\u002Fchannels",{"type":65,"value":244},{"type":60,"tag":287,"props":1276,"children":1277},{},[1278],{"type":65,"value":1279},"Compare them with the Intelligence deployment. On hosted Intelligence, a canary or prerelease client can run ahead of what is deployed. On self-hosted, the deployment is usually the one that lags.",{"type":60,"tag":287,"props":1281,"children":1282},{},[1283],{"type":65,"value":1284},"Move them onto matching lines. Pinning the client to a prerelease is the common way into this state.",{"type":60,"tag":68,"props":1286,"children":1287},{},[1288,1294],{"type":60,"tag":94,"props":1289,"children":1291},{"className":1290},[],[1292],{"type":65,"value":1293},"errorCategory",{"type":65,"value":1295}," is a classification, not the message — the underlying error text is deliberately not logged, so the category plus this note is the whole signal you get.",{"type":60,"tag":335,"props":1297,"children":1299},{"id":1298},"online-silent-and-nothing-in-the-log-at-all-a-short-scoped-slack-token",[1300],{"type":65,"value":1301},"Online, silent, and nothing in the log at all — a short-scoped Slack token",{"type":60,"tag":68,"props":1303,"children":1304},{},[1305,1307,1312],{"type":65,"value":1306},"If the host logs online, the bot says nothing, and there is ",{"type":60,"tag":86,"props":1308,"children":1309},{},[1310],{"type":65,"value":1311},"no delivery line of any kind",{"type":65,"value":1313}," in its output, the turn never reached you: Slack never sent it. On Slack that is almost always a bot token that was copied too early.",{"type":60,"tag":68,"props":1315,"children":1316},{},[1317,1319,1324,1326,1332,1334,1340,1342,1347],{"type":65,"value":1318},"Creating a Slack app from a manifest ",{"type":60,"tag":86,"props":1320,"children":1321},{},[1322],{"type":65,"value":1323},"installs it",{"type":65,"value":1325},", and that install grants only two scopes — ",{"type":60,"tag":94,"props":1327,"children":1329},{"className":1328},[],[1330],{"type":65,"value":1331},"channels:history",{"type":65,"value":1333}," and ",{"type":60,"tag":94,"props":1335,"children":1337},{"className":1336},[],[1338],{"type":65,"value":1339},"chat:write",{"type":65,"value":1341},". The manifest's declared scopes reach the app's configuration but not the grant, which is what Slack's yellow \"you've changed the permission scopes\" banner is reporting. One ",{"type":60,"tag":86,"props":1343,"children":1344},{},[1345],{"type":65,"value":1346},"Reinstall to Workspace → Allow",{"type":65,"value":1348}," raises the grant to the full set.",{"type":60,"tag":68,"props":1350,"children":1351},{},[1352],{"type":65,"value":1353},"A token copied before that reinstall is the trap, because every check still passes:",{"type":60,"tag":347,"props":1355,"children":1356},{},[1357,1368,1378],{"type":60,"tag":287,"props":1358,"children":1359},{},[1360,1366],{"type":60,"tag":94,"props":1361,"children":1363},{"className":1362},[],[1364],{"type":65,"value":1365},"auth.test",{"type":65,"value":1367}," succeeds, so attaching stores it and reports the adapter healthy.",{"type":60,"tag":287,"props":1369,"children":1370},{},[1371,1376],{"type":60,"tag":94,"props":1372,"children":1374},{"className":1373},[],[1375],{"type":65,"value":1339},{"type":65,"value":1377}," is present, so the bot can post — it is not obviously broken.",{"type":60,"tag":287,"props":1379,"children":1380},{},[1381,1387,1389,1395],{"type":60,"tag":94,"props":1382,"children":1384},{"className":1383},[],[1385],{"type":65,"value":1386},"app_mentions:read",{"type":65,"value":1388}," is absent, so Slack never delivers ",{"type":60,"tag":94,"props":1390,"children":1392},{"className":1391},[],[1393],{"type":65,"value":1394},"app_mention",{"type":65,"value":1396},", and no handler ever runs.",{"type":60,"tag":68,"props":1398,"children":1399},{},[1400],{"type":65,"value":1401},"The result is a Channel that is genuinely online and structurally deaf. Distinguishing it from the version disagreement above is easy once you know to look: that failure logs a rejected delivery, this one logs nothing, because there is nothing to reject.",{"type":60,"tag":68,"props":1403,"children":1404},{},[1405,1407,1413],{"type":65,"value":1406},"Fix it by reinstalling the Slack app, copying the reissued Bot User OAuth Token — reinstalling issues a new one — and rotating the stored credential (",{"type":60,"tag":94,"props":1408,"children":1410},{"className":1409},[],[1411],{"type":65,"value":1412},"npx copilotkit channels rotate \u003Cname> --adapter slack",{"type":65,"value":1414},").",{"type":60,"tag":68,"props":1416,"children":1417},{},[1418,1420,1426],{"type":65,"value":1419},"Intelligence now refuses a short-scoped token when it is pasted, with ",{"type":60,"tag":94,"props":1421,"children":1423},{"className":1422},[],[1424],{"type":65,"value":1425},"CHANNEL_ADAPTER_SLACK_TOKEN_SCOPES_INCOMPLETE",{"type":65,"value":1427},", and names the missing scopes. Treat that error as this problem caught early rather than as a setup failure. A Channel attached before that check existed can still be sitting in this state, and only a rotation clears it.",{"type":60,"tag":68,"props":1429,"children":1430},{},[1431,1433,1438],{"type":65,"value":1432},"If a reinstall does not fix it, the app predates the current manifest and its stored configuration is short too: paste the current manifest into ",{"type":60,"tag":86,"props":1434,"children":1435},{},[1436],{"type":65,"value":1437},"App Manifest",{"type":65,"value":1439}," in the Slack app, then reinstall.",{"type":60,"tag":74,"props":1441,"children":1443},{"id":1442},"wiring-a-project-the-cli-did-not-generate",[1444],{"type":65,"value":1445},"Wiring a project the CLI did not generate",{"type":60,"tag":68,"props":1447,"children":1448},{},[1449,1451,1456],{"type":65,"value":1450},"Everything from here down is the hand-wiring path — the less-trodden one. If ",{"type":60,"tag":94,"props":1452,"children":1454},{"className":1453},[],[1455],{"type":65,"value":183},{"type":65,"value":1457}," exists, you are in the wrong section.",{"type":60,"tag":335,"props":1459,"children":1461},{"id":1460},"prerequisites",[1462],{"type":65,"value":1463},"Prerequisites",{"type":60,"tag":68,"props":1465,"children":1466},{},[1467],{"type":65,"value":1468},"A scaffolded project satisfies all four of these already. Before starting, confirm all four. Stop and fix any that fail — each one produces a silent failure rather than an error.",{"type":60,"tag":283,"props":1470,"children":1471},{},[1472,1527,1537,1547],{"type":60,"tag":287,"props":1473,"children":1474},{},[1475,1480,1482,1488,1490,1496,1498,1504,1506,1511,1513,1518,1520,1525],{"type":60,"tag":86,"props":1476,"children":1477},{},[1478],{"type":65,"value":1479},"The Intelligence runtime is wired.",{"type":65,"value":1481}," ",{"type":60,"tag":94,"props":1483,"children":1485},{"className":1484},[],[1486],{"type":65,"value":1487},"channels",{"type":65,"value":1489}," is not available in SSE mode; the type is ",{"type":60,"tag":94,"props":1491,"children":1493},{"className":1492},[],[1494],{"type":65,"value":1495},"channels?: undefined",{"type":65,"value":1497}," there. If the project still constructs ",{"type":60,"tag":94,"props":1499,"children":1501},{"className":1500},[],[1502],{"type":65,"value":1503},"CopilotRuntime",{"type":65,"value":1505}," with a ",{"type":60,"tag":94,"props":1507,"children":1509},{"className":1508},[],[1510],{"type":65,"value":1170},{"type":65,"value":1512}," and no ",{"type":60,"tag":94,"props":1514,"children":1516},{"className":1515},[],[1517],{"type":65,"value":1162},{"type":65,"value":1519},", do the managed Intelligence step in the ",{"type":60,"tag":86,"props":1521,"children":1522},{},[1523],{"type":65,"value":1524},"copilotkit-setup",{"type":65,"value":1526}," skill first.",{"type":60,"tag":287,"props":1528,"children":1529},{},[1530,1535],{"type":60,"tag":86,"props":1531,"children":1532},{},[1533],{"type":65,"value":1534},"A long-running host.",{"type":65,"value":1536}," Activation opens a persistent connection, so the process has to outlive a request. A Next.js route handler on serverless, a Lambda, or an edge function cannot host a Channel. See \"Deployment shape\" below.",{"type":60,"tag":287,"props":1538,"children":1539},{},[1540,1545],{"type":60,"tag":86,"props":1541,"children":1542},{},[1543],{"type":65,"value":1544},"The hosted environment values are set",{"type":65,"value":1546}," — the project API key, and the realtime URL if you are overriding defaults.",{"type":60,"tag":287,"props":1548,"children":1549},{},[1550,1555],{"type":60,"tag":86,"props":1551,"children":1552},{},[1553],{"type":65,"value":1554},"The provider half exists, or is in progress.",{"type":65,"value":1556}," The two halves can be done in either order; a Channel simply does not answer until both are done.",{"type":60,"tag":335,"props":1558,"children":1560},{"id":1559},"step-1-install",[1561],{"type":65,"value":1562},"Step 1: Install",{"type":60,"tag":361,"props":1564,"children":1566},{"className":363,"code":1565,"language":365,"meta":366,"style":366},"npm install @copilotkit\u002Fchannels\n",[1567],{"type":60,"tag":94,"props":1568,"children":1569},{"__ignoreMap":366},[1570],{"type":60,"tag":372,"props":1571,"children":1572},{"class":374,"line":375},[1573,1577,1582],{"type":60,"tag":372,"props":1574,"children":1575},{"style":379},[1576],{"type":65,"value":666},{"type":60,"tag":372,"props":1578,"children":1579},{"style":385},[1580],{"type":65,"value":1581}," install",{"type":60,"tag":372,"props":1583,"children":1584},{"style":385},[1585],{"type":65,"value":1586}," @copilotkit\u002Fchannels\n",{"type":60,"tag":68,"props":1588,"children":1589},{},[1590,1595,1597,1602,1604,1610],{"type":60,"tag":94,"props":1591,"children":1593},{"className":1592},[],[1594],{"type":65,"value":119},{"type":65,"value":1596}," provides ",{"type":60,"tag":94,"props":1598,"children":1600},{"className":1599},[],[1601],{"type":65,"value":242},{"type":65,"value":1603},". The managed transport itself is built into ",{"type":60,"tag":94,"props":1605,"children":1607},{"className":1606},[],[1608],{"type":65,"value":1609},"@copilotkit\u002Fruntime",{"type":65,"value":1611}," — there is no separate adapter package to install for the managed path, and no provider credentials in your process.",{"type":60,"tag":335,"props":1613,"children":1615},{"id":1614},"step-2-declare-the-channel",[1616],{"type":65,"value":1617},"Step 2: Declare the Channel",{"type":60,"tag":68,"props":1619,"children":1620},{},[1621,1623,1629],{"type":65,"value":1622},"The Channel's ",{"type":60,"tag":94,"props":1624,"children":1626},{"className":1625},[],[1627],{"type":65,"value":1628},"name",{"type":65,"value":1630}," is chosen here, in code. It is the project-unique identifier the runtime uses to derive the managed Channel's activation config — project id, adapter, socket URL and auth — so you supply none of those.",{"type":60,"tag":361,"props":1632,"children":1634},{"className":734,"code":1633,"language":47,"meta":366,"style":366},"import { createChannel } from \"@copilotkit\u002Fchannels\";\n\nconst support = createChannel({\n  \u002F\u002F Must match the Channel name configured on the provider half.\n  \u002F\u002F Lowercase kebab-case, unique within the project.\n  name: \"support\",\n  agent: (threadId) => {\n    const agent = new MyAgent();\n    agent.threadId = threadId;\n    return agent;\n  },\n});\n\nsupport.onMention(async ({ thread, message }) => {\n  await thread.runAgent({\n    \u002F\u002F Channel history does NOT include the in-flight turn, so pass the current\n    \u002F\u002F message explicitly -- otherwise the agent runs with zero messages.\n    prompt: message.contentParts?.length ? message.contentParts : message.text,\n  });\n});\n",[1635],{"type":60,"tag":94,"props":1636,"children":1637},{"__ignoreMap":366},[1638,1685,1692,1723,1731,1739,1771,1805,1842,1871,1887,1895,1910,1917,1969,1999,2008,2017,2091,2108],{"type":60,"tag":372,"props":1639,"children":1640},{"class":374,"line":375},[1641,1647,1652,1657,1662,1667,1672,1676,1681],{"type":60,"tag":372,"props":1642,"children":1644},{"style":1643},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[1645],{"type":65,"value":1646},"import",{"type":60,"tag":372,"props":1648,"children":1649},{"style":406},[1650],{"type":65,"value":1651}," {",{"type":60,"tag":372,"props":1653,"children":1654},{"style":417},[1655],{"type":65,"value":1656}," createChannel",{"type":60,"tag":372,"props":1658,"children":1659},{"style":406},[1660],{"type":65,"value":1661}," }",{"type":60,"tag":372,"props":1663,"children":1664},{"style":1643},[1665],{"type":65,"value":1666}," from",{"type":60,"tag":372,"props":1668,"children":1669},{"style":406},[1670],{"type":65,"value":1671}," \"",{"type":60,"tag":372,"props":1673,"children":1674},{"style":385},[1675],{"type":65,"value":119},{"type":60,"tag":372,"props":1677,"children":1678},{"style":406},[1679],{"type":65,"value":1680},"\"",{"type":60,"tag":372,"props":1682,"children":1683},{"style":406},[1684],{"type":65,"value":867},{"type":60,"tag":372,"props":1686,"children":1687},{"class":374,"line":751},[1688],{"type":60,"tag":372,"props":1689,"children":1690},{"emptyLinePlaceholder":874},[1691],{"type":65,"value":877},{"type":60,"tag":372,"props":1693,"children":1694},{"class":374,"line":760},[1695,1700,1705,1710,1714,1718],{"type":60,"tag":372,"props":1696,"children":1697},{"style":801},[1698],{"type":65,"value":1699},"const",{"type":60,"tag":372,"props":1701,"children":1702},{"style":417},[1703],{"type":65,"value":1704}," support ",{"type":60,"tag":372,"props":1706,"children":1707},{"style":406},[1708],{"type":65,"value":1709},"=",{"type":60,"tag":372,"props":1711,"children":1712},{"style":790},[1713],{"type":65,"value":1656},{"type":60,"tag":372,"props":1715,"children":1716},{"style":417},[1717],{"type":65,"value":798},{"type":60,"tag":372,"props":1719,"children":1720},{"style":406},[1721],{"type":65,"value":1722},"{\n",{"type":60,"tag":372,"props":1724,"children":1725},{"class":374,"line":769},[1726],{"type":60,"tag":372,"props":1727,"children":1728},{"style":745},[1729],{"type":65,"value":1730},"  \u002F\u002F Must match the Channel name configured on the provider half.\n",{"type":60,"tag":372,"props":1732,"children":1733},{"class":374,"line":778},[1734],{"type":60,"tag":372,"props":1735,"children":1736},{"style":745},[1737],{"type":65,"value":1738},"  \u002F\u002F Lowercase kebab-case, unique within the project.\n",{"type":60,"tag":372,"props":1740,"children":1741},{"class":374,"line":843},[1742,1748,1753,1757,1762,1766],{"type":60,"tag":372,"props":1743,"children":1745},{"style":1744},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1746],{"type":65,"value":1747},"  name",{"type":60,"tag":372,"props":1749,"children":1750},{"style":406},[1751],{"type":65,"value":1752},":",{"type":60,"tag":372,"props":1754,"children":1755},{"style":406},[1756],{"type":65,"value":1671},{"type":60,"tag":372,"props":1758,"children":1759},{"style":385},[1760],{"type":65,"value":1761},"support",{"type":60,"tag":372,"props":1763,"children":1764},{"style":406},[1765],{"type":65,"value":1680},{"type":60,"tag":372,"props":1767,"children":1768},{"style":406},[1769],{"type":65,"value":1770},",\n",{"type":60,"tag":372,"props":1772,"children":1773},{"class":374,"line":852},[1774,1779,1783,1788,1793,1797,1801],{"type":60,"tag":372,"props":1775,"children":1776},{"style":790},[1777],{"type":65,"value":1778},"  agent",{"type":60,"tag":372,"props":1780,"children":1781},{"style":406},[1782],{"type":65,"value":1752},{"type":60,"tag":372,"props":1784,"children":1785},{"style":406},[1786],{"type":65,"value":1787}," (",{"type":60,"tag":372,"props":1789,"children":1790},{"style":812},[1791],{"type":65,"value":1792},"threadId",{"type":60,"tag":372,"props":1794,"children":1795},{"style":406},[1796],{"type":65,"value":636},{"type":60,"tag":372,"props":1798,"children":1799},{"style":801},[1800],{"type":65,"value":835},{"type":60,"tag":372,"props":1802,"children":1803},{"style":406},[1804],{"type":65,"value":840},{"type":60,"tag":372,"props":1806,"children":1807},{"class":374,"line":870},[1808,1813,1818,1823,1828,1833,1838],{"type":60,"tag":372,"props":1809,"children":1810},{"style":801},[1811],{"type":65,"value":1812},"    const",{"type":60,"tag":372,"props":1814,"children":1815},{"style":417},[1816],{"type":65,"value":1817}," agent",{"type":60,"tag":372,"props":1819,"children":1820},{"style":406},[1821],{"type":65,"value":1822}," =",{"type":60,"tag":372,"props":1824,"children":1825},{"style":406},[1826],{"type":65,"value":1827}," new",{"type":60,"tag":372,"props":1829,"children":1830},{"style":790},[1831],{"type":65,"value":1832}," MyAgent",{"type":60,"tag":372,"props":1834,"children":1835},{"style":1744},[1836],{"type":65,"value":1837},"()",{"type":60,"tag":372,"props":1839,"children":1840},{"style":406},[1841],{"type":65,"value":867},{"type":60,"tag":372,"props":1843,"children":1844},{"class":374,"line":880},[1845,1850,1854,1858,1862,1867],{"type":60,"tag":372,"props":1846,"children":1847},{"style":417},[1848],{"type":65,"value":1849},"    agent",{"type":60,"tag":372,"props":1851,"children":1852},{"style":406},[1853],{"type":65,"value":244},{"type":60,"tag":372,"props":1855,"children":1856},{"style":417},[1857],{"type":65,"value":1792},{"type":60,"tag":372,"props":1859,"children":1860},{"style":406},[1861],{"type":65,"value":1822},{"type":60,"tag":372,"props":1863,"children":1864},{"style":417},[1865],{"type":65,"value":1866}," threadId",{"type":60,"tag":372,"props":1868,"children":1869},{"style":406},[1870],{"type":65,"value":867},{"type":60,"tag":372,"props":1872,"children":1873},{"class":374,"line":889},[1874,1879,1883],{"type":60,"tag":372,"props":1875,"children":1876},{"style":1643},[1877],{"type":65,"value":1878},"    return",{"type":60,"tag":372,"props":1880,"children":1881},{"style":417},[1882],{"type":65,"value":1817},{"type":60,"tag":372,"props":1884,"children":1885},{"style":406},[1886],{"type":65,"value":867},{"type":60,"tag":372,"props":1888,"children":1889},{"class":374,"line":898},[1890],{"type":60,"tag":372,"props":1891,"children":1892},{"style":406},[1893],{"type":65,"value":1894},"  },\n",{"type":60,"tag":372,"props":1896,"children":1897},{"class":374,"line":961},[1898,1902,1906],{"type":60,"tag":372,"props":1899,"children":1900},{"style":406},[1901],{"type":65,"value":858},{"type":60,"tag":372,"props":1903,"children":1904},{"style":417},[1905],{"type":65,"value":636},{"type":60,"tag":372,"props":1907,"children":1908},{"style":406},[1909],{"type":65,"value":867},{"type":60,"tag":372,"props":1911,"children":1912},{"class":374,"line":969},[1913],{"type":60,"tag":372,"props":1914,"children":1915},{"emptyLinePlaceholder":874},[1916],{"type":65,"value":877},{"type":60,"tag":372,"props":1918,"children":1920},{"class":374,"line":1919},14,[1921,1925,1929,1933,1937,1941,1945,1949,1953,1957,1961,1965],{"type":60,"tag":372,"props":1922,"children":1923},{"style":417},[1924],{"type":65,"value":1761},{"type":60,"tag":372,"props":1926,"children":1927},{"style":406},[1928],{"type":65,"value":244},{"type":60,"tag":372,"props":1930,"children":1931},{"style":790},[1932],{"type":65,"value":793},{"type":60,"tag":372,"props":1934,"children":1935},{"style":417},[1936],{"type":65,"value":798},{"type":60,"tag":372,"props":1938,"children":1939},{"style":801},[1940],{"type":65,"value":804},{"type":60,"tag":372,"props":1942,"children":1943},{"style":406},[1944],{"type":65,"value":809},{"type":60,"tag":372,"props":1946,"children":1947},{"style":812},[1948],{"type":65,"value":815},{"type":60,"tag":372,"props":1950,"children":1951},{"style":406},[1952],{"type":65,"value":820},{"type":60,"tag":372,"props":1954,"children":1955},{"style":812},[1956],{"type":65,"value":825},{"type":60,"tag":372,"props":1958,"children":1959},{"style":406},[1960],{"type":65,"value":830},{"type":60,"tag":372,"props":1962,"children":1963},{"style":801},[1964],{"type":65,"value":835},{"type":60,"tag":372,"props":1966,"children":1967},{"style":406},[1968],{"type":65,"value":840},{"type":60,"tag":372,"props":1970,"children":1972},{"class":374,"line":1971},15,[1973,1978,1982,1986,1991,1995],{"type":60,"tag":372,"props":1974,"children":1975},{"style":1643},[1976],{"type":65,"value":1977},"  await",{"type":60,"tag":372,"props":1979,"children":1980},{"style":417},[1981],{"type":65,"value":815},{"type":60,"tag":372,"props":1983,"children":1984},{"style":406},[1985],{"type":65,"value":244},{"type":60,"tag":372,"props":1987,"children":1988},{"style":790},[1989],{"type":65,"value":1990},"runAgent",{"type":60,"tag":372,"props":1992,"children":1993},{"style":1744},[1994],{"type":65,"value":798},{"type":60,"tag":372,"props":1996,"children":1997},{"style":406},[1998],{"type":65,"value":1722},{"type":60,"tag":372,"props":2000,"children":2002},{"class":374,"line":2001},16,[2003],{"type":60,"tag":372,"props":2004,"children":2005},{"style":745},[2006],{"type":65,"value":2007},"    \u002F\u002F Channel history does NOT include the in-flight turn, so pass the current\n",{"type":60,"tag":372,"props":2009,"children":2011},{"class":374,"line":2010},17,[2012],{"type":60,"tag":372,"props":2013,"children":2014},{"style":745},[2015],{"type":65,"value":2016},"    \u002F\u002F message explicitly -- otherwise the agent runs with zero messages.\n",{"type":60,"tag":372,"props":2018,"children":2020},{"class":374,"line":2019},18,[2021,2026,2030,2034,2038,2043,2048,2053,2058,2062,2066,2070,2075,2079,2083,2087],{"type":60,"tag":372,"props":2022,"children":2023},{"style":1744},[2024],{"type":65,"value":2025},"    prompt",{"type":60,"tag":372,"props":2027,"children":2028},{"style":406},[2029],{"type":65,"value":1752},{"type":60,"tag":372,"props":2031,"children":2032},{"style":417},[2033],{"type":65,"value":825},{"type":60,"tag":372,"props":2035,"children":2036},{"style":406},[2037],{"type":65,"value":244},{"type":60,"tag":372,"props":2039,"children":2040},{"style":417},[2041],{"type":65,"value":2042},"contentParts",{"type":60,"tag":372,"props":2044,"children":2045},{"style":406},[2046],{"type":65,"value":2047},"?.",{"type":60,"tag":372,"props":2049,"children":2050},{"style":417},[2051],{"type":65,"value":2052},"length",{"type":60,"tag":372,"props":2054,"children":2055},{"style":406},[2056],{"type":65,"value":2057}," ?",{"type":60,"tag":372,"props":2059,"children":2060},{"style":417},[2061],{"type":65,"value":825},{"type":60,"tag":372,"props":2063,"children":2064},{"style":406},[2065],{"type":65,"value":244},{"type":60,"tag":372,"props":2067,"children":2068},{"style":417},[2069],{"type":65,"value":2042},{"type":60,"tag":372,"props":2071,"children":2072},{"style":406},[2073],{"type":65,"value":2074}," :",{"type":60,"tag":372,"props":2076,"children":2077},{"style":417},[2078],{"type":65,"value":825},{"type":60,"tag":372,"props":2080,"children":2081},{"style":406},[2082],{"type":65,"value":244},{"type":60,"tag":372,"props":2084,"children":2085},{"style":417},[2086],{"type":65,"value":65},{"type":60,"tag":372,"props":2088,"children":2089},{"style":406},[2090],{"type":65,"value":1770},{"type":60,"tag":372,"props":2092,"children":2094},{"class":374,"line":2093},19,[2095,2100,2104],{"type":60,"tag":372,"props":2096,"children":2097},{"style":406},[2098],{"type":65,"value":2099},"  }",{"type":60,"tag":372,"props":2101,"children":2102},{"style":1744},[2103],{"type":65,"value":636},{"type":60,"tag":372,"props":2105,"children":2106},{"style":406},[2107],{"type":65,"value":867},{"type":60,"tag":372,"props":2109,"children":2111},{"class":374,"line":2110},20,[2112,2116,2120],{"type":60,"tag":372,"props":2113,"children":2114},{"style":406},[2115],{"type":65,"value":858},{"type":60,"tag":372,"props":2117,"children":2118},{"style":417},[2119],{"type":65,"value":636},{"type":60,"tag":372,"props":2121,"children":2122},{"style":406},[2123],{"type":65,"value":867},{"type":60,"tag":68,"props":2125,"children":2126},{},[2127,2129,2134,2135,2140,2142,2148],{"type":65,"value":2128},"The agent is ",{"type":60,"tag":86,"props":2130,"children":2131},{},[2132],{"type":65,"value":2133},"framework-agnostic",{"type":65,"value":92},{"type":60,"tag":94,"props":2136,"children":2138},{"className":2137},[],[2139],{"type":65,"value":29},{"type":65,"value":2141}," accepts any AG-UI ",{"type":60,"tag":94,"props":2143,"children":2145},{"className":2144},[],[2146],{"type":65,"value":2147},"AbstractAgent",{"type":65,"value":2149},", including a remote one. A Python or .NET agent stays exactly where it is and a small TypeScript host proxies to it — adopting Channels never means porting an agent.",{"type":60,"tag":335,"props":2151,"children":2153},{"id":2152},"step-3-pass-the-channel-to-the-runtime",[2154],{"type":65,"value":2155},"Step 3: Pass the Channel to the runtime",{"type":60,"tag":361,"props":2157,"children":2159},{"className":734,"code":2158,"language":47,"meta":366,"style":366},"import { CopilotRuntime, CopilotKitIntelligence } from \"@copilotkit\u002Fruntime\u002Fv2\";\n\nconst intelligence = new CopilotKitIntelligence({\n  apiKey: process.env.COPILOTKIT_API_KEY!,\n});\n\nconst runtime = new CopilotRuntime({\n  \u002F\u002F A Channel supplies its own agent, so runtime-hosted agents are optional here.\n  agents: {},\n  intelligence,\n  identifyUser: (request) => resolveUserFromSession(request),\n  channels: [support],\n});\n",[2160],{"type":60,"tag":94,"props":2161,"children":2162},{"__ignoreMap":366},[2163,2213,2220,2252,2292,2307,2314,2346,2354,2371,2383,2426,2447],{"type":60,"tag":372,"props":2164,"children":2165},{"class":374,"line":375},[2166,2170,2174,2179,2183,2188,2192,2196,2200,2205,2209],{"type":60,"tag":372,"props":2167,"children":2168},{"style":1643},[2169],{"type":65,"value":1646},{"type":60,"tag":372,"props":2171,"children":2172},{"style":406},[2173],{"type":65,"value":1651},{"type":60,"tag":372,"props":2175,"children":2176},{"style":417},[2177],{"type":65,"value":2178}," CopilotRuntime",{"type":60,"tag":372,"props":2180,"children":2181},{"style":406},[2182],{"type":65,"value":820},{"type":60,"tag":372,"props":2184,"children":2185},{"style":417},[2186],{"type":65,"value":2187}," CopilotKitIntelligence",{"type":60,"tag":372,"props":2189,"children":2190},{"style":406},[2191],{"type":65,"value":1661},{"type":60,"tag":372,"props":2193,"children":2194},{"style":1643},[2195],{"type":65,"value":1666},{"type":60,"tag":372,"props":2197,"children":2198},{"style":406},[2199],{"type":65,"value":1671},{"type":60,"tag":372,"props":2201,"children":2202},{"style":385},[2203],{"type":65,"value":2204},"@copilotkit\u002Fruntime\u002Fv2",{"type":60,"tag":372,"props":2206,"children":2207},{"style":406},[2208],{"type":65,"value":1680},{"type":60,"tag":372,"props":2210,"children":2211},{"style":406},[2212],{"type":65,"value":867},{"type":60,"tag":372,"props":2214,"children":2215},{"class":374,"line":751},[2216],{"type":60,"tag":372,"props":2217,"children":2218},{"emptyLinePlaceholder":874},[2219],{"type":65,"value":877},{"type":60,"tag":372,"props":2221,"children":2222},{"class":374,"line":760},[2223,2227,2232,2236,2240,2244,2248],{"type":60,"tag":372,"props":2224,"children":2225},{"style":801},[2226],{"type":65,"value":1699},{"type":60,"tag":372,"props":2228,"children":2229},{"style":417},[2230],{"type":65,"value":2231}," intelligence ",{"type":60,"tag":372,"props":2233,"children":2234},{"style":406},[2235],{"type":65,"value":1709},{"type":60,"tag":372,"props":2237,"children":2238},{"style":406},[2239],{"type":65,"value":1827},{"type":60,"tag":372,"props":2241,"children":2242},{"style":790},[2243],{"type":65,"value":2187},{"type":60,"tag":372,"props":2245,"children":2246},{"style":417},[2247],{"type":65,"value":798},{"type":60,"tag":372,"props":2249,"children":2250},{"style":406},[2251],{"type":65,"value":1722},{"type":60,"tag":372,"props":2253,"children":2254},{"class":374,"line":769},[2255,2260,2264,2269,2273,2278,2282,2287],{"type":60,"tag":372,"props":2256,"children":2257},{"style":1744},[2258],{"type":65,"value":2259},"  apiKey",{"type":60,"tag":372,"props":2261,"children":2262},{"style":406},[2263],{"type":65,"value":1752},{"type":60,"tag":372,"props":2265,"children":2266},{"style":417},[2267],{"type":65,"value":2268}," process",{"type":60,"tag":372,"props":2270,"children":2271},{"style":406},[2272],{"type":65,"value":244},{"type":60,"tag":372,"props":2274,"children":2275},{"style":417},[2276],{"type":65,"value":2277},"env",{"type":60,"tag":372,"props":2279,"children":2280},{"style":406},[2281],{"type":65,"value":244},{"type":60,"tag":372,"props":2283,"children":2284},{"style":417},[2285],{"type":65,"value":2286},"COPILOTKIT_API_KEY",{"type":60,"tag":372,"props":2288,"children":2289},{"style":406},[2290],{"type":65,"value":2291},"!,\n",{"type":60,"tag":372,"props":2293,"children":2294},{"class":374,"line":778},[2295,2299,2303],{"type":60,"tag":372,"props":2296,"children":2297},{"style":406},[2298],{"type":65,"value":858},{"type":60,"tag":372,"props":2300,"children":2301},{"style":417},[2302],{"type":65,"value":636},{"type":60,"tag":372,"props":2304,"children":2305},{"style":406},[2306],{"type":65,"value":867},{"type":60,"tag":372,"props":2308,"children":2309},{"class":374,"line":843},[2310],{"type":60,"tag":372,"props":2311,"children":2312},{"emptyLinePlaceholder":874},[2313],{"type":65,"value":877},{"type":60,"tag":372,"props":2315,"children":2316},{"class":374,"line":852},[2317,2321,2326,2330,2334,2338,2342],{"type":60,"tag":372,"props":2318,"children":2319},{"style":801},[2320],{"type":65,"value":1699},{"type":60,"tag":372,"props":2322,"children":2323},{"style":417},[2324],{"type":65,"value":2325}," runtime ",{"type":60,"tag":372,"props":2327,"children":2328},{"style":406},[2329],{"type":65,"value":1709},{"type":60,"tag":372,"props":2331,"children":2332},{"style":406},[2333],{"type":65,"value":1827},{"type":60,"tag":372,"props":2335,"children":2336},{"style":790},[2337],{"type":65,"value":2178},{"type":60,"tag":372,"props":2339,"children":2340},{"style":417},[2341],{"type":65,"value":798},{"type":60,"tag":372,"props":2343,"children":2344},{"style":406},[2345],{"type":65,"value":1722},{"type":60,"tag":372,"props":2347,"children":2348},{"class":374,"line":870},[2349],{"type":60,"tag":372,"props":2350,"children":2351},{"style":745},[2352],{"type":65,"value":2353},"  \u002F\u002F A Channel supplies its own agent, so runtime-hosted agents are optional here.\n",{"type":60,"tag":372,"props":2355,"children":2356},{"class":374,"line":880},[2357,2362,2366],{"type":60,"tag":372,"props":2358,"children":2359},{"style":1744},[2360],{"type":65,"value":2361},"  agents",{"type":60,"tag":372,"props":2363,"children":2364},{"style":406},[2365],{"type":65,"value":1752},{"type":60,"tag":372,"props":2367,"children":2368},{"style":406},[2369],{"type":65,"value":2370}," {},\n",{"type":60,"tag":372,"props":2372,"children":2373},{"class":374,"line":889},[2374,2379],{"type":60,"tag":372,"props":2375,"children":2376},{"style":417},[2377],{"type":65,"value":2378},"  intelligence",{"type":60,"tag":372,"props":2380,"children":2381},{"style":406},[2382],{"type":65,"value":1770},{"type":60,"tag":372,"props":2384,"children":2385},{"class":374,"line":898},[2386,2391,2395,2399,2404,2408,2412,2417,2422],{"type":60,"tag":372,"props":2387,"children":2388},{"style":790},[2389],{"type":65,"value":2390},"  identifyUser",{"type":60,"tag":372,"props":2392,"children":2393},{"style":406},[2394],{"type":65,"value":1752},{"type":60,"tag":372,"props":2396,"children":2397},{"style":406},[2398],{"type":65,"value":1787},{"type":60,"tag":372,"props":2400,"children":2401},{"style":812},[2402],{"type":65,"value":2403},"request",{"type":60,"tag":372,"props":2405,"children":2406},{"style":406},[2407],{"type":65,"value":636},{"type":60,"tag":372,"props":2409,"children":2410},{"style":801},[2411],{"type":65,"value":835},{"type":60,"tag":372,"props":2413,"children":2414},{"style":790},[2415],{"type":65,"value":2416}," resolveUserFromSession",{"type":60,"tag":372,"props":2418,"children":2419},{"style":417},[2420],{"type":65,"value":2421},"(request)",{"type":60,"tag":372,"props":2423,"children":2424},{"style":406},[2425],{"type":65,"value":1770},{"type":60,"tag":372,"props":2427,"children":2428},{"class":374,"line":961},[2429,2434,2438,2443],{"type":60,"tag":372,"props":2430,"children":2431},{"style":1744},[2432],{"type":65,"value":2433},"  channels",{"type":60,"tag":372,"props":2435,"children":2436},{"style":406},[2437],{"type":65,"value":1752},{"type":60,"tag":372,"props":2439,"children":2440},{"style":417},[2441],{"type":65,"value":2442}," [support]",{"type":60,"tag":372,"props":2444,"children":2445},{"style":406},[2446],{"type":65,"value":1770},{"type":60,"tag":372,"props":2448,"children":2449},{"class":374,"line":969},[2450,2454,2458],{"type":60,"tag":372,"props":2451,"children":2452},{"style":406},[2453],{"type":65,"value":858},{"type":60,"tag":372,"props":2455,"children":2456},{"style":417},[2457],{"type":65,"value":636},{"type":60,"tag":372,"props":2459,"children":2460},{"style":406},[2461],{"type":65,"value":867},{"type":60,"tag":335,"props":2463,"children":2465},{"id":2464},"step-4-mount-a-long-running-host",[2466],{"type":65,"value":2467},"Step 4: Mount a long-running host",{"type":60,"tag":361,"props":2469,"children":2471},{"className":734,"code":2470,"language":47,"meta":366,"style":366},"import { createServer } from \"node:http\";\nimport { createCopilotNodeListener } from \"@copilotkit\u002Fruntime\u002Fv2\u002Fnode\";\n\nconst listener = createCopilotNodeListener({\n  runtime,\n  basePath: \"\u002Fapi\u002Fcopilotkit\",\n});\n\ncreateServer(listener).listen(Number(process.env.PORT ?? 8300));\n\n\u002F\u002F Optional on this mount, and worth doing: it turns a failed activation into a\n\u002F\u002F startup failure instead of a line in the logs.\nawait listener.channels.ready({ timeoutMs: 30_000 });\n",[2472],{"type":60,"tag":94,"props":2473,"children":2474},{"__ignoreMap":366},[2475,2516,2557,2564,2592,2604,2633,2648,2655,2728,2735,2743,2751],{"type":60,"tag":372,"props":2476,"children":2477},{"class":374,"line":375},[2478,2482,2486,2491,2495,2499,2503,2508,2512],{"type":60,"tag":372,"props":2479,"children":2480},{"style":1643},[2481],{"type":65,"value":1646},{"type":60,"tag":372,"props":2483,"children":2484},{"style":406},[2485],{"type":65,"value":1651},{"type":60,"tag":372,"props":2487,"children":2488},{"style":417},[2489],{"type":65,"value":2490}," createServer",{"type":60,"tag":372,"props":2492,"children":2493},{"style":406},[2494],{"type":65,"value":1661},{"type":60,"tag":372,"props":2496,"children":2497},{"style":1643},[2498],{"type":65,"value":1666},{"type":60,"tag":372,"props":2500,"children":2501},{"style":406},[2502],{"type":65,"value":1671},{"type":60,"tag":372,"props":2504,"children":2505},{"style":385},[2506],{"type":65,"value":2507},"node:http",{"type":60,"tag":372,"props":2509,"children":2510},{"style":406},[2511],{"type":65,"value":1680},{"type":60,"tag":372,"props":2513,"children":2514},{"style":406},[2515],{"type":65,"value":867},{"type":60,"tag":372,"props":2517,"children":2518},{"class":374,"line":751},[2519,2523,2527,2532,2536,2540,2544,2549,2553],{"type":60,"tag":372,"props":2520,"children":2521},{"style":1643},[2522],{"type":65,"value":1646},{"type":60,"tag":372,"props":2524,"children":2525},{"style":406},[2526],{"type":65,"value":1651},{"type":60,"tag":372,"props":2528,"children":2529},{"style":417},[2530],{"type":65,"value":2531}," createCopilotNodeListener",{"type":60,"tag":372,"props":2533,"children":2534},{"style":406},[2535],{"type":65,"value":1661},{"type":60,"tag":372,"props":2537,"children":2538},{"style":1643},[2539],{"type":65,"value":1666},{"type":60,"tag":372,"props":2541,"children":2542},{"style":406},[2543],{"type":65,"value":1671},{"type":60,"tag":372,"props":2545,"children":2546},{"style":385},[2547],{"type":65,"value":2548},"@copilotkit\u002Fruntime\u002Fv2\u002Fnode",{"type":60,"tag":372,"props":2550,"children":2551},{"style":406},[2552],{"type":65,"value":1680},{"type":60,"tag":372,"props":2554,"children":2555},{"style":406},[2556],{"type":65,"value":867},{"type":60,"tag":372,"props":2558,"children":2559},{"class":374,"line":760},[2560],{"type":60,"tag":372,"props":2561,"children":2562},{"emptyLinePlaceholder":874},[2563],{"type":65,"value":877},{"type":60,"tag":372,"props":2565,"children":2566},{"class":374,"line":769},[2567,2571,2576,2580,2584,2588],{"type":60,"tag":372,"props":2568,"children":2569},{"style":801},[2570],{"type":65,"value":1699},{"type":60,"tag":372,"props":2572,"children":2573},{"style":417},[2574],{"type":65,"value":2575}," listener ",{"type":60,"tag":372,"props":2577,"children":2578},{"style":406},[2579],{"type":65,"value":1709},{"type":60,"tag":372,"props":2581,"children":2582},{"style":790},[2583],{"type":65,"value":2531},{"type":60,"tag":372,"props":2585,"children":2586},{"style":417},[2587],{"type":65,"value":798},{"type":60,"tag":372,"props":2589,"children":2590},{"style":406},[2591],{"type":65,"value":1722},{"type":60,"tag":372,"props":2593,"children":2594},{"class":374,"line":778},[2595,2600],{"type":60,"tag":372,"props":2596,"children":2597},{"style":417},[2598],{"type":65,"value":2599},"  runtime",{"type":60,"tag":372,"props":2601,"children":2602},{"style":406},[2603],{"type":65,"value":1770},{"type":60,"tag":372,"props":2605,"children":2606},{"class":374,"line":843},[2607,2612,2616,2620,2625,2629],{"type":60,"tag":372,"props":2608,"children":2609},{"style":1744},[2610],{"type":65,"value":2611},"  basePath",{"type":60,"tag":372,"props":2613,"children":2614},{"style":406},[2615],{"type":65,"value":1752},{"type":60,"tag":372,"props":2617,"children":2618},{"style":406},[2619],{"type":65,"value":1671},{"type":60,"tag":372,"props":2621,"children":2622},{"style":385},[2623],{"type":65,"value":2624},"\u002Fapi\u002Fcopilotkit",{"type":60,"tag":372,"props":2626,"children":2627},{"style":406},[2628],{"type":65,"value":1680},{"type":60,"tag":372,"props":2630,"children":2631},{"style":406},[2632],{"type":65,"value":1770},{"type":60,"tag":372,"props":2634,"children":2635},{"class":374,"line":852},[2636,2640,2644],{"type":60,"tag":372,"props":2637,"children":2638},{"style":406},[2639],{"type":65,"value":858},{"type":60,"tag":372,"props":2641,"children":2642},{"style":417},[2643],{"type":65,"value":636},{"type":60,"tag":372,"props":2645,"children":2646},{"style":406},[2647],{"type":65,"value":867},{"type":60,"tag":372,"props":2649,"children":2650},{"class":374,"line":870},[2651],{"type":60,"tag":372,"props":2652,"children":2653},{"emptyLinePlaceholder":874},[2654],{"type":65,"value":877},{"type":60,"tag":372,"props":2656,"children":2657},{"class":374,"line":880},[2658,2663,2668,2672,2677,2681,2686,2691,2695,2699,2703,2708,2713,2719,2724],{"type":60,"tag":372,"props":2659,"children":2660},{"style":790},[2661],{"type":65,"value":2662},"createServer",{"type":60,"tag":372,"props":2664,"children":2665},{"style":417},[2666],{"type":65,"value":2667},"(listener)",{"type":60,"tag":372,"props":2669,"children":2670},{"style":406},[2671],{"type":65,"value":244},{"type":60,"tag":372,"props":2673,"children":2674},{"style":790},[2675],{"type":65,"value":2676},"listen",{"type":60,"tag":372,"props":2678,"children":2679},{"style":417},[2680],{"type":65,"value":798},{"type":60,"tag":372,"props":2682,"children":2683},{"style":790},[2684],{"type":65,"value":2685},"Number",{"type":60,"tag":372,"props":2687,"children":2688},{"style":417},[2689],{"type":65,"value":2690},"(process",{"type":60,"tag":372,"props":2692,"children":2693},{"style":406},[2694],{"type":65,"value":244},{"type":60,"tag":372,"props":2696,"children":2697},{"style":417},[2698],{"type":65,"value":2277},{"type":60,"tag":372,"props":2700,"children":2701},{"style":406},[2702],{"type":65,"value":244},{"type":60,"tag":372,"props":2704,"children":2705},{"style":417},[2706],{"type":65,"value":2707},"PORT ",{"type":60,"tag":372,"props":2709,"children":2710},{"style":406},[2711],{"type":65,"value":2712},"??",{"type":60,"tag":372,"props":2714,"children":2716},{"style":2715},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2717],{"type":65,"value":2718}," 8300",{"type":60,"tag":372,"props":2720,"children":2721},{"style":417},[2722],{"type":65,"value":2723},"))",{"type":60,"tag":372,"props":2725,"children":2726},{"style":406},[2727],{"type":65,"value":867},{"type":60,"tag":372,"props":2729,"children":2730},{"class":374,"line":889},[2731],{"type":60,"tag":372,"props":2732,"children":2733},{"emptyLinePlaceholder":874},[2734],{"type":65,"value":877},{"type":60,"tag":372,"props":2736,"children":2737},{"class":374,"line":898},[2738],{"type":60,"tag":372,"props":2739,"children":2740},{"style":745},[2741],{"type":65,"value":2742},"\u002F\u002F Optional on this mount, and worth doing: it turns a failed activation into a\n",{"type":60,"tag":372,"props":2744,"children":2745},{"class":374,"line":961},[2746],{"type":60,"tag":372,"props":2747,"children":2748},{"style":745},[2749],{"type":65,"value":2750},"\u002F\u002F startup failure instead of a line in the logs.\n",{"type":60,"tag":372,"props":2752,"children":2753},{"class":374,"line":969},[2754,2759,2764,2768,2772,2776,2781,2785,2790,2795,2799,2804,2808,2812],{"type":60,"tag":372,"props":2755,"children":2756},{"style":1643},[2757],{"type":65,"value":2758},"await",{"type":60,"tag":372,"props":2760,"children":2761},{"style":417},[2762],{"type":65,"value":2763}," listener",{"type":60,"tag":372,"props":2765,"children":2766},{"style":406},[2767],{"type":65,"value":244},{"type":60,"tag":372,"props":2769,"children":2770},{"style":417},[2771],{"type":65,"value":1487},{"type":60,"tag":372,"props":2773,"children":2774},{"style":406},[2775],{"type":65,"value":244},{"type":60,"tag":372,"props":2777,"children":2778},{"style":790},[2779],{"type":65,"value":2780},"ready",{"type":60,"tag":372,"props":2782,"children":2783},{"style":417},[2784],{"type":65,"value":798},{"type":60,"tag":372,"props":2786,"children":2787},{"style":406},[2788],{"type":65,"value":2789},"{",{"type":60,"tag":372,"props":2791,"children":2792},{"style":1744},[2793],{"type":65,"value":2794}," timeoutMs",{"type":60,"tag":372,"props":2796,"children":2797},{"style":406},[2798],{"type":65,"value":1752},{"type":60,"tag":372,"props":2800,"children":2801},{"style":2715},[2802],{"type":65,"value":2803}," 30_000",{"type":60,"tag":372,"props":2805,"children":2806},{"style":406},[2807],{"type":65,"value":1661},{"type":60,"tag":372,"props":2809,"children":2810},{"style":417},[2811],{"type":65,"value":636},{"type":60,"tag":372,"props":2813,"children":2814},{"style":406},[2815],{"type":65,"value":867},{"type":60,"tag":2817,"props":2818,"children":2820},"h4",{"id":2819},"whether-you-must-call-ready-depends-on-the-mount",[2821,2823,2828],{"type":65,"value":2822},"Whether you must call ",{"type":60,"tag":94,"props":2824,"children":2826},{"className":2825},[],[2827],{"type":65,"value":1154},{"type":65,"value":2829}," depends on the mount",{"type":60,"tag":68,"props":2831,"children":2832},{},[2833,2835,2839],{"type":65,"value":2834},"This is the single most misunderstood thing about Channels. Activation is ",{"type":60,"tag":86,"props":2836,"children":2837},{},[2838],{"type":65,"value":111},{"type":65,"value":2840}," lazy everywhere.",{"type":60,"tag":187,"props":2842,"children":2843},{},[2844,2872],{"type":60,"tag":191,"props":2845,"children":2846},{},[2847],{"type":60,"tag":195,"props":2848,"children":2849},{},[2850,2855,2860],{"type":60,"tag":199,"props":2851,"children":2852},{},[2853],{"type":65,"value":2854},"Mount",{"type":60,"tag":199,"props":2856,"children":2857},{},[2858],{"type":65,"value":2859},"Activation",{"type":60,"tag":199,"props":2861,"children":2862},{},[2863,2865,2870],{"type":65,"value":2864},"Is ",{"type":60,"tag":94,"props":2866,"children":2868},{"className":2867},[],[2869],{"type":65,"value":1154},{"type":65,"value":2871}," required?",{"type":60,"tag":210,"props":2873,"children":2874},{},[2875,2897,2918,2948,2978],{"type":60,"tag":195,"props":2876,"children":2877},{},[2878,2887,2892],{"type":60,"tag":217,"props":2879,"children":2880},{},[2881],{"type":60,"tag":94,"props":2882,"children":2884},{"className":2883},[],[2885],{"type":65,"value":2886},"createCopilotNodeListener",{"type":60,"tag":217,"props":2888,"children":2889},{},[2890],{"type":65,"value":2891},"Starts when the listener is created",{"type":60,"tag":217,"props":2893,"children":2894},{},[2895],{"type":65,"value":2896},"No — await it to observe",{"type":60,"tag":195,"props":2898,"children":2899},{},[2900,2909,2914],{"type":60,"tag":217,"props":2901,"children":2902},{},[2903],{"type":60,"tag":94,"props":2904,"children":2906},{"className":2905},[],[2907],{"type":65,"value":2908},"createCopilotExpressHandler",{"type":60,"tag":217,"props":2910,"children":2911},{},[2912],{"type":65,"value":2913},"Starts when the router is created",{"type":60,"tag":217,"props":2915,"children":2916},{},[2917],{"type":65,"value":2896},{"type":60,"tag":195,"props":2919,"children":2920},{},[2921,2930,2940],{"type":60,"tag":217,"props":2922,"children":2923},{},[2924],{"type":60,"tag":94,"props":2925,"children":2927},{"className":2926},[],[2928],{"type":65,"value":2929},"createCopilotHonoHandler",{"type":60,"tag":217,"props":2931,"children":2932},{},[2933,2935],{"type":65,"value":2934},"Deferred to the first ",{"type":60,"tag":94,"props":2936,"children":2938},{"className":2937},[],[2939],{"type":65,"value":1154},{"type":60,"tag":217,"props":2941,"children":2942},{},[2943],{"type":60,"tag":86,"props":2944,"children":2945},{},[2946],{"type":65,"value":2947},"Yes",{"type":60,"tag":195,"props":2949,"children":2950},{},[2951,2962,2971],{"type":60,"tag":217,"props":2952,"children":2953},{},[2954,2960],{"type":60,"tag":94,"props":2955,"children":2957},{"className":2956},[],[2958],{"type":65,"value":2959},"createCopilotRuntimeHandler",{"type":65,"value":2961}," (generic fetch)",{"type":60,"tag":217,"props":2963,"children":2964},{},[2965,2966],{"type":65,"value":2934},{"type":60,"tag":94,"props":2967,"children":2969},{"className":2968},[],[2970],{"type":65,"value":1154},{"type":60,"tag":217,"props":2972,"children":2973},{},[2974],{"type":60,"tag":86,"props":2975,"children":2976},{},[2977],{"type":65,"value":2947},{"type":60,"tag":195,"props":2979,"children":2980},{},[2981,2991,2996],{"type":60,"tag":217,"props":2982,"children":2983},{},[2984,2986],{"type":65,"value":2985},"any mount with ",{"type":60,"tag":94,"props":2987,"children":2989},{"className":2988},[],[2990],{"type":65,"value":1146},{"type":60,"tag":217,"props":2992,"children":2993},{},[2994],{"type":65,"value":2995},"None; no control surface, no socket",{"type":60,"tag":217,"props":2997,"children":2998},{},[2999],{"type":65,"value":3000},"Nothing will connect",{"type":60,"tag":68,"props":3002,"children":3003},{},[3004],{"type":65,"value":3005},"The two lifecycle-owning wrappers start on their own because they own their process lifetime — a declared Channel connects because it was declared, and there is no incantation to forget. The fetch and hono handlers defer on purpose: they are the serverless and edge entry points, where an isolate freezes and recycles per request and separate cold starts would mint competing listeners for the same Channel.",{"type":60,"tag":68,"props":3007,"children":3008},{},[3009,3011,3016,3018,3023,3025,3030],{"type":65,"value":3010},"So the silent failure — a process that serves HTTP, looks healthy, and answers nothing — happens on a ",{"type":60,"tag":86,"props":3012,"children":3013},{},[3014],{"type":65,"value":3015},"deferring",{"type":65,"value":3017}," mount when nothing ever calls ",{"type":60,"tag":94,"props":3019,"children":3021},{"className":3020},[],[3022],{"type":65,"value":1154},{"type":65,"value":3024},". On a node or express host, a missing ",{"type":60,"tag":94,"props":3026,"children":3028},{"className":3027},[],[3029],{"type":65,"value":1154},{"type":65,"value":3031}," is not that failure.",{"type":60,"tag":68,"props":3033,"children":3034},{},[3035],{"type":65,"value":3036},"Two details either way:",{"type":60,"tag":347,"props":3038,"children":3039},{},[3040,3073],{"type":60,"tag":287,"props":3041,"children":3042},{},[3043,3048,3050,3055,3057,3063,3065,3071],{"type":60,"tag":94,"props":3044,"children":3046},{"className":3045},[],[3047],{"type":65,"value":1154},{"type":65,"value":3049}," is ",{"type":60,"tag":86,"props":3051,"children":3052},{},[3053],{"type":65,"value":3054},"one-shot",{"type":65,"value":3056}," and idempotent. It settles on the initial activation outcome, so awaiting it after an auto-start observes that activation rather than triggering a second one. It can resolve as ",{"type":60,"tag":94,"props":3058,"children":3060},{"className":3059},[],[3061],{"type":65,"value":3062},"setup_required",{"type":65,"value":3064},", which means activation settled — not that delivery is healthy. Treat only ",{"type":60,"tag":94,"props":3066,"children":3068},{"className":3067},[],[3069],{"type":65,"value":3070},"status().overall === \"online\"",{"type":65,"value":3072}," as connected.",{"type":60,"tag":287,"props":3074,"children":3075},{},[3076,3078],{"type":65,"value":3077},"Pair activation with shutdown so a redeploy releases the connection cleanly:",{"type":60,"tag":361,"props":3079,"children":3081},{"className":734,"code":3080,"language":47,"meta":366,"style":366},"process.on(\"SIGTERM\", async () => {\n  await listener.channels.stop();\n  process.exit(0);\n});\n",[3082],{"type":60,"tag":94,"props":3083,"children":3084},{"__ignoreMap":366},[3085,3141,3177,3211],{"type":60,"tag":372,"props":3086,"children":3087},{"class":374,"line":375},[3088,3093,3097,3102,3106,3110,3115,3119,3123,3128,3133,3137],{"type":60,"tag":372,"props":3089,"children":3090},{"style":417},[3091],{"type":65,"value":3092},"process",{"type":60,"tag":372,"props":3094,"children":3095},{"style":406},[3096],{"type":65,"value":244},{"type":60,"tag":372,"props":3098,"children":3099},{"style":790},[3100],{"type":65,"value":3101},"on",{"type":60,"tag":372,"props":3103,"children":3104},{"style":417},[3105],{"type":65,"value":798},{"type":60,"tag":372,"props":3107,"children":3108},{"style":406},[3109],{"type":65,"value":1680},{"type":60,"tag":372,"props":3111,"children":3112},{"style":385},[3113],{"type":65,"value":3114},"SIGTERM",{"type":60,"tag":372,"props":3116,"children":3117},{"style":406},[3118],{"type":65,"value":1680},{"type":60,"tag":372,"props":3120,"children":3121},{"style":406},[3122],{"type":65,"value":820},{"type":60,"tag":372,"props":3124,"children":3125},{"style":801},[3126],{"type":65,"value":3127}," async",{"type":60,"tag":372,"props":3129,"children":3130},{"style":406},[3131],{"type":65,"value":3132}," ()",{"type":60,"tag":372,"props":3134,"children":3135},{"style":801},[3136],{"type":65,"value":835},{"type":60,"tag":372,"props":3138,"children":3139},{"style":406},[3140],{"type":65,"value":840},{"type":60,"tag":372,"props":3142,"children":3143},{"class":374,"line":751},[3144,3148,3152,3156,3160,3164,3169,3173],{"type":60,"tag":372,"props":3145,"children":3146},{"style":1643},[3147],{"type":65,"value":1977},{"type":60,"tag":372,"props":3149,"children":3150},{"style":417},[3151],{"type":65,"value":2763},{"type":60,"tag":372,"props":3153,"children":3154},{"style":406},[3155],{"type":65,"value":244},{"type":60,"tag":372,"props":3157,"children":3158},{"style":417},[3159],{"type":65,"value":1487},{"type":60,"tag":372,"props":3161,"children":3162},{"style":406},[3163],{"type":65,"value":244},{"type":60,"tag":372,"props":3165,"children":3166},{"style":790},[3167],{"type":65,"value":3168},"stop",{"type":60,"tag":372,"props":3170,"children":3171},{"style":1744},[3172],{"type":65,"value":1837},{"type":60,"tag":372,"props":3174,"children":3175},{"style":406},[3176],{"type":65,"value":867},{"type":60,"tag":372,"props":3178,"children":3179},{"class":374,"line":760},[3180,3185,3189,3194,3198,3203,3207],{"type":60,"tag":372,"props":3181,"children":3182},{"style":417},[3183],{"type":65,"value":3184},"  process",{"type":60,"tag":372,"props":3186,"children":3187},{"style":406},[3188],{"type":65,"value":244},{"type":60,"tag":372,"props":3190,"children":3191},{"style":790},[3192],{"type":65,"value":3193},"exit",{"type":60,"tag":372,"props":3195,"children":3196},{"style":1744},[3197],{"type":65,"value":798},{"type":60,"tag":372,"props":3199,"children":3200},{"style":2715},[3201],{"type":65,"value":3202},"0",{"type":60,"tag":372,"props":3204,"children":3205},{"style":1744},[3206],{"type":65,"value":636},{"type":60,"tag":372,"props":3208,"children":3209},{"style":406},[3210],{"type":65,"value":867},{"type":60,"tag":372,"props":3212,"children":3213},{"class":374,"line":769},[3214,3218,3222],{"type":60,"tag":372,"props":3215,"children":3216},{"style":406},[3217],{"type":65,"value":858},{"type":60,"tag":372,"props":3219,"children":3220},{"style":417},[3221],{"type":65,"value":636},{"type":60,"tag":372,"props":3223,"children":3224},{"style":406},[3225],{"type":65,"value":867},{"type":60,"tag":335,"props":3227,"children":3229},{"id":3228},"deployment-shape",[3230],{"type":65,"value":3231},"Deployment shape",{"type":60,"tag":68,"props":3233,"children":3234},{},[3235,3237,3241,3243,3249],{"type":65,"value":3236},"Deciding whether the project already has a long-running host is the judgement this skill exists to make. Detect the framework first (see the ",{"type":60,"tag":86,"props":3238,"children":3239},{},[3240],{"type":65,"value":1524},{"type":65,"value":3242}," skill's ",{"type":60,"tag":94,"props":3244,"children":3246},{"className":3245},[],[3247],{"type":65,"value":3248},"references\u002Fframework-detection.md",{"type":65,"value":3250},"), then:",{"type":60,"tag":187,"props":3252,"children":3253},{},[3254,3270],{"type":60,"tag":191,"props":3255,"children":3256},{},[3257],{"type":60,"tag":195,"props":3258,"children":3259},{},[3260,3265],{"type":60,"tag":199,"props":3261,"children":3262},{},[3263],{"type":65,"value":3264},"What the project runs today",{"type":60,"tag":199,"props":3266,"children":3267},{},[3268],{"type":65,"value":3269},"What to do",{"type":60,"tag":210,"props":3271,"children":3272},{},[3273,3286,3306],{"type":60,"tag":195,"props":3274,"children":3275},{},[3276,3281],{"type":60,"tag":217,"props":3277,"children":3278},{},[3279],{"type":65,"value":3280},"A standalone Node\u002FExpress\u002FHono server",{"type":60,"tag":217,"props":3282,"children":3283},{},[3284],{"type":65,"value":3285},"Declare the Channel on the runtime it already has",{"type":60,"tag":195,"props":3287,"children":3288},{},[3289,3294],{"type":60,"tag":217,"props":3290,"children":3291},{},[3292],{"type":65,"value":3293},"Next.js on Vercel, Lambda, or an edge function",{"type":60,"tag":217,"props":3295,"children":3296},{},[3297,3299,3304],{"type":65,"value":3298},"Add a ",{"type":60,"tag":86,"props":3300,"children":3301},{},[3302],{"type":65,"value":3303},"separate",{"type":65,"value":3305}," long-running process for the Channel",{"type":60,"tag":195,"props":3307,"children":3308},{},[3309,3314],{"type":60,"tag":217,"props":3310,"children":3311},{},[3312],{"type":65,"value":3313},"A Python or .NET agent",{"type":60,"tag":217,"props":3315,"children":3316},{},[3317],{"type":65,"value":3318},"Leave it alone; add a small TypeScript channel host that proxies",{"type":60,"tag":68,"props":3320,"children":3321},{},[3322,3324,3328],{"type":65,"value":3323},"A separate process is ",{"type":60,"tag":86,"props":3325,"children":3326},{},[3327],{"type":65,"value":111},{"type":65,"value":3329}," mandated. If the project already runs a long-running runtime — one serving a React UI, for instance — that same runtime can declare Channels. A second process is required only when the existing runtime is serverless.",{"type":60,"tag":68,"props":3331,"children":3332},{},[3333,3335,3340],{"type":65,"value":3334},"When a separate host is needed, it is a small program: the runtime, the Channel, and the awaited ready call. It does not need to serve the UI, and it does not need an HTTP server at all — nothing calls it. The gateway connection is outbound, and holding it open is what keeps the process alive. The scaffolded ",{"type":60,"tag":94,"props":3336,"children":3338},{"className":3337},[],[3339],{"type":65,"value":183},{"type":65,"value":3341}," is exactly this, and is worth reading as the reference implementation even when writing one by hand.",{"type":60,"tag":74,"props":3343,"children":3345},{"id":3344},"never-do-these",[3346],{"type":65,"value":3347},"Never do these",{"type":60,"tag":347,"props":3349,"children":3350},{},[3351,3361,3371,3388,3411,3428,3444,3454,3464],{"type":60,"tag":287,"props":3352,"children":3353},{},[3354,3359],{"type":60,"tag":86,"props":3355,"children":3356},{},[3357],{"type":65,"value":3358},"Do not write provider credentials into the project",{"type":65,"value":3360}," for a managed Channel. Intelligence stores them server-side; the runtime never reads them. If the project holds a Slack bot token for a managed Channel, something is wired wrong.",{"type":60,"tag":287,"props":3362,"children":3363},{},[3364,3369],{"type":60,"tag":86,"props":3365,"children":3366},{},[3367],{"type":65,"value":3368},"Do not put a Channel on a serverless route handler.",{"type":65,"value":3370}," It will appear to deploy and never connect.",{"type":60,"tag":287,"props":3372,"children":3373},{},[3374,3386],{"type":60,"tag":86,"props":3375,"children":3376},{},[3377,3379,3384],{"type":65,"value":3378},"Do not assume ",{"type":60,"tag":94,"props":3380,"children":3382},{"className":3381},[],[3383],{"type":65,"value":1154},{"type":65,"value":3385}," is required, or that it is optional.",{"type":65,"value":3387}," Check the mount. Telling someone to add a call they do not need is as unhelpful as omitting one they do.",{"type":60,"tag":287,"props":3389,"children":3390},{},[3391,3409],{"type":60,"tag":86,"props":3392,"children":3393},{},[3394,3396,3401,3403,3408],{"type":65,"value":3395},"Do not pass ",{"type":60,"tag":94,"props":3397,"children":3399},{"className":3398},[],[3400],{"type":65,"value":1170},{"type":65,"value":3402}," alongside ",{"type":60,"tag":94,"props":3404,"children":3406},{"className":3405},[],[3407],{"type":65,"value":1162},{"type":65,"value":244},{"type":65,"value":3410}," That is what silently keeps threads in memory.",{"type":60,"tag":287,"props":3412,"children":3413},{},[3414,3419,3421,3426],{"type":60,"tag":86,"props":3415,"children":3416},{},[3417],{"type":65,"value":3418},"Do not hand-wire a Channel into a scaffolded project.",{"type":65,"value":3420}," If ",{"type":60,"tag":94,"props":3422,"children":3424},{"className":3423},[],[3425],{"type":65,"value":183},{"type":65,"value":3427}," is present the code half is done; adding a second declaration stops the host from booting rather than adding a bot.",{"type":60,"tag":287,"props":3429,"children":3430},{},[3431,3436,3438,3443],{"type":60,"tag":86,"props":3432,"children":3433},{},[3434],{"type":65,"value":3435},"Do not invent Channel infrastructure ids.",{"type":65,"value":3437}," Project, adapter, and channel ids are derived from the Intelligence config plus the Channel ",{"type":60,"tag":94,"props":3439,"children":3441},{"className":3440},[],[3442],{"type":65,"value":1628},{"type":65,"value":244},{"type":60,"tag":287,"props":3445,"children":3446},{},[3447,3452],{"type":60,"tag":86,"props":3448,"children":3449},{},[3450],{"type":65,"value":3451},"Do not send Teams icon or package bytes through Intelligence.",{"type":65,"value":3453}," Browser-generated artifacts stay local to the active attempt and are discarded afterward.",{"type":60,"tag":287,"props":3455,"children":3456},{},[3457,3462],{"type":60,"tag":86,"props":3458,"children":3459},{},[3460],{"type":65,"value":3461},"Do not use Azure Bot for normal managed Teams setup.",{"type":65,"value":3463}," The launch path is Teams Developer Portal plus Entra, or the Teams-managed Fast CLI path.",{"type":60,"tag":287,"props":3465,"children":3466},{},[3467,3472],{"type":60,"tag":86,"props":3468,"children":3469},{},[3470],{"type":65,"value":3471},"Do not call a Teams Channel working because setup says Created and installed.",{"type":65,"value":3473}," Provider completion and runtime\u002Fmessage health are separate axes.",{"type":60,"tag":3475,"props":3476,"children":3477},"style",{},[3478],{"type":65,"value":3479},"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":3481,"total":969},[3482,3499,3517,3524,3541,3553,3566],{"slug":3483,"name":3483,"fn":3484,"description":3485,"org":3486,"tags":3487,"stars":23,"repoUrl":24,"updatedAt":3498},"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},[3488,3489,3492,3495],{"name":9,"slug":8,"type":13},{"name":3490,"slug":3491,"type":13},"Design","design",{"name":3493,"slug":3494,"type":13},"Frontend","frontend",{"name":3496,"slug":3497,"type":13},"UI Components","ui-components","2026-07-12T08:06:36.722091",{"slug":3500,"name":3500,"fn":3501,"description":3502,"org":3503,"tags":3504,"stars":23,"repoUrl":24,"updatedAt":3516},"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},[3505,3506,3509,3512,3513],{"name":18,"slug":19,"type":13},{"name":3507,"slug":3508,"type":13},"API Development","api-development",{"name":3510,"slug":3511,"type":13},"Backend","backend",{"name":9,"slug":8,"type":13},{"name":3514,"slug":3515,"type":13},"Debugging","debugging","2026-07-12T08:06:22.179755",{"slug":4,"name":4,"fn":5,"description":6,"org":3518,"tags":3519,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3520,3521,3522,3523],{"name":18,"slug":19,"type":13},{"name":9,"slug":8,"type":13},{"name":15,"slug":16,"type":13},{"name":21,"slug":22,"type":13},{"slug":3525,"name":3525,"fn":3526,"description":3527,"org":3528,"tags":3529,"stars":23,"repoUrl":24,"updatedAt":3540},"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},[3530,3531,3534,3537],{"name":9,"slug":8,"type":13},{"name":3532,"slug":3533,"type":13},"Engineering","engineering",{"name":3535,"slug":3536,"type":13},"GitHub","github",{"name":3538,"slug":3539,"type":13},"Pull Requests","pull-requests","2026-07-12T08:06:30.102192",{"slug":3542,"name":3542,"fn":3543,"description":3544,"org":3545,"tags":3546,"stars":23,"repoUrl":24,"updatedAt":3552},"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},[3547,3548,3549],{"name":9,"slug":8,"type":13},{"name":3514,"slug":3515,"type":13},{"name":3550,"slug":3551,"type":13},"Observability","observability","2026-07-12T08:06:23.407872",{"slug":3554,"name":3554,"fn":3555,"description":3556,"org":3557,"tags":3558,"stars":23,"repoUrl":24,"updatedAt":3565},"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},[3559,3560,3563,3564],{"name":18,"slug":19,"type":13},{"name":3561,"slug":3562,"type":13},"AI Context","ai-context",{"name":9,"slug":8,"type":13},{"name":3493,"slug":3494,"type":13},"2026-07-12T08:06:28.856644",{"slug":3567,"name":3567,"fn":3568,"description":3569,"org":3570,"tags":3571,"stars":23,"repoUrl":24,"updatedAt":3578},"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},[3572,3573,3574,3575],{"name":18,"slug":19,"type":13},{"name":3507,"slug":3508,"type":13},{"name":9,"slug":8,"type":13},{"name":3576,"slug":3577,"type":13},"Integrations","integrations","2026-07-12T08:06:32.560054",{"items":3580,"total":2001},[3581,3588,3596,3603,3610,3616,3623,3630,3644,3655,3667,3682],{"slug":3483,"name":3483,"fn":3484,"description":3485,"org":3582,"tags":3583,"stars":23,"repoUrl":24,"updatedAt":3498},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3584,3585,3586,3587],{"name":9,"slug":8,"type":13},{"name":3490,"slug":3491,"type":13},{"name":3493,"slug":3494,"type":13},{"name":3496,"slug":3497,"type":13},{"slug":3500,"name":3500,"fn":3501,"description":3502,"org":3589,"tags":3590,"stars":23,"repoUrl":24,"updatedAt":3516},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3591,3592,3593,3594,3595],{"name":18,"slug":19,"type":13},{"name":3507,"slug":3508,"type":13},{"name":3510,"slug":3511,"type":13},{"name":9,"slug":8,"type":13},{"name":3514,"slug":3515,"type":13},{"slug":4,"name":4,"fn":5,"description":6,"org":3597,"tags":3598,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3599,3600,3601,3602],{"name":18,"slug":19,"type":13},{"name":9,"slug":8,"type":13},{"name":15,"slug":16,"type":13},{"name":21,"slug":22,"type":13},{"slug":3525,"name":3525,"fn":3526,"description":3527,"org":3604,"tags":3605,"stars":23,"repoUrl":24,"updatedAt":3540},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3606,3607,3608,3609],{"name":9,"slug":8,"type":13},{"name":3532,"slug":3533,"type":13},{"name":3535,"slug":3536,"type":13},{"name":3538,"slug":3539,"type":13},{"slug":3542,"name":3542,"fn":3543,"description":3544,"org":3611,"tags":3612,"stars":23,"repoUrl":24,"updatedAt":3552},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3613,3614,3615],{"name":9,"slug":8,"type":13},{"name":3514,"slug":3515,"type":13},{"name":3550,"slug":3551,"type":13},{"slug":3554,"name":3554,"fn":3555,"description":3556,"org":3617,"tags":3618,"stars":23,"repoUrl":24,"updatedAt":3565},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3619,3620,3621,3622],{"name":18,"slug":19,"type":13},{"name":3561,"slug":3562,"type":13},{"name":9,"slug":8,"type":13},{"name":3493,"slug":3494,"type":13},{"slug":3567,"name":3567,"fn":3568,"description":3569,"org":3624,"tags":3625,"stars":23,"repoUrl":24,"updatedAt":3578},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3626,3627,3628,3629],{"name":18,"slug":19,"type":13},{"name":3507,"slug":3508,"type":13},{"name":9,"slug":8,"type":13},{"name":3576,"slug":3577,"type":13},{"slug":3631,"name":3631,"fn":3632,"description":3633,"org":3634,"tags":3635,"stars":23,"repoUrl":24,"updatedAt":3643},"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},[3636,3637,3640],{"name":9,"slug":8,"type":13},{"name":3638,"slug":3639,"type":13},"Documentation","documentation",{"name":3641,"slug":3642,"type":13},"Productivity","productivity","2026-07-12T08:06:31.345052",{"slug":1524,"name":1524,"fn":3645,"description":3646,"org":3647,"tags":3648,"stars":23,"repoUrl":24,"updatedAt":3654},"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 (managed Intelligence or self-hosted SSE), provider setup, and first working chat integration.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[3649,3650,3651],{"name":9,"slug":8,"type":13},{"name":3493,"slug":3494,"type":13},{"name":3652,"slug":3653,"type":13},"Onboarding","onboarding","2026-08-04T05:33:37.053218",{"slug":3656,"name":3656,"fn":3657,"description":3658,"org":3659,"tags":3660,"stars":23,"repoUrl":24,"updatedAt":3666},"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},[3661,3662,3663],{"name":9,"slug":8,"type":13},{"name":3532,"slug":3533,"type":13},{"name":3664,"slug":3665,"type":13},"Migration","migration","2026-07-12T08:06:26.949801",{"slug":3668,"name":3668,"fn":3669,"description":3670,"org":3671,"tags":3672,"stars":23,"repoUrl":24,"updatedAt":3681},"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},[3673,3674,3675,3678,3680],{"name":9,"slug":8,"type":13},{"name":3493,"slug":3494,"type":13},{"name":3676,"slug":3677,"type":13},"Next.js","next-js",{"name":3679,"slug":44,"type":13},"React",{"name":3496,"slug":3497,"type":13},"2026-07-12T08:06:15.72619",{"slug":3683,"name":3683,"fn":3684,"description":3685,"org":3686,"tags":3687,"stars":23,"repoUrl":24,"updatedAt":3696},"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},[3688,3689,3690,3693],{"name":3510,"slug":3511,"type":13},{"name":9,"slug":8,"type":13},{"name":3691,"slug":3692,"type":13},"JavaScript","javascript",{"name":3694,"slug":3695,"type":13},"Middleware","middleware","2026-07-12T08:06:10.034875"]