worktrust 0.11.4 → 0.11.6
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 +40 -6
- package/SECURITY.md +2 -2
- package/engine-release.json +1 -1
- package/package-release.json +1 -1
- package/package.json +1 -1
- package/remote-adapter-opencode.mjs +1 -1
- package/remote-cli.mjs +10 -7
- package/remote-opencode-events.mjs +1 -1
- package/remote-pairing.mjs +45 -10
- package/worktrust.mjs +5 -3
package/README.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
# worktrust
|
|
2
2
|
|
|
3
|
-
## 0.11.
|
|
3
|
+
## 0.11.6: approve a computer with your phone
|
|
4
|
+
|
|
5
|
+
**Two roads to approve this computer for Remote Agent.** `npx worktrust remote app` shows the approval as a QR code in
|
|
6
|
+
the terminal, without opening a browser: scan it with the WorkTrust app, check the code and key, accept Remote Agent's
|
|
7
|
+
terms and approve with your authenticator code. `npx worktrust remote web` opens the approval page in your browser, as
|
|
8
|
+
before. `npx worktrust remote enable` asks which one you want. A request lives ten minutes; the page and the app count
|
|
9
|
+
it down and tell you when to run the command again.
|
|
10
|
+
|
|
11
|
+
**A command the CLI does not know** now says so ("Unknown command: …") before the help, and ends with a failure code.
|
|
12
|
+
|
|
13
|
+
No measure change: the measure rules stay 4.
|
|
14
|
+
|
|
15
|
+
## 0.11.5: Remote Agent (the new name), and a link needs your authenticator
|
|
16
|
+
|
|
17
|
+
**Remote Agent.** What was called MOCHI is now called Remote Agent everywhere you read it: in this CLI's messages, in
|
|
18
|
+
Settings › Remote Agent on app.worktrust.io and on your phone, where its tab is Devs. Its terms moved to
|
|
19
|
+
worktrust.io/remote-agent-terms; the old address forwards there. Nothing it does changed.
|
|
20
|
+
|
|
21
|
+
**A link needs your authenticator.** Approving this computer on app.worktrust.io, and adding a new phone or browser, now
|
|
22
|
+
asks for a code from your authenticator app; an e-mailed code no longer does. A link stays with the account and the phone
|
|
23
|
+
that made it, and it ends when you remove that authenticator. A phone asked by code is still confirmed at this keyboard:
|
|
24
|
+
`npx worktrust remote phones confirm <fingerprint>`. What is measured for the passport is unchanged: the measure rules
|
|
25
|
+
stay 4.
|
|
26
|
+
|
|
27
|
+
## 0.11.4: local models measured, confidential client work, OpenCode in Remote Agent
|
|
4
28
|
|
|
5
29
|
**Local models, used directly.** The Ollama app's chats and Open WebUI's are now read like every other database client:
|
|
6
30
|
the model, the time of each turn and, for Open WebUI, the token counts it kept (the Ollama app keeps none, so none are
|
|
@@ -14,7 +38,7 @@ leaves the computer. Your passport names that share inside your verified hours a
|
|
|
14
38
|
`npx worktrust project exclude [folder]` leaves a folder out entirely, `project normal` undoes either, and `project list`
|
|
15
39
|
shows what you set. Only you change these at your keyboard; an agent's shell may only list them.
|
|
16
40
|
|
|
17
|
-
**OpenCode in
|
|
41
|
+
**OpenCode in Remote Agent.** Your phone can steer OpenCode on this computer, and through it a local model such as Qwen on
|
|
18
42
|
Ollama. Like Codex it is off by default: `npx worktrust remote opencode on` says what OpenCode can do without asking and
|
|
19
43
|
asks for a typed yes; `off` switches it off again. Its runs ask your phone before every command, edit and fetch, and a
|
|
20
44
|
remote-steered session never counts as your hours.
|
|
@@ -28,7 +52,7 @@ import prompt in Sources on app.worktrust.io, so it no longer costs every sessio
|
|
|
28
52
|
`npx worktrust remote phones remove --all` disconnects every phone and browser from this computer in one act, after one
|
|
29
53
|
confirmation at the keyboard. The computer refuses them from their next message. Sessions they started keep running here:
|
|
30
54
|
stop them with `npx worktrust remote disable`, or pause everything with `npx worktrust remote pause`. To end their keys for
|
|
31
|
-
your whole account too, use Settings ›
|
|
55
|
+
your whole account too, use Settings › Remote Agent on app.worktrust.io or Remote Agent settings on your phone. What is measured for the
|
|
32
56
|
passport is unchanged: remote-steered sessions never count as your hours, and the measure rules stay 3.
|
|
33
57
|
|
|
34
58
|
## 0.11.2: your phone adds a browser
|
|
@@ -759,7 +783,7 @@ does not offer its earlier work. Other retained files and your local evidence ar
|
|
|
759
783
|
automatic server or archive erasure.
|
|
760
784
|
Then revoke the key in WorkTrust: Sources → Devices → this computer → Revoke.
|
|
761
785
|
|
|
762
|
-
## Remote
|
|
786
|
+
## Remote Agent: steer this computer's agents from your phone or browser (`npx worktrust remote`)
|
|
763
787
|
|
|
764
788
|
Off until you run `npx worktrust remote enable` at this keyboard; an AI agent's shell is refused every `remote` command
|
|
765
789
|
except `status`.
|
|
@@ -769,6 +793,9 @@ except `status`.
|
|
|
769
793
|
are logged in (launchd on macOS, a systemd user unit on Linux, linger off; on Windows `npx worktrust remote run` in a
|
|
770
794
|
terminal) and draws a QR code for the WorkTrust app. `pair` draws a new one: five minutes, one phone, once. A phone
|
|
771
795
|
that scanned it is confirmed; one that typed the code instead waits for `npx worktrust remote phones confirm`.
|
|
796
|
+
- Two roads to approve the computer's key: `npx worktrust remote app` shows the approval as a QR code here (no browser);
|
|
797
|
+
the WorkTrust app scans it and you approve with your authenticator code. `npx worktrust remote web` opens the approval
|
|
798
|
+
page in your browser. `enable` asks which (Enter is the app); without a terminal, or with `--yes`, it opens the browser.
|
|
772
799
|
- `projects add <folder>` grants a folder (its real path; never your home folder, the disk's root or a folder holding
|
|
773
800
|
keys, keychains, browser profiles or wallets). A phone starts agents only in granted folders, several at once (four by
|
|
774
801
|
default).
|
|
@@ -784,8 +811,15 @@ except `status`.
|
|
|
784
811
|
remote).
|
|
785
812
|
- `status`, `pause`, `resume`, `disable` (the hard off; `--forget` also deletes the remote keys), `phones`, `projects`.
|
|
786
813
|
|
|
787
|
-
|
|
788
|
-
|
|
814
|
+
- From a browser (app.worktrust.io › Remote Agent): approve the browser in WorkTrust with your passkey, your
|
|
815
|
+
authenticator and a 6-digit PIN (asked again after five minutes without your input; agents keep running meanwhile).
|
|
816
|
+
Run `npx worktrust remote pair` here and paste the link it prints into the browser. Then confirm the browser's
|
|
817
|
+
fingerprint at this keyboard: `npx worktrust remote phones confirm <fingerprint>`. A browser is never confirmed by the
|
|
818
|
+
link alone. With `npx worktrust remote phones allow-endorse on`, a phone confirmed here may add a browser it scanned
|
|
819
|
+
instead (off by default). A PIN reset in WorkTrust removes every browser link; phones keep theirs.
|
|
820
|
+
|
|
821
|
+
Remote needs Node 22.4 or later (the Python package bundles one). It connects to the WorkTrust gateway
|
|
822
|
+
(`wss://remote.worktrust.io`, live since 2026-11-09).
|
|
789
823
|
|
|
790
824
|
## Requirements
|
|
791
825
|
|
package/SECURITY.md
CHANGED
|
@@ -209,9 +209,9 @@ the platform keeps only the listed keys, from a CLI key alone, and shows them to
|
|
|
209
209
|
`worktrust mod remove` and `worktrust disconnect` take it out of the settings and delete the plugin
|
|
210
210
|
and its counts.
|
|
211
211
|
|
|
212
|
-
## Remote
|
|
212
|
+
## Remote Agent (`npx worktrust remote`)
|
|
213
213
|
|
|
214
|
-
What it is: standing remote execution of AI agents on this computer, steered from a confirmed phone. Its limits:
|
|
214
|
+
What it is: standing remote execution of AI agents on this computer, steered from a confirmed phone or browser. Its limits:
|
|
215
215
|
|
|
216
216
|
- Separate key, separate audience. The remote keys (`~/.worktrust/remote/remote-keys.json`, 0600) are not the measurement
|
|
217
217
|
key and no remote module reads the measurement credentials (`scripts/check-remote-cli.mjs` refuses one that names them).
|
package/engine-release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"167fe3718415fe690c9e4f7a3a993520e8c652edcf61184cc14cfec2db67d7bc","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":"a5ef08186128d9fe4023944378bb0ff5682a8ae64ffdb07ef5e76cc51894d721","remote-adapter-codex.mjs":"d2fd6c61d9e3c4a45e9b10da1aa3c15d45c86629d6456e4a8d25ad95b13eb209","remote-adapter-opencode.mjs":"
|
|
1
|
+
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"167fe3718415fe690c9e4f7a3a993520e8c652edcf61184cc14cfec2db67d7bc","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":"a5ef08186128d9fe4023944378bb0ff5682a8ae64ffdb07ef5e76cc51894d721","remote-adapter-codex.mjs":"d2fd6c61d9e3c4a45e9b10da1aa3c15d45c86629d6456e4a8d25ad95b13eb209","remote-adapter-opencode.mjs":"ddd7f3ec0b4ba92f4744453d60fda338b63550e3ec7b23fa3acc668df1d64eb7","remote-adapter-terminal.mjs":"9237d3747a25126fcdad42c0eab10e69393754388a6014b30fb0890b9c735888","remote-agent-switch.mjs":"7ff5448f29f05a47d7298d730b21243a1bcf8a215b434a0c7fbf5f3cb0889041","remote-approval-bridge.mjs":"092f17b7969e4f35bea064315d04dcde1faa6a3fd3e737dcc05aece82c7a37c4","remote-approvals.mjs":"5a371e049ceb154100a3b0c1900d8a2c1fc193b01e8069f11ce1690bcf4df3e1","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":"f2ce16401a2c63db6628c83b01b18c949e96545c5ff34ecb8d3d2bd70d473998","remote-coalesce.mjs":"cb0967d9cfe81e3892bcade8349d6814db98be8c2adbdb54df0b8d1b142f65d1","remote-codex-events.mjs":"58657d6070a50c837737cb85f5a1eaf9c2cbc4e1adfe3e970748ab3b2af94631","remote-daemon.mjs":"5dadcced9bd2c69be8c48afbaabbf50bd16879612ada0553aa2284a873907492","remote-endorse.mjs":"89eda4883567176703e01e44d83e987271bc2a6134e108f517b3b213719a21f9","remote-inventory.mjs":"43954e427141b4303ca13d22068d50bfc81e544b085bce335b8e8d59dc520468","remote-journal.mjs":"907ebd48c53162b22dc743ef95b53c1a6be6886a7495605b5cfa820b8de9d330","remote-live-preview.mjs":"faa70f9260ac05037204c2a0c3facf4ffe42f68408948390b341b453a2932289","remote-opencode-events.mjs":"3108375501ead2c2c78bce1435cc2a9fe6d2af1d7ff1fb42e12ff3e0f5d9af9c","remote-opencode-session.mjs":"681b201d833a7d7d025122b3a79663bcdc0a989aefd39d8018a28113d8810caf","remote-pairing.mjs":"536fa695d1d684314dd572e9af2b77266a4e20246b7105d946b5fb60039e8344","remote-pipeline-config.mjs":"00cde6a61ce21144c51ac56fce42fee159aa9dba6586218a7ea790ce4a6bd40b","remote-pipeline-parsers.mjs":"43ca0d332d7bc883c4759a754a555815ae5dfe133446b91ba9f2e48a350fa20f","remote-pipeline.mjs":"b856ead989b29ddb618ef69bbacd104bae2b02c9d1c5214291d08ce469a8b24e","remote-policy.mjs":"aacf7578537021ab3849095bb1f58f0ed12c453c6ca2ab1352a1716fb13b0ca4","remote-preview.mjs":"fe504ad6f83dcb4a4ebdcc018686a9a5a900c47cdf8c45b75e7d02e2f3056155","remote-projects.mjs":"d07997167d1f51139ff010c8753639e48c5cd33688568459e184eabb12bfff84","remote-protocol.mjs":"7b2a78e585983be40e240b9ab0b2e31a69e586bd72292071886c60b217d97a60","remote-qr.mjs":"b80e2b4a5bc020cf6ed92e91d06b327cb5197de1c35b3445a0fc2c7a3bf1ab3f","remote-release-plans.mjs":"11884a62b7d6dcccb5e154a26603bdf650f7b40f946329fb174d8c13729bec74","remote-releases.mjs":"fb08b72593ea00013c8b679e0c0d7dee95b0fd7cc5fd31b80ac575d0e340927d","remote-run.mjs":"c72c77fdd14115e66f1f2be383ca4f1363a4cecc9dced9cc48cbb3e4bb44bc66","remote-screen-approvals.mjs":"c43ab286d36a38d17639d155782ffa017f1a9b6806a09b82ed0142a1290b6000","remote-screen-push.mjs":"4ee8bd48d24b2c87581e9f33d8354a86381f7febd82f89ed509a7a87c1442608","remote-screen-states.mjs":"7c3c86a584bebf52461f3cab39c05ea2a13910061704d48fc622956e842940f7","remote-service.mjs":"1b9d4ecf99b667f2ab7c78fe1dfd5cf507cbb36c5bcad15bfa2a88c313ae758e","remote-session-list.mjs":"494fdbe20f0542806ac6c42ad149c52e2d3ace23a3a7567f96dc7e80d092c727","remote-sessions.mjs":"64ae363f8b5f38c58c21afbeaa7951d9592c608c3c83cceb78b21700a64467e9","remote-steered.mjs":"d7afde92c62c87abbdb84b0cfea2eea4752e90a2e453e52a54812c4fe0395190","remote-steering.mjs":"7ba22e6110cea3ac75a4f084f8f92a5bd90c31a19d3ce58a88a0843bdadea834","remote-store.mjs":"51645f8355923fe51de00233477266a99e94d4ca1f98f797f96e4ebb15927e9a","remote-terminal-cli.mjs":"82a048b75e412d0b6db076afbb84cab7c754dec72b6c8b6af4d4906b38e988a7","remote-terminal-sessions.mjs":"6ab51824890a18768d23cedc499f3840b2b02a8ed651463c1fe2d74dd352a361","remote-transport.mjs":"68650fd77ea09b5762377f87cabdc1c73a34d77324aa5bf0cd9742094a50c32b","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","self-update.mjs":"378e3620d48c72cf0bf812be408883b995cdb2223de34a20f762dd73eeffb258","session-databases.mjs":"a16ffbc50ccc0e78f370ebe07f871d1a80f1977472e478e3599e7abfdc90c1b7","session-local-models.mjs":"bacd38ff8dd3056b552982ec52eb57c7b8ca86e1a46cd4cba30fc340e3e28fd4","setup-mcp.mjs":"b732e3dd9b3e522b7cc8acf167ce28ba8f1a8dee797ee15bd7c3b02919b13e6f","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5f5667b92adf11b1a5a6330a0f26dd6db73d56fe60823d9a5246dab71d27d380","transcript-readers.mjs":"e9f20415c2b5d62a09f35a63075002ebd1da56edb32f242d52822d58ecbd8ac3","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"9c89d6397852a6a971e3b31a8513fa09754f3870f4a28787abc3c333c80157dc"},"format":"worktrust-package/1","kind":"engine","version":"0.11.6"},"signature":"96m7Cc7_qCSTboTkayK7YsfopN-5oJI82WouPg4vtn2ZkoHlfl4Cgu3H3G800tJWNBiQoq01UUpq0srE2wG4Dw"}
|
package/package-release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"e8abb38c293b57b71d3a6163d6242d1f375e773372b91b6d8ce39c584c51262a","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"b38ea343eb95892d4164274be4184d6e34eade9d4c454e1dcf8bc7735736425e","README.md":"
|
|
1
|
+
{"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"AGENTS.md":"e8abb38c293b57b71d3a6163d6242d1f375e773372b91b6d8ce39c584c51262a","CLAUDE.md":"5933504f93e5a40369a4790e96dd5dad791d849d3178b1833eb64088e456aaeb","LICENSE":"b38ea343eb95892d4164274be4184d6e34eade9d4c454e1dcf8bc7735736425e","README.md":"420c1a5489fa6097de712e4c70431c57fdbd1eda1ffb598a6a6ef3126b2ce3e8","SECURITY.md":"6a798d875f48ae84c3a677397e5611e03b94215944952e0f61e13f6cfc949745","chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","engine-release.json":"d16df62414188bdff924a9cc694eabc79ee915b424b7b82b6509b8cde2f0650c","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"167fe3718415fe690c9e4f7a3a993520e8c652edcf61184cc14cfec2db67d7bc","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","package.json":"60e03bddf5dda48f311891699908ab50f5b66a3d60565fb131790516c91cbc1a","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"cd111cae0f53a25a2d878a158479abfb1ace353361454843f91a16d241101d46","project-modes.mjs":"ada26e68297fbeb90e4e91d75a90fd2d7cc107b999a9702840675b5a7529463e","remote-adapter-claude-code.mjs":"a5ef08186128d9fe4023944378bb0ff5682a8ae64ffdb07ef5e76cc51894d721","remote-adapter-codex.mjs":"d2fd6c61d9e3c4a45e9b10da1aa3c15d45c86629d6456e4a8d25ad95b13eb209","remote-adapter-opencode.mjs":"ddd7f3ec0b4ba92f4744453d60fda338b63550e3ec7b23fa3acc668df1d64eb7","remote-adapter-terminal.mjs":"9237d3747a25126fcdad42c0eab10e69393754388a6014b30fb0890b9c735888","remote-agent-switch.mjs":"7ff5448f29f05a47d7298d730b21243a1bcf8a215b434a0c7fbf5f3cb0889041","remote-approval-bridge.mjs":"092f17b7969e4f35bea064315d04dcde1faa6a3fd3e737dcc05aece82c7a37c4","remote-approvals.mjs":"5a371e049ceb154100a3b0c1900d8a2c1fc193b01e8069f11ce1690bcf4df3e1","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":"f2ce16401a2c63db6628c83b01b18c949e96545c5ff34ecb8d3d2bd70d473998","remote-coalesce.mjs":"cb0967d9cfe81e3892bcade8349d6814db98be8c2adbdb54df0b8d1b142f65d1","remote-codex-events.mjs":"58657d6070a50c837737cb85f5a1eaf9c2cbc4e1adfe3e970748ab3b2af94631","remote-daemon.mjs":"5dadcced9bd2c69be8c48afbaabbf50bd16879612ada0553aa2284a873907492","remote-endorse.mjs":"89eda4883567176703e01e44d83e987271bc2a6134e108f517b3b213719a21f9","remote-inventory.mjs":"43954e427141b4303ca13d22068d50bfc81e544b085bce335b8e8d59dc520468","remote-journal.mjs":"907ebd48c53162b22dc743ef95b53c1a6be6886a7495605b5cfa820b8de9d330","remote-live-preview.mjs":"faa70f9260ac05037204c2a0c3facf4ffe42f68408948390b341b453a2932289","remote-opencode-events.mjs":"3108375501ead2c2c78bce1435cc2a9fe6d2af1d7ff1fb42e12ff3e0f5d9af9c","remote-opencode-session.mjs":"681b201d833a7d7d025122b3a79663bcdc0a989aefd39d8018a28113d8810caf","remote-pairing.mjs":"536fa695d1d684314dd572e9af2b77266a4e20246b7105d946b5fb60039e8344","remote-pipeline-config.mjs":"00cde6a61ce21144c51ac56fce42fee159aa9dba6586218a7ea790ce4a6bd40b","remote-pipeline-parsers.mjs":"43ca0d332d7bc883c4759a754a555815ae5dfe133446b91ba9f2e48a350fa20f","remote-pipeline.mjs":"b856ead989b29ddb618ef69bbacd104bae2b02c9d1c5214291d08ce469a8b24e","remote-policy.mjs":"aacf7578537021ab3849095bb1f58f0ed12c453c6ca2ab1352a1716fb13b0ca4","remote-preview.mjs":"fe504ad6f83dcb4a4ebdcc018686a9a5a900c47cdf8c45b75e7d02e2f3056155","remote-projects.mjs":"d07997167d1f51139ff010c8753639e48c5cd33688568459e184eabb12bfff84","remote-protocol.mjs":"7b2a78e585983be40e240b9ab0b2e31a69e586bd72292071886c60b217d97a60","remote-qr.mjs":"b80e2b4a5bc020cf6ed92e91d06b327cb5197de1c35b3445a0fc2c7a3bf1ab3f","remote-release-plans.mjs":"11884a62b7d6dcccb5e154a26603bdf650f7b40f946329fb174d8c13729bec74","remote-releases.mjs":"fb08b72593ea00013c8b679e0c0d7dee95b0fd7cc5fd31b80ac575d0e340927d","remote-run.mjs":"c72c77fdd14115e66f1f2be383ca4f1363a4cecc9dced9cc48cbb3e4bb44bc66","remote-screen-approvals.mjs":"c43ab286d36a38d17639d155782ffa017f1a9b6806a09b82ed0142a1290b6000","remote-screen-push.mjs":"4ee8bd48d24b2c87581e9f33d8354a86381f7febd82f89ed509a7a87c1442608","remote-screen-states.mjs":"7c3c86a584bebf52461f3cab39c05ea2a13910061704d48fc622956e842940f7","remote-service.mjs":"1b9d4ecf99b667f2ab7c78fe1dfd5cf507cbb36c5bcad15bfa2a88c313ae758e","remote-session-list.mjs":"494fdbe20f0542806ac6c42ad149c52e2d3ace23a3a7567f96dc7e80d092c727","remote-sessions.mjs":"64ae363f8b5f38c58c21afbeaa7951d9592c608c3c83cceb78b21700a64467e9","remote-steered.mjs":"d7afde92c62c87abbdb84b0cfea2eea4752e90a2e453e52a54812c4fe0395190","remote-steering.mjs":"7ba22e6110cea3ac75a4f084f8f92a5bd90c31a19d3ce58a88a0843bdadea834","remote-store.mjs":"51645f8355923fe51de00233477266a99e94d4ca1f98f797f96e4ebb15927e9a","remote-terminal-cli.mjs":"82a048b75e412d0b6db076afbb84cab7c754dec72b6c8b6af4d4906b38e988a7","remote-terminal-sessions.mjs":"6ab51824890a18768d23cedc499f3840b2b02a8ed651463c1fe2d74dd352a361","remote-transport.mjs":"68650fd77ea09b5762377f87cabdc1c73a34d77324aa5bf0cd9742094a50c32b","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","self-update.mjs":"378e3620d48c72cf0bf812be408883b995cdb2223de34a20f762dd73eeffb258","session-databases.mjs":"a16ffbc50ccc0e78f370ebe07f871d1a80f1977472e478e3599e7abfdc90c1b7","session-local-models.mjs":"bacd38ff8dd3056b552982ec52eb57c7b8ca86e1a46cd4cba30fc340e3e28fd4","setup-mcp.mjs":"b732e3dd9b3e522b7cc8acf167ce28ba8f1a8dee797ee15bd7c3b02919b13e6f","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5f5667b92adf11b1a5a6330a0f26dd6db73d56fe60823d9a5246dab71d27d380","transcript-readers.mjs":"e9f20415c2b5d62a09f35a63075002ebd1da56edb32f242d52822d58ecbd8ac3","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"9c89d6397852a6a971e3b31a8513fa09754f3870f4a28787abc3c333c80157dc"},"format":"worktrust-package/1","kind":"npm","version":"0.11.6"},"signature":"A9tyY6f40tkdbWhj6k3SUuqP9Bwr6X71sf566eDHl7l38iD-LfdZIaoh8qN131y3RyXT5zaV1kAw1gSyxeq3BA"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* THE OPENCODE ADAPTER (owner, 2026-11-09: steer OpenCode, and through it Qwen on Ollama, from
|
|
2
|
+
* THE OPENCODE ADAPTER (owner, 2026-11-09: steer OpenCode, and through it Qwen on Ollama, from Remote Agent). OpenCode runs as
|
|
3
3
|
* `opencode run --format json`, ONE PROCESS PER RUN, no shell between us and it; read from OpenCode's source
|
|
4
4
|
* (anomalyco/opencode packages/cli/src/commands/commands.ts, run/run.ts, run/noninteractive.ts, session-target.ts; the
|
|
5
5
|
* permission docs; read 2026-11-09). NOT VERIFIED on a real install: OpenCode is not on the build machine; the tests run a
|
package/remote-cli.mjs
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* AI agent's shell is refused by worktrust.mjs, `status` excepted). docs/remote-agents/PROTOCOL.md is the contract.
|
|
4
4
|
*
|
|
5
5
|
* remote enable [--gateway <wss://…>] [--device] pair this computer's REMOTE keys (not the measurement key) in the
|
|
6
|
-
* Passport app, start the service, show a pairing QR
|
|
6
|
+
* Passport app, start the service, show a pairing QR; asks which road
|
|
7
|
+
* remote app | web the same, approved in the WorkTrust app (a QR here, no browser) |
|
|
8
|
+
* in the browser's approval page (owner, 2026-11-12)
|
|
7
9
|
* remote pair a new QR for a phone (five minutes, one phone, once)
|
|
8
10
|
* remote status [--json] what is on, paired, running, granted and installed
|
|
9
11
|
* remote pause | resume refuse every command for now | take them again
|
|
@@ -33,7 +35,7 @@ import { createInterface } from "node:readline/promises";
|
|
|
33
35
|
import * as P from "./remote-protocol.mjs";
|
|
34
36
|
import { ensureRemoteDir, isLoopbackGateway, issuerKeys, loadIdentity, loadKeys, loadPhones, loadProjects, loadSettings, newKeys, projectIdOf, random, readJson, removeFile, saveIdentity, saveKeys, savePhones, saveProjects, saveSettings, writeJson } from "./remote-store.mjs";
|
|
35
37
|
import { canonicalProject } from "./remote-policy.mjs";
|
|
36
|
-
import { IssuerMissing, PairingRefused, pairComputer } from "./remote-pairing.mjs";
|
|
38
|
+
import { IssuerMissing, PairingRefused, chooseRoad, pairComputer } from "./remote-pairing.mjs";
|
|
37
39
|
import { installService, removeService, serviceState, servicePlatform } from "./remote-service.mjs";
|
|
38
40
|
import { qrMatrix, renderQr } from "./remote-qr.mjs";
|
|
39
41
|
import { webSocketAvailable } from "./remote-transport.mjs";
|
|
@@ -62,7 +64,7 @@ function needPaired(io) {
|
|
|
62
64
|
return { keys, identity };
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
async function enable(io) {
|
|
67
|
+
async function enable(io, sub = "enable") {
|
|
66
68
|
if (!webSocketAvailable()) io.fail(`remote needs Node 22.4 or later for its connection (this is ${process.versions.node}); the Python package bundles one`);
|
|
67
69
|
const settings = loadSettings();
|
|
68
70
|
const gateway = io.flag("gateway") ?? process.env.WORKTRUST_REMOTE_GATEWAY ?? settings.gateway;
|
|
@@ -80,8 +82,9 @@ async function enable(io) {
|
|
|
80
82
|
if (!identity || io.has("repair")) {
|
|
81
83
|
const keys = newKeys();
|
|
82
84
|
const pub = P.publicKeysOf(P.importSecretKeys(keys));
|
|
85
|
+
const road = sub !== "enable" ? sub : io.has("device") ? "web" : await chooseRoad({ yes: io.has("yes") });
|
|
83
86
|
try {
|
|
84
|
-
const paired = await pairComputer({ origin: io.origin, secret: P.importSecretKeys(keys), publicKeys: pub, host: hostname(), os: io.os, device: io.has("device"), issuerKeys: issuerKeys(gateway), say: io.say, openBrowser: io.openBrowser });
|
|
87
|
+
const paired = await pairComputer({ origin: io.origin, secret: P.importSecretKeys(keys), publicKeys: pub, host: hostname(), os: io.os, device: io.has("device"), road, showQr: (link) => io.say(renderQr(qrMatrix(link).modules, { color: Boolean(process.stdout.isTTY) && !process.env.NO_COLOR })), issuerKeys: issuerKeys(gateway), say: io.say, openBrowser: io.openBrowser });
|
|
85
88
|
saveKeys(keys);
|
|
86
89
|
identity = { v: 1, device_id: paired.device_id, binding: paired.binding, sub: paired.sub, origin: io.origin, paired_at: Date.now() };
|
|
87
90
|
saveIdentity(identity);
|
|
@@ -158,7 +161,7 @@ async function phones(io, rest) {
|
|
|
158
161
|
const all = [...list.confirmed, ...list.pending], at = Date.now(); if (all.length === 0) return io.say(" No phone or browser is connected to this computer.");
|
|
159
162
|
if (process.stdin.isTTY && !(await askTyped(` Disconnect all ${all.length} phones and browsers from this computer now?`))) return io.say(" Nothing changed.");
|
|
160
163
|
savePhones({ ...list, pending: [], confirmed: [], removed: [...list.removed.filter((p) => !all.some((x) => x.device_id === p.device_id)), ...all.map((p) => ({ device_id: p.device_id, fingerprint: p.fingerprint, how: "keyboard", removed_at: at }))].slice(-20) });
|
|
161
|
-
return io.say(` ✓ Disconnected ${all.length}: none of them can steer this computer any more. Live sessions they started keep running here; stop them with npx worktrust remote disable, or pause everything with npx worktrust remote pause.\n End their keys for your whole account too: app.worktrust.io › Settings ›
|
|
164
|
+
return io.say(` ✓ Disconnected ${all.length}: none of them can steer this computer any more. Live sessions they started keep running here; stop them with npx worktrust remote disable, or pause everything with npx worktrust remote pause.\n End their keys for your whole account too: app.worktrust.io › Settings › Remote Agent, or Remote Agent settings on your phone.`);
|
|
162
165
|
}
|
|
163
166
|
if (rest[0] === "remove") {
|
|
164
167
|
const phone = find(rest[1]);
|
|
@@ -295,7 +298,7 @@ function status(io) {
|
|
|
295
298
|
|
|
296
299
|
export async function remoteCommand(args, io) {
|
|
297
300
|
const [sub = "help", ...rest] = args;
|
|
298
|
-
if (sub === "enable") return enable(io);
|
|
301
|
+
if (sub === "enable" || sub === "app" || sub === "web") return enable(io, sub);
|
|
299
302
|
if (sub === "pair") return pair(io);
|
|
300
303
|
if (sub === "status") return status(io);
|
|
301
304
|
if (sub === "pause" || sub === "resume") { const s = loadSettings(); saveSettings({ ...s, paused: sub === "pause" ? "desk" : null }); io.say(sub === "pause" ? " Paused: every command from a phone is refused until `npx worktrust remote resume`." : " Resumed."); return; }
|
|
@@ -335,5 +338,5 @@ export async function remoteCommand(args, io) {
|
|
|
335
338
|
if (sub === "releases") return releasesCommand(io, rest);
|
|
336
339
|
if (sub === "terminal") return (await import("./remote-terminal-cli.mjs")).terminalCommand(io, rest, askTyped);
|
|
337
340
|
if (sub === "attach") return (await import("./remote-terminal-cli.mjs")).attachCommand(io, rest);
|
|
338
|
-
io.say(" npx worktrust remote enable | pair | status | pause | resume | disable [--forget] | phones [confirm|remove <id>|remove --all|allow-endorse on|off] | projects add|remove|list | run | pipeline review <folder>|status | roots add|remove|list | preview allow|deny|list | codex on|off | opencode on|off | terminal on|off|list|start | attach <id> | releases [released <n>]");
|
|
341
|
+
io.say(" npx worktrust remote app | web | enable | pair | status | pause | resume | disable [--forget] | phones [confirm|remove <id>|remove --all|allow-endorse on|off] | projects add|remove|list | run | pipeline review <folder>|status | roots add|remove|list | preview allow|deny|list | codex on|off | opencode on|off | terminal on|off|list|start | attach <id> | releases [released <n>]");
|
|
339
342
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OPENCODE'S `run --format json` STREAM, MAPPED TO THE PROTOCOL (owner, 2026-11-09: steer OpenCode, and through it Qwen on
|
|
3
|
-
* Ollama, from
|
|
3
|
+
* Ollama, from Remote Agent). Pure: one line in, the protocol's events out. Read from OpenCode's source (anomalyco/opencode,
|
|
4
4
|
* packages/cli/src/run/noninteractive.ts, the `renderer`'s `emit`, read 2026-11-09): every line is
|
|
5
5
|
* `{ type, timestamp, sessionID, ... }`, and these are the ones it writes:
|
|
6
6
|
*
|
package/remote-pairing.mjs
CHANGED
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
* them. The person approves in the Passport app, signed in, with their second factor; the browser comes back to
|
|
7
7
|
* 127.0.0.1 with a one-time code that only this terminal, with its verifier, can exchange for the issuer's signed binding.
|
|
8
8
|
* Without a browser (`--device`, SSH) a typed code instead. The binding is verified against the issuer keys pinned in this
|
|
9
|
-
* release before anything is saved.
|
|
9
|
+
* release before anything is saved.
|
|
10
|
+
*
|
|
11
|
+
* TWO ROADS (owner, 2026-11-12): `remote web` opens the browser's approval page, as before; `remote app` opens nothing and
|
|
12
|
+
* shows the same approval link as a QR here, which the WorkTrust app scans and approves with the authenticator (ISSUER.md
|
|
13
|
+
* §2b). Nothing comes back to 127.0.0.1 from a phone, so on both roads this terminal also polls the token door with its
|
|
14
|
+
* device code and verifier: a phone's approval is collected that way, a browser's still by its one-time code. A Passport app without the issuer answers 404, and this says so and changes nothing.
|
|
10
15
|
* The measurement key is never read, sent or used here.
|
|
11
16
|
*/
|
|
12
17
|
import { createHash, randomBytes } from "node:crypto";
|
|
13
18
|
import { createServer } from "node:http";
|
|
19
|
+
import { createInterface } from "node:readline/promises";
|
|
14
20
|
import * as P from "./remote-protocol.mjs";
|
|
15
21
|
|
|
16
22
|
const PROOF = P.utf8Encode("worktrust-remote/v1/pair-request\n");
|
|
@@ -26,8 +32,20 @@ async function post(origin, path, body) {
|
|
|
26
32
|
return { status: response.status, json: await response.json().catch(() => ({})) };
|
|
27
33
|
}
|
|
28
34
|
|
|
29
|
-
/**
|
|
30
|
-
export async function
|
|
35
|
+
/** `remote enable`'s question: the app's QR here (Enter), or the browser. Not a terminal, or --yes: the browser, as before. */
|
|
36
|
+
export async function chooseRoad({ interactive = Boolean(process.stdin.isTTY), yes = false, prompt = null } = {}) {
|
|
37
|
+
if (!interactive || yes) return "web";
|
|
38
|
+
const rl = prompt ? null : createInterface({ input: process.stdin, output: process.stdout });
|
|
39
|
+
const answer = (await (prompt ?? ((q) => rl.question(q)))(" Approve with the WorkTrust app (QR here) or in the browser? [A/w] ")).trim().toLowerCase();
|
|
40
|
+
rl?.close();
|
|
41
|
+
return ["w", "web", "b", "browser"].includes(answer) ? "web" : "app";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Pair, and return the verified binding. `keys` holds the secret pair (never sent), `issuerKeys` the pinned keys. `road`:
|
|
46
|
+
* "web" opens the approval page in the browser; "app" draws its link with `showQr` for the WorkTrust app and opens nothing.
|
|
47
|
+
*/
|
|
48
|
+
export async function pairComputer({ origin, secret, publicKeys, host, os, device = false, road = "web", showQr = () => {}, issuerKeys, say, openBrowser, now = Date.now }) {
|
|
31
49
|
const verifier = randomBytes(32).toString("base64url");
|
|
32
50
|
const code_challenge = createHash("sha256").update(verifier).digest("base64url");
|
|
33
51
|
const state = randomBytes(24).toString("base64url");
|
|
@@ -56,13 +74,30 @@ export async function pairComputer({ origin, secret, publicKeys, host, os, devic
|
|
|
56
74
|
say(" Approve only if the WorkTrust page shows the same code and key.");
|
|
57
75
|
let exchanged = null;
|
|
58
76
|
if (!device) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
if (road === "app") {
|
|
78
|
+
say(" Scan this with the WorkTrust app (or the phone's camera) and approve with your authenticator code:");
|
|
79
|
+
showQr(authorize_url);
|
|
80
|
+
say(` Link: ${authorize_url}`);
|
|
81
|
+
} else {
|
|
82
|
+
say(` Approve in your browser (opening it). If it does not open: ${authorize_url}`);
|
|
83
|
+
openBrowser(authorize_url);
|
|
84
|
+
}
|
|
85
|
+
// The browser's one-time code arrives at 127.0.0.1; a phone's approval only by polling (device code and verifier).
|
|
86
|
+
let code = null;
|
|
87
|
+
void answer.then((c) => { code = c; });
|
|
88
|
+
const until = now() + expires_in * 1000;
|
|
89
|
+
let wait = Math.max(1, interval) * 1000;
|
|
90
|
+
while (!code && !exchanged && now() < until) {
|
|
91
|
+
await Promise.race([answer, new Promise((resolve) => setTimeout(resolve, wait))]);
|
|
92
|
+
if (code) break;
|
|
93
|
+
const reply = await post(origin, "/api/remote/token", { device_code, code_verifier: verifier }).catch(() => null);
|
|
94
|
+
if (reply?.status === 200) exchanged = reply;
|
|
95
|
+
else if (reply?.json?.error === "slow_down") wait += 2000;
|
|
96
|
+
else if (reply?.json?.error === "access_denied" || reply?.json?.error === "expired_token") throw new PairingRefused(`pairing ended (${reply.json.error})`);
|
|
97
|
+
// authorization_pending, or invalid_grant from an issuer before 2026-11-12 (no codeless loopback poll): wait on.
|
|
98
|
+
}
|
|
99
|
+
if (!exchanged && !code) throw new PairingRefused("no approval arrived in time");
|
|
100
|
+
if (!exchanged) exchanged = await post(origin, "/api/remote/token", { device_code, code, code_verifier: verifier });
|
|
66
101
|
} else {
|
|
67
102
|
say(` On any device open ${verification_uri} and type the code.`);
|
|
68
103
|
const until = now() + expires_in * 1000;
|
package/worktrust.mjs
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* command on a coupled computer offers an export lying in ~/Downloads once.
|
|
27
27
|
* npx worktrust disconnect show what comes out, ask, take it out again
|
|
28
28
|
* npx worktrust status what is coupled here
|
|
29
|
-
* npx worktrust remote enable|pair|status|pause|resume|disable|phones|projects|run steer this computer's agents
|
|
29
|
+
* npx worktrust remote app|web|enable|pair|status|pause|resume|disable|phones|projects|run steer this computer's agents
|
|
30
30
|
* from your phone (remote-cli.mjs; opt-in, its own key, never the measurement key)
|
|
31
31
|
* npx worktrust@latest preserve how long each AI app here keeps its sessions (--apply keeps them,
|
|
32
32
|
* --archive [dir] a local metadata-only record, --verify [dir] checks it,
|
|
@@ -78,7 +78,7 @@ const command = args.includes("--help") ? "help" : args.includes("--version") ?
|
|
|
78
78
|
const flag = (name) => { const at = args.indexOf(`--${name}`); return at >= 0 ? args[at + 1] : undefined; };
|
|
79
79
|
const has = (name) => args.includes(`--${name}`);
|
|
80
80
|
/** 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). */
|
|
81
|
-
const CLI_VERSION = "0.11.
|
|
81
|
+
const CLI_VERSION = "0.11.6";
|
|
82
82
|
/**
|
|
83
83
|
* 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
|
|
84
84
|
* to offer). Raised ONLY when what is measured changes: the timeline, the seconds, the tokens, the steering, the session
|
|
@@ -1776,7 +1776,9 @@ else if (command === "orchestration") {
|
|
|
1776
1776
|
if (!["orchestration-report.mjs", "orchestration-evidence.mjs", "orchestration-contract.mjs"].every((name) => existsSync(join(HERE, name)))) fail("Local agent reports need the complete WorkTrust npm/Python package or preservation kit. No file was read or sent.");
|
|
1777
1777
|
const { reportFile } = await import("./orchestration-report.mjs"); reportFile(args.slice(1));
|
|
1778
1778
|
}
|
|
1779
|
-
|
|
1779
|
+
// A word the CLI does not know (the owner typed `update,` on 2026-11-11 and got the help with no reason): say so, then the
|
|
1780
|
+
// help, and end with a failure code so a script notices.
|
|
1781
|
+
else { if (command !== "help") { say(` Unknown command: ${command}. The commands are below.`); process.exitCode = 1; } help(); }
|
|
1780
1782
|
|
|
1781
1783
|
}
|
|
1782
1784
|
try { await main(); } catch (error) { if (!(error instanceof CliFailure)) throw error; process.exitCode = 1; }
|