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

@sofagent/rules

v1.7.0

Published

sofagent 规则模块——从 audit 抽出,零 git 依赖,供编排模块 tool call 事前拦截;v1.3.9 起含官方 AST 规则引擎(sofagent-ruleset-ast,经临时文件驱动 TS 编译器,无仓库 fs 依赖)

Readme

@sofagent/rules

sofagent 规则引擎纯函数包——从 audit 包抽出,零 fs/git 依赖,供编排模块 tool call 事前拦截。

安装

npm install @sofagent/rules

库包(无 CLI),随编排模块引用。Node.js 18+。

API

  • RulesEngine — 规则引擎类,接受规则集 + tool call context,返回拦截裁决
  • defaultToolRules — 默认规则集
  • InterceptVerdict / ToolCallContext / ToolRule — 核心类型定义

文档

判定规则只有一个事实源

本包是 tool-level 触发时机的适配层,不独立维护规则正则在跨引擎共用规则定义(A1 敏感文件 / A2 密钥泄漏 / A9 注入)上,与 git-diff 审计引擎(engine/audit)共用 @sofagent/core 的同一套定义(shared/rule-definitions.ts 的身份目录 + shared/rule-patterns.ts 的检测正则)——两处 import 同一来源,而非各写一份结构相同的定义。

纪律外延:判定规则只有一个事实源。企业侧若另建判定点(自建模型网关 / 代理做流量侧 PII 过滤与敏感度分流),必须集成本引擎的同一套规则与检测器(经 v1.4.9 第八章检测器插槽嵌入组件),不得另起一套——每多一处独立实现,就是一次口径分裂风险。

v1.5.2:网络出口治理面——host 白名单声明面(默认空全拒 opt-in)+ 裁决事件契约可导出(判定底座消费源)。