@openai/codex 0.21.0 → 0.22.0

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
@@ -566,9 +566,13 @@ We're excited to launch a **$1 million initiative** supporting open source proje
566
566
 
567
567
  ## Contributing
568
568
 
569
- This project is under active development and the code will likely change pretty significantly. We'll update this message once that's complete!
569
+ This project is under active development and the code will likely change pretty significantly.
570
570
 
571
- More broadly we welcome contributions - whether you are opening your very first pull request or you're a seasoned maintainer. At the same time we care about reliability and long-term maintainability, so the bar for merging code is intentionally **high**. The guidelines below spell out what "high-quality" means in practice and should make the whole process transparent and friendly.
571
+ **At the moment, we only plan to prioritize reviewing external contributions for bugs or security fixes.**
572
+
573
+ If you want to add a new feature or change the behavior of an existing one, please open an issue proposing the feature and get approval from an OpenAI team member before spending time building it.
574
+
575
+ **New contributions that don't go through this process may be closed** if they aren't aligned with our current roadmap or conflict with other priorities/upcoming features.
572
576
 
573
577
  ### Development workflow
574
578
 
@@ -593,8 +597,9 @@ More broadly we welcome contributions - whether you are opening your very first
593
597
  ### Review process
594
598
 
595
599
  1. One maintainer will be assigned as a primary reviewer.
596
- 2. We may ask for changes - please do not take this personally. We value the work, we just also value consistency and long-term maintainability.
597
- 3. When there is consensus that the PR meets the bar, a maintainer will squash-and-merge.
600
+ 2. If your PR adds a new feature that was not previously discussed and approved, we may choose to close your PR (see [Contributing](#contributing)).
601
+ 3. We may ask for changes - please do not take this personally. We value the work, but we also value consistency and long-term maintainability.
602
+ 5. When there is consensus that the PR meets the bar, a maintainer will squash-and-merge.
598
603
 
599
604
  ### Community values
600
605
 
Binary file
Binary file
Binary file
package/bin/codex.js CHANGED
@@ -43,7 +43,7 @@ switch (platform) {
43
43
  targetTriple = "x86_64-pc-windows-msvc.exe";
44
44
  break;
45
45
  case "arm64":
46
- // We do not build this today, fall through...
46
+ // We do not build this today, fall through...
47
47
  default:
48
48
  break;
49
49
  }
@@ -65,9 +65,43 @@ const binaryPath = path.join(__dirname, "..", "bin", `codex-${targetTriple}`);
65
65
  // receives a fatal signal, both processes exit in a predictable manner.
66
66
  const { spawn } = await import("child_process");
67
67
 
68
+ async function tryImport(moduleName) {
69
+ try {
70
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
71
+ return await import(moduleName);
72
+ } catch (err) {
73
+ return null;
74
+ }
75
+ }
76
+
77
+ async function resolveRgDir() {
78
+ const ripgrep = await tryImport("@vscode/ripgrep");
79
+ if (!ripgrep?.rgPath) {
80
+ return null;
81
+ }
82
+ return path.dirname(ripgrep.rgPath);
83
+ }
84
+
85
+ function getUpdatedPath(newDirs) {
86
+ const pathSep = process.platform === "win32" ? ";" : ":";
87
+ const existingPath = process.env.PATH || "";
88
+ const updatedPath = [
89
+ ...newDirs,
90
+ ...existingPath.split(pathSep).filter(Boolean),
91
+ ].join(pathSep);
92
+ return updatedPath;
93
+ }
94
+
95
+ const additionalDirs = [];
96
+ const rgDir = await resolveRgDir();
97
+ if (rgDir) {
98
+ additionalDirs.push(rgDir);
99
+ }
100
+ const updatedPath = getUpdatedPath(additionalDirs);
101
+
68
102
  const child = spawn(binaryPath, process.argv.slice(2), {
69
103
  stdio: "inherit",
70
- env: { ...process.env, CODEX_MANAGED_BY_NPM: "1" },
104
+ env: { ...process.env, PATH: updatedPath, CODEX_MANAGED_BY_NPM: "1" },
71
105
  });
72
106
 
73
107
  child.on("error", (err) => {
@@ -120,4 +154,3 @@ if (childResult.type === "signal") {
120
154
  } else {
121
155
  process.exit(childResult.exitCode);
122
156
  }
123
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openai/codex",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "license": "Apache-2.0",
5
5
  "bin": {
6
6
  "codex": "bin/codex.js"
@@ -16,5 +16,11 @@
16
16
  "repository": {
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/openai/codex.git"
19
+ },
20
+ "dependencies": {
21
+ "@vscode/ripgrep": "^1.15.14"
22
+ },
23
+ "devDependencies": {
24
+ "prettier": "^3.3.3"
19
25
  }
20
26
  }