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

@debugtalk/opencode-hashline

v0.2.1

Published

Hashline patch language plugin for OpenCode — compact, line-anchored, tag-verified file edits

Downloads

339

Readme

@debugtalk/opencode-hashline

OpenCode plugin adapter for hashline — compact, line-anchored, tag-verified file edits. Powered by @oh-my-pi/hashline.

Instead of exact-string matching (which forces models to re-type old content and risks drift), hashline uses line-number anchors combined with content-hash tags so every edit is validated against the exact file snapshot the model saw. This plugin wraps the hashline engine as an OpenCode edit tool override and snapshot injection hook.

Package name: Published as @debugtalk/opencode-hashline on npm. The unscoped name opencode-hashline is used by a different package on the public registry.

Installation

npm install @debugtalk/opencode-hashline --save-dev

Add to opencode.json:

{
	"plugin": ["@debugtalk/opencode-hashline"]
}

Restart OpenCode. No build step — OpenCode loads the TypeScript plugin entry directly.

How It Works

The plugin overrides the built-in edit tool and injects snapshot tags into read output:

  1. Read — output starts with [path/file.ts#A1B2] (4-hex content hash of the file)
  2. Edit[path/file.ts#A1B2] plus line-anchored ops; tag must match current file content
  3. Drift — mismatch rejects the edit (with recovery when possible); re-read and retry

Edit syntax (format v2)

[src/foo.ts#A1B2]
SWAP 2.=2:
+    return newValue

INS.POST 10:
+    // new comment

DEL 5.=7

INS.HEAD:
+# SPDX-License-Identifier: MIT

| Operation | Syntax | Description | |-----------|--------|-------------| | Replace lines | SWAP N.=M: | Replace inclusive range N..M with + body rows | | Delete lines | DEL N.=M or DEL N | Delete range; no body | | Insert before | INS.PRE N: | Insert before line N | | Insert after | INS.POST N: | Insert after line N | | Insert head | INS.HEAD: | Insert at file start | | Insert tail | INS.TAIL: | Insert at file end | | Delete file | REM | Remove entire file (section header required) | | Move/rename | MV dest/path | Move file to dest/path |

Body rows are +TEXT only. The range deletes; the body is the final content for that range.

Rules

  • Line numbers refer to the original file; they do not shift as hunks apply in one patch
  • Every successful edit returns a new #TAG — use it for the next edit or re-read
  • Ranges should cover only lines that change
  • On stale tag or unexpected result: stop and re-read

Configuration

No configuration required.

Programmatic use (hashline core)

Use the upstream package directly:

import { Patch, Patcher, NodeFilesystem, InMemorySnapshotStore } from "@oh-my-pi/hashline";

Limitations

  • SWAP.BLK N: not supported — tree-sitter block resolver is not bundled; use SWAP N.=M: line ranges
  • write not overridden — create new files with the built-in write tool
  • Files > 4MB — no snapshot tag on read (falls back to built-in edit behavior)
  • OpenCode only — this npm package targets the OpenCode plugin runtime; see docs/cross-platform-plugins.md for other agents

Docs

License

MIT