dsh-session-superagent 0.9.114 → 0.9.116

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,61 @@
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.116] - 2026-11-03 —— 404 不等于"不存在";顺便修掉一个"凌晨才红"的用例
6
+
7
+ ### 学到什么(出处)
8
+ GitHub《Troubleshooting the REST API》:
9
+ > If you make a request to access a private resource and your request isn't properly authenticated,
10
+ > you will receive a `404 Not Found` response. GitHub uses `404` instead of `403` **to avoid confirming
11
+ > the existence of private repositories.**
12
+
13
+ 出处:<https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api#404-not-found-for-an-existing-resource>
14
+
15
+ 也就是说:**404 既可能是"不存在",也可能是"没权限"**,而且这两种情况的修复动作完全不同。
16
+
17
+ ### 改了什么
18
+ 1. `notfound` 的提示改写为:`(不存在或没权限 —— 私有仓库无权限也回 404:查 owner/name 与 token)`(47 字符,未超门禁 60);
19
+ 2. `repo_here` 工具失败时也走 `formatGhCall()`(与 `github` 工具一致,0.9.115 漏了它)。
20
+
21
+ ### 顺带抓到一个"凌晨才红"的用例
22
+ `顶部四个计数必须加得上总数` 里把时段写死成 `03:00-04:00`:
23
+ - 白天跑 → 该守在窗口外,计数里出现「时段外」,用例绿;
24
+ - **凌晨 3 点跑 → 该守就在窗口内**,`时段外` 这一项消失,`value('时段外')` 得到 `NaN`,用例红。
25
+
26
+ 改成 `outsideWindow()`:从当前小时 +6 开始、长度 1 小时,任何时刻都在窗口外。
27
+
28
+ ### 证据
29
+ ```
30
+ node --test → 223/223(此前凌晨跑会 221/223)
31
+ ```
32
+
33
+ ## [0.9.115] - 2026-11-03 —— `github` 工具失败时也带「下一步」和机器可读的 kind
34
+
35
+ ### 为什么
36
+ 上一版只修了**轮询**路径(x-poll-interval / 永久错误长退避)。而 `github` 工具(任意 REST 调用)
37
+ 失败时仍然只贴原始 stderr 加一行 `[exit code: 1]`:
38
+
39
+ ```
40
+ gh: HTTP 404 Not Found
41
+ [exit code: 1]
42
+ ```
43
+
44
+ 调用它的 agent 得自己猜"是仓库名错了、还是没权限、还是登录失效"。GitHub 官方最佳实践明确要求
45
+ 「do not ignore repeated 4xx/5xx」—— 失败必须带着可执行动作回到调用方。
46
+
47
+ ### 改法
48
+ 抽出 `formatGhCall()`(`lib/gh-format.js`),`github` 工具与轮询共用同一套分类:
49
+
50
+ | 情况 | 现在返回 |
51
+ |---|---|
52
+ | 404 | `…(仓库不存在或没权限:检查 owner/name)` + `[kind: notfound]` |
53
+ | 401 | `…(gh 登录失效:跑 gh auth login…)` + `[kind: auth]` |
54
+ | 304 | `…(没有变化 —— 条件请求命中 304,这不是错误)` + `[kind: notmodified]` |
55
+ | 成功 | 只加 `[exit code: 0]`(不带 kind,保持轻量) |
56
+
57
+ ### 测试
58
+ 新增 1 例:四种情况的返回形状(含「成功时不带 kind」)。合计 **223 例**。
59
+
5
60
  ## [0.9.114] - 2026-11-03 —— 按 GitHub 官方最佳实践补两条:x-poll-interval、永久错误等更久
6
61
 
7
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.114-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.116-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 # 222 项单测
125
+ node --test # 223 项单测
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.114'
17
+ const CLIENT_VERSION = '0.9.116'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。