cloudcli-plugin-task-queue

June 25, 2026 · View on GitHub

CloudCLI tab plugin for task queue management on forge. Provides a browser UI inside the CloudCLI web interface to view, filter, and act on agent tasks without leaving the editor.

Overview

The plugin runs two components:

  • UI (dist/index.js) — Renders a tab panel inside CloudCLI. Shows a filterable task list and detail view with history timeline and context ref previews.
  • Backend server (dist/server.js) — HTTP + WebSocket server launched by CloudCLI. Reads task YAML directly from ~/.claude/task-queue/ (list/detail) and watches it for file changes. Mutations (approve, cancel, status change, quarantine, restore) are proxied to the task-queue-mcp HTTP control API (TASK_QUEUE_API, default http://127.0.0.1:8485), gated by a shared-secret header — so every write inherits the MCP core's transition validation and fcntl locking. The plugin no longer writes queue YAML directly.

The backend picks a free ephemeral port at startup and reports it to CloudCLI via JSON on stdout. The UI communicates with the backend via the CloudCLI plugin RPC API (api.rpc()), which proxies requests to the backend.

Live task updates arrive via WebSocket — the backend watches ~/.claude/task-queue/*.yml and pushes a tasks event to connected UI clients when files change. The UI debounces refreshes by 2s.

Features

  • Task list with filters by agent, status, and task type
  • Detail view: full task data, history timeline, context ref file previews (confined to ~/.claude/comms/ and ~/.claude/task-queue/)
  • Session launch: review mode (plan permission, agent presents summary then waits) or auto mode (agent claims and executes)
  • Lifecycle actions (all via the shared-secret control API, actor operator):
    • Approve a submitted / pending task
    • Cancel a non-terminal task — a graceful terminal record (recoverable as a record, never deleted) instead of mislabeling it failed
    • Quarantine / restore — isolate a task to quarantine/ (drops from the list) and restore it later
    • Status change — advance a task an agent missed (audited operator override)
  • Live connection indicator (WebSocket dot: green = live, grey = disconnected)
  • Manual refresh button

Installation

Requires Node.js 20+ and CloudCLI running on localhost:3001.

cd ~/repos/personal/cloudcli-plugin-task-queue
npm install
./deploy.sh

deploy.sh builds the TypeScript, copies the plugin to ~/.claude-code-ui/plugins/cloudcli-plugin-task-queue/, and toggles the plugin via the CloudCLI API to restart the backend server.

Environment variables

VariableDefaultPurpose
TASK_QUEUE_APIhttp://127.0.0.1:8485Base URL of the task-queue-mcp HTTP control API (mutations)
TASK_QUEUE_API_SECRETShared secret sent as X-Task-Queue-Secret on every mutation. Required — mutations fail closed if unset. Provisioned in ~/.secrets/forge.env, never in source.
CLOUDCLI_ORIGINAdditional allowed WebSocket origin (added to localhost:3001)

Dependencies

PackagePurpose
wsWebSocket server

Plugin manifest (manifest.json)

FieldValue
nametask-queue
displayNameTask Queue
slottab
entrydist/index.js (UI)
serverdist/server.js (backend)

Backend API

The backend server exposes a small HTTP API consumed by the UI via api.rpc().

MethodPathDescription
GET/healthLiveness check; returns {status, uptime, version}
GET/tasksList tasks; query params: agent, status, type
GET/tasks/:idTask detail + context ref previews
POST/tasks/:id/startLaunch headless agent session; body {mode: "review"|"auto"} (client-side spawn, not a queue mutation)
POST/tasks/:id/approveApprove — proxied to the control API
POST/tasks/:id/cancelCancel (terminal); body {note?} — proxied to the control API
POST/tasks/:id/statusOperator status change; body {status, note?, allow_override?} — proxied to the control API
POST/tasks/:id/quarantineIsolate to quarantine/ — proxied to the control API
POST/tasks/:id/restoreRestore from quarantine/ — proxied to the control API

Reads (/tasks, /tasks/:id) are served directly from the queue YAML. Mutations proxy to the task-queue-mcp control API with the X-Task-Queue-Secret header.

WebSocket upgrade is handled on the same port. Clients receive {type: "connected"} on connect and {type: "tasks", count, changed} when task files change.

Session launch behavior

ModePermission modeAgent prompt
reviewplanRead task, present summary, wait for approval
autodefaultRead task, claim it (in-progress), execute

Agent project directories are resolved from the hardcoded map in server.js:

AgentProject dir
sysadmin~/.claude/projects/sysadmin
developer~/.claude/projects/developer
research~/.claude/projects/research
writer~/.claude/projects/writer
security~/.claude/projects/security

Build

npm run build
# Compiles TypeScript + bundles server.js and index.js to dist/

Build uses tsc for type checking and esbuild for bundling (ESM format).

Deployment

After initial ./deploy.sh, subsequent deploys follow the same script: build → disable plugin → copy files → re-enable plugin → verify status.

The plugin lives at ~/.claude-code-ui/plugins/cloudcli-plugin-task-queue/. CloudCLI manages the backend process lifecycle.