@matheusbbarni/pi-message-queue
v0.2.5
Published
A Pi extension for queueing user messages and sending them one after another.
Maintainers
Readme
@matheusbbarni/pi-message-queue
Persistent FIFO for Pi. Queue follow-ups while a run is in progress, then let Pi send them one at a time.
While Pi is working, Enter queues a follow-up here. Use Ctrl+Shift+S or /steer when you want to interrupt the current turn.
The package wraps the current editor instead of replacing it, so Amp/Zentui chrome and command palettes stay in place. Queue state lives in the session as custom entries, so it survives /reload, resume, and tree navigation. It is not sent to the model.
Features
- FIFO follow-ups that persist across reload, resume, and tree navigation
- One-at-a-time dispatch when Pi is idle
- Editor wrap that keeps Amp/Zentui chrome intact
- Below-editor widget plus footer count
- Pause, resume, edit-last, and steer without leaving the queue
Install
pi install npm:@matheusbbarni/pi-message-queueFrom this repo:
pi -e ./pi-message-queueOr as a local package:
pi install ./pi-message-queue[!TIP] If Pi is already open, run
/reload.
While Pi is working
| Input | Where it goes |
| --- | --- |
| Enter | This queue |
| Ctrl+Shift+S | Native steer. Not this queue. |
| Alt+Enter | Native steer if the terminal delivers it. Often dead on macOS. |
| /steer …, /queue steer … | Native steer. Not this queue. |
| /queue …, /q …, Ctrl+Shift+Q | This queue |
Use this package when you want a follow-up that waits, persists, and can be edited. Use Ctrl+Shift+S or /steer when you want to interrupt the current turn.
[!IMPORTANT] On macOS, Option+Enter usually never reaches Pi. Do not rely on Alt+Enter.
/qis a short alias for/queue add. If you already have a prompt template namedq, this command wins.
Commands
| Command | What it does |
| --- | --- |
| /queue <message> | Append |
| /queue add <message> | Append. Same as /q <message> |
| /queue next <message> | Put at the front |
| /queue list | Show pending messages (ls, status) |
| /queue remove <n> | Remove 1-based position |
| /queue remove #<id> | Remove by id |
| /queue edit-last | Pull the last queued message back into the editor |
| /queue pause / /queue resume | Stop or start dispatch (stop, start, unpause) |
| /queue clear | Drop pending messages. An in-flight send is kept |
| /queue show / /queue hide | Toggle the below-editor widget |
| /queue steer <message> | Steer the current turn. Same as /steer <message> |
| /queue help | Compact help |
Keys
- Enter queues a follow-up here while Pi is working
- Ctrl+Shift+S steers the current turn with the editor text
- Alt+Enter also steers if the terminal reports it
- Ctrl+Shift+Q queues the current editor text and clears the editor
- Ctrl+Shift+R pauses or resumes dispatch
- Shift+Left restores the last queued message to the editor (editor must be empty)
/steer with no arguments uses the current editor text. If Pi is idle, it sends immediately.
A footer status shows the count. The widget lists a short preview of the next few items, plus pause/resume, steer, and edit-last hints. When the queue is paused, the title says (paused) and the hint line starts with ctrl+shift+r resume.
Dispatch
The queue sends one message at a time, and only when Pi is idle with no native pending messages. After one finishes, the next goes out automatically unless you paused the queue.
/skill:…and prompt templates expand when dispatched- queued
/newand/reloadrun as Pi commands, not prompt text - leftover items after a queued
/newmove into the new session - unknown slash commands stay queued if the editor is busy, or get restored to the editor if it is empty
- a failed or unconfirmed send pauses the queue instead of leaving it stuck
- you cannot remove, edit, or clear the message currently being sent
Development
npm install
npm test
npm run typecheck