mihomo-cli 26.10.102 → 26.10.103
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 +10 -2
- package/dist/index.js +7 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [26.10.
|
|
3
|
+
## [26.10.103] - 2026-10-03
|
|
4
|
+
|
|
5
|
+
### 修复(第二十一轮全量复审)
|
|
6
|
+
|
|
7
|
+
- **手改缓存写入字符串时不再误判流量状态**:cache.json 被手工改成 `"upload":"12"` 这类字符串时,用量裸相加会做字符串拼接(`"12"+"34"="1234"`),可能误报「流量用尽」或漏报用量 ≥90% 的黄色告警;紧急度判定与 status 流量行着色统一按 `formatTraffic` 既有口径先 Number 化,非有限值不参与判定
|
|
8
|
+
- **内核启动失败的日志尾部不再混入 NUL 空行**:stat 与读取之间日志被并发截断或轮转重建成更小文件(双终端 start/restart 的 copy-truncate)时,短读的零填充缓冲会被解码出 NUL 字节成为一行;改为按实际读到的字节数解码,0 字节返回空
|
|
9
|
+
- 陈旧锁强夺路径存在一个已接受的双窃取者残余窗口(需持锁进程已崩溃且至少两个等待者),macOS 无用户态原子比较-删除原语,不做半吊子复核;边界与不处理由已写入代码契约注释与 CODE_REVIEW
|
|
10
|
+
|
|
11
|
+
## [26.10.102] - 2026-10-03
|
|
4
12
|
|
|
5
13
|
### 变更(第十九轮全量质量清理:/simplify 四角度)
|
|
6
14
|
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
- **删除零命中的进程内探测缓存与一批死字段**:连通性探测的 3s 缓存对单命令短进程没有第二个读端(跨进程不共享内存,「连敲第二次免等」不成立);DownloadResult 的 4 个元数据字段、AutoUpdateResult、StartResult、StopResult 的恒真字段、覆写三类条目的 path、日志轮转的计数返回值均无消费者,删除
|
|
19
27
|
- **单点收口**:并发判据 6 个调用点统一为零参数的 `startAbortedByConcurrentStop`;curl 错误末行、两端口安全读取、status 生效覆写谓词、TUN 阻断 hint 各收口一处;TUN 阻断按语境分两个标题(入口=服务在跑、复核=另一终端并发拉起)。端到端测试夹具统一进 `src/test-support/cli.ts`,13 个命令 spec 不再各抄 spawn 与隔离 env。行为不变(942 测试全绿)
|
|
20
28
|
|
|
21
|
-
## [26.10.101]
|
|
29
|
+
## [26.10.101] - 2026-10-03
|
|
22
30
|
|
|
23
31
|
### 功能(JS 覆写脚本命中约定)
|
|
24
32
|
|
package/dist/index.js
CHANGED
|
@@ -3812,8 +3812,9 @@ function deleteSubscriptionCache(subName) {
|
|
|
3812
3812
|
}
|
|
3813
3813
|
function subscriptionUrgency(entry, nowMs = Date.now()) {
|
|
3814
3814
|
if (entry.expire !== void 0 && entry.expire > 0 && entry.expire * 1e3 < nowMs) return "expired";
|
|
3815
|
-
const used = (entry.upload || 0) + (entry.download || 0);
|
|
3816
|
-
|
|
3815
|
+
const used = Number(entry.upload || 0) + Number(entry.download || 0);
|
|
3816
|
+
const total = Number(entry.total);
|
|
3817
|
+
if (entry.total !== void 0 && Number.isFinite(total) && total > 0 && Number.isFinite(used) && used >= total) return "traffic-exhausted";
|
|
3817
3818
|
if (entry.expire !== void 0 && entry.expire > 0 && entry.expire * 1e3 - nowMs < 7 * 864e5) return "expiring";
|
|
3818
3819
|
return null;
|
|
3819
3820
|
}
|
|
@@ -5590,8 +5591,8 @@ function readLogTail() {
|
|
|
5590
5591
|
const length = size - start;
|
|
5591
5592
|
const buf = Buffer.alloc(length);
|
|
5592
5593
|
fd = fs12.openSync(PATHS.logFile, "r");
|
|
5593
|
-
fs12.readSync(fd, buf, 0, length, start);
|
|
5594
|
-
return buf.toString("utf8").split("\n").map((l) => l.trimEnd()).filter((l) => l.length > 0).slice(-LOG_TAIL_LINES);
|
|
5594
|
+
const bytesRead = fs12.readSync(fd, buf, 0, length, start);
|
|
5595
|
+
return buf.subarray(0, bytesRead).toString("utf8").split("\n").map((l) => l.trimEnd()).filter((l) => l.length > 0).slice(-LOG_TAIL_LINES);
|
|
5595
5596
|
} catch {
|
|
5596
5597
|
return [];
|
|
5597
5598
|
} finally {
|
|
@@ -6942,10 +6943,8 @@ function connectivityHint(urgency) {
|
|
|
6942
6943
|
}
|
|
6943
6944
|
function trafficColor(line, urgency, total, upload, download) {
|
|
6944
6945
|
if (urgency === "traffic-exhausted") return colors.red(line);
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
if (used / total >= 0.9) return colors.yellow(line);
|
|
6948
|
-
}
|
|
6946
|
+
const used = Number(upload || 0) + Number(download || 0);
|
|
6947
|
+
if (Number.isFinite(used) && total && total > 0 && used / total >= 0.9) return colors.yellow(line);
|
|
6949
6948
|
return line;
|
|
6950
6949
|
}
|
|
6951
6950
|
function expireColor(line, urgency) {
|