@agimon-ai/doompi-grep

Snapshot-bound hashline grep for Pi and DoomPi.

Packages

Package details

extension

Install @agimon-ai/doompi-grep from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@agimon-ai/doompi-grep
Package
@agimon-ai/doompi-grep
Version
0.0.1-alpha.30
Published
Sep 6, 2026
Downloads
2,175/mo · 915/wk
Author
agiflow-ai
License
MIT
Types
extension
Size
62 KB
Dependencies
7 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/extensions/pi.mjs"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@agimon-ai/doompi-grep

Snapshot-bound hashline grep for Pi and DoomPi.

Part of the DoomPi distribution.

The package replaces only Pi's grep registration. It delegates searching to Pi's native grep tool, preserving its ripgrep behavior, then attaches an exact file tag and a stable three-letter anchor to matching or context lines from writable files. Matches in non-writable files retain Pi's native output to save model context. The matching @agimon-ai/doompi-read and @agimon-ai/doompi-edit packages use the same hashline protocol.

Alpha: tool and protocol contracts may change between releases.

Requirements

  • Node.js 22.19.0 or newer
  • Pi 0.85.0 and Pi TUI 0.85.0

Install

pi install npm:@agimon-ai/doompi-grep

Pi discovers @agimon-ai/doompi-grep/extensions/pi from the package manifest.

Install @agimon-ai/doompi-edit when the model should apply the anchors emitted by this package.

When @agimon-ai/doompi-ui is installed directly in standalone Pi, list @agimon-ai/doompi-grep first so its grep registration owns the shared tool name. DoomPi's composed runtime loads selectable packages after the UI package, so the hashline tool owns grep there.

Tool protocol

Writable search results group matching and context lines beneath an exact-byte file header:

@file src/example.ts#A1b2C3d4
   4#def|const previous = true;
>> 5#abc|const match = true;

The eight-character file tag and three-letter line anchors are model-facing protocol data. DoomPi's human renderer hides the protocol tags and anchors while retaining file paths, line numbers, match markers, and syntax highlighting.

Attribution

The hashline protocol and FNV anchor approach are adapted from Phi's writetool, licensed under MIT by pulseaiclub. DoomPi uses an exact-byte SHA-256 file tag as an intentional compatibility boundary.

Public API

import { GrepParamsSchema, registerHashlineGrepTool } from '@agimon-ai/doompi-grep';
import type { GrepParams } from '@agimon-ai/doompi-grep';

Development

pnpm build
pnpm typecheck
pnpm test
pnpm lint

Maintained by Agimon.

License

MIT