@edgehero/pi-dispatch-admin 2.1.0 → 3.0.0
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.
- package/README.md +45 -13
- package/dist/index.mjs +6482 -1889
- package/package.json +1 -1
- package/skills/operate-pi-dispatch/SKILL.md +81 -8
package/README.md
CHANGED
|
@@ -10,9 +10,11 @@ without giving it the keys to your machine.**
|
|
|
10
10
|
[pi](https://github.com/earendil-works/pi) is an open source coding agent that you normally run in a
|
|
11
11
|
terminal. It has no job queue, no spend limit and, by its own README, no permission system. pi-dispatch
|
|
12
12
|
adds exactly those, so pi can run unattended: on a cron schedule, on your repo's issues and PRs, or from
|
|
13
|
-
the command line. Every job runs in its own container. Spend is checked before a single token is spent
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
the command line. Every job runs in its own container. Spend is checked before a single token is spent:
|
|
14
|
+
job counts and a daily token count for the whole deployment, job counts per repo, folder or project, and
|
|
15
|
+
dollars per day, week or month for the deployment and per repo, folder, project or model, plus an optional
|
|
16
|
+
dollar cap per job. Everything the agent did, and what it cost, is
|
|
17
|
+
recorded, graphed and priced.
|
|
16
18
|
|
|
17
19
|
On a forge you stay in control at both ends. A job starts only when someone with write access to the repo
|
|
18
20
|
asks for one, with a label, an `@pi` comment or a review. What comes back is a pull request that you
|
|
@@ -37,8 +39,10 @@ Every trigger produces the same job, through the same path: one queue, one conta
|
|
|
37
39
|
│
|
|
38
40
|
▼
|
|
39
41
|
under the day, week and if not: refused here, before any spend
|
|
40
|
-
month caps,
|
|
41
|
-
|
|
42
|
+
month caps (jobs, tokens,
|
|
43
|
+
dollars), the scoped limits,
|
|
44
|
+
the project's share of the
|
|
45
|
+
envelope and the turn budget?
|
|
42
46
|
│ yes
|
|
43
47
|
▼
|
|
44
48
|
one container per job Docker or Podman, removed after the job: all
|
|
@@ -125,20 +129,21 @@ Four things to know before you build on it:
|
|
|
125
129
|
One command puts a live terminal view over the whole deployment:
|
|
126
130
|
|
|
127
131
|
<p align="center">
|
|
128
|
-
<img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/dispatch-dashboard.png?v=
|
|
132
|
+
<img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/dispatch-dashboard.png?v=2026-10-05" alt="The /dispatch panel: status, spend meters, dollar windows, triggers with a portfolio trigger, pause windows, scoped limits with their dollar caps, held and failed jobs, runs with their projects, and settings" width="820">
|
|
129
133
|
</p>
|
|
130
134
|
|
|
131
135
|
- **Status and spend.** Queue and worker state, day, week and month spend meters, a daily token counter,
|
|
132
136
|
and the run history with tokens and cost per job. `Enter` on a run opens its full record, `x` on a
|
|
133
|
-
running job cancels it after asking, and `b`
|
|
137
|
+
running job cancels it after asking, and `b` on an opened run reopens its workspace.
|
|
134
138
|
- **Insights, the one analytics page.** Press `i` (or type `/dispatch insights`) and one self contained
|
|
135
139
|
page opens in your browser. It shows the budget dials, plan verdicts against API rates, daily,
|
|
136
|
-
cumulative and per flow spend charts, breakdowns by flow, trigger, model and
|
|
137
|
-
|
|
140
|
+
cumulative and per flow spend charts, five breakdowns (by flow, trigger, model, repo and project), the
|
|
141
|
+
budget split with each project's share, spend and floor and the split's history, and the trigger and flow
|
|
142
|
+
topology with spend on each trigger. A plan covered run never shows as $0.00, and an estimate is
|
|
138
143
|
always marked as one ([`docs/insights.md`](https://github.com/edgehero/pi-dispatch/blob/main/docs/insights.md)).
|
|
139
144
|
|
|
140
145
|
<p align="center">
|
|
141
|
-
<img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/insights-view.png?v=
|
|
146
|
+
<img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/insights-view.png?v=2026-10-05" alt="The insights page: KPI tiles, budget dials, the budget split, a plan verdict, spend charts, the five breakdowns, and the topology with spend badges" width="820">
|
|
142
147
|
</p>
|
|
143
148
|
|
|
144
149
|
- **Triggers, editable live.** Add, edit and delete triggers without a restart. Drill-ins show what
|
|
@@ -146,13 +151,39 @@ One command puts a live terminal view over the whole deployment:
|
|
|
146
151
|
stays in the list, matches nothing, and is re-armed when you delete its `on.disarmed` mark from the file.
|
|
147
152
|
Triggers that run third party code or a custom image carry a badge. Turning either on or off stays an
|
|
148
153
|
edit to the reviewed `triggers.json`, which neither the console nor a model callable tool makes for you.
|
|
154
|
+
A portfolio manager's cron trigger carries `[portfolio]`: its jobs write the budget split.
|
|
149
155
|
- **Quiet hours.** Pause windows per folder or repo, timezone aware. A paused job waits, never drops, and
|
|
150
156
|
costs nothing.
|
|
151
|
-
- **Scoped limits.** Job caps per repo or
|
|
152
|
-
ceiling on how many run at once, enforced by making jobs wait.
|
|
157
|
+
- **Scoped limits.** Job caps per repo, folder or project (day, week, month), refused before any spend, plus a
|
|
158
|
+
ceiling on how many run at once, enforced by making jobs wait. Dollar caps per day, week or month for a
|
|
159
|
+
repo, a folder, a model (`model:<provider>/<id>`) or a project (`project:<id>`). Write a repo with its
|
|
160
|
+
forge (`github:acme/web`) to limit it on that forge only. Local jobs also have a fixed guard with
|
|
153
161
|
no switch: one job per folder at a time (it lives in the worker process, and one worker per container
|
|
154
162
|
daemon is the supported shape), because two agents editing one working tree race each other with no
|
|
155
163
|
gate and no undo.
|
|
164
|
+
- **Dollar windows.** With dollar caps set, the panel shows each window's spend and holds against its cap,
|
|
165
|
+
and what the run records settled ([`docs/costs.md`](https://github.com/edgehero/pi-dispatch/blob/main/docs/costs.md)).
|
|
166
|
+
- **Projects.** `j` shows each project with its members and this month's spend, and `Enter` on one filters
|
|
167
|
+
the runs list. `dispatch_projects` lists them, and `dispatch_project_add`, `dispatch_project_edit` and
|
|
168
|
+
`dispatch_project_delete` change `projects.json` behind your confirm
|
|
169
|
+
([`docs/projects.md`](https://github.com/edgehero/pi-dispatch/blob/main/docs/projects.md)).
|
|
170
|
+
- **The budget split.** With an allocation envelope (a dollar total per window and a floor per project), `b`
|
|
171
|
+
in the list shows each project's share and spend, the applied plan with the reasons it gave, and the history.
|
|
172
|
+
`r` on a history row reverts to it after a yes or no. `dispatch_priorities_set` sets a plan of weights with
|
|
173
|
+
no confirm, because it can only move money inside the envelope; `dispatch_envelope_set` changes the envelope
|
|
174
|
+
behind your confirm; `dispatch_allocations` reads the split. pi's own `write` and `edit` tools are blocked on
|
|
175
|
+
the envelope, `projects.json`, `scoped-limits.json`, `triggers.json` and the settings file
|
|
176
|
+
([`docs/allocation.md`](https://github.com/edgehero/pi-dispatch/blob/main/docs/allocation.md)).
|
|
177
|
+
`/dispatch priorities` shows the split as text, and `/dispatch priorities set shop=3 platform=1` sets a
|
|
178
|
+
plan. A run's detail names the plan a portfolio run wrote and the dollars it settled.
|
|
179
|
+
|
|
180
|
+
<p align="center">
|
|
181
|
+
<img src="https://raw.githubusercontent.com/edgehero/pi-dispatch/main/docs/images/dispatch-allocation.png?v=2026-10-05" alt="The panel's budget split view: the weekly envelope, each project's floor, weight, share and spend, the headroom, the applied plan clamped by the step with its reasons, and the history across two hosts with a revert" width="820">
|
|
182
|
+
</p>
|
|
183
|
+
|
|
184
|
+
- **The portfolio manager.** A weekly flow you own reads the budget and writes a plan of weights. The
|
|
185
|
+
worker applies it inside the envelope, bounds each move and logs it, so you can revert it
|
|
186
|
+
([`docs/portfolio-manager.md`](https://github.com/edgehero/pi-dispatch/blob/main/docs/portfolio-manager.md)).
|
|
156
187
|
- **Held and failed jobs.** A trigger with `run.waitFor` holds its job in the queue, unstarted and
|
|
157
188
|
unbilled, until a time passes or your check script exits 0. The panel shows a **held** section while
|
|
158
189
|
anything waits (the target, the condition and how long), and a **failed** section for jobs the queue
|
|
@@ -205,7 +236,8 @@ setup appears when there is nothing, never over an outage.
|
|
|
205
236
|
|
|
206
237
|
**Already have a deployment?** The panel finds it through the deployment pointer, or through the same env
|
|
207
238
|
vars your worker uses (`VALKEY_URL`, `PI_LOGS_DIR`, `PI_SETTINGS_FILE`, `PI_TRIGGERS_FILE`,
|
|
208
|
-
`PI_PAUSE_WINDOWS_FILE`, `PI_SUBSCRIPTIONS_FILE`
|
|
239
|
+
`PI_PAUSE_WINDOWS_FILE`, `PI_SCOPED_LIMITS_FILE`, `PI_SUBSCRIPTIONS_FILE`, `PI_PROJECTS_FILE`,
|
|
240
|
+
`PI_ENVELOPE_FILE`). Your env always wins. What your env does not set comes
|
|
209
241
|
from the deployment's own `.env`, by the same rule `pi-dispatch doctor` uses: only the pointer's
|
|
210
242
|
deployment folder (never a `.env` in the folder pi started in, which any repository could ship), and only
|
|
211
243
|
when that file is yours and nobody else can write it. A key your env sets differently is named once as a
|