dsh-session-superagent 0.9.93 → 0.9.94

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,22 @@
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.94] - 2026-11-02 —— 仓库改名/转移要单独识别(否则只是"一直没动静")
6
+
7
+ ### 为什么
8
+ 仓库被改名或转移后,GitHub 回 **301 / "Repository has been moved"**。
9
+ 原来的错误分类里它落进 `other`,客户看到的是一句笼统的失败,
10
+ 印象却是"这条守一直没动静"——**不知道该去改 owner/name**。
11
+
12
+ ### 改法
13
+ 1. `classifyGhError` 新增 `moved` 分支(匹配 301 / moved permanently / has been moved),
14
+ 排在 `notfound` 之前,提示:`(仓库改名或转移了:用新地址重新添加,或把守改成新的 owner/name)`;
15
+ 2. `moved` 不在"可自动恢复"名单里(网络/限流/网关才算);
16
+ 3. `watch_doctor` 的可访问性检查改用分类提示,不再直接贴 120 字原始 stderr。
17
+
18
+ ### 测试
19
+ - 扩展 1 例:分类表加 `HTTP 301` 与 `Repository has been moved` 两行,都判为不可自动恢复。合计 **206 例**。
20
+
5
21
  ## [0.9.93] - 2026-11-02 —— 同一仓库被多个会话守着时,面板说说清"还有谁"
6
22
 
7
23
  ### 为什么
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.93-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.94-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
 
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.93'
17
+ const CLIENT_VERSION = '0.9.94'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/gh-format.js CHANGED
@@ -26,6 +26,10 @@ export function classifyGhError(detail) {
26
26
  if (/ENOENT|not found.*gh|gh: command not found/i.test(text)) {
27
27
  return { kind: 'nogh', short, hint: '(找不到 gh 命令:确认已安装且在 PATH)' }
28
28
  }
29
+ // 仓库改名/转移:GitHub 会回 301 或 "has moved",客户看到的却只是「没动静」
30
+ if (/moved permanently|has moved|HTTP 301|Repository has been moved/i.test(text)) {
31
+ return { kind: 'moved', short, hint: '(仓库改名或转移了:用新地址重新添加,或把守改成新的 owner/name)' }
32
+ }
29
33
  if (/HTTP 404|Not Found|not found/i.test(text) && !/command not found/i.test(text)) {
30
34
  return { kind: 'notfound', short, hint: '(仓库不存在或没权限:检查 owner/name)' }
31
35
  }
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.93'
43
+ export const SERVER_VERSION = '0.9.94'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  const DEFAULT_SESSION_WAKES = 12
@@ -1906,7 +1906,13 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
1906
1906
  for (const entry of wanted) {
1907
1907
  // 2. 仓库可访问
1908
1908
  const repoRes = await run('gh', ['api', `repos/${entry.repo}`, '--jq', '.full_name'], { env: ghEnv() })
1909
- lines.push(`${repoRes.code === 0 ? 'OK ' : 'FAIL'} ${entry.repo} 可访问:${repoRes.code === 0 ? repoRes.stdout.trim() : redact(repoRes.stderr).slice(0, 120)}`)
1909
+ if (repoRes.code === 0) {
1910
+ lines.push(`OK ${entry.repo} 可访问:${repoRes.stdout.trim()}`)
1911
+ } else {
1912
+ // 仓库改名/转移在 GH 上是 301,客户看到的却只是「一直没动静」
1913
+ const why = classifyGhError([repoRes.stderr, repoRes.stdout].join(' '))
1914
+ lines.push(`FAIL ${entry.repo} 不可访问:${why.hint}`)
1915
+ }
1910
1916
 
1911
1917
  // 3. ack 标签是否存在
1912
1918
  const label = entry.ackLabel || DEFAULT_ACK_LABEL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.93",
3
+ "version": "0.9.94",
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",