New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@zero-library/chat-agent

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zero-library/chat-agent

ai会话

latest
npmnpm
Version
2.4.5
Version published
Maintainers
1
Created
Source

@zero-library/chat-agent

AI 会话 UI 组件库。提供页面级聊天组件 ChatCopilot,并内置会话/消息编排、HTTP 服务封装、WebSocket 收消息、文件预览等能力。

该文档只维护稳定信息(安装、入口、能力、开发方式)。所有具体类型/方法以源码与类型注释为准,避免文档与实现重复维护。

安装

pnpm add @zero-library/chat-agent

样式(建议在应用入口引入一次):

import '@zero-library/chat-agent/style'

快速开始

import { ChatCopilot } from '@zero-library/chat-agent'
import '@zero-library/chat-agent/style'

export default function App() {
  return <ChatCopilot config={{ receiverType: 3, receiverId: 'agent-001' }} services={{ http: { config: { baseURL: '/api' } } }} />
}

能力与边界

  • 组件:ChatCopilot(主聊天 UI),以及少量通用子组件(发言框/附件/消息渲染)
  • 状态:Valtio store 统一管理会话、消息、预览等
  • HTTP:内置服务层,默认基于 @zero-library/common 的请求封装
  • WebSocket:支持配置主/备地址,提升可用性
  • 预览:支持 URL 文件预览与 Markdown 文本预览

入口与结构

  • 对外导出入口:src/index.ts
  • UI:src/ui
  • 状态与业务编排:src/stores
  • 服务与类型:src/services

开发

pnpm --filter=chat-agent run dev
pnpm --filter=chat-agent run build

维护约定

  • README 仅描述稳定能力与使用约定,不罗列具体方法列表
  • API/类型说明以源码的类型与注释为准(例如 src/ui/layouts/types.tssrc/stores/types.tssrc/services/*.ts

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts