@codexhost/cli 0.3.5 → 0.4.1

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
@@ -5,7 +5,7 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install -g @codexhost/cli@0.3.5
8
+ npm install -g @codexhost/cli@0.4.1
9
9
  ```
10
10
 
11
11
  npm automatically installs the matching macOS, Windows, or Linux platform package. Node.js 22 or 24 and the official ChatGPT/Codex Desktop are required.
@@ -15,8 +15,12 @@ npm automatically installs the matching macOS, Windows, or Linux platform packag
15
15
  ```bash
16
16
  codexhost --version
17
17
  codexhost
18
+ codexhost remote install
19
+ codexhost remote status
18
20
  ```
19
21
 
20
22
  The `codexhost` command starts Codex Desktop. On macOS and Linux it returns immediately while the packaged Launcher keeps supervising in the background. On Windows, the command remains attached until Codex Desktop exits so shells that clean up process trees of completed commands cannot discard the supervisor. Re-running `codexhost` attaches to the same controlled instance.
21
23
 
24
+ On macOS, `remote install` installs a current-user Aqua Harness broker so Background SSH Hosts can use native Claude Code login without reading, copying, or unlocking Keychain credentials.
25
+
22
26
  If installation used `--omit=optional`, reinstall without that option so npm can select the native package for the current architecture.
package/bin/codexhost.js CHANGED
@@ -6,7 +6,7 @@ import { homedir } from "node:os";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
- const version = "0.3.5";
9
+ const version = "0.4.1";
10
10
  const userArguments = process.argv.slice(2);
11
11
  const startupTraceStartedAt = Date.now();
12
12
  function startupTrace(stage) {
@@ -190,6 +190,8 @@ if (updateEnvironment.CODEXHOST_REMOTE_SSH_MANAGED === "1") {
190
190
 
191
191
  let launchArguments;
192
192
  let remoteArguments = null;
193
+ let brokerArguments = null;
194
+ let delegationArguments = null;
193
195
  if (userArguments.length === 0) {
194
196
  launchArguments = ["launch"];
195
197
  } else if (userArguments[0] === "launch") {
@@ -199,6 +201,16 @@ if (userArguments.length === 0) {
199
201
  } else if (userArguments[0] === "remote") {
200
202
  launchArguments = null;
201
203
  remoteArguments = userArguments.slice(1);
204
+ } else if (userArguments[0] === "broker") {
205
+ launchArguments = null;
206
+ brokerArguments = userArguments.slice(1);
207
+ } else if (
208
+ userArguments[0] === "harness" ||
209
+ userArguments[0] === "delegate" ||
210
+ userArguments[0] === "thread"
211
+ ) {
212
+ launchArguments = null;
213
+ delegationArguments = userArguments;
202
214
  } else if (userArguments[0] === "--help" || userArguments[0] === "-h") {
203
215
  console.log(
204
216
  [
@@ -208,6 +220,11 @@ if (userArguments.length === 0) {
208
220
  " codexhost inspect",
209
221
  " codexhost launch [launcher options]",
210
222
  " codexhost remote install|start|stop|status|uninstall",
223
+ " codexhost broker install|status|stop|uninstall",
224
+ " codexhost delegate --help",
225
+ " codexhost harness inspect ...",
226
+ " codexhost delegate start ...",
227
+ " codexhost thread send|cancel|read|wait|list ...",
211
228
  "",
212
229
  "This npm package uses the current Node.js runtime and the packaged",
213
230
  "Rust launcher/shim. Codex Desktop must already be installed.",
@@ -246,7 +263,71 @@ if (launchArguments?.[0] === "launch") {
246
263
  launchArguments = ["launch", ...extras, ...launchArguments.slice(1)];
247
264
  }
248
265
 
249
- if (remoteArguments !== null) {
266
+ if (delegationArguments !== null) {
267
+ const child = spawn(
268
+ process.execPath,
269
+ [hostRuntime, "--codexhost-delegation-cli", ...delegationArguments],
270
+ {
271
+ env: {
272
+ ...updateEnvironment,
273
+ CODEXHOST_CLI_PATH: fileURLToPath(import.meta.url),
274
+ },
275
+ stdio: "inherit",
276
+ windowsHide: true,
277
+ },
278
+ );
279
+ child.on("error", (error) => fail(error.message));
280
+ child.on("exit", (code, signal) => {
281
+ if (signal) {
282
+ process.kill(process.pid, signal);
283
+ return;
284
+ }
285
+ process.exit(code ?? 1);
286
+ });
287
+ } else if (brokerArguments !== null) {
288
+ const child = spawn(
289
+ launcher,
290
+ [
291
+ "broker",
292
+ ...brokerArguments,
293
+ "--node", process.execPath, "--host-runtime", hostRuntime,
294
+ ],
295
+ {
296
+ env: updateEnvironment,
297
+ stdio: "inherit",
298
+ windowsHide: true,
299
+ },
300
+ );
301
+ child.on("error", (error) => fail(error.message));
302
+ child.on("exit", (code, signal) => {
303
+ if (signal) {
304
+ process.kill(process.pid, signal);
305
+ return;
306
+ }
307
+ process.exit(code ?? 1);
308
+ });
309
+ } else if (remoteArguments !== null) {
310
+ const runNativeBroker = (command) => {
311
+ const broker = spawn(
312
+ launcher,
313
+ ["broker", command, "--node", process.execPath, "--host-runtime", hostRuntime],
314
+ {
315
+ env: updateEnvironment,
316
+ // remote status is a stable JSON stdout surface. Keep the broker's
317
+ // human-readable status beside it on stderr instead of corrupting JSON.
318
+ stdio: command === "status" ? ["inherit", process.stderr, "inherit"] : "inherit",
319
+ windowsHide: true,
320
+ },
321
+ );
322
+ broker.on("error", (error) => fail(error.message));
323
+ broker.on("exit", (code, signal) => {
324
+ if (signal) {
325
+ process.kill(process.pid, signal);
326
+ return;
327
+ }
328
+ process.exit(code ?? 1);
329
+ });
330
+ };
250
331
  const child = spawn(
251
332
  process.execPath,
252
333
  [
@@ -272,6 +353,20 @@ if (remoteArguments !== null) {
272
353
  process.kill(process.pid, signal);
273
354
  return;
274
355
  }
356
+ if (code === 0 && process.platform === "darwin") {
357
+ if (remoteArguments[0] === "install") {
358
+ runNativeBroker("install");
359
+ return;
360
+ }
361
+ if (remoteArguments[0] === "status") {
362
+ runNativeBroker("status");
363
+ return;
364
+ }
365
+ if (remoteArguments[0] === "uninstall") {
366
+ runNativeBroker("uninstall");
367
+ return;
368
+ }
369
+ }
275
370
  process.exit(code ?? 1);
276
371
  });
277
372
  } else if (launchArguments?.[0] === "launch") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexhost/cli",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "description": "Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,12 +14,12 @@
14
14
  "node": ">=22"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@codexhost/cli-darwin-arm64": "0.3.5",
18
- "@codexhost/cli-darwin-x64": "0.3.5",
19
- "@codexhost/cli-win32-x64": "0.3.5",
20
- "@codexhost/cli-win32-arm64": "0.3.5",
21
- "@codexhost/cli-linux-x64": "0.3.5",
22
- "@codexhost/cli-linux-arm64": "0.3.5"
17
+ "@codexhost/cli-darwin-arm64": "0.4.1",
18
+ "@codexhost/cli-darwin-x64": "0.4.1",
19
+ "@codexhost/cli-win32-x64": "0.4.1",
20
+ "@codexhost/cli-win32-arm64": "0.4.1",
21
+ "@codexhost/cli-linux-x64": "0.4.1",
22
+ "@codexhost/cli-linux-arm64": "0.4.1"
23
23
  },
24
24
  "keywords": [
25
25
  "codex",