dsh-session-superagent 0.9.84 → 0.9.86

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,37 @@
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.86] - 2026-11-02 —— watch_status 文本:正常的守不堆字段,异常的才说原因
6
+
7
+ ### 为什么
8
+ 原来每条守一行,字段固定为 `repo → session | every 60s | flags | lastPoll=… | lastWake=… | err=-`。
9
+ **十条守就是十行长日志**,而其中 90% 的字段是 `-` 或 `null` —— agent 读完还得自己在脑子里筛。
10
+
11
+ ### 改法
12
+ - 基础部分只写"这条守是什么":`o/ok → s1 | 每 60s`(正常的守 < 60 字符);
13
+ - **只有需要你注意时才追加**:`暂停:cap-session`、`叫醒 3 次没回音`、`已 35 分钟没轮询`、`还没轮询过`、`上次失败:…`;
14
+ - `lastPoll=` / `lastWake=` / `err=-` 这类固定字段不再出现(JSON 里仍有,机器不受影响)。
15
+
16
+ ### 测试
17
+ - 更新 1 例(断言从 `defer=cap-session` 改成 `暂停:cap-session`,并新增"不许出现 lastPoll=");
18
+ - 新增 1 例:正常的守行 < 60 字符且无暂停、异常的守带原因、每条守一行。合计 **198 例**。
19
+
20
+ ## [0.9.85] - 2026-11-02 —— 知识库加一条「第一次读这三篇」的入口(并有门禁守着)
21
+
22
+ ### 为什么
23
+ 112 篇、9 个板块,按主题分组对熟悉的人好用,**对新人等于没有入口** —— 他不知道自己该从哪篇开始。
24
+
25
+ ### 做法
26
+ `docs/kb/README.md` 顶部加 3 篇阅读路径(规则对齐 → 门禁可信度 → 错误分类 ),
27
+ `check-docs.mjs` 增加第 4 项检查:
28
+ - 路径必须存在且有 ≥ 3 篇;
29
+ - 路径里的文件必须真实存在。
30
+
31
+ ### 写的时候踩到的两个真问题
32
+ 1. 第一版检查用了不存在的变量 `ok` → 路径一坏就 **抛异常**(比不检查更糟);
33
+ 2. 检查块被插进了 `countMismatch` 的 `else` 分支里,只有"篇数一致"时才跑 ——
34
+ 重构到独立段落后,验证:删掉一篇链接 → `FAIL 知识库索引缺「第一次读」的阅读路径`,exit=1;还原后 exit=0。
35
+
5
36
  ## [0.9.84] - 2026-11-02 —— ack 失败分两类:会不会自己好,客户要知道
6
37
 
7
38
  ### 为什么
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.84-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.86-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
 
@@ -121,7 +121,7 @@ dsh plugin install /path/to/dsh-session-superagent
121
121
  ## 开发
122
122
 
123
123
  ```sh
124
- node --test # 197 项单测
124
+ node --test # 198 项单测
125
125
  ```
126
126
 
127
127
  ### 工具输出:文本给人和 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.84'
17
+ const CLIENT_VERSION = '0.9.86'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
 
41
41
  export const name = 'dsh-session-superagent'
42
42
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
43
- export const SERVER_VERSION = '0.9.84'
43
+ export const SERVER_VERSION = '0.9.86'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  const DEFAULT_SESSION_WAKES = 12
@@ -2091,23 +2091,29 @@ export function apply(ctx) {
2091
2091
  // 同一份数据:结构化视图 -> 文本只是它的一种渲染,两边永远对得上
2092
2092
  const view = statusView(list)
2093
2093
  if (args && args.format === 'json') return JSON.stringify(view, null, 2)
2094
+ // 默认只写「这条守是什么」;只有当它需要你注意时才追加原因。
2095
+ // 以前每行都带 lastPoll/lastWake/err=-,十条守就是十行长日志。
2094
2096
  const body = view.watchers.map((w) => {
2095
- const flags = []
2096
- if (w.observe) flags.push('observe')
2097
- if (w.isolated) flags.push('isolated')
2098
- if (!w.enabled) flags.push('paused')
2099
- if (w.activeHours) flags.push('hours=' + w.activeHours)
2100
- if (w.labels.length) flags.push('labels=' + w.labels.join(','))
2101
- if (w.onlyAssigned) flags.push('onlyAssigned')
2102
- if (w.deferReason) flags.push('defer=' + w.deferReason)
2103
- if (w.silentWakes > 0) flags.push('silent=' + w.silentWakes)
2104
- return [w.repo, '→', w.sessionId,
2105
- '| every ' + w.intervalSec + 's',
2106
- flags.length ? '| ' + flags.join(' ') : '',
2107
- '| lastPoll=' + (w.lastPoll || '-'),
2108
- '| lastWake=' + (w.lastWake || '-'),
2109
- '| err=' + (w.lastError || '-'),
2110
- ].filter(Boolean).join(' ')
2097
+ const parts = [w.repo, '→', w.sessionId, '| 每 ' + w.intervalSec + 's']
2098
+ if (w.observe) parts.push('| 仅观察')
2099
+ if (w.isolated) parts.push('| 隔离')
2100
+ if (!w.enabled) parts.push('| 已暂停')
2101
+ if (w.activeHours) parts.push('| 时段 ' + w.activeHours)
2102
+ if (w.labels.length) parts.push('| 标签 ' + w.labels.join(','))
2103
+ if (w.onlyAssigned) parts.push('| 只看已指派')
2104
+ const problems = []
2105
+ if (w.deferReason) problems.push('暂停:' + w.deferReason)
2106
+ if (w.silentWakes >= 2) problems.push('叫醒 ' + w.silentWakes + ' 次没回音')
2107
+ if (w.lastError) problems.push('上次失败:' + String(w.lastError).split('(')[0].slice(0, 60))
2108
+ if (w.enabled && w.lastPoll) {
2109
+ const age = Date.now() - Date.parse(w.lastPoll)
2110
+ if (Number.isFinite(age) && age > Math.max(w.intervalSec * 3000, 300000)) {
2111
+ problems.push('已 ' + Math.round(age / 60000) + ' 分钟没轮询')
2112
+ }
2113
+ }
2114
+ if (!w.lastPoll) problems.push('还没轮询过')
2115
+ if (problems.length) parts.push('| ' + problems.join(';'))
2116
+ return parts.join(' ')
2111
2117
  }).join(String.fromCharCode(10))
2112
2118
  const s2 = view.session
2113
2119
  const summary = 'session: ' + s2.used + '/' + s2.cap + ' wakes last hour'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.84",
3
+ "version": "0.9.86",
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",