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

@johnny-joster/n9e-plugin

v1.0.10

Published

Nightingale alert platform query plugin for OpenClaw

Downloads

254

Readme

N9e Plugin for OpenClaw

夜莺(Nightingale)告警平台查询插件,支持通过自然语言查询告警事件、历史告警、告警规则和告警屏蔽配置。

功能特性

  • ✅ 查询当前活跃告警
  • ✅ 查询历史告警记录
  • ✅ 查询告警规则配置
  • ✅ 查询告警屏蔽规则
  • ✅ 自然语言交互
  • ✅ 全局查询(跨所有业务组)
  • ✅ 完善的错误处理

快速开始

1. 安装插件

# 从本地目录安装(开发模式)
openclaw plugins install -l ./n9e-plugin

# 或从npm安装
openclaw plugins install @youdao/n9e-plugin

2. 配置插件

编辑OpenClaw配置文件,添加以下配置:

{
  "plugins": {
    "entries": {
      "n9e-plugin": {
        "enabled": true,
        "config": {
          "apiBaseUrl": "https://n9e-dev.inner.youdao.com/api/n9e",
          "apiKey": "your-api-key-here",
          "timeout": 30000
        }
      }
    }
  }
}

3. 重启Gateway

openclaw gateway restart

4. 验证安装

openclaw plugins list

使用示例

与Agent对话即可使用:

用户: 查一下最近的告警
→ Agent调用 n9e_query_active_alerts
→ 返回: 当前有5条活跃告警...

用户: 昨天有哪些告警
→ Agent调用 n9e_query_historical_alerts
→ 返回: 昨天共有15条告警...

用户: CPU相关的告警规则
→ Agent调用 n9e_query_alert_rules
→ 返回: 找到3条CPU相关规则...

用户: 哪些告警被屏蔽了
→ Agent调用 n9e_query_alert_mutes
→ 返回: 当前有2条屏蔽规则...

API Tools

1. n9e_query_active_alerts

查询当前活跃告警。

参数:

  • severity: 严重级别(1=严重,2=警告,3=提示)
  • rule_name: 规则名称(支持模糊匹配)
  • limit: 返回数量(默认50)
  • query: 搜索关键词

2. n9e_query_historical_alerts

查询历史告警记录。

参数:

  • severity: 严重级别
  • rule_name: 规则名称
  • stime: 开始时间戳(秒)
  • etime: 结束时间戳(秒)
  • limit: 返回数量(默认50)

3. n9e_query_alert_rules

查询告警规则配置。

参数:

  • rule_name: 规则名称
  • datasource_ids: 数据源ID列表
  • disabled: 规则状态(0=启用,1=禁用)
  • limit: 返回数量(默认50)

4. n9e_query_alert_mutes

查询告警屏蔽规则。

参数:

  • query: 搜索关键词
  • limit: 返回数量(默认50)

项目结构

n9e-plugin/
├── openclaw.plugin.json    # 插件清单
├── package.json
├── index.ts                 # 插件入口
├── src/
│   ├── config-schema.ts     # Zod配置Schema
│   ├── n9e-client.ts       # 夜莺API客户端
│   ├── types.ts            # TypeScript类型定义
│   └── tools/              # 工具实现
│       ├── active-alerts.ts
│       ├── historical-alerts.ts
│       ├── alert-rules.ts
│       └── alert-mutes.ts
└── skills/                  # Agent技能
    ├── query-active-alerts/
    ├── query-historical-alerts/
    ├── query-alert-rules/
    └── query-alert-mutes/

开发

安装依赖

npm install

链接模式开发

npm run dev
# 等同于: openclaw plugins install -l .

类型检查

npx tsc --noEmit

配置说明

| 字段 | 类型 | 必需 | 说明 | |------|------|------|------| | apiBaseUrl | string | ✅ | 夜莺API地址 | | apiKey | string | ✅ | API访问密钥 | | timeout | number | ❌ | 请求超时(毫秒),默认30000 |

错误处理

| 错误类型 | 提示信息 | |---------|---------| | 网络错误 | 无法连接到夜莺平台,请检查网络或配置 | | 401/403 | 认证失败,请检查API Key配置 | | 404 | 未找到指定的资源 | | 500 | 夜莺服务器错误,请稍后重试 | | 超时 | 请求超时,请检查网络连接 |

许可证

MIT

作者

Youdao DevOps Team