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

@aalis/api-trigger

v0.2.0

Published

触发判定契约:trigger 服务描述符(选出当前生效的触发插件,二选一)与触发插件共用的函数

Readme

@aalis/api-trigger

触发判定契约:trigger 服务描述符,以及触发插件共用的函数。判定一条入站消息要不要让 agent 开口的是触发插件本身,本包不含判定。

角色

  • trigger:标记当前生效的触发插件。触发插件各自 provide(trigger, 自己的实例) 并在 inbound:trigger 相位挂中间件;服务胜者(偏好 > 优先级 > 注册顺序)即生效者,其余触发插件对每条消息直接放行。二选一,同一条消息只由生效者判定。
  • 共用的函数:isActiveTrigger(这次入站是否由自己判定)、hitsMuteKeyword、createBotNames(名字表:别名与全部已登记人设的名字、昵称,人设按会话取,某个人设出错只跳过它的名字)、isAddressed、markTriggered、archiveSwallowed。写日志的函数由调用方传入日志前缀。

安装

pnpm add @aalis/api-trigger

提供

服务描述符:trigger(服务名 trigger),服务接口 TriggerService({ readonly label: string })。

import { trigger } from '@aalis/api-trigger';

触发插件:规则判定 @aalis/plugin-trigger-policy;模型判定 @aalis/plugin-trigger-laya(仓库内私有插件,不发布到 npm)。

文档

详见 docs/services/trigger.md。

许可

见仓库根目录 LICENSE。