dsh-session-superagent 0.8.87 → 0.8.89

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,57 @@
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.8.89] - 2026-11-02 —— 「在等」也是一种空态,别让它沉默
6
+
7
+ ### 学到的(知识库第 38 条)
8
+ NN/g《Empty-State Interface Design》:空态不只有"新手引导"一种,
9
+ 还有"内容被过滤""还没开始"等形态,各自需要不同提示。
10
+ <https://www.nngroup.com/articles/empty-state-interface-design/>
11
+
12
+ ### 抓到的缺口
13
+ 面板原来只有两种状态:**一条守都没有**(三步引导)、**有守**(显示列表)。
14
+ 但最常见的是中间态:**已经有守,但一次都没被唤醒过** —— 这时界面一片安静,客户以为坏了。
15
+
16
+ ### 改了什么
17
+ 加一句明确的"在等",并且**指向下一步动作**:
18
+ > 还没有唤醒过:守会在仓库出现新条目时叫醒这个会话。想先试一次,点行里的「立刻」;
19
+ > 如果一直没动静,看上面「需要关注」里有没有被过滤的记录。
20
+
21
+ 只在"全部守都没唤醒过"时出现,唤醒过就消失,不占版面。
22
+
23
+ ### 顺带
24
+ `docs/optimization-plan.md` 的指标表更新到当前状态(新增 17–20 项:中间态、知识库 37 条、
25
+ 契约快照、挂载冒烟)。
26
+
27
+ ### 测试
28
+ - 新增 1 例,合计 **136 例**。
29
+
30
+ ## [0.8.88] - 2026-11-02 —— 契约快照:数量对,形状也要对
31
+
32
+ ### 学到的(知识库第 37 条)
33
+ Node 有 Snapshot testing 一节,但本机 `assert.snapshot` 是 `undefined`(`t.assert.snapshot` 属实验 API),
34
+ **所以没用它** —— 改用最朴素的「JSON fixture + deepEqual」,即 approval testing。
35
+
36
+ ### 为什么需要
37
+ 0.8.87 的挂载冒烟只验**数量**(8 路由 / 7 工具)。路由改名、工具少一个参数时,数量仍可能是 8/7,
38
+ 但客户调用会**全废**。数量和形状是两件事。
39
+
40
+ ### 改了什么
41
+ - `scripts/contract.mjs`:假 ctx → 真 `apply()` → 抽出 `{version, inject, tools[{name,params,required}], routes}`;
42
+ - `test/fixtures/contract.json` 存快照;`test/contract-shape.test.mjs` 每次 deepEqual;
43
+ - 只记**参数名**不记描述文案 —— 改文案不该红。
44
+ - 改形状必须 `node scripts/contract.mjs --update` 并在 CHANGELOG 说明。
45
+
46
+ ### 负例验证(重要)
47
+ 故意把 `github` 的 params 改成只剩 `path` → 测试**立刻红**;`--update` 后恢复绿。
48
+
49
+ ### 当轮修正的一处设计错误
50
+ 第一版把 `version` 也写进快照 —— 结果每次发版都必须手工 `--update`,纯摩擦。
51
+ 已移除(版本由 meta 测试守)。**"测试不该逼人做无意义的操作"** 也是设计标准之一。
52
+
53
+ ### 测试
54
+ - 新增 1 例,合计 **135 例**。
55
+
5
56
  ## [0.8.87] - 2026-11-02 —— 离线挂载冒烟:下次重启前先证明"挂得上去"
6
57
 
7
58
  ### 为什么这轮做这个(知识库第 36 条)
package/MAINTENANCE.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## 二、当前状态(2026-11-01)
11
11
 
12
- - [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test` 134/134 通过
12
+ - [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test` 136/136 通过
13
13
  - [x] 自回声抑制(逐条水位)
14
14
  - [x] 仅空闲注入(避免草稿回放)
15
15
  - [x] 唤醒失败不推进水位
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.8.87-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.8.89-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
 
@@ -99,7 +99,7 @@ dsh plugin install /path/to/dsh-session-superagent
99
99
  ## 开发
100
100
 
101
101
  ```sh
102
- node --test # 134 项单测
102
+ node --test # 136 项单测
103
103
  ```
104
104
 
105
105
  版本与发布流程见 [UPDATING.md](UPDATING.md),交付门见 [CHECKLIST.md](CHECKLIST.md),接手台账见 [MAINTENANCE.md](MAINTENANCE.md)。
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.8.87'
17
+ const CLIENT_VERSION = '0.8.89'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -1137,6 +1137,12 @@ window.__ModuleLoader__.load({
1137
1137
  ? h(Section, { key: 'problems', title: '需要关注', count: problems.length },
1138
1138
  h('ul', { className: 'dt-plain-list' }, problems.map((item) => h('li', { key: item.key, className: 'dt-danger' }, item.text))))
1139
1139
  : null,
1140
+ // 中间态:已经有守、但一次都没唤醒过 —— 这不是"没配置",是"在等"
1141
+ (watchers.length > 0 && watchers.every((w) => !w.lastWake))
1142
+ ? h('div', { className: 'sa-dock-foot', key: 'waiting' },
1143
+ '还没有唤醒过:守会在仓库出现新条目时叫醒这个会话。'
1144
+ + '想先试一次,点行里的「立刻」;如果一直没动静,看上面「需要关注」里有没有被过滤的记录。')
1145
+ : null,
1140
1146
  badgeFilter
1141
1147
  ? h('div', { className: 'dt-row-meta', key: 'badge-filter' },
1142
1148
  h('span', null, '只看 ' + badgeFilter + ' 的守(' + visible.length + ' 条):'),
package/lib/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
 
31
31
  export const name = 'dsh-session-superagent'
32
32
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
33
- export const SERVER_VERSION = '0.8.87'
33
+ export const SERVER_VERSION = '0.8.89'
34
34
  export const inject = ['tools', 'agents', 'webServer']
35
35
 
36
36
  /** 仅供测试:读写状态文件(生产代码不要用)。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.8.87",
3
+ "version": "0.8.89",
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",