dsh-session-superagent 0.9.112 → 0.9.113

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,25 @@
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.113] - 2026-11-03 —— 把「不是错误的状态码」理一遍:204 也补上了
6
+
7
+ ### 梳理结果
8
+ | 状态码 | 语义 | 我们的处理 |
9
+ |---|---|---|
10
+ | 200 | 正常 | 解析 body |
11
+ | **204** | 没有内容(DELETE / 空列表) | **本轮补上**:按「未变化」处理(此前会掉进"不是合法 JSON") |
12
+ | **304** | 没有变化(条件请求命中) | 0.9.110 修好:按「未变化」处理,不计入速率限制 |
13
+ | 301 | 改名/转移 | 归 `moved`,提示换新地址 |
14
+ | 401 / 403 / 404 | 要人动手 | 归 `auth` / `ratelimit` / `notfound` |
15
+ | 5xx | 服务端/网关 | 归 `gateway`,暗示可重试 |
16
+
17
+ ### 改法
18
+ `pollOnce` 在 304 之外再认 204:清 `lastError`、重置退避、记 `unchanged` 事件。
19
+
20
+ ### 测试
21
+ 新增 1 例:`parseGhInclude` 能认 200/204/304 三种状态码与 ETag;304 的分类提示必须直说「不是错误」。
22
+ 合计 **220 例**。
23
+
5
24
  ## [0.9.112] - 2026-11-03 —— 错误旁边写上「多久之前」,超过一小时标「旧记录」
6
25
 
7
26
  ### 为什么
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.112-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.113-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
 
@@ -122,7 +122,7 @@ dsh plugin install /path/to/dsh-session-superagent
122
122
  ## 开发
123
123
 
124
124
  ```sh
125
- node --test # 219 项单测
125
+ node --test # 220 项单测
126
126
  ```
127
127
 
128
128
  ### 工具输出:文本给人和 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.112'
17
+ const CLIENT_VERSION = '0.9.113'
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.112'
43
+ export const SERVER_VERSION = '0.9.113'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
@@ -901,6 +901,16 @@ async function pollOnce(ctx, entry, baseMs) {
901
901
  entry.lastError = null
902
902
  return
903
903
  }
904
+ // 204 No Content 也是「没有新东西」:DELETE/空列表都会这样,别当 JSON 解析失败
905
+ if (parsed.status === 204) {
906
+ entry.lastError = null
907
+ entry.consecutiveFailures = 0
908
+ entry.nextAt = null
909
+ entry.lastDeferred = '没有内容(204)'
910
+ entry.deferReason = 'unchanged'
911
+ noteEvent(entry, 'unchanged', entry.lastDeferred)
912
+ return
913
+ }
904
914
  if (parsed.status === 304) {
905
915
  // 没变化:不解析、不算失败、不重置退避,只记一笔
906
916
  entry.lastError = null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.112",
3
+ "version": "0.9.113",
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",