dsh-deepseek-web-login 0.6.24 → 0.6.25
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 +32 -0
- package/lib/index.js +42 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
本项目大致遵循语义化版本;日期为本地时间。
|
|
4
4
|
|
|
5
|
+
## 0.6.25 — 2026-10-01
|
|
6
|
+
|
|
7
|
+
**新增:投喂决策留痕(`feed-decisions.jsonl`)—— 把"这一轮为什么没走增量"变成可查的事实。**
|
|
8
|
+
|
|
9
|
+
### 为什么要有
|
|
10
|
+
|
|
11
|
+
判据只在**原因变化时**打 `链式投喂退回全量重发(原因=X)`,而**宿主日志不落盘**。
|
|
12
|
+
2026-10-01 两次排查("每轮都发全量"、"同一个窗口又多一个会话")都被这一点卡住,
|
|
13
|
+
最后只能往**已安装的产物**里插桩 —— 那是能查,但每次都要占一个发版周期。
|
|
14
|
+
|
|
15
|
+
### 做了什么
|
|
16
|
+
|
|
17
|
+
每一轮决策追加一行到 `~/.dsh/web-login/feed-decisions.jsonl`(环形保留 300 条,超 256 KB 自动裁剪):
|
|
18
|
+
|
|
19
|
+
| 字段 | 含义 |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `reason` | `chained`(真的只发增量)或退回全量的具体原因 |
|
|
22
|
+
| `reused` | 这一轮的网页端会话是不是复用来的 |
|
|
23
|
+
| `session` / `account` | 会话与账号键前 8 位 —— **切号会让 `account` 变**,一眼看出"多出来的会话"是不是换号造成的 |
|
|
24
|
+
| `chainLen` / `entriesLen` | 链里已发的条目数 / 本轮条目数 |
|
|
25
|
+
| `tailSame` | **链尾是否仍在本轮的同一位置** —— `canExtendChain` 第二条判据的直接答案,`false` 就是"DSH 改写了历史"的实锤 |
|
|
26
|
+
|
|
27
|
+
⚠️ 只记**结构性事实**(长度 / 原因 / 是否复用),不记任何内容。
|
|
28
|
+
|
|
29
|
+
### 验证
|
|
30
|
+
|
|
31
|
+
- 新增一条端到端用例:跑三轮(起链 → 严格追加 → 历史被改写),
|
|
32
|
+
断言落盘三条、`reason` 依次为 `new-session` / `chained` / `not-appended`,
|
|
33
|
+
且 `tailSame` 为 `null` / `true` / `false`
|
|
34
|
+
- 变异反向验证:把 `tailSame` 写死成 `null` ⇒ 用例变红、`rc=1`
|
|
35
|
+
- `tsc --noEmit`、`npm run test`(60/60)、`check-smoke`、`check-bundle` 全通过
|
|
36
|
+
|
|
5
37
|
## 0.6.24 — 2026-10-01
|
|
6
38
|
|
|
7
39
|
**修复:浏览器代理传输层不支持 `FormData` ⇒ 图片全部上传失败。**
|
package/lib/index.js
CHANGED
|
@@ -5109,6 +5109,33 @@ let sentRefIdsSession;
|
|
|
5109
5109
|
* 同时"哪一轮开始退回全量、为什么"又一定能看见。
|
|
5110
5110
|
*/
|
|
5111
5111
|
let lastFeedReason;
|
|
5112
|
+
/** 投喂决策留痕的路径(与 gate.json 同目录)。 */
|
|
5113
|
+
function feedDecisionLogPath() {
|
|
5114
|
+
return join(process.env.DSH_HOME || join(homedir(), ".dsh"), "web-login", "feed-decisions.jsonl");
|
|
5115
|
+
}
|
|
5116
|
+
/** 超过这个字节数就裁剪一次(`statSync` 很便宜,不必每次读全文件)。 */
|
|
5117
|
+
const FEED_DECISION_MAX_BYTES = 262144;
|
|
5118
|
+
/**
|
|
5119
|
+
* 记一轮投喂决策。
|
|
5120
|
+
*
|
|
5121
|
+
* 为什么必须有它(2026-10-01 两次排查都被它卡住):
|
|
5122
|
+
* 判据只在**原因变化时**打 `链式投喂退回全量重发(原因=X)`,而**宿主日志不落盘** ——
|
|
5123
|
+
* 真机上根本查不到"这一轮为什么没走增量",最后只能往已安装的产物里插桩。
|
|
5124
|
+
* 把决策要素落成 jsonl 之后,直接读文件就能回答,不必再占一个发版周期。
|
|
5125
|
+
*
|
|
5126
|
+
* ⚠️ 只记**结构性事实**(长度 / 原因 / 是否复用 / 链尾是否还在原位),不记内容。
|
|
5127
|
+
*/
|
|
5128
|
+
function noteFeedDecision(note) {
|
|
5129
|
+
try {
|
|
5130
|
+
const file = feedDecisionLogPath();
|
|
5131
|
+
mkdirSync(join(file, ".."), { recursive: true });
|
|
5132
|
+
appendFileSync(file, `${JSON.stringify(note)}\n`, "utf8");
|
|
5133
|
+
if (statSync(file).size > FEED_DECISION_MAX_BYTES) {
|
|
5134
|
+
const lines = readFileSync(file, "utf8").split("\n").filter(Boolean);
|
|
5135
|
+
writeFileSync(file, `${lines.slice(-300).join("\n")}\n`, "utf8");
|
|
5136
|
+
}
|
|
5137
|
+
} catch {}
|
|
5138
|
+
}
|
|
5112
5139
|
/** 丢弃当前的链(会话退役/测试隔离用)。 */
|
|
5113
5140
|
function resetContextChain() {
|
|
5114
5141
|
contextChains.clear();
|
|
@@ -5308,6 +5335,20 @@ async function openCompletion(auth, params, signal, transport) {
|
|
|
5308
5335
|
};
|
|
5309
5336
|
}
|
|
5310
5337
|
const sessionId = lease.sessionId;
|
|
5338
|
+
{
|
|
5339
|
+
const chainEntries = contextChains.get(slotKey)?.entries;
|
|
5340
|
+
const currentEntries = params.promptParts?.entries;
|
|
5341
|
+
noteFeedDecision({
|
|
5342
|
+
at: Date.now(),
|
|
5343
|
+
reason: feed.reason,
|
|
5344
|
+
reused: lease.reused,
|
|
5345
|
+
session: String(sessionId).slice(0, 8),
|
|
5346
|
+
account: accountKey(auth),
|
|
5347
|
+
chainLen: chainEntries ? chainEntries.length : null,
|
|
5348
|
+
entriesLen: currentEntries ? currentEntries.length : null,
|
|
5349
|
+
tailSame: !chainEntries || !currentEntries ? null : currentEntries.length <= chainEntries.length ? false : currentEntries[chainEntries.length - 1] === chainEntries[chainEntries.length - 1]
|
|
5350
|
+
});
|
|
5351
|
+
}
|
|
5311
5352
|
if (feed.reason !== lastFeedReason) {
|
|
5312
5353
|
lastFeedReason = feed.reason;
|
|
5313
5354
|
params.onContextFeed?.({
|
|
@@ -10077,7 +10118,7 @@ async function checkForUpdate(current, fetchImpl) {
|
|
|
10077
10118
|
* 兜底常量与 package.json 的一致性由 `tests/check-smoke.mjs` 守着,不会漂。
|
|
10078
10119
|
*/
|
|
10079
10120
|
/** 与 package.json 保持一致的兜底版本(由测试保证不会漂)。 */
|
|
10080
|
-
const FALLBACK_VERSION = "0.6.
|
|
10121
|
+
const FALLBACK_VERSION = "0.6.25";
|
|
10081
10122
|
let cached;
|
|
10082
10123
|
/** 本插件版本(如 `0.1.26`)。 */
|
|
10083
10124
|
function pluginVersion() {
|