dsh-session-superagent 0.9.16 → 0.9.17

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,30 @@
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.17] - 2026-11-02 —— 抽检扩到六条路径:抓到"同一件事两种说法"
6
+
7
+ ### 学到的(知识库第 66 条)
8
+ 同语义的两份实现(服务端 + 客户端)会慢慢走偏 —— 本轮有实测证据。
9
+
10
+ ### 抓到的三处
11
+ | 路径 | 抽检发现 | 处理 |
12
+ |---|---|---|
13
+ | ④ 面板接口 500 | 已有"复制诊断 → 重启"的下一步 | ✅ 不动 |
14
+ | ⑤ gh 未安装/未登录 | 设置页只有原始错误,且**不进「需要关注」** | ✅ 补人话 + 后果 + 下一步 |
15
+ | ⑥ 归档 / 禁用仓库 | **客户端 `repoStructureNote` 少了这两条**(服务端早有) | ✅ 对齐,顺序也统一 |
16
+
17
+ ### 为什么⑥ 会发生
18
+ 面板不能跨包 import 服务端模块,于是 `repoBadges` / `durationText` / `accessNote` / `repoStructureNote`
19
+ 各有一份同语义实现。改一边忘另一边,就出现"唤醒消息说已归档、面板什么都不说"。
20
+
21
+ ### 防再走偏
22
+ 1. 每处重复都要**两端各一条用例**(本轮补了客户端这条);
23
+ 2. 改一边时同步 `grep` 另一边;
24
+ 3. 抽检脚本把面板文案打出来,走查时更容易发现不一致。
25
+
26
+ ### 测试
27
+ - 新增 2 例(gh 不可用的文案与后果;归档/禁用必须在面板出现)。合计 **162 例**。
28
+
5
29
  ## [0.9.16] - 2026-11-02 —— 可用性抽检:只读仓库没进「需要关注」
6
30
 
7
31
  ### 怎么做的(知识库第 65 条)
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.16-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.17-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.16'
17
+ const CLIENT_VERSION = '0.9.17'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -1132,6 +1132,9 @@ window.__ModuleLoader__.load({
1132
1132
  if (watcher.lastError) problems.push({ key: 'e-' + watcher.repo, text: watcher.repo + ' 轮询失败:' + watcher.lastError })
1133
1133
  else if (watcher.lastDeferred) problems.push({ key: 'd-' + watcher.repo, text: watcher.repo + ' 暂停唤醒:' + watcher.lastDeferred })
1134
1134
  }
1135
+ if (body.gh && body.gh.ok === false && credentials.token === 'none') {
1136
+ problems.push({ key: 'gh', text: 'gh CLI 不可用,且没有配置 token —— 现在所有轮询都会失败。先跑 gh auth login,或在「设置 → 来源」填一个 token。' })
1137
+ }
1135
1138
  if (watchers.length > 0 && credentials.token === 'none') {
1136
1139
  problems.push({ key: 'cred', text: '未配置 token,正在复用已登录的 gh CLI(可用 panel 填 token 换成独立凭据)' })
1137
1140
  }
@@ -1308,7 +1311,11 @@ window.__ModuleLoader__.load({
1308
1311
  h(Section, { key: 'source', title: '来源' },
1309
1312
  h(KeyValues, { rows: [
1310
1313
  ['仓库', watchers.length === 0 ? '未绑定' : watchers.map((w) => w.repo).join(', ')],
1311
- ['gh CLI', !body.gh ? '检测中…' : body.gh.ok ? '可用 · ' + (body.gh.version || '') : '不可用 · ' + (body.gh.error || '')],
1314
+ ['gh CLI', !body.gh
1315
+ ? '检测中…'
1316
+ : body.gh.ok
1317
+ ? '可用 · ' + (body.gh.version || '')
1318
+ : '不可用 —— 先跑 gh auth login(或装 gh CLI);也可以直接在下面填 token · ' + String(body.gh.error || '').slice(0, 80)],
1312
1319
  ['凭证', credentials.token === 'none' ? '回退到 gh CLI 登录态' : '使用面板配置的 token'],
1313
1320
  ['权限范围', (() => {
1314
1321
  const info = body.tokenScopes
@@ -1514,6 +1521,9 @@ window.__ModuleLoader__.load({
1514
1521
  function repoStructureNote(access) {
1515
1522
  if (!access || typeof access !== 'object') return ''
1516
1523
  const repo = String(access.repo || '这个仓库')
1524
+ // 顺序与服务端 gh-format.js:repoStructureNote 保持一致:归档/禁用优先
1525
+ if (access.archived === true) return repo + ' 已归档:GitHub 上归档仓库是只读的,评论和打标签都会失败 —— 守它只能看、不能回写。'
1526
+ if (access.disabled === true) return repo + ' 已被禁用:这个仓库当前不可用,主理鱼不会拿到任何条目。'
1517
1527
  if (access.hasIssues === false) return repo + ' 关闭了 Issues —— 主理鱼只认 issue / PR,这里不会有任何条目可接。'
1518
1528
  if (access.fork === true && access.parent && access.hasIssues !== true) {
1519
1529
  return repo + ' 是 ' + String(access.parent) + ' 的 fork。fork 默认不带 Issues,issue 大多落在上游 —— 确认你要守的是哪一个。'
package/lib/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
 
33
33
  export const name = 'dsh-session-superagent'
34
34
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
35
- export const SERVER_VERSION = '0.9.16'
35
+ export const SERVER_VERSION = '0.9.17'
36
36
  export const inject = ['tools', 'agents', 'webServer']
37
37
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
38
38
  const DEFAULT_SESSION_WAKES = 12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.16",
3
+ "version": "0.9.17",
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",