Skip to content

tychoish/agent-shell-queue

Repository files navigation

agent-shell-queue.el — Persistent prompt queue for agent-shell

Overview

A persistent prompt queue for agent-shell sessions, supporting multi-session dispatch with pause, resume, and archive lifecycle management. Queue state is serialized to plist, JSON, or YAML for session persistence across Emacs restarts. Interactive capture, edit, and item-view buffers allow queue manipulation without leaving Emacs. Fork operations split a queue across multiple sessions for parallel workloads.

This repository also includes agent-shell-menu.el: ACR-based transient menus for navigating and controlling agent sessions, covering permission resolution, action selection, command insertion, and collapse control. The menu requires the queue and can be loaded separately with (require 'agent-shell-menu).

Contents

Installation

package-vc.el

Requires Emacs 29.1+. Run once to clone and register the package:

(package-vc-install '(agent-shell-queue
                      :url "https://github.com/tychoish/agent-shell-queue"))

use-package with VC

Requires Emacs 30+. Installs on first load if not already present:

(use-package agent-shell-queue
  :vc (:url "https://github.com/tychoish/agent-shell-queue")
  :after agent-shell)

Use Package

git clone https://github.com/tychoish/agent-shell-queue ~/.emacs.d/elpa/agent-shell-queue
(use-package agent-shell-queue
  :load-path "~/.emacs.d/elpa/agent-shell-queue"
  :after agent-shell)

Manual

git clone https://github.com/tychoish/agent-shell-queue ~/.emacs.d/elpa/agent-shell-queue
(add-to-list 'load-path "~/.emacs.d/elpa/agent-shell-queue")
(require 'agent-shell-queue)

API Reference

Alist mapping label strings to commands for ‘agent-shell-select-action’. Each entry is either (LABEL . COMMAND) or (LABEL . (COMMAND . PREDICATE)). When a PREDICATE is supplied it is called with no arguments; the entry is omitted from the menu when the predicate returns nil.

Buffer/session management

agent-shell-switch-buffer [Command]

Switch to an agent-shell buffer with status, cwd, context, and age annotations.

Permission resolution

agent-shell-resolve-permission [Command]

Resolve a pending permission prompt via ‘annotated-completing-read’.

Action menu

agent-shell-select-action [Command]

Pick a common agent-shell action and run it via ‘call-interactively’. When a permission request is pending, permission responses are spliced into the menu.

Project session switching

agent-shell-menu-project-buffers

Return live agent-shell buffers sharing the current buffer’s project directory.

agent-shell-switch-project-session [Command]

Switch to another agent-shell session in the same project directory.

Send content to agent shell

agent-shell-menu-send-file [Command]

Prompt for a file and send it to the current agent-shell session. Uses ‘read-file-name’ for file selection, integrating with Consult/Vertico.

agent-shell-menu-send-buffer [Command]

Pick a buffer and send its contents to the current agent-shell session. File-visiting buffers are sent as @file references; others as raw text.

Transient menus

agent-shell-session-menu [Command]

no docstring

Command menu

agent-shell-select-command [Command]

Insert one of the agent’s advertised ‘/’ commands at the prompt.

Collapse menu

agent-shell-select-collapse [Command]

Pick a collapse action via ‘annotated-completing-read’. Offers bulk expand/collapse, per-category toggles, and entries to flip the three expand-by-default customization variables.

Session info buffer

agent-shell-session-info [Command]

Display a read-only ephemeral buffer with live session diagnostics. Shows fragment count, agent uptime, queue options, queue depth, and the underlying shell process uptime for the current agent-shell buffer.

Variables

agent-shell-queue-db-file [Variable]

Path to the SQLite database file used by the queue DB backend. When nil, the path is derived from ‘user-emacs-directory’ as “agent-shell-queue.db”. Set before calling ‘agent-shell-queue-db-enable’ to store the database at a custom location.

Enable / disable

agent-shell-queue-db-enable [Command]

Activate the SQLite persistence backend for agent-shell-queue. When DB-FILE is non-nil, use it as the database path; otherwise the default path under ‘user-emacs-directory’ is used (see ‘agent-shell-queue-db-file’). Sets ‘agent-shell-queue-save-function’, ‘agent-shell-queue-load-function’, and ‘agent-shell-queue-state-file-function’ to SQLite-aware variants. Saves the previous values so ‘agent-shell-queue-db-disable’ can restore them.

agent-shell-queue-db-disable [Command]

Deactivate the SQLite backend and revert to the previous persistence settings. Closes the database connection.

Show state

agent-shell-queue-db-show-state [Command]

Display the SQLite database contents in a read-only popup buffer. Shows per-bucket item counts and a tabular dump of all persisted rows.

Export

agent-shell-queue-db-export [Command]

Export current queue items from SQLite to a YAML buffer. Loads current state from the DB then delegates to ‘agent-shell-queue-export’.

Import

agent-shell-queue-db-import [Command]

Import queue items from YAML into the SQLite database. SOURCE follows the same convention as ‘agent-shell-queue-import’: nil or ‘clipboard’ reads from the clipboard; ‘file’ prompts for a file. After importing, the DB is flushed immediately.

Org heading → queue capture

agent-shell-queue-org-refile-from-heading [Command]

Capture the current org heading’s subtree text into the agent-shell-queue. Opens a queue capture buffer pre-seeded with the heading content. With prefix arg REMOVE-ORIGINAL, delete the original subtree immediately after opening the capture buffer.

agent-shell-queue-serialization-format [Variable]

Format used to persist queue state to disk. One of: ‘plist’ — s-expression with keyword-keyed plists (default; no extra deps) ‘json’ — JSON via built-in ‘json-serialize’/‘json-parse-string’ (Emacs 27+) ‘yaml’ — YAML via ‘yaml-encode’/‘yaml-parse-string’ from the ‘yaml’ package

agent-shell-queue-save-function [Variable]

When non-nil, called instead of the default file-based save logic. The function is called with no arguments and must persist the current queue items to a durable store. Used by backends such as ‘agent-shell-queue-db’ to bypass file I/O.

agent-shell-queue-load-function [Variable]

When non-nil, called instead of the default file-based load logic. The function is called with no arguments and must populate the queue items from a durable store. Used by backends such as ‘agent-shell-queue-db’ to bypass file I/O.

agent-shell-queue-safe-save [Variable]

When non-nil, write a versioned backup before each queue state save. Backups are written to ‘agent-shell-queue-safe-save-directory’ using the format selected by ‘agent-shell-queue-safe-save-format’. Has no effect when ‘agent-shell-queue-save-function’ is set.

agent-shell-queue-safe-save-directory [Variable]

Directory for versioned queue backups written when ‘agent-shell-queue-safe-save’ is non-nil. Nil means use a subdirectory of ‘temporary-file-directory’ named “emacs-<instance>” where <instance> comes from ‘agent-shell-queue-instance-name’.

agent-shell-queue-safe-save-format [Variable]

Serialization format for safe-save backups, or nil to use ‘agent-shell-queue-serialization-format’.

agent-shell-queue-instance-name [Variable]

Instance identifier written into archive records. May be a string or a zero-argument function that returns a string. Defaults to the daemon name or system hostname. Override in config: (setq agent-shell-queue-instance-name “<name>”) (setq agent-shell-queue-instance-name ‘get-instance-name

agent-shell-queue-done-log-file [Variable]

File path for appending completed queue items as JSON lines. When nil (the default), completed items are not logged to disk.

agent-shell-queue-archive-enabled [Variable]

When non-nil, completed items can be archived and ‘agent-shell-queue-buffer-archive’ is active. The destination path is controlled separately by ‘agent-shell-queue-archive-file-function’. Set to t to enable archiving.

agent-shell-queue-archive-file-function [Variable]

Function returning the JSONL archive file path. Called with no arguments. Override to store the archive at a custom location. Only consulted when ‘agent-shell-queue-archive-enabled’ is non-nil.

agent-shell-queue-auto-flush-interval [Variable]

Seconds between automatic queue flushes. Set to nil to disable.

agent-shell-queue-write-log-max-entries [Option]

Maximum entries retained in ‘agent-shell-queue–write-log’.

agent-shell-queue-write-log-enabled [Option]

When non-nil, append each persistence event to agent-shell-queue-log and emit a message.

agent-shell-queue-show-write-log [Command]

Display the in-memory write log in a readable buffer.

agent-shell-queue-instance-name [Variable]

Instance identifier written into archive records. May be a string or a zero-argument function that returns a string. Defaults to the daemon name or system hostname. Override in config: (setq agent-shell-queue-instance-name “<name>”) (setq agent-shell-queue-instance-name ‘get-instance-name

Configuration

agent-shell-queue-serialization-format [Variable]

Format used to persist queue state to disk. One of: ‘plist’ — s-expression with keyword-keyed plists (default; no extra deps) ‘json’ — JSON via built-in ‘json-serialize’/‘json-parse-string’ (Emacs 27+) ‘yaml’ — YAML via ‘yaml-encode’/‘yaml-parse-string’ from the ‘yaml’ package

agent-shell-queue-idle-delay [Variable]

Idle delay in seconds for the backup auto-send timer. Primary draining happens via ‘shell-maker-finish-output’ advice; this timer is only a safety net for buffers that become idle outside that path.

agent-shell-queue-background-prefix [Variable]

String prepended to prompts flagged for background sub-agent execution.

agent-shell-queue-clear-command [Variable]

Command string sent when a clear item is dequeued.

agent-shell-queue-done-log-file [Variable]

File path for appending completed queue items as JSON lines. When nil (the default), completed items are not logged to disk.

agent-shell-queue-state-file-function [Variable]

Function returning the path to the queue state file.

agent-shell-queue-pick-buffer-function [Variable]

Function called with a PROMPT string to pick an agent-shell buffer.

agent-shell-queue-archive-enabled [Variable]

When non-nil, completed items can be archived and ‘agent-shell-queue-buffer-archive’ is active. The destination path is controlled separately by ‘agent-shell-queue-archive-file-function’. Set to t to enable archiving.

agent-shell-queue-archive-file-function [Variable]

Function returning the JSONL archive file path. Called with no arguments. Override to store the archive at a custom location. Only consulted when ‘agent-shell-queue-archive-enabled’ is non-nil.

agent-shell-queue-response-max-length [Option]

Maximum length (in characters) of captured response text to store. Responses longer than this are truncated with a “…[truncated]” suffix.

This prevents very large responses from bloating the queue state file. Set to nil to disable truncation and store full responses.

Default: 8192 (8KB) — balances completeness with file size.

agent-shell-queue-response-max-length-absolute [Variable]

Absolute maximum length (1MB) for response text, regardless of configuration. This hard limit prevents pathological cases from consuming excessive memory or creating unmanageable state files. Applies even when ‘agent-shell-queue-response-max-length’ is nil.

agent-shell-queue-auto-flush-interval [Variable]

Seconds between automatic queue flushes. Set to nil to disable.

agent-shell-queue-before-reload-hook [Variable]

Hook run just before code and state are reloaded. Queue is paused and flushed to disk before this hook fires.

agent-shell-queue-after-reload-hook [Variable]

Hook run after code and state have been reloaded from disk.

agent-shell-queue-save-function [Variable]

When non-nil, called instead of the default file-based save logic. The function is called with no arguments and must persist the current queue items to a durable store. Used by backends such as ‘agent-shell-queue-db’ to bypass file I/O.

agent-shell-queue-load-function [Variable]

When non-nil, called instead of the default file-based load logic. The function is called with no arguments and must populate the queue items from a durable store. Used by backends such as ‘agent-shell-queue-db’ to bypass file I/O.

agent-shell-queue-safe-save [Variable]

When non-nil, write a versioned backup before each queue state save. Backups are written to ‘agent-shell-queue-safe-save-directory’ using the format selected by ‘agent-shell-queue-safe-save-format’. Has no effect when ‘agent-shell-queue-save-function’ is set.

agent-shell-queue-safe-save-directory [Variable]

Directory for versioned queue backups written when ‘agent-shell-queue-safe-save’ is non-nil. Nil means use a subdirectory of ‘temporary-file-directory’ named “emacs-<instance>” where <instance> comes from ‘agent-shell-queue-instance-name’.

agent-shell-queue-safe-save-format [Variable]

Serialization format for safe-save backups, or nil to use ‘agent-shell-queue-serialization-format’.

Registries

agent-shell-queue-strict-buffer-assignment [Option]

When non-nil, signal ‘user-error’ when no compatible live buffer exists. When nil (default), fall through to nil/unassigned assignment instead.

Data model

agent-shell-queue-intercept-mode [Variable]

When non-nil in an agent-shell buffer, capture user-typed turns as queue items.

agent-shell-queue-input-mode [Variable]

Current input routing mode for this agent-shell buffer. One of ‘default’ (normal shell input), ‘queue-intercept’ (capture user input as queue items while still submitting), or ‘queue-only’ (no prompt; all input routed through the queue). Set via ‘agent-shell-queue-set-input-mode’.

agent-shell-queue-disable-intercept-mode-all [Command]

Reset all live agent-shell buffers in queue-intercept mode to default.

agent-shell-queue-blocked-session-modes [Variable]

Session mode IDs that block queue dispatch. When a target shell is in one of these modes the item is not sent and the session queue is paused until the mode changes.

Persistence — implementation in agent-shell-queue-persistence.el

agent-shell-queue-buffer-archive [Command]

Archive the item at point to the archive file and remove it from the queue. Archiving must be enabled via ‘agent-shell-queue-archive-enabled’. The destination path is provided by ‘agent-shell-queue-archive-file-function’.

Queue operations

agent-shell-queue-enqueue-emacs [Command]

Open an Emacs Lisp capture buffer to compose a form for BUF’s queue. The capture buffer is in ‘emacs-lisp-mode’. Confirm with C-c C-c, cancel with C-c C-k. When dispatched, the form is evaluated via ‘eval’; errors are reported as messages and the item is marked done. BUF may be nil to enqueue to the unassigned bucket.

agent-shell-queue-enqueue-emacs-command [Command]

Enqueue an interactive COMMAND to run in Emacs for BUF’s queue. COMMAND is selected via ‘read-command’ (completing-read over all commands). When dispatched, the command is invoked with ‘call-interactively’. BUF may be nil to enqueue to the unassigned bucket.

agent-shell-queue-enqueue-shell-eshell [Command]

Open a shell capture buffer to compose a command for eshell BUF. The capture buffer is in ‘sh-mode’. Confirm with C-c C-c. BUF may be nil to enqueue to the unassigned bucket.

agent-shell-queue-enqueue-shell-eat [Command]

Open a shell capture buffer to compose a command for eat BUF. The capture buffer is in ‘sh-mode’. Confirm with C-c C-c. BUF may be nil to enqueue to the unassigned bucket.

agent-shell-queue-item-done-hook [Variable]

Hook run when a queue item transitions to done status. Each function is called with two arguments: BUF-NAME and ITEM.

Queue buffer

agent-shell-queue-flush [Command]

Force-save queue state to disk immediately.

agent-shell-queue-reload [Command]

Pause, flush, reload source code, and reload state from disk. Stops the idle timer, drops all turn-complete subscriptions, reloads ‘agent-shell-queue.el’ from source, re-reads queue state from disk, and reinstates subscriptions for buffers with active/running items. Queue remains paused after reload; call ‘agent-shell-queue-resume’ when ready.

agent-shell-queue-clear-unparsable [Command]

Remove items whose struct fields cannot be read; print each to Messages. Useful after a code reload that left in-memory structs with mismatched layouts. When called interactively, prompts y/n/a for each candidate before removing it. Affected buffer queues are paused and the queue state is saved.

agent-shell-queue-show-disk-state [Command]

Display the on-disk queue state file in a read-only popup buffer.

Display configuration

agent-shell-queue-show-buffer-column [Variable]

Show the Buffer column in the queue buffer. Toggle interactively with ‘agent-shell-queue-toggle-buffer-column’ (db in the menu).

agent-shell-queue-show-ordinal-column [Variable]

Show the ordinal (#) column in the queue buffer.

agent-shell-queue-show-age-column [Variable]

Show the Age column in the queue buffer.

agent-shell-queue-show-kind-column [Variable]

Show the Kind column in the queue buffer.

agent-shell-queue-multiline-format [Variable]

Display prompt on a second line with a separator between items. When non-nil, ‘<down>’ and ‘<up>’ move by item rather than by line.

agent-shell-queue-set-scope [Command]

Narrow the queue buffer view: choose global, a directory, or a specific buffer.

agent-shell-queue-scope-global [Command]

Reset the queue buffer to the global scope (show all items).

agent-shell-queue-export [Command]

Export items in the current scope to a read-only YAML buffer. Multi-line prompt and response fields are formatted as YAML literal block scalars.

agent-shell-queue-mode-map [Variable]

Keymap for ‘agent-shell-queue-mode’.

agent-shell-queue-insert-pause [Command]

Insert a pause item into BUF’s queue, optionally at 1-based POSITION. When called interactively, prompts for the target buffer.

agent-shell-queue-insert-clear-context [Command]

Insert a context-drop item with PROMPT into BUF’s queue. When called interactively, prompts for target buffer and context text.

agent-shell-queue-insert-wait [Command]

Insert a wait-until item into BUF’s queue. Prompts for a target date/time; uses ‘org-read-date’ when available, otherwise reads a string parseable by ‘date-to-time’ (e.g. “2026-05-16 14:30”). When dispatched the item blocks the queue until the target time is reached, then marks itself done and advances to the next item automatically.

Item-view action table — single source of truth for keys, transient, and ACR menu

agent-shell-queue-item-view-mode-map [Variable]

Keymap for ‘agent-shell-queue-item-view-mode’.

agent-shell-queue-archive-done-n [Command]

Archive the N oldest done items across all queues. Errors if archiving is not enabled.

agent-shell-queue-archive-done-all [Command]

Archive all done items across all queues. Errors if archiving is not enabled or no done items exist.

agent-shell-queue-toggle-archive [Command]

Toggle ‘agent-shell-queue-archive-enabled’ and report the new state.

agent-shell-queue-load-archive [Command]

Import items from the JSONL archive file into the queue as active items. FILE defaults to the path returned by ‘agent-shell-queue-archive-file-function’; when called interactively with a prefix argument, prompts for a file path.

Item raw inspect

agent-shell-queue-inspect-mode-map [Variable]

Keymap for ‘agent-shell-queue-inspect-mode’.

agent-shell-queue-buffer-inspect-item [Command]

Open a read-only raw-serialization view of the queue item at point. Prompts for the serialization format (p=plist j=json y=yaml in the buffer).

agent-shell-queue-item-view-inspect [Command]

Open a raw-serialization view of the item shown in this buffer. Prompts for the serialization format (p=plist j=json y=yaml in the buffer).

Transient predicates

agent-shell-queue-buffer-open [Command]

Open (or refresh) the agent-shell-queue buffer.

agent-shell-queue-buffer-switch [Command]

Switch to the agent-shell-queue buffer in the current window.

agent-shell-queue-capture [Command]

Open a capture buffer targeting BUF (nil adds to the unassigned queue). When called interactively from an agent-shell buffer, targets that buffer. With a prefix argument, opens an unassigned capture instead.

Display toggle commands

agent-shell-queue-select-columns [Command]

Pick column display options via ‘annotated-completing-read’. Offers bulk presets, per-column visibility toggles, and the multi-line format switch. Changes take effect immediately via ‘agent-shell-queue-buffer-refresh’.

Edit popup

agent-shell-queue-edit-mode-map [Variable]

Keymap for ‘agent-shell-queue-edit-mode’.

agent-shell-queue-edit-task [Command]

Edit a queued item’s prompt. In ‘agent-shell-queue-mode’ without SELECT (prefix argument): edit the item at point immediately. With SELECT, or when point carries no item, or when called from outside ‘agent-shell-queue-mode’: select via annotated-completing-read. Candidates include all non-done, non-running items across all buffers.

Capture buffer

agent-shell-queue-capture-mode-map [Variable]

Keymap for ‘agent-shell-queue-capture-mode’.

Entry points

agent-shell-queue-enqueue [Command]

Queue PROMPT for BUF, optionally flagged for BACKGROUND sub-agent execution. Send immediately if BUF is idle, otherwise store in the queue. When called interactively, opens a capture buffer for composing the prompt.

agent-shell-queue-enqueue-clear [Command]

Enqueue a clear command for BUF. Uses ‘agent-shell-queue-clear-command’ as the prompt.

agent-shell-queue-capture-unassigned [Command]

Open a capture buffer to compose a prompt for the unassigned queue. Unassigned items display in blue and can later be assigned to a shell via ‘t’.

agent-shell-queue-capture-from-region [Command]

Open a capture buffer pre-seeded with the active region text. When no region is active, opens an empty capture. BUF is the target agent-shell buffer; nil adds to the unassigned queue.

agent-shell-queue-capture-from-context [Command]

Open a capture buffer pre-seeded with a string selected from context. Candidates include thing-at-point, the active region, the current line, and the kill ring. BUF is the target agent-shell buffer; nil for the unassigned queue.

agent-shell-queue-capture-from-clipboard [Command]

Open a capture buffer pre-seeded with the current clipboard contents. BUF is the target agent-shell buffer; nil adds to the unassigned queue.

Raw edit mode

agent-shell-queue-raw-edit-mode-map [Variable]

Keymap for ‘agent-shell-queue-raw-edit-mode’.

agent-shell-queue-raw-edit [Command]

Open the queue for direct YAML editing. The queue is paused while the edit buffer is live. Confirm changes with M-x agent-shell-queue-raw-edit-confirm; cancel with M-x agent-shell-queue-raw-edit-cancel.

Import

agent-shell-queue-import [Command]

Import queue items from YAML. With no prefix arg reads from clipboard; with prefix arg prompts for a file. For each item whose ID already exists, prompts to keep, replace, or assign new ID.

Fork Queue Operations

agent-shell-queue-fork-default-mode [Variable]

Default mode for creating new sessions when forking a queue. ‘new’ creates a clean new session via ‘agent-shell-new-shell’. ‘fork’ uses the ACP fork session option via ‘agent-shell-fork’.

agent-shell-queue-fork-session [Command]

Fork the queue for SOURCE-BUF starting at FROM-ID into a new agent-shell session.

Items at or after FROM-ID (by queue position among active/deferred/draft items) are moved to the new session. When FROM-ID is nil, all eligible items are moved. The original session is paused during session creation.

OPTS is a plist with these keys: :fork-mode Symbol ‘new’ (default) or ‘fork’ — how to create the new session. ‘new’ calls ‘agent-shell-new-shell’; ‘fork’ calls ‘agent-shell-fork’. :use-worktree Non-nil — create a git worktree for the new session. :worktree-path String — explicit worktree path (auto-generated when nil). :worktree-branch String — new branch name for the worktree. :capture-pending Non-nil — mark items at/after FROM-ID as ‘pending-fork’ in the original session instead of moving them, then leave the session paused so new items can be inserted before the frozen ones.

agent-shell-queue-release-pending-fork [Command]

Release all pending-fork items in BUF back to active status and resume dispatch. BUF defaults to the current agent-shell session when called from one.

agent-shell-queue-insert-fork-before [Command]

Insert a fork task into BUF’s queue immediately before ITEM-ID. When ITEM-ID is nil, appends to the end of the queue. When the fork task is dispatched (as an emacs item), it forks the queue starting at the item that follows the fork task in the queue at dispatch time. OPTS is the fork options plist (see ‘agent-shell-queue-fork-session’).

agent-shell-queue-insert-fork-after [Command]

Insert a fork task into BUF’s queue immediately after ITEM-ID. When ITEM-ID is nil, appends to the end of the queue. When the fork task is dispatched, it forks the queue starting at the next item after the fork task (determined dynamically at dispatch time). OPTS is the fork options plist (see ‘agent-shell-queue-fork-session’).

agent-shell-queue-buffer-fork [Command]

Fork the queue starting at the item at point into a new session. Prompts interactively for fork options; uses annotated-completing-read when called outside the queue buffer to build options without task-at-point context.

agent-shell-queue-buffer-insert-fork-before [Command]

Insert a fork queue item before the item at point. Prompts for fork options interactively.

agent-shell-queue-buffer-insert-fork-after [Command]

Insert a fork queue item after the item at point. Prompts for fork options interactively.

Interjection

agent-shell-queue-interjection-continuation-suffix [Variable]

Text appended to the interjection prompt before sending. Set to nil to send the user’s text verbatim without a continuation instruction.

agent-shell-queue-interjection-mode-map [Variable]

Keymap for ‘agent-shell-queue-interjection-mode’.

Queue-only mode

agent-shell-queue-input-mode-default [Option]

Default input routing mode for new agent-shell sessions. One of ‘default’ (normal shell input), ‘queue-intercept’ (capture user input as queue items while still submitting), or ‘queue-only’ (no prompt; all input routed through the queue). Use ‘agent-shell-queue-set-input-mode-default’ to change this and sync all existing sessions simultaneously.

agent-shell-queue-set-input-mode-default [Command]

Set ‘agent-shell-queue-input-mode-default’ to MODE and sync all existing sessions. MODE is prompted interactively from the three valid options. All live agent-shell buffers are immediately updated to the new default.

agent-shell-queue-reset-all-input-modes [Command]

Reset all live agent-shell buffers to default input mode.

agent-shell-queue-toggle-intercept-default [Command]

Toggle queue-intercept as the default input mode and sync all sessions.

agent-shell-queue-toggle-only-default [Command]

Toggle queue-only as the default input mode and sync all sessions.

agent-shell-queue-ready-capture [Command]

Clear the ready overlay and open the queue enqueue dispatch menu. Any keypress in queue-only mode at the idle prompt routes here, giving access to all registered item kinds rather than prompt-only capture.

agent-shell-queue-only-mode [Command]

Route all agent-shell input through the queue; show <ready> when idle.

This is a minor mode. If called interactively, toggle the ‘Agent-Shell-Queue-Only mode’ mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is ‘toggle’. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable ‘agent-shell-queue-only-mode’.

The mode’s hook is called both when the mode is enabled and when it is disabled.

Key Binding

RET agent-shell-queue-ready-capture SPC agent-shell-queue-ready-capture

<remap> <self-insert-command> agent-shell-queue-ready-capture

License

Copyright (C) tychoish. GPL-3.0 or later. See the source file header for the full license text.

About

Persistent prompt queue for agent-shell sessions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors