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

mt-ai-assistant-panel

v0.1.0

Published

Vue 3 AI safety risk assistant panel component.

Readme

mt-ai-assistant-panel

Vue 3 安全风险智能分析助手组件,已从当前业务项目中提取为可发布的 npm 包。

效果图

mt-ai-assistant-panel 效果图

安装

pnpm add mt-ai-assistant-panel

使用

import { createApp } from "vue";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import "katex/dist/katex.min.css";
import MtAiAssistantPanel from "mt-ai-assistant-panel";
import "mt-ai-assistant-panel/style.css";

import App from "./App.vue";

createApp(App).use(Antd).use(MtAiAssistantPanel).mount("#app");

插件会同时注册 MtAiAssistantPanel 和兼容旧用法的 AIAssistantPanel

<template>
  <MtAiAssistantPanel
    :regulations="regulations"
    :suggestions="suggestions"
    chat-endpoint="/mt_cpp_gpt/mt_intention_chat"
    @send="onSend"
    @response="onResponse"
  />
</template>

<script setup lang="ts">
const regulations = [
  {
    id: 1,
    type: "safety",
    typeLabel: "安全",
    name: "煤矿安全规程",
    snippet: "涉及现场巡检、隐患处置和风险分级管控。",
  },
];

const suggestions = ["当前区域有哪些高风险点?", "生成本班安全巡检建议"];

function onSend(question: string) {
  console.log(question);
}

function onResponse(answer: string) {
  console.log(answer);
}
</script>

API 约定

默认请求体:

{
  "query": "用户问题",
  "stream": true,
  "merge_knowledge_toggle": false,
  "exts": { "vqa": true }
}

组件默认读取 sessionStorage.userinfo 中的 userIduserName 写入请求头;如不需要,可设置 :with-session-user-headers="false"

SSE 返回值默认识别两类数据:

  • 进度:{"intent":"progress","tools":{"tools_output":{"progress_name":"检索规程中"}}}
  • 最终回答:{"final_answer":"..."}

常用 Props

| Prop | 说明 | 默认值 | | ---------------- | ------------------------ | ------------------------------- | | title | 面板标题 | 安全风险智能分析助手 | | regulations | 当前关联规程列表 | [] | | suggestions | 推荐问题列表 | [] | | chatEndpoint | SSE 问答接口 | /mt_cpp_gpt/mt_intention_chat | | requestHeaders | 追加请求头对象或函数 | {} | | requestPayload | 自定义请求体函数 | null | | theme | light / dark | dark | | avatar | 自定义助手头像 URL | 包内默认头像 | | sendIcon | 自定义发送图标 URL | Ant Design 图标 | | collapseIcon | 自定义折叠图标 URL | 包内默认图标 | | collapsed | 暗色模式下的受控折叠状态 | undefined |

包内默认图片也可单独导入,例如:

import sendIcon from "mt-ai-assistant-panel/assets/send.png";

事件

| 事件 | 参数 | | ------------------ | ------------------ | | update:collapsed | boolean | | send | question: string | | progress | text: string | | response | answer: string | | error | error: unknown |

构建与发布

cd mt-ai-assistant-panel
pnpm install
pnpm build
pnpm publish

发布前按实际 npm 组织调整 package.json 里的 nameversionlicense