worktrust 0.10.29 → 0.10.30

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/README.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # worktrust
2
2
 
3
+ ## 0.10.30: an update asks only what is new
4
+
5
+ `update` remembers what you said yes to. Each AI app's WorkTrust door, the session hook, Codex's `notify` line and
6
+ Antigravity's `Stop` hook that you agreed to are brought onto the new version without a question, each printed as
7
+ `✓ … refreshed (you agreed on <date>)`. Only the launcher's path changes; nothing else about what was agreed. A NEW AI
8
+ app, or a wake hook that is no longer there (you took it out), is shown in full and asked about; `--yes` leaves it as
9
+ it is and lists it as `skipped: new, run without --yes to decide`. A No drops the agreement, and `disconnect` deletes
10
+ the record. It is one small file, `~/.worktrust/consent.json` (see [SECURITY.md](SECURITY.md)). The first update that
11
+ keeps it counts the WorkTrust entries already on this computer as agreed, because only a yes ever wrote them.
12
+
13
+ The re-measure after a new version is one question, asked after its plan (the plan is counted on this computer and
14
+ sends nothing): `Send them (re-measured; …)? [y/N]`. Enter and `--yes` are No. `--rebuild` agrees in advance.
15
+
16
+ One line that updates a computer you coupled before, with no question at all:
17
+
18
+ ```
19
+ npx -y worktrust@latest update --yes --rebuild
20
+ ```
21
+
22
+ - `npx -y`: npm's own flag. It answers npm's `Ok to proceed?` before it downloads the package; WorkTrust never sees it.
23
+ - `worktrust@latest`: the newest published version, never a copy npm cached earlier.
24
+ - `update`: this computer onto that version, the same key, no new pairing.
25
+ - `--yes`: every question whose answer is Yes by default. Anything new stays as it is (skipped, and listed).
26
+ - `--rebuild`: yes in advance to re-measuring this computer's sessions with the new version's rules. WorkTrust
27
+ replaces this computer's earlier lines for those days, each withdrawn and kept, never deleted. Leave it out to
28
+ be asked.
29
+ - `--codex` and `--antigravity` say yes in advance to a NEW Codex or Antigravity wake hook as well.
30
+
3
31
  ## 0.10.29: history in calls WorkTrust takes; how each session was started
4
32
 
5
33
  A history call carries at most 1.9 MB and 1.4 MB of timelines (WorkTrust takes 2 MB and 1.5 MB). A batch an earlier
@@ -336,9 +364,9 @@ sends them with one difference: WorkTrust **replaces** this computer's earlier l
336
364
  - **Only from this computer's own key.** A connector (an AI signed in on the web) cannot ask for a rebuild; WorkTrust
337
365
  refuses it at the door.
338
366
  - **Offered once by `update`.** When this computer's earlier lines were made by an earlier version (the copy in
339
- `~/.worktrust` says which), `npx worktrust@latest update` says so in plain words and offers the rebuild; Enter is No,
340
- and the same version updated again offers nothing. The command cannot read your record, so it is an offer, not a
341
- finding.
367
+ `~/.worktrust` says which), `npx worktrust@latest update` says so in plain words, shows the plan and asks once
368
+ (0.10.30); Enter and `--yes` are No, `--rebuild` agrees in advance, and the same version updated again offers
369
+ nothing. The command cannot read your record, so it is an offer, not a finding.
342
370
 
343
371
  ## A web chat's data export
344
372
 
@@ -461,7 +489,7 @@ retried safely. A row kept pending on WorkTrust remains excluded from counted ac
461
489
  | | |
462
490
  |---|---|
463
491
  | **Reads** | Which AI apps are installed (the settings folders of Claude Code, Codex, Cursor, Gemini CLI, Antigravity, VS Code, Windsurf, Hermes Agent, Goose, OpenCode, OpenClaw), and the chats Cursor and Copilot keep (clocks, models and token counts only). Afterwards, the session hook reads Claude Code's, Codex's and Antigravity's session files, the session databases of Hermes, Goose, OpenCode and OpenClaw, and the chats Cursor and Copilot keep, on this computer to measure durations and token counts. |
464
- | **Writes** | The key file (above). In each AI app's MCP settings (`~/.claude.json` through `claude mcp`, `~/.cursor/mcp.json`, `~/.codex/config.toml`, `~/.gemini/settings.json`, `~/.gemini/config/mcp_config.json` (Antigravity), VS Code's `mcp.json`, Windsurf's `mcp_config.json`, Hermes's and Goose's `config.yaml`, OpenCode's `opencode.json`, OpenClaw through `openclaw mcp set`) a WorkTrust entry that runs the local bridge, with no key in it; three hooks in `~/.claude/settings.json`; the bridge, the hook and the counter in `~/.worktrust/`. |
492
+ | **Writes** | The key file (above). In each AI app's MCP settings (`~/.claude.json` through `claude mcp`, `~/.cursor/mcp.json`, `~/.codex/config.toml`, `~/.gemini/settings.json`, `~/.gemini/config/mcp_config.json` (Antigravity), VS Code's `mcp.json`, Windsurf's `mcp_config.json`, Hermes's and Goose's `config.yaml`, OpenCode's `opencode.json`, OpenClaw through `openclaw mcp set`) a WorkTrust entry that runs the local bridge, with no key in it; three hooks in `~/.claude/settings.json`; the bridge, the hook and the counter in `~/.worktrust/`; and `~/.worktrust/consent.json`, what you agreed to (names and days only, 0.10.30). |
465
493
  | **Sends, to pair** | This computer's system (macOS, Windows, Linux) and host name. WorkTrust also records the network address the request arrives from, as a security record kept 90 days and seen only by WorkTrust staff (to answer a theft or fraud report). |
466
494
  | **Sends, afterwards** | Per measured stretch of work, and nothing else: its timeline and basis (`timeline`, `duration_basis`: since 0.10.20 the CLI sends no duration and no hours in layers of its own; WorkTrust computes them from the timeline), token counts (`tokens_in`, `tokens_out`, `tokens_cache_read`, `tokens_cache_write`, `token_basis`), the model's name (`model`), the kind of work and one layer keyword such as frontend or backend (`title`, `kind`, `layer`, `layers`), closed technology keys (`stack`) and separate display-only tool keys (`tools_seen`), how the turns are counted (`turn_basis`; the counts themselves WorkTrust reads from the timeline; the subagents' seconds wait for a timeline per run), when it began and ended and your computer's offset from UTC (`started_at`, `at`, `utc_offset`), what the CLI derived from the stretch as kinds and counts (`evidence`: checks run and failed, delivery steps and whether a check passed first, recoveries, delegation, context, routing, steering, refusals, planning, files and test files changed, the complexity class; with the WorkTrust mod on, its `live` counts from inside Claude Code: permission answers, effort levels, context and plan-limit peaks, subagents and setup; never a word, a command or a path; since 0.8.3, `live` since 0.10.15), a hash of the session and the day (`stretch_ref`), `steered_from` when it ran over SSH, the stretch's clock as step kinds and whole seconds so WorkTrust computes the figures itself (`timeline`, since 0.10.20: never a word, a tool name or a path), how the session was started as the AI app recorded it, beside the timeline (`session_kind`: interactive, headless or scheduled, since 0.10.29; left out when the app did not say), the CLI's version and a digest of its own files as signals (`cli_version`, `cli_digest`), and, so the work can be matched to GitHub, the repository as its remote's owner/name (`repo`, only for a repository on GitHub, GitLab or Bitbucket, the hosts WorkTrust can couple; never one on your own or a client's server), for any other git repository a code in its place (`repo_code`: 16 hex of an HMAC of its remote, or its root, keyed with this computer's own secret in `~/.worktrust/archive-salt`, which is never sent, so WorkTrust can group its lines but cannot tell which repository it is) and the hashes of the commits made in the stretch (`commits`, never their messages). |
467
495
  | **Never sends** | Prompts, answers, code, file names or paths, commit messages, branch names, or the name of your local folder (a repository is named only as its remote's owner/name, above). The door has no field for them and refuses a submission that carries them. |
@@ -509,7 +537,8 @@ never as proof.
509
537
  ## Undo
510
538
 
511
539
  `npx worktrust@latest disconnect` removes the WorkTrust entries (Hermes's hook with them), the hook (and Codex's `notify` line and
512
- Antigravity's `worktrust` hook when WorkTrust set them), the credentials and installed bridge scripts.
540
+ Antigravity's `worktrust` hook when WorkTrust set them), the credentials, installed bridge scripts and the record of
541
+ what you agreed to (`~/.worktrust/consent.json`, 0.10.30).
513
542
  Protected mode retains an encrypted empty slot and its OS wrapping key so reconnecting stays protected.
514
543
  A small note of the previous account (masked) remains so that a later coupling by another account
515
544
  does not offer its earlier work. Other retained files and your local evidence archive are not an
package/SECURITY.md CHANGED
@@ -56,6 +56,23 @@ private transcripts or account data in a public issue.
56
56
  - Local `disconnect` is distinct from server revocation and archive deletion. Revoke through
57
57
  WorkTrust's device settings when the server credential must stop working.
58
58
 
59
+ ## What you agreed to: `~/.worktrust/consent.json` (0.10.30)
60
+
61
+ - One private file (mode 0600, written through the same exclusive-temp, atomic-replace path as the credential file,
62
+ refused when it is a link or not owned by you). Per coupling you said yes to it holds a NAME only
63
+ (`door:<app>` such as `door:Cursor`, `session-hook`, `codex-notify`, `antigravity-stop`), the day, the CLI version
64
+ and how the yes was given (`typed`, `flag` for `--yes`, `--codex` or `--antigravity` said in advance, `found` for a
65
+ WorkTrust entry already on the computer when the file was first made). No key, no token, no path, no command and
66
+ nothing of any config file. It is never sent.
67
+ - What it changes: `update` refreshes an agreed entry without asking when only the launcher's path moves. It never
68
+ turns a new AI app or a wake hook that is no longer there into a yes: those are asked about, and `--yes` skips them.
69
+ It is never read as agreement to send anything: the re-measure of earlier history still needs a typed `y` or
70
+ `--rebuild`, every time a new version offers it.
71
+ - Who can change it: anyone who can write your home folder, which can already edit the AI apps' settings directly.
72
+ A forged entry can at most spare the question for a write WorkTrust would offer anyway (the door in an AI app found
73
+ here, a wake hook); it cannot widen what is written, sent or read. An unreadable or unsafe file counts as no agreement.
74
+ - A No drops the entry it answered; `disconnect` deletes the file; a coupling to another account starts it empty.
75
+
59
76
  ## What measurement signatures establish
60
77
 
61
78
  The metadata journal introduced in the 0.10.21 candidate preserves observations, not their
@@ -1 +1 @@
1
- {"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"6ecfbf44f001dd433512b26736031ebc855b154e2bb0a401e2512b43623cd9cd","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"9e3c21c144dfc8397da49cf04b0262c4f6e64619b4233a768bc928f6704026ec"},"format":"worktrust-package/1","kind":"engine","version":"0.10.29"},"signature":"syVJ_vcbmCt6ZhD4wL0yY9KtE0Z2EUzY2OdLEGeNJfDwgBslJU37iCZVwLRKbGyzmMSt0hMUOI74wXbIBQtuAg"}
1
+ {"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"0c29113179561af1c1e9ff8b7a786e7240edf48a2244993e12335e5ee362c812","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"7ed5f7a4f50b386943b4848d4ed1065b61541f8953bed52eb00fdac04187afcf"},"format":"worktrust-package/1","kind":"engine","version":"0.10.30"},"signature":"2rFv0Weq_38gvPDk01zX1siW_IFFLEjrI_8CA1DMD0cJL8FrLlb6rXQaAsQKV-qXlZf8ASNPWa5YMqcp674aCA"}
@@ -1 +1 @@
1
- {"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"c6f5280c5bf81a14db4bdc282218fb005706e92dd9a9170c0e727716ee91685a","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"3096ed1693974a90e1f4f59bf01c9559d94a7941d933e36fb81d3995a97f25c1","README.md":"6b1932fe3e0dc1c167a964f60a4f7db6b667d5af87b1d71bca6df0d359ed7b42","SECURITY.md":"b0cf3c839c918f3a403ae33e857c947fe62cbbad96bee6cac748bb42924839fc","chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","engine-release.json":"28ad03e959e2bb94342629b25373e208fc482769a47d88d6ef7e9fce61304625","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","package.json":"863e796accfcb4a228afccb6f8c7a9c92748f9fb45848f42be7a32d093ee5194","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"6ecfbf44f001dd433512b26736031ebc855b154e2bb0a401e2512b43623cd9cd","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"9e3c21c144dfc8397da49cf04b0262c4f6e64619b4233a768bc928f6704026ec"},"format":"worktrust-package/1","kind":"npm","version":"0.10.29"},"signature":"IzmnxMIX-w2YY9j8qlkMYDG3iKGlSSgDNMHUZx9aOryhcEbB_NheH_MvvM3LMfgmMU5_aHPCd04dTB95a0aZBw"}
1
+ {"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"c6f5280c5bf81a14db4bdc282218fb005706e92dd9a9170c0e727716ee91685a","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"3096ed1693974a90e1f4f59bf01c9559d94a7941d933e36fb81d3995a97f25c1","README.md":"ba9f69395ecb09fb0272f6ced835cff5c1a9ae18e296434da80bd3820dff5874","SECURITY.md":"a7f1187b4f384a71e1f69cb25327487597969c0b0422b377dd4c72086b1b9ad9","chat-exports.mjs":"04eafe333940ec03d5058d8d51062124aa12ab882bf04db03bcda5613ec69298","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","config-edits.mjs":"0eba2f176ef6f7afba071d6e00de0ff19ba2b283180a801dfd957aa38c1edd94","count-behaviour.mjs":"1beaec2a4d0aead76d166f89cc52441a9cf48f2e69da9888ca2091dd3a10a37b","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","engine-release.json":"5838696d584288739d3950fa3bf435e0add7f17e341c26376ac4a84afb93bbcc","history-outbox.mjs":"b84e22542bb2d8195a469ee5f4116356ae9eac4a53ff2d40f0268b5b1de99dc5","log-session.mjs":"4da610744dfdd1aa939c231263fad9962288376bf8494ef3e0a08128e3d0cb17","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","package.json":"ad4556d952977e5e68daa66128b246b9f27c17dc6858fb80dfb4bc34a2694b40","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"3e369083ba43bcda2fa0622fd526aa64fcf8ad66e7b6e8f23821752c4d47ad27","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","session-databases.mjs":"543fd3b82d28d96d789be0a1dc9186c5fafa783e98b87e5b3b17b211542e2b4d","setup-mcp.mjs":"0c29113179561af1c1e9ff8b7a786e7240edf48a2244993e12335e5ee362c812","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5b31a6f29b785d277e92257532f3c7cee366a79759decc7a75cfbaec2686ee13","transcript-readers.mjs":"2f17bb5f234ccd630d51cf3f35c396d1b43240b601330cc3abb193effb5bfc3c","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"7ed5f7a4f50b386943b4848d4ed1065b61541f8953bed52eb00fdac04187afcf"},"format":"worktrust-package/1","kind":"npm","version":"0.10.30"},"signature":"hTe1ztpzEICp88drixUXrlKWTZPJvvzn0FUXMSLlg6Tu9daRjsS34r8N7XCT4KBH4zd-o1E1j6IPto7cKTkDDg"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktrust",
3
- "version": "0.10.29",
3
+ "version": "0.10.30",
4
4
  "description": "Couple this computer to WorkTrust: approve a code in your browser, and every AI app here reports what you built. Metadata only, no dependencies.",
5
5
  "type": "module",
6
6
  "bin": {
package/setup-mcp.mjs CHANGED
@@ -26,6 +26,8 @@ const value = (name) => { const i = args.indexOf(`--${name}`); return i >= 0 ? a
26
26
  const WRITE = args.includes("--write");
27
27
  const REMOVE = args.includes("--remove");
28
28
  const NAME = value("name") ?? "worktrust";
29
+ /** `--skip "Cursor,Zed"` (0.10.30): apps the person has not agreed to yet are left exactly as they are, in and out. */
30
+ const SKIP = new Set((value("skip") ?? "").split(",").map((label) => label.trim()).filter(Boolean));
29
31
  /**
30
32
  * THE BRIDGE (2026-10-03). With `--bridge <path to worktrust.mjs>` no client is given a key: each
31
33
  * gets a local command (`node worktrust.mjs mcp`) that reads the key from ~/.worktrust/key.json
@@ -217,6 +219,7 @@ let touched = 0;
217
219
  let standing = 0;
218
220
  for (const client of CLIENTS) {
219
221
  if (!client.present()) { console.log(` – ${client.label}: not on this machine`); continue; }
222
+ if (SKIP.has(client.label)) { console.log(` · ${client.label}: left as it is (not agreed yet)`); continue; }
220
223
  if (client.shape === "openclaw") {
221
224
  const text = existsSync(client.file) ? readFileSync(client.file, "utf8") : "";
222
225
  const named = new RegExp(`["']?${NAME}["']?\\s*:\\s*\\{`).test(text) && ours(text);
package/worktrust.mjs CHANGED
@@ -8,7 +8,8 @@
8
8
  * npx worktrust --yes no question (for scripts); the computer is still approved in the app
9
9
  * npx worktrust --device a computer without a browser (SSH): type a code on another device
10
10
  * npx worktrust connect couple again, also on a computer already coupled
11
- * npx worktrust update this computer onto the newest CLI, same key, no new pairing
11
+ * npx worktrust update this computer onto the newest CLI, same key, no new pairing (0.10.30: what
12
+ * was agreed before is refreshed unasked; --rebuild agrees to the re-measure)
12
13
  * npx worktrust history send this computer's earlier sessions as history (asks first)
13
14
  * npx worktrust history --rebuild the same as history (0.10.5: history always re-measures); WorkTrust replaces this computer's
14
15
  * earlier lines day by day, never counting a day twice (shows the plan, asks first)
@@ -75,7 +76,7 @@ const command = args.includes("--help") ? "help" : args.includes("--version") ?
75
76
  const flag = (name) => { const at = args.indexOf(`--${name}`); return at >= 0 ? args[at + 1] : undefined; };
76
77
  const has = (name) => args.includes(`--${name}`);
77
78
  /** This CLI's version, said to the door so the app can tell which computer runs an old one (check-cli-package holds it equal to package.json). */
78
- const CLI_VERSION = "0.10.29";
79
+ const CLI_VERSION = "0.10.30";
79
80
  const ORIGIN = (flag("origin") ?? process.env.WORKTRUST_ORIGIN ?? "https://app.worktrust.io").replace(/\/$/, "");
80
81
  const MCP = flag("url") ?? process.env.WORKTRUST_MCP_URL ?? `${ORIGIN}/api/mcp`;
81
82
  const HOME_DIR = join(homedir(), ".worktrust");
@@ -330,6 +331,64 @@ const previousNote = {
330
331
  erase() { try { rmSync(PREVIOUS_FILE); } catch { /* gone */ } },
331
332
  };
332
333
 
334
+ /**
335
+ * WHAT THE PERSON ALREADY AGREED TO (0.10.30, owner 2026-10-28: "an update should need fewer y + Enter"). One small file,
336
+ * ~/.worktrust/consent.json (0600): per coupling the person said yes to, its name only (`door:<app>`, `session-hook`,
337
+ * `codex-notify`, `antigravity-stop`), the day, the CLI version and how (`typed`, `flag`: --yes / --codex / --antigravity
338
+ * said in advance, `found`: a WorkTrust entry already here when this file was first made, which only a yes ever wrote).
339
+ * Never a key, a path or a config's content. `update` refreshes an agreed entry whose only change is the launcher's path
340
+ * without asking; a NEW app or hook still asks, and under --yes is skipped. A No drops the entry; disconnect deletes the
341
+ * file; a coupling to another account starts it empty. An unreadable file counts as no agreement at all.
342
+ */
343
+ const CONSENT_FILE = join(HOME_DIR, "consent.json");
344
+ const CONSENT_NAME = /^(?:door:[^\n,]{1,80}|session-hook|codex-notify|antigravity-stop)$/;
345
+ const CONSENT_HOW = new Set(["typed", "flag", "found"]);
346
+ let consentLoaded = null;
347
+ async function consent() {
348
+ if (consentLoaded) return consentLoaded;
349
+ let file = null;
350
+ try { const text = readPrivateFile(CONSENT_FILE); file = text === null ? null : JSON.parse(text); } catch { file = {}; }
351
+ const entries = {};
352
+ for (const [name, entry] of Object.entries(file?.entries ?? {})) if (CONSENT_NAME.test(name) && /^\d{4}-\d{2}-\d{2}$/.test(entry?.at ?? "") && CONSENT_HOW.has(entry?.how)) entries[name] = { at: entry.at, cli: String(entry.cli ?? "").slice(0, 16), how: entry.how };
353
+ let dirty = false;
354
+ const today = () => new Date().toISOString().slice(0, 10);
355
+ // THE FIRST RUN THAT KEEPS THIS FILE: what WorkTrust already wrote here on an earlier yes counts as that yes, once.
356
+ if (file === null) { for (const name of await consentFound()) entries[name] = { at: today(), cli: CLI_VERSION, how: "found" }; dirty = Object.keys(entries).length > 0; }
357
+ const save = () => { if (!dirty || has("dry-run")) return; try { ensureHome(); writePrivateFile(CONSENT_FILE, `${JSON.stringify({ version: 1, entries })}\n`); dirty = false; } catch { /* not kept: the next run asks again */ } };
358
+ consentLoaded = {
359
+ has: (name) => Boolean(entries[name]),
360
+ said: (name) => (entries[name]?.how === "found" ? "you agreed with an earlier version" : `you agreed on ${entries[name]?.at}`),
361
+ agree(name, how) { if (!entries[name]) { entries[name] = { at: today(), cli: CLI_VERSION, how }; dirty = true; } save(); },
362
+ drop(name) { if (entries[name]) { delete entries[name]; dirty = true; } save(); },
363
+ reset() { for (const name of Object.keys(entries)) delete entries[name]; dirty = true; save(); },
364
+ save,
365
+ };
366
+ return consentLoaded;
367
+ }
368
+ function eraseConsent() { try { rmSync(CONSENT_FILE); } catch { /* none */ } consentLoaded = null; }
369
+ /** The WorkTrust entries already standing here: each app's door (setup-mcp's own removal plan), the session hook, Codex's and Antigravity's wake hooks. */
370
+ async function consentFound() {
371
+ const found = [];
372
+ try {
373
+ const plan = await run((await scripts())["setup-mcp.mjs"], ["--remove"], PLACEHOLDER, true);
374
+ for (const line of plan.out.split("\n")) { const match = /^\s+− ([^:]+): would (?:remove from|run)/.exec(line); if (match && match[1] !== "Claude Code") found.push(`door:${match[1]}`); }
375
+ } catch { /* no plan: nothing found */ }
376
+ if (claudeDoorHere()) found.push("door:Claude Code");
377
+ if (sessionHookHere()) found.push("session-hook");
378
+ if (existsSync(join(homedir(), ".codex")) && isOurNotify(codexNotify().text ?? "")) found.push("codex-notify");
379
+ if (antigravityHere() && agyHooks()?.worktrust) found.push("antigravity-stop");
380
+ return found.filter((name) => CONSENT_NAME.test(name));
381
+ }
382
+ /** Claude Code's own entry for the door, as status reads it; the session hook in its settings. */
383
+ function claudeDoorHere() {
384
+ const servers = {};
385
+ try { const config = JSON.parse(readFileSync(join(homedir(), ".claude.json"), "utf8")); Object.assign(servers, config.mcpServers ?? {}); for (const project of Object.values(config.projects ?? {})) Object.assign(servers, project.mcpServers ?? {}); } catch { /* no Claude Code here */ }
386
+ return Object.entries(servers).find(([name, server]) => /worktrust/i.test(`${name} ${server?.url ?? ""} ${(server?.args ?? []).join(" ")}`)) ?? null;
387
+ }
388
+ function sessionHookHere() { try { return /log-session|worktrust(?:-launch)?\.(?:mjs|py)\\?" hook/.test(readFileSync(join(homedir(), ".claude", "settings.json"), "utf8")); } catch { return false; } }
389
+ /** The app a plan line names: " ✓ Cursor: …" → Cursor. */
390
+ const labelOf = (line) => /^\s*[↻+✓!−-] ([^:]+):/.exec(line)?.[1] ?? null;
391
+
333
392
  /**
334
393
  * THE OLD KEY ENDS WHEN THE COMPUTER IS COUPLED AGAIN (owner, 2026-10-04). Signed with the old key's own
335
394
  * device key, which only this computer holds, and naming the new key by its prefix: WorkTrust ends the
@@ -565,25 +624,40 @@ async function update() {
565
624
  say();
566
625
  const paths = await scripts();
567
626
  const plan = await run(paths["setup-mcp.mjs"], ["--bridge", STABLE], PLACEHOLDER, true);
627
+ // AGREED BEFORE, REFRESHED WITHOUT A QUESTION (0.10.30): an app or hook the person said yes to is brought onto this
628
+ // version's launcher; only what is NEW here is shown in full and asked about, and --yes leaves the new ones as they are.
629
+ const agreed = await consent();
568
630
  say(" Every AI app found here gets the WorkTrust door, the local command that reads the key:");
569
631
  const found = planLines(plan.out, true).filter((line) => !line.includes("not on this machine"));
570
- for (const line of found) say(line);
632
+ const apps = [...new Set(found.map(labelOf).filter(Boolean))], fresh = apps.filter((app) => !agreed.has(`door:${app}`));
633
+ for (const app of apps) if (!fresh.includes(app)) say(` ✓ ${app}: refreshed (${agreed.said(`door:${app}`)})`);
634
+ for (const line of found) if (fresh.includes(labelOf(line))) say(`${line} · new`);
571
635
  if (found.length === 0) say(" (no AI app found here)");
636
+ const hookFresh = !agreed.has("session-hook");
572
637
  say(` The session hook and ${STABLE} are brought to ${CLI_VERSION}.`);
638
+ say(hookFresh ? ` + Session hook: ${join(homedir(), ".claude", "settings.json")} → SessionStart, SessionEnd and PreCompact run it · new` : ` ✓ Session hook: refreshed (${agreed.said("session-hook")})`);
573
639
  say(" The key stays as it is: no new pairing, the same computer in WorkTrust.");
574
640
  say();
575
641
  if (has("dry-run")) { say(" Dry run: nothing was written and nothing was sent."); return; }
576
- if (!(await ask("Continue?"))) { say(" Stopped. Nothing was written."); return; }
642
+ const newOnes = [...fresh, ...(hookFresh ? ["Session hook"] : [])];
643
+ let takeNew = false;
644
+ if (newOnes.length > 0 && has("yes")) say(` skipped: new, run without --yes to decide: ${newOnes.join(", ")}`);
645
+ else if (newOnes.length > 0) takeNew = await ask(`Couple the new ${newOnes.length === 1 ? "one" : "ones"} marked "new" (${newOnes.join(", ")})?`, false);
646
+ if (newOnes.length > 0 && !takeNew && !has("yes")) say(" The new ones stay as they are. npx worktrust update asks again.");
647
+ const skip = takeNew ? [] : fresh, hookOn = !hookFresh || takeNew;
577
648
  const previousVersion = stableVersion();
578
649
  await prepareBundledRuntime();
579
650
  ensureHome();
580
651
  saveStableEntry();
581
652
  say(` ✓ ${STABLE} is now ${CLI_VERSION}`);
582
- // Out first, then in: an app that held a key of its own (a hand-made entry) moves onto the bridge.
583
- await run(paths["setup-mcp.mjs"], ["--remove", "--write"], key.token, true);
584
- if ((await run(paths["setup-mcp.mjs"], ["--write", "--bridge", STABLE], key.token)).code !== 0) fail("coupling the AI apps failed; the output above says where.");
653
+ // Out first, then in: an app that held a key of its own (a hand-made entry) moves onto the bridge. An app not agreed to is not touched.
654
+ const skipArgs = skip.length > 0 ? ["--skip", skip.join(",")] : [];
655
+ await run(paths["setup-mcp.mjs"], ["--remove", "--write", ...skipArgs], key.token, true);
656
+ if ((await run(paths["setup-mcp.mjs"], ["--write", "--bridge", STABLE, ...skipArgs], key.token)).code !== 0) fail("coupling the AI apps failed; the output above says where.");
585
657
  const hookArgs = ["--install", "--via", STABLE];
586
- if ((await run(paths["log-session.mjs"], hookArgs, key.token, false)).code !== 0) fail("installing the session hook failed; the output above says where.");
658
+ if (hookOn && (await run(paths["log-session.mjs"], hookArgs, key.token, false)).code !== 0) fail("installing the session hook failed; the output above says where.");
659
+ for (const name of [...apps.filter((app) => !skip.includes(app)).map((app) => `door:${app}`), ...(hookOn ? ["session-hook"] : [])]) agreed.agree(name, "typed");
660
+ agreed.save();
587
661
  // Codex installed since, or a No said at connect: the one question, asked again (or "already set").
588
662
  await offerCodex();
589
663
  await offerAntigravity();
@@ -632,6 +706,7 @@ async function connect() {
632
706
  if (has("dry-run")) { say(" Dry run: nothing was written and nothing was sent."); return; }
633
707
  if (!(await ask("Continue?"))) { say(" Stopped. Nothing was written and nothing was sent."); return; }
634
708
  await prepareBundledRuntime();
709
+ const agreed = await consent(); // read before anything is written, so what this run writes is not taken for an earlier yes
635
710
 
636
711
  // The device key: made here, its private half kept with the key, its public half bound at WorkTrust.
637
712
  const device = direct ? null : generateKeyPairSync("ed25519");
@@ -662,6 +737,9 @@ async function connect() {
662
737
  const floors = !previous || switched ? ["--from-now", ...(switched ? ["--history-floor", "now"] : [])] : [];
663
738
  const hookArgs = ["--install", ...floors, "--via", STABLE, ...(direct ? ["--direct"] : [])];
664
739
  if ((await run(paths["log-session.mjs"], hookArgs, token, false, { WORKTRUST_CODEX_OFFER: "1" })).code !== 0) fail("installing the session hook failed; the output above says where.");
740
+ // WHAT WAS AGREED HERE (0.10.30): the apps and the hook this "Continue?" covered; another account starts with none from before.
741
+ if (switched) agreed.reset();
742
+ for (const name of [...new Set(foundApps.map(labelOf).filter(Boolean))].map((app) => `door:${app}`).concat("session-hook")) agreed.agree(name, has("yes") ? "flag" : "typed");
665
743
  await offerCodex();
666
744
  await offerAntigravity();
667
745
  if (switched) { say(); say(" Earlier work on this computer is not offered: it was coupled to another account before. Only work from now on goes to this account."); }
@@ -680,7 +758,7 @@ async function connect() {
680
758
  * Enter, --yes and a closed terminal all mean No; `--history` says yes in advance. What goes is hours
681
759
  * and tokens per day, filed as history (never verified hours, never text).
682
760
  */
683
- async function offerHistory(paths, token, devicePem, url = MCP, rebuild = false) {
761
+ async function offerHistory(paths, token, devicePem, url = MCP, rebuild = false, agreedInAdvance = false) {
684
762
  const env = { WORKTRUST_MCP_URL: url, ...(devicePem ? { WORKTRUST_DEVICE_KEY: devicePem } : {}) };
685
763
  const counted = await run(paths["log-session.mjs"], ["--history", "--dry-run", "--summary"], token, true, env);
686
764
  let found = null;
@@ -698,7 +776,7 @@ async function offerHistory(paths, token, devicePem, url = MCP, rebuild = false)
698
776
  say(" never deleted, so a day is counted once. Other computers, web sources and days not listed are not touched.");
699
777
  }
700
778
  if (has("dry-run")) { say(" Dry run: nothing was sent."); return; }
701
- if (!has("history") && !(rebuild ? await ask("Send them (re-measured; this computer's earlier lines for these days are replaced, a day is counted once)?", false) : await ask("Send these as history (hours and tokens per day; never text)?", false))) { historyDone(false); say(" Not sent. Send them later with: npx worktrust"); return; }
779
+ if (!has("history") && !agreedInAdvance && !(rebuild ? await ask("Send them (re-measured; this computer's earlier lines for these days are replaced, a day is counted once)?", false) : await ask("Send these as history (hours and tokens per day; never text)?", false))) { historyDone(false); say(" Not sent. Send them later with: npx worktrust"); return; }
702
780
  // Marked unfinished before the first batch leaves (0.10.9): a send stopped halfway (Ctrl+C, a closed lid) is finished by the next run.
703
781
  historyDone(false);
704
782
  const sent = await run(paths["log-session.mjs"], ["--history", ...(rebuild ? ["--rebuild"] : []), ...(has("retry-review") ? ["--retry-review"] : [])], token, true, env);
@@ -744,8 +822,9 @@ async function offerRebuild(previousVersion, paths, key) {
744
822
  say(" the agent, what the seconds were, more AI apps). You can re-measure the");
745
823
  say(" sessions still on this computer and have WorkTrust replace this computer's earlier lines, day by day, never counting");
746
824
  say(" a day twice. Later: npx worktrust");
747
- if (!(await ask("Show the plan and rebuild now?", false))) { say(" Not now."); return; }
748
- await offerHistory(paths, key.token, key.device ?? null, key.url, true);
825
+ // ONE QUESTION, AFTER THE PLAN (0.10.30): counting the plan reads this computer only and sends nothing, so it is shown
826
+ // first and the send is asked once, Enter is No; `--rebuild` agrees in advance, --yes alone never does.
827
+ await offerHistory(paths, key.token, key.device ?? null, key.url, true, has("rebuild"));
749
828
  }
750
829
 
751
830
  /**
@@ -971,17 +1050,24 @@ async function offerCodex() {
971
1050
  say(" Codex takes one, so it stays as it is; Codex sessions are still sent whenever the Claude Code hook runs.");
972
1051
  return;
973
1052
  }
974
- say(" Codex can wake the session hook at the end of every turn, so Codex work arrives without Claude Code running:");
975
- say(` ${found.text ? "↻" : "+"} ${CODEX_CONFIG} → ${want}`);
1053
+ // AGREED BEFORE (0.10.30): WorkTrust's own line, already said yes to, whose launcher path moved: refreshed without a question.
1054
+ const agreed = await consent(), known = Boolean(found.text) && agreed.has("codex-notify");
1055
+ if (known) say(` ✓ Codex wakes the session hook: refreshed (${agreed.said("codex-notify")}).`);
1056
+ else {
1057
+ say(" Codex can wake the session hook at the end of every turn, so Codex work arrives without Claude Code running:");
1058
+ say(` ${found.text ? "↻" : "+"} ${CODEX_CONFIG} → ${want}`);
1059
+ }
976
1060
  if (has("dry-run")) { say(" Dry run: nothing was written."); return; }
977
- if (!has("codex") && !(await ask("Let Codex wake the session hook?", false))) { say(" Not set. npx worktrust update asks again."); return; }
1061
+ if (!known && !has("codex") && has("yes")) { say(" Not set (skipped: new, run without --yes to decide)."); return; }
1062
+ if (!known && !has("codex") && !(await ask("Let Codex wake the session hook?", false))) { agreed.drop("codex-notify"); say(" Not set. npx worktrust update asks again."); return; }
978
1063
  await prepareBundledRuntime(); want = desired();
979
1064
  const rows = [...found.rows];
980
1065
  if (found.text) rows.splice(found.at, found.end - found.at + 1, want);
981
1066
  else rows.splice(found.insert, 0, ...(found.insert < rows.length && rows[found.insert] !== "" ? [want, ""] : [want]));
982
1067
  if (rows.at(-1) !== "") rows.push("");
983
1068
  writeCodex(rows);
984
- say(" ✓ Codex wakes the session hook. Restart Codex to pick it up; the earlier file is kept as config.toml.worktrust-backup.");
1069
+ agreed.agree("codex-notify", has("codex") ? "flag" : "typed");
1070
+ say(known ? " Restart Codex to pick it up; the earlier file is kept as config.toml.worktrust-backup." : " ✓ Codex wakes the session hook. Restart Codex to pick it up; the earlier file is kept as config.toml.worktrust-backup.");
985
1071
  }
986
1072
 
987
1073
  /**
@@ -1014,13 +1100,20 @@ async function offerAntigravity() {
1014
1100
  say();
1015
1101
  if (hooks === null) { say(` ${AGY_HOOKS} is not readable JSON, so it is left as it is; Antigravity sessions are still sent whenever another hook runs.`); return; }
1016
1102
  if (JSON.stringify(hooks.worktrust) === JSON.stringify(want)) { say(" ✓ Antigravity already wakes the session hook when its agent stops."); return; }
1017
- say(" Antigravity can wake the session hook when its agent stops, so Antigravity work arrives without Claude Code running:");
1018
- say(` ${hooks.worktrust ? "↻" : "+"} ${AGY_HOOKS} → worktrust: Stop runs ${want.Stop[0].command}`);
1103
+ // AGREED BEFORE (0.10.30): WorkTrust's own hook, already said yes to, whose launcher path moved: refreshed without a question.
1104
+ const agreed = await consent(), known = Boolean(hooks.worktrust) && agreed.has("antigravity-stop");
1105
+ if (known) say(` ✓ Antigravity wakes the session hook: refreshed (${agreed.said("antigravity-stop")}).`);
1106
+ else {
1107
+ say(" Antigravity can wake the session hook when its agent stops, so Antigravity work arrives without Claude Code running:");
1108
+ say(` ${hooks.worktrust ? "↻" : "+"} ${AGY_HOOKS} → worktrust: Stop runs ${want.Stop[0].command}`);
1109
+ }
1019
1110
  if (has("dry-run")) { say(" Dry run: nothing was written."); return; }
1020
- if (!has("antigravity") && !(await ask("Let Antigravity wake the session hook?", false))) { say(" Not set. npx worktrust update asks again."); return; }
1111
+ if (!known && !has("antigravity") && has("yes")) { say(" Not set (skipped: new, run without --yes to decide)."); return; }
1112
+ if (!known && !has("antigravity") && !(await ask("Let Antigravity wake the session hook?", false))) { agreed.drop("antigravity-stop"); say(" Not set. npx worktrust update asks again."); return; }
1021
1113
  await prepareBundledRuntime(); want = desired();
1022
1114
  writeAgyHooks({ ...hooks, worktrust: want });
1023
- say(` ✓ Antigravity wakes the session hook. Restart Antigravity to pick it up${existsSync(`${AGY_HOOKS}.worktrust-backup`) ? "; the earlier file is kept as hooks.json.worktrust-backup" : ""}.`);
1115
+ agreed.agree("antigravity-stop", has("antigravity") ? "flag" : "typed");
1116
+ say(` ${known ? " Restart" : "✓ Antigravity wakes the session hook. Restart"} Antigravity to pick it up${existsSync(`${AGY_HOOKS}.worktrust-backup`) ? "; the earlier file is kept as hooks.json.worktrust-backup" : ""}.`);
1024
1117
  }
1025
1118
  /** Disconnect takes the hook named worktrust out of Antigravity's hooks, and nothing else. */
1026
1119
  function removeAntigravityHook() {
@@ -1049,7 +1142,7 @@ async function disconnect() {
1049
1142
  const plan = await run(paths["setup-mcp.mjs"], ["--remove"], PLACEHOLDER, true);
1050
1143
  say(" 1. The WorkTrust door comes out of every AI app here:");
1051
1144
  for (const line of planLines(plan.out)) say(line);
1052
- say(" 2. The session hook comes out of ~/.claude/settings.json (and Codex's notify line and Antigravity's worktrust hook, when WorkTrust set them), credentials are removed (an encrypted empty slot keeps the OS-vault preference)");
1145
+ say(" 2. The session hook comes out of ~/.claude/settings.json (and Codex's notify line and Antigravity's worktrust hook, when WorkTrust set them), credentials are removed (an encrypted empty slot keeps the OS-vault preference), and so is the record of what you agreed to (consent.json)");
1053
1146
  say(" but for one note of which account this computer fed (masked), so a later coupling by another account starts clean.");
1054
1147
  say(" 3. The key itself stays valid until you revoke it: WorkTrust → Sources → Devices → this computer → Revoke.");
1055
1148
  say();
@@ -1063,6 +1156,8 @@ async function disconnect() {
1063
1156
  if (removeAntigravityHook()) say(" ✓ Antigravity no longer wakes the session hook.");
1064
1157
  previousNote.save(keyStore.load());
1065
1158
  keyStore.erase();
1159
+ eraseConsent(); // 0.10.30: what was agreed goes with the coupling; a later connect asks again
1160
+
1066
1161
  // Everything of ours on this computer goes; the folder too, when nothing else is left in it.
1067
1162
  for (const name of [STABLE_FILE, ...SCRIPTS.map((script) => join(HOME_DIR, downloaded(script))), join(HOME_DIR, "pinned")]) { try { rmSync(name); } catch { /* gone */ } }
1068
1163
  try { rmSync(HOME_DIR, { recursive: false }); } catch { /* not empty, or gone */ }
@@ -1112,21 +1207,13 @@ async function mod() {
1112
1207
  }
1113
1208
 
1114
1209
  async function status() {
1115
- const servers = {};
1116
- try {
1117
- const config = JSON.parse(readFileSync(join(homedir(), ".claude.json"), "utf8"));
1118
- Object.assign(servers, config.mcpServers ?? {});
1119
- for (const project of Object.values(config.projects ?? {})) Object.assign(servers, project.mcpServers ?? {});
1120
- } catch { /* no Claude Code here */ }
1121
- const door = Object.entries(servers).find(([name, server]) => /worktrust/i.test(`${name} ${server?.url ?? ""} ${(server?.args ?? []).join(" ")}`));
1210
+ const door = claudeDoorHere();
1122
1211
  say(door ? ` Claude Code: coupled (${door[1].url ?? "through the local bridge"})` : " Claude Code: not coupled. Run `npx worktrust connect`.");
1123
1212
  const key = keyStore.load();
1124
1213
  say(` Credential storage: ${keyStore.protected() ? "OS vault + encrypted local file" : "private local file; use worktrust protect-key after updating"}`);
1125
1214
  say(key ? ` Key: in ${KEY_PLACE}, ${key.device ? "bound to this computer, " : ""}last renewed ${String(key.renewedAt ?? "").slice(0, 10) || "never"}` : " Key: not on this computer (or written into the apps' settings with --direct)");
1126
1215
  if (key) say(key.account ? ` Account: ${key.account}${key.coupledAt ? `, coupled ${String(key.coupledAt).slice(0, 10)}` : ""}` : " Account: not recorded (coupled by an older version; `npx worktrust connect` records it)");
1127
- let hook = false;
1128
- try { hook = /log-session|worktrust(?:-launch)?\.(?:mjs|py)\\?" hook/.test(readFileSync(join(homedir(), ".claude", "settings.json"), "utf8")); } catch { /* none */ }
1129
- say(hook ? " Session hook: installed" : " Session hook: not installed");
1216
+ say(sessionHookHere() ? " Session hook: installed" : " Session hook: not installed");
1130
1217
  if (existsSync(join(homedir(), ".codex"))) { const notify = codexNotify().text ?? ""; say(isOurNotify(notify) ? " Codex: wakes the session hook" : " Codex: does not wake the session hook (npx worktrust update asks)"); }
1131
1218
  if (existsSync(join(homedir(), ".hermes"))) { let text = ""; try { text = readFileSync(join(homedir(), ".hermes", "config.yaml"), "utf8"); } catch { /* none */ } say(/worktrust(?:-launch)?\.(?:mjs|py)\\?" hook --hermes/.test(text) ? " Hermes Agent: wakes the session hook" : " Hermes Agent: does not wake the session hook (npx worktrust update writes it)"); }
1132
1219
  if (antigravityHere()) say(agyHooks()?.worktrust ? " Antigravity: wakes the session hook" : " Antigravity: does not wake the session hook (npx worktrust update asks)");
@@ -1189,7 +1276,11 @@ function help() {
1189
1276
  say(" --direct put the key in each app's settings instead of the key file");
1190
1277
  say(" worktrust connect couple again, also when this computer is already coupled (asks first)");
1191
1278
  say(" --replace yes in advance to coupling a computer that is already coupled");
1192
- say(" worktrust update this computer onto the newest CLI: same key, no new pairing");
1279
+ say(" worktrust update this computer onto the newest CLI: same key, no new pairing; what you agreed to before is");
1280
+ say(" refreshed without a question, a new AI app or hook is asked about (--yes: skipped)");
1281
+ say(" --rebuild yes in advance to the re-measure update offers after a new version (the plan is still shown)");
1282
+ say(" --codex yes in advance to letting Codex wake the session hook (also for connect)");
1283
+ say(" --antigravity yes in advance to letting Antigravity wake the session hook (also for connect)");
1193
1284
  say(" worktrust history send this computer's earlier sessions as history (asks first)");
1194
1285
  say(" --resume retry saved metadata batches, even if source files are gone (asks first)");
1195
1286
  say(" --retry-review explicitly retry held batches after support resolves their review");