@matheusbbarni/pi-message-queue

A Pi extension for queueing user messages and sending them one after another.

Packages

Package details

extension

Install @matheusbbarni/pi-message-queue from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@matheusbbarni/pi-message-queue
Package
@matheusbbarni/pi-message-queue
Version
0.2.5
Published
Aug 25, 2026
Downloads
1,184/mo · 33/wk
Author
matheusbbarni
License
MIT
Types
extension
Size
48.5 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "index.ts"
  ]
}

Security note

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

README

@matheusbbarni/pi-message-queue

npm Pi package

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

From this repo:

pi -e ./pi-message-queue

Or 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.

/q is a short alias for /queue add. If you already have a prompt template named q, 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 /new and /reload run as Pi commands, not prompt text
  • leftover items after a queued /new move 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