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

@kyfe/ai-agent-chat-card

v1.0.1

Published

AI智能体聊天卡片组件

Readme

AI智能体聊天卡片组件

百科搜索框场景下的 AI 问答卡片,自包含组件,可嵌入任意页面,一行调用即可发起 AI 对话。

快速上手

<template>
  <AgentChatCard ref="agentChatCard"
                 appCode="CHAT-002"
                 v-show="isShowCard"
                 @showMore="onShowMore" />
</template>

<script>
import AgentChatCard from '@kyfe/ai-agent-chat-card' // 注意事项:由于该 npm 包发布频繁,请锁定版本使用

export default {
  components: { AgentChatCard },
  data () {
    return { isShowCard: false }
  },
  methods: {
    ask (question) {
      this.isShowCard = true
      this.$refs.agentChatCard.sendMsg({ msg: question })
    },
    onShowMore ({ answerItem, sessionParams }) {
      this.$router.push({
        name: 'AIAgentPage',
        query: { question: '这里传问题内容', answerItem, sessionParams }
      })
    }
  }
}
</script>

Props

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | appCode | String | 'CHAT-002' | AI 应用标识,决定后端会话创建的应用类型 |

Events

| 事件名 | 参数 | 说明 | |--------|------|------| | showMore | { answerItem, sessionParams } | 用户点击"查看更多"时触发,携带当前答案和会话信息,由外部监听处理跳转等逻辑 |

Methods(通过 ref 调用)

sendMsg({ msg, callback })

发起一次 AI 问答,完整流程:创建会话 → SSE 流式获取答案 → 上报问答记录。

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | msg | String | 是 | 用户提问内容 | | callback | Function | 否 | 会话创建成功后的回调 |

this.$refs.agentChatCard.sendMsg({
  msg: '年假怎么请?',
  callback: () => console.log('会话已创建')
})

升级记录

| 版本 | 说明 | | ------ | ----------------------- | | 1.0.0 | 发布 AgentChatCard 组件 | | 1.0.1 | 去掉highlight.js代码高亮,优化包体积 |