@dibssoftware/dibs 0.0.180 → 0.0.195
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/CHANGELOG.md +111 -1
- package/README.md +10 -8
- package/bin/dibs.mjs +379 -74
- package/docs/agents.md +303 -0
- package/docs/council.md +88 -0
- package/docs/files.md +3 -3
- package/docs/guard.md +86 -11
- package/docs/json.md +211 -0
- package/docs/later.md +5 -5
- package/docs/machines.md +6 -6
- package/docs/questions.md +104 -3
- package/docs/reference.md +124 -30
- package/docs/relay.md +135 -11
- package/docs/releasing.md +7 -1
- package/docs/scheduling.md +28 -6
- package/docs/secrets.md +53 -0
- package/docs/simulators.md +3 -3
- package/docs/windows.md +3 -3
- package/package.json +1 -1
- package/skills/dibs/SKILL.md +79 -149
- package/src/about.mjs +341 -0
- package/src/acquire.mjs +113 -28
- package/src/after.mjs +127 -0
- package/src/agents.mjs +2 -1
- package/src/alerts.mjs +109 -48
- package/src/answers.mjs +2 -2
- package/src/board.mjs +21 -16
- package/src/broker.mjs +23 -7
- package/src/carry.mjs +287 -0
- package/src/codex.mjs +132 -0
- package/src/commands.mjs +254 -86
- package/src/config.mjs +85 -14
- package/src/connect.mjs +4 -2
- package/src/cool.mjs +28 -12
- package/src/council.mjs +482 -0
- package/src/cwd.mjs +9 -0
- package/src/decisions.mjs +250 -0
- package/src/declare.mjs +96 -0
- package/src/diskreport.mjs +306 -0
- package/src/diskuse.mjs +420 -0
- package/src/diskwarn.mjs +68 -13
- package/src/doctor.mjs +149 -0
- package/src/doors.mjs +547 -0
- package/src/durable.mjs +143 -0
- package/src/envs.mjs +372 -0
- package/src/events.mjs +7 -2
- package/src/files.mjs +121 -7
- package/src/guard.mjs +288 -105
- package/src/guardd.mjs +8 -1
- package/src/halt.mjs +63 -0
- package/src/handoffs.mjs +362 -0
- package/src/history.mjs +34 -4
- package/src/hogs.mjs +36 -8
- package/src/jobprogress.mjs +283 -0
- package/src/later.mjs +21 -10
- package/src/lock.mjs +51 -11
- package/src/measure.mjs +60 -14
- package/src/media.mjs +240 -0
- package/src/news.mjs +31 -0
- package/src/notes.mjs +49 -8
- package/src/notices.mjs +126 -43
- package/src/ondemand.mjs +25 -2
- package/src/outcome.mjs +163 -0
- package/src/overlap.mjs +2 -2
- package/src/override.mjs +149 -79
- package/src/owner.mjs +15 -2
- package/src/people.mjs +236 -0
- package/src/pickup.mjs +72 -0
- package/src/picture.mjs +321 -0
- package/src/plain.mjs +84 -18
- package/src/platform.mjs +29 -7
- package/src/preempt.mjs +123 -15
- package/src/primer.mjs +91 -20
- package/src/prints.mjs +99 -0
- package/src/proc.mjs +11 -1
- package/src/progress.mjs +49 -3
- package/src/proof.mjs +102 -0
- package/src/push.mjs +271 -0
- package/src/questions.mjs +328 -57
- package/src/quota.mjs +1 -1
- package/src/recap.mjs +205 -0
- package/src/relay.mjs +262 -26
- package/src/remote.mjs +23 -10
- package/src/reviewgate.mjs +268 -0
- package/src/reviews.mjs +377 -0
- package/src/route.mjs +263 -0
- package/src/rules.mjs +216 -0
- package/src/schedule.mjs +238 -44
- package/src/schema.mjs +62 -0
- package/src/scratch.mjs +2 -2
- package/src/serve.mjs +3 -2
- package/src/service.mjs +5 -1
- package/src/signed.mjs +97 -0
- package/src/simpool.mjs +46 -1
- package/src/spend.mjs +375 -0
- package/src/state.mjs +43 -17
- package/src/talk.mjs +1082 -134
- package/src/thin.sh +2 -0
- package/src/trail.mjs +290 -0
- package/src/trailnote.mjs +209 -0
- package/src/util.mjs +7 -0
- package/src/vault.mjs +435 -0
- package/src/vendors.mjs +327 -0
- package/src/version.mjs +1 -1
- package/src/web.mjs +354 -60
- package/src/work.mjs +487 -0
- package/src/worker.mjs +7 -1
package/docs/json.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# dibs --json: the layout programs read
|
|
2
|
+
|
|
3
|
+
dibs prints sentences for people. Programs, and agents that want facts instead of sentences, read `--json`. This page is that layout. `dibs help json` prints it.
|
|
4
|
+
|
|
5
|
+
Every object below carries `schema: 1`. A field documented here keeps its name and meaning while `schema` is 1; dibs may add fields at any time, so ignore the ones you don't know. If a documented field is ever renamed or dropped, `schema` goes up.
|
|
6
|
+
|
|
7
|
+
Conventions:
|
|
8
|
+
|
|
9
|
+
- Times are milliseconds since 1970 (`...At`). Durations are milliseconds (`...Ms`).
|
|
10
|
+
- A field that doesn't apply is `null`, never missing.
|
|
11
|
+
- `agent` is the session name the board shows, the same name `dibs tell` and SendMessage use.
|
|
12
|
+
- Older keys (`held`, `waiting`, `res`, `who`, `purpose`, `prio`, `enq`, `start`, `waited`, `code`) are still printed beside the new ones for programs that read them. New code should read `jobs`.
|
|
13
|
+
|
|
14
|
+
## A job
|
|
15
|
+
|
|
16
|
+
Every command that prints jobs prints them in this shape, whatever state they're in.
|
|
17
|
+
|
|
18
|
+
| field | type | meaning |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `id` | number | the job number: what `dibs stop`, `dibs boost`, `dibs pause` and `--after` take |
|
|
21
|
+
| `state` | string | `waiting`, `running`, `paused` or `done` |
|
|
22
|
+
| `kind` | string | `run` (a command) or `hold` (a reservation from `dibs hold`) |
|
|
23
|
+
| `resource` | string | the resources as you'd type them, comma-separated: `sim,xcode-build` |
|
|
24
|
+
| `resources` | array | the same, one per entry, file leases as full paths |
|
|
25
|
+
| `agent` | string | whose job it is |
|
|
26
|
+
| `label` | string or null | the subagent label (`--as`), if any |
|
|
27
|
+
| `what` | string or null | what the job does: its `-m` words, or words dibs made from what it knows when there were none |
|
|
28
|
+
| `declared` | boolean | true when `what` is the agent's own `-m` |
|
|
29
|
+
| `cmd` | string or null | the command; null for a hold |
|
|
30
|
+
| `priority` | string | `urgent`, `high`, `normal`, `low` or `idle` |
|
|
31
|
+
| `mine` | boolean | true when the job is the calling session's |
|
|
32
|
+
| `place` | number or null | its place in line, 1 first; null unless waiting |
|
|
33
|
+
| `queuedAt` | number or null | when it got in line |
|
|
34
|
+
| `startedAt` | number or null | when it started; null while waiting |
|
|
35
|
+
| `endedAt` | number or null | when it ended; null until done |
|
|
36
|
+
| `waitedMs` | number or null | how long it waited (so far, while waiting) |
|
|
37
|
+
| `ranMs` | number or null | how long it has run, not counting time paused; null while waiting, and when it never started |
|
|
38
|
+
| `exitCode` | number or null | the command's exit code; null until done |
|
|
39
|
+
| `expectStartAt` | number or null | dibs's forecast of its start; null when unknown or not waiting |
|
|
40
|
+
| `expectEndAt` | number or null | when a hold expires, or a run's forecast end from its past runs; null when unknown |
|
|
41
|
+
| `blockedBy` | string or null | which rule holds a waiter back: `slot`, `ahead`, `mem`, `load`, `disk`, `files`, `halt`, ... |
|
|
42
|
+
| `blocked` | string or null | the same in words: `behind web-app`, `blocked by mem` |
|
|
43
|
+
| `keptUntil` | number or null | a place kept after its wait gave up (exit 75): running the same command again before this picks it up |
|
|
44
|
+
| `paused` | string or null | why a paused job is paused: `paused by web-app`, `paused: memory pressure` |
|
|
45
|
+
| `by` | string or null | the agent that boosted, lowered or stopped it, when one did |
|
|
46
|
+
|
|
47
|
+
## `dibs --json`
|
|
48
|
+
|
|
49
|
+
The board. `dibs status --json` prints the same.
|
|
50
|
+
|
|
51
|
+
| field | type | meaning |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `schema` | number | 1 |
|
|
54
|
+
| `jobs` | array of job | every job on this machine: running and paused, then waiting in queue order |
|
|
55
|
+
| `machine.memFree` | number | percent of memory free |
|
|
56
|
+
| `machine.diskFree` | number or null | free disk in bytes |
|
|
57
|
+
| `machine.load` | number | the load average |
|
|
58
|
+
| `limits` | string | the board's Limits line |
|
|
59
|
+
| `hold` | string | what holds every new job back, or '' when nothing does |
|
|
60
|
+
| `halt` | object or null | a `dibs halt` in force |
|
|
61
|
+
| `questions` | number | open questions waiting for the person |
|
|
62
|
+
| `notes` | number | agents' notes the person hasn't read |
|
|
63
|
+
| `alerts` | array | what's wrong, each with its fix (as `dibs alerts --json`) |
|
|
64
|
+
| `held` | array | older view of the running and paused jobs: the raw lease records |
|
|
65
|
+
| `waiting` | array | older view of the waiting jobs: the raw queue entries with `place` |
|
|
66
|
+
|
|
67
|
+
## `dibs why --json`
|
|
68
|
+
|
|
69
|
+
Your waits, each with the sentences plain `dibs why` prints and how its place in line was worked out.
|
|
70
|
+
|
|
71
|
+
| field | type | meaning |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `schema` | number | 1 |
|
|
74
|
+
| `waiting` | boolean | true when you're waiting for anything |
|
|
75
|
+
| `jobs` | array of job | your waits, each with `why` and `rank` added |
|
|
76
|
+
| `jobs[].why` | array | the sentences plain `dibs why` prints for it |
|
|
77
|
+
| `jobs[].rank` | array | what moved its place in line |
|
|
78
|
+
| `jobs[].rank[].reason` | string | the cause: a priority (`high`), `short job`, `long job`, `deadline`, `recent use`, `let ahead`, `quick`, `holds sim` |
|
|
79
|
+
| `jobs[].rank[].aheadMs` | number | how far that moved it ahead in line; below 0 moved it back |
|
|
80
|
+
| `holding` | array of job | what you hold or are running now |
|
|
81
|
+
|
|
82
|
+
## `dibs mine --json`
|
|
83
|
+
|
|
84
|
+
What you hold and wait for. Exits 1 when that's nothing.
|
|
85
|
+
|
|
86
|
+
| field | type | meaning |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| `schema` | number | 1 |
|
|
89
|
+
| `jobs` | array of job | your jobs, running and paused first |
|
|
90
|
+
| `held` | array | older view: your raw lease records |
|
|
91
|
+
| `waiting` | array | older view: your raw queue entries |
|
|
92
|
+
|
|
93
|
+
## `dibs jobs --json`
|
|
94
|
+
|
|
95
|
+
Every job on this machine now, then the ones that ended in the last hour (`--since 3h` for longer), newest first, with their exit codes.
|
|
96
|
+
|
|
97
|
+
| field | type | meaning |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `schema` | number | 1 |
|
|
100
|
+
| `jobs` | array of job | every job, in any state |
|
|
101
|
+
|
|
102
|
+
## `dibs run --json`
|
|
103
|
+
|
|
104
|
+
With `--json` on `dibs run`, or `DIBS_JSON=1` in its environment, the run's end line is followed by one more line on stderr: the same end as JSON, the last thing dibs writes. Your command's own output is untouched. A wait that gives up (75) or a refusal (78, 2) prints no end; its exit code says what happened. Nor, yet, does a run sent to another machine (`--anywhere`, `--on`).
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
dibs: "login tests" failed (exit 1) after 41s. #26566
|
|
108
|
+
{"schema":1,"kind":"end","started":true,"job":{"id":26566,"state":"done","exitCode":1,...}}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
| field | type | meaning |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| `schema` | number | 1 |
|
|
114
|
+
| `kind` | string | `end` |
|
|
115
|
+
| `started` | boolean | false when the command never started (exit 127) |
|
|
116
|
+
| `job` | job | the job, `state` `done` |
|
|
117
|
+
|
|
118
|
+
## `dibs questions --json`
|
|
119
|
+
|
|
120
|
+
| field | type | meaning |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `schema` | number | 1 |
|
|
123
|
+
| `questions` | array | open questions first, by priority then age, then answered ones |
|
|
124
|
+
| `questions[].id` | number | what `dibs answer` takes |
|
|
125
|
+
| `questions[].state` | string | `open`, `answered`, `dismissed`, `expired`, or `decided` (an agent's own call on a two-way door, or a standing rule's) |
|
|
126
|
+
| `questions[].text` | string | the question |
|
|
127
|
+
| `questions[].options` | array or null | the choices, if any |
|
|
128
|
+
| `questions[].who` | string | who asked: the name the board shows |
|
|
129
|
+
| `questions[].agent` | string or null | the asking agent's session name; null outside an agent session |
|
|
130
|
+
| `questions[].asked` | number | when it was asked |
|
|
131
|
+
| `questions[].answer` | string or null | the answer |
|
|
132
|
+
| `questions[].answeredAt` | number or null | when it was answered |
|
|
133
|
+
| `questions[].waiting` | boolean | true while its asker waits on the answer (`--wait`) |
|
|
134
|
+
| `open` | number | how many are open |
|
|
135
|
+
| `hours` | object or null | the person's hours (`dibs hours`) |
|
|
136
|
+
|
|
137
|
+
## `dibs threads --json`
|
|
138
|
+
|
|
139
|
+
One thread per agent: its notes, questions, and the person's messages.
|
|
140
|
+
|
|
141
|
+
| field | type | meaning |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `schema` | number | 1 |
|
|
144
|
+
| `threads` | array | newest activity first |
|
|
145
|
+
| `threads[].agent` | string | the agent's name |
|
|
146
|
+
| `threads[].to` | string | the name `dibs tell` reaches it by |
|
|
147
|
+
| `threads[].alive` | boolean | true while its session runs |
|
|
148
|
+
| `threads[].reach` | string | how a message would reach it now: `listening`, `working`, `idle`, `command` or `ended` |
|
|
149
|
+
| `threads[].unread` | number | its lines the person hasn't read |
|
|
150
|
+
| `threads[].last` | number | when the thread last changed |
|
|
151
|
+
| `threads[].messages` | array | oldest first |
|
|
152
|
+
| `threads[].messages[].id` | string | `m12` for a message, `q4` for a question, `q4a` for its answer |
|
|
153
|
+
| `threads[].messages[].at` | number | when |
|
|
154
|
+
| `threads[].messages[].from` | string | `agent` or `person` |
|
|
155
|
+
| `threads[].messages[].kind` | string | `note`, `message`, `question`, `answer`, `decided`, ... |
|
|
156
|
+
| `threads[].messages[].text` | string | the words |
|
|
157
|
+
| `desk` | string or null | the agent that answers the person's chat, if one is set |
|
|
158
|
+
| `needsYou` | number | open questions waiting for the person |
|
|
159
|
+
|
|
160
|
+
## `dibs disk --json`
|
|
161
|
+
|
|
162
|
+
Who fills the disk, as last measured.
|
|
163
|
+
|
|
164
|
+
| field | type | meaning |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| `schema` | number | 1 |
|
|
167
|
+
| `at` | number | when it was measured |
|
|
168
|
+
| `free` | number or null | free disk in bytes |
|
|
169
|
+
| `floor` | number | under this much free, nothing new starts (`minDisk`) |
|
|
170
|
+
| `share` | number | each running session's share in bytes |
|
|
171
|
+
| `sessions` | number | sessions running |
|
|
172
|
+
| `rows` | array | biggest first |
|
|
173
|
+
| `rows[].agent` | string or null | the session's agent |
|
|
174
|
+
| `rows[].session` | string or null | its Claude Code session id |
|
|
175
|
+
| `rows[].live` | boolean | true while the session runs |
|
|
176
|
+
| `rows[].bytes` | number | everything it fills |
|
|
177
|
+
| `rows[].scratch` | number | of which its temp scratch folder |
|
|
178
|
+
| `rows[].dirs` | array | folders it marked with `dibs disk add`, each `{path, bytes}` |
|
|
179
|
+
|
|
180
|
+
`dibs disk list --json` prints `schema`, `dirs` (the marked folders) and `cleared` (the ones deleted).
|
|
181
|
+
|
|
182
|
+
## `dibs history --json`
|
|
183
|
+
|
|
184
|
+
What happened over a span (`--since 7d` by default).
|
|
185
|
+
|
|
186
|
+
| field | type | meaning |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| `schema` | number | 1 |
|
|
189
|
+
| `since` | number | the span's start |
|
|
190
|
+
| `until` | number | its end |
|
|
191
|
+
| `resources` | object | one entry per resource, keyed by its name |
|
|
192
|
+
| `resources{}.busyMs` | number | time anything held it |
|
|
193
|
+
| `resources{}.waits` | number | waits that ended in the span |
|
|
194
|
+
| `resources{}.waitMs` | number | time spent waiting for it |
|
|
195
|
+
| `resources{}.p50WaitMs` | number or null | the median wait |
|
|
196
|
+
| `resources{}.p90WaitMs` | number or null | 9 in 10 waits were shorter |
|
|
197
|
+
| `resources{}.timeouts` | number | waits that gave up (exit 75) |
|
|
198
|
+
| `agents` | object | one entry per agent, keyed by its name |
|
|
199
|
+
| `agents{}.runs` | number | jobs it started |
|
|
200
|
+
| `agents{}.holdMs` | number | time it held resources |
|
|
201
|
+
| `agents{}.waitMs` | number | time it waited |
|
|
202
|
+
| `agents{}.timeouts` | number | its waits that gave up |
|
|
203
|
+
| `hourly` | array | one entry per hour |
|
|
204
|
+
| `hourly[].hour` | number | the hour's start |
|
|
205
|
+
| `hourly[].waiting` | number | the most jobs waiting at once |
|
|
206
|
+
| `hourly[].held` | number | the most jobs running at once |
|
|
207
|
+
| `events` | array | the newest 2000 events, oldest first |
|
|
208
|
+
| `events[].at` | number | when |
|
|
209
|
+
| `events[].kind` | string | `start`, `end`, `wait`, `timeout`, `left`, `pause`, `resume`, `override`, ... |
|
|
210
|
+
| `events[].id` | number or null | the job, when the event is about one |
|
|
211
|
+
| `events[].who` | string or null | whose job |
|
package/docs/later.md
CHANGED
|
@@ -4,11 +4,11 @@ Schedule a run for a time, or for when something else ends. `dibs later` records
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
dibs later sim --at 02:00 -m "ios snapshot suite" -- ./snapshots.sh
|
|
7
|
-
dibs later test --in 3h -- npm test
|
|
8
|
-
dibs later test --after web-app -- npm run smoke
|
|
9
|
-
dibs later test --after web-app:deploy -- npm run smoke # only its deploy
|
|
10
|
-
dibs later test --after 42 -- npm run smoke
|
|
11
|
-
dibs later deploy --after-ok l3 -- ./ship.sh
|
|
7
|
+
dibs later test --in 3h -m "rerun the flaky suite once the API is back" -- npm test
|
|
8
|
+
dibs later test --after web-app -m "smoke tests on what web-app shipped" -- npm run smoke # when everything web-app holds or waits for now has ended
|
|
9
|
+
dibs later test --after web-app:deploy -m "smoke tests on the new deploy" -- npm run smoke # only its deploy
|
|
10
|
+
dibs later test --after 42 -m "smoke tests once the build lands" -- npm run smoke # #42 on the board
|
|
11
|
+
dibs later deploy --after-ok l3 -m "ship the docs if the tests pass" -- ./ship.sh # after later job l3, only if it exited 0
|
|
12
12
|
dibs later list [--json]
|
|
13
13
|
dibs later cancel l3
|
|
14
14
|
```
|
package/docs/machines.md
CHANGED
|
@@ -31,10 +31,10 @@ Without codes: `dibs invite <name>` on the coordinator prints a line to run on t
|
|
|
31
31
|
## Send work
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
dibs run test --anywhere -- npm test
|
|
35
|
-
dibs run sim --on mini -- ./ui.sh
|
|
36
|
-
dibs run test --anywhere --bring coverage -- npm run cover
|
|
37
|
-
dibs run test --shards 2 -- npx vitest run
|
|
34
|
+
dibs run test --anywhere -m "unit tests for the date fix" -- npm test # whichever machine would start it soonest, maybe this one
|
|
35
|
+
dibs run sim --on mini -m "check the onboarding screens" -- ./ui.sh # that machine
|
|
36
|
+
dibs run test --anywhere --bring coverage -m "coverage report for the API" -- npm run cover # copy coverage/ back when it ends
|
|
37
|
+
dibs run test --shards 2 -m "full unit suite before merging" -- npx vitest run # split a suite across machines, output and exit codes merged
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
**Where it goes.** The coordinator takes the machines reporting in that can run the job (sim and xcode-build need macOS, and the memory has to fit) and picks the one where it would wait least: the resource's line and slots there, load per core, low memory, jobs it was just sent. A machine that already has a free copy of your project, from an earlier job, gets a head start worth most of a job, so it wins unless a cold one would start a whole job sooner or is much less loaded. The machine you send from counts as the warmest of all and wins a near tie; if it wins, the job runs in place, exactly like a plain `dibs run`.
|
|
@@ -112,7 +112,7 @@ A cloud VM bills every second it runs, so dibs can keep one asleep and wake it o
|
|
|
112
112
|
|
|
113
113
|
A job can also go there on its own, from any machine in the group, if the job can run there:
|
|
114
114
|
|
|
115
|
-
- It's been held 2 minutes by the machine it was sent from: its load, the memory or CPU budget, memory pressure, swap growth, the free disk swap needs, or a job ahead reserving memory.
|
|
115
|
+
- It's been held 2 minutes by the machine it was sent from: its load, the memory or CPU budget, memory pressure, swap growth, free disk under `minDisk` or the free disk swap needs, or a job ahead reserving memory. The VM has a disk of its own, so a job the disk floor holds on the Mac runs there.
|
|
116
116
|
- It's held for memory and dibs knows it usually uses more than that machine has: it goes at once.
|
|
117
117
|
- Its turn there is further off than 90 seconds plus its usual run time.
|
|
118
118
|
|
|
@@ -120,7 +120,7 @@ Jobs pack onto the VM while what's sent there fits its memory, less 1 GB. Jobs h
|
|
|
120
120
|
|
|
121
121
|
**Waking.** `boat resume`, then a reverse forward (`boat forward <id> --reverse --local <port>`), so the VM reaches the coordinator on its own 127.0.0.1, no Tailscale needed there. If the VM lacks Node v22.23.4 (pinned, checksum checked) or the coordinator's dibs version, they're installed. The VM gets a fresh token every wake, sent as a file, never on a command line, and a worker starts. boat's snapshot can bring back the VM's last worker on its old dibs; dibs stops it before starting its own, and an on-demand worker gets jobs only once it runs the coordinator's version. A first wake took 35 seconds on 2026-10-18 (resume 2.6 s, the rest installing Node and dibs); a later one, 19 seconds.
|
|
122
122
|
|
|
123
|
-
**Stopping.** Once nothing has run there or been sent to it for `idleStop` (30 seconds unless set, 3 minutes at most), the coordinator runs `boat stop`. boat's own one-hour auto-stop stays as the backstop, pushed back an hour every 30 minutes while a job runs. The VM's worker runs with `--ephemeral`: when it can't reach the coordinator for a minute (10 with a job running), it leaves. A coordinator that stops leaves a VM with jobs running up. One that starts and finds its VM up looks at what runs there (`boat ps`): its own worker with jobs, it takes the VM back; other work using CPU, it leaves the VM running and says so; nothing, it stops it. Every resume and stop is an event (`kind: "ondemand"`) with the seconds billed.
|
|
123
|
+
**Stopping.** Once nothing has run there or been sent to it for `idleStop` (30 seconds unless set, 3 minutes at most), the coordinator runs `boat stop`. boat's own one-hour auto-stop stays as the backstop, pushed back an hour every 30 minutes while a job runs. The VM's worker runs with `--ephemeral`: when it can't reach the coordinator for a minute (10 with a job running), it leaves. A coordinator that stops leaves a VM with jobs running up. One that starts and finds its VM up looks at what runs there (`boat ps`): its own worker with jobs, it takes the VM back; other work using CPU, it leaves the VM running and says so; nothing, it stops it. Every resume and stop is an event (`kind: "ondemand"`) with the seconds billed. Give the entry `"perHour"`, what an hour costs in dollars (`0.12`, or one price per size: `{ "small": 0.06, "default": 0.12, "large": 0.24 }`), and each stop also goes in the spend ledger (`dibs spend`) as spend on `boat` by `dibs`, so it counts against the person's caps.
|
|
124
124
|
|
|
125
125
|
**Nothing kept.** Treat everything on the VM as gone after a stop: each job's copy there is deleted when the job ends, after `--bring` has sent back what you asked for. Node and dibs stay installed between wakes, since installing them again costs about 30 billed seconds. `.dibs.json` `stayOn` and machine limits apply as for any machine.
|
|
126
126
|
|
package/docs/questions.md
CHANGED
|
@@ -28,12 +28,21 @@ The person's standing rule: walk through two-way doors (anything you can undo) a
|
|
|
28
28
|
2. When you reach the step that does, run the same command again with `--wait`. It prints the answer on stdout, and only the answer, so `answer=$(dibs question ... --wait)` works.
|
|
29
29
|
3. Exit 75 means no answer: the person dismissed it, or your wait's `--timeout` (a duration: `30s`, `1m`, `2h`) passed. Nothing was decided. Don't take silence as a yes; carry on without that step and say so in your report. A question you asked in step 1 stays open for the person after a wait gives up: run the same command with `--wait` again later to collect it. One asked only with `--wait` stays open 2 minutes after its wait gives up, so the same command picks it back up.
|
|
30
30
|
|
|
31
|
-
- The person may answer in their own words instead of an option. Those words are the answer (on stdout with `--wait`), and they also reach you through the hook as `Message from the person
|
|
31
|
+
- The person may answer in their own words instead of an option. Those words are the answer (on stdout with `--wait`), and they also reach you through the hook as `Message from the person via <phone>: (answering your question #N) ...`, or as `Unsigned message from this Mac` when they answered on the Mac (see "Who a message is from" below).
|
|
32
|
+
- `--about <kind>` (lowercase: `testflight`, `deploy`, `simulators`) names the kind of question, so one of the person's standing rules can answer it at once (below). Use the same kind for the same thing every time.
|
|
32
33
|
- `-p urgent|high|normal|low|idle` places it like a job in line: urgent goes 2 hours ahead, high 1 hour, low 10 minutes back. Use urgent only when something is broken or the person is waiting on you right now.
|
|
33
34
|
- Asking the same text again from the same session is the same question, not a new one (a two-way one gives the same decision), until it's answered and read, dismissed or expired. After that the same text is a new question with a new id.
|
|
34
35
|
- Inside a Claude Code tool call, `--wait` has no time limit, as with `dibs run`: if the call reaches its timeout, Claude Code moves it to the background and tells you when the answer comes.
|
|
35
36
|
- A question belongs to whoever asked. Asked with `--wait` only, that's the waiting dibs: if it's killed, the question expires. Asked without it, it's your agent session: its questions expire when the session ends, or at the `--timeout` you gave when you asked, never at a later wait's.
|
|
36
37
|
|
|
38
|
+
### Asked twice, asked once
|
|
39
|
+
|
|
40
|
+
The person's attention is the scarcest thing on the machine, so the queue in front of them is kept short and in order:
|
|
41
|
+
|
|
42
|
+
- **A repeat joins the open question.** An open `--one-way` (or `--needs-you`) question in the same project, for the same person, in the same words or close to them (most words shared, the same numbers, both or neither saying "not"), is the one you're asking. You're added to it instead of putting a second card in front of the person: dibs says `<agent> already asked this (question N: "...")`, prints that id, and its answer reaches you as it reaches the first asker (on stdout with `--wait`, as a message otherwise). Questions that only share an `--about` aren't repeats ("deploy web?" isn't "deploy api?"); they sit together in the list instead.
|
|
43
|
+
- **Most pressing first, each project's together.** `dibs questions`, the page and the phone list open questions in this order: one an agent is stopped on (it asked with `--wait`) first, then the other one-way doors and things only the person can do, then the rest, with priority and age deciding within each. Each project's questions sit together, under a heading, where its first one falls. Held questions (outside the person's hours) come after. `dibs pending` puts polls, which ask an opinion, after every question. `dibs questions --json` gives each question its `project`, the `askers` folded into it and its `rank` (`{tier, why}`), and `groups`, the open ids by project in that order.
|
|
44
|
+
- **A card always carries its question.** dibs refuses (exit 2, nothing sent) a question with no words, a poll whose question isn't a couple of words (`dibs poll "?"`), and a `--kind needs-you` note with a file but no words.
|
|
45
|
+
|
|
37
46
|
An agent may answer another agent's question with `dibs answer <id> <text>` when it knows the answer: the asker sees `answered by <agent>, an agent, not the person` on stderr, beside the bare answer on stdout, and the history names who answered.
|
|
38
47
|
|
|
39
48
|
## The person's threads, and the desk
|
|
@@ -52,10 +61,90 @@ dibs hours 09:00-23:00 # dibs hours off clears them; dibs hours [--json] sho
|
|
|
52
61
|
|
|
53
62
|
(or `"hours": { "start": "09:00", "end": "23:00" }` in `~/.dibs/config.json`) keeps questions below urgent out of your way at night. They stay in the list, marked "for tomorrow", and the board doesn't count them until `start`. An end before the start runs past midnight. Agents asking off hours are told their question waits for the morning unless it's urgent.
|
|
54
63
|
|
|
55
|
-
|
|
64
|
+
## Standing rules: answer a kind of question once
|
|
65
|
+
|
|
66
|
+
If you'd answer every TestFlight upload question with yes, say so once:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
dibs rules add --about testflight --answer yes -m "TestFlight is for testers"
|
|
70
|
+
dibs rules add --about deploy --if production --after 18:00 --answer no
|
|
71
|
+
dibs rules add --about simulators --if delete --unless dibs-pool --answer no
|
|
72
|
+
dibs rules # each rule, who set it, how often it answered and when last
|
|
73
|
+
dibs rules test "Deploy the api to production?" --about deploy --at 19:00 # would one answer it? exit 1: no
|
|
74
|
+
dibs rules remove r2 # that kind of question comes to you again
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
A rule answers a question only when all of these hold, and otherwise stays out of the way:
|
|
78
|
+
|
|
79
|
+
- The agent asked with `--about` and the same kind (`dibs question "..." --about testflight`). No model reads the question: an agent that doesn't name a kind never gets a rule's answer.
|
|
80
|
+
- Every `--if` word or phrase is in the question itself (or its `--one-way` line), as a whole word: `delete` isn't in "deletes".
|
|
81
|
+
- No `--unless` word is anywhere in it, the agent's `-m` reasons and options included, even inside another word.
|
|
82
|
+
- The clock is inside `--between 18:00-08:00` (`--after 18:00` runs to midnight, `--before 09:00` from it), if the rule has one.
|
|
83
|
+
- With `--options`, the rule's answer is one of them.
|
|
84
|
+
- It isn't a `--needs-you` question: no rule signs in for you.
|
|
85
|
+
- No other rule that covers it gives a different answer. Two that disagree answer neither, and the agent hears so.
|
|
86
|
+
|
|
87
|
+
A rule you set answers one-way doors too: that's what it's for. The agent gets the rule's answer on stdout at once, `--wait` or not, with `answered by the person's standing rule r1 (about testflight: yes)` on stderr. It shows in `dibs questions` as `answered by rule r1`, in the agent's thread, in `dibs recap` as `(your rule r1)`, and in `dibs history` as a `decided` event with the rule's id. A rule added while a question of its kind is open answers it when its agent asks again with `--wait`.
|
|
88
|
+
|
|
89
|
+
Agents may add rules too, as they may answer questions, but an agent's rule answers only two-way doors: a one-way door of its kind still comes to you, and `dibs rules test` says why the rule stepped aside. A rule an agent set says so in `dibs rules`, to every agent it answers ("set by <agent>, an agent, not the person"), and on your phone the moment it's set.
|
|
90
|
+
|
|
91
|
+
The page's Settings list the rules with a Remove button. A paired phone can read them; removing one needs a pairing with `--allow-actions`, and adding one (`POST /api/rules`) is a talk call, Face ID each time, since from then on it answers in your place. Rules live in `~/.dibs/rules.json`.
|
|
92
|
+
|
|
93
|
+
## The attention budget
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
dibs attention 6 # the default: your phone buzzes at most 6 times an hour
|
|
97
|
+
dibs attention 0 # only urgent questions
|
|
98
|
+
dibs attention off # no cap (still at most once every 30 seconds, batched)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
(or `"attention": 6` in `~/.dibs/config.json`). Each notification already gathers everything that came in a burst. Past the cap, urgent questions still go at once; everything else waits and goes as one notification when the past hour has room again. What you dealt with on the Mac in the meantime (a question answered, a note read) never buzzes; `dibs recap` has the rest.
|
|
102
|
+
|
|
103
|
+
`dibs answer`, `dibs questions dismiss`, `dibs hours`, `dibs rules` and `dibs attention` work for the person and for agents alike; `dibs history` names who did each.
|
|
56
104
|
|
|
57
105
|
Closed questions stay in `dibs questions --json` for 7 days (at most 200), in `~/.dibs/questions.json`.
|
|
58
106
|
|
|
107
|
+
## Decisions: asked once, kept
|
|
108
|
+
|
|
109
|
+
What a question settled outlives the question. Every answer to a question (the person's, or an agent's for them), every two-way door an agent walked through, and every decision kept with `dibs decide` goes into `~/.dibs/decisions.json` for good, with what was decided, why, who decided, when and the project it belongs to: the repo's origin, the same in every clone and worktree, or the folder outside git.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
dibs decide "use Postgres 16 for staging" -m "matches production" --tags db # this project (--everywhere: every project)
|
|
113
|
+
dibs decisions --project --about "postgres staging" # this project's, the closest first (plain word overlap, no model)
|
|
114
|
+
dibs decisions --all --json # every project's, revoked ones too
|
|
115
|
+
dibs decisions revoke 4 -m "moved to 17" # never cited again
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Before `dibs question` asks anyone, it looks for a past decision in the same project that clearly says the same thing, and if there is one it answers with that instead: the answer on stdout as usual, and on stderr `decided on 11-20 by the person: no, because ... Nobody was asked`. Add `--again` to ask anyway when things have changed since. Its answer takes the older decision back (revoked, "answered again: decision N"), so only the newer one is cited.
|
|
119
|
+
|
|
120
|
+
"Clearly" is strict on purpose, since citing the wrong decision is worse than asking twice. The two texts must share most of their words (stop words aside), the same numbers (build 123 is not build 124), and both or neither say "not". For a one-way door only the person's own decisions count, never an agent's two-way call or its `dibs decide`. A question with `--options` is answered only from an earlier question's answer, never from a `dibs decide` sentence, which isn't one of its options. A `--needs-you` question is never answered from the past: a login is needed every time. Nor is an answer the person gave in their own words rather than an option ("not yet, ask me Monday"): it's listed, never cited.
|
|
121
|
+
|
|
122
|
+
A new session in a project with decisions hears one line about them, with the latest one. The page lists them under Questions, with Revoke; a paired phone reads them at `GET /api/decisions` (`?about=words` for the closest first) and, paired with `--allow-actions`, revokes one with `POST /api/decisions/<id>/revoke`. Revoking is on the record in `dibs history` like any other change. The log keeps the newest 2000; past that the oldest agents' and revoked ones go first.
|
|
123
|
+
## More than one person
|
|
124
|
+
|
|
125
|
+
Two people's agents on one shared Mac mini (or one group of machines) need dibs to know whose is whose. Name each person:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
dibs people add jordan # the first person gets this Mac's macOS user
|
|
129
|
+
dibs people add sam --user sam --hours 10:00-18:00 --notify asks
|
|
130
|
+
dibs connect --phone --for sam # pair a phone that is sam's from its first connection
|
|
131
|
+
dibs people set sam --device 3f9a2c1b # or give sam a phone paired earlier (ids: dibs connect --list)
|
|
132
|
+
dibs people # who's here; --json for scripts
|
|
133
|
+
dibs people me # an agent: whose it is; a person: who dibs thinks you are
|
|
134
|
+
dibs people remove sam
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
With one person named, or none, nothing changes: dibs says "the person" everywhere, as before. With two or more:
|
|
138
|
+
|
|
139
|
+
- **An agent's owner** is, first match wins: `DIBS_PERSON` in its environment (two people on one macOS account each export their own), the project's `.dibs.json` (`{"owner": "sam"}` in a repo, or `{"owners": {"ios-app": "sam", "web": "jordan"}}` in a folder above several), the macOS user running it (`--user`), and with one person, that person.
|
|
140
|
+
- **A question** goes to its agent's owner: it waits for that person's hours (`--hours`, else everyone's `dibs hours`) and buzzes their phone. `dibs question ... --one-way "..." --for sam` sends it to sam instead, and then only sam may answer: anyone else, another agent included, gets exit 2 and nothing changes. Anyone may answer the rest, and the waiting asker hears `answered by jordan, not sam, who it was for` on stderr when it wasn't its own person.
|
|
141
|
+
- **A message** names the person who sent it, the device it came through, and whether they're the agent's own person: `Message from sam (a person, who you work for) via Safari on iPhone (remote 3f9a2c1b): ...`, or `Message from jordan (a person, not sam, who you work for): ...`. One dibs can't attribute (no `DIBS_PERSON`, a macOS user nobody has) reads `Message from a person here (dibs couldn't tell which one)`. Another agent's message still reads `(another agent, not the person)`.
|
|
142
|
+
- **The page, `dibs threads`, `dibs questions` and `dibs recap`** show the reader's own agents first and say whose the others are; everyone's stay visible. Each person's `dibs recap` starts from their own last look.
|
|
143
|
+
- **Phones** (see docs/relay.md): a phone given to a person hears about their agents' questions, notes and tasks, and what's everyone's (an agent's hold on new jobs, an untaken handoff). `--notify asks` limits it to questions; `--notify off` silences it. A phone nobody has been given hears only what's everyone's.
|
|
144
|
+
- `dibs history` names the person who answered, dismissed, told or changed something, where it said "the person".
|
|
145
|
+
|
|
146
|
+
People live in `~/.dibs/config.json` under `"people"`. Adding, changing and removing them is logged like any other setting, and agents may do it too.
|
|
147
|
+
|
|
59
148
|
## Threads: notes and messages both ways
|
|
60
149
|
|
|
61
150
|
Questions are one half of a conversation. Each agent also has a thread, keyed by its session (and, for a subagent, its agent id), that holds its questions and your answers, the notes it leaves you, and the messages you send it.
|
|
@@ -70,13 +159,25 @@ dibs tell web-app/Explore "check the tests" # a subagent's thread is <session n
|
|
|
70
159
|
|
|
71
160
|
How a message reaches the agent, with `dibs guard install` (or the plugin):
|
|
72
161
|
|
|
73
|
-
- On the agent's next Bash, edit or Agent tool call, the hook adds it next to the call as `additionalContext` ("Message from the person
|
|
162
|
+
- On the agent's next Bash, edit or Agent tool call, the hook adds it next to the call as `additionalContext` ("Message from the person via ...: ...", or marked unsigned or unverified: see "Who a message is from" below). The call itself goes through unchanged, through the normal permission checks. If the guard turns that call away (a heavy command outside dibs, a file another agent leased), the message waits for the next one.
|
|
74
163
|
- If the agent is ending its turn instead, the Stop hook (SubagentStop for a subagent) answers with the message as `additionalContext`, so it keeps going and reads it as hook feedback (a `decision: "block"` would read as a hook error). Each message is handed over once, and a stop that's already a stop hook's continuation (`stop_hook_active`) never gets another, so this can't loop.
|
|
75
164
|
- An agent that's idle, waiting for its person to type, gets it on its next tool call. A session that has ended keeps the message queued, shown as not delivered, in case it's resumed.
|
|
76
165
|
- Without the guard, the agent gets queued messages the next time it runs `dibs say`.
|
|
77
166
|
|
|
78
167
|
dibs leaves notices of its own in an agent's thread, as lines from dibs: a job of the agent's that has used no CPU for 20 minutes while others wait for it, one that used far more memory than it asked for (with the `--mem` to pass next time), and one paused for low disk or memory (it resumes by itself). Each is said once and handed over the same way as your messages, beside the next tool call, with "dibs has a notice about your jobs". A notice never keeps an agent from stopping, and one nobody picked up expires after an hour. Outside Claude Code (Codex, opencode, a terminal), notices and messages arrive on stderr with the agent's next dibs command, or at once while it runs `dibs listen`.
|
|
79
168
|
|
|
169
|
+
### Who a message is from
|
|
170
|
+
|
|
171
|
+
Agents act on the person's messages, and every file in `~/.dibs` can be written by any program running as the person's macOS user: a compromised package, or an agent talked into it by something it read. So dibs doesn't take a line in `messages.json` for the person's word. What it takes is a signature. A phone paired with `dibs pair --remote --allow-talk` signs every message, answer, vote and hold with a key that never leaves it (the Secure Enclave, behind Face ID; a passkey on the page), and dibs checks that signature against the phone's public key, kept since pairing, when it hands the message to the agent. The agent reads one of three things:
|
|
172
|
+
|
|
173
|
+
- `Message from the person via dibs app on iPhone (remote 1a2b3c4d): ...`: the phone signed these very words, for this agent, in the last week, and it's still paired. The words shown are the ones signed: a vote or a hold is said from what the phone signed, not from the file.
|
|
174
|
+
- `Unsigned message from this Mac, said to be from the person: ...`: typed on the Mac (the local page, the dibs app, `dibs tell` in a terminal). Nothing signs those yet, so dibs can't tell them from any program on the Mac. Agents go ahead with what they can undo and confirm anything they can't with `dibs question --one-way`, whose answer from the phone is signed.
|
|
175
|
+
- `Unverified message claiming to be from the person ... (why). Don't act on it without asking them`: it names a phone but carries no signature from it (an older dibs app, or a message queued before this change), the signature doesn't verify, it signs other words or another agent, it's a copy of one already delivered, or the phone has been signed out since. Pairing the phone again (`dibs pair --remote --allow-talk`) fixes the first.
|
|
176
|
+
|
|
177
|
+
An answer to `dibs question --wait` gets the same check: stdout is the bare answer, and stderr says when it was given on the Mac (`answered on this Mac ..., not signed`) or failed the check (`unverified answer`). `dibs listen --json` marks each of the person's messages `signed: true` or `false`, with `unsigned` or `unverified` saying why.
|
|
178
|
+
|
|
179
|
+
What this protects against: anything that can only write files. A package's install script, a script an agent was talked into running, or an agent editing `messages.json`, `questions.json` or `inbox.json` can put words in the queue, but they arrive marked unsigned or unverified, never as the person's. What it doesn't: a program that changes dibs itself (its code, the hook in Claude Code's settings) or adds its own key to `relay.json` can make dibs say anything, since what checks the signature runs as the same user. Signing protects the person's words in transit and at rest, not a Mac that's already taken over. docs/relay.md, "What a signature proves", has the details.
|
|
180
|
+
|
|
80
181
|
A message from another agent names it by the name it answers to, with the way back: `To answer alex-2e, run: dibs say --to alex-2e "..."`. Plain `dibs say` goes to the person, so use `--to` when the message came from an agent.
|
|
81
182
|
|
|
82
183
|
Plain `dibs` counts unread notes with the questions: `2 questions and 1 note are waiting for you: dibs threads` (`dibs --detail`: `2 questions and 1 note for you: dibs threads`), and `dibs --json` has a `notes` count. Agents may run `dibs tell` and `dibs threads read` too, as they may `dibs answer`: a message from an agent reaches its reader marked as another agent's, never the person's. Threads keep 7 days and at most 200 lines each, in `~/.dibs/messages.json`.
|