@agimon-ai/doompi-read

Snapshot-bound hashline read tool for Pi and DoomPi.

Packages

Package details

extension

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

$ pi install npm:@agimon-ai/doompi-read
Package
@agimon-ai/doompi-read
Version
0.0.1-alpha.28
Published
Sep 5, 2026
Downloads
2,161/mo · 928/wk
Author
agiflow-ai
License
MIT
Types
extension
Size
60.3 KB
Dependencies
8 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-read

Snapshot-bound hashline read tool for Pi and DoomPi.

Part of the DoomPi distribution.

The package replaces only Pi's read registration. Writable text reads attach an exact file tag and a stable three-letter anchor to every returned line. Non-writable files retain Pi's native output, which avoids spending model context on anchors that cannot be edited. The full hashline protocol remains available to the model, while DoomPi's renderer hides the protocol tags and anchors from people and preserves syntax highlighting. Image reads retain Pi's native attachment behavior.

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

Pi discovers @agimon-ai/doompi-read/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-read first so its read registration owns the shared tool name. DoomPi's composed runtime loads selectable packages after the UI package, so the hashline tool owns read there.

Tool protocol

A writable text result starts with one file header, followed by tagged lines:

@file src/example.ts#A1b2C3d4
1#abc|const value = 1;

The eight-character file tag is the base64url SHA-256 prefix of the exact file bytes. The three-letter line anchor is a whitespace-insensitive FNV-1a64 tag. Large reads retain Pi's output limits and include an offset hint when more lines are available.

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 { ReadParamsSchema, registerHashlineReadTool } from '@agimon-ai/doompi-read';
import type { ReadParams } from '@agimon-ai/doompi-read';

Development

pnpm build
pnpm typecheck
pnpm test
pnpm lint

Maintained by Agimon.

License

MIT