@mmmbuto/codex-cli-termux 0.55.2-termux → 0.55.4-termux
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/bin/codex +0 -0
- package/bin/codex.js +9 -57
- package/package.json +2 -2
package/bin/codex
CHANGED
|
Binary file
|
package/bin/codex.js
CHANGED
|
@@ -1,66 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
4
5
|
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
|
|
9
|
-
// Get directory of this script
|
|
10
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
-
const __dirname =
|
|
12
|
-
|
|
13
|
-
// Path to the Rust binary
|
|
14
|
-
const binaryPath = path.join(__dirname, "codex");
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
const env = {
|
|
18
|
-
...process.env,
|
|
19
|
-
CODEX_MANAGED_BY_NPM: "1",
|
|
20
|
-
};
|
|
9
|
+
const binaryPath = join(__dirname, 'codex');
|
|
21
10
|
|
|
22
|
-
// Spawn the Rust binary with all arguments
|
|
23
11
|
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
24
|
-
stdio:
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Handle spawn errors (e.g., binary not found or not executable)
|
|
29
|
-
child.on("error", (err) => {
|
|
30
|
-
console.error("Failed to start Codex:", err.message);
|
|
31
|
-
process.exit(1);
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
windowsHide: true,
|
|
32
14
|
});
|
|
33
15
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (child.killed) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
try {
|
|
40
|
-
child.kill(signal);
|
|
41
|
-
} catch {
|
|
42
|
-
/* ignore */
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
["SIGINT", "SIGTERM", "SIGHUP"].forEach((sig) => {
|
|
47
|
-
process.on(sig, () => forwardSignal(sig));
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Wait for child to exit and mirror its exit status
|
|
51
|
-
const childResult = await new Promise((resolve) => {
|
|
52
|
-
child.on("exit", (code, signal) => {
|
|
53
|
-
if (signal) {
|
|
54
|
-
resolve({ type: "signal", signal });
|
|
55
|
-
} else {
|
|
56
|
-
resolve({ type: "code", exitCode: code ?? 1 });
|
|
57
|
-
}
|
|
58
|
-
});
|
|
16
|
+
child.on('exit', (code) => {
|
|
17
|
+
process.exit(code);
|
|
59
18
|
});
|
|
60
|
-
|
|
61
|
-
// Exit with same code/signal as child
|
|
62
|
-
if (childResult.type === "signal") {
|
|
63
|
-
process.kill(process.pid, childResult.signal);
|
|
64
|
-
} else {
|
|
65
|
-
process.exit(childResult.exitCode);
|
|
66
|
-
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmmbuto/codex-cli-termux",
|
|
3
|
-
"version": "0.55.
|
|
4
|
-
"description": "OpenAI Codex CLI v0.55.
|
|
3
|
+
"version": "0.55.4-termux",
|
|
4
|
+
"description": "OpenAI Codex CLI v0.55.4 - Fix bash execution in Agent mode for Termux (Android ARM64)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/codex.js",
|
|
7
7
|
"bin": {
|