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

openclaw-glance-plugin

v0.1.16

Published

OpenClaw plugin client for ticker-monitor openclaw-bridge

Readme

openclaw-glance

智能盯盘:OpenClaw 插件连接 openclaw-bridge

安装与接入文档:

插件定位

本项目当前以 OpenClaw 插件模式运行(index.js + openclaw.plugin.json),保持长连接并接收 watch.triggered,并对同一 baseWsUrl + token 启用严格单活锁,防止重复实例。

OpenClaw 调用时机(插件模式)

  • 用户新建盯盘:调用 submitWatchDemandcreateWatch
  • 用户修改状态:调用 activate / pause
  • 用户删除盯盘:调用 remove
  • 需要接收触发消息:由插件后台运行时持续接收
  • 需要主动通过邮件、短信、电话发送通知时

功能

  • openclaw-bridge 建立 WebSocket 长连接
  • 支持请求:watch.create / watch.activate / watch.pause / watch.delete / ticker.query / notify.send / ping
  • 支持渠道:openclaw / email / call / sms / dingtalk
    • 建议在 channel_configs.openclaw 中携带路由字段(如 channelsession_keyaccount_idconversation_id),便于触发后回推到正确会话
  • 订阅推送:watch.triggered
  • 主动发起通知结果推送:notify.sent
  • 自动重连 + 心跳
  • 严格单活(同 token 只允许一个活跃进程)
  • 断线请求排队(可配置),重连后自动冲刷
  • 提供业务适配层 OpenClawPluginAdapter

安装

npm install

测试

npm test

运行示例

OPENCLAW_WS_TOKEN=your_ws_token \
npm start

运行适配层示例:

npm run start:adapter

SDK 使用

import { OpenClawBridgeClient } from './src/index.js';

const client = new OpenClawBridgeClient({
  baseWsUrl: 'wss://glanceup-pre.100credit.cn',
  token: '<JWT_TOKEN>',
  enqueueIfDisconnected: true
});

client.on('triggered', (msg) => {
  console.log(msg);
});

await client.connect();
const res = await client.createWatch({
  product_code: '00700',
  product_type: 'hk_stock',
  operator_type: 'rule',
  operator_parameters: {
    condition: 'price < threshold',
    variables: { threshold: 420 }
  },
  channels: ['openclaw'],
  channel_configs: { openclaw: {} }
});

适配层用法

import { OpenClawPluginAdapter } from './src/index.js';

const adapter = new OpenClawPluginAdapter({
  baseWsUrl: 'wss://glanceup-pre.100credit.cn',
  token: '<JWT_TOKEN>'
});

await adapter.start();
await adapter.submitWatchDemand({
  productCode: '06608',
  productType: 'hk_stock',
  condition: 'price >= threshold',
  variables: { threshold: 8.97 },
  channels: ['openclaw', 'email', 'call', 'sms', 'dingtalk'], // openclaw 必传,其它可选
  emailConfig: {
    to_address: '[email protected]',
    template_id: 4
  },
  callConfig: {
    phone: '13800138000',
    customer_name: 'Demo'
  },
  smsConfig: {
    receiver: '13800138000',
    template_id: 90010,
    content: '测试短信'
  },
  dingtalkConfig: {
    cas_id: 'user.dingtalk',
    template_id: 3,
    msg_type: 'text',
    content: '测试钉钉消息'
  }
});

插件工具(OpenClaw 调用)

  • watch_query_ticker
  • watch_create
  • watch_list
  • watch_pause
  • watch_activate
  • watch_remove
  • notify_sms
  • notify_call
  • notify_email
  • notify_dingtalk

notify_* 工具走 bridge notify.send 直连通知链路,发送完成后客户端会收到 notify.sent 回执事件。

客户端事件

  • connected
  • disconnected
  • reconnecting
  • warning
  • error
  • queued(请求入队)
  • queueFlushed(重连后队列发送)
  • triggered

说明

  • 先获取 ws token,然后连接 wss://<host>:8005/openclaw/ws,并在握手 Header 传 Authorization: Bearer <TOKEN>
  • 发布时将导出 src/README.md(见 package.jsonfiles/exports)。