@4xeoz/re-entry 0.2.13 → 0.2.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/README.md +42 -22
- package/package.json +1 -1
- package/src/main.mjs +38 -28
package/README.md
CHANGED
|
@@ -18,7 +18,8 @@ Requirements: macOS, Node.js 24+, Codex installed and signed in, and an absolute
|
|
|
18
18
|
Codex may read and write.
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
npx
|
|
21
|
+
npx --yes --package=@4xeoz/re-entry re-entry install \
|
|
22
|
+
--receiver https://your-accepted-receiver.example
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
`npx` runs a temporary copy, so it does not leave a permanent shell command behind. Install the
|
|
@@ -29,7 +30,8 @@ npm install --global @4xeoz/re-entry
|
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
The package installs both `re-entry` and the older `reentry` spelling; `re-entry` is the documented
|
|
32
|
-
command.
|
|
33
|
+
command. If you keep using the temporary `npx` form, run later commands with the same executable
|
|
34
|
+
prefix, for example `npx --yes --package=@4xeoz/re-entry re-entry status`.
|
|
33
35
|
|
|
34
36
|
The CLI no longer has a default hosted Receiver. For any new or historical test, pass an explicit
|
|
35
37
|
accepted Receiver origin with `--receiver` or `REENTRY_RECEIVER_ORIGIN`; the former
|
|
@@ -39,13 +41,14 @@ The interactive CLI first offers Desktop, the current folder, or a small folder
|
|
|
39
41
|
with ↑/↓ and Enter. If you want to skip the picker, pass the workspace directly:
|
|
40
42
|
|
|
41
43
|
```sh
|
|
42
|
-
npx
|
|
44
|
+
npx --yes --package=@4xeoz/re-entry re-entry install \
|
|
45
|
+
--receiver https://your-accepted-receiver.example \
|
|
43
46
|
--codex-cd /absolute/path/to/your/project
|
|
44
47
|
```
|
|
45
48
|
|
|
46
49
|
The guided screen stays intentionally small: **Workspace → System check → Connect Re-entry**. It
|
|
47
|
-
shows one
|
|
48
|
-
paths stay out of the normal success screen.
|
|
50
|
+
shows one executable next command when setup finishes; internal Connector IDs, credential paths, and
|
|
51
|
+
log paths stay out of the normal success screen.
|
|
49
52
|
|
|
50
53
|
Run this from the Host project directory, your home directory, or another normal working
|
|
51
54
|
directory—not from a checked-out `runtime/local-connector` package directory. npm can treat that
|
|
@@ -56,7 +59,9 @@ installation instead:
|
|
|
56
59
|
|
|
57
60
|
```sh
|
|
58
61
|
npm install --global @4xeoz/re-entry
|
|
59
|
-
re-entry install
|
|
62
|
+
re-entry install \
|
|
63
|
+
--receiver https://your-accepted-receiver.example \
|
|
64
|
+
--codex-cd /absolute/path/to/your/project
|
|
60
65
|
```
|
|
61
66
|
|
|
62
67
|
Use `--receiver` to select an accepted replacement Receiver, such as a local historical preview:
|
|
@@ -86,29 +91,43 @@ preview.
|
|
|
86
91
|
|
|
87
92
|
## Check it
|
|
88
93
|
|
|
94
|
+
If you installed the package globally:
|
|
95
|
+
|
|
89
96
|
```sh
|
|
90
97
|
re-entry status
|
|
91
98
|
re-entry listen
|
|
92
99
|
re-entry --help
|
|
100
|
+
re-entry stop
|
|
101
|
+
re-entry uninstall
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If you used the temporary `npx` invocation:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
npx --yes --package=@4xeoz/re-entry re-entry status
|
|
108
|
+
npx --yes --package=@4xeoz/re-entry re-entry listen
|
|
109
|
+
npx --yes --package=@4xeoz/re-entry re-entry --help
|
|
110
|
+
npx --yes --package=@4xeoz/re-entry re-entry stop
|
|
111
|
+
npx --yes --package=@4xeoz/re-entry re-entry uninstall
|
|
93
112
|
```
|
|
94
113
|
|
|
95
114
|
The status view checks the local authorization, background job, Receiver reachability, Node, and
|
|
96
115
|
Codex. If the Receiver rejects a previously saved device credential, the Connector pauses instead
|
|
97
|
-
of retrying forever, and `status`/`listen`
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
of retrying forever, and `status`/`listen` print an executable `connect` command. `listen` watches the
|
|
117
|
+
already-running background Connector and displays new activity until you press Ctrl+C; it does not
|
|
118
|
+
start a competing second poller. Useful development commands are:
|
|
100
119
|
|
|
101
120
|
```sh
|
|
102
|
-
re-entry doctor --codex-cd /absolute/path/to/project
|
|
103
|
-
re-entry connect --receiver http://127.0.0.1:43224
|
|
104
|
-
re-entry claim-once --codex-cd /absolute/path/to/project
|
|
105
|
-
re-entry start --codex-cd /absolute/path/to/project
|
|
121
|
+
npx --yes --package=@4xeoz/re-entry re-entry doctor --codex-cd /absolute/path/to/project
|
|
122
|
+
npx --yes --package=@4xeoz/re-entry re-entry connect --receiver http://127.0.0.1:43224
|
|
123
|
+
npx --yes --package=@4xeoz/re-entry re-entry claim-once --codex-cd /absolute/path/to/project
|
|
124
|
+
npx --yes --package=@4xeoz/re-entry re-entry start --codex-cd /absolute/path/to/project
|
|
106
125
|
```
|
|
107
126
|
|
|
108
127
|
Test the local Codex handoff without waiting for Cloud work:
|
|
109
128
|
|
|
110
129
|
```sh
|
|
111
|
-
re-entry test "Reply with: Re-entry is working."
|
|
130
|
+
npx --yes --package=@4xeoz/re-entry re-entry test "Reply with: Re-entry is working."
|
|
112
131
|
```
|
|
113
132
|
|
|
114
133
|
This starts one fresh local Codex process through the same adapter seam used by real deliveries. It
|
|
@@ -117,8 +136,8 @@ does not create a Grant, claim Receiver work, or prove the browser/WebMCP return
|
|
|
117
136
|
To pause or remove the local Connector:
|
|
118
137
|
|
|
119
138
|
```sh
|
|
120
|
-
re-entry stop
|
|
121
|
-
re-entry uninstall
|
|
139
|
+
npx --yes --package=@4xeoz/re-entry re-entry stop
|
|
140
|
+
npx --yes --package=@4xeoz/re-entry re-entry uninstall
|
|
122
141
|
```
|
|
123
142
|
|
|
124
143
|
`stop` pauses the macOS background service and keeps the account connection. `uninstall` requires
|
|
@@ -139,8 +158,8 @@ Install the Re-entry Local Connector on this Mac. First read the package README.
|
|
|
139
158
|
or newer and locate the Connector executable. Run `npx --yes --package=@4xeoz/re-entry re-entry install` with an absolute
|
|
140
159
|
project directory. Let the human create or sign in to a Re-entry account, click Pair this Mac, and
|
|
141
160
|
enter the code in the CLI; never copy browser cookies, organization keys, Connector tokens, or private keys
|
|
142
|
-
into chat, logs, source files, or git. Finish by running `re-entry status`
|
|
143
|
-
results without claiming Browser/WebMCP or production deployment.
|
|
161
|
+
into chat, logs, source files, or git. Finish by running `npx --yes --package=@4xeoz/re-entry re-entry status`
|
|
162
|
+
and report the bounded results without claiming Browser/WebMCP or production deployment.
|
|
144
163
|
```
|
|
145
164
|
|
|
146
165
|
## Package map
|
|
@@ -208,15 +227,16 @@ npm run verify
|
|
|
208
227
|
npm publish --access public
|
|
209
228
|
```
|
|
210
229
|
|
|
211
|
-
NPM versions are immutable: if the
|
|
212
|
-
publishing
|
|
230
|
+
NPM versions are immutable: if the target version has already been published, bump it before
|
|
231
|
+
publishing with `npm version patch --no-git-tag-version`.
|
|
213
232
|
|
|
214
233
|
After publishing, users run `npx --yes --package=@4xeoz/re-entry re-entry install`. The explicit
|
|
215
234
|
`--package` form works across npm versions when the package is scoped; the executable itself is
|
|
216
235
|
still named `re-entry`.
|
|
217
236
|
|
|
218
|
-
|
|
219
|
-
@4xeoz/re-entry` once and then
|
|
237
|
+
A temporary `npx` invocation does not add `re-entry` to your shell `PATH`. If you prefer the shorter
|
|
238
|
+
bare commands, run `npm install --global @4xeoz/re-entry` once and then use `re-entry install`
|
|
239
|
+
directly.
|
|
220
240
|
|
|
221
241
|
## Check a Mac before pairing
|
|
222
242
|
|
package/package.json
CHANGED
package/src/main.mjs
CHANGED
|
@@ -41,6 +41,8 @@ const DEFAULT_POLL_INTERVAL_MS = 5_000;
|
|
|
41
41
|
const DEFAULT_MAX_CONSECUTIVE_ERRORS = 5;
|
|
42
42
|
const DEFAULT_PAIRING_REQUEST_TIMEOUT_MS = 20_000;
|
|
43
43
|
const CONNECTOR_VERSION = readConnectorVersion();
|
|
44
|
+
// The npx form is executable even when this CLI was launched from a temporary npx cache.
|
|
45
|
+
const TEMPORARY_CLI_COMMAND = "npx --yes --package=@4xeoz/re-entry re-entry";
|
|
44
46
|
|
|
45
47
|
async function main() {
|
|
46
48
|
let ui;
|
|
@@ -129,6 +131,10 @@ Usage:
|
|
|
129
131
|
re-entry listen Watch live activity
|
|
130
132
|
re-entry test "Reply with hello" Test Codex locally
|
|
131
133
|
|
|
134
|
+
Invocation:
|
|
135
|
+
Temporary npx: npx --yes --package=@4xeoz/re-entry re-entry <command>
|
|
136
|
+
Global install: npm install --global @4xeoz/re-entry, then re-entry <command>
|
|
137
|
+
|
|
132
138
|
Commands:
|
|
133
139
|
install Check this Mac, connect the Re-entry account, and start at login
|
|
134
140
|
status Show account, Receiver, service, Node.js, and Codex readiness
|
|
@@ -156,6 +162,10 @@ The Connector opens no inbound port. Host keys never belong on this Mac.
|
|
|
156
162
|
`);
|
|
157
163
|
}
|
|
158
164
|
|
|
165
|
+
function cliCommand(command) {
|
|
166
|
+
return `${TEMPORARY_CLI_COMMAND} ${command}`;
|
|
167
|
+
}
|
|
168
|
+
|
|
159
169
|
function readConnectorVersion() {
|
|
160
170
|
const packageJson = JSON.parse(
|
|
161
171
|
readFileSync(new URL("../package.json", import.meta.url), "utf8"),
|
|
@@ -265,7 +275,7 @@ async function pair(flags, ui, options = {}) {
|
|
|
265
275
|
});
|
|
266
276
|
if (ui.interactive) {
|
|
267
277
|
ui.complete("Pairing complete", "Re-entry can now deliver approved work to this Mac.");
|
|
268
|
-
ui.next("
|
|
278
|
+
ui.next(cliCommand("start"), "Wait for approved work in this terminal.");
|
|
269
279
|
} else {
|
|
270
280
|
process.stdout.write(`${JSON.stringify({ event: "connector_paired", connector_id: credentials.connector_id })}\n`);
|
|
271
281
|
}
|
|
@@ -288,7 +298,7 @@ async function connect(flags, ui, options = {}) {
|
|
|
288
298
|
if (ui.interactive) {
|
|
289
299
|
ui.success("Account", "already connected");
|
|
290
300
|
if (!options.guidedInstall) {
|
|
291
|
-
ui.next("
|
|
301
|
+
ui.next(cliCommand("start"), "Wait for approved work in this terminal.");
|
|
292
302
|
}
|
|
293
303
|
} else {
|
|
294
304
|
process.stdout.write(`${JSON.stringify({
|
|
@@ -347,7 +357,7 @@ async function connect(flags, ui, options = {}) {
|
|
|
347
357
|
if (ui.interactive) {
|
|
348
358
|
if (!options.guidedInstall) {
|
|
349
359
|
ui.complete("This Mac is connected", "Re-entry can now route approved work here.");
|
|
350
|
-
ui.next("
|
|
360
|
+
ui.next(cliCommand("start"), "Wait for approved work in this terminal.");
|
|
351
361
|
}
|
|
352
362
|
} else {
|
|
353
363
|
process.stdout.write(`${JSON.stringify({
|
|
@@ -386,14 +396,14 @@ async function status(flags, ui) {
|
|
|
386
396
|
else if (credentials) ui.warning("Cloud", "unavailable");
|
|
387
397
|
|
|
388
398
|
if (reauthorizationRequired) {
|
|
389
|
-
ui.next("
|
|
399
|
+
ui.next(cliCommand("connect"), "Approve this Mac again in your browser; the old credential was rejected.");
|
|
390
400
|
} else if (!connected || !service.running) {
|
|
391
|
-
ui.next("
|
|
401
|
+
ui.next(cliCommand("install"), "Finish setup and start Re-entry in the background.");
|
|
392
402
|
} else if (!receiverReady) {
|
|
393
|
-
ui.next("
|
|
403
|
+
ui.next(cliCommand("status"), "Check again when the Re-entry Cloud service is available.");
|
|
394
404
|
} else {
|
|
395
405
|
ui.complete("Everything looks good", "Re-entry is ready for approved work.");
|
|
396
|
-
ui.next("
|
|
406
|
+
ui.next(cliCommand("listen"), "Watch live activity. Press Ctrl+C when you are done.");
|
|
397
407
|
}
|
|
398
408
|
} else {
|
|
399
409
|
process.stdout.write(`${JSON.stringify({
|
|
@@ -425,11 +435,11 @@ async function listen(flags, ui) {
|
|
|
425
435
|
if (ui.interactive) {
|
|
426
436
|
if (reauthorizationRequired) {
|
|
427
437
|
ui.warning("Account", "reconnect required; the Cloud Receiver rejected this Mac");
|
|
428
|
-
ui.next("
|
|
438
|
+
ui.next(cliCommand("connect"), "Approve this Mac again in your browser.");
|
|
429
439
|
}
|
|
430
440
|
if (!credentials) ui.warning("Account", "not connected");
|
|
431
441
|
if (!service.running) ui.warning("Background", "not running");
|
|
432
|
-
ui.next("
|
|
442
|
+
ui.next(cliCommand("install"), "Finish setup and start the background Connector.");
|
|
433
443
|
} else {
|
|
434
444
|
process.stdout.write(`${JSON.stringify({
|
|
435
445
|
event: "connector_listener_unavailable",
|
|
@@ -494,7 +504,7 @@ async function testCodex(flags, positionals, ui) {
|
|
|
494
504
|
if (ui.interactive) {
|
|
495
505
|
ui.stopWait("Codex", "completed the local test");
|
|
496
506
|
ui.complete("Test passed", "The same fresh-session process seam is ready for Re-entry work.");
|
|
497
|
-
ui.next("
|
|
507
|
+
ui.next(cliCommand("listen"), "Watch the background Connector for approved work.");
|
|
498
508
|
} else {
|
|
499
509
|
process.stdout.write('{"event":"connector_codex_test_passed"}\n');
|
|
500
510
|
}
|
|
@@ -511,7 +521,7 @@ function reportLiveActivity(event, ui) {
|
|
|
511
521
|
);
|
|
512
522
|
} else if (event.event === "connector_reauthorization_required" || event.code === "connector_identity_invalid") {
|
|
513
523
|
ui.stopWait("Reconnect required", "the Cloud Receiver rejected this Mac's saved connection", "warning");
|
|
514
|
-
ui.next("
|
|
524
|
+
ui.next(cliCommand("connect"), "Approve this Mac again in your browser.");
|
|
515
525
|
return;
|
|
516
526
|
} else if (event.event === "connector_poll_failed" || event.event === "local_connector_failed") {
|
|
517
527
|
ui.stopWait("Connection interrupted", "Re-entry is retrying", "warning");
|
|
@@ -534,7 +544,7 @@ async function stop(flags, ui) {
|
|
|
534
544
|
if (!result.supported) ui.warning("Platform", "background service control currently supports macOS only");
|
|
535
545
|
else if (result.stopped) ui.complete("Re-entry is paused", "Your account connection is still saved.");
|
|
536
546
|
else ui.info("Already stopped", "no running background Connector was found");
|
|
537
|
-
if (result.supported) ui.next("
|
|
547
|
+
if (result.supported) ui.next(cliCommand("install"), "Start Re-entry in the background again.");
|
|
538
548
|
} else {
|
|
539
549
|
process.stdout.write(`${JSON.stringify({
|
|
540
550
|
event: "connector_stopped",
|
|
@@ -557,7 +567,7 @@ async function uninstall(flags, ui) {
|
|
|
557
567
|
});
|
|
558
568
|
if (ui.interactive) {
|
|
559
569
|
ui.complete("Removed from this Mac", "The local service, connection, and logs are gone.");
|
|
560
|
-
ui.next("
|
|
570
|
+
ui.next(cliCommand("install"), "Connect this Mac again whenever you are ready.");
|
|
561
571
|
} else {
|
|
562
572
|
process.stdout.write(`${JSON.stringify({
|
|
563
573
|
event: "connector_uninstalled",
|
|
@@ -589,7 +599,7 @@ async function install(flags, ui) {
|
|
|
589
599
|
if (ui.interactive) {
|
|
590
600
|
ui.stopWait("Background", "running at login");
|
|
591
601
|
ui.complete("You're all set", "Re-entry is connected and waiting for approved work.");
|
|
592
|
-
ui.next("
|
|
602
|
+
ui.next(cliCommand("listen"), "Watch live activity. Press Ctrl+C when you are done.");
|
|
593
603
|
} else {
|
|
594
604
|
process.stdout.write(`${JSON.stringify({
|
|
595
605
|
event: "connector_service_installed",
|
|
@@ -628,7 +638,7 @@ async function start(flags, ui) {
|
|
|
628
638
|
} else if (await hasConnectorReauthorizationRequired(credentialFile)) {
|
|
629
639
|
if (ui.interactive) {
|
|
630
640
|
ui.warning("Account", "this Mac needs to be connected again");
|
|
631
|
-
ui.next("
|
|
641
|
+
ui.next(cliCommand("connect"), "Create a new dashboard pairing code and connect this Mac again.");
|
|
632
642
|
} else {
|
|
633
643
|
process.stdout.write('{"event":"connector_reauthorization_required"}\n');
|
|
634
644
|
}
|
|
@@ -674,7 +684,7 @@ async function start(flags, ui) {
|
|
|
674
684
|
});
|
|
675
685
|
if (ui.interactive) {
|
|
676
686
|
ui.stopWait("Reconnect required", "the Cloud Receiver rejected this Mac's saved connection", "warning");
|
|
677
|
-
ui.next("
|
|
687
|
+
ui.next(cliCommand("connect"), "Approve this Mac again in your browser.");
|
|
678
688
|
} else {
|
|
679
689
|
process.stdout.write('{"event":"connector_reauthorization_required"}\n');
|
|
680
690
|
}
|
|
@@ -1038,15 +1048,15 @@ function errorHint(error) {
|
|
|
1038
1048
|
connector_codex_cd_missing: "pass --codex-cd /absolute/path/to/your/Host-project",
|
|
1039
1049
|
connector_codex_not_found: "install Codex, add it to PATH, or pass --codex-binary /path/to/codex",
|
|
1040
1050
|
connector_codex_binary_not_found: "check --codex-binary or remove it to use automatic discovery",
|
|
1041
|
-
connector_codex_unusable:
|
|
1051
|
+
connector_codex_unusable: `open Codex, complete login if needed, then run \`${cliCommand("doctor")}\` again`,
|
|
1042
1052
|
connector_node_unsupported: "use Node.js 24 or newer, then run the command again",
|
|
1043
1053
|
connector_receiver_missing: "pass --receiver <replacement-receiver-origin> or set REENTRY_RECEIVER_ORIGIN",
|
|
1044
|
-
connector_credentials_missing:
|
|
1045
|
-
connector_credentials_expired:
|
|
1054
|
+
connector_credentials_missing: `connect this Mac once with \`${cliCommand("connect")}\``,
|
|
1055
|
+
connector_credentials_expired: `run \`${cliCommand("connect")}\` to authorize this Mac again`,
|
|
1046
1056
|
connector_credentials_already_exists: "use the existing Connector credential or ask for a new pairing code",
|
|
1047
|
-
connector_identity_invalid:
|
|
1048
|
-
connector_reauthorization_required:
|
|
1049
|
-
connector_pairing_code_missing:
|
|
1057
|
+
connector_identity_invalid: `run \`${cliCommand("connect")}\` and approve this Mac again`,
|
|
1058
|
+
connector_reauthorization_required: `run \`${cliCommand("connect")}\` and approve this Mac again`,
|
|
1059
|
+
connector_pairing_code_missing: `ask the Host backend for a new pairing code, then run \`${cliCommand("pair")}\` in a terminal`,
|
|
1050
1060
|
pairing_code_invalid: "use the 16-character code returned by the Host, for example ABCD-EFGH-IJKL-MNOP",
|
|
1051
1061
|
host_subject_already_paired: "use the existing Connector credential or revoke/reset the preview pairing",
|
|
1052
1062
|
pairing_expired: "ask the Host backend for a new pairing code",
|
|
@@ -1054,14 +1064,14 @@ function errorHint(error) {
|
|
|
1054
1064
|
pairing_network_error: "check your internet connection and the Receiver address, then try again",
|
|
1055
1065
|
workspace_directory_unavailable: "choose a readable folder or pass --codex-cd /absolute/path",
|
|
1056
1066
|
workspace_selection_cancelled: "run the command again when you are ready to choose a workspace",
|
|
1057
|
-
device_authorization_expired:
|
|
1058
|
-
device_authorization_denied:
|
|
1067
|
+
device_authorization_expired: `run \`${cliCommand("connect")}\` again and approve within ten minutes`,
|
|
1068
|
+
device_authorization_denied: `run \`${cliCommand("connect")}\` again when you are ready to approve this Mac`,
|
|
1059
1069
|
connector_poll_interval_invalid: "use a polling interval between 1000 and 60000 milliseconds",
|
|
1060
1070
|
connector_max_errors_invalid: "use a maximum error count between 1 and 20",
|
|
1061
|
-
connector_service_load_failed:
|
|
1062
|
-
connector_uninstall_confirmation_required:
|
|
1063
|
-
connector_service_stop_failed:
|
|
1064
|
-
connector_test_prompt_missing:
|
|
1071
|
+
connector_service_load_failed: `run \`${cliCommand("install")}\` again; if it still fails, inspect the Connector error log`,
|
|
1072
|
+
connector_uninstall_confirmation_required: `run \`${cliCommand("uninstall")}\` interactively and type DELETE, or pass \`--yes\` in a deliberate script`,
|
|
1073
|
+
connector_service_stop_failed: `check the Connector status and try \`${cliCommand("stop")}\` again`,
|
|
1074
|
+
connector_test_prompt_missing: `use \`${cliCommand('test "Reply with: Re-entry is working."')}\``,
|
|
1065
1075
|
connector_test_prompt_invalid: "use one short, single-line prompt inside quotes",
|
|
1066
1076
|
connector_activation_timeout_invalid: "use an activation timeout between 100 and 60000 milliseconds",
|
|
1067
1077
|
};
|