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

metro-agent

v0.2.18

Published

Metro Agent

Readme

metro-agent

// tts服务
const ttsClient = {
  tts: async ({ text }) => {
    return ttsServe(text)
  }
}

new MetroAgent({
  // tts
  ttsClient,
  // [选填] tts播放结束状态更新延迟,毫秒
  ttsDelay: 100,
  // 是否开启流式
  stream: false,
  // openai baseURL
  baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
  // openai model
  model: 'qwq-32b',
  // openai apiKey
  apiKey: 'Bearer $DASHSCOPE_API_KEY',
  // 音频转文本实时接口(ws)
  asrWsUrl: '/api/ws',
  // 唤醒词
  wakeupWord: ['小爱同学'],
  // 休眠词
  dormancyWord: ['再见'],
  // 唤醒后欢迎词,配置tts服务后自动调用
  welcomeWord: '你好,我在。',
  // 休眠后提示词,配置tts服务后自动调用
  goodbyeWord: '好的,再见。',
  // [选用] 支持重写openai fetch
  fetch: async (url, options) => {
    if (url.includes("/chat/completions")) {
      return fetch('/xxxx/chat-completions', options);
    }
  },
  // 唤醒超时
  wakeTimeout: 20 * 1000,
  // 向ws发送数据
  onSend: (client, sample) => {},
  // 唤醒后回调
  onWake: (welcomeWord) => {},
  // 休眠后回调
  onDormancy: (dormancyWord) => {},
  // asr转换后消息回调
  onMessage: (data, wakeStatus, ttsStatus) => {},
  // 开始调用模型回调
  onStart: () => {},
  // 模型流式回调
  onStream: (chunk) => {},
  // 模型调用完成回调
  onCompleted: (res) => {},
  // [选填] 录音数据处理回调,默认使用:https://github.com/modelscope/FunASR/blob/main/runtime/docs/SDK_advanced_guide_offline_en_zh.md#Html%E7%BD%91%E9%A1%B5%E7%89%88
  onRecProcess: (buffer, powerLevel, bufferDuration, bufferSampleRate) => {},
  // 部分状态变化回调
  onChange: () => {},
  // 音频波形回调
  onAudioWaveform: (powerLevel: number) => {},
  // 错误回调
  onError: (error) => {}
})

相关资源

https://github.com/modelscope/FunASR

https://github.com/xiangyuecn/Recorder