worktrust 0.11.13 → 0.11.14
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 +28 -0
- package/README.md +6 -4
- package/SECURITY.md +6 -0
- package/cli-menu-remote.mjs +4 -3
- package/engine-release.json +1 -1
- package/package-release.json +1 -1
- package/package.json +1 -1
- package/remote-cli.mjs +2 -2
- package/remote-connections.mjs +5 -3
- package/remote-daemon.mjs +43 -2
- package/remote-protocol.mjs +23 -2
- package/remote-settings.mjs +49 -1
- package/worktrust.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
The WorkTrust CLI, newest first. What the tool is and how to use it: [README.md](README.md).
|
|
4
4
|
|
|
5
|
+
## 0.11.14: the phone keeps its link, the link flow asks about browsers and modes, and dictation that hears you
|
|
6
|
+
|
|
7
|
+
**Back in the app, the session carries on.** When the WorkTrust app comes back to the front after you sent a prompt and
|
|
8
|
+
opened another app, Remote Agent now sends it what happened in between: the phone asks for the session's events after the
|
|
9
|
+
last one it holds, and the CLI answers from its own journal on this computer, page by page (at most 200 events and 1 MB
|
|
10
|
+
per page), sealed for that phone alone. Nothing is run for it and nothing new is written; it is answered while remote
|
|
11
|
+
control is paused too, as a status read is. A session this computer never ran is refused, so the phone drops it.
|
|
12
|
+
|
|
13
|
+
**A message you sent just before leaving is no longer stuck at "Delivery unconfirmed".** The app keeps an unconfirmed
|
|
14
|
+
message sealed on the phone and sends it again on its new connection, under its own id. The CLI used to see the new seal
|
|
15
|
+
as a conflict and drop it silently, while the agent was already working on it. It now answers that resend as the
|
|
16
|
+
duplicate it is, with the receipts it already gave, after checking it opens under your phone's signature on this
|
|
17
|
+
channel: nothing runs twice, and another message under the same id is still refused.
|
|
18
|
+
|
|
19
|
+
**Older apps and older CLIs are unaffected.** The phone asks this by a probe of its own first; a CLI before 0.11.14 drops
|
|
20
|
+
the probe and the phone asks it nothing new.
|
|
21
|
+
|
|
22
|
+
**After "✓ Phone linked" and what it may reach, the CLI asks two more things.** "May your confirmed phones add a browser?"
|
|
23
|
+
(what `npx worktrust remote phones allow-endorse on|off` sets) and "Which agent modes may a phone start here?": Manual and
|
|
24
|
+
Plan, + Edit automatically, or + Auto (what `npx worktrust remote modes allow|deny` sets). Each question marks the setting
|
|
25
|
+
as it is now. Both answers are taken first and only then written, through the same door as the typed commands, so Ctrl+C
|
|
26
|
+
or Esc at either question leaves both as they were. Without a terminal, or with `--yes`, nothing is asked and the commands
|
|
27
|
+
are named. `remote access` ends with the same two questions.
|
|
28
|
+
|
|
29
|
+
**Remote Agent › Modes.** The menu's modes row is now called Modes and names the ceiling beside it (Manual, Plan; + Edit;
|
|
30
|
+
+ Auto). `remote phones allow-endorse` writes through the one settings door too; a change from the app or the web can never
|
|
31
|
+
turn it on.
|
|
32
|
+
|
|
5
33
|
## 0.11.13: computer health in Remote Agent, and continue a session on this computer
|
|
6
34
|
|
|
7
35
|
**This computer's health, live on your phone and in the browser.** The Remote Agent service reads memory pressure, free
|
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ computer in WorkTrust under Sources, Devices. More under [Undo](#undo).
|
|
|
67
67
|
On a computer that is not connected yet:
|
|
68
68
|
|
|
69
69
|
```
|
|
70
|
-
WorkTrust CLI 0.11.
|
|
70
|
+
WorkTrust CLI 0.11.14
|
|
71
71
|
Not connected yet
|
|
72
72
|
|
|
73
73
|
> 1 Look at this computer npx worktrust look
|
|
@@ -84,13 +84,13 @@ On a computer that is not connected yet:
|
|
|
84
84
|
Once it is connected (80 columns; on a wide terminal each row's sentence stands on the row itself, as a fourth column):
|
|
85
85
|
|
|
86
86
|
```
|
|
87
|
-
WorkTrust CLI 0.11.
|
|
87
|
+
WorkTrust CLI 0.11.14
|
|
88
88
|
Account you@example.com
|
|
89
89
|
This computer imac · connected since 2026-11-03
|
|
90
90
|
Remote Agent approved, 2 connections
|
|
91
91
|
Sharing session hook on · AI apps on (7) · Remote Agent approved
|
|
92
92
|
|
|
93
|
-
1 Update WorkTrust · up to date (0.11.
|
|
93
|
+
1 Update WorkTrust · up to date (0.11.14) npx worktrust update
|
|
94
94
|
> 2 Check this computer npx worktrust
|
|
95
95
|
3 Remote Agent › npx worktrust remote …
|
|
96
96
|
4 Import earlier history › npx worktrust history …
|
|
@@ -193,7 +193,9 @@ whole.
|
|
|
193
193
|
grant an "always allow". Those are decided at this keyboard or not at all.
|
|
194
194
|
|
|
195
195
|
**Modes with a ceiling.** Manual and Plan are always there. Edit automatically and Auto exist only once you allow them
|
|
196
|
-
here with `remote modes allow
|
|
196
|
+
here with `remote modes allow`, in the menu under Remote Agent › Modes, or when a phone links: after what it may reach,
|
|
197
|
+
the CLI asks which modes a phone may start and whether your confirmed phones may add a browser (Ctrl+C or Esc changes
|
|
198
|
+
neither). The computer refuses a mode above what you allowed.
|
|
197
199
|
|
|
198
200
|
**Sealed end to end.** The computer holds one outbound connection and opens no port. Messages are sealed between your
|
|
199
201
|
phone and this computer; the relay passes them on and cannot read a prompt, a file, a path, an output or a model name.
|
package/SECURITY.md
CHANGED
|
@@ -256,6 +256,12 @@ What it is: standing remote execution of AI agents on this computer, steered fro
|
|
|
256
256
|
under keys from an authenticated X25519 handshake). The gateway sees ids, message types, times and size classes.
|
|
257
257
|
- At most once. Every command is written to `~/.worktrust/remote/journal.jsonl` and flushed to disk before an agent runs; a
|
|
258
258
|
repeat is answered from the journal, and a command an interrupted daemon left mid-way is closed as failed, never run again.
|
|
259
|
+
Since 0.11.14 a phone's own resend sealed again on a new connection (same id, same idempotency key, and it opens under
|
|
260
|
+
that phone's signature) is answered with the stored receipts and never run again; anything else under a stored id is
|
|
261
|
+
refused as a conflict.
|
|
262
|
+
- Catch-up (0.11.14). A linked phone may ask for a session's journaled events after a sequence it holds; the daemon re-seals
|
|
263
|
+
at most 200 events or 1 MB per page for that phone alone, runs nothing and writes nothing. It is the same sealed traffic
|
|
264
|
+
the phone received live; the gateway sees only the message type and sizes.
|
|
259
265
|
- Approvals are classified on this computer. Only project edits, the reviewed test, build and lint commands, and outward
|
|
260
266
|
messages shown whole can be approved from a phone, each by a signed decision bound to the exact action, single use,
|
|
261
267
|
five minutes at most; offline or no answer is a denial. Claude Code also gets deny rules for pushes, installs, deploys
|
package/cli-menu-remote.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { choose, muted, remoteState, runShown, typed } from "./cli-menu.mjs";
|
|
|
13
13
|
import { makeProjectsFolder, pickFolder, pickerCommand, suggestedFolders } from "./folder-picker.mjs";
|
|
14
14
|
import { awaitingName, awaitingRow, connections } from "./remote-connections.mjs";
|
|
15
15
|
import { loadIdentity, loadProjects, loadRoots, loadSettings } from "./remote-store.mjs";
|
|
16
|
-
import { allowedModes } from "./remote-settings.mjs";
|
|
16
|
+
import { allowedModes, ceilingOf } from "./remote-settings.mjs";
|
|
17
17
|
import { HEALTH_REFUSAL, keptHealth } from "./remote-health.mjs";
|
|
18
18
|
|
|
19
19
|
const BACK = { label: "← Back", hint: "Esc", back: true }; // its name and its key say it: no sentence of its own (owner, 2026-11-14)
|
|
@@ -163,7 +163,7 @@ export function approval() { try { return Boolean(loadIdentity()); } catch { ret
|
|
|
163
163
|
* `approved` is approval()'s answer, `act` what each row does. NOT APPROVED: the approval is first and chosen, and what
|
|
164
164
|
* cannot work before it cannot be chosen. By the code: `remote pair` and adding a project or a root refuse without this
|
|
165
165
|
* computer's remote keys (remote-cli.mjs needPaired, remote-settings.mjs applyRules), and no phone can be linked, so there
|
|
166
|
-
* is no connection to list and nothing to pause.
|
|
166
|
+
* is no connection to list and nothing to pause. Modes is a local setting and Status only reads: both stay.
|
|
167
167
|
* APPROVED: Link a phone first, and approving again stays (new keys). NOT KNOWN: every row can be chosen and the title says so.
|
|
168
168
|
*
|
|
169
169
|
* PART OF PREMIUM (owner, 2026-11-14; docs/remote-agents/ISSUER.md §12): when WorkTrust itself answered `premium_required`
|
|
@@ -183,7 +183,7 @@ export function remoteItems(approved, paused, act = {}, access = null) {
|
|
|
183
183
|
...(approved ? [link, approve] : [approve, link]),
|
|
184
184
|
{ label: "Projects ›", hint: "npx worktrust remote projects", info: "Folders a phone may steer an agent in.", run: act.projects, ...wait },
|
|
185
185
|
{ label: "Roots for new projects ›", hint: "npx worktrust remote roots", info: "Where a phone may open and create projects.", run: act.roots, ...wait },
|
|
186
|
-
{ label: "
|
|
186
|
+
{ label: "Modes ›", hint: "npx worktrust remote modes", info: "Agent modes a phone may start. This computer is the limit.", run: act.modes, ...(act.modesNote ? { note: { text: act.modesNote, tone: "dim" } } : {}) },
|
|
187
187
|
{ label: "Connections ›", hint: "npx worktrust remote connections", info: "Phones and browsers linked here.", run: act.connections, ...wait },
|
|
188
188
|
{ label: paused ? "Resume" : "Pause", hint: `npx worktrust remote ${paused ? "resume" : "pause"}`, info: paused ? "Lets linked phones steer agents here again." : "Stops every phone until you resume. Links stay.", run: act.pause, ...wait },
|
|
189
189
|
{ label: "Status", hint: "npx worktrust remote status", info: "Shows if Remote Agent is on and what is linked. Only reads.", run: act.status },
|
|
@@ -224,6 +224,7 @@ export async function remoteMenu(term, io, header) {
|
|
|
224
224
|
], io),
|
|
225
225
|
link: () => runShown(term, io, ["remote", "pair"]),
|
|
226
226
|
projects: () => projectsMenu(term, io, header), roots: () => rootsMenu(term, io, header), modes: () => modesMenu(term, io, header), connections: () => connectionsMenu(term, io, header),
|
|
227
|
+
modesNote: (() => { try { return { plan: "Manual, Plan", edit: "+ Edit", auto: "+ Auto" }[ceilingOf(allowedModes(loadSettings()))]; } catch { return null; } })(), // 0.11.14: the ceiling in a word
|
|
227
228
|
pause: () => runShown(term, io, ["remote", paused ? "resume" : "pause"]),
|
|
228
229
|
status: () => runShown(term, io, ["remote", "status"]),
|
|
229
230
|
upgrade: () => showUpgrade(term, io, state?.upgrade ?? null), upgradeHint: state?.upgrade ? String(state.upgrade).replace(/^https?:\/\//, "") : undefined,
|
package/engine-release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","cli-colour.mjs":"9736ab0801b3889967134a916680acb9dc3d614db6fd221be9c5ae7079d9d173","cli-look.mjs":"1c8eea30fa57dbdbf260e5e45f017a9ca85c77bd511569f931bfd80c8cdb648a","cli-menu-remote.mjs":"
|
|
1
|
+
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","cli-colour.mjs":"9736ab0801b3889967134a916680acb9dc3d614db6fd221be9c5ae7079d9d173","cli-look.mjs":"1c8eea30fa57dbdbf260e5e45f017a9ca85c77bd511569f931bfd80c8cdb648a","cli-menu-remote.mjs":"f8a8ad8407680d9af8b95fc434096ee1fc3624e4e2e36eeb4460fe6ab76bf8d4","cli-menu.mjs":"f6eb43e71c8c941c79736f5073c393d3a349077a2a21af5cd75687b24731178b","cli-stop.mjs":"34f63fb7d27723d52650475582c3b8d36aa57e37457ebf55ab24449743df9847","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-decoy.mjs":"8b9a264a3739fb9f58f8b9102b93a14292962689c8557ff7fad332dcfac3f7d9","credential-store.mjs":"8a83e7086fadaba31b0923101851d348d67cf3c87610f6d3e73a774f64435392","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","folder-picker.mjs":"daeb379626d5716f91f588064c6b4083618279320c006c177960cc93f056d96a","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"171f4abb0d603d58446129e007de9e9dc0f707bde33b1b4481a134376ed301c8","node-guide.mjs":"5bf52c5028b07a80ec4d41be365eb025dfce74328f41f928a26ce6737b1f9cc4","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":"cd111cae0f53a25a2d878a158479abfb1ace353361454843f91a16d241101d46","project-modes.mjs":"ada26e68297fbeb90e4e91d75a90fd2d7cc107b999a9702840675b5a7529463e","remote-adapter-claude-code.mjs":"d0558bb123a29a934db1bf8162e7c3f37e8ccde4c502178d47e9b4cbb3a0491b","remote-adapter-codex.mjs":"0370611044e6f5f6ef3ca370e0f6ef237468f01ecc890b019da8167730eb75eb","remote-adapter-opencode.mjs":"062c571cc4ab972412044066c236a9f20794cfb841c66cc9c0e9e5ec1133699e","remote-adapter-terminal.mjs":"c047a362474abb90b7968b8a624358af40a989ad137166a03bc955409ff1dc82","remote-admin.mjs":"ac4d434c0a374159b27accac3fdd0324ff96ffe32227fba054cc62d00e58d35b","remote-agent-switch.mjs":"7ff5448f29f05a47d7298d730b21243a1bcf8a215b434a0c7fbf5f3cb0889041","remote-approval-bridge.mjs":"092f17b7969e4f35bea064315d04dcde1faa6a3fd3e737dcc05aece82c7a37c4","remote-approvals.mjs":"63847226e398f9eb5b8d3989ba2b2436fbedd898385eb5f2f63bbdf07fbe6852","remote-attachments.mjs":"2e9c1277329a45cf26c0c62abda632cf0ab9fad78d0504416ecee9805220e16c","remote-cdp.mjs":"70e333a1ebe845e872cc3a703a0a507391f8ce59640bdbd662bdad55eeff216b","remote-changes.mjs":"2141fece4961a5bc1bb1b046f78222812617457b1ba6452275eac6a897e62e19","remote-claude-events.mjs":"58822471203c6a1b66cf81c115c4d713657c3dea5c7b98df959f894ee5b2e704","remote-claude-progress.mjs":"2ca626d3dbc16d8d570abe1df6477b7e44ffb43c1d9145228ec5ea1928e415ca","remote-cli.mjs":"07c03d66dcee3a52ce30265dd2ed73cf5829e37dd965e743ed42cc1c992ea2ce","remote-coalesce.mjs":"cb0967d9cfe81e3892bcade8349d6814db98be8c2adbdb54df0b8d1b142f65d1","remote-codex-events.mjs":"58657d6070a50c837737cb85f5a1eaf9c2cbc4e1adfe3e970748ab3b2af94631","remote-connections.mjs":"7178bbad6f04c59a32d0a68472c50145c65c041d94cb5c3c8a60925da78c8cfb","remote-countdown.mjs":"b1020c59fcae3cbf6c355976b2a5ef80a3476ffadcd9949e8e884bedfd1efa06","remote-daemon.mjs":"629b5f87fce9cecf14b80dfb9c85e46af0052ac5e67e41dc5b9d56fc8b58a1bb","remote-desk-sessions.mjs":"3a342e525fdf43ba54b40576f84a2399baa0c03c54f9184bfc153242fb50e4a3","remote-endorse.mjs":"89eda4883567176703e01e44d83e987271bc2a6134e108f517b3b213719a21f9","remote-health.mjs":"0f37d08f97fc6e08c69792cf3d22201b3103a28bdb19613b5abb02b80eb91983","remote-inventory.mjs":"98a65a066772ef183f405a1455c02db6827f06e80ed601796c65c19f9be10f09","remote-journal.mjs":"907ebd48c53162b22dc743ef95b53c1a6be6886a7495605b5cfa820b8de9d330","remote-live-preview.mjs":"faa70f9260ac05037204c2a0c3facf4ffe42f68408948390b341b453a2932289","remote-opencode-events.mjs":"3108375501ead2c2c78bce1435cc2a9fe6d2af1d7ff1fb42e12ff3e0f5d9af9c","remote-opencode-session.mjs":"681b201d833a7d7d025122b3a79663bcdc0a989aefd39d8018a28113d8810caf","remote-pairing.mjs":"b27625cc3b5313091252bc8ae907b4b969b96be0fe8c2ee3e9000c767ea60175","remote-pipeline-config.mjs":"00cde6a61ce21144c51ac56fce42fee159aa9dba6586218a7ea790ce4a6bd40b","remote-pipeline-parsers.mjs":"43ca0d332d7bc883c4759a754a555815ae5dfe133446b91ba9f2e48a350fa20f","remote-pipeline.mjs":"b856ead989b29ddb618ef69bbacd104bae2b02c9d1c5214291d08ce469a8b24e","remote-policy.mjs":"16ea015ad5de3c357bce730ea8ea98571dc981d8591fb5156b1941b2c557a381","remote-preview.mjs":"fe504ad6f83dcb4a4ebdcc018686a9a5a900c47cdf8c45b75e7d02e2f3056155","remote-projects.mjs":"ec8c530ad3e880bca21a4d4078ecd68b6aaafcc442b50087127868d952034d5f","remote-protocol.mjs":"5b9e2f98e6f34bbe974c668e045f45c5eaad790a3f0763f01eb381c6ef9e10a2","remote-qr.mjs":"a0f4044f0afe8a636be14cf5afe10f53404b57262c23fea37f8cf30b6d0a5220","remote-release-plans.mjs":"11884a62b7d6dcccb5e154a26603bdf650f7b40f946329fb174d8c13729bec74","remote-releases.mjs":"fb08b72593ea00013c8b679e0c0d7dee95b0fd7cc5fd31b80ac575d0e340927d","remote-run.mjs":"7bdb3aa1327dd64ce79bd3038ad844ba32ccf9c82eb436116f437d3a48e4e871","remote-screen-approvals.mjs":"c43ab286d36a38d17639d155782ffa017f1a9b6806a09b82ed0142a1290b6000","remote-screen-push.mjs":"4ee8bd48d24b2c87581e9f33d8354a86381f7febd82f89ed509a7a87c1442608","remote-screen-states.mjs":"7c3c86a584bebf52461f3cab39c05ea2a13910061704d48fc622956e842940f7","remote-service.mjs":"a3a5502e0f6f43b04e37ee778f43d88f4c219776439cfed0d8fa0b511e0c9637","remote-session-list.mjs":"494fdbe20f0542806ac6c42ad149c52e2d3ace23a3a7567f96dc7e80d092c727","remote-sessions.mjs":"b4028b4247245013e9c2e4451f8dbb0ebff531066b78a4ea62499985464a4c43","remote-settings.mjs":"4bf5b9ded17332a6fd11ea326476b7e8595aa010eb6c449520469c35a231441b","remote-steered.mjs":"d7afde92c62c87abbdb84b0cfea2eea4752e90a2e453e52a54812c4fe0395190","remote-steering.mjs":"593447f3b7abbf3b91237d6d8a1aebcce9fbddc5ea5874341241ee45d83e5196","remote-store.mjs":"592a87f0ab8f53cc8eee1318a309310e27cb01d4549caebad6d51c3fad1b75ac","remote-terminal-cli.mjs":"82a048b75e412d0b6db076afbb84cab7c754dec72b6c8b6af4d4906b38e988a7","remote-terminal-sessions.mjs":"51b8140d46962eb035ff4ae60e5afea3c83244ea824412ca20e74a8318bbc3a5","remote-transport.mjs":"68650fd77ea09b5762377f87cabdc1c73a34d77324aa5bf0cd9742094a50c32b","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","self-update.mjs":"378e3620d48c72cf0bf812be408883b995cdb2223de34a20f762dd73eeffb258","session-databases.mjs":"a16ffbc50ccc0e78f370ebe07f871d1a80f1977472e478e3599e7abfdc90c1b7","session-local-models.mjs":"bacd38ff8dd3056b552982ec52eb57c7b8ca86e1a46cd4cba30fc340e3e28fd4","session-readers.mjs":"14cbd2c92d87511b396feaa54710f00d5e3929b55e01dc559f39c5def13777a2","setup-mcp.mjs":"b732e3dd9b3e522b7cc8acf167ce28ba8f1a8dee797ee15bd7c3b02919b13e6f","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5f5667b92adf11b1a5a6330a0f26dd6db73d56fe60823d9a5246dab71d27d380","transcript-readers.mjs":"3dfdd9d2189063f24dbd5c2abec6bb21e2bb36f22b89d0d84282e12216022670","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"0c50a284db3ca1890958fd70e639a9c4b3cc1acbc3ce57a3b6c45ce023d6335e"},"format":"worktrust-package/1","kind":"engine","version":"0.11.14"},"signature":"YzdsauUThGlNqMrRrJMBXj1fikmJmZOABC2Xbnibl-pU3RJDuE9_FFzNPwuPZsLgypbNjIJ-vKSo9_TxFFqoBg"}
|
package/package-release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"e8abb38c293b57b71d3a6163d6242d1f375e773372b91b6d8ce39c584c51262a","CHANGELOG.md":"
|
|
1
|
+
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"e8abb38c293b57b71d3a6163d6242d1f375e773372b91b6d8ce39c584c51262a","CHANGELOG.md":"4642551fbb5992970ae7b99e5978b08a1085423a68ffa97f0ac14a09e4cb37b1","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"eb210c9cab5dbb6a2c293a003a7604e7fb6e5f7b95ab22b382171dc7adeed41a","README.md":"b0ee9b8bf08f15b3521e47e1af664d6bd9a9fe4bd7e7e747d1aa5d9df3c3c3f4","SECURITY.md":"9c7c73b6eca30884bb175967a0daa49ab804d214b4073ff645d7d51444407252","chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","cli-colour.mjs":"9736ab0801b3889967134a916680acb9dc3d614db6fd221be9c5ae7079d9d173","cli-look.mjs":"1c8eea30fa57dbdbf260e5e45f017a9ca85c77bd511569f931bfd80c8cdb648a","cli-menu-remote.mjs":"f8a8ad8407680d9af8b95fc434096ee1fc3624e4e2e36eeb4460fe6ab76bf8d4","cli-menu.mjs":"f6eb43e71c8c941c79736f5073c393d3a349077a2a21af5cd75687b24731178b","cli-stop.mjs":"34f63fb7d27723d52650475582c3b8d36aa57e37457ebf55ab24449743df9847","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-decoy.mjs":"8b9a264a3739fb9f58f8b9102b93a14292962689c8557ff7fad332dcfac3f7d9","credential-store.mjs":"8a83e7086fadaba31b0923101851d348d67cf3c87610f6d3e73a774f64435392","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","engine-release.json":"ac2c74e44ee0541c5215427f8d048415f87779665a8353ee330b9a8d778ede4c","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","folder-picker.mjs":"daeb379626d5716f91f588064c6b4083618279320c006c177960cc93f056d96a","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"171f4abb0d603d58446129e007de9e9dc0f707bde33b1b4481a134376ed301c8","node-guide.mjs":"5bf52c5028b07a80ec4d41be365eb025dfce74328f41f928a26ce6737b1f9cc4","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","package.json":"0034198c6a5a36d428acb2c8e4e4af6581d20516f2a3a16889f8beeed401b49e","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"cd111cae0f53a25a2d878a158479abfb1ace353361454843f91a16d241101d46","project-modes.mjs":"ada26e68297fbeb90e4e91d75a90fd2d7cc107b999a9702840675b5a7529463e","remote-adapter-claude-code.mjs":"d0558bb123a29a934db1bf8162e7c3f37e8ccde4c502178d47e9b4cbb3a0491b","remote-adapter-codex.mjs":"0370611044e6f5f6ef3ca370e0f6ef237468f01ecc890b019da8167730eb75eb","remote-adapter-opencode.mjs":"062c571cc4ab972412044066c236a9f20794cfb841c66cc9c0e9e5ec1133699e","remote-adapter-terminal.mjs":"c047a362474abb90b7968b8a624358af40a989ad137166a03bc955409ff1dc82","remote-admin.mjs":"ac4d434c0a374159b27accac3fdd0324ff96ffe32227fba054cc62d00e58d35b","remote-agent-switch.mjs":"7ff5448f29f05a47d7298d730b21243a1bcf8a215b434a0c7fbf5f3cb0889041","remote-approval-bridge.mjs":"092f17b7969e4f35bea064315d04dcde1faa6a3fd3e737dcc05aece82c7a37c4","remote-approvals.mjs":"63847226e398f9eb5b8d3989ba2b2436fbedd898385eb5f2f63bbdf07fbe6852","remote-attachments.mjs":"2e9c1277329a45cf26c0c62abda632cf0ab9fad78d0504416ecee9805220e16c","remote-cdp.mjs":"70e333a1ebe845e872cc3a703a0a507391f8ce59640bdbd662bdad55eeff216b","remote-changes.mjs":"2141fece4961a5bc1bb1b046f78222812617457b1ba6452275eac6a897e62e19","remote-claude-events.mjs":"58822471203c6a1b66cf81c115c4d713657c3dea5c7b98df959f894ee5b2e704","remote-claude-progress.mjs":"2ca626d3dbc16d8d570abe1df6477b7e44ffb43c1d9145228ec5ea1928e415ca","remote-cli.mjs":"07c03d66dcee3a52ce30265dd2ed73cf5829e37dd965e743ed42cc1c992ea2ce","remote-coalesce.mjs":"cb0967d9cfe81e3892bcade8349d6814db98be8c2adbdb54df0b8d1b142f65d1","remote-codex-events.mjs":"58657d6070a50c837737cb85f5a1eaf9c2cbc4e1adfe3e970748ab3b2af94631","remote-connections.mjs":"7178bbad6f04c59a32d0a68472c50145c65c041d94cb5c3c8a60925da78c8cfb","remote-countdown.mjs":"b1020c59fcae3cbf6c355976b2a5ef80a3476ffadcd9949e8e884bedfd1efa06","remote-daemon.mjs":"629b5f87fce9cecf14b80dfb9c85e46af0052ac5e67e41dc5b9d56fc8b58a1bb","remote-desk-sessions.mjs":"3a342e525fdf43ba54b40576f84a2399baa0c03c54f9184bfc153242fb50e4a3","remote-endorse.mjs":"89eda4883567176703e01e44d83e987271bc2a6134e108f517b3b213719a21f9","remote-health.mjs":"0f37d08f97fc6e08c69792cf3d22201b3103a28bdb19613b5abb02b80eb91983","remote-inventory.mjs":"98a65a066772ef183f405a1455c02db6827f06e80ed601796c65c19f9be10f09","remote-journal.mjs":"907ebd48c53162b22dc743ef95b53c1a6be6886a7495605b5cfa820b8de9d330","remote-live-preview.mjs":"faa70f9260ac05037204c2a0c3facf4ffe42f68408948390b341b453a2932289","remote-opencode-events.mjs":"3108375501ead2c2c78bce1435cc2a9fe6d2af1d7ff1fb42e12ff3e0f5d9af9c","remote-opencode-session.mjs":"681b201d833a7d7d025122b3a79663bcdc0a989aefd39d8018a28113d8810caf","remote-pairing.mjs":"b27625cc3b5313091252bc8ae907b4b969b96be0fe8c2ee3e9000c767ea60175","remote-pipeline-config.mjs":"00cde6a61ce21144c51ac56fce42fee159aa9dba6586218a7ea790ce4a6bd40b","remote-pipeline-parsers.mjs":"43ca0d332d7bc883c4759a754a555815ae5dfe133446b91ba9f2e48a350fa20f","remote-pipeline.mjs":"b856ead989b29ddb618ef69bbacd104bae2b02c9d1c5214291d08ce469a8b24e","remote-policy.mjs":"16ea015ad5de3c357bce730ea8ea98571dc981d8591fb5156b1941b2c557a381","remote-preview.mjs":"fe504ad6f83dcb4a4ebdcc018686a9a5a900c47cdf8c45b75e7d02e2f3056155","remote-projects.mjs":"ec8c530ad3e880bca21a4d4078ecd68b6aaafcc442b50087127868d952034d5f","remote-protocol.mjs":"5b9e2f98e6f34bbe974c668e045f45c5eaad790a3f0763f01eb381c6ef9e10a2","remote-qr.mjs":"a0f4044f0afe8a636be14cf5afe10f53404b57262c23fea37f8cf30b6d0a5220","remote-release-plans.mjs":"11884a62b7d6dcccb5e154a26603bdf650f7b40f946329fb174d8c13729bec74","remote-releases.mjs":"fb08b72593ea00013c8b679e0c0d7dee95b0fd7cc5fd31b80ac575d0e340927d","remote-run.mjs":"7bdb3aa1327dd64ce79bd3038ad844ba32ccf9c82eb436116f437d3a48e4e871","remote-screen-approvals.mjs":"c43ab286d36a38d17639d155782ffa017f1a9b6806a09b82ed0142a1290b6000","remote-screen-push.mjs":"4ee8bd48d24b2c87581e9f33d8354a86381f7febd82f89ed509a7a87c1442608","remote-screen-states.mjs":"7c3c86a584bebf52461f3cab39c05ea2a13910061704d48fc622956e842940f7","remote-service.mjs":"a3a5502e0f6f43b04e37ee778f43d88f4c219776439cfed0d8fa0b511e0c9637","remote-session-list.mjs":"494fdbe20f0542806ac6c42ad149c52e2d3ace23a3a7567f96dc7e80d092c727","remote-sessions.mjs":"b4028b4247245013e9c2e4451f8dbb0ebff531066b78a4ea62499985464a4c43","remote-settings.mjs":"4bf5b9ded17332a6fd11ea326476b7e8595aa010eb6c449520469c35a231441b","remote-steered.mjs":"d7afde92c62c87abbdb84b0cfea2eea4752e90a2e453e52a54812c4fe0395190","remote-steering.mjs":"593447f3b7abbf3b91237d6d8a1aebcce9fbddc5ea5874341241ee45d83e5196","remote-store.mjs":"592a87f0ab8f53cc8eee1318a309310e27cb01d4549caebad6d51c3fad1b75ac","remote-terminal-cli.mjs":"82a048b75e412d0b6db076afbb84cab7c754dec72b6c8b6af4d4906b38e988a7","remote-terminal-sessions.mjs":"51b8140d46962eb035ff4ae60e5afea3c83244ea824412ca20e74a8318bbc3a5","remote-transport.mjs":"68650fd77ea09b5762377f87cabdc1c73a34d77324aa5bf0cd9742094a50c32b","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","self-update.mjs":"378e3620d48c72cf0bf812be408883b995cdb2223de34a20f762dd73eeffb258","session-databases.mjs":"a16ffbc50ccc0e78f370ebe07f871d1a80f1977472e478e3599e7abfdc90c1b7","session-local-models.mjs":"bacd38ff8dd3056b552982ec52eb57c7b8ca86e1a46cd4cba30fc340e3e28fd4","session-readers.mjs":"14cbd2c92d87511b396feaa54710f00d5e3929b55e01dc559f39c5def13777a2","setup-mcp.mjs":"b732e3dd9b3e522b7cc8acf167ce28ba8f1a8dee797ee15bd7c3b02919b13e6f","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5f5667b92adf11b1a5a6330a0f26dd6db73d56fe60823d9a5246dab71d27d380","transcript-readers.mjs":"3dfdd9d2189063f24dbd5c2abec6bb21e2bb36f22b89d0d84282e12216022670","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"0c50a284db3ca1890958fd70e639a9c4b3cc1acbc3ce57a3b6c45ce023d6335e"},"format":"worktrust-package/1","kind":"npm","version":"0.11.14"},"signature":"3yaMKKdP54D1XqziI9ZuQYPZ23eWptlmRayQQOXE9Gm5ufkoX3_TKu975GItEHnQszH9iOHC9YXlRjvJGpt2Cg"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrust",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.14",
|
|
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/remote-cli.mjs
CHANGED
|
@@ -174,8 +174,8 @@ async function phones(io, rest) {
|
|
|
174
174
|
if (rest[1] !== "on" && rest[1] !== "off") io.fail("npx worktrust remote phones allow-endorse on|off");
|
|
175
175
|
if (rest[1] === "on" && !process.stdin.isTTY) io.fail("endorsements are allowed at this keyboard, in a terminal");
|
|
176
176
|
if (rest[1] === "on" && !(await askTyped(" A phone confirmed here may then add a browser it scanned as a controller of this computer. Allow it?"))) { io.say(" Not changed."); return; }
|
|
177
|
-
|
|
178
|
-
io.say(
|
|
177
|
+
const done = applySettingsChange({ what: "endorse", on: rest[1] === "on" }, { kind: "keyboard" }); // the one door (remote-settings.mjs)
|
|
178
|
+
io.say(` ✓ ${done.message}`);
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
if (rest[0] === "remove" && (rest[1] === "--all" || io.has("all"))) { // EVERY DEVICE OFF, FROM THE SOURCE (owner, 2026-11-09): the daemon reads this list per message
|
package/remote-connections.mjs
CHANGED
|
@@ -285,11 +285,13 @@ export function awaitingAccess(phones = loadPhones(), roots = loadRoots(), proje
|
|
|
285
285
|
return connections({ ...phones, pending: [] }).find((c) => c.device_id === newest.device_id) ?? null;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
/** The access step in this terminal
|
|
288
|
+
/** The access step in this terminal (interactive only with a terminal on both ends and no --yes), then the 0.11.14 questions. */
|
|
289
289
|
export async function reachStep(io, apply) {
|
|
290
290
|
const interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY) && !io.has?.("yes");
|
|
291
|
-
const menu = interactive ? await import("./cli-menu.mjs") : null;
|
|
292
|
-
|
|
291
|
+
const menu = interactive ? await import("./cli-menu.mjs") : null, term = menu?.createTerminal() ?? null;
|
|
292
|
+
const reach = await accessStep(io, { apply, interactive, term, choose: menu?.choose ?? null });
|
|
293
|
+
await (await import("./remote-settings.mjs")).trustStep(io, { apply, interactive, term, choose: menu?.choose ?? null }); // may phones add a browser; the modes
|
|
294
|
+
return reach;
|
|
293
295
|
}
|
|
294
296
|
|
|
295
297
|
/** `remote access`: the newest linked phone, then the same step. */
|
package/remote-daemon.mjs
CHANGED
|
@@ -48,9 +48,10 @@ export function createDaemonCore(o) {
|
|
|
48
48
|
: extendedPeers.has(channel.peer_device_id) ? (switchPeers.has(channel.peer_device_id) ? record.body : withoutSwitch(record.body))
|
|
49
49
|
: Object.fromEntries(Object.entries(record.body).filter(([key]) => !EXTENDED_KEYS.includes(key))));
|
|
50
50
|
|
|
51
|
-
function sealAll(record) {
|
|
51
|
+
function sealAll(record, only = null) { // `only`: one phone's channel (a catch-up page is for the phone that asked)
|
|
52
52
|
for (const [id, channel] of channels) {
|
|
53
53
|
if (!confirmed().has(channel.peer_fingerprint)) { channels.delete(id); continue; } // a revoked phone hears nothing
|
|
54
|
+
if (only !== null && channel.peer_device_id !== only) continue;
|
|
54
55
|
const draft = { protocol_version: channel.protocol_version, session_id: record.session_id, device_id: self, event_seq: record.event_seq, type: record.type, occurred_at: record.occurred_at, command_id: record.command_id, notify: record.notify, ...(record.lane ? { lane: record.lane } : {}) };
|
|
55
56
|
const sealed = P.sealEvent(channel, draft, bodyFor(channel, record), o.random);
|
|
56
57
|
if (!sealed.ok) { o.log("seal_refused", { type: record.type, code: sealed.code }); continue; }
|
|
@@ -88,6 +89,27 @@ export function createDaemonCore(o) {
|
|
|
88
89
|
/** Re-seal what the journal holds for a session after `after` (session.attach): same event_seq, so the phone dedups. */
|
|
89
90
|
const replay = (sessionId, after) => { for (const record of o.journal.eventsAfter(sessionId, after)) sealAll(record); };
|
|
90
91
|
|
|
92
|
+
/**
|
|
93
|
+
* THE CATCH-UP (release 37, CLI 0.11.14; PROTOCOL.md §Catch-up): session.attach with `after`, `max_events` and `max_bytes`
|
|
94
|
+
* re-seals, for the asking phone alone, the journaled events after `after`, in order, at most max_events of them and
|
|
95
|
+
* at most max_bytes of their canonical records (one always, so every page moves; both capped by the protocol's own
|
|
96
|
+
* bounds whatever was asked). A session this computer never ran or journaled is `not_found`. Reading only: it runs no
|
|
97
|
+
* agent, writes no event of its own, and is answered while the computer is paused, like status.get.
|
|
98
|
+
*/
|
|
99
|
+
function catchUp(sessionId, payload, phone) {
|
|
100
|
+
if (!sessions?.get?.(sessionId) && !o.journal.session(sessionId)) return "not_found";
|
|
101
|
+
const most = Math.min(payload.max_events, P.CATCH_UP_MAX_EVENTS), room = Math.min(payload.max_bytes, P.CATCH_UP_MAX_BYTES);
|
|
102
|
+
let sent = 0, bytes = 0;
|
|
103
|
+
for (const record of o.journal.eventsAfter(sessionId, payload.after)) {
|
|
104
|
+
const weight = P.canonicalJson(record).length;
|
|
105
|
+
if (sent >= most || (sent > 0 && bytes + weight > room)) break;
|
|
106
|
+
sealAll(record, phone);
|
|
107
|
+
sent += 1; bytes += weight;
|
|
108
|
+
}
|
|
109
|
+
o.log("catch_up", { sent });
|
|
110
|
+
return "taken";
|
|
111
|
+
}
|
|
112
|
+
|
|
91
113
|
function inventoryBody(refresh) {
|
|
92
114
|
const settings = loadSettings();
|
|
93
115
|
const inv = o.inventory(refresh);
|
|
@@ -123,6 +145,24 @@ export function createDaemonCore(o) {
|
|
|
123
145
|
else if (P.DELIVERY_RANK[entry.state] >= P.DELIVERY_RANK.AGENT_ACCEPTED) emit(meta.session_id ?? null, "command.agent_accepted", {}, entry.command_id);
|
|
124
146
|
}
|
|
125
147
|
|
|
148
|
+
/**
|
|
149
|
+
* THE PHONE'S OWN RESEND UNDER A NEW SEAL (release 37). A phone that was away comes back on a new channel and sends a
|
|
150
|
+
* message it kept, unconfirmed, sealed again under its OWN id and idempotency key (remote-client outbox-store.ts): other
|
|
151
|
+
* bytes, so the ledger calls it a conflict, and dropping it left the phone at "Delivery unconfirmed" for ever while the
|
|
152
|
+
* agent ran. Same id, same key, same sender, and it OPENS (the phone's signature, this channel): it is that duplicate,
|
|
153
|
+
* answered with the stored receipts again. It is never admitted and never dispatched, so nothing runs twice; anything
|
|
154
|
+
* else under a stored id stays a conflict and is dropped, as before.
|
|
155
|
+
*/
|
|
156
|
+
function resealed(channel, envelope, input) {
|
|
157
|
+
const entry = o.journal.entry(envelope.command_id);
|
|
158
|
+
const same = entry !== null && entry.idempotency_key === input.idempotency_key && entry.sender_device_id === input.sender_device_id;
|
|
159
|
+
const opened = same ? P.openCommand(channel, envelope, o.now()) : null;
|
|
160
|
+
if (!opened || (!opened.ok && opened.code !== "expired")) return o.log("command_dropped", { code: "conflict", command_id: envelope.command_id });
|
|
161
|
+
if (opened.ok) { channels.set(channel.channel_id, opened.value.channel); persist(); }
|
|
162
|
+
o.log("command_resealed", { command_id: envelope.command_id });
|
|
163
|
+
return resendReceipts(entry);
|
|
164
|
+
}
|
|
165
|
+
|
|
126
166
|
function reject(env, reason) {
|
|
127
167
|
o.journal.advance(env.command_id, { kind: "device_rejected", expired: reason === "expired" }, o.now(), reason);
|
|
128
168
|
emit(env.session_id, "command.rejected", { reason }, env.command_id);
|
|
@@ -186,6 +226,7 @@ export function createDaemonCore(o) {
|
|
|
186
226
|
async function dispatch(env, payload) {
|
|
187
227
|
const settings = loadSettings();
|
|
188
228
|
if (!settings.enabled) return "remote_paused";
|
|
229
|
+
if (env.type === "session.attach" && payload.after !== undefined) return catchUp(env.session_id, payload, env.sender_device_id); // reading, also while paused
|
|
189
230
|
if (settings.paused !== null && !DEVICE_COMMANDS.has(env.type)) return "remote_paused";
|
|
190
231
|
if (env.type === "inventory.get") {
|
|
191
232
|
if (payload.extended === true && env.sender_device_id) extendedPeers.add(env.sender_device_id);
|
|
@@ -236,7 +277,7 @@ export function createDaemonCore(o) {
|
|
|
236
277
|
if (!confirmed().has(channel.peer_fingerprint)) { channels.delete(channel.channel_id); persist(); return o.log("command_dropped", { code: "not_confirmed" }); }
|
|
237
278
|
const input = { command_id: envelope.command_id, idempotency_key: envelope.idempotency_key, sender_device_id: envelope.sender_device_id, digest: P.envelopeDigest(envelope) };
|
|
238
279
|
const found = o.journal.find(input);
|
|
239
|
-
if (found === "conflict") return
|
|
280
|
+
if (found === "conflict") return resealed(channel, envelope, input);
|
|
240
281
|
if (found !== "unknown") return resendReceipts(found.duplicate);
|
|
241
282
|
const opened = P.openCommand(channel, envelope, o.now());
|
|
242
283
|
if (!opened.ok && opened.code !== "expired") return o.log("command_dropped", { code: opened.code, command_id: envelope.command_id });
|
package/remote-protocol.mjs
CHANGED
|
@@ -2508,6 +2508,9 @@ export const projectNameOk = (name ) => typeof name === "string
|
|
|
2508
2508
|
export const MAX_SESSION_NAME = 100;
|
|
2509
2509
|
/** A phone's or a browser's own name, as it tells a computer (inventory.get `device_name`). */
|
|
2510
2510
|
export const MAX_DEVICE_NAME = 64;
|
|
2511
|
+
/** One catch-up page (session.attach `after`, release 37): at most this many events, and this many characters of them. */
|
|
2512
|
+
export const CATCH_UP_MAX_EVENTS = 200;
|
|
2513
|
+
export const CATCH_UP_MAX_BYTES = 1_048_576;
|
|
2511
2514
|
|
|
2512
2515
|
export const COMMAND_PAYLOAD_SPECS = {
|
|
2513
2516
|
/**
|
|
@@ -2581,8 +2584,15 @@ export const COMMAND_PAYLOAD_SPECS = {
|
|
|
2581
2584
|
}),
|
|
2582
2585
|
/** Ask for a status.report: of one session, or of the whole computer (then a device.inventory too). */
|
|
2583
2586
|
"status.get": object({ scope: oneOf(["session", "device"]) }),
|
|
2584
|
-
/**
|
|
2585
|
-
|
|
2587
|
+
/**
|
|
2588
|
+
* Join a session started at the desk, which the computer listed in its inventory. Empty: the computer replays the
|
|
2589
|
+
* session's journal whole. THE CATCH-UP (release 37, CLI 0.11.14): `after`, `max_events` and `max_bytes` together ask
|
|
2590
|
+
* only the journaled events after `after`, in order, at most `max_events` of them and at most `max_bytes` (the journal
|
|
2591
|
+
* record's canonical characters; one event always, so a page always moves), sealed for the asking phone alone; the phone
|
|
2592
|
+
* asks the next page once this one's `command.agent_accepted` arrived. Sent only to a computer whose inventory probe
|
|
2593
|
+
* showed it reads `catch_up` (inventory.get below): an older one drops the fields, so it is never asked.
|
|
2594
|
+
*/
|
|
2595
|
+
"session.attach": object({ after: optional(int(0)), max_events: optional(int(1, CATCH_UP_MAX_EVENTS)), max_bytes: optional(int(1024, CATCH_UP_MAX_BYTES)) }),
|
|
2586
2596
|
/** Bring the session to the front on the computer's own screen ("show it on my desk"). Moves the view only. */
|
|
2587
2597
|
"session.focus": object({}),
|
|
2588
2598
|
/** End the session and its agent. */
|
|
@@ -2621,6 +2631,11 @@ export const COMMAND_PAYLOAD_SPECS = {
|
|
|
2621
2631
|
* drops the unknown field, so the phone asks it by a probe of its own (client-core.ts, inventory-asks.ts).
|
|
2622
2632
|
*/
|
|
2623
2633
|
desk_sessions: optional(bool()),
|
|
2634
|
+
/**
|
|
2635
|
+
* Release 37: this phone asks a session's events after a sequence (session.attach `after`, the catch-up). Only with
|
|
2636
|
+
* `extended`; an older computer drops the unknown field, so the phone asks it by a probe of its own.
|
|
2637
|
+
*/
|
|
2638
|
+
catch_up: optional(bool()),
|
|
2624
2639
|
}),
|
|
2625
2640
|
/** This computer's remote settings, each optional. Pausing from the phone is soft; `worktrust remote disable` at the
|
|
2626
2641
|
* desk is the hard off, which no message can undo. */
|
|
@@ -2781,6 +2796,12 @@ export function validateCommandPayload (type , value
|
|
|
2781
2796
|
if (i.device_name !== undefined && (i.extended !== true || !deviceNameOk(i.device_name))) return refuse("payload", "$payload.device_name: printable words, with extended");
|
|
2782
2797
|
if (i.model_switch !== undefined && i.extended !== true) return refuse("payload", "$payload.model_switch: with extended");
|
|
2783
2798
|
if (i.desk_sessions !== undefined && i.extended !== true) return refuse("payload", "$payload.desk_sessions: with extended");
|
|
2799
|
+
if (i.catch_up !== undefined && i.extended !== true) return refuse("payload", "$payload.catch_up: with extended");
|
|
2800
|
+
}
|
|
2801
|
+
if (type === "session.attach") {
|
|
2802
|
+
const a = payload ;
|
|
2803
|
+
const given = [a.after, a.max_events, a.max_bytes].filter((v) => v !== undefined).length;
|
|
2804
|
+
if (given !== 0 && given !== 3) return refuse("payload", "$payload: after, max_events and max_bytes together, or none");
|
|
2784
2805
|
}
|
|
2785
2806
|
if (type === "attachment.put") { const bad = attachmentRule(payload ); if (bad) return refuse("payload", `$payload: ${bad}`); }
|
|
2786
2807
|
if (type === "preview.render") { const bad = previewRule(payload ); if (bad) return refuse("payload", `$payload: ${bad}`); }
|
package/remote-settings.mjs
CHANGED
|
@@ -58,7 +58,8 @@ export function startChoice(payload, projectId, inventory, settings, known) {
|
|
|
58
58
|
/**
|
|
59
59
|
* The one door for a settings change. `change`: { what: "modes", allow|deny: "edit"|"auto" } | { what: "roots", add: dir,
|
|
60
60
|
* git_init } | { what: "roots", remove: id|dir } | { what: "projects", add: dir } | { what: "projects", remove: id|dir } |
|
|
61
|
-
* { what: "admin", on: boolean } | { what: "
|
|
61
|
+
* { what: "admin", on: boolean } | { what: "endorse", on: boolean } (both this keyboard only) | { what: "connections", remove:
|
|
62
|
+
* fingerprint } (resolved from the app's change only).
|
|
62
63
|
* `source`: { kind: "keyboard" }, or { kind: "admin", proof, issuerKeys, claims, now, via } (part B; its change is
|
|
63
64
|
* crypto/admin.ts's ADMIN_CHANGE_SPEC, resolved by id before it reaches the rules below).
|
|
64
65
|
* → { ok: true, message, paths?, setting? } or { ok: false, reason, code? } (code: the protocol's reject reason).
|
|
@@ -94,6 +95,13 @@ function applyRules(change, fromApp) {
|
|
|
94
95
|
const n = removePhones([String(change.remove ?? "")]);
|
|
95
96
|
return n > 0 ? { ok: true, message: "Disconnected: it can no longer steer this computer." } : { ...refused("no phone or browser by that fingerprint"), code: "not_found" };
|
|
96
97
|
}
|
|
98
|
+
if (change?.what === "endorse") {
|
|
99
|
+
// May a phone confirmed here add a browser it scanned (remote-endorse.mjs)? This keyboard only, like the admin switch.
|
|
100
|
+
if (fromApp) return refused("whether phones may add a browser changes at this keyboard only");
|
|
101
|
+
if (typeof change.on !== "boolean") return refused("on or off");
|
|
102
|
+
saveSettings({ ...settings, allow_endorse: change.on });
|
|
103
|
+
return { ok: true, message: change.on ? "Your confirmed phones may add a browser. Each one is listed here with the phone that added it." : "No phone may add a browser. Browsers already added stay until you remove them." };
|
|
104
|
+
}
|
|
97
105
|
if (change?.what === "admin") {
|
|
98
106
|
if (fromApp) return refused("the admin switch changes at this keyboard only");
|
|
99
107
|
if (typeof change.on !== "boolean") return refused("on or off");
|
|
@@ -189,3 +197,43 @@ export async function askMacFolderAccess(io, paths) {
|
|
|
189
197
|
io.say(` then turn on ${guarded.join(" and ")} for "node" (or "python"); or add that program under Full Disk Access.`);
|
|
190
198
|
return false;
|
|
191
199
|
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* TWO MORE QUESTIONS WHEN A PHONE HAS LINKED (CLI 0.11.14, owner 2026-11-16), after its reach (remote-connections.mjs
|
|
203
|
+
* reachStep): may the confirmed phones add a browser, and which agent modes may a phone start here. Both are the settings
|
|
204
|
+
* that exist, changed through `apply` (the keyboard's one door, applySettingsChange): `endorse` is what `remote phones
|
|
205
|
+
* allow-endorse on|off` writes, the ceiling what `remote modes allow|deny` writes. Both answers are taken first and only
|
|
206
|
+
* then applied, so Ctrl+C or Esc at either question changes nothing. Without a terminal the commands are named.
|
|
207
|
+
*/
|
|
208
|
+
export const CEILINGS = Object.freeze([
|
|
209
|
+
{ value: "plan", label: "Manual and Plan", info: "The agent asks before every change, or only reads and plans." },
|
|
210
|
+
{ value: "edit", label: "+ Edit automatically", info: "Also sessions that edit in their projects without asking." },
|
|
211
|
+
{ value: "auto", label: "+ Auto", info: "Also the agent's own automatic mode (it allows edit too)." },
|
|
212
|
+
]);
|
|
213
|
+
/** The ceiling a list of allowed modes is: plan, edit or auto. */
|
|
214
|
+
export const ceilingOf = (allowed) => (allowed.includes("auto") ? "auto" : allowed.includes("edit") ? "edit" : "plan");
|
|
215
|
+
/** The `modes` changes that move the ceiling from one step to another (none when it stays). */
|
|
216
|
+
export function ceilingChanges(from, to) {
|
|
217
|
+
if (from === to) return [];
|
|
218
|
+
if (to === "plan") return [{ what: "modes", deny: "edit" }];
|
|
219
|
+
if (to === "auto") return [{ what: "modes", allow: "auto" }];
|
|
220
|
+
return from === "auto" ? [{ what: "modes", deny: "auto" }] : [{ what: "modes", allow: "edit" }];
|
|
221
|
+
}
|
|
222
|
+
const nowMark = (on) => (on ? { note: { text: "now", tone: "dim" } } : {});
|
|
223
|
+
export async function trustStep(io, { apply, interactive, term = null, choose = null, settings = loadSettings() }) {
|
|
224
|
+
const endorse = settings.allow_endorse === true, ceiling = ceilingOf(allowedModes(settings));
|
|
225
|
+
if (!interactive || !term || !choose) { io.say(" Later: npx worktrust remote phones allow-endorse on|off and npx worktrust remote modes allow|deny edit|auto"); return "later"; }
|
|
226
|
+
term.enter();
|
|
227
|
+
try {
|
|
228
|
+
const asked = await choose(term, { title: "May your confirmed phones add a browser?", items: [
|
|
229
|
+
{ label: "Yes, they may add a browser", info: "A phone confirmed here may add a browser it scanned.", value: true, ...nowMark(endorse) },
|
|
230
|
+
{ label: "No", info: "Only this keyboard adds a browser.", value: false, ...nowMark(!endorse) }] });
|
|
231
|
+
const modes = asked === "quit" || asked === "back" ? asked : await choose(term, { title: "Which agent modes may a phone start here?", items: CEILINGS.map((c) => ({ ...c, ...nowMark(c.value === ceiling) })) });
|
|
232
|
+
term.erase(); term.restore();
|
|
233
|
+
if (modes === "quit" || modes === "back") { io.say(" Unchanged. Later: npx worktrust remote phones allow-endorse on|off · npx worktrust remote modes"); return "unchanged"; }
|
|
234
|
+
const changes = [...(asked.item.value === endorse ? [] : [{ what: "endorse", on: asked.item.value }]), ...ceilingChanges(ceiling, modes.item.value)];
|
|
235
|
+
for (const change of changes) await apply(change);
|
|
236
|
+
if (changes.length === 0) io.say(" ✓ Unchanged: these were already your settings.");
|
|
237
|
+
return "set";
|
|
238
|
+
} finally { term.restore(); }
|
|
239
|
+
}
|
package/worktrust.mjs
CHANGED
|
@@ -83,7 +83,7 @@ const command = args.includes("--help") ? "help" : args.includes("--version") ?
|
|
|
83
83
|
const flag = (name) => { const at = args.indexOf(`--${name}`); return at >= 0 ? args[at + 1] : undefined; };
|
|
84
84
|
const has = (name) => args.includes(`--${name}`);
|
|
85
85
|
/** 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). */
|
|
86
|
-
const CLI_VERSION = "0.11.
|
|
86
|
+
const CLI_VERSION = "0.11.14";
|
|
87
87
|
/**
|
|
88
88
|
* HOW THIS CLI MEASURES, AS A NUMBER OF ITS OWN (0.10.31; owner, 2026-10-28: 0.10.30 offered a re-measure it had no reason
|
|
89
89
|
* to offer). Raised ONLY when what is measured changes: the timeline, the seconds, the tokens, the steering, the session
|