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

@0xbot/chat

v1.0.11

Published

0xBot Studio agent chat library

Readme

0xBot 聊天组件库

一个支持 API 密钥的 Vue 3 聊天组件库。

安装

npm install @0xbot/chat

使用方法

全局安装

import { createApp } from 'vue'
import ChatLibrary from '@0xbot/chat'
import "@0xbot/chat/dist/style.css"
import Avatar from "your-avatar-address"
const app = createApp(App)

app.use(ChatLibrary, {
  apiKey: 'your-api-key-here', // 必填
  serverUrl: 'http://localhost:3000', // 选填
  AgentAvatar: 'https://example.com/agent-avatar.png', // 必填,可以是本地图片
  UserAvatar: Avatar, // 必填
  loadingText: 'AI is thinking...', // 选填,自定义加载文本
  emptyText: 'No messages yet', // 选填,自定义空消息文本
  tradeApiKey: "xxxx-xxxx-xx"
})

app.mount('#app')

配置选项

| 选项 | 类型 | 是否必填 | 默认值 | 描述 | |-------------|--------|----------|---------|--------------------------| | apiKey | string | 是 | - | 聊天服务的 API 密钥 | | AgentAvatar | string | 是 | null | AI 助手的头像 | | UserAvatar | string | 是 | null | 用户的头像 | | serverUrl | string | 否 | - | 聊天服务的服务器地址 | | loadingText | string | 否 | 'AI is thinking...' | AI 处理时的自定义文本 | | emptyText | string | 否 | 'No messages yet' | 空消息时的自定义文本 | | tradeApiKey | string | No | '' | 交易的apikey |

功能特性

  • 实时 AI 聊天
  • 支持 Markdown 消息
  • 可自定义加载状态
  • 空消息状态处理
  • 响应式设计
  • 可自定义主题
  • 消息历史管理

样式

/* 主容器 */
.chat-library {
  box-sizing: border-box;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

/* 底部栏 */
.chat-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 输入框 */
.chat-bar-input {
  flex: 1;
  height: 44px;
  outline: none;
  border-radius: 99999px;
  border: 1px solid #ccc;
  background-color: transparent;
  color: #fff;
  padding: 0 16px;
  min-width: 0;
}

/* 发送按钮 */
.chat-bar-send {
  flex: none;
  width: auto;
  border: 1px solid;
  height: 48px;
  padding: 0 32px;
  border-radius: 99999px;
  cursor: pointer;
  background-color: transparent;
  transition: all 0.2s ease-in-out;
}

/* 发送按钮悬停效果 */
.chat-bar-send:hover {
  background-color: var(--primary-color);
  color: white !important;
}

/* 聊天容器(不包含底部栏) */
.chat-container {
  flex: 1;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* 隐藏滚动条 */
.chat-container::-webkit-scrollbar {
  display: none;
}

/* 聊天消息列表 */
.chat-container-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 消息气泡 */
.message-bubble {
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 90%;
  font-size: 14px;
  word-break: break-all;
  line-height: 24px;
}

@media (min-width: 768px) {
  .message-bubble {
    max-width: 70%;
    font-size: 13px;
  }
}

/* 头像 */
.chat-avatar {
  width: 44px;
  height: 44px;
  max-width:44px;
  max-height:44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
}

/* 消息气泡背景 */
.chat-message {
  background-color: rgba(255, 255, 255, 0.1)
}

/* 消息容器 */
.message-container {
  display: flex;
}

/* 删除按钮 */
.chat-bar-trash {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  color: #fff;
  cursor: pointer;
}

/* 加载状态 */
.message-loading {
  color: #fff;
  font-style: italic;
}

/* 空消息状态 */
.message-empty {
  color: #fff;
  font-style: italic;
  text-align: center;
}

/* 交易弹窗 */
.dodo-swap {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

许可证

MIT