@edgehero/pi-dispatch-admin 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +54 -21
  2. package/package.json +11 -4
package/README.md CHANGED
@@ -1,33 +1,66 @@
1
- # @edgehero/pi-dispatch-admin
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/banner.png" alt="pi-dispatch — run the pi coding agent as a self-hosted service" width="880">
3
+ </p>
2
4
 
3
- The **operator console** for [**pi-dispatch**](https://github.com/edgehero/pi-dispatch) — a
4
- [pi](https://github.com/earendil-works/pi) extension that adds a `/dispatch` command (a live TUI overlay +
5
- model-callable tools) for running the pi coding agent as a self-hosted service.
5
+ # pi-dispatch — run the pi coding agent as a self-hosted service
6
6
 
7
- > This is a **companion** to a running pi-dispatch deployment. It reads that deployment's Valkey queue and
8
- > run-history — install it in your own pi, alongside the pi-dispatch service. On its own it will show
9
- > "queue unreachable".
7
+ **[pi](https://github.com/earendil-works/pi) is a superb coding agent — but it has no job queue, no spend limit, and, by its own README, no permission system.** pi-dispatch is the operational layer that adds exactly those, so you can run pi **unattended and safely**: on a cron schedule, on your repo's GitHub issues and PRs, or straight from the CLI — every job in an isolated container, with spend bounded *before* a single token is spent.
10
8
 
11
- ## What it gives you
9
+ > This npm package — **`@edgehero/pi-dispatch-admin`** — is the **operator console** (a pi extension). The queue, worker, container image, and GitHub receiver that make up the service live in the [main repo](https://github.com/edgehero/pi-dispatch); install this to **drive** a deployment, and get the whole thing there.
12
10
 
13
- - A `/dispatch` overlay: live queue state, day/week/month **spend meters** + a daily token counter, run
14
- history with per-job token & cost, and a unified **triggers** pane (cron / label / comment / pull_request).
15
- - **Editable** triggers and **scheduled pause windows** ("quiet hours" per folder/repo), applied live.
16
- - **Confirm-gated** model tools so an agent can operate the deployment (change limits, manage triggers/pauses)
17
- with **a human approving each change** — fail-closed when no operator is present.
18
- - The bundled `operate-pi-dispatch` **skill** documenting those human-in-the-loop gates.
11
+ ## How it works
19
12
 
20
- ## Install
13
+ Every trigger produces the same job, through the same path — one queue, one container, one budget:
14
+
15
+ ```
16
+ CLI · cron · GitHub issue / PR
17
+ │ enqueue
18
+ ▼
19
+ Valkey + BullMQ durable queue — survives reboots, absorbs bursts
20
+ │
21
+ ▼
22
+ under the daily cap + ── if not: refused here, before any spend
23
+ per-job turn budget?
24
+ │ yes
25
+ ▼
26
+ docker run --rm one ephemeral container per job:
27
+ --cap-drop=ALL · non-root --no-new-privileges · /job mounted read-only
28
+ │
29
+ ▼
30
+ pi + your .pi/skills edits your code in place, opens a PR, comments back
31
+ ```
32
+
33
+ - **The container is the boundary.** pi ships no permission system, so every job runs `--cap-drop=ALL`, non-root, ephemeral, with its instructions mounted read-only. That *is* the missing permission system — enforced by Docker, not hoped for.
34
+ - **Spend is bounded before tokens.** A per-job turn budget plus daily / weekly / monthly caps, checked *before* a container starts. A runaway or a junk trigger costs you a refusal, not a surprise bill.
35
+ - **Three triggers, one job.** A CLI command, a cron schedule, or a GitHub issue/PR — same queue, same box, same budget. Cron is the unattended one: recurring work on your own hardware, in an image you control.
36
+ - **Your image, your tools.** Bake a project's toolchain into the Dockerfile; it ships **Playwright + Chromium**, so a flow can build a frontend, screenshot it, and iterate on the rendered result.
37
+
38
+ ## The console — `/dispatch`
39
+
40
+ This extension puts a live TUI over the whole deployment in one command:
41
+
42
+ <p align="center">
43
+ <img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/dispatch-dashboard.png" alt="The /dispatch panel: status, spend meters, triggers, runs, and settings" width="820">
44
+ </p>
45
+
46
+ - **Status & spend.** Queue and worker state, day/week/month **spend meters** + a daily token counter, and a run-history table with per-job token & cost.
47
+ - **Triggers, editable live.** cron / label / comment / pull_request, with colored drill-ins showing *what fires* each one, *what it runs*, and its *trust model* — added, edited, and deleted without a restart.
48
+ - **Quiet hours.** Scheduled pause windows per folder or repo: defer a scope's runs **between certain times** — recurring daily, weekday- and date-bounded, timezone-aware — and resume automatically. Deferred, never dropped, at zero budget cost.
49
+ - **AI-operable, with a human gate.** Model-callable tools let an agent change limits and manage triggers and pause windows — but **every write pops an operator confirmation the model can't answer**, and is refused when no operator is present. The bundled `operate-pi-dispatch` **skill** teaches the agent to use those gates.
50
+ - **Logs stay put.** Raw container output renders only in the overlay viewer, never into model context.
51
+
52
+ ## Install the console
21
53
 
22
54
  ```bash
23
55
  pi install npm:@edgehero/pi-dispatch-admin
24
56
  ```
25
57
 
26
- Then run pi and use `/dispatch`. Point it at your deployment with `VALKEY_URL` / `PI_LOGS_DIR` /
27
- `PI_SETTINGS_FILE` / `PI_TRIGGERS_FILE` / `PI_PAUSE_WINDOWS_FILE` (the same values your pi-dispatch worker uses).
58
+ Then run pi and open `/dispatch`. Point it at your deployment with `VALKEY_URL` / `PI_LOGS_DIR` / `PI_SETTINGS_FILE` / `PI_TRIGGERS_FILE` / `PI_PAUSE_WINDOWS_FILE` — the same values your worker uses. It reads that deployment's queue and run history; on its own it will just say "queue unreachable."
59
+
60
+ ## Get the whole thing
61
+
62
+ The queue, worker, container image, and GitHub webhook receiver — the actual service — are in the main repo. **Start there:**
28
63
 
29
- ## The service
64
+ ### → **https://github.com/edgehero/pi-dispatch**
30
65
 
31
- The queue, worker, container image, and GitHub receiver live in the main repo:
32
- **https://github.com/edgehero/pi-dispatch** — start there. MIT. Read
33
- [`SECURITY.md`](https://github.com/edgehero/pi-dispatch/blob/main/SECURITY.md) before you rely on it.
66
+ MIT, self-hosted. Read [`SECURITY.md`](https://github.com/edgehero/pi-dispatch/blob/main/SECURITY.md) before you rely on it — it states plainly what is and isn't defended (short version: the trust model is a GitHub Action's — whoever can merge to your default branch can instruct the agent).
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@edgehero/pi-dispatch-admin",
3
- "version": "0.1.0",
4
- "description": "Operator console (a pi extension) + skill for the pi-dispatch self-hosted agent service: a /dispatch TUI for queue, spend, run history, triggers, and scheduled pause windows. Runs against a live pi-dispatch deployment.",
3
+ "version": "0.1.2",
4
+ "description": "Operator console (a pi extension) + skill for pi-dispatch: run the pi coding agent as a self-hosted service. A /dispatch TUI for the queue, spend caps, run history, editable triggers (cron/label/comment/PR), and scheduled pause windows — plus AI-operable, human-confirmed controls. Runs against a live pi-dispatch deployment.",
5
5
  "keywords": [
6
6
  "pi-package",
7
+ "pi-extension",
7
8
  "pi",
8
9
  "pi-coding-agent",
9
10
  "coding-agent",
10
- "extension"
11
+ "ai-agent",
12
+ "autonomous-agents",
13
+ "self-hosted",
14
+ "job-queue",
15
+ "cron",
16
+ "tui",
17
+ "dashboard"
11
18
  ],
12
19
  "license": "MIT",
13
20
  "author": "Rob Boerman",
@@ -30,7 +37,7 @@
30
37
  "skills": [
31
38
  "./skills"
32
39
  ],
33
- "image": "https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/dispatch-dashboard.svg"
40
+ "image": "https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/banner.png"
34
41
  },
35
42
  "scripts": {
36
43
  "build": "node build.mjs",