You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78-16Lines changed: 78 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,9 @@ The admin surface — the dashboard and command transcript shown at the top of t
197
197
extension** in [`admin/`](admin/) that loads into *your own* interactive pi session — no daemon, no web
198
198
app, **no network port at all**.
199
199
200
-
**Install it through pi** — the published package, then open the panel:
200
+
**Install it through pi** — the published package (the extension **and** the `operate-pi-dispatch` skill, so
201
+
your AI can drive the deployment too — see [Operating pi-dispatch from your AI](#operating-pi-dispatch-from-your-ai)),
202
+
then open the panel:
201
203
202
204
```bash
203
205
pi install npm:@edgehero/pi-dispatch-admin # then, in pi: /dispatch
@@ -213,8 +215,9 @@ deployment.
213
215
Bare `/dispatch` opens the live dashboard overlay — one snapshot per second, `p`/`r` to pause/resume the
214
216
queue in place, `↑`/`↓` to move across the triggers and runs, `Enter` to drill into either. **Triggers are
215
217
editable in place**: `Enter` on a trigger shows its trust model, `e` edits its flow, `x` deletes it, `a`
216
-
adds one (guided, kind-first), and `s` edits a limit — every write is operator-typed, validated, atomic, and
217
-
**reloaded live** by the worker/receiver (no restart). `Enter` on a run opens its full PII-free record:
218
+
adds one (guided, kind-first), `s` edits a limit, and `w` manages scheduled pause windows — every write is
219
+
operator-typed, validated, atomic, and **reloaded live** by the worker/receiver (no restart). `Enter` on a
220
+
run opens its full PII-free record:
218
221
219
222

220
223
@@ -234,15 +237,24 @@ reads only queue counts, run records, and the settings overlay — none of which
234
237
235
238
### Operating pi-dispatch from your AI
236
239
237
-
The extension is AI-operable, so your assistant can drive it — but **every change asks you to confirm
238
-
first**. The model-callable tools are: reads (`status`, `runs`, `triggers`); on/off (`pause`/`resume`, no
239
-
confirm — reversible and money-safe); the gated `dispatch_run` enqueue; and the **confirm-gated writes**
240
-
`dispatch_set` (change a limit) and `dispatch_trigger_add`/`_edit`/`_delete`. A write tool applies its
241
-
change **only after you approve a dialog showing the exact before→after**, and **refuses — writing nothing —
242
-
when no interactive operator is present** (so a prompt-injected session can't raise your cap or add a paid
243
-
trigger; the model emits the call, only your keypress approves it). The bundled `operate-pi-dispatch` skill
244
-
tells the model how to use those gates: state the change plainly, and accept a decline. `CONST-BUDGET-BEFORE-TOKENS`
245
-
and `CONST-TRIGGER-AUTHOR-GATE` are unchanged — the confirm is the human approval.
240
+
Installing `@edgehero/pi-dispatch-admin` gives your AI more than the panel: the package **also ships the
241
+
`operate-pi-dispatch` skill** (via its `pi.skills` manifest), so once it's installed your assistant knows this
242
+
deployment's tools and how to use their gates — **you can just ask, in plain language**: *"raise the daily cap
243
+
to 30", "add a nightly `tidy` trigger for `/srv/site`", "quiet-hours for `acme/web` 22:00–06:00 Amsterdam"*.
244
+
Everything the panel does is model-callable, so **setting it up can be driven entirely by the AI** — with your
245
+
confirmation on every change that costs money or config:
246
+
247
+
-**Read** (no confirm): `dispatch_status`, `dispatch_runs`, `dispatch_triggers`, `dispatch_pauses`.
248
+
-**Turn on/off** (no confirm — reversible, money-safe): `dispatch_pause` / `dispatch_resume`.
249
+
-**Change config — each behind a confirm you approve**: `dispatch_set` (a limit/setting), the triggers
250
+
`dispatch_trigger_add` / `_edit` / `_delete`, and the quiet-hours `dispatch_pause_add` / `_edit` / `_delete`.
251
+
-**Start a paid run**: `dispatch_run` (gated — see below).
252
+
253
+
A confirm-gated write applies its change **only after you approve a dialog showing the exact before→after**,
254
+
and **refuses — writing nothing — when no interactive operator is present** (so a prompt-injected session
255
+
can't raise your cap or add a paid trigger; the model emits the call, only your keypress approves it). The
256
+
`operate-pi-dispatch` skill tells the model how to use those gates: state the change plainly, and accept a
257
+
decline. `CONST-BUDGET-BEFORE-TOKENS` and `CONST-TRIGGER-AUTHOR-GATE` are unchanged — the confirm is the human approval.
246
258
247
259
`dispatch_run` is the one model-callable tool that is **not money-safe**: unlike the others, it enqueues a
248
260
**PAID** agent run that edits a folder in place with **no undo** — and unlike the confirm-gated writes, it
@@ -274,6 +286,32 @@ because that raw stream can contain issue and comment text (PII). Both files sta
274
286
mounted into the job container, and are gitignored. A boot-time sweep prunes anything older than
275
287
`PI_LOG_RETENTION_DAYS` (default 30; `0` keeps them forever).
276
288
289
+
## Flows: the custom prompt a trigger runs
290
+
291
+
A **flow** is the recipe the agent follows — a pi **skill** committed to the target repo/folder at
292
+
`.pi/skills/<flow>/SKILL.md`. **That file *is* the custom prompt**: the frontmatter names the flow, the body is
293
+
the standing instructions the agent runs. A trigger (or `pi-dispatch run --flow <name>`) only *names* which
294
+
flow to run; the flow lives with the project, so different repos can define the same flow name their own way.
295
+
296
+
```markdown
297
+
<!-- .pi/skills/tidy/SKILL.md -->
298
+
---
299
+
name: tidy
300
+
description: Format, fix lint, and tighten types across the repo.
301
+
ai-trigger: allow # opt-in required for GitHub/AI triggers; omit for CLI/cron-only flows (default deny)
302
+
---
303
+
304
+
Run the formatter and linter and fix what they report; tighten obvious type holes.
305
+
Keep the diff minimal and open a PR titled "tidy: <whatchanged>". Do not change behavior.
306
+
```
307
+
308
+
Two things reach the agent: the **flow** (this SKILL.md — the standing instructions) and the **task** (the
309
+
one-off ask for a single run). You set the task explicitly for a CLI/cron run (`--task "…"`, or the trigger's
310
+
`task`); for a GitHub trigger the issue/comment/PR text *is* the task. Flows are read from your
311
+
**default-branch** commit, read-only — so **commit and merge a flow before a trigger can use it**; a PR branch
312
+
can neither add one nor alter it. `ai-trigger: allow` in the frontmatter is what lets a label/comment/PR — or
313
+
an AI tool — run that flow at all (default **deny**).
0 commit comments