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

@piex-dev/hashline

v0.1.2

Published

Hashline patch language extension for pi — compact, line-anchored, tag-verified file edits

Readme

hashline

基于 @oh-my-pi/hashline 的 hashline 编辑语言扩展,覆盖 pi 内置 edit 工具。

功能

  • 覆盖 edit 工具:内置 edit 替换为 hashline 语法解析 + 应用
  • read hook:读取文件后自动注入 [PATH#TAG] header,为后续编辑提供锚点
  • 快照验证:编辑时验证 #TAG 与文件内容一致,防止并发修改冲突
  • seen-lines 追踪:记录 agent 实际看到的行号,Patcher 拒绝编辑未显示的行
  • noop 循环守卫:连续 3 次 byte-identical noop 抛 [E_NOOP_LOOP]patches.ts EditGuard)
  • 重复编辑检测:成功编辑后重发相同 payload 且文件未变 → 抛 [E_DUPLICATE_EDIT]
  • 方言归一化:吸收 CRLF/代码块包裹/多余空行等模型输出偏差
  • diff 回显:每次 update 附带 compact diff preview,实际增删行当场可见(含行号,可直接作下次编辑锚点)

使用说明

pi install npm:@piex-dev/hashline

安装后即生效:hashline 覆盖 pi 内置 edit 工具,并 hook read 结果。无需额外开关,无需配置文件。

冒烟测试(改动后必跑):

pi -e ./extensions/hashline/src/hashline.ts -p "what is 1+1" --no-session

依赖

  • @oh-my-pi/hashline ^17.1.3(运行时)
  • @earendil-works/pi-coding-agent(peer)
  • typebox(peer)
  • patch-package ^8.0.1(运行时,安装时自动应用 patches/ 下的补丁)

Patches

patches/ 目录包含两个上游补丁,通过 postinstall 脚本 + patch-package 自动应用:

  • @oh-my-pi+hashline+17.1.3.patch — 修复 findDuplicateSuffix/findDuplicatePrefix 在较大重写 payload 中误判边界回显的问题
  • @oh-my-pi+pi-natives+17.1.3.patch — 用 fileURLToPath 替代 Node 21.2+ 才支持的 import.meta.dir

补丁针对 @oh-my-pi/[email protected] 的精确文件内容生成。升级 @oh-my-pi/hashline 版本时需重新生成补丁,postinstall 应用失败即为版本不兼容的明确信号。

延伸阅读

  • https://piex.dev/zh/packages/hashline/