codex-to-im 1.0.59 → 1.0.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-to-im",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "Installable Codex-to-IM bridge with local setup UI and background service",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/zhangle1987/codex-to-im#readme",
@@ -37,19 +37,20 @@
37
37
  "open": "node dist/cli.mjs open",
38
38
  "weixin:login": "node --import tsx src/weixin-login.ts",
39
39
  "test": "node scripts/run-tests.js",
40
- "prepublishOnly": "npm run typecheck && npm run build"
40
+ "prepublishOnly": "npm run typecheck && npm test && npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@larksuiteoapi/node-sdk": "^1.66.0",
44
- "@openai/codex-sdk": "^0.144.1",
45
- "markdown-it": "^14.2.0",
43
+ "@larksuiteoapi/node-sdk": "^1.71.1",
44
+ "@openai/codex-sdk": "0.144.6",
45
+ "markdown-it": "^14.3.0",
46
46
  "qrcode": "^1.5.4",
47
- "ws": "^8.21.0"
47
+ "ws": "^8.21.1"
48
48
  },
49
49
  "overrides": {
50
50
  "axios": "1.16.1",
51
51
  "follow-redirects": "1.16.0",
52
- "protobufjs": "7.5.9",
52
+ "form-data": "4.0.6",
53
+ "protobufjs": "7.6.5",
53
54
  "qs": "6.15.2"
54
55
  },
55
56
  "devDependencies": {
@@ -57,7 +58,7 @@
57
58
  "@types/node": "^22",
58
59
  "@types/ws": "^8.5.0",
59
60
  "esbuild": "^0.25.0",
60
- "tsx": "^4.22.3",
61
+ "tsx": "^4.23.1",
61
62
  "typescript": "^5"
62
63
  },
63
64
  "engines": {
@@ -10,12 +10,12 @@ import path from 'node:path';
10
10
  * the upstream package while avoiding the extra console window on Windows.
11
11
  *
12
12
  * Maintenance rule:
13
- * - Keep this patch conservative and version-gated.
13
+ * - Keep this patch conservative and source-shape-gated.
14
14
  * - When upgrading `@openai/codex-sdk`, verify the spawn block still matches.
15
15
  * - If upstream adds `windowsHide` natively, remove this script.
16
16
  */
17
17
  const PATCH_MARKER = 'windowsHide: process.platform === "win32"';
18
- const SUPPORTED_SDK_VERSION = /^0\.(11\d|12\d|13\d|14[0-4])\.\d+$/;
18
+ const MIN_SUPPORTED_SDK_VERSION = [0, 110, 0];
19
19
 
20
20
  function logSkip(message) {
21
21
  console.warn(`[postinstall] ${message}`);
@@ -40,6 +40,17 @@ function readSdkVersion(packageJsonPath) {
40
40
  }
41
41
  }
42
42
 
43
+ function isSupportedSdkVersion(version) {
44
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:-|$)/.exec(version);
45
+ if (!match) return false;
46
+ const current = match.slice(1).map(Number);
47
+ for (let index = 0; index < MIN_SUPPORTED_SDK_VERSION.length; index += 1) {
48
+ if (current[index] > MIN_SUPPORTED_SDK_VERSION[index]) return true;
49
+ if (current[index] < MIN_SUPPORTED_SDK_VERSION[index]) return false;
50
+ }
51
+ return true;
52
+ }
53
+
43
54
  function applyPatch(filePath) {
44
55
  const source = fs.readFileSync(filePath, 'utf-8');
45
56
  if (source.includes(PATCH_MARKER)) {
@@ -82,7 +93,7 @@ if (!sdkVersion) {
82
93
  process.exit(0);
83
94
  }
84
95
 
85
- if (!SUPPORTED_SDK_VERSION.test(sdkVersion)) {
96
+ if (!isSupportedSdkVersion(sdkVersion)) {
86
97
  logSkip(`unsupported @openai/codex-sdk version ${sdkVersion}; skipping windowsHide patch`);
87
98
  process.exit(0);
88
99
  }