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

dsh-audit-common

v0.1.0

Published

Trust Anchor shared pure-function library (zero DSH deps): workspace keys & snapshot layout, intent labels, line diff engine, write-path guards, content hashing

Readme

dsh-audit-common —— Trust Anchor 公共纯函数库

Trust Anchor(dsh-audit-foundation)的共享纯函数库。零 DSH 依赖 (不 import 任何 @deepseek-ai 包),CI 可直接测试;供基座各插件与生态 复用(M4:横切关注点独立实现;M6/M7:唯一实现,禁止各写一份)。

模块

| 模块 | 职责 | MDP | |---|---|---| | workspace.mjs | 工作区键(workspaceKeyOf)/ 快照根解析 / 快照目录名(rewind 同构算法) | M8(组合不 fork) | | labels.mjs | 意图标签:tool/call 事件 → 人类可读 label(路径相对化 / 命令简写 / 别名) | M4 | | diff-engine.mjs | 行级 LCS diff(Uint32Array 全表 + 单元上限降级)+ 二进制检测 | — | | pathguard.mjs | 写路径安全纯函数:normalizeTargetPath / isProtectedRel / resolveInside / classifyRollback / withKeyLock | M6 | | hash.mjs | 内容寻址(contentHash)/ 记录哈希链(recordHash / stableStringify) | M7 | | constants.mjs | 词汇表与协议常量(providers / file status / diff ops / limits) | — |

来源:workspace/labels/diff-engine/pathguard/constants 迁移自 dsh-checkpoint-diff 0.5.x (文件头注明);hash 为本基座新增。迁入后旧仓不再演进这些模块(D3)。

用法

import { workspaceKeyOf, snapshotKeyDir } from 'dsh-audit-common'
import { normalizeTargetPath, resolveInside } from 'dsh-audit-common'
import { diffLines } from 'dsh-audit-common'
import { contentHash, recordHash } from 'dsh-audit-common'

合规自证(MDP)

  • M6:写路径校验唯一实现(pathguard);任何写路径禁止自写校验。
  • M7:哈希唯一实现(hash);"可验证 ≠ 不可篡改"(不密封、不签名)。
  • 无写路径、无数据产出(不拥有 schema——schema 归 dsh-audit-spec)。