dsh-session-superagent 0.9.158 → 0.9.160
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 +56 -0
- package/README.md +2 -2
- package/client.js +37 -12
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,62 @@
|
|
|
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.160] - 2026-11-03 —— 样式表在 apply() 里注入一次,从结构上消灭"某个入口没样式"
|
|
6
|
+
|
|
7
|
+
### 为什么
|
|
8
|
+
0.9.159 发现圆环弹层没样式,根因是 `ensurePortedCss()` 只挂在面板组件里。
|
|
9
|
+
当时补的那次调用是**第二个注入点** —— 但下次再加一个槽位(比如状态栏右侧的角标),
|
|
10
|
+
同样的坑会再来一次。
|
|
11
|
+
|
|
12
|
+
### 改法
|
|
13
|
+
把注入提到模块入口,一次搞定所有槽位:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
apply(ctx) {
|
|
17
|
+
…
|
|
18
|
+
// 任何槽位(面板 / 圆环 / 将来的入口)都用得上
|
|
19
|
+
try { ensurePortedCss() } catch {}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
组件里的两次调用保留(幂等),作为"宿主早期渲染顺序异常"时的兜底。
|
|
23
|
+
|
|
24
|
+
### 测试
|
|
25
|
+
在 0.9.159 那条静态断言里再加一条:**`apply()` 源码里也必须出现 `ensurePortedCss`**。
|
|
26
|
+
现在两道:入口一次 + StatusOrbit 一次,缺哪个都会红。
|
|
27
|
+
|
|
28
|
+
## [0.9.159] - 2026-11-03 —— 真机:圆环弹层变成无样式裸文字(样式表没注入)
|
|
29
|
+
|
|
30
|
+
### 现场(用户截图)
|
|
31
|
+
重启后点状态栏圆环,弹层是一堆**裸文字叠在一起**:没有卡片底色、没有圆角、没有分隔线,
|
|
32
|
+
标题和副行压在同一个坐标上(`.sa-dock-*` 这些规则一条都没生效)。
|
|
33
|
+
|
|
34
|
+
### 根因
|
|
35
|
+
`PORTED_CSS + DOCK_CSS` 挂在同一张 `<style id="dsh-zhuli-ported-css">` 里,
|
|
36
|
+
而 `ensurePortedCss()` 只在**「主理鱼」面板组件挂载时**调用:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
// 面板里
|
|
40
|
+
useEffect(() => { ensurePortedCss() }, [])
|
|
41
|
+
// StatusOrbit 里 —— 没有
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
客户只要**没打开过面板**、直接点圆环,弹层就没有任何样式。以前圆环弹层用内联 style
|
|
45
|
+
所以看不出来,这一版改成 class 之后立刻暴露。
|
|
46
|
+
|
|
47
|
+
### 改法
|
|
48
|
+
`StatusOrbit` 挂载时也调一次(幂等,`document.getElementById` 已去重)。
|
|
49
|
+
|
|
50
|
+
### 测试
|
|
51
|
+
新增 1 例:`StatusOrbit` 的挂载副作用里必须出现 `ensurePortedCss` —— 纯静态断言,
|
|
52
|
+
因为预览脚本会自己塞 CSS,这一点只能在真机暴露。
|
|
53
|
+
|
|
54
|
+
### 顺带(上一轮的筛选汇总行收尾)
|
|
55
|
+
- 筛选叠加时一行说清「已应用 N 个筛选」,每个标签可单独清除,多筛选时多一个「全部清除」;
|
|
56
|
+
- 单筛选时保持原措辞「只看 X 的守(N 条)」;
|
|
57
|
+
- 用例改为**空白归一化**后断言(横跨多个文本节点时 `只看` 与 `异常` 会分成两段)。
|
|
58
|
+
|
|
59
|
+
合计 **264 例**。
|
|
60
|
+
|
|
5
61
|
## [0.9.158] - 2026-11-03 —— 筛选要有可见提示:加「只看『异常』的守(1 条)· 清除」
|
|
6
62
|
|
|
7
63
|
### 为什么
|
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
|
|
|
@@ -123,7 +123,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
123
123
|
## 开发
|
|
124
124
|
|
|
125
125
|
```sh
|
|
126
|
-
node --test #
|
|
126
|
+
node --test # 264 项单测
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### 工具输出:文本给人和 agent,JSON 给程序
|
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.160'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -677,6 +677,10 @@ window.__ModuleLoader__.load({
|
|
|
677
677
|
const btnRef = useRef(null)
|
|
678
678
|
const panelRef = useRef(null)
|
|
679
679
|
|
|
680
|
+
// 弹层的样式(DOCK_CSS)挂在 PORTED_CSS 同一张 <style> 里,而那张表以前只有「主理鱼」面板挂载时才注入。
|
|
681
|
+
// 用户从没打开过面板就直接点状态栏圆环时,弹层就是一堆无样式的裸文字(真机复现过)。
|
|
682
|
+
useEffect(() => { ensurePortedCss() }, [])
|
|
683
|
+
|
|
680
684
|
useEffect(() => {
|
|
681
685
|
let alive = true
|
|
682
686
|
noteOnce('orbit-mount', 'ok')
|
|
@@ -1349,7 +1353,36 @@ window.__ModuleLoader__.load({
|
|
|
1349
1353
|
&& (!problemsOnly || hasProblem(watcher))
|
|
1350
1354
|
&& (!deferFilter || watcher.deferReason === deferFilter))
|
|
1351
1355
|
|
|
1356
|
+
const filterSummary = (() => {
|
|
1357
|
+
// 筛选汇总:叠加时用一行说清「应用了哪几个」,而不是每条各占一行。
|
|
1358
|
+
// 只有一个筛选时仍然是一句「只看 X 的守(N 条):清除」。
|
|
1359
|
+
const chips = []
|
|
1360
|
+
if (badgeFilter) chips.push({ label: badgeFilter, clear: () => setBadgeFilter(null) })
|
|
1361
|
+
if (stateFilter) chips.push({ label: STATE_TEXT[stateFilter], clear: () => setStateFilter(null) })
|
|
1362
|
+
if (needle) chips.push({ label: '搜索「' + needle + '」', clear: () => setSearch('') })
|
|
1363
|
+
if (problemsOnly) chips.push({ label: '有问题', clear: () => setProblemsOnly(false) })
|
|
1364
|
+
if (deferFilter) chips.push({ label: '暂停原因「' + (DEFER_LABELS[deferFilter] || deferFilter) + '」', clear: () => setDeferFilter(null) })
|
|
1365
|
+
if (chips.length === 0) return null
|
|
1366
|
+
return h('div', { className: 'dt-row-meta', key: 'filter-summary' },
|
|
1367
|
+
(() => {
|
|
1368
|
+
// 拼成一个文本节点:拆成多段会让文案断言断在标签边界上
|
|
1369
|
+
const head = chips.length > 1
|
|
1370
|
+
? '已应用 ' + chips.length + ' 个筛选'
|
|
1371
|
+
: '只看 ' + chips.map((c) => c.label).join('、')
|
|
1372
|
+
return h('span', null, head + ' 的守(' + visible.length + ' 条):')
|
|
1373
|
+
})(),
|
|
1374
|
+
...chips.map((chip) => h(Pill, { key: chip.label, onClick: chip.clear }, chip.label + ' ✕')),
|
|
1375
|
+
chips.length > 1
|
|
1376
|
+
? h(Pill, {
|
|
1377
|
+
key: '__all', onClick: () => {
|
|
1378
|
+
setBadgeFilter(null); setStateFilter(null); setSearch(''); setProblemsOnly(false); setDeferFilter(null)
|
|
1379
|
+
},
|
|
1380
|
+
}, '全部清除')
|
|
1381
|
+
: null)
|
|
1382
|
+
})()
|
|
1383
|
+
|
|
1352
1384
|
const overview = [
|
|
1385
|
+
filterSummary,
|
|
1353
1386
|
h('div', { className: 'dt-stats', key: 'stats' },
|
|
1354
1387
|
h(Stat, {
|
|
1355
1388
|
key: 'all', value: watchers.length, unit: '条主理鱼',
|
|
@@ -1398,17 +1431,6 @@ window.__ModuleLoader__.load({
|
|
|
1398
1431
|
'代码已更新到 ' + body.installedVersion + ',但宿主还在跑 ' + body.runningVersion
|
|
1399
1432
|
+ ' —— 服务端改动需要重启宿主才生效(客户端部分已生效,所以界面可能看起来是新的)。')
|
|
1400
1433
|
: null,
|
|
1401
|
-
badgeFilter
|
|
1402
|
-
? h('div', { className: 'dt-row-meta', key: 'badge-filter' },
|
|
1403
|
-
h('span', null, '只看 ' + badgeFilter + ' 的守(' + visible.length + ' 条):'),
|
|
1404
|
-
h(Pill, { onClick: () => setBadgeFilter(null) }, '清除'))
|
|
1405
|
-
: null,
|
|
1406
|
-
// 状态筛选(点统计数字触发):光靠按钮按下态暗示太弱,这里给一条能一键清掉的提示
|
|
1407
|
-
stateFilter
|
|
1408
|
-
? h('div', { className: 'dt-row-meta', key: 'state-filter' },
|
|
1409
|
-
h('span', null, '只看「' + STATE_TEXT[stateFilter] + '」的守(' + visible.length + ' 条):'),
|
|
1410
|
-
h(Pill, { onClick: () => setStateFilter(null) }, '清除'))
|
|
1411
|
-
: null,
|
|
1412
1434
|
h(Section, { key: 'list', title: needle ? '搜索结果' : '主理鱼', count: visible.length },
|
|
1413
1435
|
watchers.length === 0
|
|
1414
1436
|
? h(Onboarding, { onStart: () => setTab('trigger') })
|
|
@@ -1993,6 +2015,9 @@ window.__ModuleLoader__.load({
|
|
|
1993
2015
|
apply(ctx) {
|
|
1994
2016
|
try { noteOnce('client-version', CLIENT_VERSION) } catch {}
|
|
1995
2017
|
try { note('apply', 'start') } catch {}
|
|
2018
|
+
// 样式表在这里注入一次就够了:任何槽位(面板 / 圆环 / 将来的入口)都用得上。
|
|
2019
|
+
// 之前只在面板组件挂载时注入,没打开过面板就直接点圆环 → 弹层没有样式(0.9.159 才补上那次调用)。
|
|
2020
|
+
try { ensurePortedCss() } catch {}
|
|
1996
2021
|
|
|
1997
2022
|
// ① the 主理鱼 tab in the centre-column view ring
|
|
1998
2023
|
ctx.effect(() => {
|
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.160'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.160",
|
|
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",
|