dsh-session-superagent 0.9.13 → 0.9.15

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,48 @@
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.15] - 2026-11-02 —— 「只看有问题的」一键筛掉健康的守
6
+
7
+ ### 学到的(知识库第 64 条)
8
+ 任何收窄视图的操作都必须有一个**显眼的还原方式**,否则用户会以为"数据没了"。
9
+
10
+ ### 改法
11
+ 「按仓库」标题旁加 Pill:`只看有问题的 (2)`
12
+ - 什么算有问题:有 `lastError` / 未回音 ≥2 / 仓库结构问题 / 警示或危险徽章;
13
+ - 数量直接写在 Pill 上;
14
+ - 开启时出现「全部」还原;筛选后为空还有一句说明;
15
+ - **纯前端筛选,零新增请求**。
16
+
17
+ ### 又一次 useState 槽位的坑(第二次,这次更隐蔽)
18
+ 按上轮教训追加在最后,但测试里 `[...deskQueue(snapshot), true]` 是靠"追加到末尾"来点亮确认删除的。
19
+ 新增槽位后那个 `true` 落到 `problemsOnly` 上 → 该行被筛掉 → 用例红。
20
+ 修法:`deskQueue` 默认值补第 18 个槽(`false`)。
21
+ **教训**:位置型测试桩,新增槽位既要追加在代码末尾,**还要同步默认队列长度**。
22
+
23
+ ### 测试
24
+ - 新增 1 例。合计 **159 例**。
25
+
26
+ ## [0.9.14] - 2026-11-02 —— 「按仓库」的仓库名可以点了
27
+
28
+ ### 学到的(知识库第 63 条)
29
+ 概览层的作用是**导航**,不是再显示一遍信息;看起来像可点的就必须可点。
30
+
31
+ ### 问题
32
+ 0.9.13 的汇总里仓库名是纯文本 —— 像标题、点了没反应,明细还得自己去列表里找。
33
+
34
+ ### 改法
35
+ 仓库名改成按钮,点一下把 `search` 设成该仓库(再点取消),复用已有搜索过滤:
36
+ - **零新增 state**(`search` 已在槽位里);
37
+ - 类名用 `dt-textlink dt-row-name`,**不用 `dt-open`** —— 后者是明细行的展开按钮,
38
+ 已有用例按"每行恰好 1 个 dt-open"断言。
39
+
40
+ ### 又一次同一个坑
41
+ 先用 `dt-open` → 「每行有编辑按钮」用例立刻红(2 !== 1)。
42
+ **共用类名导致语义混淆**:`dt-open` 是"展开这一行","筛选列表"是另一件事。
43
+
44
+ ### 测试
45
+ - 新增 1 例(每仓库一个可点名字 + 搜索命中时明细只剩它)。合计 **158 例**。
46
+
5
47
  ## [0.9.13] - 2026-11-02 —— 总览加「按仓库」汇总
6
48
 
7
49
  ### 学到的(知识库第 62 条)
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.13-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.15-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.13'
17
+ const CLIENT_VERSION = '0.9.15'
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 () => {
@@ -1137,7 +1139,11 @@ window.__ModuleLoader__.load({
1137
1139
  || (watcher.filteredLog || []).some((entry) => String(entry.number).includes(needle) || String(entry.title || '').toLowerCase().includes(needle))
1138
1140
  const matchesBadge = (watcher) => !badgeFilter
1139
1141
  || repoBadges(watcher.repoAccess).some((badge) => badge.text === badgeFilter)
1140
- const visible = watchers.filter((watcher) => matches(watcher) && matchesBadge(watcher))
1142
+ const hasProblem = (watcher) => Boolean(watcher.lastError)
1143
+ || Number(watcher.silentWakes) >= 2
1144
+ || Boolean(repoStructureNote(watcher.repoAccess))
1145
+ || repoBadges(watcher.repoAccess).some((badge) => badge.tone === 'warning' || badge.tone === 'danger')
1146
+ const visible = watchers.filter((watcher) => matches(watcher) && matchesBadge(watcher) && (!problemsOnly || hasProblem(watcher)))
1141
1147
 
1142
1148
  const overview = [
1143
1149
  watchers.some((w) => (w.filteredLog || []).length > 0)
@@ -1254,12 +1260,22 @@ window.__ModuleLoader__.load({
1254
1260
  h('div', { className: 'dt-hint' }, watcher.repo + ' · ' + event.text)))))))
1255
1261
 
1256
1262
  // 按仓库汇总:守多个仓库时先看哪个健康,再看明细(渐进披露)
1257
- const repoSummary = visible.length === 0 ? null : h(Section, { key: 'repo-summary', title: '按仓库' },
1263
+ const problemCount = watchers.filter(hasProblem).length
1264
+ const repoSummary = watchers.length === 0 ? null : h(Section, { key: 'repo-summary', title: '按仓库', hint: '点仓库名只看它(再点取消)' },
1265
+ h('div', { className: 'dt-row-meta' },
1266
+ h(Pill, { active: problemsOnly, onClick: () => setProblemsOnly(!problemsOnly) }, '只看有问题的' + (problemCount > 0 ? ' (' + problemCount + ')' : '')),
1267
+ problemsOnly ? h(Pill, { onClick: () => setProblemsOnly(false) }, '全部') : null),
1268
+ visible.length === 0 ? h(Hint, null, '没有符合条件的主理鱼。点上面「全部」看所有守。') : null,
1258
1269
  h('div', { className: 'dt-rows' }, ...summarizeByRepo(visible).map((group) => h('div', { key: 'repo-' + group.repo, className: 'dt-row' },
1259
1270
  h('div', { className: 'dt-row-main' },
1260
1271
  h('div', { className: 'dt-row-title' },
1261
1272
  h(StateDot, { state: group.errors > 0 ? 'error' : group.silentWakes >= 2 ? 'warning' : 'done' }),
1262
- h('span', { className: 'dt-row-name' }, group.repo),
1273
+ h('button', {
1274
+ className: 'dt-textlink dt-row-name',
1275
+ type: 'button',
1276
+ onClick: () => setSearch(search === group.repo ? '' : group.repo),
1277
+ title: '点一下只看这个仓库(再点取消)',
1278
+ }, group.repo),
1263
1279
  ...group.badges.map((badge) => h(Tag, { key: 'rb-' + badge.text, tone: badge.tone }, badge.text))),
1264
1280
  h('div', { className: 'dt-row-meta' },
1265
1281
  h('span', null, group.count + ' 条守(启用 ' + group.enabled + ')'),
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.13'
35
+ export const SERVER_VERSION = '0.9.15'
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.13",
3
+ "version": "0.9.15",
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",