@4xeoz/re-entry 0.2.18 → 0.2.19
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 +28 -27
- package/package.json +1 -1
- package/src/main.mjs +96 -4
- package/src/terminal-ui.mjs +22 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Requirements: macOS, Node.js 24+, Codex installed and signed in, and an absolute
|
|
|
19
19
|
Codex may read and write.
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
npx --yes
|
|
22
|
+
npx --yes @4xeoz/re-entry install
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
`npx` runs a temporary copy, so it does not leave a permanent shell command behind. Install the
|
|
@@ -30,8 +30,8 @@ npm install --global @4xeoz/re-entry
|
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
The package installs both `re-entry` and the older `reentry` spelling; `re-entry` is the documented
|
|
33
|
-
command. If you keep using the temporary `npx` form, run later commands with the same
|
|
34
|
-
prefix, for example `npx --yes
|
|
33
|
+
command. If you keep using the temporary `npx` form, run later commands with the same short
|
|
34
|
+
executable prefix, for example `npx --yes @4xeoz/re-entry status`.
|
|
35
35
|
|
|
36
36
|
The CLI defaults to the current Cloud Receiver v2 preview at
|
|
37
37
|
`https://cloud-receiver-delta.vercel.app`. Override it with `--receiver` or
|
|
@@ -42,13 +42,14 @@ The interactive CLI first offers Desktop, the current folder, or a small folder
|
|
|
42
42
|
with ↑/↓ and Enter. If you want to skip the picker, pass the workspace directly:
|
|
43
43
|
|
|
44
44
|
```sh
|
|
45
|
-
npx --yes
|
|
45
|
+
npx --yes @4xeoz/re-entry install \
|
|
46
46
|
--codex-cd /absolute/path/to/your/project
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
The guided screen stays intentionally small: **Workspace → System check → Connect Re-entry**.
|
|
50
|
-
shows
|
|
51
|
-
|
|
49
|
+
The guided screen stays intentionally small: **Workspace → System check → Connect Re-entry**. On
|
|
50
|
+
success it shows a compact copy-paste command catalog for status, activity, testing, account
|
|
51
|
+
lifecycle, and local diagnostics. Internal Connector IDs, credential paths, and log paths stay out
|
|
52
|
+
of the normal success screen.
|
|
52
53
|
|
|
53
54
|
Run this from the Host project directory, your home directory, or another normal working
|
|
54
55
|
directory—not from a checked-out `runtime/local-connector` package directory. npm can treat that
|
|
@@ -66,7 +67,7 @@ re-entry install \
|
|
|
66
67
|
Use `--receiver` to select an accepted replacement Receiver, such as a local historical preview:
|
|
67
68
|
|
|
68
69
|
```sh
|
|
69
|
-
npx --yes
|
|
70
|
+
npx --yes @4xeoz/re-entry install \
|
|
70
71
|
--receiver http://127.0.0.1:43224 \
|
|
71
72
|
--codex-cd /absolute/path/to/your/project
|
|
72
73
|
```
|
|
@@ -104,12 +105,12 @@ re-entry uninstall
|
|
|
104
105
|
If you used the temporary `npx` invocation:
|
|
105
106
|
|
|
106
107
|
```sh
|
|
107
|
-
npx --yes
|
|
108
|
-
npx --yes
|
|
109
|
-
npx --yes
|
|
110
|
-
npx --yes
|
|
111
|
-
npx --yes
|
|
112
|
-
npx --yes
|
|
108
|
+
npx --yes @4xeoz/re-entry status
|
|
109
|
+
npx --yes @4xeoz/re-entry listen
|
|
110
|
+
npx --yes @4xeoz/re-entry --help
|
|
111
|
+
npx --yes @4xeoz/re-entry stop
|
|
112
|
+
npx --yes @4xeoz/re-entry disconnect
|
|
113
|
+
npx --yes @4xeoz/re-entry uninstall
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
The status view checks the local authorization, background job, Receiver reachability, Node, and
|
|
@@ -119,16 +120,16 @@ the already-running background Connector and displays new activity until you pre
|
|
|
119
120
|
not start a competing second poller. Useful development commands are:
|
|
120
121
|
|
|
121
122
|
```sh
|
|
122
|
-
npx --yes
|
|
123
|
-
npx --yes
|
|
124
|
-
npx --yes
|
|
125
|
-
npx --yes
|
|
123
|
+
npx --yes @4xeoz/re-entry doctor --codex-cd /absolute/path/to/project
|
|
124
|
+
npx --yes @4xeoz/re-entry connect --receiver http://127.0.0.1:43224
|
|
125
|
+
npx --yes @4xeoz/re-entry claim-once --codex-cd /absolute/path/to/project
|
|
126
|
+
npx --yes @4xeoz/re-entry start --codex-cd /absolute/path/to/project
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
Test the local Codex handoff without waiting for Cloud work:
|
|
129
130
|
|
|
130
131
|
```sh
|
|
131
|
-
npx --yes
|
|
132
|
+
npx --yes @4xeoz/re-entry test "Reply with: Re-entry is working."
|
|
132
133
|
```
|
|
133
134
|
|
|
134
135
|
This starts one fresh local Codex process through the same adapter seam used by real deliveries. It
|
|
@@ -144,9 +145,9 @@ The one-shot test allows up to one hour by default. Override it with
|
|
|
144
145
|
To pause or remove the local Connector:
|
|
145
146
|
|
|
146
147
|
```sh
|
|
147
|
-
npx --yes
|
|
148
|
-
npx --yes
|
|
149
|
-
npx --yes
|
|
148
|
+
npx --yes @4xeoz/re-entry stop
|
|
149
|
+
npx --yes @4xeoz/re-entry disconnect
|
|
150
|
+
npx --yes @4xeoz/re-entry uninstall
|
|
150
151
|
```
|
|
151
152
|
|
|
152
153
|
`stop` pauses the macOS background service and keeps the account connection. `uninstall` requires
|
|
@@ -178,10 +179,10 @@ Copy this prompt into a coding-agent task:
|
|
|
178
179
|
|
|
179
180
|
```text
|
|
180
181
|
Install the Re-entry Local Connector on this Mac. First read the package README. Verify Node.js 24
|
|
181
|
-
or newer and locate the Connector executable. Run `npx --yes
|
|
182
|
+
or newer and locate the Connector executable. Run `npx --yes @4xeoz/re-entry install` with an absolute
|
|
182
183
|
project directory. Let the human create or sign in to a Re-entry account, click Pair this Mac, and
|
|
183
184
|
enter the code in the CLI; never copy browser cookies, organization keys, Connector tokens, or private keys
|
|
184
|
-
into chat, logs, source files, or git. Finish by running `npx --yes
|
|
185
|
+
into chat, logs, source files, or git. Finish by running `npx --yes @4xeoz/re-entry status`
|
|
185
186
|
and report the bounded results without claiming Browser/WebMCP or production deployment.
|
|
186
187
|
```
|
|
187
188
|
|
|
@@ -254,9 +255,9 @@ npm publish --access public
|
|
|
254
255
|
NPM versions are immutable: if the target version has already been published, bump it before
|
|
255
256
|
publishing with `npm version patch --no-git-tag-version`.
|
|
256
257
|
|
|
257
|
-
After publishing, users run `npx --yes
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
After publishing, users run `npx --yes @4xeoz/re-entry install`. The executable itself is still
|
|
259
|
+
named `re-entry`; the short package form works with the scoped package. The command uses the
|
|
260
|
+
built-in preview Receiver unless `--receiver` or
|
|
260
261
|
`REENTRY_RECEIVER_ORIGIN` overrides it.
|
|
261
262
|
|
|
262
263
|
A temporary `npx` invocation does not add `re-entry` to your shell `PATH`. If you prefer the shorter
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4xeoz/re-entry",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Outbound Local Connector process for Re-entry Core; uses the Cloud Receiver v2 preview by default with an explicit override for other accepted origins.",
|
|
6
6
|
"publishConfig": {
|
package/src/main.mjs
CHANGED
|
@@ -49,7 +49,7 @@ const DEFAULT_MAX_CONSECUTIVE_ERRORS = 5;
|
|
|
49
49
|
const DEFAULT_PAIRING_REQUEST_TIMEOUT_MS = 20_000;
|
|
50
50
|
const CONNECTOR_VERSION = readConnectorVersion();
|
|
51
51
|
// The npx form is executable even when this CLI was launched from a temporary npx cache.
|
|
52
|
-
const TEMPORARY_CLI_COMMAND = "npx --yes
|
|
52
|
+
const TEMPORARY_CLI_COMMAND = "npx --yes @4xeoz/re-entry";
|
|
53
53
|
|
|
54
54
|
async function main() {
|
|
55
55
|
let ui;
|
|
@@ -144,7 +144,7 @@ Usage:
|
|
|
144
144
|
re-entry test "Reply with hello" Test Codex locally
|
|
145
145
|
|
|
146
146
|
Invocation:
|
|
147
|
-
Temporary npx: npx --yes
|
|
147
|
+
Temporary npx: npx --yes @4xeoz/re-entry <command>
|
|
148
148
|
Global install: npm install --global @4xeoz/re-entry, then re-entry <command>
|
|
149
149
|
|
|
150
150
|
Commands:
|
|
@@ -165,6 +165,8 @@ Common options:
|
|
|
165
165
|
--receiver <url> Accepted Receiver origin (overrides the preview default)
|
|
166
166
|
--codex-cd <path> Workspace for Codex; interactive mode offers a folder picker if omitted
|
|
167
167
|
--codex-binary <path> Explicit Codex executable
|
|
168
|
+
--activation-timeout <ms>
|
|
169
|
+
Codex limit; test defaults to 1 hour, background start to 60 seconds
|
|
168
170
|
--json Machine-readable output
|
|
169
171
|
--yes Confirm uninstall in a non-interactive script
|
|
170
172
|
--help Show this help
|
|
@@ -183,6 +185,96 @@ function cliCommand(command) {
|
|
|
183
185
|
return `${TEMPORARY_CLI_COMMAND} ${command}`;
|
|
184
186
|
}
|
|
185
187
|
|
|
188
|
+
function showInstallGuide(ui, workingDirectory) {
|
|
189
|
+
const workspace = shellQuote(workingDirectory);
|
|
190
|
+
ui.commands("COPY-PASTE COMMANDS", [
|
|
191
|
+
{
|
|
192
|
+
label: "Connect / install",
|
|
193
|
+
command: cliCommand(`install --codex-cd ${workspace}`),
|
|
194
|
+
detail: "run after disconnecting to connect one account on this Mac",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
label: "Check status",
|
|
198
|
+
command: cliCommand("status"),
|
|
199
|
+
detail: "account, Cloud, background service, Node.js, and Codex",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
label: "Watch activity",
|
|
203
|
+
command: cliCommand("listen"),
|
|
204
|
+
detail: "follow live work; Ctrl+C closes this view",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
label: "Test Codex",
|
|
208
|
+
command: cliCommand(`test "Reply exactly: Re-entry is working." --codex-cd ${workspace}`),
|
|
209
|
+
detail: "local smoke test; no Cloud work is claimed",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
label: "Check readiness",
|
|
213
|
+
command: cliCommand(`doctor --codex-cd ${workspace}`),
|
|
214
|
+
detail: "verify Node.js, Codex, and the workspace",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: "Start manually",
|
|
218
|
+
command: cliCommand(`start --codex-cd ${workspace}`),
|
|
219
|
+
detail: "foreground delivery loop for development",
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
label: "Check once",
|
|
223
|
+
command: cliCommand(`claim-once --codex-cd ${workspace}`),
|
|
224
|
+
detail: "one delivery check, then exit",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
label: "Pause",
|
|
228
|
+
command: cliCommand("stop"),
|
|
229
|
+
detail: "stop background delivery; keep the account connected",
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
label: "Sign out",
|
|
233
|
+
command: cliCommand("disconnect"),
|
|
234
|
+
detail: "clear this Mac's saved account connection",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "Remove setup",
|
|
238
|
+
command: cliCommand("uninstall"),
|
|
239
|
+
detail: "remove the local service, credential, and logs",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
label: "Show all help",
|
|
243
|
+
command: cliCommand("--help"),
|
|
244
|
+
detail: "all commands, options, and the legacy pairing command",
|
|
245
|
+
},
|
|
246
|
+
]);
|
|
247
|
+
ui.info("Account", "one account connected on this Mac; disconnect before connecting another");
|
|
248
|
+
ui.info("Test timeout", "one-shot Codex tests wait up to 1 hour by default");
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function showTestGuide(ui, workingDirectory, prompt) {
|
|
252
|
+
const workspace = shellQuote(workingDirectory);
|
|
253
|
+
ui.commands("COPY-PASTE COMMANDS", [
|
|
254
|
+
{
|
|
255
|
+
label: "Test again",
|
|
256
|
+
command: cliCommand(`test ${shellQuote(prompt)} --codex-cd ${workspace}`),
|
|
257
|
+
detail: "run another local Codex smoke test",
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
label: "Check readiness",
|
|
261
|
+
command: cliCommand(`doctor --codex-cd ${workspace}`),
|
|
262
|
+
detail: "verify Node.js, Codex, and the workspace",
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: "Show all help",
|
|
266
|
+
command: cliCommand("--help"),
|
|
267
|
+
detail: "all commands, options, and account lifecycle actions",
|
|
268
|
+
},
|
|
269
|
+
]);
|
|
270
|
+
ui.info("Scope", "local Codex test only; no account or Cloud work was used");
|
|
271
|
+
ui.info("Test timeout", "one-shot Codex tests wait up to 1 hour by default");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function shellQuote(value) {
|
|
275
|
+
return `'${String(value).replaceAll("'", "'\\''")}'`;
|
|
276
|
+
}
|
|
277
|
+
|
|
186
278
|
function readConnectorVersion() {
|
|
187
279
|
const packageJson = JSON.parse(
|
|
188
280
|
readFileSync(new URL("../package.json", import.meta.url), "utf8"),
|
|
@@ -537,7 +629,7 @@ async function testCodex(flags, positionals, ui) {
|
|
|
537
629
|
if (ui.interactive) {
|
|
538
630
|
ui.stopWait("Codex", "completed the local test");
|
|
539
631
|
ui.complete("Test passed", "The same fresh-session process seam is ready for Re-entry work.");
|
|
540
|
-
ui.
|
|
632
|
+
showTestGuide(ui, readiness.workingDirectory, prompt);
|
|
541
633
|
} else {
|
|
542
634
|
process.stdout.write('{"event":"connector_codex_test_passed"}\n');
|
|
543
635
|
}
|
|
@@ -658,7 +750,7 @@ async function install(flags, ui) {
|
|
|
658
750
|
if (ui.interactive) {
|
|
659
751
|
ui.stopWait("Background", "running at login");
|
|
660
752
|
ui.complete("You're all set", "Re-entry is connected and waiting for approved work.");
|
|
661
|
-
ui
|
|
753
|
+
showInstallGuide(ui, readiness.workingDirectory);
|
|
662
754
|
} else {
|
|
663
755
|
process.stdout.write(`${JSON.stringify({
|
|
664
756
|
event: "connector_service_installed",
|
package/src/terminal-ui.mjs
CHANGED
|
@@ -128,6 +128,28 @@ export function createTerminalUi(options = {}) {
|
|
|
128
128
|
write();
|
|
129
129
|
},
|
|
130
130
|
|
|
131
|
+
commands(title, entries) {
|
|
132
|
+
if (!interactive) return;
|
|
133
|
+
clearSpinnerLine();
|
|
134
|
+
const validEntries = Array.isArray(entries)
|
|
135
|
+
? entries.filter((entry) => (
|
|
136
|
+
entry &&
|
|
137
|
+
typeof entry.label === "string" && entry.label.length > 0 &&
|
|
138
|
+
typeof entry.command === "string" && entry.command.length > 0
|
|
139
|
+
))
|
|
140
|
+
: [];
|
|
141
|
+
if (validEntries.length === 0) return;
|
|
142
|
+
const labelWidth = Math.max(...validEntries.map((entry) => entry.label.length));
|
|
143
|
+
write();
|
|
144
|
+
if (title) write(` ${style(title, CYAN)}`);
|
|
145
|
+
for (const entry of validEntries) {
|
|
146
|
+
const label = entry.label.padEnd(labelWidth);
|
|
147
|
+
write(` ${style(label, BOLD)} ${style("$", CYAN)} ${style(entry.command, BOLD)}`);
|
|
148
|
+
if (entry.detail) write(` ${style(entry.detail, DIM)}`);
|
|
149
|
+
}
|
|
150
|
+
write();
|
|
151
|
+
},
|
|
152
|
+
|
|
131
153
|
error(label, detail, hint) {
|
|
132
154
|
if (!interactive) return;
|
|
133
155
|
clearSpinnerLine();
|