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-approval

v0.1.0

Published

审批契约:approvals 服务描述符(发起、应答、结算、审批面登记与在场)、审批对象的类型与卡片清洗函数

Readme

@aalis/api-approval

审批契约:模型发起、需要 owner 批准的操作以审批对象的形式发起、推给在场的审批面、由 owner 应答、结算后回给发起方。不含服务实现,默认实现是 @aalis/plugin-session-server。

角色

  • approvals:服务描述符(服务名 approvals)。发起方调 request(req, signal) 等结算;审批面经绑定门面 registerSurface(name) 登记,随激活撤回,每个客户端 attend 一次,在场上报与应答都经它。
  • Approval、ApprovalRequest、ApprovalOutcome 等:审批对象、请求与结局的类型。
  • approval:created、approval:settled:审批推给审批面、结算时发出的事件。
  • sanitizeForCard(text, limit?):审批卡显示事实之前的清洗,各审批面共用。

安装

pnpm add @aalis/api-approval

使用

import { approvals, sanitizeForCard } from '@aalis/api-approval';

// uses: { approvals: optional(approvals) }
const surface = caps.approvals.use.registerSurface('cli');
const attendance = surface.attend({ platform: 'cli', userId: 'console' }, {
  requested: approval => showCard(sanitizeForCard(approval.facts.command ?? approval.tool, 400)),
  settled: approvalId => closeCard(approvalId),
});
attendance.presence(true);

详见 docs/api/api-approval.md。