dsh-session-superagent 0.9.46 → 0.9.48
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 +36 -0
- package/README.md +4 -2
- package/client.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
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.48] - 2026-11-02 —— 契约从测试目录搬进文档:`docs/json-契约.md`
|
|
6
|
+
|
|
7
|
+
### 学到的(延续知识库第 93 条)
|
|
8
|
+
契约要出现在**客户看得见的地方**,不能只躺在 `test/fixtures/` 里。
|
|
9
|
+
|
|
10
|
+
### 做了什么
|
|
11
|
+
1. 清单补上 `watch_trace.results[]` 的结构(含 `filtered[]` / `wakes[]` 的子字段);
|
|
12
|
+
2. `scripts/render-contract.mjs` 把清单渲染成 `docs/json-契约.md`(149 行,含每个字段的稳定性);
|
|
13
|
+
3. `--write` / `--check` 两种模式;`--check` 进 preflight 第 20 项 —— 清单改了没重新生成就红;
|
|
14
|
+
4. README「工具输出」小节指向这份文档。
|
|
15
|
+
|
|
16
|
+
### 一个"假通过"被自己抓住
|
|
17
|
+
`results[]` 的断言原本写成 `if (results.length > 0) {...}` —— 空数组时整段被跳过,
|
|
18
|
+
**等于永远通过**。改成先断言"必须非空"(并在测试里造痕迹),断到真的执行。
|
|
19
|
+
|
|
20
|
+
### 测试
|
|
21
|
+
- 契约用例仍 2 例,但 `results[]` 分支现在真的跑;preflight 20 项全绿。
|
|
22
|
+
|
|
23
|
+
## [0.9.47] - 2026-11-02 —— 字段稳定性清单:哪个字段可以被依赖
|
|
24
|
+
|
|
25
|
+
### 学到的(知识库第 93 条)
|
|
26
|
+
`schemaVersion` 只说"什么时候算破坏性变更",不回答**哪个字段**是承诺。
|
|
27
|
+
参考 Kubernetes 的 stable / beta / alpha,我们缩成 `stable` / `experimental` 两档。
|
|
28
|
+
|
|
29
|
+
### 做法
|
|
30
|
+
`test/fixtures/contract-stability.json` 作为唯一口径;配套用例:
|
|
31
|
+
1. 实测 JSON 的字段集合必须与清单**完全一致**(新增字段不登记就红);
|
|
32
|
+
2. 级别只能是 stable / experimental,且至少一个 stable(防清单自我腐烂)。
|
|
33
|
+
|
|
34
|
+
### 第一次跑就红两次(都是"我以为我记得返回值")
|
|
35
|
+
- `watch_stop` 实际返回 `{schemaVersion, ok, id, repo}` —— 漏登记 `repo`;
|
|
36
|
+
- `watch_ack` 失败时形状不同(`{schemaVersion, ok, repo, acked, failed}`)—— 用例改成两种都接受。
|
|
37
|
+
|
|
38
|
+
### 测试
|
|
39
|
+
- 新增 2 例;合计 **184 例**。
|
|
40
|
+
|
|
5
41
|
## [0.9.46] - 2026-11-02 —— 写工具也给 JSON:成功与否不再靠读中文
|
|
6
42
|
|
|
7
43
|
### 学到的(延续知识库第 91 条)
|
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)
|
|
6
|
-
[](https://github.com/MYCF711/dsh-session-superagent/releases)
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-session-superagent)
|
|
8
8
|
[](https://github.com/topics/dsh-plugin)
|
|
9
9
|
|
|
@@ -121,7 +121,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
121
121
|
## 开发
|
|
122
122
|
|
|
123
123
|
```sh
|
|
124
|
-
node --test #
|
|
124
|
+
node --test # 184 项单测
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
### 工具输出:文本给人和 agent,JSON 给程序
|
|
@@ -137,6 +137,8 @@ node --test # 182 项单测
|
|
|
137
137
|
|
|
138
138
|
`schemaVersion` 现在是 `1`;**字段语义一变就会加这个数**,程序可以据此决定要不要重新解析。
|
|
139
139
|
|
|
140
|
+
每个字段的稳定性(可依赖 / 实验性)见 [docs/json-契约.md](docs/json-契约.md) —— 它由 `test/fixtures/contract-stability.json` 生成,改字段时两边会互相校验收。
|
|
141
|
+
|
|
140
142
|
版本与发布流程见 [UPDATING.md](UPDATING.md),交付门见 [CHECKLIST.md](CHECKLIST.md),接手台账见 [MAINTENANCE.md](MAINTENANCE.md)。
|
|
141
143
|
|
|
142
144
|
## 客户(Customer)
|
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.
|
|
17
|
+
const CLIENT_VERSION = '0.9.48'
|
|
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.
|
|
43
|
+
export const SERVER_VERSION = '0.9.48'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
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.
|
|
3
|
+
"version": "0.9.48",
|
|
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",
|