@copilotkit/channels

中文文档
0.12.0发布于 2026/10/28MITTypeScriptES Module构建来源已验证近 30 天下载 4.8万

包括电池的副驾驶Kit 带有核心引擎JSX UI的Channels软件包,以及每一个被支持的平台适配器.

中文使用文档

@ copilotkit/ 频道

@copilotkit/channels 是包含电池的 CopilotKit Channels 软件包。 一个安装 提供引擎,JSX词汇,UI原始,测试API,以及每个被支持的适配器.

频道通过频道跑道运行. 副驾驶Kit情报部门提供 管理下跑者,可在自由计划中使用: CopilotRuntime 开始和拥有 每个频道的生命周期,一旦配置智能。 你也可以建造和 在SDK原始版下层操作自己的频道跑取器,没有 情报依赖——一个支持路径,你的团队拥有状态, 持久性、货币性、锁定性、再试和种族条件处理.

安装

pnpm add @copilotkit/channels

配置 TypeScript 用于频道 JSX 运行时间 :

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "@copilotkit/channels"
  }
}
import { createChannel, Message, Section } from "@copilotkit/channels";
import { slack } from "@copilotkit/channels/slack";
import { CopilotRuntime, CopilotKitIntelligence } from "@copilotkit/runtime/v2";
import { createCopilotNodeListener } from "@copilotkit/runtime/v2/node";

const channel = createChannel({
  name: "support-bot", // project-unique Intelligence Channel name
  identifyUser: "platform",
  adapters: [
    slack({
      botToken: process.env.SLACK_BOT_TOKEN!,
      appToken: process.env.SLACK_APP_TOKEN!,
    }),
  ],
});

channel.onMessage(({ thread, message }) =>
  thread.post(
    <Message>
      <Section>Echo: {message.text}</Section>
    </Message>,
  ),
);

// The runtime owns the Channel's lifecycle — there is no `channel.start()`.
const runtime = new CopilotRuntime({
  intelligence: new CopilotKitIntelligence({
    // apiUrl and wsUrl default to cloud-hosted CopilotKit Intelligence — override
    // both together only for a self-hosted deployment.
    apiKey: process.env.CPK_INTELLIGENCE_API_KEY!, // free tier available
  }),
  channels: [channel],
});

// Creating the listener starts the Channel's connection.
const listener = createCopilotNodeListener({ runtime });
// Optional: await that activation so a broken config fails startup loudly.
await listener.channels.ready(); // listener.channels.stop() tears it down

适应器切入点

  • @copilotkit/channels/slack (单位:千美元) /slack/codec 财务报告和审定财务报表 /slack/render(中文(简体) )
  • @copilotkit/channels/teams (单位:千美元) /teams/render(中文(简体) )
  • @copilotkit/channels/discord
  • @copilotkit/channels/whatsapp

一个软件包版本给你一个测试过的核心引擎快照 JSX/UI词汇, 测试辅助器,以及上面列出的所有适配器.

@copilotkit/channels/teams 需要微软365代理SDK,这是一个 可选同伴依赖 而不为您安装

pnpm add @microsoft/agents-hosting @microsoft/agents-activity

只有自办的团队适配器需要它. @copilotkit/channels/teams/render 没有,这就是为什么SDK 远离从未运行过团队的安装 内入. express 也是可选的对等器, 懒散地装入, 只需要由 内置 createTeamsServer 听着.

对于适配器作者或选择性依赖性图表,安装 @copilotkit/channels-core 加您需要的直接适配软件包,例如:

pnpm add @copilotkit/channels-core @copilotkit/channels-slack

版本与发布记录

@copilotkit/channels 共发布 43 个版本,首次发布于 2026/07/09;过去 12 个月发布了 43 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.12.0latest2026/10/2813 天前
0.11.12026/10/1625 天前
0.11.02026/09/231 个月前
0.10.02026/09/151 个月前
0.9.22026/09/032 个月前
0.9.02026/08/152 个月前

其他发布通道:canary → 0.7.3-canary.1785878925。

关于 @copilotkit/channels 的常见问题

@copilotkit/channels 是什么?

包括电池的副驾驶Kit 带有核心引擎JSX UI的Channels软件包,以及每一个被支持的平台适配器.

如何安装 @copilotkit/channels?

在项目目录运行 npm install @copilotkit/channels,或使用 pnpm add / yarn add / bun add。

@copilotkit/channels 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@copilotkit/channels 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@copilotkit/channels 可以商用吗?

@copilotkit/channels 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@copilotkit/channels 的下载量有多少?

根据 npm 官方下载统计,@copilotkit/channels 在 2026/10/11 – 2026/11/09 这 30 天内被下载 48,262 次,日均约 1,609 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@copilotkit/channels 还在维护吗?

最新版本 0.12.0 发布于 2026/10/28(13 天前);至今共发布 43 个版本,其中过去 12 个月发布了 43 个;首次发布于 2026/07/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。