@just-every/code 0.2.162 → 0.2.163

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.
Files changed (2) hide show
  1. package/bin/codex.js +10 -23
  2. package/package.json +6 -6
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.exe";
44
+ targetTriple = "x86_64-pc-windows-msvc";
44
45
  break;
45
46
  case "arm64":
46
- targetTriple = "aarch64-pc-windows-msvc.exe";
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 binaryPath = path.join(__dirname, "..", "bin", `codex-${targetTriple}`);
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 rgDir = await resolveRgDir();
98
- if (rgDir) {
99
- additionalDirs.push(rgDir);
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.162",
3
+ "version": "0.2.163",
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.162",
39
- "@just-every/code-darwin-x64": "0.2.162",
40
- "@just-every/code-linux-x64-musl": "0.2.162",
41
- "@just-every/code-linux-arm64-musl": "0.2.162",
42
- "@just-every/code-win32-x64": "0.2.162"
38
+ "@just-every/code-darwin-arm64": "0.2.163",
39
+ "@just-every/code-darwin-x64": "0.2.163",
40
+ "@just-every/code-linux-x64-musl": "0.2.163",
41
+ "@just-every/code-linux-arm64-musl": "0.2.163",
42
+ "@just-every/code-win32-x64": "0.2.163"
43
43
  }
44
44
  }