@dibssoftware/dibs 0.0.178 → 0.0.180
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 +40 -2
- package/README.md +49 -196
- package/bin/dibs-guard.mjs +10 -1
- package/bin/dibs.mjs +72 -31
- package/docs/benchmarks.md +1 -1
- package/docs/files.md +1 -1
- package/docs/guard.md +6 -0
- package/docs/machines.md +1 -1
- package/docs/questions.md +7 -3
- package/docs/reference.md +157 -0
- package/docs/relay.md +9 -7
- package/docs/releasing.md +11 -8
- package/docs/scheduling.md +6 -6
- package/docs/windows.md +14 -0
- package/package.json +2 -1
- package/skills/dibs/SKILL.md +104 -83
- package/src/acquire.mjs +102 -34
- package/src/agents.mjs +7 -22
- package/src/alerts.mjs +157 -57
- package/src/answers.mjs +2 -2
- package/src/board.mjs +3 -4
- package/src/broker.mjs +26 -11
- package/src/commands.mjs +39 -14
- package/src/config.mjs +27 -6
- package/src/cool.mjs +104 -9
- package/src/diskwarn.mjs +32 -35
- package/src/events.mjs +13 -2
- package/src/files.mjs +52 -67
- package/src/guard.mjs +52 -6
- package/src/guardd.mjs +97 -0
- package/src/guardw.mjs +19 -0
- package/src/hogs.mjs +18 -5
- package/src/later.mjs +20 -25
- package/src/lock.mjs +292 -0
- package/src/measure.mjs +9 -4
- package/src/news.mjs +101 -0
- package/src/notes.mjs +171 -0
- package/src/notices.mjs +52 -13
- package/src/ondemand.mjs +6 -3
- package/src/override.mjs +60 -14
- package/src/plain.mjs +7 -4
- package/src/platform.mjs +165 -35
- package/src/preempt.mjs +54 -6
- package/src/primer.mjs +43 -15
- package/src/proc.mjs +39 -8
- package/src/progress.mjs +33 -4
- package/src/questions.mjs +8 -22
- package/src/relay.mjs +10 -22
- package/src/remote.mjs +12 -8
- package/src/schedule.mjs +182 -44
- package/src/serve.mjs +22 -3
- package/src/service.mjs +4 -3
- package/src/state.mjs +139 -47
- package/src/stats.mjs +3 -2
- package/src/talk.mjs +335 -73
- package/src/trust.mjs +7 -1
- package/src/util.mjs +28 -2
- package/src/version.mjs +1 -1
- package/src/web.mjs +19 -27
- package/src/worker.mjs +2 -1
package/bin/dibs.mjs
CHANGED
|
@@ -12,14 +12,15 @@ import path from 'node:path';
|
|
|
12
12
|
import { fileURLToPath } from 'node:url';
|
|
13
13
|
import { loadConfig, paths, profiled } from '../src/config.mjs';
|
|
14
14
|
import { identity } from '../src/proc.mjs';
|
|
15
|
+
import { changelog, seenBy, markSeen, newer } from '../src/news.mjs';
|
|
15
16
|
import { PRIORITY_SHIFT, PRIORITIES, priority } from '../src/schedule.mjs';
|
|
16
17
|
import { VERSION } from '../src/version.mjs';
|
|
17
18
|
import { run, notifyOnExit, hold, release, when, why, mine, who, yieldTo, ask, requests, status, freePort, pace, checkNames, nearest } from '../src/commands.mjs';
|
|
18
19
|
import { remoteRun, join, machines } from '../src/remote.mjs';
|
|
19
20
|
import { sims } from '../src/simpool.mjs';
|
|
20
21
|
import { question, questions, answer, hoursCmd } from '../src/questions.mjs';
|
|
21
|
-
import { say, tell, threads, noticesFor } from '../src/talk.mjs';
|
|
22
|
-
import { bytes, ms, deadline, die, noSpace, fullDisk, setCaller, lastDie, lastDieCode } from '../src/util.mjs';
|
|
22
|
+
import { say, tell, threads, noticesFor, listen } from '../src/talk.mjs';
|
|
23
|
+
import { bytes, ms, deadline, die, noSpace, fullDisk, setCaller, lastDie, lastDieCode, lastDieAt } from '../src/util.mjs';
|
|
23
24
|
import { event } from '../src/events.mjs';
|
|
24
25
|
import { fileRes, isFiles, resList } from '../src/files.mjs';
|
|
25
26
|
import { boost, pause, resume, stop, cap } from '../src/override.mjs';
|
|
@@ -41,6 +42,7 @@ Wait your turn
|
|
|
41
42
|
(no wait under your hold); give it back: dibs release sim
|
|
42
43
|
dibs hold 'files:src/auth/**' -m "why" keep other agents' edits off these files
|
|
43
44
|
dibs run test --anywhere -- <command> on whichever machine in the group starts it soonest (--on <machine>: that one)
|
|
45
|
+
dibs run deploy --quick -- ./ship.sh a command over in under 15 s starts at once (or --est 10s; dibs learns it after)
|
|
44
46
|
|
|
45
47
|
Tell the person
|
|
46
48
|
dibs progress "what you did or found" --task <name> --eta 30m as often as you commit; then --blocked or --done
|
|
@@ -48,6 +50,10 @@ Tell the person
|
|
|
48
50
|
only one-way doors reach the person; the same command plus --wait reads the answer
|
|
49
51
|
dibs say "done: tests pass" an FYI in your thread, no question
|
|
50
52
|
|
|
53
|
+
Other agents and their jobs
|
|
54
|
+
dibs tell <agent> "..." a message that reaches it with its next tool call (or dibs say --to <agent>)
|
|
55
|
+
dibs boost <id> high -m "why" move a job up (urgent|high|normal|low|idle); --owner <its session> if not yours
|
|
56
|
+
|
|
51
57
|
Look around
|
|
52
58
|
dibs what each resource is doing and who's next
|
|
53
59
|
dibs why where you are in the queue and what you're waiting for
|
|
@@ -58,6 +64,7 @@ Look around
|
|
|
58
64
|
Set up
|
|
59
65
|
dibs pace quiet|normal|max how hard dibs drives this machine
|
|
60
66
|
dibs guard install make Claude Code agents use dibs when they forget
|
|
67
|
+
dibs init point your agents' CLAUDE.md and AGENTS.md at dibs.md (install does it)
|
|
61
68
|
dibs machines other machines in the group
|
|
62
69
|
|
|
63
70
|
Priority: -p urgent|high|normal|low|idle (urgent and high need -m "why"). Due by a time: --by 23:30.
|
|
@@ -114,13 +121,15 @@ ask the person (one-way doors only)
|
|
|
114
121
|
dibs questions dismiss <id> dismiss one; its waiting agent gets exit 75
|
|
115
122
|
dibs hours [09:00-23:00|off] [--json] the person's hours: outside them, questions below urgent wait for morning
|
|
116
123
|
dibs say "..." [--as label] [--to person] an FYI to the person in your thread: progress, done, blocked on X.
|
|
117
|
-
--to person: a reply to what they said (the desk's answers)
|
|
124
|
+
--to person: a reply to what they said (the desk's answers); --to <agent>: a message to that agent,
|
|
125
|
+
the same as dibs tell
|
|
118
126
|
|
|
119
127
|
progress (post as often as you commit)
|
|
120
128
|
dibs progress "..." [--task <name>] [--eta 30m|17:30] [--done|--blocked]
|
|
121
129
|
what you just did, found or decided, in a sentence or a paragraph. The person
|
|
122
130
|
reads every post live; other agents read them too. Post at each step, not at the end
|
|
123
131
|
dibs progress [--agent <name>] [-n 50] [--json] recent posts
|
|
132
|
+
dibs progress list [--all] [--json] your session's open tasks (--all: every session's), owner, state, ETA, last post
|
|
124
133
|
|
|
125
134
|
the person's page and MCP server
|
|
126
135
|
dibs web [--port 7421] [--bind <address>] every agent's jobs, tasks and posts at http://127.0.0.1:7421, and the same as
|
|
@@ -152,6 +161,10 @@ talk with your agents
|
|
|
152
161
|
dibs tell <agent> "..." a message for that agent: it gets it with its next tool call, or as it
|
|
153
162
|
finishes its turn (needs dibs guard install). From an agent, it says which agent sent it
|
|
154
163
|
dibs tell desk "..." to the agent config.json names as "desk": it answers with dibs say --to person
|
|
164
|
+
dibs listen [--for 30m] [--json] waits until a message, an answer or a notice is queued for you, prints all of it
|
|
165
|
+
and exits 0; no time limit unless --for (exit 3: none in time), and it ends quietly
|
|
166
|
+
with your session. Start it with run_in_background at the start of
|
|
167
|
+
a session and again each time it exits: its exit wakes you even while idle
|
|
155
168
|
|
|
156
169
|
several machines
|
|
157
170
|
dibs run <res> --anywhere -- <cmd> run it on whichever machine would start it soonest (maybe this one)
|
|
@@ -190,7 +203,10 @@ other
|
|
|
190
203
|
dibs throttle [--watch] move CPU hogs running outside dibs to background priority when the machine is hot
|
|
191
204
|
dibs setup scratch [--size 40G] print the one-time commands for a capped volume for build output (--check: how full)
|
|
192
205
|
dibs changes what changed in recent versions
|
|
193
|
-
dibs guard install|remove|status|check a Claude Code hook that runs heavy commands through dibs when an agent forgets
|
|
206
|
+
dibs guard install|remove|status|check|serve a Claude Code hook that runs heavy commands through dibs when an agent forgets
|
|
207
|
+
dibs init [--repo] [--remove] write dibs.md (the agent instructions) and a note pointing at it in ~/.claude/CLAUDE.md,
|
|
208
|
+
~/.codex/AGENTS.md and this repo's CLAUDE.md and AGENTS.md (install does it; --repo makes
|
|
209
|
+
this repo's CLAUDE.md; --remove takes it all out; DIBS_NO_AGENT_NOTES=1 skips it)
|
|
194
210
|
|
|
195
211
|
flags
|
|
196
212
|
-m "why" shown to everyone (required with urgent and high)
|
|
@@ -203,6 +219,10 @@ flags
|
|
|
203
219
|
low and idle runs may be paused (not killed) for urgent or high work, or under memory pressure
|
|
204
220
|
--by 23:30|20m deadline: as it nears you move up the queue (up to an hour), and you're warned if it's at risk
|
|
205
221
|
--est 5m how long the job takes, when dibs has no history for it. Short jobs move up a little
|
|
222
|
+
--quick it takes under 15 s (quickUnder): it starts at once, past the line and full slots, at most 2 at a time.
|
|
223
|
+
On the simulator, or a deploy of the same repo, it goes to the front of the line instead. Trusted the
|
|
224
|
+
first time; a run that goes over loses the pass until it runs under again. A command dibs has seen run
|
|
225
|
+
under 15 s gets it without the flag
|
|
206
226
|
--cost 3 tokens a quota:<name> job takes from its bucket (default 1)
|
|
207
227
|
--mem 4G memory the job needs (default from the resource). dibs measures what it really uses
|
|
208
228
|
and plans the next run at that when it's more
|
|
@@ -237,11 +257,12 @@ A profile is a name for a resource with its ports and sizes, set once in config.
|
|
|
237
257
|
files:<path or glob> is a file lease: while you hold it, dibs guard turns away other sessions' edits and writes there.
|
|
238
258
|
sim is the one shared booted simulator. sim-own boots a private one for your command: its udid is in $SIM, its name in $SIM_NAME.
|
|
239
259
|
Exit codes: the command's own, or 75 gave up waiting (NOT a failure: your command never started; run the
|
|
240
|
-
same command again within 2 minutes to keep your place), 74
|
|
260
|
+
same command again within 2 minutes to keep your place), 74 this run can't fit on this disk even empty of
|
|
261
|
+
other jobs, or its wait limit ran out on disk (low disk otherwise just means you wait),
|
|
241
262
|
76 lost the coordinator or the other machine before the job started (safe to send again),
|
|
242
263
|
77 lost it after the job started on another machine (it may have run: check before running it again),
|
|
243
264
|
127 command didn't start, 2 bad usage (also: you already have this exact command waiting or running),
|
|
244
|
-
1 nothing matched (mine, release), 70 dibs itself crashed (a bug in dibs; report it: dibs ask "...").
|
|
265
|
+
1 nothing matched (mine, release), 3 dibs listen heard nothing in time, 70 dibs itself crashed (a bug in dibs; report it: dibs ask "...").
|
|
245
266
|
A job sent to another machine takes the git working copy (tracked files plus new ones git doesn't ignore;
|
|
246
267
|
outside git, the folder minus build output). .env files, keys and certificates never leave this machine.
|
|
247
268
|
Config: ${paths.config}`;
|
|
@@ -256,6 +277,7 @@ function parse(argv) {
|
|
|
256
277
|
else if (a === '-p' || a === '--priority') { o.prio = priority(next()); if (!(o.prio in PRIORITY_SHIFT)) die(`priority is one of ${PRIORITIES.join(', ')} (or 1-5)`); }
|
|
257
278
|
else if (a === '--by') o.by = deadline(next());
|
|
258
279
|
else if (a === '--est') o.est = ms(next());
|
|
280
|
+
else if (a === '--quick') o.quick = true;
|
|
259
281
|
else if (a === '--cost') { o.cost = Number(next()); if (!(o.cost > 0)) die('--cost takes a number of tokens above 0'); }
|
|
260
282
|
else if (a === '--mem') o.mem = bytes(next());
|
|
261
283
|
else if (a === '--cpu') { o.cpu = Number(next()); if (!(o.cpu >= 0)) die('--cpu takes a number of cores'); }
|
|
@@ -295,14 +317,6 @@ function parse(argv) {
|
|
|
295
317
|
return o;
|
|
296
318
|
}
|
|
297
319
|
|
|
298
|
-
// The changelog's sections, newest first: [{ version, body }].
|
|
299
|
-
function changelog() {
|
|
300
|
-
try {
|
|
301
|
-
return fs.readFileSync(path.join(ROOT, 'CHANGELOG.md'), 'utf8').split(/^## /m).slice(1)
|
|
302
|
-
.map(sec => ({ version: sec.split(/\s/)[0], body: sec.slice(sec.indexOf('\n') + 1).trim() }));
|
|
303
|
-
} catch { return []; }
|
|
304
|
-
}
|
|
305
|
-
|
|
306
320
|
// The first time each agent session runs a new version, one line pointing at
|
|
307
321
|
// what changed. Only for an agent that ran an older one here: a brand-new
|
|
308
322
|
// install, or a session that never ran dibs before, has nothing to compare.
|
|
@@ -310,19 +324,26 @@ function changelog() {
|
|
|
310
324
|
function announce() {
|
|
311
325
|
const id = identity();
|
|
312
326
|
const key = String(id.spid || id.who);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
try {
|
|
319
|
-
const tmp = `${paths.seen}.${process.pid}`;
|
|
320
|
-
fs.writeFileSync(tmp, JSON.stringify(seen));
|
|
321
|
-
fs.renameSync(tmp, paths.seen);
|
|
322
|
-
} catch {}
|
|
327
|
+
const before = seenBy(key);
|
|
328
|
+
// Already heard of this one, or of a newer one (a dibs listen told it of an update this older
|
|
329
|
+
// process hasn't been replaced by yet): nothing to say, and never move it back.
|
|
330
|
+
if (before === VERSION || (before && newer(before, VERSION))) return;
|
|
331
|
+
markSeen(key, VERSION);
|
|
323
332
|
if (before) process.stderr.write(`dibs was updated to ${VERSION}: see \`dibs changes\`\n`);
|
|
324
333
|
}
|
|
325
334
|
|
|
335
|
+
// An npm install has no install script (the package runs none, by design), so the first
|
|
336
|
+
// command after an install or upgrade writes dibs.md and the agents' notes (src/notes.mjs).
|
|
337
|
+
// Only from node_modules: a checkout or install.sh's folder has dibs init and install.sh.
|
|
338
|
+
async function npmNotes() {
|
|
339
|
+
if (!ROOT.split(path.sep).includes('node_modules')) return;
|
|
340
|
+
try {
|
|
341
|
+
const notes = await lazy('notes');
|
|
342
|
+
if (!notes.stale()) return;
|
|
343
|
+
for (const f of notes.write()) process.stderr.write(`dibs: wrote ${f}\n`);
|
|
344
|
+
} catch (e) { process.stderr.write(`dibs: couldn't write dibs.md or the agents' notes (${e.message}). dibs init tries again\n`); }
|
|
345
|
+
}
|
|
346
|
+
|
|
326
347
|
// A caller with no hook to hand it notices (outside Claude Code) gets them here.
|
|
327
348
|
function notices() {
|
|
328
349
|
if (process.env.CLAUDE_CODE_SESSION_ID) return;
|
|
@@ -334,8 +355,8 @@ function notices() {
|
|
|
334
355
|
const ALIASES = { done: 'release', renew: 'hold', news: 'changes', cool: 'throttle', ls: 'status', board: 'status' };
|
|
335
356
|
const VERBS = new Set(['run', 'hold', 'release', 'when', 'why', 'mine', 'who', 'yield', 'ask', 'requests', 'port', 'throttle', 'changes', 'status', 'help',
|
|
336
357
|
'machines', 'serve', 'join', 'leave', 'worker', 'service', 'invite', 'kick', 'limit', 'guard', 'sims', 'pace', 'setup', 'history', 'stats',
|
|
337
|
-
'question', 'questions', 'answer', 'hours', 'say', 'tell', 'threads', 'boost', 'pause', 'resume', 'stop', 'cap', 'later',
|
|
338
|
-
'progress', 'web', 'pair', 'relay', 'connect', 'alerts']);
|
|
358
|
+
'question', 'questions', 'answer', 'hours', 'say', 'tell', 'threads', 'listen', 'boost', 'pause', 'resume', 'stop', 'cap', 'later',
|
|
359
|
+
'progress', 'web', 'pair', 'relay', 'connect', 'alerts', 'init']);
|
|
339
360
|
|
|
340
361
|
// A job sent from another machine ends when the worker that started it does,
|
|
341
362
|
// even if the worker was killed outright and couldn't say so.
|
|
@@ -401,7 +422,8 @@ async function main() {
|
|
|
401
422
|
// Services, jobs sent from another machine and scheduled ones have nobody to read the notes.
|
|
402
423
|
// A thin waiter's turn has had them already, when it got in line.
|
|
403
424
|
const lease = argv.slice(0, argv.indexOf('--') >>> 0).includes('--lease');
|
|
404
|
-
if (!process.env.DIBS_REMOTE_JOB && !process.env.DIBS_LATER_JOB && !lease && !['serve', 'worker', 'service', 'relay'].includes(verb)) { announce(); notices(); }
|
|
425
|
+
if (!process.env.DIBS_REMOTE_JOB && !process.env.DIBS_LATER_JOB && !lease && !['serve', 'worker', 'service', 'relay', 'init'].includes(verb)) { announce(); notices(); }
|
|
426
|
+
if (verb !== 'init') await npmNotes();
|
|
405
427
|
// `dibs sim -- cmd` (no verb) means run; a bare `dibs` or `dibs --json` is the board.
|
|
406
428
|
// `dibs -m why sim -- cmd` is a run too: anything with a command after -- is.
|
|
407
429
|
if (!verb || (verb.startsWith('-') && verb !== '--' && !argv.includes('--'))) return status(parse(argv), cfg);
|
|
@@ -467,9 +489,11 @@ async function main() {
|
|
|
467
489
|
case 'web': return (await lazy('web')).web(rest);
|
|
468
490
|
case 'pair': return (await lazy('web')).pair(rest);
|
|
469
491
|
case 'connect': return (await lazy('connect')).connect(rest);
|
|
492
|
+
case 'init': return (await lazy('notes')).init(rest);
|
|
470
493
|
case 'relay': return (await lazy('relay')).relay(rest);
|
|
471
494
|
case 'tell': return tell(rest);
|
|
472
495
|
case 'threads': return threads(rest);
|
|
496
|
+
case 'listen': return listen(rest);
|
|
473
497
|
case 'boost': return boost(rest, cfg);
|
|
474
498
|
case 'pause': return pause(rest, cfg);
|
|
475
499
|
case 'resume': return resume(rest);
|
|
@@ -509,18 +533,35 @@ async function readOne(argv) {
|
|
|
509
533
|
const CRASHED = 70;
|
|
510
534
|
const crash = e => die(`dibs itself crashed (a bug in dibs, not in your command; exit ${CRASHED}). Report it: dibs ask "..."\n${e?.stack || String(e)}`, CRASHED);
|
|
511
535
|
// A full disk is no bug: say what to do, with the exit code agents know (74), not a stack.
|
|
512
|
-
|
|
536
|
+
// A lock dibs can't take over (src/lock.mjs LockBroken) is no bug either: the message names what to remove.
|
|
537
|
+
const fail = e => (noSpace(e) ? die(fullDisk(e), 74) : e?.code === 'ELOCKBROKEN' ? die(e.message, 75) : crash(e));
|
|
513
538
|
process.on('uncaughtException', fail);
|
|
514
539
|
|
|
515
540
|
// A job lost on its way to or on another machine (76, 77) and dibs's own crash
|
|
516
541
|
// (70) go in the event log, so the person hears of them (src/alerts.mjs), not
|
|
517
542
|
// only the agent whose tool call ended.
|
|
518
543
|
let calledVerb = '';
|
|
544
|
+
// A crash's error and stack, so the record says which bug it was: the stack used to go only to the
|
|
545
|
+
// terminal or a service's log, and the 2026-11-10 broker crashes left no trace of theirs anywhere.
|
|
546
|
+
const SRC_FRAME = /\/((?:src|bin)\/[\w.]+:\d+)/;
|
|
547
|
+
const crashAt = text => {
|
|
548
|
+
const [, error, ...frames] = text.split('\n');
|
|
549
|
+
const where = frames.map(l => l.match(SRC_FRAME)?.[1]).find(Boolean);
|
|
550
|
+
return error ? { error: error.slice(0, 300), ...(where && { where }), stack: frames.filter(l => /^\s+at /.test(l)).slice(0, 8).map(l => l.trim()).join('\n').slice(0, 1500) } : {};
|
|
551
|
+
};
|
|
552
|
+
// What a long-running dibs (a service, the broker, a listener) was doing when it gave up with 75.
|
|
553
|
+
// Plain runs and holds exit 75 every day when a wait runs out; that's no news.
|
|
554
|
+
const GAVE_UP = new Set(['throttle', 'worker', 'serve', 'web', 'relay', 'listen', '']);
|
|
555
|
+
const gaveUpAt = () => ({ where: lastDieAt.split('\n').slice(2).map(l => l.match(SRC_FRAME)?.[1]).filter(Boolean).slice(0, 4).join(' < ') });
|
|
519
556
|
process.on('exit', code => {
|
|
520
|
-
if (code !== lastDieCode
|
|
557
|
+
if (code !== lastDieCode) return;
|
|
558
|
+
const lost = (code === 76 || code === 77) && calledVerb === 'run';
|
|
559
|
+
const gaveUp = code === 75 && GAVE_UP.has(calledVerb);
|
|
560
|
+
if (code !== CRASHED && !lost && !gaveUp) return;
|
|
521
561
|
try {
|
|
522
|
-
event({ kind: code === CRASHED ? 'crash' : 'lost', code, verb: calledVerb, who: identity().who,
|
|
523
|
-
cmd: process.argv.slice(2).join(' ').slice(0, 160), why: lastDie.split('\n')[0].slice(0, 300)
|
|
562
|
+
event({ kind: code === CRASHED ? 'crash' : gaveUp ? 'gaveup' : 'lost', code, verb: calledVerb, who: identity().who,
|
|
563
|
+
cmd: process.argv.slice(2).join(' ').slice(0, 160), why: lastDie.split('\n')[0].slice(0, 300),
|
|
564
|
+
...(code === CRASHED ? crashAt(lastDie) : gaveUp ? gaveUpAt() : {}) });
|
|
524
565
|
} catch {}
|
|
525
566
|
});
|
|
526
567
|
main().catch(fail);
|
package/docs/benchmarks.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Does dibs speed work up or slow it down?
|
|
2
2
|
|
|
3
|
-
Measured on 2026-10-14, on
|
|
3
|
+
Measured on 2026-10-14, on a 10-core (4 performance, 6 efficiency), 16 GB Mac, with 0.0.72 and with this branch. Everything here can be rerun: the commands are under each section.
|
|
4
4
|
|
|
5
5
|
## Short answer
|
|
6
6
|
|
package/docs/files.md
CHANGED
|
@@ -19,7 +19,7 @@ With the guard installed (`dibs guard install`, or the plugin), the hook turns a
|
|
|
19
19
|
|
|
20
20
|
Claude Code keeps each session's scratch files in `/private/tmp/claude-<uid>/<project folder>/<session id>/`. The guard turns away any delete or write there outside the calling session's own folder, whatever `guard.files` says, because it's the person's rule: another agent may be using those files right now. That covers `rm`, `find -delete` and `find -exec rm`, `xargs rm`, `rsync --delete`, `mv` away, `truncate`, `>` redirects, and Edit or Write. It also covers deleting the root itself, a project folder, or a glob that spans sessions (`/private/tmp/claude-503/*`), under any spelling (`/tmp/...`). Variables set earlier in the same command (`S=/path; find $S ...`, `export S=...`) or in the hook's environment are read, so a path in one is checked like one typed out. A `$VAR` path dibs still can't read is turned away when its literal start names another session's folder. A recursive delete whose whole target is a variable or `$(...)` it can't read (`rm -rf $S`, `rm -rf "$S"/*`, `find $S ... -delete`) is turned away everywhere: write the path out. A literal end (`"$S/build"`) is fine. Reads are fine anywhere, and so are writes and single-file deletes in your own session's folder.
|
|
21
21
|
|
|
22
|
-
Subagents share their session's folder, so inside it the guard
|
|
22
|
+
Subagents share their session's folder, so inside it the guard turns away only a recursive delete (`rm -r`, `find -delete`, `find -exec rm`, `find | xargs rm`, `rsync --delete`, `rmdir -p`; a find's filters such as `-mindepth 1` or `-mmin +180` don't change that, since it can still reach everything) of the session folder itself or its `scratchpad`, or a glob of nothing but wildcards at the scratchpad's top (`scratchpad/*`). Anything inside the scratchpad is the session's own: any agent of the session, the main thread or a teammate, may delete any folder in it, whoever made it and however old it is. dibs still notes which agent first wrote into each folder at the top of the scratchpad (in `~/.dibs/scratch/<session>`, gone once the session's folder is), counting a folder a program makes as made by the agent whose command named it before it existed (`xcodebuild -derivedDataPath <scratchpad>/dd`, `--out=<path>`), so the disk watcher can tell whose folder is filling the disk. Ask a teammate before deleting what it may still be using.
|
|
23
23
|
|
|
24
24
|
Reads are never blocked, and nothing it can't read is blocked either: a path built from `$VAR` or `$(...)`, a script that writes on its own. A refusal means wait or ask the holder, not find another way to write the file.
|
|
25
25
|
|
package/docs/guard.md
CHANGED
|
@@ -61,6 +61,12 @@ dibs guard status # installed? exit 1 if not
|
|
|
61
61
|
dibs guard remove
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
**Faster: the resident guard.** The hook runs on every tool call, and starting Node for each one is most of its time on a busy Mac. `dibs service install guard` keeps one process answering it over `~/.dibs/guard.sock` (macOS and Linux, settings.json installs; the plugin's hook starts Node as before). Each call still runs on its own, with the session's environment, so it answers exactly as before. When the service isn't running, or doesn't answer within 2 seconds, the hook starts Node itself: a stopped service slows the hook down but never breaks a tool call.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
dibs service install guard
|
|
68
|
+
```
|
|
69
|
+
|
|
64
70
|
**Codex.** Codex reads the same marketplace and plugin files:
|
|
65
71
|
|
|
66
72
|
```bash
|
package/docs/machines.md
CHANGED
|
@@ -124,7 +124,7 @@ Jobs pack onto the VM while what's sent there fits its memory, less 1 GB. Jobs h
|
|
|
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
|
|
|
127
|
-
**When boat says no.** Before waking or making a VM, dibs reads `boat limits --json` (at most once a minute). With no starts left for the day or the hour, or `canStart` false, it doesn't try. A wake that fails anyway (a 429, say) is handled the same way: the jobs sent there go back to the machine that sent them when it takes jobs, and are lost (76) only when there's nowhere to go. The VM is marked `can't wake` with the reason and a time to try again: an hour for a quota or a 429, 5 minutes for anything else. Until then `dibs machines` shows `can't wake: <reason>`, `--anywhere` and jobs dibs ships on its own skip it, and `--on` it
|
|
127
|
+
**When boat says no.** Before waking or making a VM, dibs reads `boat limits --json` (at most once a minute). With no starts left for the day or the hour, or `canStart` false, it doesn't try. A wake that fails anyway (a 429, say) is handled the same way: the jobs sent there go back to the machine that sent them when it takes jobs, and are lost (76) only when there's nowhere to go. The VM is marked `can't wake` with the reason and a time to try again: an hour for a quota or a 429, 5 minutes for anything else. Until then `dibs machines` shows `can't wake: <reason>`, `--anywhere` and jobs dibs ships on its own skip it, and a job sent `--on` it runs on the machine that sent it, saying why.
|
|
128
128
|
|
|
129
129
|
### A VM made for a job too big for it
|
|
130
130
|
|
package/docs/questions.md
CHANGED
|
@@ -38,7 +38,9 @@ An agent may answer another agent's question with `dibs answer <id> <text>` when
|
|
|
38
38
|
|
|
39
39
|
## The person's threads, and the desk
|
|
40
40
|
|
|
41
|
-
`dibs threads` holds what's for the person: one-way questions, and agents' `dibs say` notes, marked FYI. dibs's own notices to an agent about its jobs (bookings, stuck-job advice, "pass --mem 7G") go only to that agent through the hook, never into the person's threads.
|
|
41
|
+
`dibs threads` holds what's for the person: one-way questions, and agents' `dibs say` notes, marked FYI. dibs's own notices to an agent about its jobs (bookings, stuck-job advice, "pass --mem 7G") go only to that agent through the hook, never into the person's threads. Neither do the notes dibs writes in an agent's name (how a `dibs later` run ended), or one agent's `dibs tell` to another.
|
|
42
|
+
|
|
43
|
+
`dibs threads --json` keeps those apart for the page and the Mac app: `between` lists what agents told each other (`from`, `to`, delivery state), and `fromDibs` lists dibs's notices and notes to agents. Each thread's `reach` says how a message sent now would get to its agent: `listening` (within seconds), `working` (its next tool call), `idle` (not until it works again), `ended`, or `command` (not a Claude Code session). A message the person sent carries `deliveredAt` and `via` (`tool`, `stop`, `listen`, `say`, `command`) once it's handed over.
|
|
42
44
|
|
|
43
45
|
Set `"desk": "<agent name>"` in `~/.dibs/config.json` to give the person one agent to talk to. `dibs tell desk "..."` (and the Mac app's chat) reaches that agent through the hook, and it answers with `dibs say --to person "..."`. `dibs threads --json` names it (`desk`), marks its thread `desk: true`, and its answers `reply: true`.
|
|
44
46
|
|
|
@@ -69,10 +71,12 @@ dibs tell web-app/Explore "check the tests" # a subagent's thread is <session n
|
|
|
69
71
|
How a message reaches the agent, with `dibs guard install` (or the plugin):
|
|
70
72
|
|
|
71
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: ..."). 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.
|
|
72
|
-
- If the agent is ending its turn instead, the Stop hook (SubagentStop for a subagent) answers with
|
|
74
|
+
- 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.
|
|
73
75
|
- 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.
|
|
74
76
|
- Without the guard, the agent gets queued messages the next time it runs `dibs say`.
|
|
75
77
|
|
|
76
|
-
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, notices arrive on stderr with the agent's next dibs command
|
|
78
|
+
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
|
+
|
|
80
|
+
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.
|
|
77
81
|
|
|
78
82
|
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`.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# dibs reference
|
|
2
|
+
|
|
3
|
+
Everything the [README](../README.md) leaves out: the rules to paste into your agents' instructions, every command, who may change what, the page and MCP in full, exit codes and settings. `dibs help all` prints the commands too, and `dibs ask "..."` answers from this file and the rest of docs/.
|
|
4
|
+
|
|
5
|
+
## Tell your agents
|
|
6
|
+
|
|
7
|
+
The install does this for you: it writes `dibs.md` beside dibs and a note pointing at it into `~/.claude/CLAUDE.md` (`dibs init` again by hand). The Claude Code plugin ships the same text as a skill. To paste it yourself into a `CLAUDE.md` or `AGENTS.md`, these are the rules every agent gets first; the rest is reference in the skill:
|
|
8
|
+
|
|
9
|
+
<!-- dibs:rules:start -->
|
|
10
|
+
```markdown
|
|
11
|
+
## dibs
|
|
12
|
+
dibs runs on this machine. Agents take turns through it on the simulator, Xcode builds, test suites, browser runs and deploys.
|
|
13
|
+
- Wrap those: `dibs run <resource> -m "why" -- <command>` (resources: sim, sim-own, xcode-build, test, playwright, deploy, heavy). Two at once: `dibs run sim,xcode-build -- ...`.
|
|
14
|
+
- No dibs for reads, edits, small commands, or long jobs that mostly wait on the network and use little CPU, memory or disk (crawlers, pollers, HTTP checks). The hook leaves those alone too.
|
|
15
|
+
- Start `dibs listen` with run_in_background now, and again each time it exits: it wakes you when the person or dibs has something for you.
|
|
16
|
+
- Waiting is normal. A call moved to the background is still waiting: don't run it again. A wait on memory, swap or disk protects the machine: keep waiting, and never lower `--mem` or raise `-p` to get past it.
|
|
17
|
+
- Exit 75: it gave up waiting and your command never ran; run the same command again. Exit 74: it can't fit on this disk, or its wait limit ran out; low disk just means a wait.
|
|
18
|
+
- Decide what you can undo yourself. Ask the person only before something you can't undo (`dibs question ... --one-way`). Lines starting "Message from the person:" are theirs: act on them.
|
|
19
|
+
- Post progress as you work: `dibs progress "what you did or found" --task <name> --eta 30m`, then `--done`.
|
|
20
|
+
- The rest (holding across tool calls, file leases, other machines, every exit code, overriding jobs, questions) is in the dibs skill and in `dibs help`.
|
|
21
|
+
```
|
|
22
|
+
<!-- dibs:rules:end -->
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dibs run sim,xcode-build -- ./build-and-install.sh # everything you need, at once
|
|
28
|
+
dibs run playwright --port WEB --port API -- npx playwright test # free ports in $WEB and $API
|
|
29
|
+
dibs run test -p high -m "release blocker" --by 23:30 -- npm test
|
|
30
|
+
dibs run test --after #42 -- npm run e2e # joins the line once your job #42 has ended
|
|
31
|
+
dibs hold sim --for 20m -m "screenshot pass" # across several tool calls; again to extend
|
|
32
|
+
dibs release sim
|
|
33
|
+
dibs hold 'files:src/auth/**' -m "auth refactor" # other agents' edits there are turned away
|
|
34
|
+
dibs run quota:asc --cost 3 -- ./upload.sh # share an API's rate limit between scripts
|
|
35
|
+
dibs when sim # when you'd get it, without joining the line
|
|
36
|
+
dibs who sim # who holds it, until when, who's next
|
|
37
|
+
dibs why # where you are, when you start, what you're waiting for (--detail: the math)
|
|
38
|
+
dibs mine sim # exit 0 if you hold it, 1 if not
|
|
39
|
+
dibs yield web-app # let another agent go first
|
|
40
|
+
dibs pace quiet # how hard dibs drives this machine: quiet, normal or max
|
|
41
|
+
dibs sims # the private simulator pool
|
|
42
|
+
dibs setup scratch # the admin commands for a capped scratch volume for build output (macOS)
|
|
43
|
+
dibs changes # what changed in recent versions
|
|
44
|
+
dibs question "Ship 123 now?" --options yes,no --recommend yes -m "tests pass" --one-way "testers get it at once" --wait # only one-way doors reach the person
|
|
45
|
+
dibs questions # what agents are asking you, with what they recommend; dibs answer <id> <option, or your own words>
|
|
46
|
+
dibs hours 09:00-23:00 # outside your hours, questions below urgent wait for the morning
|
|
47
|
+
dibs threads # one thread per agent: its notes and questions, your messages; dibs threads read <agent>
|
|
48
|
+
dibs tell web-app "use the staging database" # reaches the agent on its next tool call, or as it finishes its turn
|
|
49
|
+
dibs tell desk "why is my build waiting?" # the agent config.json names as "desk" answers you with dibs say --to person
|
|
50
|
+
dibs alerts # what's wrong and the one fix for each: long waits, memory holding work back (and what to close), stuck jobs, failed or lost jobs, dibs itself, a full disk
|
|
51
|
+
dibs alerts dismiss <id> # close one for a day; it comes back if its cause is still there
|
|
52
|
+
dibs listen # an agent waits for a message (run_in_background), as long as its session lives
|
|
53
|
+
dibs history # the last 7 days: busy time, waits and who waited, by resource, agent and hour
|
|
54
|
+
dibs stats # waits against run times, today and the last 7 days: the share of jobs that waited longer than they ran
|
|
55
|
+
dibs stats --me # your own: jobs, run and wait time, failures by exit code, what held you back, top commands, ETAs met (--agent <name>, --since 30d, --json)
|
|
56
|
+
dibs later sim --at 02:00 -m "snapshot suite" -- ./snapshots.sh # run it tonight; returns at once with its id
|
|
57
|
+
dibs later test --after web-app:deploy -- npm run smoke # when that agent's deploy ends (--after-ok: only if it passed)
|
|
58
|
+
dibs later list # scheduled, waiting, running, and how the finished ones ended; dibs later cancel <id>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`dibs listen` also wakes an agent when dibs on this machine is updated (with what changed) or when a newer release is out, which it learns by asking dibs.cc at most every 6 hours per machine (never from a git checkout). `"updateCheck": false` in `~/.dibs/config.json` turns that ask off.
|
|
62
|
+
|
|
63
|
+
Anyone can override any job, the person or an agent. An agent acting on a job that isn't its own names the owner with `--owner <session>` (or `session/agent`), as the board shows it, or nothing changes (exit 2, with the owner, its `-m` and the command to rerun); the person never needs it. Every answer starts with whose job it was: `boosting #10167: alex-c8 deploy 'shop-api first deploy'`. `dibs boost <id> high -m "why"` (the `#` on `dibs --detail`), `dibs pause <id>` and `dibs resume <id>`, `dibs stop <id>` (kills the job; its agent is told who stopped it), and `dibs cap <agent> low` (that agent never waits or runs above low until `dibs cap <agent> off`). The same goes for `answer`, `questions dismiss`, `hours`, `pace <word>`, `tell`, `threads read`, `join`, `invite`, `pair --machine`, `kick`, `limit`, `service install`/`remove`, `guard install`/`remove` and `serve --force`: nothing is the person's alone.
|
|
64
|
+
|
|
65
|
+
Every one of them is logged with who ran it: `dibs history --json` has an `override` event with `by` (the agent's session name, or `the person`). The board says it too: `[boosted by web-app: release blocked]`, `[paused by web-app]`, `capped: pushy at low (by web-app)`. A message an agent sends with `dibs tell` arrives as `Message from web-app (another agent, not the person)`, and an agent that answers a question is named to the one that asked. An agent raising a job to high or urgent passes `-m`, so everyone sees why. The machine's own limits (memory, swap, disk, and never pausing every job) hold for everyone.
|
|
66
|
+
|
|
67
|
+
A waiting `dibs run` or `dibs hold` is a shell blocked on a FIFO (about 1.5 MB, no CPU), and one broker process decides for every waiter on the machine: it starts when someone waits and exits after a quiet minute. Before 0.0.102 each waiter was a Node process of its own, 35 to 65 MB polling the state every 1.5 seconds, which with dozens waiting came to gigabytes and kept the state lock busy most of the time. To go back to that, in `~/.dibs/config.json` (or `DIBS_THIN=0` for one caller):
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{ "waits": "fat" }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Nothing changes in how agents call dibs, what it prints, or its exit codes. Jobs other machines send here and `dibs later` jobs wait thin too. `--after` still waits in Node (it waits outside the line until the other job ends), as does a run sent with `--anywhere` or `--on`, whose sender follows it over the network while it waits on the other machine. Anything that goes wrong with a thin wait (a broker that died, got stuck or couldn't start, a wait that fell back to Node, a crash) leaves an event of kind `thin` in `~/.dibs/events.jsonl`: `grep '"kind":"thin"' ~/.dibs/events.jsonl`.
|
|
74
|
+
|
|
75
|
+
## Watching your agents: the page and MCP
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
dibs service install web # or: dibs web (http://127.0.0.1:7421)
|
|
79
|
+
dibs pair # a one-time code, e.g. K7QM-4XNA: one use, 10 minutes
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Open http://127.0.0.1:7421 and type the code. The rail on the left switches between views:
|
|
83
|
+
|
|
84
|
+
- **Now**: alerts first: anything wrong, why, and the one fix, until it resolves (then when it did). Then every agent's running and waiting jobs on a timeline that spans only the time something is in, file locks, tasks with their ETAs, and every `dibs progress` post, live. Click a job to make it go first, give it back its normal place, let others go first, pause, resume or stop it (stop asks twice). Pick an agent to hold all its jobs back (`dibs cap`).
|
|
85
|
+
- **Questions**: what agents asked you at one-way doors. Answer with an option or your own words, or say not now.
|
|
86
|
+
- **Messages**: one thread per agent. What you send reaches the agent with its next tool call.
|
|
87
|
+
- **Stats**: run and wait time by agent and by resource, how often jobs waited longer than they ran, failures by exit code, what held jobs back, top commands, ETAs met, a daily trend, a day-by-hour heatmap, and the machine's load, memory and disk over time. Agents get the same numbers from `dibs stats --me`.
|
|
88
|
+
- **Scheduled**: `dibs later` runs coming up and ended this week; cancel one.
|
|
89
|
+
- **History**: `dibs history` for the past day, week or 30 days, and every override with who made it.
|
|
90
|
+
- **Settings**: the speed (`dibs pace`), your hours, and the Claude Code hook.
|
|
91
|
+
|
|
92
|
+
Every change on the page runs the same CLI command you would, as you, so `dibs history` and the board name you, and the CLI's own rules apply. Changes need the page's sign-in; nothing else can make them.
|
|
93
|
+
|
|
94
|
+
The same server is an MCP server at `http://127.0.0.1:7421/mcp`, so your own Claude can answer "what are my agents doing?". Add it to Claude Code with `claude mcp add --transport http dibs http://127.0.0.1:7421/mcp`; the client opens a sign-in page in your browser, and you type a code from `dibs pair`. With a plain `dibs pair` code it gets read-only tools: `board`, `agents`, `agent`, `progress`, `stats`, `questions`, `history`, `resource`, `machines` and `messages`. A code from `dibs pair --allow-actions` adds tools that act: post progress, answer questions, message agents and you, hold and release, and boost, pause, resume and stop jobs. It acts as an agent named after the client (`mcp-<name>`), never as you, so agents treat its messages as a peer's. A model reads text agents wrote, and text can steer a model, so give actions only to a client you'd trust with them. A code from `dibs pair --allow-commands` also lets a client signed in here (never through mcp.dibs.cc) queue commands to run on this Mac with `queue_run`, the way `dibs later` does. `dibs pair --list` shows what's signed in and `dibs pair --revoke <id|all>` signs it out.
|
|
95
|
+
|
|
96
|
+
It answers only on 127.0.0.1 unless you pass `--bind <address>` (your Tailscale address, say), and only to requests that name that address, so a web page can't reach it by DNS rebinding. Codes and tokens are stored hashed in `~/.dibs/web.json`. After 10 wrong codes in 10 minutes every try is refused until the window passes; open codes stay good. To let claude.ai or another Claude account read your board, `dibs relay mcp on` serves it at `https://mcp.dibs.cc/mcp` through the relay (docs/relay.md).
|
|
97
|
+
|
|
98
|
+
## Mac app
|
|
99
|
+
|
|
100
|
+
`app/` builds a Mac app (macOS 26) over the same commands: the live board with boost, pause, stop and cap buttons, agents' questions to answer, the week's history, and the pace, in a window and the menu bar. It runs the `dibs` on your PATH and reads nothing else. A signed, notarized download is at https://dibs.cc/mac. To build it yourself you need Xcode 26 and xcodegen (`brew install xcodegen`): [app/README.md](../app/README.md) has the steps.
|
|
101
|
+
|
|
102
|
+
Priority is `-p urgent|high|normal|low|idle`. `urgent` and `high` need `-m` and everyone sees them. `low` and `idle` run at background priority, and may be paused while urgent work borrows their slot. `--est 5m` tells dibs how long a new job takes, so short jobs can move up. A command that runs in under 15 seconds goes in the quick lane: wrap it with `--quick` (or `--est 10s`) and it starts at once, past the line and full slots, at most 2 at a time (on the simulator, or a deploy of the same repo, at the front of the line instead); dibs learns it after that, and takes the pass away from a run that goes over. `--by 23:30` moves you up as a deadline gets close.
|
|
103
|
+
|
|
104
|
+
Agents show up by their Claude Code session name. Anywhere else, dibs names them after the folder they run in; set `DIBS_AGENT=name` to pick your own.
|
|
105
|
+
|
|
106
|
+
## Exit codes
|
|
107
|
+
|
|
108
|
+
Agents branch on these, so they don't change.
|
|
109
|
+
|
|
110
|
+
| code | meaning |
|
|
111
|
+
|---|---|
|
|
112
|
+
| the command's own | it ran |
|
|
113
|
+
| 75 | dibs stopped waiting in line. The command never started and did not fail. Run the same command again within 2 minutes to keep your place. For `dibs question --wait`: no answer (timed out or dismissed), nothing was decided |
|
|
114
|
+
| 74 | this run can't fit on this disk even when it's empty of other jobs, or (outside Claude Code) its wait limit ran out while disk held it. Low disk otherwise just means you wait. Other sessions' `/private/tmp/claude-*` folders are off limits for making room |
|
|
115
|
+
| 76 | lost the coordinator or the other machine before a remote job started. Nothing ran there: sending it again is safe |
|
|
116
|
+
| 77 | lost the other machine after a remote job started. It may have run, or may still be running: check before running it again |
|
|
117
|
+
| 127 | the command didn't start |
|
|
118
|
+
| 2 | bad usage, a job asking more memory or cores than the machine ever hands out (it says the most it can ask), a resource name close to a real one (`simulator` for `sim`), an agent's high or urgent boost without `-m`, `--on` on a machine that isn't in a group, or a `dibs run` you already have waiting or running (wait for that one) |
|
|
119
|
+
| 3 | `dibs listen --for <time>` heard nothing in that time (without `--for` it has no limit). Run it again to keep listening |
|
|
120
|
+
| 1 | nothing matched: `mine` with nothing held (the clean result after a release), `release` with nothing to give back |
|
|
121
|
+
| 70 | dibs itself crashed: a bug in dibs, not your command. Report it with `dibs ask "..."`. If your command already ran, you get its code instead |
|
|
122
|
+
|
|
123
|
+
Inside Claude Code, `dibs run` waits as long as it takes: when the tool call hits its timeout, Claude Code moves it to the background and tells the agent when it ends. Everywhere else (Codex, scripts, a terminal) dibs gives up after 8 minutes with exit 75, which fits a 10-minute tool call. `--wait` lifts the limit, `--max-wait 20m` sets your own.
|
|
124
|
+
|
|
125
|
+
## Resources
|
|
126
|
+
|
|
127
|
+
| name | slots | memory | cores | free disk | pausable |
|
|
128
|
+
|---|---|---|---|---|---|
|
|
129
|
+
| sim | 1 | 3G | 1 | 8G | no |
|
|
130
|
+
| sim-own | 4 on 16 GB (RAM / 4G, at most 4), and only as many as free memory fits | 3G | 2 | 6G | no |
|
|
131
|
+
| xcode-build | 2 | 4G | 4 | 4G | no |
|
|
132
|
+
| playwright | 2 | 3G | 2 | 3G | yes |
|
|
133
|
+
| test | 3 | 2G | 3 | | yes |
|
|
134
|
+
| deploy | 1 per project (its repo's origin, or the folder outside git), up to 3 projects at once (`exclusiveBy: "repo"`, `across: 3`) | 0.5G | 1 | | no |
|
|
135
|
+
| heavy | 1 | 4G | 4 | 10G | yes |
|
|
136
|
+
| any other name | 1 | 1G | 1 | | no |
|
|
137
|
+
| `files:<path or glob>` | one holder per path | 0 | 0 | | no |
|
|
138
|
+
| `quota:<name>` | a token bucket from config | 0 | 0 | | no |
|
|
139
|
+
|
|
140
|
+
A name close to a real one (`simulator`, `tests`, `xcode`) is refused with exit 2 and the right name, since two agents slipping differently would both get the real thing at once. A name of your own that looks like none of them starts a queue of its own.
|
|
141
|
+
|
|
142
|
+
Running jobs share a budget of 8 GB and 6 cores while the machine is busy, so light jobs run side by side and heavy ones take turns. The cores count what running jobs are measured using, not what they asked for. dibs measures what each job really uses, failed and killed runs included, and plans the next run of the same command at that, when it's more than asked (a command it hasn't measured yet goes by the same program on the same resource, so a new Playwright spec starts at what the others used); `--mem` and `--cpu` say what you need up front. Override any of it in `~/.dibs/config.json`; you only need the keys you change. State lives in `~/.dibs`. A resource you make up can have a name people read on the board: `"resources": { "gpu": { "slots": 1, "label": "The GPU" } }` (a quota takes `"label"` too).
|
|
143
|
+
|
|
144
|
+
## The rest of docs/
|
|
145
|
+
|
|
146
|
+
- [docs/scheduling.md](scheduling.md): how a turn is decided, what a lease guarantees, nested runs, measuring what jobs use, rate-limit quotas, pausing low-priority work, `dibs pace`, running jobs side by side, resetting a resource after each use, throttling
|
|
147
|
+
- [docs/files.md](files.md): file leases, and which edits the guard turns away
|
|
148
|
+
- [docs/questions.md](questions.md): agents queuing questions for the person, `--wait`, working hours
|
|
149
|
+
- [app/README.md](../app/README.md): the Mac app
|
|
150
|
+
- [docs/later.md](later.md): runs scheduled for a time or after something else ends
|
|
151
|
+
- [docs/relay.md](relay.md): the page from a phone or any browser, end to end encrypted, and dibs accounts
|
|
152
|
+
- [docs/simulators.md](simulators.md): `sim-own`, the pool of private simulators
|
|
153
|
+
- [docs/guard.md](guard.md): the hook, what it matches, the subagent limit, installing it for Claude Code and Codex, your own rules
|
|
154
|
+
- [docs/machines.md](machines.md): sending jobs to other machines, adding one (`dibs pair --machine` on the coordinator, `dibs join <code>` on the new machine), tokens, and keeping a project's code on the machines you name
|
|
155
|
+
- [AGENTS.md](../AGENTS.md): working on dibs itself
|
|
156
|
+
|
|
157
|
+
Platforms: macOS is what dibs is tested on. Linux uses the same code paths (`ps`, process groups, `/proc/pressure/memory`) but hasn't had a full test run yet. Windows support exists and is untested.
|
package/docs/relay.md
CHANGED
|
@@ -56,7 +56,7 @@ Every connection, including the first right after pairing:
|
|
|
56
56
|
|
|
57
57
|
Keys: `salt = SHA-256(tx("dibs-hs-keys-v1", TH, sigM, sigD))`; from the X25519 shared secret, HKDF-SHA-256 with that salt gives `k_b2m` (info "dibs-relay-v1 key b2m"), `k_m2b` ("... key m2b") and the session id `sid` ("... sid"). Both ephemeral private keys are dropped after the exchange, so a later theft of the long-term keys reveals no recorded session (forward secrecy). Both sides signed the same transcript (mutual authentication); a replayed hello3 fails because the Mac's `em` and `nm` are new every time.
|
|
58
58
|
|
|
59
|
-
4. **ready**: the Mac's first encrypted frame. The page
|
|
59
|
+
4. **ready**: the Mac's first encrypted frame (key confirmation). The page may send its first call right behind hello3, sealed under keys bound to the Mac's signed ephemeral key, so only that Mac can read it; it reads no answer before it decrypts this, and a session without it dies with every call on it. The Mac handles hello3 before the next frame, so the call finds the keys in place.
|
|
60
60
|
|
|
61
61
|
## Frames
|
|
62
62
|
|
|
@@ -68,7 +68,7 @@ AAD = "dibs-frame-v1" | sid | direction (1 = browser to Mac, 2 = Mac to browse
|
|
|
68
68
|
|
|
69
69
|
Each side's `seq` starts at 0, and the receiver accepts only exactly the next one. A replayed, dropped, reordered, altered or cross-session frame fails, and any failure closes the session (the page reconnects with new keys). Plaintext is a 4-byte length, the JSON, and zeros up to the next bucket of 1, 4, 16, 64, 256 KiB, 1 or 4 MiB; requests are capped at 64 KiB. Messages: `{t: "req", id, method, path, body}` from the page, `{t: "res", id, status, json}` from the Mac. The Mac runs a request only after it decrypts, only for `/api/...` paths, only if the device is still in `relay.json` at that moment, and only if the device may. Remote calls go through an allow-list, checked in the relay connector and again in `api()`, on the path as `api()` parses it (so `/api/x/../hook` is `/api/hook`):
|
|
70
70
|
|
|
71
|
-
- any paired device: GET `/api/board`, `/api/questions`, `/api/threads`, `/api/later`, `/api/history`, `/api/stats`, `/api/settings`;
|
|
71
|
+
- any paired device: GET `/api/board` (with `?posts=0` the day's posts stay apart, for `/api/posts`), `/api/posts`, `/api/questions`, `/api/threads`, `/api/later`, `/api/history`, `/api/stats`, `/api/settings`;
|
|
72
72
|
- a device paired with `--allow-actions`, also: POST `/api/jobs/<id>/boost|pause|resume|stop`, `/api/cap`, `/api/pace`, `/api/later/<id>/cancel`;
|
|
73
73
|
- everything else is 403, a route added later included, so new routes are local-only until someone decides otherwise. That covers messaging an agent, marking a thread read, answering or dismissing an agent's question (all of which reach agents as "Message from the person", which agents act on, shell commands included), installing the hook (it edits `~/.claude/settings.json`) and setting the hours (they decide when the person gets asked).
|
|
74
74
|
|
|
@@ -152,11 +152,13 @@ An account remembers your Macs, so any browser you sign in with opens all of the
|
|
|
152
152
|
|
|
153
153
|
### Signing in
|
|
154
154
|
|
|
155
|
-
- **Email link.** The address is typed on
|
|
155
|
+
- **Email code (and link).** The address is typed on app.dibs.cc/account. The person check is Cloudflare Turnstile, invisible, on an origin of its own: `https://human.dibs.cc`, which the account page frames out of sight as soon as the email step shows (Turnstile's script changes without notice and so can't be pinned; app.dibs.cc runs no script it didn't ship, since AK is in its storage, and mcp.dibs.cc, whose origin the Mac trusts for MCP sign-in, runs none either). Only app.dibs.cc may frame it, it posts its token to that origin only, and it stores nothing. Only the person's click on Send code sends the token with the address; the relay checks the token with Cloudflare (for human.dibs.cc and this action, once) before it sends anything. `https://mcp.dibs.cc/email`, the old email page, redirects to the account page. It keeps HMAC-SHA-256 under `ACCOUNT_SECRET` of the trimmed, lowercased address (so it can find the account an address signs in to, and can't list addresses), and mails, through Cloudflare Email Sending from no-reply@mail.dibs.cc, a 6-digit code (never in the subject, which lock screens show) and a link, `https://app.dibs.cc/account#signin=<token>`, saying which browser asked and roughly where (Cloudflare's city and country for the request). The page that asked gets a request id (16 random bytes) and the person types the code there; the link is for another device. Either one, once, within 10 minutes, spends both. The code is uniform over 000000 to 999999, stored only as HMAC-SHA-256 under `ACCOUNT_SECRET` with its request id, compared in constant time, and gone after 5 wrong tries (a 1 in 200,000 chance per request, each request behind Turnstile, a click, and the limits below). The token is 32 random bytes in the fragment, so no request line, log or mail scanner's prefetch carries it; the relay stores only its SHA-256. For a mail wrapper that drops fragments, the page also takes `?signin=<token>`: loading it spends nothing (the page is served `no-store`, sends no referrer, takes the token out of the address bar at once and redeems it from script, which a scanner's prefetch doesn't run). Guesses at one code are checked one at a time, each against the tries the last one left, and an address takes at most 10 wrong codes a day across its requests; after that only its links sign in. The answer is the same whether or not the address has an account. A first sign-in makes the account, and the page then asks to add a passkey (skipping takes a second click that says what it costs).
|
|
156
156
|
- **Passkey.** WebAuthn, checked by hand in the Worker (relay/src/webauthn.js): CBOR, COSE ES256 and EdDSA, attestation "none", the challenge, origin, relying party (app.dibs.cc), user presence, and a sign count that must go up (a copy of a passkey with an older count is refused as a possible clone). User verification (a PIN or biometrics) is required to add one, and a sign-in without it gets a session but not the wrapped AK. Challenges are stateless: the time, 16 random bytes and an HMAC under `ACCOUNT_SECRET` over them, the kind and the account, good for 5 minutes; the relay stores one only once it's been used, so asking for challenges costs it nothing. It stores each passkey's id and public key. The account page lists them and removes one.
|
|
157
157
|
- **PRF.** When the browser supports the WebAuthn PRF extension, adding a passkey wraps AK under HKDF of its PRF output (AES-256-GCM, "dibs-ak-v1"), and the relay stores the wrapped AK. Signing in with that passkey anywhere it's synced opens AK there and then. The relay never sees the PRF output.
|
|
158
158
|
- **A session** is 32 random bytes the browser sends as a bearer header (never a cookie, so a WebSocket upgrade doesn't carry it and the relay can't tie a session to the Macs it opens), good for 30 days; the relay stores its SHA-256, and drops it the first time it's shown for an account that's gone. "Sign out everywhere else" ends every session made before it (the relay stores the time) and gives the asking browser a new one.
|
|
159
|
-
- **
|
|
159
|
+
- **Passkeys only.** With a passkey on the account, the account key's proof can switch email sign-in off: an email code or link then gives a recovery session, which reads nothing (not even the sealed keyring) and can only ask a Mac for AK. Once a Mac approves it (`dibs connect --approve`), the browser holds AK and proves it like any other. That's the way back for someone who lost every passkey.
|
|
160
|
+
- **Passkey first.** A browser that signed in with or added a passkey leads with "Sign in with passkey" next time; the email field also offers this site's passkeys in its autofill (WebAuthn conditional mediation).
|
|
161
|
+
- **Limits:** sign-in codes and links 3 an hour per address from one IP, 20 an hour per address from anywhere (so strangers can't lock a person out), 10 an hour per IP and 300 an hour in all, every request counting toward all four, behind Turnstile, and counted in the object's storage by the clock hour (keyed by the address's and IP's keyed hashes), so an eviction doesn't reset them; sign-in attempts 10 in 10 minutes per IP; 30 account requests a minute per IP (Workers rate limiting); 10 passkeys and 50 Macs per account (a 51st is refused; a Mac joining again replaces its own entry). Expired entries are swept by the object's alarm, 128 keys per kind at a time, never during a request.
|
|
160
162
|
|
|
161
163
|
### A new browser without the key
|
|
162
164
|
|
|
@@ -172,7 +174,7 @@ Everything the relay lists is its word, so the Mac pins what it saw in step 2: t
|
|
|
172
174
|
|
|
173
175
|
### What the relay sees and keeps, for accounts
|
|
174
176
|
|
|
175
|
-
- **Keeps:** the email hash, the account id, the hash of AK's proof, passkey ids and public keys and sign counts, AK wrapped under each PRF passkey, the sealed keyring and its version, the hashes of member Macs' account secrets and their machine ids, when sessions were last ended, and for
|
|
177
|
+
- **Keeps:** the email hash, the account id, the hash of AK's proof, passkey ids and public keys and sign counts, AK wrapped under each PRF passkey, the sealed keyring and its version, the hashes of member Macs' account secrets and their machine ids, when sessions were last ended, whether email may sign in, and for 10 minutes, 30 days, 5 minutes and 10 minutes the hashes of link tokens and codes (with their request ids' hashes), sessions, used challenges and approval requests.
|
|
176
178
|
- **Sees in transit:** the email address while it sends the link (TLS ends at Cloudflare), the link and session tokens, the public keys and commitments of approvals, IPs and times, and the size of the keyring.
|
|
177
179
|
- **Never sees:** AK, a PRF output, the keyring's contents (which Macs, their keys, the device key), or any frame between a browser and a Mac.
|
|
178
180
|
- **Can infer:** which Macs a signed-in browser then opens, from timing and IP, since those WebSockets carry no session.
|
|
@@ -183,8 +185,8 @@ Everything the relay lists is its word, so the Mac pins what it saw in step 2: t
|
|
|
183
185
|
- **The code index is one place every bare-host sign-in goes through.** It holds only code hashes and machine ids, and only for ten minutes, but it's a single object: a big enough flood can slow it, and while the global budget is spent, a person who mistypes their code has to wait a minute to try again (their first try always gets through). The per-machine URL, `https://mcp.dibs.cc/<machine id>/mcp`, doesn't use the index at all.
|
|
184
186
|
- **The relay holds one secret, `REG_SECRET`.** It signs bare-host client ids and nothing else. Whoever has it can mint a client id with any redirect, which is no more than anyone can do by registering; it can't sign anyone in, since that still takes the person's code.
|
|
185
187
|
- **An account is as safe as its key.** Whoever holds AK opens every Mac of the account (as the account device). It's in each signed-in browser's IndexedDB, on each member Mac, and wrapped under each PRF passkey. A stolen synced passkey with PRF, or a browser profile, gives it; so does a person approving the wrong browser at a Mac (the code is there to stop that). `dibs connect --remove <id>` takes a Mac off the account (its account device and key go); signing out clears a browser. There is no way yet to change AK without starting a new account.
|
|
186
|
-
- **Email is only as safe as the inbox.** A sign-in link gives a session, not AK, so a stolen inbox alone opens no Mac and changes nothing on the account; it can still ask a Mac for approval, which is why both codes must match.
|
|
187
|
-
- **Turnstile runs Cloudflare's script on
|
|
188
|
+
- **Email is only as safe as the inbox.** A sign-in code or link gives a session, not AK, so a stolen inbox alone opens no Mac and changes nothing on the account; it can still ask a Mac for approval, which is why both codes must match.
|
|
189
|
+
- **Turnstile runs Cloudflare's script on human.dibs.cc.** It never sees the address (that's typed on app.dibs.cc and sent from there), and it can't reach app.dibs.cc's storage or AK, or act as mcp.dibs.cc. If changed, it could hand the account page a bad token (the relay refuses it) or none (no code gets sent, passkeys still work).
|
|
188
190
|
- **The account's first write sets its proof.** Whoever writes the keyring first sets it. That's the browser that made the account, at once; an attacker would need the account's first sign-in link before the person used it. An account that got a keyring before proofs existed (2026-11-02, before the accounts CLI shipped, so with no Mac on it) takes no first proof from anyone and can't be changed.
|
|
189
191
|
- **The relay sees remote MCP traffic in transit.** With `dibs relay mcp on`, whatever an MCP client reads (the board, agents' posts and tasks, stats) passes through Cloudflare decrypted, as do the sign-in codes and OAuth tokens on their way. It's never stored, but whoever controls the relay could read or change it, or keep a token and use it until it expires (access tokens last a day) or is revoked. Changing it can't do more than that client's code allowed: read, or with `dibs pair --allow-actions`, act as its `mcp-` agent. `queue_run` never goes through the relay. The page's own channel isn't affected. Leave remote MCP off unless a client elsewhere needs it.
|
|
190
192
|
- **The relay sees each tab's relay token.** A tab presents it so the relay can admit it; the relay keeps only hashes (in the Mac socket's state, gone when it disconnects). The token grants a tab slot and nothing else: it opens no session and decrypts nothing. Someone who steals it from the browser can occupy one of that device's slots until it's revoked.
|