@dibssoftware/dibs 0.0.0-stage → 0.0.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +577 -0
  2. package/LICENSE +670 -0
  3. package/README.md +234 -2
  4. package/bin/dibs-guard.mjs +7 -0
  5. package/bin/dibs.mjs +526 -0
  6. package/docs/benchmarks.md +193 -0
  7. package/docs/files.md +30 -0
  8. package/docs/guard.md +91 -0
  9. package/docs/later.md +43 -0
  10. package/docs/machines.md +147 -0
  11. package/docs/questions.md +78 -0
  12. package/docs/relay.md +196 -0
  13. package/docs/releasing.md +25 -0
  14. package/docs/scheduling.md +163 -0
  15. package/docs/simulators.md +17 -0
  16. package/package.json +44 -4
  17. package/skills/dibs/SKILL.md +162 -0
  18. package/src/acquire.mjs +697 -0
  19. package/src/admin.mjs +145 -0
  20. package/src/agents.mjs +145 -0
  21. package/src/alerts.mjs +437 -0
  22. package/src/answers.mjs +65 -0
  23. package/src/board.mjs +202 -0
  24. package/src/broker.mjs +369 -0
  25. package/src/commands.mjs +801 -0
  26. package/src/config.mjs +320 -0
  27. package/src/connect.mjs +106 -0
  28. package/src/cool.mjs +160 -0
  29. package/src/diskwarn.mjs +161 -0
  30. package/src/events.mjs +94 -0
  31. package/src/files.mjs +1100 -0
  32. package/src/guard.mjs +583 -0
  33. package/src/history.mjs +247 -0
  34. package/src/hogs.mjs +214 -0
  35. package/src/later.mjs +487 -0
  36. package/src/measure.mjs +262 -0
  37. package/src/nodecheck.mjs +17 -0
  38. package/src/notices.mjs +121 -0
  39. package/src/ondemand.mjs +572 -0
  40. package/src/overlap.mjs +151 -0
  41. package/src/override.mjs +351 -0
  42. package/src/owner.mjs +30 -0
  43. package/src/plain.mjs +467 -0
  44. package/src/platform.mjs +357 -0
  45. package/src/preempt.mjs +438 -0
  46. package/src/primer.mjs +61 -0
  47. package/src/proc.mjs +98 -0
  48. package/src/progress.mjs +158 -0
  49. package/src/qr.mjs +204 -0
  50. package/src/questions.mjs +389 -0
  51. package/src/quota.mjs +81 -0
  52. package/src/reads.mjs +54 -0
  53. package/src/relay.mjs +779 -0
  54. package/src/remote.mjs +584 -0
  55. package/src/reset.mjs +127 -0
  56. package/src/schedule.mjs +995 -0
  57. package/src/scratch.mjs +61 -0
  58. package/src/serve.mjs +736 -0
  59. package/src/service.mjs +221 -0
  60. package/src/shard.mjs +59 -0
  61. package/src/simctl.mjs +42 -0
  62. package/src/simpool.mjs +258 -0
  63. package/src/state.mjs +201 -0
  64. package/src/stats.mjs +328 -0
  65. package/src/style.mjs +44 -0
  66. package/src/talk.mjs +523 -0
  67. package/src/thin.sh +130 -0
  68. package/src/trust.mjs +152 -0
  69. package/src/util.mjs +184 -0
  70. package/src/version.mjs +2 -0
  71. package/src/web.mjs +1117 -0
  72. package/src/worker.mjs +318 -0
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "@dibssoftware/dibs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.178",
4
+ "description": "Coding agents on one machine take turns on the simulator, Xcode builds, test suites, browser runs and deploys",
5
+ "type": "module",
6
+ "bin": {
7
+ "dibs": "bin/dibs.mjs"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "src/",
12
+ "docs/",
13
+ "skills/",
14
+ "CHANGELOG.md",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "engines": {
19
+ "node": ">=22.23.4"
20
+ },
21
+ "os": [
22
+ "darwin",
23
+ "linux",
24
+ "win32"
25
+ ],
26
+ "author": "dibs maintainers <licensing@dibs.cc>",
27
+ "homepage": "https://dibs.cc",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/dibssoftware/dibs.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/dibssoftware/dibs/issues"
34
+ },
35
+ "license": "AGPL-3.0-only",
36
+ "keywords": [
37
+ "simulator",
38
+ "xcode",
39
+ "queue",
40
+ "parallel-agents",
41
+ "claude-code"
42
+ ],
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: dibs
3
+ description: How to take turns with other agents on this machine's simulators, Xcode builds, test suites, browser runs, deploys and shared files using the dibs CLI, post progress, and ask the person questions. Use before running xcodebuild, xcrun simctl, swift test, Playwright, jest, vitest, npm test, node --test or a deploy, before editing files other agents may touch, before asking the person anything, when a command, edit or subagent spawn was blocked or rewritten by dibs guard, or when dibs exits 1, 2, 70, 74, 75, 76 or 77.
4
+ ---
5
+
6
+ # dibs
7
+
8
+ Other agents share this machine. Anything that collides (the one simulator, builds that each want 4 GB, test suites that pin every core, deploys) runs through dibs, which waits for a turn, runs the command and gives the turn back when it exits. Plain reads, edits and small commands need nothing.
9
+
10
+ ## The five you need
11
+
12
+ ```bash
13
+ dibs run test -m "auth suite" -- npm test # wait for a turn, run, give it back
14
+ dibs hold sim --for 20m -m "screenshot pass" # keep it across several tool calls...
15
+ dibs run sim -m "shot 1" -- ./shot.sh # ...still wrap each command: under your hold it starts at once
16
+ dibs release sim # ...and give it back the moment you're done
17
+ dibs hold 'files:src/auth/**' -m "auth refactor" # keep other agents' edits off these paths (quote the glob)
18
+ dibs progress "dry run touched 4,210 rows, 0 errors" --task billing --eta 30m # your running log; the person reads it live
19
+ dibs question "Run the migration on prod now?" --options yes,no --recommend yes -m "dry run clean" \
20
+ --one-way "it rewrites 4,210 rows and has no down-migration" # only a one-way door reaches the person
21
+ ```
22
+
23
+ Resources: `sim` (the shared booted simulator), `sim-own` (a private one), `xcode-build`, `test`, `playwright`, `deploy`, `heavy`, plus any your machine's config adds. `dibs` alone shows the board.
24
+
25
+ Three habits:
26
+
27
+ - Always pass `-m` with a short reason. Everyone waiting sees it.
28
+ - Need two resources? Ask for both at once: `dibs run sim,xcode-build -- ...`. Never hold one while waiting for another.
29
+ - If a tool call with `dibs run` or `dibs hold` times out and moves to the background, don't run it again. dibs refuses the copy (exit 2); wait for the first one's result.
30
+
31
+ ## Running
32
+
33
+ ```bash
34
+ dibs run xcode-build -m "why" -- xcodebuild -scheme App build
35
+ dibs run sim-own -- sh -c 'xcrun simctl install "$SIM" App.app' # $SIM is the private simulator's udid
36
+ dibs run sim-own,xcode-build -- sh -c 'xcodebuild test -scheme App -destination "id=$SIM"'
37
+ dibs run playwright --port WEB -- npx playwright test # a free port in $WEB
38
+ dibs run test --after #42 -- npm run e2e # joins the line once job #42 has ended
39
+ dibs run test -- sh -c 'npm run build && npm test' # a shell line goes in sh -c
40
+ ```
41
+
42
+ - `$SIM` and `--port` variables are set inside the run, so put them in single-quoted `sh -c '...'`.
43
+ - Inside Claude Code, `dibs run` waits as long as it takes. Every run ends with one line on stderr, `dibs: #812 test, waited 2m10s, ran 3m04s, exit 0`; after a compaction, that line is the result.
44
+ - `--est 3m` (a duration like `30s`, `5m`, `1h`) on a job dibs hasn't seen lets short jobs move up. `--mem 6G --cpu 4` the first time you run something heavy dibs hasn't measured; after that it plans at the measured peak, and says so if a job used far more than it asked.
45
+ - Priority: `-p urgent|high|normal|low|idle`. `urgent` (something's broken or a person is waiting now) and `high` (critical path) need `-m`, and everyone sees them. `--by 23:30` for a deadline.
46
+ - A resource name close to a real one (`simulator`, `tests`) is refused with exit 2 and the right name. A new name of your own starts its own queue.
47
+ - A suite that takes minutes: `dibs run test --shards 2 -- npx vitest run` splits it across the group's machines and merges the output and exit codes. vitest and `node --test` suites that usually take over 5 minutes split on their own; `--no-shard` keeps one piece.
48
+
49
+ ## Holding across tool calls
50
+
51
+ `dibs hold <res> --for 20m -m "why"` waits for its turn like `dibs run`, then returns. Keep wrapping each command in `dibs run <res> -- ...`: under your hold it starts without waiting. Run the hold again to extend it; an hour is the most it gets at once. `dibs release <res>` when you're done. `dibs mine` lists what you hold and wait for, and exits 1 when that's nothing, which is the clean result after a release.
52
+
53
+ A script running under `dibs run deploy` that calls `dibs run xcode-build` waits only for xcode-build, ahead of waiters holding nothing.
54
+
55
+ ## Files other agents may edit
56
+
57
+ `dibs hold 'files:src/auth/**' -m "why"` (paths from the git root; `**` crosses folders) turns away other agents' edits and writes there, with who holds it and why. Quote the glob, or zsh expands it first and fails with "no matches found". `dibs release 'files:src/auth/**'` gives it back. If your edit is refused: wait (`dibs when files:<path>`) or message the holder. Don't write the file another way. Paths nobody leased need nothing.
58
+
59
+ ## Progress
60
+
61
+ Post as often as you commit. The person reads every post live on their page, the Mac app and their own Claude; other agents read them with `dibs progress`.
62
+
63
+ ```bash
64
+ dibs progress "Starting billing-migration: script written, dry run next" --task billing-migration --eta 45m
65
+ dibs progress "Dry run touched 4,210 rows, 0 errors. Asking before prod" --task billing-migration --eta 30m
66
+ dibs progress "Blocked: waiting on the person for the prod run (question #3)" --task billing-migration --blocked
67
+ dibs progress "Done: migrated 4,210 rows on prod, checks pass" --task billing-migration --done
68
+ ```
69
+
70
+ - Post when you start (with `--eta`), when you learn something (a test fails, a cause found, a plan changed, with the numbers), when you hand off or wait (`--blocked`), and at the end (`--done`). A task of a minute or two needs just the `--done` post.
71
+ - Keep `--task` the same short name across posts, and move `--eta` (`30m` or `17:30`) when the estimate moves.
72
+ - A task still open past its `--eta` shows as overdue, and (from 0.0.173) dibs tells you once: post a new `--eta`, or `--done`. You hear once too if an open task goes 45 minutes without a post. Ending a task without finishing it: `--done` with a post that says what isn't done.
73
+ - Posts are for the record. Questions go through `dibs question`; a note the person should see now goes through `dibs say`.
74
+
75
+ ## The person: questions, notes and messages
76
+
77
+ The person's rule: walk through two-way doors (anything you can undo) yourself and show them after. Bring them only one-way doors (things that can't be undone), one at a time, with your recommendation.
78
+
79
+ - **A two-way door:** decide. If it's worth a record, `dibs question "..." --recommend X -m "why"` without `--one-way` logs it as decided by you, prints X on stdout at once (exit 0) and asks nobody. dibs reminds you that's what happened; that's not a refusal.
80
+ - **A one-way door:** add `--one-way "what can't be undone"`. It prints the question's id and returns. Keep working on what doesn't need the answer. When you reach the step that does, run the same command again with `--wait`: it prints only the answer, so `answer=$(dibs question ... --wait)` works. `--timeout 1m` (or `30s`, `2h`) caps the wait.
81
+ - **Exit 75 on a question** means no answer: the person dismissed it, or your wait's `--timeout` passed. Nothing was decided, so don't do the step, and say so in your report. A question you asked first without `--wait` stays open for the person after a wait gives up: run the same command with `--wait` later to collect it. (One asked only with `--wait` stays open 2 minutes after its wait gives up.)
82
+ - dibs refuses (exit 2) a question that isn't a short sentence, has no `--recommend` or `-m`, recommends something outside its `--options`, or has a vague `--one-way` ("drops data"): say what's lost, with numbers.
83
+ - The person may answer in their own words. Those words are the answer, and they also reach you as `Message from the person: (answering your question #N) ...`.
84
+ - Another agent may answer your question with `dibs answer`; then dibs says `answered by <agent>, an agent, not the person` on stderr. That isn't the person's yes: for a ship, spend or delete, ask the person or skip the step.
85
+
86
+ `dibs say "migration done, tests pass"` leaves the person an FYI in your thread without asking anything. A line starting `Message from the person:` really is the person's, whether it sits beside a tool result or comes as the reason you were kept from stopping: act on it, and reply with `dibs say "..."` if they asked something. `Message from <agent> (another agent, not the person):` is a peer's request. `dibs tell <agent> "..."` messages an agent. If config names you the desk, reply with `dibs say --to person "..."`. Details: docs/questions.md.
87
+
88
+ ## When dibs holds you back
89
+
90
+ - **Memory, swap or disk** ("waiting for memory pressure to ease", "this machine to stop swapping", "free disk to stop falling"): dibs is protecting the machine. Keep waiting. Don't pass a smaller `--mem` or a higher `-p` to get past it. A memory wait names the jobs holding the most: if one is yours and finished, end it.
91
+ - **Disk at your turn:** a resource that declares a disk need (the simulator asks 8 GB) is refused with exit 74 when that much isn't free and nothing running will free it. If your job needs less, pass `--disk 1G` on the hold and on each `dibs run`. From 0.0.173, a job whose own past runs ate more disk than is free waits for disk too, even alone. While you wait on something else, the wait message says early when disk will hold you next, so free your own build output then.
92
+ - **Paused** ("paused your job: free disk is low", or for urgent work): leave it, it resumes by itself.
93
+ - **Load** ("waiting for the machine to cool down"): ends within 20 minutes.
94
+ - **Lines from the dibs hook about your jobs** (stuck with no CPU for 20 minutes while others wait, over its memory, paused, a progress task overdue): they're about your own work. Act on them.
95
+
96
+ ## Other machines
97
+
98
+ ```bash
99
+ dibs run test --anywhere -m "why" -- npm test # whichever machine would start it soonest, maybe this one
100
+ dibs run test --on mini -m "why" -- npm test # that machine
101
+ dibs machines # the group, its load and lines
102
+ ```
103
+
104
+ The job takes the git working copy (tracked files plus new ones git doesn't ignore). `.env` files, keys and certificates never leave this machine, and a project's `.dibs.json` `stayOn` limits where its code may go. `--bring <path>` copies a file or folder back when the job ends.
105
+
106
+ On a machine that isn't in a group, `--anywhere` runs here and says so, `--on` exits 2 with the setup line, and `dibs machines` says it isn't in a group (exit 0). `dibs leave` takes a machine out of its group; only run it when the person asks. To start a group, one machine is the coordinator: `dibs service install serve worker` there (or `dibs serve` in a terminal). To add a machine: on the coordinator, `dibs invite <name>` prints the join line to run on the new machine, then `dibs service install worker` there keeps it taking jobs. From 0.0.173, `dibs pair --machine` on the coordinator prints a one-time code instead, and `dibs join <code>` on the new machine finds the coordinator (same network, Tailscale, or `--at <address>`). Details: docs/machines.md.
107
+
108
+ ## Run it later
109
+
110
+ ```bash
111
+ dibs later sim --at 02:00 -m "snapshot suite" -- ./snapshots.sh # prints its id (l3) and returns
112
+ dibs later test --in 3h -- npm test
113
+ dibs later test --after-ok web-app:deploy -m "smoke tests" -- npm run smoke # after that agent's deploy, only if it passed
114
+ dibs later list # state, exit code; output in ~/.dibs/later/<id>.log
115
+ ```
116
+
117
+ When it's due it runs as `dibs run --wait` in this folder, with PATH, HOME and LANG (more with `--env NAME`). At most 7 days out. Details: docs/later.md.
118
+
119
+ ## Overriding jobs and settings
120
+
121
+ You may do anything the person can, on any job: boost, lower, pause, resume, stop, cap. Use the `#` id from `dibs --detail`. On a job that isn't yours, add `--owner <its session>` as the board names it left of the `#`; without it nothing changes (exit 2) and dibs prints the command to rerun.
122
+
123
+ ```bash
124
+ dibs boost 4221 urgent -m "person waiting on the fix" # high or urgent needs -m, which everyone sees
125
+ dibs pause 4219 # dibs resume 4219 continues it
126
+ dibs stop 4219 # end it and kill its processes
127
+ dibs cap pushy low # that agent's work waits and runs at low or below until dibs cap pushy off
128
+ dibs yield web-app # let another agent go first
129
+ ```
130
+
131
+ The same goes for `answer`, `hours`, `pace`, `tell`, `invite`, `pair --machine`, `service install` and `guard install`. dibs records who did each, on the board and in `dibs history`, so act the way you'd defend to the person. Raise a job to high or urgent only when a person is waiting on it now or something is broken. Prefer a message and `dibs yield` over stopping someone else's work. If your own job was **stopped by** someone, it was ended on purpose: find out why (`dibs history`, or ask them) before running it again.
132
+
133
+ ## The person's page and MCP
134
+
135
+ If the person asks you to connect something to dibs:
136
+
137
+ - From a phone or any browser: `dibs pair --remote` prints a one-time link to https://app.dibs.cc, end-to-end encrypted through the relay; it can only look unless paired with `--allow-actions`.
138
+ - The page and MCP server: `dibs web` (or `dibs service install web`) at `http://127.0.0.1:7421`, MCP at `/mcp`. Another machine on Tailscale reaches it with `dibs web --bind <tailscale address>`. A claude.ai connector on another account uses `https://mcp.dibs.cc/mcp` after the person runs `dibs relay mcp on`.
139
+ - Sign-in is a one-time code from `dibs pair` (10 minutes, one use), which gives read-only tools. From 0.0.173, a code from `dibs pair --allow-actions` adds tools that act (post progress, answer questions, message agents, hold, boost, pause, stop); the client acts as an agent named `mcp-<name>`, never as the person. A code from `dibs pair --allow-commands` also lets a client signed in at this Mac's own address queue commands, never through mcp.dibs.cc.
140
+ - `dibs pair --list` shows what's signed in and what each may do; `dibs pair --revoke <id|all>` signs it out. Details: README.md and docs/relay.md.
141
+
142
+ ## Exit codes
143
+
144
+ | code | meaning | what to do |
145
+ |---|---|---|
146
+ | the command's own | it ran | read it as usual |
147
+ | 75 | gave up waiting: your command never started and didn't fail (outside Claude Code, after `--max-wait`, 8m by default), or a question got no answer | rerun the same command within 2 minutes to keep your place, or add `--wait`. On a question: nothing was decided, skip that step |
148
+ | 74 | not enough free disk | the message says how much it needed. Free your own build output, or tell the person; if this run needs less, pass a smaller `--disk` on that `dibs run` (a hold's `--disk` doesn't cover the runs under it). Never delete in another session's `/private/tmp/claude-*` folder |
149
+ | 76 | lost the coordinator or the other machine before the job started | nothing ran there: send it again |
150
+ | 77 | lost the other machine after the job started | it may have run, or still be running: check before running it again, above all a deploy |
151
+ | 70 | dibs itself crashed | a bug in dibs, not your command: `dibs ask "..."` |
152
+ | 127 | the command didn't start | check the command and its path |
153
+ | 2 | bad usage: a near-miss resource name, a high or urgent boost without `-m`, a job bigger than this machine (ask for what it names, or `--anywhere`), `--on` or `dibs machines` outside a group, or a run you already have going | read the message: it names the fix |
154
+ | 1 | nothing matched (`mine` with nothing held, `release` with nothing to give back) | usually the clean result |
155
+
156
+ ## The guard
157
+
158
+ When dibs's hook sees a heavy command outside `dibs run`, it rewrites it into the `dibs run ...` line (in bypass-permissions sessions) or blocks it and prints that line. Run the line. If the command really builds, boots, tests and deploys nothing, put `DIBS_GUARD=off` in front of it. If the person set a subagent limit (config `agents.slots`), a denied spawn started nothing and isn't a failure: wait for one of yours to report back, then spawn again.
159
+
160
+ ## Looking without joining the line
161
+
162
+ `dibs` (the board, whose `Limits` line has memory, disk and swap), `dibs when sim`, `dibs who sim`, `dibs why`, `dibs mine`, `dibs history` (the last 7 days). Every command and flag: `dibs help all`. Something wrong with dibs, or a question about it: `dibs ask "..."`.