@regent-vcs/pi-extension
Pi extension package that forwards session events to re_gent.
Package details
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
rgtbinary available onPATH.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_start→SessionStartbefore_agent_start→UserPromptSubmittool_result→PostToolUseagent_end/ guardedsession_shutdown→Stop
It preserves structured tool input and result data where Pi exposes it, including content, details, and isError.
Troubleshooting
rgtmissing: ensurergtis onPATHbefore starting Pi. The extension logs a diagnostic if the hook process cannot be spawned.- Hook exits non-zero: run
rgt pi-hooktroubleshooting from the target repository and inspect.regent/log/hook-error.logif.regent/exists. - No
.regent/directory: initialize the repository withrgt 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, orrgt blamein the repository and look for apiorigin step.