npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ariel_jhy/ai-bot-adk

v1.0.6

Published

智能客服SDK - 基于Vue 3的移动端H5智能客服组件

Downloads

689

Readme

@ariel_jhy/ai-bot-adk

智能客服 SDK

基于 Vue 3 的移动端 H5 智能客服组件库

npm version License: MIT Vue 3

✨ 特性

  • 📱 移动端优先 - 专为移动端 H5 设计
  • 💬 智能推荐 - 支持推荐问题,一键"换一换"
  • 🔄 SSE 流式输出 - 内置 SSE 支持,实现流式输出
  • 💾 历史记录 - 自动保存聊天历史
  • ⚙️ 灵活配置 - 丰富的配置选项
  • 🎯 TypeScript - 完整的类型定义

📦 安装

npm install @ariel_jhy/ai-bot-adk

🚀 快速开始

import { createChatSDK } from '@ariel_jhy/ai-bot-adk'

const sdk = createChatSDK({
  title: '智能客服',
  welcomeMessage: 'Hi,有什么可以帮您的吗?',

  // SSE 流式接口
  sseUrl: 'https://your-api.com/sse',
  sseMethod: 'POST',

  // 推荐问题
  quickQuestions: [
    { id: '1', text: '如何使用这个平台?' },
    { id: '2', text: '账号如何注册?' }
  ]
})

sdk.mount()

CDN 引入

<script src="https://unpkg.com/@ariel_jhy/ai-bot-adk/dist/chat-sdk.umd.js"></script>
<script>
  const SDKClass = ChatSDK.default || ChatSDK
  const sdk = new SDKClass({
    title: '智能客服',
    sseUrl: 'https://your-api.com/sse'
  })
  sdk.mount()
</script>

⚙️ 配置选项

interface ChatSDKConfig {
  // API 配置
  sseUrl?: string              // SSE 接口地址
  sseMethod?: 'GET' | 'POST'   // 请求方法

  // UI 配置
  title?: string               // 标题
  welcomeMessage?: string      // 欢迎消息
  placeholder?: string         // 输入框占位符
  theme?: 'light' | 'dark'     // 主题模式
  position?: 'left' | 'right'  // 位置

  // 头像
  avatar?: {
    user?: string              // 用户头像
    assistant?: string         // 助手头像
  }

  // 推荐问题
  quickQuestions?: QuickQuestion[]

  // 历史记录
  enableHistory?: boolean      // 是否启用
  maxHistoryDays?: number      // 保存天数

  // 其他
  container?: string | HTMLElement  // 容器
  storageKey?: string          // 存储 key
}

📖 API

方法

| 方法 | 说明 | |------|------| | mount() | 挂载到页面 | | unmount() | 卸载 | | open() | 打开聊天窗口 | | close() | 关闭聊天窗口 | | sendMessage(content) | 发送消息 | | addMessage(message) | 添加消息 | | clearMessages() | 清空消息 | | on(event, callback) | 监听事件 | | off(event, callback) | 取消监听 |

事件

| 事件 | 说明 | |------|------| | sendMessage | 发送消息时 | | open | 打开窗口时 | | close | 关闭窗口时 | | message | 添加消息时 | | streamingComplete | 流式完成时 |

sdk.on('sendMessage', (content) => {
  console.log('用户发送:', content)
})

🎨 自定义样式

通过 CSS 变量定制:

:root {
  --cs-primary-color: #3B82F6;
  --cs-bg-color: #F0F5FF;
  --cs-text-primary: #1F2937;
  /* ... 更多变量 */
}

🔌 SSE 接口规范

请求

POST /sse
Content-Type: application/json

{
  "message": "用户的问题",
  "history": []
}

响应

event: connected
data: {"status": "connected"}

data: 收到
data: 你的
data: 消息

data: [DONE]

详见 node-server/README.md

📝 更新日志

查看 CHANGELOG.md

📄 许可证

MIT


如有问题或建议,欢迎提交 Issue!