@codexhost/cli 0.1.3 → 0.1.5
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 +1 -1
- package/bin/codexhost.js +21 -3
- package/package.json +5 -5
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.1.
|
|
8
|
+
npm install -g @codexhost/cli@0.1.5
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
npm automatically installs the matching macOS or Windows platform package. Node.js 22 or newer and Codex Desktop are required.
|
package/bin/codexhost.js
CHANGED
|
@@ -5,8 +5,15 @@ import { createRequire } from "node:module";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
|
|
8
|
-
const version = "0.1.
|
|
8
|
+
const version = "0.1.5";
|
|
9
9
|
const userArguments = process.argv.slice(2);
|
|
10
|
+
const startupTraceStartedAt = Date.now();
|
|
11
|
+
function startupTrace(stage) {
|
|
12
|
+
if (process.env.CODEXHOST_STARTUP_TRACE !== "1") return;
|
|
13
|
+
console.error(
|
|
14
|
+
"[codexhost startup +" + (Date.now() - startupTraceStartedAt) + "ms] npm: " + stage,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
10
17
|
if (
|
|
11
18
|
userArguments.length === 1 &&
|
|
12
19
|
(userArguments[0] === "--version" || userArguments[0] === "-v")
|
|
@@ -14,6 +21,7 @@ if (
|
|
|
14
21
|
console.log(version);
|
|
15
22
|
process.exit(0);
|
|
16
23
|
}
|
|
24
|
+
startupTrace("entry");
|
|
17
25
|
|
|
18
26
|
const platformPackages = {
|
|
19
27
|
"darwin-arm64": "@codexhost/cli-darwin-arm64",
|
|
@@ -52,6 +60,7 @@ try {
|
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
62
|
|
|
63
|
+
startupTrace("platform package resolved");
|
|
55
64
|
const executableSuffix = process.platform === "win32" ? ".exe" : "";
|
|
56
65
|
const launcher = path.join(packageRoot, "bin", `codexhost${executableSuffix}`);
|
|
57
66
|
const shim = path.join(packageRoot, "libexec", `codexhost-shim${executableSuffix}`);
|
|
@@ -154,6 +163,7 @@ if (launchArguments[0] === "launch") {
|
|
|
154
163
|
// The Launcher prints "ready" once the Desktop, Controller, and Host chain
|
|
155
164
|
// are up, then detaches from the terminal to keep supervising. Return
|
|
156
165
|
// success immediately so the terminal is not held open by this command.
|
|
166
|
+
startupTrace("spawning Launcher");
|
|
157
167
|
const child = spawn(launcher, launchArguments, {
|
|
158
168
|
env: updateEnvironment,
|
|
159
169
|
stdio: ["ignore", "pipe", "inherit"],
|
|
@@ -163,16 +173,24 @@ if (launchArguments[0] === "launch") {
|
|
|
163
173
|
const finish = (code) => {
|
|
164
174
|
if (finished) return;
|
|
165
175
|
finished = true;
|
|
176
|
+
startupTrace("Launcher finished startup with code " + code);
|
|
166
177
|
process.exit(code);
|
|
167
178
|
};
|
|
168
179
|
child.stdout.setEncoding("utf8");
|
|
169
180
|
let launcherOutput = "";
|
|
170
181
|
child.stdout.on("data", (chunk) => {
|
|
171
182
|
launcherOutput += chunk;
|
|
172
|
-
if (launcherOutput.includes("ready\n"))
|
|
183
|
+
if (launcherOutput.includes("ready\n")) {
|
|
184
|
+
startupTrace("received Launcher ready");
|
|
185
|
+
finish(0);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
child.on("error", (error) => {
|
|
189
|
+
startupTrace("Launcher spawn failed: " + error.message);
|
|
190
|
+
fail(error.message);
|
|
173
191
|
});
|
|
174
|
-
child.on("error", (error) => fail(error.message));
|
|
175
192
|
child.on("exit", (code, signal) => {
|
|
193
|
+
startupTrace("Launcher exited before ready");
|
|
176
194
|
if (signal) {
|
|
177
195
|
process.kill(process.pid, signal);
|
|
178
196
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codexhost/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"node": ">=22"
|
|
15
15
|
},
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"@codexhost/cli-darwin-arm64": "0.1.
|
|
18
|
-
"@codexhost/cli-darwin-x64": "0.1.
|
|
19
|
-
"@codexhost/cli-win32-x64": "0.1.
|
|
20
|
-
"@codexhost/cli-win32-arm64": "0.1.
|
|
17
|
+
"@codexhost/cli-darwin-arm64": "0.1.5",
|
|
18
|
+
"@codexhost/cli-darwin-x64": "0.1.5",
|
|
19
|
+
"@codexhost/cli-win32-x64": "0.1.5",
|
|
20
|
+
"@codexhost/cli-win32-arm64": "0.1.5"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"codex",
|