grok-cli-to-openai-compatible 1.7.6 → 1.7.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.
- package/CHANGELOG.md +15 -0
- package/CHANGELOG.zh.md +15 -0
- package/README-ZH.md +16 -10
- package/README.md +16 -10
- package/dist/middlewares/error.middleware.d.ts.map +1 -1
- package/dist/middlewares/error.middleware.js +15 -0
- package/dist/middlewares/error.middleware.js.map +1 -1
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,21 @@ Categories: **New features**, **Improvements**, **Fixes**, **Security**, **Depen
|
|
|
10
10
|
|
|
11
11
|
Entries come from git history, tags, and [GitHub Releases](https://github.com/yanshekki/Grok-Cli-to-OpenAI-compatible/releases). A version that appears in `package.json` history but was never published to npm is marked. npm dates are the registry publish time in Hong Kong (UTC+8). Commit subjects are not rewritten into claims the commits do not make.
|
|
12
12
|
|
|
13
|
+
## [1.7.7] - 2026-10-25
|
|
14
|
+
|
|
15
|
+
### Security
|
|
16
|
+
|
|
17
|
+
- Upgrade `multer` 1.4.5-lts.2 → **2.5.0** for CVE-2026-77078 (High multipart field-name DoS) and later 2.x multipart fixes including CVE-2026-113872. Upload routes still use `memoryStorage()`. Oversize and malformed multipart now map `MulterError` to **413** / **400** instead of 500.
|
|
18
|
+
- Lock `body-parser` at **1.20.9** (CVE-2026-111181) via `overrides` so `express.json` / `urlencoded` pick up the patched transitive. Repo lockfile was on 1.20.8.
|
|
19
|
+
- Operators: prefer Node **22.23.4+** or **24.22.1+** after the 2026-10-21 Node security releases (High Brotli OOB CVE-2026-111497). `engines` stays `>=20`.
|
|
20
|
+
|
|
21
|
+
### Dependency upgrades
|
|
22
|
+
|
|
23
|
+
- `express` range `^4.21.2` → `^4.22.3` (resolved version already 4.22.3).
|
|
24
|
+
- `vite` 6.4.4 → **6.4.5** (GHSA-8g5g-mxqh-grgj, incomplete `server.fs.deny` backport; Admin Vite dev server only).
|
|
25
|
+
- `typescript-eslint` 8.71.1 → **8.72.0**.
|
|
26
|
+
- `@types/multer` 1.4.13 → **2.3.0** (multer 2 does not ship its own types).
|
|
27
|
+
|
|
13
28
|
## [1.7.6] - 2026-10-11
|
|
14
29
|
|
|
15
30
|
### Dependency upgrades
|
package/CHANGELOG.zh.md
CHANGED
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
|
|
11
11
|
條目來自 git 歷史、標籤,以及 [GitHub Releases](https://github.com/yanshekki/Grok-Cli-to-OpenAI-compatible/releases)。`package.json` 有過、但未曾發佈到 npm 的版本會註明。npm 日期是登錄庫發佈時間(香港時間,UTC+8)。沒有把 commit 說明改寫成 commit 本身沒有的說法。
|
|
12
12
|
|
|
13
|
+
## [1.7.7] - 2026-10-25
|
|
14
|
+
|
|
15
|
+
### 安全
|
|
16
|
+
|
|
17
|
+
- 將 `multer` 由 1.4.5-lts.2 升到 **2.5.0**,修 CVE-2026-77078(High,multipart 欄位名稱 DoS)以及其後 2.x 的 multipart 修正(含 CVE-2026-113872)。上傳路徑仍用 `memoryStorage()`。過大或格式錯誤的 multipart 會把 `MulterError` 對應成 **413**/**400**,不再變成 500。
|
|
18
|
+
- 用 `overrides` 把 `body-parser` 鎖在 **1.20.9**(CVE-2026-111181),讓 `express.json`/`urlencoded` 用到已修的傳遞依賴。倉庫 lockfile 先前是 1.20.8。
|
|
19
|
+
- 營運建議:2026-10-21 Node 安全更新之後,生產環境優先用 **22.23.4+** 或 **24.22.1+**(High Brotli 越界寫入 CVE-2026-111497)。`engines` 仍是 `>=20`。
|
|
20
|
+
|
|
21
|
+
### 依賴升級
|
|
22
|
+
|
|
23
|
+
- `express` 範圍 `^4.21.2` → `^4.22.3`(實際解析版本本來已是 4.22.3)。
|
|
24
|
+
- `vite` 6.4.4 → **6.4.5**(GHSA-8g5g-mxqh-grgj,`server.fs.deny` 回移植不完整;只影響 Admin Vite 開發伺服器)。
|
|
25
|
+
- `typescript-eslint` 8.71.1 → **8.72.0**。
|
|
26
|
+
- `@types/multer` 1.4.13 → **2.3.0**(multer 2 不自帶型別)。
|
|
27
|
+
|
|
13
28
|
## [1.7.6] - 2026-10-11
|
|
14
29
|
|
|
15
30
|
### 依賴升級
|
package/README-ZH.md
CHANGED
|
@@ -739,6 +739,21 @@ gctoac setup|start|status|stop|doctor|logs|update
|
|
|
739
739
|
|
|
740
740
|
這裡只列最近三個版本。較舊的版本在 [CHANGELOG.zh.md](./CHANGELOG.zh.md)。
|
|
741
741
|
|
|
742
|
+
### 1.7.7 — 2026-10-25
|
|
743
|
+
|
|
744
|
+
#### 安全
|
|
745
|
+
|
|
746
|
+
- 將 `multer` 由 1.4.5-lts.2 升到 **2.5.0**,修 CVE-2026-77078(High,multipart 欄位名稱 DoS)以及其後 2.x 的 multipart 修正(含 CVE-2026-113872)。上傳路徑仍用 `memoryStorage()`。過大或格式錯誤的 multipart 會把 `MulterError` 對應成 **413**/**400**,不再變成 500。
|
|
747
|
+
- 用 `overrides` 把 `body-parser` 鎖在 **1.20.9**(CVE-2026-111181),讓 `express.json`/`urlencoded` 用到已修的傳遞依賴。倉庫 lockfile 先前是 1.20.8。
|
|
748
|
+
- 營運建議:2026-10-21 Node 安全更新之後,生產環境優先用 **22.23.4+** 或 **24.22.1+**(High Brotli 越界寫入 CVE-2026-111497)。`engines` 仍是 `>=20`。
|
|
749
|
+
|
|
750
|
+
#### 依賴升級
|
|
751
|
+
|
|
752
|
+
- `express` 範圍 `^4.21.2` → `^4.22.3`(實際解析版本本來已是 4.22.3)。
|
|
753
|
+
- `vite` 6.4.4 → **6.4.5**(GHSA-8g5g-mxqh-grgj,`server.fs.deny` 回移植不完整;只影響 Admin Vite 開發伺服器)。
|
|
754
|
+
- `typescript-eslint` 8.71.1 → **8.72.0**。
|
|
755
|
+
- `@types/multer` 1.4.13 → **2.3.0**(multer 2 不自帶型別)。
|
|
756
|
+
|
|
742
757
|
### 1.7.6 — 2026-10-11
|
|
743
758
|
|
|
744
759
|
#### 依賴升級
|
|
@@ -768,16 +783,6 @@ gctoac setup|start|status|stop|doctor|logs|update
|
|
|
768
783
|
- CI 的 `actions/checkout` 與 `actions/setup-node` 由 v4 改為 v7。發佈 job 使用 Node 24,以便內建 npm 為 11.5.1 或更新。
|
|
769
784
|
- 兩份 README 只保留最近三個版本,並按類別分組。完整記錄在 `CHANGELOG.md` 與 `CHANGELOG.zh.md`。
|
|
770
785
|
|
|
771
|
-
### 1.7.4 — 2026-08-14
|
|
772
|
-
|
|
773
|
-
#### 修正
|
|
774
|
-
|
|
775
|
-
- Grok CLI 在檔案寫好之後以 exit `1` 結束時(`maxTurns`/失敗的 `use_tool` 複製),`/v1/images/generations` 仍交回 Imagine 圖片。Gateway 會取回今次 run 的 session 圖片與沙箱 `output.*`,串流期間輪詢並複製;`n=1` 一拿到檔案就停止行程。
|
|
776
|
-
|
|
777
|
-
#### 內部/CI
|
|
778
|
-
|
|
779
|
-
- 為 v1.7.3 的 i18n 字串重新建置 `public/admin/boot.js`。
|
|
780
|
-
|
|
781
786
|
[完整更新日誌](./CHANGELOG.zh.md)
|
|
782
787
|
|
|
783
788
|
---
|
|
@@ -793,6 +798,7 @@ gctoac setup|start|status|stop|doctor|logs|update
|
|
|
793
798
|
- 不要 commit `.env`,不要外洩 admin key/OTP
|
|
794
799
|
- 可完全關閉 Admin:`gctoac admin off`(只能用 `gctoac admin on` 重開)
|
|
795
800
|
- 一鍵更新/PM2/改 port 需 admin(視 admin key/OTP session 為 root)
|
|
801
|
+
- 生產環境 Node:優先 **22.23.4+** 或 **24.22.1+**(2026-10-21 安全更新)。`engines` 仍是 `>=20`。
|
|
796
802
|
|
|
797
803
|
---
|
|
798
804
|
|
package/README.md
CHANGED
|
@@ -802,6 +802,21 @@ The changelog rule and the full steps are in [CONTRIBUTING.md](./CONTRIBUTING.md
|
|
|
802
802
|
|
|
803
803
|
Only the latest three versions are listed here. Older releases are in [CHANGELOG.md](./CHANGELOG.md).
|
|
804
804
|
|
|
805
|
+
### 1.7.7 — 2026-10-25
|
|
806
|
+
|
|
807
|
+
#### Security
|
|
808
|
+
|
|
809
|
+
- Upgrade `multer` 1.4.5-lts.2 → **2.5.0** for CVE-2026-77078 (High multipart field-name DoS) and later 2.x multipart fixes including CVE-2026-113872. Upload routes still use `memoryStorage()`. Oversize and malformed multipart now map `MulterError` to **413** / **400** instead of 500.
|
|
810
|
+
- Lock `body-parser` at **1.20.9** (CVE-2026-111181) via `overrides` so `express.json` / `urlencoded` pick up the patched transitive. Repo lockfile was on 1.20.8.
|
|
811
|
+
- Operators: prefer Node **22.23.4+** or **24.22.1+** after the 2026-10-21 Node security releases (High Brotli OOB CVE-2026-111497). `engines` stays `>=20`.
|
|
812
|
+
|
|
813
|
+
#### Dependency upgrades
|
|
814
|
+
|
|
815
|
+
- `express` range `^4.21.2` → `^4.22.3` (resolved version already 4.22.3).
|
|
816
|
+
- `vite` 6.4.4 → **6.4.5** (GHSA-8g5g-mxqh-grgj, incomplete `server.fs.deny` backport; Admin Vite dev server only).
|
|
817
|
+
- `typescript-eslint` 8.71.1 → **8.72.0**.
|
|
818
|
+
- `@types/multer` 1.4.13 → **2.3.0** (multer 2 does not ship its own types).
|
|
819
|
+
|
|
805
820
|
### 1.7.6 — 2026-10-11
|
|
806
821
|
|
|
807
822
|
#### Dependency upgrades
|
|
@@ -831,16 +846,6 @@ Only the latest three versions are listed here. Older releases are in [CHANGELOG
|
|
|
831
846
|
- CI `actions/checkout` and `actions/setup-node` move from v4 to v7. The publish job uses Node 24 so the bundled npm is 11.5.1 or newer.
|
|
832
847
|
- READMEs keep the latest three versions, by category. The full history is in `CHANGELOG.md` and `CHANGELOG.zh.md`.
|
|
833
848
|
|
|
834
|
-
### 1.7.4 — 2026-08-14
|
|
835
|
-
|
|
836
|
-
#### Fixes
|
|
837
|
-
|
|
838
|
-
- `/v1/images/generations` returns the Imagine image when Grok CLI exits 1 after the file was written (`maxTurns` / failed `use_tool` copies). The gateway recovers this run’s session images and sandbox `output.*`, polls and copies during the stream, and for `n=1` stops the process once a file is in hand.
|
|
839
|
-
|
|
840
|
-
#### Internal/CI
|
|
841
|
-
|
|
842
|
-
- Rebuild `public/admin/boot.js` for the v1.7.3 i18n strings.
|
|
843
|
-
|
|
844
849
|
[Full changelog](./CHANGELOG.md)
|
|
845
850
|
|
|
846
851
|
---
|
|
@@ -856,6 +861,7 @@ Only the latest three versions are listed here. Older releases are in [CHANGELOG
|
|
|
856
861
|
- Never commit `.env` or share admin keys / OTP codes
|
|
857
862
|
- Admin can be fully disabled: `gctoac admin off` (re-enable only via `gctoac admin on`)
|
|
858
863
|
- One-click update / PM2 / port change require admin (treat admin keys / OTP sessions as root)
|
|
864
|
+
- Production Node: prefer **22.23.4+** or **24.22.1+** (2026-10-21 security releases). `engines` remains `>=20`.
|
|
859
865
|
|
|
860
866
|
---
|
|
861
867
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.middleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"error.middleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAc/D,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAEtF;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,YAAY,GAClB,IAAI,CAkDN"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.notFoundHandler = notFoundHandler;
|
|
4
7
|
exports.errorMiddleware = errorMiddleware;
|
|
8
|
+
const multer_1 = __importDefault(require("multer"));
|
|
9
|
+
const env_1 = require("../config/env");
|
|
5
10
|
const http_exception_1 = require("../exceptions/http.exception");
|
|
6
11
|
const exception_factory_1 = require("../exceptions/exception.factory");
|
|
7
12
|
const logger_1 = require("../utils/logger");
|
|
@@ -19,6 +24,16 @@ function errorMiddleware(err, req, res, _next) {
|
|
|
19
24
|
res.status(httpErr.statusCode).json((0, http_exception_1.toProtocolErrorBody)(httpErr, path));
|
|
20
25
|
return;
|
|
21
26
|
}
|
|
27
|
+
// multer 2 raises MulterError instead of crashing on oversize / bad field names
|
|
28
|
+
if (err instanceof multer_1.default.MulterError) {
|
|
29
|
+
err =
|
|
30
|
+
err.code === 'LIMIT_FILE_SIZE'
|
|
31
|
+
? exception_factory_1.ExceptionFactory.documentTooLarge(env_1.env.UPLOAD_MAX_BYTES)
|
|
32
|
+
: exception_factory_1.ExceptionFactory.validation(err.message || 'Invalid multipart upload', {
|
|
33
|
+
multerCode: err.code,
|
|
34
|
+
field: err.field,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
22
37
|
if (err instanceof http_exception_1.HttpException) {
|
|
23
38
|
if (err.statusCode >= 500) {
|
|
24
39
|
logger_1.logger.error({ err, requestId: req.requestId, path: req.path }, err.message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.middleware.js","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.middleware.js","sourceRoot":"","sources":["../../src/middlewares/error.middleware.ts"],"names":[],"mappings":";;;;;AAcA,0CAEC;AAED,0CAuDC;AAxED,oDAA4B;AAC5B,uCAAoC;AACpC,iEAGsC;AACtC,uEAAmE;AACnE,4CAAyC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AI,GAAG,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;YAC1B,eAAM,CAAC,KAAK,CACV,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EACjD,GAAG,CAAC,OAAO,CACZ,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,eAAM,CAAC,IAAI,CACT,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAC5D,GAAG,CAAC,OAAO,CACZ,CAAC;QACJ,CAAC;QAED,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAA,oCAAmB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QAChE,OAAO;IACT,CAAC;IAED,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAEnF,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,oCAAgB,CAAC,QAAQ,EAAE,CAAC;IAC5C,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAA,oCAAmB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grok-cli-to-openai-compatible",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "OpenAI-compatible API gateway for Grok CLI — with Admin panel, safe mode, and gctoac CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"grok",
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
"cors": "^2.8.5",
|
|
84
84
|
"dotenv": "^16.4.7",
|
|
85
85
|
"execa": "5.1.1",
|
|
86
|
-
"express": "^4.
|
|
86
|
+
"express": "^4.22.3",
|
|
87
87
|
"express-rate-limit": "^7.5.0",
|
|
88
88
|
"helmet": "^8.0.0",
|
|
89
|
-
"multer": "^
|
|
89
|
+
"multer": "^2.5.0",
|
|
90
90
|
"pino": "^9.6.0",
|
|
91
91
|
"pino-http": "^10.4.0",
|
|
92
92
|
"prisma": "6.19.3",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@eslint/js": "^9.39.5",
|
|
97
97
|
"@types/cors": "^2.8.17",
|
|
98
98
|
"@types/express": "^4.17.21",
|
|
99
|
-
"@types/multer": "^
|
|
99
|
+
"@types/multer": "^2.3.0",
|
|
100
100
|
"@types/node": "^22.13.10",
|
|
101
101
|
"@vitest/coverage-v8": "^3.0.9",
|
|
102
102
|
"eslint": "^9.39.5",
|
|
@@ -104,11 +104,14 @@
|
|
|
104
104
|
"pino-pretty": "^13.0.0",
|
|
105
105
|
"tsx": "^4.19.3",
|
|
106
106
|
"typescript": "5.8",
|
|
107
|
-
"typescript-eslint": "^8.
|
|
108
|
-
"vite": "^6.4.
|
|
107
|
+
"typescript-eslint": "^8.72.0",
|
|
108
|
+
"vite": "^6.4.5",
|
|
109
109
|
"vitest": "^3.0.9"
|
|
110
110
|
},
|
|
111
111
|
"engines": {
|
|
112
112
|
"node": ">=20"
|
|
113
|
+
},
|
|
114
|
+
"overrides": {
|
|
115
|
+
"body-parser": "1.20.9"
|
|
113
116
|
}
|
|
114
117
|
}
|