@just-every/code 0.2.162 → 0.2.164
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 -0
- package/bin/codex.js +10 -23
- package/package.json +6 -6
- package/postinstall.js +43 -7
package/README.md
CHANGED
|
@@ -217,6 +217,7 @@ model_reasoning_summary = "detailed"
|
|
|
217
217
|
- `CODEX_HOME`: Override config directory location
|
|
218
218
|
- `OPENAI_API_KEY`: Use API key instead of ChatGPT auth
|
|
219
219
|
- `OPENAI_BASE_URL`: Use alternative API endpoints
|
|
220
|
+
- `OPENAI_WIRE_API`: Force the built-in OpenAI provider to use `chat` or `responses` wiring
|
|
220
221
|
|
|
221
222
|
 
|
|
222
223
|
## FAQ
|
package/bin/codex.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Unified entry point for the Codex CLI.
|
|
3
3
|
|
|
4
|
+
import { existsSync } from "fs";
|
|
4
5
|
import path from "path";
|
|
5
6
|
import { fileURLToPath } from "url";
|
|
6
7
|
|
|
@@ -40,10 +41,10 @@ switch (platform) {
|
|
|
40
41
|
case "win32":
|
|
41
42
|
switch (arch) {
|
|
42
43
|
case "x64":
|
|
43
|
-
targetTriple = "x86_64-pc-windows-msvc
|
|
44
|
+
targetTriple = "x86_64-pc-windows-msvc";
|
|
44
45
|
break;
|
|
45
46
|
case "arm64":
|
|
46
|
-
targetTriple = "aarch64-pc-windows-msvc
|
|
47
|
+
targetTriple = "aarch64-pc-windows-msvc";
|
|
47
48
|
break;
|
|
48
49
|
default:
|
|
49
50
|
break;
|
|
@@ -57,7 +58,10 @@ if (!targetTriple) {
|
|
|
57
58
|
throw new Error(`Unsupported platform: ${platform} (${arch})`);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
const
|
|
61
|
+
const vendorRoot = path.join(__dirname, "..", "vendor");
|
|
62
|
+
const archRoot = path.join(vendorRoot, targetTriple);
|
|
63
|
+
const codexBinaryName = process.platform === "win32" ? "codex.exe" : "codex";
|
|
64
|
+
const binaryPath = path.join(archRoot, "codex", codexBinaryName);
|
|
61
65
|
|
|
62
66
|
// Use an asynchronous spawn instead of spawnSync so that Node is able to
|
|
63
67
|
// respond to signals (e.g. Ctrl-C / SIGINT) while the native binary is
|
|
@@ -66,23 +70,6 @@ const binaryPath = path.join(__dirname, "..", "bin", `codex-${targetTriple}`);
|
|
|
66
70
|
// receives a fatal signal, both processes exit in a predictable manner.
|
|
67
71
|
const { spawn } = await import("child_process");
|
|
68
72
|
|
|
69
|
-
async function tryImport(moduleName) {
|
|
70
|
-
try {
|
|
71
|
-
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
|
72
|
-
return await import(moduleName);
|
|
73
|
-
} catch (err) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function resolveRgDir() {
|
|
79
|
-
const ripgrep = await tryImport("@vscode/ripgrep");
|
|
80
|
-
if (!ripgrep?.rgPath) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
return path.dirname(ripgrep.rgPath);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
73
|
function getUpdatedPath(newDirs) {
|
|
87
74
|
const pathSep = process.platform === "win32" ? ";" : ":";
|
|
88
75
|
const existingPath = process.env.PATH || "";
|
|
@@ -94,9 +81,9 @@ function getUpdatedPath(newDirs) {
|
|
|
94
81
|
}
|
|
95
82
|
|
|
96
83
|
const additionalDirs = [];
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
additionalDirs.push(
|
|
84
|
+
const pathDir = path.join(archRoot, "path");
|
|
85
|
+
if (existsSync(pathDir)) {
|
|
86
|
+
additionalDirs.push(pathDir);
|
|
100
87
|
}
|
|
101
88
|
const updatedPath = getUpdatedPath(additionalDirs);
|
|
102
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@just-every/code",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.164",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lightweight coding agent that runs in your terminal - fork of OpenAI Codex",
|
|
6
6
|
"bin": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prettier": "^3.3.3"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@just-every/code-darwin-arm64": "0.2.
|
|
39
|
-
"@just-every/code-darwin-x64": "0.2.
|
|
40
|
-
"@just-every/code-linux-x64-musl": "0.2.
|
|
41
|
-
"@just-every/code-linux-arm64-musl": "0.2.
|
|
42
|
-
"@just-every/code-win32-x64": "0.2.
|
|
38
|
+
"@just-every/code-darwin-arm64": "0.2.164",
|
|
39
|
+
"@just-every/code-darwin-x64": "0.2.164",
|
|
40
|
+
"@just-every/code-linux-x64-musl": "0.2.164",
|
|
41
|
+
"@just-every/code-linux-arm64-musl": "0.2.164",
|
|
42
|
+
"@just-every/code-win32-x64": "0.2.164"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/postinstall.js
CHANGED
|
@@ -54,6 +54,26 @@ function getCachedBinaryPath(version, targetTriple, isWindows) {
|
|
|
54
54
|
return join(cacheDir, `code-${targetTriple}${ext}`);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
const CODE_SHIM_SIGNATURES = [
|
|
58
|
+
'@just-every/code',
|
|
59
|
+
'bin/coder.js',
|
|
60
|
+
'$(dirname "$0")/coder',
|
|
61
|
+
'%~dp0coder'
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
function shimContentsLookOurs(contents) {
|
|
65
|
+
return CODE_SHIM_SIGNATURES.some(sig => contents.includes(sig));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function looksLikeOurCodeShim(path) {
|
|
69
|
+
try {
|
|
70
|
+
const contents = readFileSync(path, 'utf8');
|
|
71
|
+
return shimContentsLookOurs(contents);
|
|
72
|
+
} catch {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
function isWSL() {
|
|
58
78
|
if (platform() !== 'linux') return false;
|
|
59
79
|
try {
|
|
@@ -285,7 +305,7 @@ async function main() {
|
|
|
285
305
|
} catch {
|
|
286
306
|
contents = '';
|
|
287
307
|
}
|
|
288
|
-
const looksLikeOurs =
|
|
308
|
+
const looksLikeOurs = shimContentsLookOurs(contents);
|
|
289
309
|
if (!looksLikeOurs) {
|
|
290
310
|
console.warn('[notice] Found an existing `code` on PATH at:');
|
|
291
311
|
console.warn(` ${resolved}`);
|
|
@@ -647,7 +667,13 @@ async function main() {
|
|
|
647
667
|
const ourShim = globalBin ? join(globalBin, isWindows ? 'code.cmd' : 'code') : '';
|
|
648
668
|
const candidates = resolveAllOnPath();
|
|
649
669
|
const others = candidates.filter(p => p && (!ourShim || p !== ourShim));
|
|
650
|
-
const
|
|
670
|
+
const ourShimExists = ourShim && existsSync(ourShim);
|
|
671
|
+
const shimLooksOurs = ourShimExists && looksLikeOurCodeShim(ourShim);
|
|
672
|
+
const conflictPaths = [
|
|
673
|
+
...others,
|
|
674
|
+
...(ourShimExists && !shimLooksOurs ? [ourShim] : []),
|
|
675
|
+
];
|
|
676
|
+
const collision = conflictPaths.length > 0;
|
|
651
677
|
|
|
652
678
|
const ensureWrapper = (name, args) => {
|
|
653
679
|
if (!globalBin) return;
|
|
@@ -674,13 +700,23 @@ async function main() {
|
|
|
674
700
|
|
|
675
701
|
if (collision) {
|
|
676
702
|
console.error('⚠ Detected existing `code` on PATH:');
|
|
677
|
-
for (const p of
|
|
703
|
+
for (const p of conflictPaths) console.error(` - ${p}`);
|
|
678
704
|
if (globalBin) {
|
|
679
705
|
try {
|
|
680
|
-
if (
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
706
|
+
if (ourShimExists) {
|
|
707
|
+
if (shimLooksOurs && others.length > 0) {
|
|
708
|
+
unlinkSync(ourShim);
|
|
709
|
+
console.error(`✓ Removed global 'code' shim (ours) at ${ourShim}`);
|
|
710
|
+
const reason = others[0] || ourShim;
|
|
711
|
+
skippedCmds.push({ name: 'code', reason: `existing: ${reason}` });
|
|
712
|
+
} else if (!shimLooksOurs) {
|
|
713
|
+
console.error(`✓ Skipped global 'code' shim (different CLI at ${ourShim})`);
|
|
714
|
+
const reason = conflictPaths[0] || ourShim;
|
|
715
|
+
skippedCmds.push({ name: 'code', reason: `existing: ${reason}` });
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
const reason = conflictPaths[0] || 'another command on PATH';
|
|
719
|
+
skippedCmds.push({ name: 'code', reason: `existing: ${reason}` });
|
|
684
720
|
}
|
|
685
721
|
} catch (e) {
|
|
686
722
|
console.error(`⚠ Could not remove npm shim '${ourShim}': ${e.message}`);
|