@gair/codex-med 0.1.6 → 0.1.7

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 +18 -3
  2. package/package.json +3 -3
package/bin/codex.js CHANGED
@@ -2,8 +2,9 @@
2
2
  // Unified entry point for the Codex CLI.
3
3
 
4
4
  import { spawn } from "node:child_process";
5
- import { existsSync, realpathSync } from "fs";
5
+ import { existsSync, mkdirSync, realpathSync } from "fs";
6
6
  import { createRequire } from "node:module";
7
+ import { homedir } from "node:os";
7
8
  import path from "path";
8
9
  import { fileURLToPath } from "url";
9
10
 
@@ -13,7 +14,12 @@ const __dirname = path.dirname(__filename);
13
14
  const require = createRequire(import.meta.url);
14
15
 
15
16
  const PLATFORM_PACKAGE_BY_TARGET = {
16
- "x86_64-unknown-linux-gnu": "@gair/codex-med-linux-x64",
17
+ "x86_64-unknown-linux-musl": "@gair/codex-med-linux-x64",
18
+ "aarch64-unknown-linux-musl": "@gair/codex-med-linux-arm64",
19
+ "x86_64-apple-darwin": "@gair/codex-med-darwin-x64",
20
+ "aarch64-apple-darwin": "@gair/codex-med-darwin-arm64",
21
+ "x86_64-pc-windows-msvc": "@gair/codex-med-win32-x64",
22
+ "aarch64-pc-windows-msvc": "@gair/codex-med-win32-arm64",
17
23
  };
18
24
 
19
25
  const { platform, arch } = process;
@@ -24,7 +30,7 @@ switch (platform) {
24
30
  case "android":
25
31
  switch (arch) {
26
32
  case "x64":
27
- targetTriple = "x86_64-unknown-linux-gnu";
33
+ targetTriple = "x86_64-unknown-linux-musl";
28
34
  break;
29
35
  case "arm64":
30
36
  targetTriple = "aarch64-unknown-linux-musl";
@@ -169,6 +175,15 @@ if (existsSync(pathDir)) {
169
175
  const updatedPath = getUpdatedPath(additionalDirs);
170
176
 
171
177
  const env = { ...process.env, PATH: updatedPath };
178
+ const configuredCodexMedHome = process.env.CODEX_MED_HOME;
179
+ const codexMedHome = configuredCodexMedHome
180
+ ? path.resolve(configuredCodexMedHome)
181
+ : path.join(homedir(), ".codex-med");
182
+ mkdirSync(codexMedHome, { recursive: true });
183
+ env.CODEX_MED_HOME = codexMedHome;
184
+ // Keep Codex Med authentication, model metadata, and state isolated from the
185
+ // regular Codex installation while the native CLI continues to read CODEX_HOME.
186
+ env.CODEX_HOME = codexMedHome;
172
187
  const packageManagerEnvVar =
173
188
  detectPackageManager() === "bun"
174
189
  ? "CODEX_MANAGED_BY_BUN"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gair/codex-med",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Codex CLI for medical domain agents (fork of OpenAI Codex CLI).",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -16,11 +16,11 @@
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/openai/codex.git",
19
+ "url": "git+https://github.com/snowy2002/codex-for-med.git",
20
20
  "directory": "codex-cli"
21
21
  },
22
22
  "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
23
23
  "optionalDependencies": {
24
- "@gair/codex-med-linux-x64": "npm:@gair/codex-med@0.1.6-linux-x64"
24
+ "@gair/codex-med-linux-x64": "npm:@gair/codex-med@0.1.7-linux-x64"
25
25
  }
26
26
  }