@aleph-alpha/chat-kit

中文文档
7.2.1发布于 2026/11/04MITTypeScriptES Module近 30 天下载 1.6万

Chat kit package for building chat interfaces with Vue

原始使用文档
文档目录6 节
  1. Installation
  2. Architecture
  3. Usage
  4. Development
  5. Documentation
  6. License

@aleph-alpha/chat-kit

Chat kit for building chat interfaces with Vue. Ships components, handlers (message tree via useMessageHandler, markdown, labels — from the package root or @aleph-alpha/chat-kit/handlers), a composables entry for useChat (under development), and a services layer for backends (under development).

Part of the frontend-hub monorepo.

Installation

pnpm add @aleph-alpha/chat-kit

Architecture

Chat Kit is organised into three layers:

  1. Components — Pre-built Vue 3 components for chat UIs, split into base (presentational) and composed (opinionated patterns).
  2. Handlers — Reactive utilities for chat state management: useMessageHandler (conversation tree), useMarkdownParser (markdown pipeline), useChatKitLabels (i18n).
  3. Services (under development) — Abstract ChatService / IChatService for backend communication and streaming. Not ready for production use.

useChat (under development) lives in composables/ as a planned high-level orchestrator that composes handlers and services into a single API

Usage

Import from specific entry points for tree-shaking:

// Services only
import { ChatService, type IChatService } from '@aleph-alpha/chat-kit/services';

// Handlers only
import { useMessageHandler } from '@aleph-alpha/chat-kit/handlers';

// Composables only
import { useChat } from '@aleph-alpha/chat-kit/composables';

// Components only
import { CkConversation } from '@aleph-alpha/chat-kit/components';

// Everything
import { ChatService, useChat, CkConversation } from '@aleph-alpha/chat-kit';

Development

This package lives in the frontend-hub monorepo. To work on it locally:

git clone [email protected]:Aleph-Alpha/frontend-hub.git
cd frontend-hub
pnpm install

# Run tests
pnpm nx run chat-kit:test

# Lint
pnpm nx run chat-kit:lint

# Storybook
pnpm nx run chat-kit:storybook

Documentation

License

MIT.

版本与发布记录

@aleph-alpha/chat-kit 共发布 89 个版本,首次发布于 2026/03/09;过去 12 个月发布了 89 个版本。

版本发布日期距今
7.2.1latest2026/11/041 天前
7.2.02026/10/316 天前
7.1.02026/10/288 天前
7.0.02026/10/2610 天前
6.8.02026/10/1323 天前
6.7.22026/10/1323 天前

关于 @aleph-alpha/chat-kit 的常见问题

@aleph-alpha/chat-kit 是什么?

Chat kit package for building chat interfaces with Vue

如何安装 @aleph-alpha/chat-kit?

在项目目录运行 npm install @aleph-alpha/chat-kit,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.27)、pinia(^3.0.0)、@aleph-alpha/ui-library(^7.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aleph-alpha/chat-kit 支持 TypeScript 吗?

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

@aleph-alpha/chat-kit 支持 ESM 还是 CommonJS?

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

@aleph-alpha/chat-kit 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aleph-alpha/chat-kit 可以商用吗?

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

@aleph-alpha/chat-kit 的下载量有多少?

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

@aleph-alpha/chat-kit 还在维护吗?

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