dsh-session-superagent 0.8.46 → 0.8.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 +40 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +37 -2
- package/lib/index.js +35 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
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.8.48] - 2026-11-02 —— 第一次打开不再白屏:三步上手
|
|
6
|
+
|
|
7
|
+
客户装完第一次打开「主理鱼」,以前只有一行灰字「还没有主理鱼」。等于让他去翻 README。
|
|
8
|
+
|
|
9
|
+
现在空态是一张官方 `dt-card`,三步 + 一个能直接开始的按钮:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
三步让这个会话开始盯办
|
|
13
|
+
① 填一个仓库(owner/name,比如 MYCF711/dsh-session-superagent)
|
|
14
|
+
② 选间隔(默认 60 秒;建议先设 300 秒,别把 API 打满)
|
|
15
|
+
③ 点「添加到当前会话」——之后仓库有动静,这个会话就会被叫醒
|
|
16
|
+
[去添加第一条]
|
|
17
|
+
想先看看效果?在「触发」页勾上「仅观察」:它只记录本会唤醒哪几条,不会真打扰你。
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
点「去添加第一条」直接切到「触发」页,不用自己找。
|
|
21
|
+
|
|
22
|
+
### 测试
|
|
23
|
+
- 新增用例:空态必须有三步(①③都在)+ 一个「去添加第一条」按钮。合计 **103 例**。
|
|
24
|
+
|
|
25
|
+
## [0.8.47] - 2026-11-02 —— 客户报障:面板里一键复制诊断
|
|
26
|
+
|
|
27
|
+
客户在别的电脑上用我们的插件,我们看不到他的状态文件。以前报障只能靠来回问
|
|
28
|
+
「你装的哪一版」「面板显示什么」「错误原文是什么」—— 一轮就是半天。
|
|
29
|
+
|
|
30
|
+
### 做法
|
|
31
|
+
- 新增只读接口 `GET /session-superagent/diagnose`,返回一段**已脱敏**的纯文本:
|
|
32
|
+
插件版本、宿主 node 版本、挂载状态(routes/failed/base/at)、每条值守的
|
|
33
|
+
仓库 / 启用状态 / 间隔 / 会话 / 上次轮询 / 连续失败数 / 最近错误;
|
|
34
|
+
- 面板「设置 → 诊断」一键复制这段(`navigator.clipboard`),复制成功会提示行数;
|
|
35
|
+
- 文本出厂前过一遍 `redact()`:token、私钥、Authorization 头都不会带出去。
|
|
36
|
+
|
|
37
|
+
### 测试
|
|
38
|
+
- 路由面 7 → **8 条**,测试与 `preflight` 里的断言同步(含跨实例接管、整组重放、卸载幂等三条)
|
|
39
|
+
- 客户端契约测试逼我改了变量名(`body.text` 会被当成 `/state` 的字段 —— 那是 `/diagnose` 的),
|
|
40
|
+
这条测试挺管用:它保证客户端引用的 `/state` 字段服务端真的回传。
|
|
41
|
+
- UI 体检里「图标按钮缺可读名字」的检测器从「固定 420 字符窗口」改成**花括号配对**:
|
|
42
|
+
长 `onClick` 的按钮之前会被误判成没名字(一次误报 16 个)。顺手给 `ConfirmBtn` 补了 `aria-label`。
|
|
43
|
+
- 合计 **102 例**;UI 体检 11/11。
|
|
44
|
+
|
|
5
45
|
## [0.8.46] - 2026-11-02 —— 双主题预览 + 「自造 token」守门
|
|
6
46
|
|
|
7
47
|
### ① 预览脚本终于能看两套主题
|
package/MAINTENANCE.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## 二、当前状态(2026-11-01)
|
|
11
11
|
|
|
12
|
-
- [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test`
|
|
12
|
+
- [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test` 103/103 通过
|
|
13
13
|
- [x] 自回声抑制(逐条水位)
|
|
14
14
|
- [x] 仅空闲注入(避免草稿回放)
|
|
15
15
|
- [x] 唤醒失败不推进水位
|
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
|
|
|
@@ -99,7 +99,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
99
99
|
## 开发
|
|
100
100
|
|
|
101
101
|
```sh
|
|
102
|
-
node --test #
|
|
102
|
+
node --test # 103 项单测
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
版本与发布流程见 [UPDATING.md](UPDATING.md),交付门见 [CHECKLIST.md](CHECKLIST.md),接手台账见 [MAINTENANCE.md](MAINTENANCE.md)。
|
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.8.
|
|
17
|
+
const CLIENT_VERSION = '0.8.48'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -257,6 +257,23 @@ window.__ModuleLoader__.load({
|
|
|
257
257
|
children)
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
+
/**
|
|
261
|
+
* 第一次打开面板时的空态:官方那种「不是白屏,而是告诉你下一步做什么」。
|
|
262
|
+
* 三步走完就能跑起来 —— 客户不用去翻 README。
|
|
263
|
+
*/
|
|
264
|
+
function Onboarding({ onStart }) {
|
|
265
|
+
return h('div', { className: 'dt-card' },
|
|
266
|
+
h('div', { className: 'dt-card-head' },
|
|
267
|
+
h('span', { className: 'dt-card-title' }, '三步让这个会话开始盯办')),
|
|
268
|
+
h('ol', { className: 'dt-plain-list' },
|
|
269
|
+
h('li', null, '① 填一个仓库(owner/name,比如 MYCF711/dsh-session-superagent)'),
|
|
270
|
+
h('li', null, '② 选间隔(默认 60 秒;建议先设 300 秒,别把 API 打满)'),
|
|
271
|
+
h('li', null, '③ 点「添加到当前会话」——之后仓库有动静,这个会话就会被叫醒')),
|
|
272
|
+
h('div', { className: 'dt-actions' },
|
|
273
|
+
h(Btn, { variant: 'primary', icon: h(Icon, { name: 'plus' }), onClick: onStart }, '去添加第一条')),
|
|
274
|
+
h(Hint, null, '想先看看效果?在「触发」页勾上「仅观察」:它只记录本会唤醒哪几条,不会真打扰你。'))
|
|
275
|
+
}
|
|
276
|
+
|
|
260
277
|
/** 官方 DisclosureRow 的实际用法:默认收起,点开看明细。 */
|
|
261
278
|
function CollapsibleList({ title, items }) {
|
|
262
279
|
const [open, setOpen] = useState(false)
|
|
@@ -392,6 +409,7 @@ window.__ModuleLoader__.load({
|
|
|
392
409
|
size,
|
|
393
410
|
className: armed ? 'dt-danger' : undefined,
|
|
394
411
|
icon,
|
|
412
|
+
'aria-label': armed ? confirmLabel : label,
|
|
395
413
|
onClick: () => {
|
|
396
414
|
if (!armed) { setArmed(true); return }
|
|
397
415
|
setArmed(false)
|
|
@@ -1062,7 +1080,7 @@ window.__ModuleLoader__.load({
|
|
|
1062
1080
|
h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(broken)), h('span', null, '异常'))),
|
|
1063
1081
|
h(Section, { key: 'list', title: needle ? '搜索结果' : '主理鱼', count: visible.length },
|
|
1064
1082
|
watchers.length === 0
|
|
1065
|
-
? h(
|
|
1083
|
+
? h(Onboarding, { onStart: () => setTab('trigger') })
|
|
1066
1084
|
: visible.length === 0
|
|
1067
1085
|
? h(Hint, null, '没有匹配「' + search + '」的主理鱼。')
|
|
1068
1086
|
: h('ul', { className: 'dt-list' }, visible.map(row))),
|
|
@@ -1140,6 +1158,22 @@ window.__ModuleLoader__.load({
|
|
|
1140
1158
|
h('div', { className: 'dt-actions' },
|
|
1141
1159
|
h(Btn, { size: 'sm', variant: 'ghost', onClick: () => checkUpdate(true), disabled: checking }, checking ? '检查中…' : '重新检查')),
|
|
1142
1160
|
h(Hint, null, '升级要改 profile,装完需要重载一次宿主才会用上新版本 —— 所以这里只给命令,不替你执行。')),
|
|
1161
|
+
h(Section, { key: 'diagnose', title: '诊断' },
|
|
1162
|
+
h(Hint, null, '反馈问题时把这段贴给对方:里面有版本、挂载状态和每条值守的最近错误(凭证已脱敏)。'),
|
|
1163
|
+
h('div', { className: 'dt-actions' },
|
|
1164
|
+
h(Btn, {
|
|
1165
|
+
size: 'sm', variant: 'outline',
|
|
1166
|
+
onClick: async () => {
|
|
1167
|
+
try {
|
|
1168
|
+
const payload = await call('/diagnose')
|
|
1169
|
+
const text = String((payload && payload.text) || '')
|
|
1170
|
+
try { await navigator.clipboard.writeText(text) } catch {}
|
|
1171
|
+
notify('诊断信息已复制(' + text.split(String.fromCharCode(10)).length + ' 行)', 'info')
|
|
1172
|
+
} catch (error) {
|
|
1173
|
+
notify('生成诊断失败:' + String((error && error.message) || error), 'error')
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
}, '复制诊断信息'))),
|
|
1143
1177
|
h(Section, { key: 'goal', title: '会话 goal' },
|
|
1144
1178
|
h('textarea', {
|
|
1145
1179
|
className: 'dt-textarea', rows: 3, value: goalDraft,
|
|
@@ -1156,6 +1190,7 @@ window.__ModuleLoader__.load({
|
|
|
1156
1190
|
{ key: 'source', title: '来源' },
|
|
1157
1191
|
{ key: 'creds', title: '凭证' },
|
|
1158
1192
|
{ key: 'update', title: '版本与更新' },
|
|
1193
|
+
{ key: 'diagnose', title: '诊断' },
|
|
1159
1194
|
{ key: 'goal', title: '会话 goal' },
|
|
1160
1195
|
]
|
|
1161
1196
|
const settingsBody = settingsSections.find((node) => node && node.props && node.props.key === settingsSection)
|
package/lib/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
|
|
31
31
|
export const name = 'dsh-session-superagent'
|
|
32
32
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
33
|
-
export const SERVER_VERSION = '0.8.
|
|
33
|
+
export const SERVER_VERSION = '0.8.48'
|
|
34
34
|
export const inject = ['tools', 'agents', 'webServer']
|
|
35
35
|
|
|
36
36
|
/** 仅供测试:读写状态文件(生产代码不要用)。 */
|
|
@@ -906,6 +906,40 @@ export function apply(ctx) {
|
|
|
906
906
|
},
|
|
907
907
|
})
|
|
908
908
|
|
|
909
|
+
// 客户报障用:把「版本 / 挂载状态 / 每条守的最近错误」拼成一段可直接粘贴的文本。
|
|
910
|
+
// 客户在别的电脑上,我们看不到他的状态文件 —— 让他一键复制这段就够了。
|
|
911
|
+
addRoute({
|
|
912
|
+
kind: 'exact',
|
|
913
|
+
path: '/session-superagent/diagnose',
|
|
914
|
+
handler: (req, res) => {
|
|
915
|
+
if (req.method !== 'GET') return json(res, 405, { error: 'method not allowed' })
|
|
916
|
+
const state = readState()
|
|
917
|
+
const mounted = state.server || {}
|
|
918
|
+
const lines = []
|
|
919
|
+
lines.push('主理鱼诊断 · ' + new Date().toISOString())
|
|
920
|
+
lines.push('插件版本: ' + SERVER_VERSION)
|
|
921
|
+
lines.push('宿主: DSH / node ' + String(process.version || ''))
|
|
922
|
+
lines.push('挂载: routes=' + String(mounted.routes ?? '?')
|
|
923
|
+
+ ' failed=' + String((mounted.failed || []).length)
|
|
924
|
+
+ ' base=' + String(mounted.base || '-')
|
|
925
|
+
+ ' at=' + String(mounted.at || '-'))
|
|
926
|
+
if ((mounted.failed || []).length > 0) lines.push('挂载失败: ' + mounted.failed.join('; '))
|
|
927
|
+
const entries = Object.values(state.watchers || {})
|
|
928
|
+
lines.push('值守: ' + entries.length + ' 条')
|
|
929
|
+
for (const entry of entries) {
|
|
930
|
+
lines.push('- ' + entry.repo
|
|
931
|
+
+ ' | ' + (entry.enabled === false ? '已暂停' : '启用')
|
|
932
|
+
+ ' | 间隔 ' + entry.intervalSec + 's'
|
|
933
|
+
+ ' | 会话 ' + String(entry.sessionId || '').slice(0, 20)
|
|
934
|
+
+ ' | 上次轮询 ' + String(entry.lastPoll || '-')
|
|
935
|
+
+ ' | 失败 ' + (entry.consecutiveFailures || 0)
|
|
936
|
+
+ (entry.lastError ? ' | 错误: ' + String(entry.lastError).slice(0, 160) : ''))
|
|
937
|
+
}
|
|
938
|
+
const text = redact(lines.join(String.fromCharCode(10)))
|
|
939
|
+
json(res, 200, { ok: true, text })
|
|
940
|
+
},
|
|
941
|
+
})
|
|
942
|
+
|
|
909
943
|
// 版本检查(只读;面板「设置」页那一行「有新版本」靠它)
|
|
910
944
|
addRoute({
|
|
911
945
|
kind: 'exact',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.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",
|