dsh-session-superagent 0.9.14 → 0.9.16

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,47 @@
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.16] - 2026-11-02 —— 可用性抽检:只读仓库没进「需要关注」
6
+
7
+ ### 怎么做的(知识库第 65 条)
8
+ 写了 `scripts/audit-ux-copy.mjs`,把三条失败路径的**现有文案**直接打出来看,
9
+ 而不是凭记忆判断:
10
+ - ① 仓库没写权限 → 只有行内一个 `只读` 徽章,**「需要关注」里没有** ❌
11
+ - ② 会话没规则 → 有原因 + 「看建议规则」✅
12
+ - ③ 一直没动静 → 时间线 + 「还没唤醒过…点立刻 / 看需要关注」✅
13
+
14
+ ### 改了什么
15
+ 补上 `accessNoteForPanel()`(与服务端 `accessNote` 同语义),写进「需要关注」:
16
+ > 你对 owner/name 只有读权限:能看、能被叫醒,但没法回写评论或打标签 ——
17
+ > 要么换有写权限的 token,要么把结论写在本地/PR 描述里。
18
+
19
+ 客户端独立一份是有意为之(不把服务端依赖带进浏览器包),这已是第三个这样的重复
20
+ (`repoBadges` / `durationText` / 本项)—— **每次都要两端各有用例**。
21
+
22
+ ### 测试
23
+ - 新增 1 例。合计 **160 例**。
24
+
25
+ ## [0.9.15] - 2026-11-02 —— 「只看有问题的」一键筛掉健康的守
26
+
27
+ ### 学到的(知识库第 64 条)
28
+ 任何收窄视图的操作都必须有一个**显眼的还原方式**,否则用户会以为"数据没了"。
29
+
30
+ ### 改法
31
+ 「按仓库」标题旁加 Pill:`只看有问题的 (2)`
32
+ - 什么算有问题:有 `lastError` / 未回音 ≥2 / 仓库结构问题 / 警示或危险徽章;
33
+ - 数量直接写在 Pill 上;
34
+ - 开启时出现「全部」还原;筛选后为空还有一句说明;
35
+ - **纯前端筛选,零新增请求**。
36
+
37
+ ### 又一次 useState 槽位的坑(第二次,这次更隐蔽)
38
+ 按上轮教训追加在最后,但测试里 `[...deskQueue(snapshot), true]` 是靠"追加到末尾"来点亮确认删除的。
39
+ 新增槽位后那个 `true` 落到 `problemsOnly` 上 → 该行被筛掉 → 用例红。
40
+ 修法:`deskQueue` 默认值补第 18 个槽(`false`)。
41
+ **教训**:位置型测试桩,新增槽位既要追加在代码末尾,**还要同步默认队列长度**。
42
+
43
+ ### 测试
44
+ - 新增 1 例。合计 **159 例**。
45
+
5
46
  ## [0.9.14] - 2026-11-02 —— 「按仓库」的仓库名可以点了
6
47
 
7
48
  ### 学到的(知识库第 63 条)
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.14-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.16-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
 
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.14'
17
+ const CLIENT_VERSION = '0.9.16'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -855,6 +855,8 @@ window.__ModuleLoader__.load({
855
855
  const [reasonFilter, setReasonFilter] = useState(null)
856
856
  // 行内徽章可点:点「只读」就只看只读的守(与跳过原因筛选同一套交互)
857
857
  const [badgeFilter, setBadgeFilter] = useState(null)
858
+ // 只看有问题的:放在最后追加,避免打乱测试桩按位置取值的队列
859
+ const [problemsOnly, setProblemsOnly] = useState(false)
858
860
  // 建议规则弹层:给"叫醒了没回音"一个下一步动作(只提供可复制的规则,不替客户写仓库文件)
859
861
 
860
862
  const load = useCallback(async () => {
@@ -1110,6 +1112,10 @@ window.__ModuleLoader__.load({
1110
1112
  for (const watcher of watchers) {
1111
1113
  // 仓库结构问题(关闭 Issues / 是 fork)比轮询失败更早该说:它注定收不到条目
1112
1114
  const structure = repoStructureNote(watcher.repoAccess)
1115
+ if (structure) problems.push({ key: 's-' + watcher.repo, text: structure })
1116
+ // 只读:以前只在行内显示一个徽章,客户在「需要关注」里看不到,也不知道回写会 403
1117
+ const readOnly = accessNoteForPanel(watcher.repoAccess)
1118
+ if (readOnly) problems.push({ key: 'ro-' + watcher.repo, text: readOnly })
1113
1119
  // 叫醒了但没回音:守在工作、消息也进去了,但会话没动手(规则缺失或被忽略)
1114
1120
  if (Number(watcher.silentWakes) >= 2) {
1115
1121
  problems.push({
@@ -1137,7 +1143,11 @@ window.__ModuleLoader__.load({
1137
1143
  || (watcher.filteredLog || []).some((entry) => String(entry.number).includes(needle) || String(entry.title || '').toLowerCase().includes(needle))
1138
1144
  const matchesBadge = (watcher) => !badgeFilter
1139
1145
  || repoBadges(watcher.repoAccess).some((badge) => badge.text === badgeFilter)
1140
- const visible = watchers.filter((watcher) => matches(watcher) && matchesBadge(watcher))
1146
+ const hasProblem = (watcher) => Boolean(watcher.lastError)
1147
+ || Number(watcher.silentWakes) >= 2
1148
+ || Boolean(repoStructureNote(watcher.repoAccess))
1149
+ || repoBadges(watcher.repoAccess).some((badge) => badge.tone === 'warning' || badge.tone === 'danger')
1150
+ const visible = watchers.filter((watcher) => matches(watcher) && matchesBadge(watcher) && (!problemsOnly || hasProblem(watcher)))
1141
1151
 
1142
1152
  const overview = [
1143
1153
  watchers.some((w) => (w.filteredLog || []).length > 0)
@@ -1254,7 +1264,12 @@ window.__ModuleLoader__.load({
1254
1264
  h('div', { className: 'dt-hint' }, watcher.repo + ' · ' + event.text)))))))
1255
1265
 
1256
1266
  // 按仓库汇总:守多个仓库时先看哪个健康,再看明细(渐进披露)
1257
- const repoSummary = visible.length === 0 ? null : h(Section, { key: 'repo-summary', title: '按仓库', hint: '点仓库名只看它(再点取消)' },
1267
+ const problemCount = watchers.filter(hasProblem).length
1268
+ const repoSummary = watchers.length === 0 ? null : h(Section, { key: 'repo-summary', title: '按仓库', hint: '点仓库名只看它(再点取消)' },
1269
+ h('div', { className: 'dt-row-meta' },
1270
+ h(Pill, { active: problemsOnly, onClick: () => setProblemsOnly(!problemsOnly) }, '只看有问题的' + (problemCount > 0 ? ' (' + problemCount + ')' : '')),
1271
+ problemsOnly ? h(Pill, { onClick: () => setProblemsOnly(false) }, '全部') : null),
1272
+ visible.length === 0 ? h(Hint, null, '没有符合条件的主理鱼。点上面「全部」看所有守。') : null,
1258
1273
  h('div', { className: 'dt-rows' }, ...summarizeByRepo(visible).map((group) => h('div', { key: 'repo-' + group.repo, className: 'dt-row' },
1259
1274
  h('div', { className: 'dt-row-main' },
1260
1275
  h('div', { className: 'dt-row-title' },
@@ -1473,6 +1488,15 @@ window.__ModuleLoader__.load({
1473
1488
  return rest > 0 ? hours + ' 小时 ' + rest + ' 分' : hours + ' 小时'
1474
1489
  }
1475
1490
 
1491
+ /** 只读仓库的提示(与服务端 gh-format.js:accessNote 同语义;面板要独立一份)。 */
1492
+ function accessNoteForPanel(access) {
1493
+ if (!access || typeof access !== 'object') return ''
1494
+ if (access.push === true) return ''
1495
+ if (access.push !== false) return ''
1496
+ return '你对 ' + String(access.repo || '这个仓库') + ' 只有读权限:能看、能被叫醒,但没法回写评论或打标签 —— ' +
1497
+ '要么换有写权限的 token,要么把结论写在本地/PR 描述里。'
1498
+ }
1499
+
1476
1500
  /** 仓库能力徽章(与服务端 watch.js:repoBadges 同语义)。 */
1477
1501
  function repoBadges(access) {
1478
1502
  if (!access || typeof access !== 'object') return []
package/lib/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
 
33
33
  export const name = 'dsh-session-superagent'
34
34
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
35
- export const SERVER_VERSION = '0.9.14'
35
+ export const SERVER_VERSION = '0.9.16'
36
36
  export const inject = ['tools', 'agents', 'webServer']
37
37
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
38
38
  const DEFAULT_SESSION_WAKES = 12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
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
5
  "type": "module",
6
6
  "main": "lib/index.js",