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

copaw-ai-chat-widget

v0.1.0

Published

AI Chat Assistant widget for Vue 3 with direct and floating-window component entry points

Readme

Copaw AI Chat Widget

AI 对话助手组件包,提供两种 Vue 3 接入方式:

  • 直接渲染聊天组件 AiChatAssistant
  • 开箱即用的悬浮入口 AiChatFloatingAssistant

安装

npm install copaw-ai-chat-widget
# 或 pnpm add copaw-ai-chat-widget

依赖

宿主项目需要安装以下 peerDependencies:

npm install vue@^3.3.0 element-plus@^2.13.0

使用方式

1. 直接渲染聊天组件

<script setup>
import { AiChatAssistant } from 'copaw-ai-chat-widget'
import 'copaw-ai-chat-widget/style'
</script>

<template>
  <AiChatAssistant
    title="你好,我是 AI 助手"
    theme="auto"
    :show-sidebar="true"
    :sidebar-width="320"
  />
</template>

2. 使用悬浮按钮 + 弹窗一体化组件

<script setup>
import { AiChatFloatingAssistant } from 'copaw-ai-chat-widget'
import 'copaw-ai-chat-widget/style'
</script>

<template>
  <AiChatFloatingAssistant
    title="你好,我是 AI 助手"
    window-title="AI 助手"
    button-label="AI 助手"
    theme="auto"
    :show-sidebar="true"
    :default-visible="false"
    :default-size="{ width: 720, height: 600 }"
  />
</template>

3. 受控模式

<script setup lang="ts">
const visible = ref(false)
const position = ref({ x: 200, y: 80 })
const size = ref({ width: 720, height: 600 })
const isMinimized = ref(false)
</script>

<template>
  <AiChatFloatingAssistant
    v-model:visible="visible"
    v-model:position="position"
    v-model:size="size"
    v-model:is-minimized="isMinimized"
    :show-sidebar="true"
  />
</template>

AiChatAssistant Props

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | title | string | '你好,我是 AI 助手' | 欢迎页标题 | | primaryColor | string | '#9547EC' | 主题色 | | theme | 'light' \| 'dark' \| 'auto' | 'auto' | 主题模式 | | showSidebar | boolean | false | 是否显示左侧会话栏 | | sidebarWidth | number | 280 | 左侧会话栏宽度 | | showHeader | boolean | false | 是否显示顶部导航栏 |

AiChatFloatingAssistant Props

除透传全部 AiChatAssistant props 外,还支持以下外层配置:

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | visible | boolean | - | 受控显示状态 | | position | { x: number; y: number } | - | 受控窗口位置 | | size | { width: number; height: number } | - | 受控窗口尺寸 | | isMinimized | boolean | - | 受控最小化状态 | | defaultVisible | boolean | false | 非受控默认显示状态 | | defaultPosition | { x: number; y: number } | window.innerWidth - 780, 80 | 非受控默认位置 | | defaultSize | { width: number; height: number } | { width: 720, height: 600 } | 非受控默认尺寸 | | defaultMinimized | boolean | false | 非受控默认最小化状态 | | buttonLabel | string | 'AI 助手' | 悬浮按钮文案 | | windowTitle | string | 'AI 助手' | 弹窗标题 | | zIndex | number | 9999 | 弹窗层级 |

认证

组件通过 sessionStorage 读取以下认证信息:

  • authorization
  • access-token
  • refresh-token
  • expires-at

请确保在调用组件前,这些值已正确设置到 sessionStorage 中。