dsh-session-superagent 0.9.240 → 0.9.241

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,43 @@
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.241] - 2026-11-05 —— 知识库里会过期的数字
6
+
7
+ ### 问题
8
+
9
+ T34 抽的 20 条里,规则全部成立,但有 **11 处「依据里的数字」已经过期**:
10
+
11
+ | 位置 | 文档写的 | 实际 |
12
+ |---|---|---|
13
+ | `contract-snapshot.md` | 8 条路由、7 个工具 | **9 条路由、8 个工具** |
14
+ | `copy-snapshot.md` | 示例 44 行 | **59 行** |
15
+ | `why-not-split-index.md` | 1795 行 | **2954 行(+65%)** |
16
+ | `offline-mount-smoke.md` | 8 条路由 | 9 条 |
17
+
18
+ 规则本身不受影响,但**下一轮读者会严重低估规模** —— 尤其那个 1795 → 2954。
19
+
20
+ ### 改法
21
+
22
+ 不加「现值」了事,而是写清「**当时值 + 现值**」,保留历史语境:
23
+
24
+ > 当时 8 条路由、7 个工具;2026-11 已是 **9 条路由、8 个工具**,数量会继续涨,判据不能跟着写死。
25
+
26
+ 同时把判据改成**比清单**而不是比数字 —— 数字会涨,清单不会说谎。
27
+
28
+ ### 顺带:安全板块两条也接进代码
29
+
30
+ `windows-secrets-perms.md`(Windows 上 chmod 0600 保护不了 token)与
31
+ `token-scopes.md`(权限要看得见、也要够窄)此前是 **0 引用**,现在都指向了实现点。
32
+
33
+ KB 引用 **16 → 19 条**,必查清单从 5 条扩到 7 条。
34
+
35
+ ### 证据
36
+
37
+ ```
38
+ npm test → 381/381
39
+ audit-kb-links → 19 处引用,7 条关键条目都在
40
+ ```
41
+
5
42
  ## [0.9.240] - 2026-11-05 —— 让代码指着知识库:引用从 3 条到 16 条
6
43
 
7
44
  ### 问题
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.240-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.241-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
  [![awesome](https://img.shields.io/badge/awesome-dsh--plugin-%E2%9C%93-success.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
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.240'
17
+ const CLIENT_VERSION = '0.9.241'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
 
45
45
  export const name = 'dsh-session-superagent'
46
46
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
47
- export const SERVER_VERSION = '0.9.240'
47
+ export const SERVER_VERSION = '0.9.241'
48
48
  export const inject = ['tools', 'agents', 'webServer']
49
49
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
50
50
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
@@ -783,6 +783,7 @@ function wake(ctx, sessionId, text) {
783
783
  * 出处:https://nodejs.org/api/fs.html(fs.chmod 的 Caveats)
784
784
  */
785
785
  let secretsHardened = 'unknown'
786
+ // KB: windows-secrets-perms.md —— Windows 上 chmod 0600 保护不了 token,要补 ACL
786
787
  function hardenSecretsFile(file) {
787
788
  if (process.platform !== 'win32') {
788
789
  try {
@@ -815,6 +816,7 @@ function hardenSecretsFile(file) {
815
816
  let scopesCache = { at: 0, value: null }
816
817
  const BROAD_SCOPES = ['delete:packages', 'admin:repo_hook', 'admin:org', 'workflow', 'write:packages', 'admin:public_key']
817
818
 
819
+ // KB: token-scopes.md —— token 权限要看得见、也要够窄
818
820
  async function tokenScopes() {
819
821
  if (scopesCache.value && Date.now() - scopesCache.at < 5 * 60 * 1000) return scopesCache.value
820
822
  const res = await run('gh', ['api', '-i', 'user'], { timeoutMs: 20000, env: ghEnv() })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.240",
3
+ "version": "0.9.241",
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",