@wddgda/pi-recent-messages
v0.1.0
Published
Pi extension that keeps the five most recent user messages above the editor
Readme
pi-recent-messages
A lightweight Pi extension that keeps the five most recent user messages above the editor.
Features
- Shows the latest five user messages from the active session branch.
- Keeps previews bounded to 160 characters with head-and-tail truncation.
- Opens a keyboard selector with
Ctrl+Shift+Ror/recent. - Uses
↑/↓andEnterto jump to a rendered message. - Includes a permanent
↓ back to bottomaction. - Marks skill, image-only, and compacted messages as preview-only.
- Never changes the active session branch.
Install
pi install npm:@wddgda/pi-recent-messagesRun /reload in Pi, then set TUI mode to fullscreen in /settings.
The extension lives at extensions/recent-messages.ts inside the package; Pi's package manager loads it through the pi.extensions manifest in package.json.
Usage
- Press
Ctrl+Shift+Ror run/recent. - Press
↑/↓to select a message. - Press
Enterto jump, orEscto close. - The selector starts on
↓ back to bottom, soEnterreturns immediately to the latest output.
Resource behavior
The extension does not call a model, access the network, create a persistent cache, write session data, use WAL, or start timers/watchers. After Pi loads the extension, it reads only the in-memory active branch and rendered context.
Compatibility
Tested with Pi 0.84.4 in experimental fullscreen mode. Message jumping uses fullscreen layout internals because Pi does not currently expose a public message-anchor API; future Pi releases may require an adapter update. Regular mode can display the widget, but transcript jumping requires fullscreen.
Test
No install step is needed for local development; Node's built-in TypeScript support runs the tests directly:
node --test test/recent-messages.test.tsLicense
MIT
