dsh-session-superagent 0.9.187 → 0.9.189

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 CHANGED
@@ -2,6 +2,66 @@
2
2
 
3
3
  格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.9.189] - 2026-11-05 —— 此前所有深色出图都带着一个失真:「选中态」样式从没生效
6
+
7
+ ### 来源
8
+ T11 子代理第一次做**浅色主题**核对,顺手发现工具链的 `attr()` 有 bug:
9
+
10
+ ```js
11
+ if (value === true) return ' ' + name // 渲染成裸属性 aria-selected
12
+ ```
13
+
14
+ 而 CSS 写的是 `[aria-selected='true']` —— **属性选择器永远匹配不到**。
15
+ 于是预览里「选中的 tab / 选中的导航项 / 选中的胶囊」全都显示成未选中样式。
16
+ **这意味着之前每一份深色出图核对,看到都不是真机的样子。**
17
+
18
+ 真机 React 渲染的是 `aria-selected="true"`。已修:`aria-*` / `data-*` 的 `true` 渲染成 `"true"`。
19
+ 修完实测 `aria-selected="true"` 出现 1 次(设置页的选中 tab),UI 体检仍 11/11。
20
+
21
+ ### 浅色主题核对结论(T11)
22
+ 采样 4 页 / 157 个文字节点:**没有任何元素落在比值≈1**(最低 1.82 是 WCAG 豁免的禁用按钮),
23
+ **面板硬编码色 0 处**,颜色 100% 走 `--dsw-alias-*`。三条最该修:
24
+
25
+ 1. `--dsw-alias-label-caption`(`#818b98`)在白底上 **3.14–3.45**(深色下同一档 4.34–5.07 全过线)—— 浅色独有;
26
+ 2. 琥珀/绿胶囊的**同色底扣 0.7**:`warning` 4.17、`success` 4.43(深色 6.34/6.51);
27
+ 3. 浅色下「表面」几乎全同色:`dt-input` 填充 1.00、`dt-stat-btn[aria-pressed=true]` 选中底 **1.03** —— 点了统计数字零视觉反馈。
28
+
29
+ ### 证据
30
+ ```
31
+ node --test → 305/305
32
+ ui-audit → 11/11(100)
33
+ 出图:shot-light-{source,signal,error,paused}.png
34
+ 报告:docs/报告-浅色主题核对.md(742 行 / 83 行对比度总表)
35
+ ```
36
+
37
+ ## [0.9.188] - 2026-11-05 —— 审核「值得改」里的四条:JSON 丢字段、翻页、所有权、永不清空
38
+
39
+ ### ① `watch_ack` 的 JSON 分支丢了 `labelNote`
40
+ 文本分支会告诉你「标签是新建的还是本来就有的」,JSON 分支把它丢了 —— 消费方只能猜。已补进契约清单。
41
+
42
+ ### ② `ensureGiteeLabel` 不翻页 → 重复建标签
43
+ Gitee 的标签列表默认每页 20 条。标签一多,「已存在」会被判成不存在,于是再 POST 一次。
44
+ 改成翻页到不足一页为止(最多 5 页 = 500 个标签)。实测:100 个标签的仓库,第 2 页才命中 → 请求数 2、结果 `already-exists`。
45
+
46
+ ### ③ `release()` 不校验所有权
47
+ 一个被挂起的旧进程醒来时,锁可能已经归别人了 —— 无条件 `rmSync` 会把新持有者的锁拆掉。
48
+ 改成「只删自己的锁」(比对 `owner.json` 里的 pid)。加了一条用例守住。
49
+
50
+ ### ④ `lastReopened` 永不清空
51
+ 一条 issue 重新打开过一次,面板就永远挂着「被重新打开」。它描述的是「最近一次轮询的事实」:
52
+ 这一页里看不到它(或它又关了)就清掉。
53
+
54
+ ### ⑤ 顺带
55
+ - `watch_ack` 里那行 `return` 顶格(缩进丢了,读起来像不属于这个函数);
56
+ - 契约清单登记 `labelNote`。
57
+
58
+ ### 证据
59
+ ```
60
+ node --test → 305/305(新增:锁所有权 1 条)
61
+ preflight --fast → 全绿(--no-maintenance 形态)
62
+ 真机:ensureGiteeLabel 翻页命中(请求 2 次,不重复建)
63
+ ```
64
+
5
65
  ## [0.9.187] - 2026-11-05 —— 审核专员挖出 5 条必须修(含我自己写的两处假保护)
6
66
 
7
67
  ### 来源
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="assets/icon-180.png" width="88" height="88" alt="">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.9.187-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.189-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
 
@@ -144,7 +144,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
144
144
  ## 开发
145
145
 
146
146
  ```sh
147
- node --test # 304 项单测
147
+ node --test # 305 项单测
148
148
  ```
149
149
 
150
150
  ### 工具输出:文本给人和 agent,JSON 给程序
package/client.js CHANGED
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
14
14
  const { useCallback, useEffect, useRef, useState } = React
15
15
 
16
16
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
17
- const CLIENT_VERSION = '0.9.187'
17
+ const CLIENT_VERSION = '0.9.189'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/gitee.js CHANGED
@@ -194,7 +194,16 @@ export async function ensureGiteeLabel({ repo, token = '', label, color = 'edede
194
194
  suggestion: suggestGiteeLabel(name),
195
195
  }
196
196
  }
197
- const listed = await request(`/repos/${repo}/labels`, { token, fetchImpl })
197
+ // 默认每页 20 条:标签多了会把「已存在」判成不存在,于是重复 POST。
198
+ // 翻到没有为止(最多 5 页 = 500 个标签,足够)。
199
+ let listed = { ok: true, data: [] }
200
+ for (let page = 1; page <= 5; page += 1) {
201
+ const res = await request(`/repos/${repo}/labels?per_page=100&page=${page}`, { token, fetchImpl })
202
+ if (!res.ok) { listed = res; break }
203
+ const pageItems = Array.isArray(res.data) ? res.data : []
204
+ listed.data = (listed.data || []).concat(pageItems)
205
+ if (pageItems.length < 100) break
206
+ }
198
207
  if (listed.ok) {
199
208
  const names = (Array.isArray(listed.data) ? listed.data : []).map((item) => String(item && item.name || ''))
200
209
  if (names.includes(name)) return { ok: true, created: false, reason: 'already-exists' }
package/lib/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
 
43
43
  export const name = 'dsh-session-superagent'
44
44
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
45
- export const SERVER_VERSION = '0.9.187'
45
+ export const SERVER_VERSION = '0.9.189'
46
46
  export const inject = ['tools', 'agents', 'webServer']
47
47
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
48
48
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
@@ -1207,7 +1207,12 @@ async function pollWithItems(ctx, entry, baseMs, parsed) {
1207
1207
  // **必须放在 markGiteeReopened 之后** —— 以前写在前面,Gitee 判出来的 reopened 那一轮已经算完,
1208
1208
  // 下一轮 lastStates 已是 open,永远不再触发(T8 审计发现)。
1209
1209
  const reopened = items.find((item) => (item.state_reason || '') === 'reopened')
1210
+ // 以前只写不清:一条 issue 重新打开过一次,面板就永远挂着「被重新打开」。
1211
+ // 这一页里已经看不到它(或它又关了)就清掉 —— 它描述的是「最近一次轮询的事实」。
1210
1212
  if (reopened) entry.lastReopened = reopened.number
1213
+ else if (entry.lastReopened && !items.some((item) => String(item.number) === String(entry.lastReopened))) {
1214
+ entry.lastReopened = null
1215
+ }
1211
1216
  const { fresh, absorbed } = partitionItems(considered, entry, { cooldownMs: Number(entry.cooldownMs) || DEFAULT_COOLDOWN_MS })
1212
1217
 
1213
1218
  if (absorbed.length > 0) {
@@ -2187,9 +2192,10 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
2187
2192
  writeState(latest)
2188
2193
  }
2189
2194
  if (args && args.format === 'json') {
2190
- return JSON.stringify({ schemaVersion: 1, ok: true, repo: entry.repo, label, acked: results, at: nowIso })
2195
+ // labelNote 是「标签是新建的还是本来就有的」——JSON 分支以前把它丢了,消费方只能猜
2196
+ return JSON.stringify({ schemaVersion: 1, ok: true, repo: entry.repo, label, acked: results, at: nowIso, labelNote: labelNote || null })
2191
2197
  }
2192
- return `acked ${entry.repo} #${results.join(' #')} with label "${label}"` + labelNote
2198
+ return `acked ${entry.repo} #${results.join(' #')} with label "${label}"` + labelNote
2193
2199
  },
2194
2200
  }))
2195
2201
 
package/package.json CHANGED
@@ -1,82 +1,82 @@
1
- {
2
- "name": "dsh-session-superagent",
3
- "version": "0.9.187",
4
- "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "exports": {
8
- ".": "./lib/index.js",
9
- "./watch": "./lib/watch.js",
10
- "./redact": "./lib/redact.js",
11
- "./package.json": "./package.json",
12
- "./client": "./client.js"
13
- },
14
- "files": [
15
- "lib/index.js",
16
- "lib/watch.js",
17
- "lib/gh-format.js",
18
- "lib/redact.js",
19
- "lib/body.js",
20
- "lib/gitee.js",
21
- "cordis.patch.yml",
22
- "README.md",
23
- "CHANGELOG.md",
24
- "LICENSE",
25
- "client.js"
26
- ],
27
- "engines": {
28
- "node": ">=22.19.0",
29
- "dsh": ">=0.2.1-rc.5"
30
- },
31
- "scripts": {
32
- "test": "node --test",
33
- "check": "node --test",
34
- "preview:orbit": "node scripts/preview-orbit.mjs",
35
- "sync:profile": "node scripts/sync-profile.mjs",
36
- "smoke:observe": "node scripts/smoke-observe.mjs",
37
- "sync:profile:check": "node scripts/sync-profile.mjs --check",
38
- "sync:profile:repair": "node scripts/sync-profile.mjs --repair",
39
- "preview": "node scripts/render-preview.mjs",
40
- "preflight": "node scripts/preflight.mjs",
41
- "preview:themes": "node scripts/render-preview.mjs preview-themes.html"
42
- },
43
- "keywords": [
44
- "dsh",
45
- "dsh-plugin",
46
- "deepseek-harness",
47
- "cordis",
48
- "superagent",
49
- "watcher",
50
- "github",
51
- "automation"
52
- ],
53
- "license": "MIT",
54
- "repository": {
55
- "type": "git",
56
- "url": "git+https://github.com/MYCF711/dsh-session-superagent.git"
57
- },
58
- "dsh": {
59
- "bundle": {
60
- "patch": "./cordis.patch.yml"
61
- },
62
- "client": {
63
- "platform": "web",
64
- "inject": [
65
- "@deepseek-ai/dsh-client-ui-conversation"
66
- ]
67
- }
68
- },
69
- "peerDependencies": {
70
- "@deepseek-ai/cordis": "^4.0.1"
71
- },
72
- "peerDependenciesMeta": {
73
- "@deepseek-ai/cordis": {
74
- "optional": true
75
- }
76
- },
77
- "author": "MYCF711",
78
- "homepage": "https://github.com/MYCF711/dsh-session-superagent#readme",
79
- "bugs": {
80
- "url": "https://github.com/MYCF711/dsh-session-superagent/issues"
81
- }
82
- }
1
+ {
2
+ "name": "dsh-session-superagent",
3
+ "version": "0.9.189",
4
+ "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./watch": "./lib/watch.js",
10
+ "./redact": "./lib/redact.js",
11
+ "./package.json": "./package.json",
12
+ "./client": "./client.js"
13
+ },
14
+ "files": [
15
+ "lib/index.js",
16
+ "lib/watch.js",
17
+ "lib/gh-format.js",
18
+ "lib/redact.js",
19
+ "lib/body.js",
20
+ "lib/gitee.js",
21
+ "cordis.patch.yml",
22
+ "README.md",
23
+ "CHANGELOG.md",
24
+ "LICENSE",
25
+ "client.js"
26
+ ],
27
+ "engines": {
28
+ "node": ">=22.19.0",
29
+ "dsh": ">=0.2.1-rc.5"
30
+ },
31
+ "scripts": {
32
+ "test": "node --test",
33
+ "check": "node --test",
34
+ "preview:orbit": "node scripts/preview-orbit.mjs",
35
+ "sync:profile": "node scripts/sync-profile.mjs",
36
+ "smoke:observe": "node scripts/smoke-observe.mjs",
37
+ "sync:profile:check": "node scripts/sync-profile.mjs --check",
38
+ "sync:profile:repair": "node scripts/sync-profile.mjs --repair",
39
+ "preview": "node scripts/render-preview.mjs",
40
+ "preflight": "node scripts/preflight.mjs",
41
+ "preview:themes": "node scripts/render-preview.mjs preview-themes.html"
42
+ },
43
+ "keywords": [
44
+ "dsh",
45
+ "dsh-plugin",
46
+ "deepseek-harness",
47
+ "cordis",
48
+ "superagent",
49
+ "watcher",
50
+ "github",
51
+ "automation"
52
+ ],
53
+ "license": "MIT",
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/MYCF711/dsh-session-superagent.git"
57
+ },
58
+ "dsh": {
59
+ "bundle": {
60
+ "patch": "./cordis.patch.yml"
61
+ },
62
+ "client": {
63
+ "platform": "web",
64
+ "inject": [
65
+ "@deepseek-ai/dsh-client-ui-conversation"
66
+ ]
67
+ }
68
+ },
69
+ "peerDependencies": {
70
+ "@deepseek-ai/cordis": "^4.0.1"
71
+ },
72
+ "peerDependenciesMeta": {
73
+ "@deepseek-ai/cordis": {
74
+ "optional": true
75
+ }
76
+ },
77
+ "author": "MYCF711",
78
+ "homepage": "https://github.com/MYCF711/dsh-session-superagent#readme",
79
+ "bugs": {
80
+ "url": "https://github.com/MYCF711/dsh-session-superagent/issues"
81
+ }
82
+ }