dsh-session-superagent 0.9.103 → 0.9.104

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,34 @@
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.104] - 2026-11-02 —— 顶部四个数字加不上总数:一条守被数了两次,「时段外」一次没数
6
+
7
+ ### 查出来的
8
+ 面板顶部是 `条主理鱼 / 主理中 / 已暂停 / 异常`。原来的算法各数各的:
9
+ ```js
10
+ running = 状态==active 的条数
11
+ broken = 状态==error 的条数
12
+ paused = enabled===false 的条数 // ← 与上面两个不互斥
13
+ ```
14
+ 于是:
15
+ - 一条**已暂停又有错误**的守 → 「已暂停」「异常」各数一次;
16
+ - 「**时段外**」(设了 activeHours 且此刻在窗口外)根本不进任何一项。
17
+
18
+ 5 条守(正常/暂停/出错/时段外/暂停且出错)时,四项加出来是 5,但其中一条被数两次、一条没数 ——
19
+ **看起来也对得上,实际是巧合**。
20
+
21
+ ### 改法
22
+ 四项都由同一个 `orbitStateOf()` 产出,天然互斥:
23
+ ```js
24
+ const byState = { active: 0, paused: 0, error: 0, dormant: 0 }
25
+ for (const w of watchers) byState[orbitStateOf(w)] += 1
26
+ ```
27
+ 「时段外」只在 > 0 时显示(不占版面)。
28
+
29
+ ### 测试
30
+ 新增 1 例:五种状态的守 → 分项之和必须等于总数。
31
+ 验证:把 `dormant` 写死为 0 → 用例立刻红;还原后绿。合计 **213 例**。
32
+
5
33
  ## [0.9.103] - 2026-11-02 —— 232 条 CHANGELOG 里「重复」出现 22 次,那就让工具找它
6
34
 
7
35
  ### 统计(把 232 条按关键词聚一遍)
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.103-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.104-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 # 212 项单测
124
+ node --test # 213 项单测
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.103'
17
+ const CLIENT_VERSION = '0.9.104'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -1017,9 +1017,14 @@ window.__ModuleLoader__.load({
1017
1017
  setGoalTouched(false)
1018
1018
  }, 'goal 已保存')
1019
1019
 
1020
- const running = watchers.filter((w) => orbitStateOf(w) === 'active').length
1021
- const broken = watchers.filter((w) => orbitStateOf(w) === 'error').length
1022
- const paused = watchers.filter((w) => w.enabled === false).length
1020
+ // 四个数字必须加得上总数(以前「已暂停」按 enabled 数、「异常」按 lastError 数:
1021
+ // 一条已暂停又有错误的守会被数两次,而「时段外」根本没被数)
1022
+ const byState = { active: 0, paused: 0, error: 0, dormant: 0 }
1023
+ for (const w of watchers) byState[orbitStateOf(w)] += 1
1024
+ const running = byState.active
1025
+ const broken = byState.error
1026
+ const paused = byState.paused
1027
+ const dormant = byState.dormant
1023
1028
 
1024
1029
  const stateTag = (watcher) => {
1025
1030
  const state = orbitStateOf(watcher)
@@ -1248,7 +1253,8 @@ window.__ModuleLoader__.load({
1248
1253
  h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(watchers.length)), h('span', null, '条主理鱼')),
1249
1254
  h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(running)), h('span', null, '主理中')),
1250
1255
  h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(paused)), h('span', null, '已暂停')),
1251
- h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(broken)), h('span', null, '异常'))),
1256
+ h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(broken)), h('span', null, '异常')),
1257
+ dormant > 0 ? h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(dormant)), h('span', null, '时段外')) : null),
1252
1258
  h(Section, { key: 'list', title: needle ? '搜索结果' : '主理鱼', count: visible.length },
1253
1259
  watchers.length === 0
1254
1260
  ? h(Onboarding, { onStart: () => setTab('trigger') })
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.103'
43
+ export const SERVER_VERSION = '0.9.104'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.103",
3
+ "version": "0.9.104",
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",