@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/reference.md
CHANGED
|
@@ -9,29 +9,37 @@ The install does this for you: it writes `dibs.md` beside dibs and a note pointi
|
|
|
9
9
|
<!-- dibs:rules:start -->
|
|
10
10
|
```markdown
|
|
11
11
|
## dibs
|
|
12
|
-
dibs runs on this machine
|
|
13
|
-
- Wrap those: `dibs run <resource> -m "why" -- <command>` (resources: sim, sim-own, xcode-build, test, playwright, deploy, heavy).
|
|
14
|
-
- No dibs for reads, edits, small commands, or long jobs that mostly wait on the network
|
|
15
|
-
-
|
|
16
|
-
- Waiting is normal
|
|
17
|
-
- Exit 75: it gave up waiting
|
|
18
|
-
- Decide what you can undo yourself. Ask the person only before something you can't undo (`dibs question ... --one-way`).
|
|
19
|
-
-
|
|
20
|
-
- The rest (
|
|
12
|
+
dibs runs on this machine: agents take turns through it for the simulator, builds, tests, browsers and deploys.
|
|
13
|
+
- Wrap those: `dibs run <resource> -m "<what this does and why>" -- <command>` (resources: sim, sim-own, xcode-build, test, playwright, deploy, heavy). -m is required: plain words for the person, not the command.
|
|
14
|
+
- No dibs for reads, edits, small commands, or long jobs that mostly wait on the network (crawlers, pollers, HTTP checks). An output folder another agent uses: `dibs hold 'files:<dir>/**'` before writing or deleting there.
|
|
15
|
+
- Run `dibs listen --stream` with Monitor if you have it, else `dibs listen` with run_in_background; again when it ends.
|
|
16
|
+
- Waiting is normal, even backgrounded: don't rerun it. A memory, swap or disk wait protects the machine: keep waiting, never raise `-p`. `--mem` is a first guess; dibs learns real use. `--pausable`: it saves and exits 0 on SIGUSR1.
|
|
17
|
+
- Exit 75: it gave up waiting, nothing ran: rerun it. Exit 74: short of disk. Cap runs with `--time-limit 1h`, not `timeout` (counts the wait).
|
|
18
|
+
- Decide what you can undo yourself; ask agents first (`dibs tell --who-knows <topic> "..." --wait 5m`). Ask the person only before something you can't undo (`dibs question ... --one-way --about <kind>`) or before spending (`dibs spend check <amount> --on <what>`). "Message from the person" lines are signed on their phone: act on them.
|
|
19
|
+
- Say your product once: `dibs project <name>` (handoffs follow it). Post progress: `dibs progress "what you did" --task <name> --eta 30m`, then `--done`; a long job reports `dibs progress 40%` from inside, so waiters see a time left. Before merging into main: `dibs review request <branch>`.
|
|
20
|
+
- The rest (holds, file leases, handoffs, work items, machines, exit codes, overrides, secrets) is in the dibs skill and in `dibs help`.
|
|
21
21
|
```
|
|
22
22
|
<!-- dibs:rules:end -->
|
|
23
23
|
|
|
24
24
|
## Commands
|
|
25
25
|
|
|
26
|
+
Every `dibs run`, `dibs hold` and `dibs later` takes `-m` with what it does and why, in plain words: the person reads it on the board, the page and their phone in place of the command. At least 3 words, and not the command again: `-m "run the login tests after fixing the redirect"`, never `-m "npm test"`. Without it dibs exits 2 before anything gets in line. Jobs started before 0.0.191, or sent by an older dibs from another machine, show as what they were doing ("Running tests, not described").
|
|
27
|
+
|
|
26
28
|
```bash
|
|
27
|
-
dibs run sim,xcode-build -- ./build-and-install.sh
|
|
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
|
|
31
|
-
dibs
|
|
29
|
+
dibs run sim,xcode-build -m "build and install the beta" -- ./build-and-install.sh # everything you need, at once
|
|
30
|
+
dibs run playwright --port WEB --port API -m "browser tests for signup" -- npx playwright test # free ports in $WEB and $API
|
|
31
|
+
dibs run test -p high -m "release blocker: the checkout tests" --by 23:30 -- npm test
|
|
32
|
+
dibs run test --after #42 -m "end-to-end tests on the new API" -- npm run e2e # joins the line once your job #42 has ended
|
|
33
|
+
dibs run test --after-ok "drift test" -m "the flop test, only if drift passed" -- npm run flop # by number, agent or -m words; failed or never ran: exit 75, nothing ran
|
|
34
|
+
dibs hold sim --for 20m -m "take the App Store screenshots" # across several tool calls; again to extend
|
|
32
35
|
dibs release sim
|
|
33
|
-
dibs hold 'files:src/auth/**' -m "
|
|
34
|
-
dibs run quota:asc --cost 3 -- ./upload.sh
|
|
36
|
+
dibs hold 'files:src/auth/**' -m "rework how sessions refresh" # other agents' edits there are turned away
|
|
37
|
+
dibs run quota:asc --cost 3 -m "upload the release notes" -- ./upload.sh # share an API's rate limit between scripts
|
|
38
|
+
dibs run env:staging -m "deploy the web app to staging" -- ./deploy.sh staging # one holder per project; hear what the last one left there first
|
|
39
|
+
dibs env staging left "deployed web@1a2b3c" # say what you left there (during your turn, or just after)
|
|
40
|
+
dibs env [staging] [--all] [--json] # who has each environment now, and what each turn left
|
|
41
|
+
dibs jobs [--json] # every job here, running, paused and waiting, and those that ended lately with their exit codes
|
|
42
|
+
dibs help json # the --json layout (schema 1) every command that prints state follows: docs/json.md
|
|
35
43
|
dibs when sim # when you'd get it, without joining the line
|
|
36
44
|
dibs who sim # who holds it, until when, who's next
|
|
37
45
|
dibs why # where you are, when you start, what you're waiting for (--detail: the math)
|
|
@@ -42,25 +50,72 @@ dibs sims # the private simulator pool
|
|
|
42
50
|
dibs setup scratch # the admin commands for a capped scratch volume for build output (macOS)
|
|
43
51
|
dibs changes # what changed in recent versions
|
|
44
52
|
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
|
|
53
|
+
dibs question "Sign in to GitHub?" --needs-you "sign in to GitHub in the bison tab" --options done,cant --recommend done -m "the push needs a login" --wait # what only the person can do also reaches them
|
|
45
54
|
dibs questions # what agents are asking you, with what they recommend; dibs answer <id> <option, or your own words>
|
|
46
55
|
dibs hours 09:00-23:00 # outside your hours, questions below urgent wait for the morning
|
|
56
|
+
dibs decide "use Postgres 16 for staging" -m "matches production" # kept for this project; dibs question answers from it instead of asking again
|
|
57
|
+
dibs decisions --project --about "postgres" # what's decided here, closest first; dibs decisions revoke <id> takes one back
|
|
58
|
+
dibs rules add --about testflight --answer yes # a standing rule: every question asked --about testflight gets yes at once
|
|
59
|
+
dibs rules # the rules, who set each and what each answered; dibs rules remove r1, dibs rules test "..." --about <kind>
|
|
60
|
+
dibs doors on # opt-in, off by default: the guard turns away agents' commands that can't be undone until you say yes (docs/guard.md)
|
|
61
|
+
dibs attention 6 # your phone buzzes at most 6 times an hour (the default); past it only urgent questions do
|
|
62
|
+
dibs people add sam --user sam # two or more people: questions go to each agent's owner, messages name who sent them (docs/questions.md)
|
|
47
63
|
dibs threads # one thread per agent: its notes and questions, your messages; dibs threads read <agent>
|
|
48
64
|
dibs tell web-app "use the staging database" # reaches the agent on its next tool call, or as it finishes its turn
|
|
49
65
|
dibs tell desk "why is my build waiting?" # the agent config.json names as "desk" answers you with dibs say --to person
|
|
66
|
+
dibs tell --all "no deploys until 15:00" # every agent running here: Claude Code sessions, their recent subagents, listeners
|
|
67
|
+
dibs tell api "which port is staging on?" --wait 5m # wait for its answer (its dibs say --to you) and print only that; exit 75: none in time
|
|
68
|
+
dibs who knows src/payments # which agents edited, read, held, ran or posted about it lately, best first, and why; also words: dibs who knows "iOS build"
|
|
69
|
+
dibs tell --who-knows src/payments "why do refunds round down?" --wait 5m # ask the best of them still running, no name needed; exit 1: nobody fits, nothing sent
|
|
70
|
+
dibs say "the latency chart" --file chart.png --report findings.md --link ./screenshots # files (copied, 25 MB each), a markdown report, a live folder
|
|
71
|
+
dibs say "deploy blocked" --kind needs-you --body notes.txt # a badge (fyi, doing, done, needs-you) and a one-line summary over the details
|
|
72
|
+
dibs poll "which name?" --option dibs --option queue [--multi] [--to <agent>] # each vote reaches the asker as a message; dibs poll results p1
|
|
73
|
+
dibs pending # everything waiting on you: open questions, polls, needs-you notes; dibs pending clear <id>; agents: dibs pending --mine
|
|
74
|
+
dibs handoff "fix the flaky login test" --to api -m "fails 1 in 5 on CI" # hand work over; no --to: whichever agent takes it first
|
|
75
|
+
dibs handoff take w3 # then: dibs handoff done w3 "what you did", or back w3 "why"; the sender hears each. dibs handoff list
|
|
76
|
+
dibs handoff give w7 web-app # an open handoff is that agent's to take; it hears it now. A session that ends mid-task leaves one (below)
|
|
77
|
+
dibs work # shared work: who has what, what's blocked and why, what's done and its proof (progress tasks too)
|
|
78
|
+
dibs work add "fix the login test" --goal "passes 20 runs" --after w2 --files 'src/auth/**' # any agent can claim it (--to <agent>: that one)
|
|
79
|
+
dibs work next # claim the oldest item you can take (exit 1: none); dibs work claim w3 for that one
|
|
80
|
+
dibs work done w3 "what you did" # closes it with proof dibs checked: your last passing dibs run since the claim, a commit made since (or --commit <sha>)
|
|
81
|
+
dibs review request fix-login -m "does the retry loop ever stop?" # another agent running here reviews it: one that knows the area, never your session
|
|
82
|
+
dibs review approve r3 "bounded by the caller" # or: dibs review changes r3 "what to change" (notes needed); its author hears it. dibs review list
|
|
83
|
+
dibs review check fix-login # exit 0 if that commit has an approving review, 1 if not
|
|
84
|
+
dibs halt --for 7m -m "restarting the mini" # no new dibs job starts until then; running ones go on; every agent is told. dibs halt off
|
|
50
85
|
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
86
|
dibs alerts dismiss <id> # close one for a day; it comes back if its cause is still there
|
|
87
|
+
dibs doctor # every state file parses and no lease or waiter is left from a process that ended; puts right what it can, on the record (--check only looks, exit 1 if something needs it)
|
|
52
88
|
dibs listen # an agent waits for a message (run_in_background), as long as its session lives
|
|
89
|
+
dibs listen --stream # never exits for a message: one line each, for Claude Code's Monitor tool
|
|
53
90
|
dibs history # the last 7 days: busy time, waits and who waited, by resource, agent and hour
|
|
91
|
+
dibs recap # since your last look: tasks done and stuck, agents that stopped mid-task, deadlines missed, decisions made without you, reviews agents gave, notes, spend, and what dibs saw agents ship
|
|
92
|
+
dibs trail --since 2h # what agents did, as dibs saw it (not their words): commits, pushes, merges, tags, releases, pull requests, App Store Connect uploads, test suites, deploys
|
|
93
|
+
dibs spend check 50 --on apple-ads -m "holiday push" # before committing money: exit 0 within every cap; past one the person decides (exit 78: they said no)
|
|
94
|
+
dibs spend 3.00 --on apple-ads -m "keyword bids" # record it as you commit it; the project is the repo's unless --project
|
|
95
|
+
dibs spend hold 210 --on apple-ads -m "monthly budget" # about to commit it: counts against caps until dibs spend close <id>; pay against it with --against <id>
|
|
96
|
+
dibs spend cap 210 --on apple-ads --per month # a cap per day or month on all spend, a category (--on), a project (--project) or both; off lifts it
|
|
97
|
+
dibs spend # this month: caps, spend by project, agent and category, open holds, the latest entries (--json: amounts in cents)
|
|
98
|
+
dibs disk # what fills the disk: the biggest folders, dibs's or not, who made each, whether it can go and how; then each session's share
|
|
99
|
+
dibs disk add <dir> # a worktree or build folder you made: dibs deletes it 30 minutes after your session ends (dibs disk keep <dir> undoes)
|
|
100
|
+
dibs agents # each agent in plain words: what it's for, what it needs from you, what blocks it, what it's doing, its plan, what its runs meant (--json: the page's /api/agents)
|
|
54
101
|
dibs stats # waits against run times, today and the last 7 days: the share of jobs that waited longer than they ran
|
|
55
102
|
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
103
|
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
|
|
104
|
+
dibs later test --after web-app:deploy -m "smoke tests on the new deploy" -- npm run smoke # when that agent's deploy ends (--after-ok: only if it passed)
|
|
58
105
|
dibs later list # scheduled, waiting, running, and how the finished ones ended; dibs later cancel <id>
|
|
59
106
|
```
|
|
60
107
|
|
|
61
|
-
`dibs listen`
|
|
108
|
+
`dibs listen` wakes an agent only for something it should hear: a message, an answer, a vote, work handed to it, or a notice it should act on (a job stuck while others wait, one paused under the disk floor). Progress reminders, disk notes above the floor and other notices that ask nothing urgent come with the agent's next tool call instead. Once something wakes it, it gathers for a second and a half, so a burst arrives as one wake, and it ends its output with the line to start it again. `dibs listen --stream` never exits for a message: it prints each as one line and keeps listening, for a harness that turns output lines into notifications (Claude Code's Monitor tool). When dibs on this machine is updated, the listener carries on under the new code in the same process (the agent's next dibs command says what changed). A newer release on dibs.cc, which it learns by asking at most every 6 hours per machine (never from a git checkout), is said with the next thing that wakes it. `"updateCheck": false` in `~/.dibs/config.json` turns that ask off. A second `dibs listen` for the same agent waits behind the first instead of ending it.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
dibs project shop-web # an agent says which product it works on; handoffs and items for anyone go by it
|
|
112
|
+
dibs work pickup on # offer open items to agents listening with nothing on, within their project (off by default)
|
|
113
|
+
dibs work add "fix login redirect" --no-pickup # never offered; --project <name> for another project's backlog
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Work outlives its session. Nothing tells dibs when a Claude Code session ends (a full context, a crash, a closed window), so it notices on a later look (the throttle service every minute, the relay connector, the page, `dibs listen`, `dibs handoff list`): a session with no live process whose transcript has been still for two minutes. If its last progress post wasn't `--done`, or it had taken a handoff or work item, dibs makes a handoff of its work, from that agent, holding what dibs knows: the folder and branch, uncommitted files and unpushed commits (git read only, with `--no-optional-locks`), the open task and its last posts, other open tasks, questions it asked that nobody answered, files it held leases on, what the trail saw it do, its session's title and what it was asked. An agent listening in the same repo (any worktree or clone of it) is offered it first, one with no open task of its own before a busy one; it hears it as a message from dibs, never the person's words. When nobody's listening there, or the one offered gives it back or leaves it for 10 minutes, the page shows it under Handoffs and your phone says `web-app stopped mid-task: login page. Pick it up?`. Give it to an agent (`dibs handoff give h7 web-app`, or the page) or drop it (`dibs handoff cancel h7`). A session that runs again takes its work back: the open handoff of it is dropped. Only work posted after dibs first looked on this machine counts, so turning it on doesn't dig up last week's sessions.
|
|
62
117
|
|
|
63
|
-
Anyone can override any job, the person or an agent
|
|
118
|
+
Anyone can override any job, the person or an agent, with no `--owner` (older callers may still pass it; it's ignored). Every answer starts with whose job it was: `boosting #10167: alex-c8 deploy 'shop-api first deploy'`. `dibs boost <id> high -m "why"` (the `#` beside every job on the board), `dibs pause <id>` and `dibs resume <id>`, and `dibs stop`: bare, it lists your running and waiting jobs with their numbers; `dibs stop <id> [<id> ...]` ends any job, anyone's (its agent is told who stopped it, and the history keeps it); `dibs stop <words>` ends your one job whose `-m` or command has those words (a session's main agent: its subagents' too; words never pick another agent's job); `dibs stop mine` ends all of yours. A number that already ended says how and when. 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`, `halt`, `handoff`, `threads read`, `review`, `join`, `invite`, `pair --machine`, `kick`, `limit`, `service install`/`remove`, `guard install`/`remove` and `serve --force`: nothing is the person's alone.
|
|
64
119
|
|
|
65
120
|
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
121
|
|
|
@@ -83,26 +138,58 @@ Open http://127.0.0.1:7421 and type the code. The rail on the left switches betw
|
|
|
83
138
|
|
|
84
139
|
- **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
140
|
- **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.
|
|
141
|
+
- **Messages**: one thread per agent. What you send reaches the agent with its next tool call. Images an agent sent show in the thread; PDFs, CSVs (as a table), reports (rendered markdown) and live folders open in a viewer, and polls take a tap.
|
|
142
|
+
- **Handoffs** (on Now): work agents handed each other, and work a session left unfinished when it ended, with what dibs knows of it. Give it to an agent or drop it.
|
|
87
143
|
- **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
144
|
- **Scheduled**: `dibs later` runs coming up and ended this week; cancel one.
|
|
145
|
+
- **Work**: every work item and handoff in flight: who has it, what's blocked and why, what nobody has claimed, and what closed lately as `done, proved by: suite passed 12:04, commit 1a2b3c4` or `done, no proof` (in red). Proof is only what dibs checked itself: the agent's last passing `dibs run` since it claimed the item, and a commit git has. A URL or build number the agent names is shown as its word. `/api/work` has every item with its log and proof.
|
|
146
|
+
- **While you were away**: back after 15 minutes or more, the page starts with what agents finished, what they're stuck on, what missed a deadline and what they decided without you. `dibs recap` says the same in a terminal, and your phone gets a notification when an agent finishes a task or says it's stuck, or when dibs sees one merge into main, tag a version, publish a release or upload a build.
|
|
147
|
+
- **Seen by dibs**: each agent's commits, merges, tags, releases, pull requests, uploads to App Store Connect, test suites and deploys, kept by dibs whether or not the agent posts progress, on the Progress view and in the agent's thread. The guard hook notes each attempt before it runs; dibs shows it only once the repo's reflog or the agent's transcript says it happened, and suites and deploys come from `dibs run`'s own record (with the `-m` you gave). It's always labelled as dibs's record, never as the agent's words. `"guard": { "trail": false }` in `~/.dibs/config.json` turns the noting off.
|
|
89
148
|
- **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.
|
|
149
|
+
- **Settings**: the speed (`dibs pace`), your hours, the phone's notification cap (`dibs attention`), your standing rules (to see and remove), and the Claude Code hook.
|
|
91
150
|
|
|
92
151
|
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
152
|
|
|
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 `
|
|
153
|
+
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`, `messages` and `work`. 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
154
|
|
|
96
155
|
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
156
|
|
|
157
|
+
### What a message carries
|
|
158
|
+
|
|
159
|
+
For anything that reads `dibs threads --json`, `/api/threads` or `dibs listen --json`. Every field here is optional; a client that ignores them still shows `text`, which holds the whole message.
|
|
160
|
+
|
|
161
|
+
- `attachments: [{id, kind, name, size, mime, isDir?, path?}]`. `kind` is `image`, `pdf`, `csv`, `report` (markdown), `file` or `link`. A file is copied when sent (up to 25 MB, 10 a message, 500 MB kept in all, each for a week) and read with GET `/api/file/<id>`. A `link` is a live file or folder on the Mac (`isDir`, and `path`, where it is there), read with GET `/api/link/<id>[?path=<relative>]`: a folder answers `{id, name, root, path, isDir: true, entries: [{name, path, isDir, size, mtime, kind, mime}], more?}`. Reads under a link never leave it, and key-looking files (the rule that keeps them off other machines) are never sent, listed or served. In `dibs listen --json` each attachment also has `path`, the file on this Mac an agent reads.
|
|
162
|
+
- `poll: {id, question, options, multi, votes: {option: [who]}, closed}`, on a line of `kind: "poll"` in the asker's thread (a poll to the person) or on a message to another agent. `who` is `person` or an agent's name. Vote with POST `/api/vote {poll, options}` (`options` a list, or one choice a line); the asker gets a message for each vote, marked `vote: <poll id>`.
|
|
163
|
+
- `badge`: `fyi`, `doing`, `done` or `needs-you` (`dibs say --kind`). `summary` and `body`: a one-line summary and the details under it (`--body`, or the lines after the first); `text` is both.
|
|
164
|
+
- `answers: {questionId, option?}` on the message that carries the person's answer to a question.
|
|
165
|
+
- `seen`, `seenAt` on an agent's lines: whether the person has opened the thread since (the page, the phone, `dibs threads read`), and when.
|
|
166
|
+
- GET `/api/pending` answers `{pending: [...], count}`, oldest first: `{type: "question", id: "q12", questionId, who, at, text, options, recommend, why, prio, oneWay, cantUndo, needsYou, waiting}`, `{type: "poll", id: "p3", who, at, text, poll}`, `{type: "note", id: "m40", who, at, text, body?, seen, seenAt}`. POST `/api/pending/clear {id}` dismisses the question, closes the poll or clears the note.
|
|
167
|
+
|
|
98
168
|
## Mac app
|
|
99
169
|
|
|
100
170
|
`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
171
|
|
|
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.
|
|
172
|
+
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. On macOS background priority (`taskpolicy -b`, PRIO_DARWIN_BG) throttles the job's disk and any network connection it opens, not only its CPU, so run uploads, downloads and deploys at `-p normal`. `--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.
|
|
173
|
+
|
|
174
|
+
A long job can say how far along it is: `dibs progress 40%` or `dibs progress 1200/9000 "flops solved"` from inside it (dibs run sets `DIBS_LEASE` in the job), or `dibs progress 40% --job <id>` from outside. Without that, dibs reads progress lines in the job's output when it goes to a file, as Claude Code's tool calls and background tasks do (`[ 40%]`, `[12/300]`, tqdm bars, `Progress: 40%`), from the file, without piping the output through dibs. The board, `dibs why`, the wait lines, the page and the phone then say "40% done, about 2 hr left", from the job's own rate. A job whose rate falls under a quarter of its earlier rate (judged over at least 30 minutes), or that runs three times as long as the same command's usual (the middle of at least 3 finished runs, and 30 minutes past it), is an alert that names its agent, what it does and who waits behind it, and its agent hears once. dibs never stops it.
|
|
175
|
+
|
|
176
|
+
`--pausable` on `dibs run` says the job is safe to pause, or to stop at its next checkpoint. dibs never stops a job without it (low and idle work on a pausable resource still pauses for urgent work, as before). With it, a waiter that's urgent or high may make it yield if it's lower priority, and a waiter that has waited 20 minutes may make it yield if it's the same priority or lower. For a full slot, dibs pauses it (SIGSTOP) and continues it when that job ends. For memory, pausing frees nothing, so dibs sends its process group SIGUSR1 (`$DIBS_CHECKPOINT_SIGNAL`; `$DIBS_PAUSABLE` is 1): save your progress and exit 0. Its `dibs run` then puts it back in line right behind the job it made room for and runs the same command again, which should pick up from the checkpoint. A job that hasn't exited 2 minutes after the signal is ended and put back in line anyway. Every yield is in `dibs history` (who stepped aside, for whom, why, after how long), in `dibs why` for both agents, and on the board while it's under way.
|
|
177
|
+
|
|
178
|
+
The disk floor is `minDisk` (5 GB), and while the machine swaps it's `minDisk` plus `swapRoom` (8 GB), so swap has room to grow. Every message that names the floor names both.
|
|
103
179
|
|
|
104
180
|
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
181
|
|
|
182
|
+
## Secrets
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
dibs secret set ASC_KEY # type it (not shown), pipe it in, or --file path; never on the command line
|
|
186
|
+
dibs secret run ASC_KEY -- ./upload.sh # $ASC_KEY set for this one command; its output comes back with the value blanked
|
|
187
|
+
dibs secret rules ASC_KEY --projects poker --ask each # who may use it and when you're asked (default: once per session)
|
|
188
|
+
dibs secret list | log | revoke ASC_KEY
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Only you approve a use and loosen the rules; agents may store, tighten and revoke. The guard turns away commands and edits that hold a stored value. Threat model and details: [secrets.md](secrets.md).
|
|
192
|
+
|
|
106
193
|
## Exit codes
|
|
107
194
|
|
|
108
195
|
Agents branch on these, so they don't change.
|
|
@@ -110,18 +197,22 @@ Agents branch on these, so they don't change.
|
|
|
110
197
|
| code | meaning |
|
|
111
198
|
|---|---|
|
|
112
199
|
| 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 |
|
|
200
|
+
| 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. With `--after` or `--after-ok`: the job it waited on never ran, or (`--after-ok`) failed, so nothing ran; see to that job first. For `dibs question --wait`: no answer (timed out or dismissed), nothing was decided. For `dibs tell <agent> --wait`: no answer in time (the message stays with that agent, and a later answer arrives like any message), or that agent's session has ended |
|
|
114
201
|
| 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
202
|
| 76 | lost the coordinator or the other machine before a remote job started. Nothing ran there: sending it again is safe |
|
|
116
203
|
| 77 | lost the other machine after a remote job started. It may have run, or may still be running: check before running it again |
|
|
204
|
+
| 78 | refused, nothing ran. `dibs secret run`: a secret's rule, the person said no, or an agent answered instead of the person. `dibs spend check`: the amount goes over a spend cap and the person answered anything but yes (only the person can answer it: an agent's `dibs answer` is turned away); don't spend it, and the answer is on stdout. A one-way environment (`env:prod`): the person said no; don't run it again unless they say otherwise. `dibs answer` on a question only the person (or the one `--for` names) may answer: nothing was answered, it stays open for them |
|
|
205
|
+
| 124 | the command ran past its `--time-limit` and dibs stopped it (SIGTERM, then SIGKILL 5 s later). The limit counts from when the command started, never the wait in line or time dibs kept it paused |
|
|
117
206
|
| 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) |
|
|
207
|
+
| 2 | bad usage, a `dibs run`, `hold` or `later` without `-m` in plain words (at least 3, not the command again; it prints your command back with `-m "..."` to fill in), 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 environment the project doesn't name in its `.dibs.json` (`env:stagin`: it says the closest), 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
208
|
| 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 |
|
|
209
|
+
| 1 | nothing matched: `mine` with nothing held (the clean result after a release), `release` with nothing to give back, `tell` or `handoff --to` an agent dibs doesn't know, `tell --all` with no agent running, `who knows` or `tell --who-knows` with no agent that fits (nothing sent), a handoff or work item already taken or closed, `dibs work next` with nothing free, `dibs work done --commit` naming a commit git doesn't have, `halt off` with no halt on, `review check` on a commit nobody approved, `review approve` on your own request |
|
|
121
210
|
| 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
211
|
|
|
123
212
|
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
213
|
|
|
214
|
+
To cap how long the command itself may run, use `dibs run <res> --time-limit 1h -m "..." -- <command>`: the clock starts when the command does (exit 124 when it runs out). Never put `timeout` around dibs: its clock counts the wait in line too, and a job that waits its whole limit is killed before it starts. dibs warns when it sees one. A wait ended by a signal (a `timeout`, a tool's limit, Ctrl-C) says so: the command never ran, how long it waited, what was ahead, and the line to rerun; its place is kept 2 minutes.
|
|
215
|
+
|
|
125
216
|
## Resources
|
|
126
217
|
|
|
127
218
|
| name | slots | memory | cores | free disk | pausable |
|
|
@@ -132,20 +223,23 @@ Inside Claude Code, `dibs run` waits as long as it takes: when the tool call hit
|
|
|
132
223
|
| playwright | 2 | 3G | 2 | 3G | yes |
|
|
133
224
|
| test | 3 | 2G | 3 | | yes |
|
|
134
225
|
| 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 |
|
|
226
|
+
| heavy | 1 | 4G | 4 | 3G | yes |
|
|
136
227
|
| any other name | 1 | 1G | 1 | | no |
|
|
137
228
|
| `files:<path or glob>` | one holder per path | 0 | 0 | | no |
|
|
138
229
|
| `quota:<name>` | a token bucket from config | 0 | 0 | | no |
|
|
230
|
+
| `env:<name>`, `account:<name>` | 1 per project, any number of projects | 0 | 0 | | no |
|
|
139
231
|
|
|
140
232
|
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
233
|
|
|
142
|
-
Running jobs share a budget of
|
|
234
|
+
Running jobs share a budget of 70% of the machine's memory (11 GB on 16 GB) and all its 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, and so does memory: a run measured a few minutes counts at what it uses plus a margin (a fifth, between 0.25 and 1 GB), not its ask. dibs measures what each job really uses, failed and killed runs included, and once a command has run in a repo, its next runs there are planned at what they peaked at plus that margin, more or less than `--mem` says. `--mem` is the first guess for a command dibs has never seen, so asking honestly never costs you a turn (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, though that only raises an ask). `--cpu` says what you need up front.
|
|
235
|
+
|
|
236
|
+
Memory pressure at warning level holds new jobs while others run, with two ways past: a job of 3 GB or less that has waited 10 minutes, or that a person waits on (high, urgent, or `--by` with its reason), starts when the machine really has it free plus 1 GB, one at a time. Critical pressure holds everything but urgent work. 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
237
|
|
|
144
238
|
## The rest of docs/
|
|
145
239
|
|
|
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
|
|
240
|
+
- [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, environments and accounts with what's on them, throttling
|
|
147
241
|
- [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
|
|
242
|
+
- [docs/questions.md](questions.md): agents queuing questions for the person, `--wait`, working hours, standing rules, the attention budget
|
|
149
243
|
- [app/README.md](../app/README.md): the Mac app
|
|
150
244
|
- [docs/later.md](later.md): runs scheduled for a time or after something else ends
|
|
151
245
|
- [docs/relay.md](relay.md): the page from a phone or any browser, end to end encrypted, and dibs accounts
|
package/docs/relay.md
CHANGED
|
@@ -6,8 +6,9 @@ Turn it on:
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
dibs service install relay # keeps the outbound connection up, with backoff; off until you do this
|
|
9
|
-
dibs pair --remote #
|
|
9
|
+
dibs pair --remote # shows a QR code and a code; scan it with the phone or type the code at app.dibs.cc. That browser can only look
|
|
10
10
|
dibs pair --remote --allow-actions # the same, and that browser may also boost, pause, resume and stop jobs, cap an agent, set the pace and cancel scheduled runs
|
|
11
|
+
dibs pair --remote --allow-talk # all that, and that phone may message agents and answer their questions, with Face ID every time (below)
|
|
11
12
|
dibs pair --list # local sign-ins and remote devices
|
|
12
13
|
dibs pair --revoke <id|all> # a revoked device's open session ends within 25 seconds
|
|
13
14
|
dibs service status relay # connected or not, since when, how many devices
|
|
@@ -20,6 +21,7 @@ dibs service status relay # connected or not, since when, how many devices
|
|
|
20
21
|
| Mac identity, Ed25519 | `~/.dibs/relay-keys.json` (0600), never sent | signs every pairing answer and session handshake; browsers pin its fingerprint |
|
|
21
22
|
| Mac relay key, Ed25519 | same file | proves to the relay that this Mac owns its machine id; opens no session, decrypts nothing |
|
|
22
23
|
| device key, Ed25519 | the browser's IndexedDB, made with `extractable: false` | signs the device's half of each handshake; page script can use it but never read it |
|
|
24
|
+
| talking key, P-256 | the phone's Secure Enclave, or a WebAuthn credential; only for `--allow-talk` | signs each message or answer, only after Face ID or the passcode (see "Talking from a phone") |
|
|
23
25
|
| session keys, AES-256-GCM | memory only, per connection | one per direction, from a fresh X25519 exchange |
|
|
24
26
|
|
|
25
27
|
Machine id `mid` = first 16 bytes of SHA-256("dibs-mid-v1\0" ‖ relay public key), base64url (22 characters). Fingerprint `fp` = SHA-256("dibs-fp-v1\0" ‖ identity public key), base64url (43 characters).
|
|
@@ -39,12 +41,25 @@ https://app.dibs.cc/#p=<mid>.<secret>.<fp>
|
|
|
39
41
|
The fragment never goes in a request, and the page removes it from the address bar (`history.replaceState`) before any other code runs. The Mac keeps only what's derived from the secret, for ten minutes: `pid` = HKDF(secret, info "dibs-relay-v1 pair id", 16 bytes), the HMAC key `kp` (info "... pair key"), the name key `kn` (info "... pair name"), and the hash of the pairing ticket `pt` (info "... pair ticket", 32 bytes), which it registers with the relay. The page sends `pt` to the relay to get into the pairing pool; the relay can't derive anything else from it.
|
|
40
42
|
|
|
41
43
|
1. **pair1**, browser to Mac: `{t, pid, d, nb, name, sig, mac}`. `d` is the new device public key, `nb` 32 random bytes, `name` is the device's name ("Safari on iPhone") padded to 64 bytes, followed by the device's 32-byte random relay token `rt`, sealed together with AES-GCM under `kn` (random nonce), so the relay learns neither the name, its length, nor the token. `T1 = tx("dibs-pair1-v1", mid, pid, d, nb, name)`, `sig = Sign_d(T1)`, `mac = HMAC(kp, T1 ‖ sig)`.
|
|
44
|
+
A phone pairing with a `--allow-talk` link also sends `tk`, its talking key sealed under `kn`, and then `T1 = tx("dibs-pair1-v1", mid, pid, d, nb, name, tk)` (see "Talking from a phone").
|
|
42
45
|
The Mac finds the pending link by `pid` (gone or expired: `pair-expired`), checks `mac` in constant time (three failures burn the link), checks `sig`, decrypts the name, and only then, under one lock, deletes the link and stores the device `{pub: d, name, rth, created}` under a random 16-byte id `did`, where `rth` is the first 16 bytes of SHA-256("dibs-relay-token-v1\0" ‖ rt). It sends the relay the new list of token hashes, then `{t: "admit", ch, h: rth}` for the pairing tab.
|
|
43
46
|
2. **pair2**, Mac to browser: `{t, m, nm, did, sig, mac}`. `m` is the Mac's identity key, `nm` 32 random bytes. `T2 = tx("dibs-pair2-v1", mid, pid, d, nb, name, m, nm, did)`, `sig = Sign_M(T2)`, `mac = HMAC(kp, T2 ‖ sig)`.
|
|
44
47
|
The browser requires `fingerprint(m) == fp` from the link, then the HMAC, then the signature, and only then stores `{mid, m, fp, did, device key pair}`.
|
|
45
48
|
|
|
46
49
|
So pairing needs the secret (256 bits, one use, ten minutes; there's nothing to brute force), and a relay that swaps either key is caught: the device key by the HMAC and the device's own signature, the Mac's key by the fingerprint and the HMAC.
|
|
47
50
|
|
|
51
|
+
### The typed code
|
|
52
|
+
|
|
53
|
+
Beside the QR code, `dibs pair --remote` shows a code to type at app.dibs.cc instead, like `7KQM-2XRP-9DHT`: 12 Crockford base32 characters (no I, L, O or U; the page reads O as 0 and I and L as 1). The first 4 are a drop name `R`, the other 8 are `K`, 40 random bits that never leave the Mac or the person's eyes.
|
|
54
|
+
|
|
55
|
+
The Mac seals the link's fragment, `<mid>.<secret>.<fp>`, with AES-256-GCM under PBKDF2-SHA256(`K`, salt "dibs-code-v1" ‖ `R`, 600,000 iterations), a random 12-byte nonce and the salt as associated data, and sends the box to the relay as `{t: "drops", d: [{r, b, exp}]}` over its authenticated socket, the whole list of its open links' boxes each time it changes. The relay's code index keeps each box under `R` for the machine that sent it, until the link's ten minutes run out or the Mac stops listing it: when the link is used, revoked, or replaced past five open links.
|
|
56
|
+
|
|
57
|
+
A name another machine already holds stays theirs. The relay answers every drops message with `{t: "drops-res", ok, taken}`, the names it now holds for this Mac and the ones another machine holds, and `dibs pair --remote` waits up to 5 seconds for that answer before printing its code. A taken name gets the same link sealed again under a fresh code (three tries, then no code, only the QR code); no answer prints the code with a warning that it may not work yet. So the code it prints is one the relay took.
|
|
58
|
+
|
|
59
|
+
The page sends `R` to `POST /pair/code`, same origin only, and gets the box back, at most 3 times per box. A name nobody holds, an expired box and one already handed out 3 times all get the same 404. It derives the key from `K`, opens the box, and pairs with the link inside exactly as if the QR code had been scanned. A wrong `K` fails in the page, which keeps the box, so retyping never fetches again.
|
|
60
|
+
|
|
61
|
+
The relay never sees `K`. Whoever holds a box (the relay, or someone who guessed a live `R` out of 1,048,576 within the per-address limits) has 2^40 keys to try at 600,000 PBKDF2 rounds each: 3.3e17 HMAC-SHA256 calls on average. A top-end GPU does about 9e9 a second, so opening one box inside its ten minutes takes some 60,000 of them, and what's inside is worthless once those ten minutes are up or the link is used. The worst a guesser can do cheaply is spend a live box's 3 fetches; the person then runs `dibs pair --remote` again.
|
|
62
|
+
|
|
48
63
|
## A session
|
|
49
64
|
|
|
50
65
|
Every connection, including the first right after pairing:
|
|
@@ -68,24 +83,132 @@ AAD = "dibs-frame-v1" | sid | direction (1 = browser to Mac, 2 = Mac to browse
|
|
|
68
83
|
|
|
69
84
|
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
85
|
|
|
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
|
-
- a device paired with `--allow-actions`, also: POST `/api/jobs/<id>/boost|pause|resume|stop`, `/api/cap`, `/api/pace`, `/api/later/<id>/cancel
|
|
73
|
-
-
|
|
86
|
+
- 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/envs` (each project's environments: who has each, what was left on it), `/api/recap`, `/api/decisions` (every decision kept, newest first; `?about=words` for the closest), `/api/work` (work items with their logs and proof), `/api/agents` (each agent in plain words), `/api/runs/<id>` (one run's details), `/api/secrets` (stored credentials' names, rules and uses, never a value), `/api/history`, `/api/stats`, `/api/settings`, `/api/machines`, `/api/rules` (the standing rules), `/api/pending` (everything waiting on the person: open questions, polls, needs-you notes), `/api/file/<id>` and `/api/link/<id>` (what a message carries: a file sent with it, a file or folder shared live), `/api/paired` (the paired devices, so the app can show who else reaches this Mac), and POST `/api/push`, which signs that device up for notifications and nothing else (see "Notifications");
|
|
87
|
+
- a device paired with `--allow-actions`, also: POST `/api/jobs/<id>/boost|pause|resume|stop`, `/api/cap`, `/api/pace`, `/api/later/<id>/cancel`, `/api/alerts/dismiss`, `/api/hours`, `/api/attention` (the notification cap), `/api/decisions/<id>/revoke`, `/api/rules/<id>/remove`, `/api/secrets/revoke`, `/api/handoffs/<id>/drop`, `/api/work/<id>/drop`, `/api/seen` (marks a thread seen), `/api/reveal` (shows a file in Finder), and `/api/read` (none of these tells an agent anything, so they need no signature);
|
|
88
|
+
- a phone paired with `--allow-talk`, also, and only with a fresh signature from its talking key on each call: POST `/api/vote` (a vote on a poll, which reaches the agent that asked), `/api/pending/clear`, `/api/questions/<id>/answer`, `/api/questions/<id>/dismiss`, `/api/rules` (a new standing rule, which answers questions in the person's place from then on), `/api/handoffs/<id>/give` (sends an agent work), `/api/tell`, `/api/tell/all`, `/api/halt`, `/api/halt/off`, and `/api/pair/revoke` (signing a device out, which a stolen phone mustn't do without Face ID). These reach agents as "Message from the person", which agents act on, shell commands included, so without `--allow-talk` they're 403 like the rest;
|
|
89
|
+
- everything else is 403, a route added later included, so new routes are local-only until someone decides otherwise. That covers installing the hook (it edits `~/.claude/settings.json`), pairing new devices and machines, and accounts.
|
|
74
90
|
|
|
75
|
-
A reason sent with
|
|
91
|
+
A reason sent with an unsigned remote action is dropped: the action runs, but no words from a paired browser reach an agent as the person's unless the call was signed after Face ID (a halt's reason). A remote action runs the CLI with `DIBS_VIA`, so the record names the device: the job's `by` (a stop's `stopBy`, a pause's `by`, which the job's agent is told), the override event and `logChange` all read "the person via Safari on iPhone (remote 1a2b3c4d)": a label from the page's fixed vocabulary (browser and system, or "a browser" for any name the page wouldn't have made, since the device chooses its own name and this text reaches agents), and the start of its id, the one `dibs pair --revoke` takes. The device's own name appears only in `dibs pair --list`. `dibs pair --list` shows each device as "can talk (Face ID each time) and act", "can act" or "look only", and every `dibs pair --remote` is logged with whether it allowed actions and talking. Sessions end after 12 hours; the page reconnects.
|
|
76
92
|
|
|
77
93
|
Errors before a session exists (`{t: "err", code}`) are unauthenticated, so the relay could write them. The page believes only four codes (`unpaired`, `pair-expired`, `bad-pair`, `bad-hello`), shows only its own fixed sentence for each, and never deletes keys because of one. Nothing else the relay sends reaches the page as words either: WebSocket close reasons are ignored, and every message the page shows about the connection is one of its own.
|
|
78
94
|
|
|
95
|
+
## Files through the relay
|
|
96
|
+
|
|
97
|
+
A message can carry files and live links (dibs say --file, --report, --link; the shapes are in docs/reference.md). Answers through the relay are JSON in frames of at most 4 MiB, so file bytes come as base64, at most 2 MiB of the file per answer (`RELAY_CHUNK` in src/media.mjs):
|
|
98
|
+
|
|
99
|
+
- GET `/api/file/<id>[?range=<start>-<end>]` answers `{id, name, mime, kind, size, start, end, data, next?}`: `data` is the bytes from `start` to `end` (inclusive) in base64, status 200 when that's the whole file and 206 when it's a part. `next` is the range to ask for after it (`"2097152-"`), absent at the end. `range` reads as HTTP's Range does: `100-199`, `100-` (to the end, capped at a piece), `-500` (the last 500 bytes). A range outside the file is 416 with the `size`.
|
|
100
|
+
- GET `/api/link/<id>[?path=<relative path>]` answers a folder's listing (`{id, name, root, path, isDir: true, entries: [{name, path, isDir, size, mtime, kind, mime}], more?}`) or, for a file under it, the same pieces as `/api/file`. A path that leaves the shared folder, by `..` or through a symlink, or a key-looking file, is 403; a link more than a week old is 404.
|
|
101
|
+
|
|
102
|
+
A 25 MB file is 13 answers. On the Mac's own page (`http://127.0.0.1:7421`) the same paths answer raw bytes with the file's `Content-Type`, `Accept-Ranges: bytes`, and 206 with `Content-Range` for an HTTP `Range` header, so a PDF viewer can stream it.
|
|
103
|
+
|
|
104
|
+
## Talking from a phone
|
|
105
|
+
|
|
106
|
+
`dibs pair --remote --allow-talk` (or `dibs connect --phone --allow-talk`) pairs a phone that may also message agents and answer their questions. It implies `--allow-actions`. Those calls reach agents as "Message from the person", and agents act on them, so a phone that can talk is remote control of the Mac. Each such phone holds a second key, its **talking key**, that signs only after Face ID (or the device passcode), and every talk call carries a fresh signature from it. The device key alone (the one in every handshake) can't talk.
|
|
107
|
+
|
|
108
|
+
`dibs connect --account --allow-talk` is refused: an account's browsers all share one device key, and a talking key belongs to one phone.
|
|
109
|
+
|
|
110
|
+
### The link
|
|
111
|
+
|
|
112
|
+
A `--allow-talk` link ends in `.t`:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
https://app.dibs.cc/#p=<mid>.<secret>.<fp>.t
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The typed code's box holds the same fragment, `.t` included. The `.t` tells the phone to make its talking key before it sends pair1. A phone that pairs without one (the `.t` stripped, or a page from before this) gets a device that can act but not talk.
|
|
119
|
+
|
|
120
|
+
### The talking key
|
|
121
|
+
|
|
122
|
+
A P-256 key, sent as its uncompressed point: 65 bytes, `0x04 || X || Y`, base64url (87 characters).
|
|
123
|
+
|
|
124
|
+
- **kind `raw`**, the dibs iPhone app: a Secure Enclave key whose access control requires biometry, made with `SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleWhenUnlockedThisDeviceOnly, [.privateKeyUsage, .biometryCurrentSet], nil)` and `SecureEnclave.P256.Signing.PrivateKey(accessControl:)`. `pub` is its `publicKey.x963Representation`.
|
|
125
|
+
- **kind `webauthn`**, the page at app.dibs.cc: a WebAuthn credential, relying party `app.dibs.cc`, algorithm ES256 (-7), `userVerification: "required"`. `pub` is `response.getPublicKey()` (SPKI) reduced to its 65-byte point, and `cred` is the credential's `rawId`, base64url.
|
|
126
|
+
|
|
127
|
+
In pair1 it travels as `tk`:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
plain = UTF-8 JSON: {"kind":"raw","pub":"<pub>"} or {"kind":"webauthn","pub":"<pub>","cred":"<rawId>"}
|
|
131
|
+
tk = base64url( iv (12 random bytes) || AES-256-GCM(key kn, iv, plain, additional data "dibs-pair-talk-v1") || tag (16) )
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`kn` is the name key from pairing (HKDF of the link's secret, info "dibs-relay-v1 pair name"). With `tk` present, the transcript the device signs and the link's HMAC covers is `T1 = tx("dibs-pair1-v1", mid, pid, d, nb, name, tk)`, with `tk` as its raw box bytes, so a relay can't swap the key. Without it, T1 is as before. The box is at most 2048 bytes. pair2 is unchanged.
|
|
135
|
+
|
|
136
|
+
The Mac keeps the key only for a `--allow-talk` link, on the device record as `talk: true, tk: {kind, pub, cred?}` (a key sent with any other link is ignored). A key that isn't a valid P-256 point, or a box that doesn't open, fails the pairing with `bad-pair`.
|
|
137
|
+
|
|
138
|
+
### A talk call
|
|
139
|
+
|
|
140
|
+
The routes: POST `/api/questions/<id>/answer` `{"text": ..., "asked": ...}` (`asked`, the question as shown, is optional), POST `/api/questions/<id>/dismiss` `{}`, POST `/api/tell` `{"to": ..., "text": ...}`, POST `/api/vote` `{"poll": "p3", "options": "one choice a line"}` (a list would not sign: values are strings or booleans), POST `/api/pending/clear` `{"id": "q12" | "p3" | "m40"}`. Each goes in an ordinary `{t: "req", id, method, path, body}` frame, with one more field in the body, `uv`:
|
|
141
|
+
|
|
142
|
+
1. **Body bytes `B`.** The body's fields other than `uv`, sorted by name, written `{"name":value,"name":value}` with no spaces. Names are 1 to 32 ASCII letters; values are strings or `true`/`false` (anything else is refused). Strings are written as JavaScript's `JSON.stringify` writes them: `"` as `\"`, `\` as `\\`, U+0008 `\b`, U+0009 `\t`, U+000A `\n`, U+000C `\f`, U+000D `\r`, any other U+0000 to U+001F as `\u00xx` (lowercase hex), and everything else, `/` and non-ASCII included, as itself in UTF-8. An empty body is `{}`. Build this string by hand: a JSON encoder may escape `/` or order the names differently, and then the signature won't match.
|
|
143
|
+
2. **Time `t`**: milliseconds since 1970 UTC, an integer.
|
|
144
|
+
3. **Digest `D`** = SHA-256( tx("dibs-talk-v1", did, method, path, SHA-256(B), t as decimal ASCII) ). `did` is the device id from pair2 as its ASCII string, `method` is `"POST"`, and `path` is exactly the `path` string the frame carries.
|
|
145
|
+
4. **Signature.**
|
|
146
|
+
- `raw`: an ECDSA P-256 signature with SHA-256 over the 32 bytes `D` (the signer hashes `D`; CryptoKit's `signature(for: D)` does), as raw `r || s`, 64 bytes, base64url. Face ID is the Secure Enclave's own check. `uv = {"t": t, "kind": "raw", "sig": "<r||s>"}`.
|
|
147
|
+
- `webauthn`: `navigator.credentials.get` with `challenge` = `D`, `rpId` "app.dibs.cc", `allowCredentials` = the credential, `userVerification: "required"`. `uv = {"t": t, "kind": "webauthn", "authenticatorData": ..., "clientDataJSON": ..., "sig": <the assertion's DER signature>}`, each base64url.
|
|
148
|
+
5. Send the body with its own fields and `uv` beside them.
|
|
149
|
+
|
|
150
|
+
In Swift, for kind `raw`:
|
|
151
|
+
|
|
152
|
+
```swift
|
|
153
|
+
let b = canonical(body) // step 1, by hand
|
|
154
|
+
let t = Int64(Date().timeIntervalSince1970 * 1000)
|
|
155
|
+
let d = Data(SHA256.hash(data: tx("dibs-talk-v1", [did, "POST", path].map { Data($0.utf8) } + [Data(SHA256.hash(data: b)), Data(String(t).utf8)])))
|
|
156
|
+
let sig = try talkKey.signature(for: d).rawRepresentation // Face ID shows here
|
|
157
|
+
// tx(label, fields): for the label and then each field, a 4-byte big-endian length and the bytes
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The Mac checks, in order: the device was paired with `--allow-talk` and has a key; `uv` is there with an integer `t` (else "needs Face ID each time"); `t` is within 120 seconds of the Mac's clock either way ("more than 2 minutes ago"); the kind is the device's, the body can be written as above, and the signature verifies ("didn't check out"). For `webauthn` that means: authenticatorData's first 32 bytes are SHA-256("app.dibs.cc"), its flags have user present (0x01) and user verified (0x04), clientDataJSON's `type` is `webauthn.get`, its `challenge` is base64url(`D`), its `origin` is `https://app.dibs.cc` and `crossOrigin` isn't true, and the signature verifies over authenticatorData || SHA-256(clientDataJSON). Last, under the lock on `relay.json`, `t` must be greater than the last `t` this device used, which it then records ("already used"), so a replayed call runs at most once. A refusal is a 403 with `{error, uv: true}`, and `api()` never runs. The Mac passes the body on without `uv`, and `api()` checks again that the call was signed.
|
|
161
|
+
|
|
162
|
+
A call that passes runs as the person, with `DIBS_VIA` set to the device's label and `DIBS_PROOF` to the signature (kept with what it queues, below): the message reaches the agent as "Message from the person via dibs app on iPhone (remote 1a2b3c4d): ...", and the answer, the `tell` and their events record `the person via ...` the same way. The label is from a fixed vocabulary (the page's browser names, and `dibs app on iPhone` or `dibs app on iPad` for the app, which should name itself that in pair1); any other name reads "a browser". `/api/board` says `canTalk` for the device, and the page shows Answer, Not now, the message box and New message only when it's true. Marking a thread read (POST `/api/read` `{"to": ...}`) isn't a talk call: any device paired with `--allow-actions` makes it without a signature (it was one in 0.0.182 and before; a signature sent with it now is ignored), so the app marks a thread read when the person opens it, with no Face ID.
|
|
163
|
+
|
|
164
|
+
### What a signature proves
|
|
165
|
+
|
|
166
|
+
The signature is checked twice. Once here, before `api()` runs the call, as above. And again when the message or answer the call queued reaches an agent: the Mac keeps the proof with it (`proof`: `{d: did, m: method, p: path, b: B as a string, uv}`, an optional field in `messages.json` and `questions.json`), and src/signed.mjs verifies `uv` over `B` against the device's `tk` in `relay.json` at that moment. Every file in `~/.dibs` can be written by any program running as this user, so the first check alone would let one write a message into `messages.json` that reads as the person's. With the second, only words the phone signed do: the message must be what the signed call made (the same text, to the agent named in `to`, or the answer to that question id, or the vote on that poll), the device must still be paired with `--allow-talk`, the signature at most a week old (messages are kept a week), and no message with the same signature already delivered to that agent. Anything else reaches the agent as an unverified message it shouldn't act on without asking (docs/questions.md, "Who a message is from"). An answer may carry `asked`, the question as the phone showed it (its first 300 characters); the Mac refuses the answer (409) if the question says otherwise now, and the agent is shown the signed words.
|
|
167
|
+
|
|
168
|
+
This protects the person's words from anything that can only write files: a compromised package, a script an agent was talked into running, an agent editing dibs's state. It doesn't protect against a program that rewrites dibs's code, the guard hook in Claude Code's settings, or the phone's public key in `relay.json`: what checks the signature runs as the same user, and such a program can change what it believes. Messages typed on the Mac itself (the local page, the dibs app, `dibs tell`) aren't signed at all yet; they reach agents marked as unsigned, from this Mac. A passkey on the local page (WebAuthn takes `localhost` as its relying party, not `127.0.0.1`) or a Secure Enclave key in the Mac app, behind Touch ID, would sign those the same way.
|
|
169
|
+
|
|
170
|
+
Worked example: `did` = `Bd3fXk9QAAAAAAAAAAAAAA`, POST `/api/tell` with body `{"to": "web-app", "text": "ship it"}`, `t` = 1764000000000.
|
|
171
|
+
|
|
172
|
+
- B: `{"text":"ship it","to":"web-app"}`
|
|
173
|
+
- SHA-256(B) (hex): `b764bd7416ac79f5a6ce4f79a85ca530305ae10722bcfa0dfe6f9eb62b8fe7ad`
|
|
174
|
+
- the tx bytes (hex): `0000000c646962732d74616c6b2d76310000001642643366586b3951414141414141414141414141414100000004504f5354000000092f6170692f74656c6c00000020b764bd7416ac79f5a6ce4f79a85ca530305ae10722bcfa0dfe6f9eb62b8fe7ad0000000d31373634303030303030303030`
|
|
175
|
+
- digest (hex): `e11efca4add6fadc2124f625f992313fc9f0e1a051e2bce05580bd6c713aa856`
|
|
176
|
+
|
|
177
|
+
## Notifications
|
|
178
|
+
|
|
179
|
+
The dibs iPhone app can be told when something reaches the person: a question only they can answer (`--one-way` or `--needs-you`), a note or reply an agent leaves them, a handoff no agent has taken in 10 minutes, or a hold on new jobs an agent put on. Neither the relay nor Apple reads a word of it.
|
|
180
|
+
|
|
181
|
+
**Signing up**, once per Mac and APNs token:
|
|
182
|
+
|
|
183
|
+
1. The app makes a 32-byte push key for that Mac and keeps it in the keychain of its App Group (`group.cc.dibs.phone`), which its notification extension shares, readable after the first unlock and never synced.
|
|
184
|
+
2. Over its session it calls POST `/api/push` `{"token": "<APNs token, hex>", "key": "<push key, base64url>"}`. The Mac stores both on that device's record as `push: {tok, key, at}`, for the session's own device whatever the body says; `{"off": true}` removes them. Any paired device may, since a notification says only what the device can already read. On the Mac's own page the route is refused.
|
|
185
|
+
3. In every connection's first message the app also tells the relay its APNs token: `{t: "hello", rt, apns: "<hex>", sb?: true}` (`sb` for a debug build, which Apple's sandbox serves). The relay takes it only from a tab its relay token proves is paired, and keeps it in that machine's object as `apns:<hash of rt>`, deleted when the Mac stops listing that hash.
|
|
186
|
+
|
|
187
|
+
**Sending.** The relay connector looks once a second at questions, threads, handoffs and the hold on new jobs. What's new for the person waits until nothing more has come for 5 seconds (30 at most), and each phone hears from the Mac at most once every 30 seconds, so ten notes buzz once. Outside the person's hours (`dibs hours`) only urgent questions go; the rest go when the hours start, if they still need the person. What's already there when notifications start never goes out. With two or more people (`dibs people`), a phone given to one of them (`dibs people set sam --device <id>`) hears only about that person's agents and what's everyone's, within their own hours and `--notify` setting; a phone nobody has been given hears only what's everyone's. `dibs connect --phone --for sam` pairs a phone that's sam's from the start.
|
|
188
|
+
|
|
189
|
+
What a notification says is JSON, `{v: 1, kind, title, body, q?, thread?, options?}`, padded with spaces to 512, 1024 or 2048 bytes and sealed per phone:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
box = base64url( iv (12 random bytes) || AES-256-GCM(push key, iv, json, additional data "dibs-push-v1 <mid> <did>") || tag (16) )
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The Mac sends the relay `{t: "push", id, n: [{h, tok, d: box}]}` over its authenticated socket, one item per phone. The relay sends each to Apple only if this Mac lists `h` now, its object holds an APNs token under `h`, and `tok` is that token; within 40 a minute per Mac (20 at once); otherwise it answers 403 or 429 for that item. What goes to Apple is `{aps: {alert: {title: "dibs", body: "Something needs you"}, mutable-content: 1, sound: "default"}, d: box, m: mid}`, to production APNs (or the sandbox for `sb`), topic `cc.dibs.phone`, signed with an ES256 provider token from the APNs key the Worker holds as a secret. The relay answers `{t: "push-res", id, r: [{h, status, reason?, gone?}]}`; on 410 (or a token Apple calls bad) it drops its entry and says `gone`, and the Mac drops the token from the device, so the app signs up again with its new one.
|
|
196
|
+
|
|
197
|
+
**On the phone**, the notification extension finds its key for `m`, opens the box and shows the title and body in place of the fixed words. A box that doesn't open, or a Mac it has no key for, leaves "Something needs you". A question's choices become the notification's buttons; each opens the app on that question with the choice picked, and sending it still takes Face ID. Tapping a notification opens its question or thread.
|
|
198
|
+
|
|
199
|
+
So the relay learns which machine notifies which APNs token and when, and the size of a padded box; Apple learns the same from its side. Neither learns what it says, who asked, or which kind of thing it was.
|
|
200
|
+
|
|
79
201
|
## The relay
|
|
80
202
|
|
|
81
203
|
| path | who | what the relay does |
|
|
82
204
|
|---|---|---|
|
|
83
|
-
| `wss://app.dibs.cc/ws/m/<mid>` | the Mac (also sends `{t: "tokens", h, p}`: the hashes of its paired browsers' relay tokens and of its open links' pairing tickets, within a second of any change in `relay.json`) | sends a 32-byte challenge; the Mac answers with its relay public key and `Sign_R(tx("dibs-relay-auth-v1", mid, challenge, host))`. The relay checks that the key hashes to `<mid>` and the signature; then routes. The newest authenticated connection replaces the old one |
|
|
84
|
-
| `wss://app.dibs.cc/ws/b/<mid>` | a browser tab | only from the page's own Origin. A tab gets a slot only by proving it's paired: its first message is `{t: "hello", rt}
|
|
205
|
+
| `wss://app.dibs.cc/ws/m/<mid>` | the Mac (also sends `{t: "tokens", h, p}`: the hashes of its paired browsers' relay tokens and of its open links' pairing tickets, and `{t: "drops", d}`, its open links' sealed code boxes, within a second of any change in `relay.json`) | sends a 32-byte challenge; the Mac answers with its relay public key and `Sign_R(tx("dibs-relay-auth-v1", mid, challenge, host))`. The relay checks that the key hashes to `<mid>` and the signature; then routes. The newest authenticated connection replaces the old one |
|
|
206
|
+
| `wss://app.dibs.cc/ws/b/<mid>` | a browser tab | only from the page's own Origin. A tab gets a slot only by proving it's paired: its first message is `{t: "hello", rt}` (the dibs app adds its APNs token, see "Notifications"), and the relay admits it if the hash of `rt` is one the Mac registered (compared in constant time), or `{t: "pair", ticket}` with a ticket whose hash the Mac registered for an open link, into a pool of 2 with a 30 s deadline that ends when the Mac admits it. A wrong ticket and no open link get the same answer, so the relay's answers say nothing about whether a link is open, and nobody without the link can take the pairing pool. Anything else (a byte, a made-up token, silence for 5 s) closes it. An admitted tab gets a random channel id; its binary messages go to the Mac prefixed with the id, and the Mac's go back by id. Text from the relay: `{t: "mac", up}`, and `{t: "refused", why: "unpaired" or "no-pairing"}`, which the page turns into its own words |
|
|
207
|
+
| `https://app.dibs.cc/pair/code` | the page (`POST {r}`, same Origin only) | a typed code's sealed box by its drop name (see "The typed code"), 3 times per box at most; the Worker's limit of 20 a minute per address and the code index's own count apply |
|
|
85
208
|
| `https://app.dibs.cc/` | anyone | the page, with the headers below |
|
|
86
209
|
| `https://dibs.cc/app`, `https://dibs.cc/app/*` | anyone | a 301 to `https://app.dibs.cc/`, which keeps the fragment. Exactly these two route patterns, so `/apple-touch-icon.png` and the like stay the waitlist's |
|
|
87
210
|
|
|
88
|
-
Limits: 20 connections a minute per address and role (Workers rate limiting), and 30 new tabs a minute per address in the machine's Durable Object. At most 8 paired tabs per machine and 4 per address; at most 6 tabs waiting to prove themselves, 3 per address, and past 6 the oldest waiting goes, never the newcomer. A Mac socket has 10 seconds to authenticate, on its own timer; at most 8 wait at once, and past that the oldest waiting one is closed rather than the newcomer refused, so silent sockets can't lock the real Mac out. When the Mac goes offline every tab hears so and is closed 5 seconds later, whatever it sends meanwhile; a tab that arrives while it's offline is turned away at once. When the Mac reconnects, every admitted tab is closed so it proves itself to the new connection. A revoke reaches the relay within a second, and that device's open tabs are closed. Also 64 KiB per browser frame and 4 MiB per Mac frame, token buckets of 20 frames a second (burst 60) per tab and 200 (burst 400) for the Mac, tabs closed after 10 idle minutes, a Mac closed after 90 seconds without a ping. One Durable Object per machine id,
|
|
211
|
+
Limits: 20 connections a minute per address and role (Workers rate limiting), and 30 new tabs a minute per address in the machine's Durable Object. At most 8 paired tabs per machine and 4 per address; at most 6 tabs waiting to prove themselves, 3 per address, and past 6 the oldest waiting goes, never the newcomer. A Mac socket has 10 seconds to authenticate, on its own timer; at most 8 wait at once, and past that the oldest waiting one is closed rather than the newcomer refused, so silent sockets can't lock the real Mac out. When the Mac goes offline every tab hears so and is closed 5 seconds later, whatever it sends meanwhile; a tab that arrives while it's offline is turned away at once. When the Mac reconnects, every admitted tab is closed so it proves itself to the new connection. A revoke reaches the relay within a second, and that device's open tabs are closed. Also 64 KiB per browser frame and 4 MiB per Mac frame, token buckets of 20 frames a second (burst 60) per tab and 200 (burst 400) for the Mac, tabs closed after 10 idle minutes, a Mac closed after 90 seconds without a ping. One Durable Object per machine id, whose storage holds only the APNs tokens of phones that signed up for notifications from that Mac; observability and logpush off, and nothing about a frame or a notification is logged.
|
|
89
212
|
|
|
90
213
|
## The page
|
|
91
214
|
|
|
@@ -132,7 +255,7 @@ The relay's own copy of `web/authorize.html`, with SRI and the same strict CSP a
|
|
|
132
255
|
- **Registrations** through the relay (at `/<machine id>/`) are limited to 10 in 10 minutes per address, 100 in all. At most 200 remote clients are kept; when full, the oldest one that never signed in is dropped, and a client that has signed in is never dropped (with none to drop, registration waits). Local clients are never touched.
|
|
133
256
|
- **Per machine,** requests with a token the Mac accepts have their own budget (120 a minute), apart from everything else (discovery, registration, sign-in, rejected tokens: 40 a minute), so strangers can't spend the signed-in client's. At most 8 requests at once per machine, 2 from one address. Per address, 120 requests a minute (Workers rate limiting).
|
|
134
257
|
- **Tokens, grants and clients** made through the relay carry `remote: true` and work only through it; local ones work only locally. `dibs pair --list` shows them as "MCP via mcp.dibs.cc: <client name>"; `--revoke` signs one out.
|
|
135
|
-
- **What a client can do** depends on the code it signed in with, here and through the relay alike. A plain `dibs pair` code gives the read tools: `board`, `agents`, `agent`, `progress`, `stats`, `questions`, `history`, `resource`, `machines`, `messages`. A code from `dibs pair --allow-actions` adds the write tools: `post_progress`, `answer_question`, `tell_agent`, `say_to_person`, `hold`, `release`, `boost_job`, `pause_job`, `resume_job`, `stop_job`. The grant goes from the code to its grant, its tokens and every refresh; `dibs pair --list` shows each client as "can act" or "look only".
|
|
258
|
+
- **What a client can do** depends on the code it signed in with, here and through the relay alike. A plain `dibs pair` code gives the read tools: `board`, `agents`, `agent`, `progress`, `stats`, `questions`, `history`, `resource`, `machines`, `messages`, `work`. A code from `dibs pair --allow-actions` adds the write tools: `post_progress`, `answer_question`, `tell_agent`, `say_to_person`, `hold`, `release`, `boost_job`, `pause_job`, `resume_job`, `stop_job`. The grant goes from the code to its grant, its tokens and every refresh; `dibs pair --list` shows each client as "can act" or "look only".
|
|
136
259
|
- **A client acts as an agent, never as the person.** Every write runs the CLI as `mcp-<name>-<hash>` (its name made safe, and 4 hex characters of its client id), so its messages and answers reach agents as another agent's, its holds and job changes show under that name on the board and in `dibs history`, and acting on another session's job takes `owner`, as for any agent. No tool installs the hook or sets the hours.
|
|
137
260
|
- **Commands never go through the relay.** A code from `dibs pair --allow-commands` also gives `queue_run` (a command for dibs to run later, as `dibs later` does), but only to a client signed in at this Mac's own `http://127.0.0.1:7421/mcp`. Through mcp.dibs.cc a token could be read in transit, so a token issued there never carries the commands grant, `queue_run` is never listed, and a call to it is refused, whatever code the client signed in with. `dibs pair --list` shows such a local client as "can run commands".
|
|
138
261
|
- Through the relay, writes carry a token the Mac accepts, so they count against the signed budget like any other MCP call.
|
|
@@ -193,6 +316,7 @@ Everything the relay lists is its word, so the Mac pins what it saw in step 2: t
|
|
|
193
316
|
- **The relay sees metadata**: which machine id is online and when, how many tabs, the time and padded size of each frame, IP addresses, and the public keys exchanged in pairing and handshakes. It can drop or delay anything (denial of service), but can't read, forge, replay or reorder a frame without the session closing.
|
|
194
317
|
- **The link is the key to pairing.** Anyone who sees it within ten minutes and opens it first pairs instead of the person (the person's own browser then gets "already used", and `dibs pair --list` shows the extra device to revoke). Don't paste it into a chat; scan the QR code with the phone's camera.
|
|
195
318
|
- **The link can reach synced browser history.** The page removes the fragment from the address bar as soon as its script runs, but a browser may record the full URL in its history first, and history syncs (iCloud, a Google or Firefox account). The link is dead after one use and after ten minutes either way, so a synced copy is only a risk in that window, and only before the person's own browser uses it. Scanning the QR code on the phone that will use it keeps it off the Mac's browser history altogether.
|
|
196
|
-
- **A compromised Mac or browser** is out of scope: malware in the person's account can read `~/.dibs`, and a browser extension with access to app.dibs.cc can drive the page.
|
|
197
|
-
- **A device paired with `--allow-actions`** can boost, pause, resume and stop any job, cap an agent, set the pace and cancel scheduled runs, as the person (the record names the device, and no reason text goes with it). It can't message agents, answer their questions, or change the hook or the hours.
|
|
319
|
+
- **A compromised Mac or browser** is out of scope: malware in the person's account can read `~/.dibs`, and a browser extension with access to app.dibs.cc can drive the page. Malware that can only write files can't make agents take its words for the person's (see "What a signature proves"); malware that can change dibs's code or the hook can.
|
|
320
|
+
- **A device paired with `--allow-actions`** can boost, pause, resume and stop any job, cap an agent, set the pace and cancel scheduled runs, as the person (the record names the device, and no reason text goes with it). It can't message agents, answer their questions, or change the hook or the hours.
|
|
321
|
+
- **A phone paired with `--allow-talk`** can tell agents to do anything, as the person. Face ID guards each message, but Face ID doesn't show what it's approving: on the page, a changed app.dibs.cc could show one message and sign another while the person looks at it. The app from the App Store doesn't load its code from a server, so it doesn't have that gap. A WebAuthn credential may sync to the person's other devices through their passkey provider; it signs only for this device's id, and only this device's key opens a session, so a synced copy alone can't talk. A phone that's lost while unlocked still asks for Face ID on every send. Revoke a lost phone at once (`dibs pair --revoke <id>`). A lost phone that isn't revoked, or a changed page at app.dibs.cc while that device has it open, can do the same: stopping every job is the worst of it. Pair with actions only the devices that need them, and revoke a lost one at once. Look-only devices, the default, can read the board and nothing else.
|
|
198
322
|
- A pairing whose answer never reaches the browser (the connection dropped between pair1 and pair2) leaves a device on the Mac that no browser holds the key for. It can't be used; `dibs pair --list` shows it and `--revoke` removes it.
|
package/docs/releasing.md
CHANGED
|
@@ -22,7 +22,13 @@ From the public repo, after the AGENTS.md steps and with the version bumped ever
|
|
|
22
22
|
1. Each change in the release lands in the public repo as a commit of its own, with its own message, authored and committed by `dibs maintainers <licensing@dibs.cc>`. Never one squashed commit per release, and never a rewrite of what's already public. `release.sh` refuses a tag with any other author since the last tag.
|
|
23
23
|
2. `git tag vX && git push origin main vX`. The release workflow runs the suite on macOS and Linux, makes the GitHub release, and publishes `@dibssoftware/dibs` to npm through trusted publishing: no npm token anywhere, and npm shows the package's provenance as that workflow run. package.json has no dependencies and no scripts, so nothing runs on anyone's machine at install.
|
|
24
24
|
3. `sh release.sh` uploads the tarball, its sum, install.sh and install.ps1 to dibs.cc, then downloads each back and compares bytes. `DIBS_DRY_RUN=1` builds and checks without uploading.
|
|
25
|
-
4. The Mac app: `dibs run xcode-build -m "
|
|
25
|
+
4. The Mac app: `dibs run xcode-build -m "build the Mac app for release" -- app/release.sh`, then `sh release.sh --mac` to upload the DMG and, last, `latest.json`.
|
|
26
26
|
5. Plugin users get the new version once the `version` in `.claude-plugin/plugin.json` changes and their marketplace refreshes (`claude plugin marketplace update dibs`).
|
|
27
27
|
|
|
28
28
|
The tarball is `git archive` of the tag through `gzip -n`, so the same tag always gives the same bytes and the same sum.
|
|
29
|
+
|
|
30
|
+
## Waived checks
|
|
31
|
+
|
|
32
|
+
- 0.0.194: `claude plugin validate --strict .` fails on one warning, that claude.ai refuses a plugin with files in `bin/`. v0.0.181 fails it the same way under Claude Code 2.1.337, so it isn't a regression; the plain `claude plugin validate .` passes. Moving `dibs.mjs` and `dibs-guard.mjs` out of `bin/` is left for a later release.
|
|
33
|
+
- 0.0.194: tagged but never released. Its release workflow failed twice on flaky macOS tests, so nothing went to GitHub releases, npm or dibs.cc. 0.0.195 replaces it, with the Windows tests passing; `install.ps1` is no longer pinned.
|
|
34
|
+
- 0.0.195: the strict plugin check fails on the same `bin/` warning as 0.0.194 and is waived the same way.
|