@4xeoz/re-entry 0.2.17 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -137,6 +137,10 @@ underlying direct `codex exec` command. It does not create a Grant, claim Receiv
137
137
  Desktop UI thread, browser, or WebMCP return path. If it times out, run the equivalent direct
138
138
  `codex exec` command to inspect Codex's own output; the test does not contact the Receiver.
139
139
 
140
+ The one-shot test allows up to one hour by default. Override it with
141
+ `--activation-timeout <milliseconds>` when needed. Background delivery keeps its separate
142
+ 60-second adapter bound.
143
+
140
144
  To pause or remove the local Connector:
141
145
 
142
146
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4xeoz/re-entry",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
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": {
@@ -10,6 +10,8 @@ import {
10
10
  } from "./codex-discovery.mjs";
11
11
 
12
12
  export const CODEX_EXEC_ADAPTER_ID = "codex_exec_local";
13
+ export const DEFAULT_CODEX_PROMPT_TIMEOUT_MS = 3_600_000;
14
+ export const MAX_CODEX_PROMPT_TIMEOUT_MS = 3_600_000;
13
15
 
14
16
  const OPTION_FIELDS = Object.freeze([
15
17
  "workingDirectory",
@@ -89,7 +91,10 @@ export async function runCodexPrompt(options) {
89
91
  ? discoverCodexExecutable()
90
92
  : requireReference(options.executable, "Codex executable");
91
93
  const prompt = requirePrompt(options.prompt);
92
- const timeoutMs = requireTimeout(options.commandTimeoutMs ?? 60_000);
94
+ const timeoutMs = requireTimeout(
95
+ options.commandTimeoutMs ?? DEFAULT_CODEX_PROMPT_TIMEOUT_MS,
96
+ MAX_CODEX_PROMPT_TIMEOUT_MS,
97
+ );
93
98
  const spawnCommand = options.spawnCommand ?? spawn;
94
99
  if (typeof spawnCommand !== "function") {
95
100
  throw new TypeError("Codex prompt spawnCommand must be a function");
@@ -216,11 +221,11 @@ function readClock(clock) {
216
221
  return new Date(value.getTime());
217
222
  }
218
223
 
219
- function requireTimeout(value) {
224
+ function requireTimeout(value, maximum = MAX_COMMAND_TIMEOUT_MS) {
220
225
  if (
221
226
  !Number.isSafeInteger(value) ||
222
227
  value < MIN_COMMAND_TIMEOUT_MS ||
223
- value > MAX_COMMAND_TIMEOUT_MS
228
+ value > maximum
224
229
  ) {
225
230
  throw new TypeError("Codex exec adapter commandTimeoutMs is invalid");
226
231
  }
package/src/main.mjs CHANGED
@@ -10,7 +10,12 @@ import process from "node:process";
10
10
 
11
11
  import { LocalConnectorClient } from "@webmcp-challenge/reentry-core/local-connector-client";
12
12
  import { followConnectorActivity } from "./activity-monitor.mjs";
13
- import { createCodexExecAdapter, runCodexPrompt } from "./codex-exec-adapter.mjs";
13
+ import {
14
+ createCodexExecAdapter,
15
+ DEFAULT_CODEX_PROMPT_TIMEOUT_MS,
16
+ MAX_CODEX_PROMPT_TIMEOUT_MS,
17
+ runCodexPrompt,
18
+ } from "./codex-exec-adapter.mjs";
14
19
  import {
15
20
  discoverCodexExecutable,
16
21
  requireSupportedNode,
@@ -523,10 +528,10 @@ async function testCodex(flags, positionals, ui) {
523
528
  prompt,
524
529
  stdio: ui.interactive ? "inherit" : ["ignore", "ignore", "ignore"],
525
530
  commandTimeoutMs: readBoundedNumber(
526
- flags["activation-timeout"] ?? 60_000,
531
+ flags["activation-timeout"] ?? DEFAULT_CODEX_PROMPT_TIMEOUT_MS,
527
532
  100,
528
- 60_000,
529
- "connector_activation_timeout_invalid",
533
+ MAX_CODEX_PROMPT_TIMEOUT_MS,
534
+ "connector_test_timeout_invalid",
530
535
  ),
531
536
  });
532
537
  if (ui.interactive) {
@@ -1133,6 +1138,7 @@ function errorHint(error) {
1133
1138
  connector_service_stop_failed: `check the Connector status and try \`${cliCommand("stop")}\` again`,
1134
1139
  connector_test_prompt_missing: `use \`${cliCommand('test "Reply with: Re-entry is working."')}\``,
1135
1140
  connector_test_prompt_invalid: "use one short, single-line prompt inside quotes",
1141
+ connector_test_timeout_invalid: "use a test timeout between 100 and 3600000 milliseconds",
1136
1142
  connector_activation_timeout_invalid: "use an activation timeout between 100 and 60000 milliseconds",
1137
1143
  };
1138
1144
  return hints[error?.code] ?? "check the command output and try again";