@regent-vcs/pi-extension

Pi extension package that forwards session events to re_gent.

Packages

Package details

extension

Install @regent-vcs/pi-extension from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@regent-vcs/pi-extension
Package
@regent-vcs/pi-extension
Version
0.1.0
Published
Jun 1, 2026
Downloads
not available
Author
doshay
License
Apache-2.0
Types
extension
Size
26 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions/index.ts"
  ]
}

Security note

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

README

regent-pi-extension

Pi package for capturing Pi coding-agent sessions with re_gent.

The extension subscribes to Pi lifecycle events and forwards normalized session, prompt, tool, and assistant-finalization payloads to:

rgt pi-hook

rgt pi-hook performs the actual re_gent recording. The extension only observes Pi events and runs the hook process; it does not change tool calls or tool results.

Requirements

  • Pi with package support.

  • The rgt binary available on PATH.

  • A repository initialized for re_gent capture, usually with:

    rgt init --agent pi
    

If .regent/ is absent, rgt pi-hook is expected to no-op, so normal Pi usage should continue.

Install

Install project-locally from the GitHub package source:

pi install -l git:github.com/MegaGrindStone/regent-pi-extension

Project-local install writes to .pi/settings.json, so Pi can load the package for that repository.

Local development

Run Pi with this checkout as a temporary extension package:

pi -e /home/gs/repository/regent-pi-extension

Useful package commands:

npm install
npm test
npm run typecheck
npm run check

What is captured

The extension maps Pi events to the rgt pi-hook payload shape:

  • session_startSessionStart
  • before_agent_startUserPromptSubmit
  • tool_resultPostToolUse
  • agent_end / guarded session_shutdownStop

It preserves structured tool input and result data where Pi exposes it, including content, details, and isError.

Troubleshooting

  • rgt missing: ensure rgt is on PATH before starting Pi. The extension logs a diagnostic if the hook process cannot be spawned.
  • Hook exits non-zero: run rgt pi-hook troubleshooting from the target repository and inspect .regent/log/hook-error.log if .regent/ exists.
  • No .regent/ directory: initialize the repository with rgt init --agent pi. Without .regent/, the hook should silently no-op.
  • No captured context: after a Pi prompt that uses at least one tool, run rgt log, rgt show, or rgt blame in the repository and look for a pi origin step.