dsh-session-superagent 0.9.133 → 0.9.134
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 +31 -0
- package/README.md +1 -1
- package/client.js +82 -42
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,37 @@
|
|
|
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.134] - 2026-11-03 —— 卫星环弹层重做:从"一坨文字"到官方那种摘要卡
|
|
6
|
+
|
|
7
|
+
### 现场(用户截图)
|
|
8
|
+
点开状态栏卫星环后,弹层是这样一个东西:
|
|
9
|
+
- 每条守最多 **5 行**说明(goal / 会话 / 每 120s · 轮询 · 唤醒 / 时段 · 隔离 · workdir · 304 / 错误);
|
|
10
|
+
- 按钮「立刻 暂停 删除」和正文抢同一行;
|
|
11
|
+
- **弹层没有实心底色**(`.dt-card` 只定义了边框),叠在聊天内容上直接透字 —— 截图里文字互相压着;
|
|
12
|
+
- `.dt-card` 自带 `gap: 12px` 也没有被覆盖,块间被撑得更散。
|
|
13
|
+
|
|
14
|
+
### 学到什么(出处)
|
|
15
|
+
NN/g《Progressive Disclosure》:
|
|
16
|
+
|
|
17
|
+
> Progressive disclosure defers advanced or rarely used features to a secondary screen,
|
|
18
|
+
> making applications easier to learn and less error-prone.
|
|
19
|
+
|
|
20
|
+
<https://www.nngroup.com/articles/progressive-disclosure/>
|
|
21
|
+
|
|
22
|
+
弹层是**摘要屏**,不是详情屏 —— 细节该去「主理鱼」标签页。
|
|
23
|
+
|
|
24
|
+
### 改法(对齐官方 Token 用量 / 上下文弹层的语言)
|
|
25
|
+
1. **实心卡片**:`background: var(--dsw-alias-bg-layer-2)` + `box-shadow: prominent` + 圆角 16,`gap: 0`;
|
|
26
|
+
2. **头部**:标题「主理鱼」+ 右对齐等宽指标 `1 / 2 主理中`;
|
|
27
|
+
3. **比例条**:4px 细条,按 运行中 / 其他 / 异常 比例分段(官方「上下文已用」同款表达);
|
|
28
|
+
4. **每行只有两行字**:`● repo c0a5847a [主理中]` + 副行 `每 120s · 83 秒前 · 时段 09:00-23:00`;
|
|
29
|
+
错误时多一行红色单行(省略号截断);
|
|
30
|
+
5. **动作收进悬停**:`立刻 / 暂停 / 删除` 只在 hover 或 focus 时出现(触屏设备常显),不再抢占信息区;
|
|
31
|
+
6. **其余细节进 title**:goal、过滤、退避、隔离、上次唤醒等放进 `title`,悬停可读,行内不再堆。
|
|
32
|
+
|
|
33
|
+
### 测试
|
|
34
|
+
5 个弹层用例按新信息架构改写(信息没丢:goal / 过滤 / 退避 / 隔离 / 历史都断言在 `title` 里)。合计 **249 例**。
|
|
35
|
+
|
|
5
36
|
## [0.9.133] - 2026-11-03 —— 系统错误码各归其类;没见过的措辞自动留样本
|
|
6
37
|
|
|
7
38
|
### 学到什么(出处)
|
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
|
|
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.134'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -125,11 +125,34 @@ window.__ModuleLoader__.load({
|
|
|
125
125
|
* 以前这里是一整套自成体系的 inline style,和原生界面放一起能看出断层。
|
|
126
126
|
*/
|
|
127
127
|
const DOCK_CSS = `
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.sa-dock-
|
|
131
|
-
.sa-dock-
|
|
132
|
-
.sa-
|
|
128
|
+
/* 弹层:卡片 + 一行摘要 + 比例条,全部走 dt-* 与 --dsw-alias-* token(官方弹层的做法) */
|
|
129
|
+
/* dt-card 只有边框没有底色,弹层叠在聊天内容上会透字 —— 官方弹层是实心 layer-2 */
|
|
130
|
+
.sa-dock-panel { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); border-radius: 16px; font-size: 12px; line-height: 18px; }
|
|
131
|
+
.sa-dock-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 8px; }
|
|
132
|
+
.sa-dock-title { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
133
|
+
.sa-dock-metric { margin-left: auto; display: inline-flex; align-items: baseline; gap: 2px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; }
|
|
134
|
+
.sa-dock-metric b { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--dsw-alias-label-primary); }
|
|
135
|
+
.sa-dock-bar { display: flex; gap: 2px; height: 4px; margin: 0 14px 8px; border-radius: 2px; overflow: hidden; background: var(--dsw-alias-bg-module-platform); }
|
|
136
|
+
.sa-dock-bar > span { display: block; height: 100%; border-radius: 2px; }
|
|
137
|
+
.sa-dock-bar > span[data-tone='ok'] { background: var(--dsw-alias-state-success-primary); }
|
|
138
|
+
.sa-dock-bar > span[data-tone='warn'] { background: var(--dsw-alias-border-l4); }
|
|
139
|
+
.sa-dock-bar > span[data-tone='err'] { background: var(--dsw-alias-state-error-primary); }
|
|
140
|
+
.sa-dock-rows { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 4px; max-height: 264px; overflow: auto; }
|
|
141
|
+
.sa-dock-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 10px; }
|
|
142
|
+
.sa-dock-row:hover, .sa-dock-row:focus-within { background: var(--dsw-alias-interactive-bg-hover); }
|
|
143
|
+
.sa-dock-row > .dt-state-dot { margin-top: 5px; }
|
|
144
|
+
.sa-dock-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
145
|
+
.sa-dock-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
146
|
+
.sa-dock-session { flex: none; font-size: 11px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }
|
|
147
|
+
.sa-dock-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
148
|
+
.sa-dock-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-label-tertiary); }
|
|
149
|
+
.sa-dock-err { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-state-error-primary); }
|
|
150
|
+
.sa-dock-actions { display: flex; flex: none; gap: 2px; opacity: 0; transition: opacity 120ms ease; }
|
|
151
|
+
.sa-dock-row:hover .sa-dock-actions, .sa-dock-row:focus-within .sa-dock-actions { opacity: 1; }
|
|
152
|
+
@media (hover: none) { .sa-dock-actions { opacity: 1; } }
|
|
153
|
+
@media (prefers-reduced-motion: reduce) { .sa-dock-actions { transition: none; } }
|
|
154
|
+
.sa-dock-empty { padding: 4px 14px 12px; color: var(--dsw-alias-label-tertiary); }
|
|
155
|
+
.sa-dock-foot { padding: 8px 14px 10px; border-top: 0.5px solid var(--dsw-alias-border-l3); color: var(--dsw-alias-label-caption); }
|
|
133
156
|
`
|
|
134
157
|
|
|
135
158
|
function ensurePortedCss() {
|
|
@@ -727,40 +750,47 @@ window.__ModuleLoader__.load({
|
|
|
727
750
|
|
|
728
751
|
// 悬浮面板也走移植来的 dt-* 设计系统(以前这里是一套自成体系的 inline style,
|
|
729
752
|
// 和原生界面放在一起能看出断层;ui-audit ⑥ 就是在盯这件事)。
|
|
753
|
+
// 摘要行(官方弹层的写法):主名一行 + 一行 muted 细节,细节超长就省略号。
|
|
754
|
+
// 以前每条守最多 5 行提示挤在一起(goal / 时段 / 隔离 / 错误 / 历史),弹层读不动。
|
|
755
|
+
const shortSub = (w) => {
|
|
756
|
+
const parts = ['每 ' + (Number(w.intervalSec) || 60) + 's']
|
|
757
|
+
if (w.lastPoll) parts.push(ageText(w.lastPoll) + '前')
|
|
758
|
+
if (w.activeHours) parts.push('时段 ' + w.activeHours)
|
|
759
|
+
return parts.join(' · ')
|
|
760
|
+
}
|
|
761
|
+
const detailTitle = (w) => [
|
|
762
|
+
w.title || '未命名会话',
|
|
763
|
+
'会话 ' + sessionTag(w.sessionId),
|
|
764
|
+
filterText(w.filters),
|
|
765
|
+
isolationText(w),
|
|
766
|
+
backoffText(w),
|
|
767
|
+
historyText(w),
|
|
768
|
+
w.lastDeferred,
|
|
769
|
+
w.goal && w.goal.objective ? 'goal · ' + String(w.goal.objective).slice(0, 80) : '',
|
|
770
|
+
w.lastError || '',
|
|
771
|
+
].filter(Boolean).join('\n')
|
|
772
|
+
|
|
730
773
|
const rows = list.map((w) => {
|
|
731
774
|
const state = orbitStateOf(w)
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
w.activeHours ? '时段 ' + w.activeHours : '',
|
|
735
|
-
isolationText(w),
|
|
736
|
-
backoffText(w),
|
|
737
|
-
historyText(w),
|
|
738
|
-
w.lastDeferred,
|
|
739
|
-
].filter(Boolean).join(' · ')
|
|
775
|
+
const dotState = state === 'active' ? 'done' : state === 'paused' ? 'warning' : state === 'error' ? 'error' : 'idle'
|
|
776
|
+
const tone = state === 'active' ? 'success' : state === 'paused' ? 'neutral' : state === 'error' ? 'danger' : 'quiet'
|
|
740
777
|
return h('div', {
|
|
741
778
|
key: String(w.repo || '') + '#' + String(w.sessionId || ''),
|
|
742
|
-
className: '
|
|
779
|
+
className: 'sa-dock-row',
|
|
780
|
+
title: detailTitle(w),
|
|
743
781
|
},
|
|
744
|
-
h('
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
h('span', { className: '
|
|
750
|
-
|
|
751
|
-
h('div', { className: '
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
w.lastError ? (() => {
|
|
757
|
-
// 之前整串 slice(0,160):错误一长就先切掉后面的建议 —— 恰好是最有用的部分
|
|
758
|
-
const parts = splitErrorText(w.lastError)
|
|
759
|
-
return h('div', { className: 'dt-error' },
|
|
760
|
-
parts.main.slice(0, 120) + (parts.main.length > 120 ? '…' : ''),
|
|
761
|
-
parts.hint ? h('div', { className: 'dt-hint' }, parts.hint) : null)
|
|
762
|
-
})() : null),
|
|
763
|
-
h('div', { className: 'dt-row-actions' },
|
|
782
|
+
h('span', { className: 'dt-state-dot', 'data-state': dotState }),
|
|
783
|
+
h('div', { className: 'sa-dock-body' },
|
|
784
|
+
h('div', { className: 'sa-dock-line' },
|
|
785
|
+
h('span', { className: 'sa-dock-name' }, String(w.repo || '?')),
|
|
786
|
+
// 同一个仓库可能有多条守(不同会话),会话后缀必须露出来才分得清
|
|
787
|
+
h('span', { className: 'sa-dock-session sa-mono' }, sessionTag(w.sessionId)),
|
|
788
|
+
h('span', { className: 'dt-tag', 'data-tone': tone }, STATE_TEXT[state])),
|
|
789
|
+
h('div', { className: 'sa-dock-sub' }, shortSub(w)),
|
|
790
|
+
w.lastError
|
|
791
|
+
? h('div', { className: 'sa-dock-err' }, splitErrorText(w.lastError).main)
|
|
792
|
+
: null),
|
|
793
|
+
h('div', { className: 'sa-dock-actions' },
|
|
764
794
|
h(Btn, { size: 'sm', variant: 'ghost', onClick: () => act(w, 'poll') }, '立刻'),
|
|
765
795
|
h(Btn, { size: 'sm', variant: 'ghost', onClick: () => act(w, w.enabled ? 'pause' : 'resume') },
|
|
766
796
|
w.enabled ? '暂停' : '恢复'),
|
|
@@ -770,20 +800,30 @@ window.__ModuleLoader__.load({
|
|
|
770
800
|
})))
|
|
771
801
|
})
|
|
772
802
|
|
|
803
|
+
// 比例条:和官方的「上下文已用」同一种表达(一眼看出多少在跑)
|
|
804
|
+
const bar = list.length === 0 ? null : h('div', { className: 'sa-dock-bar', 'aria-hidden': 'true' },
|
|
805
|
+
h('span', { 'data-tone': 'ok', style: { flexGrow: Math.max(running, 0.001) } }),
|
|
806
|
+
h('span', { 'data-tone': 'warn', style: { flexGrow: Math.max(list.length - running - broken, 0.001) } }),
|
|
807
|
+
h('span', { 'data-tone': 'err', style: { flexGrow: Math.max(broken, 0.001) } }))
|
|
808
|
+
|
|
773
809
|
const panel = h('div', {
|
|
774
810
|
ref: panelRef, role: 'dialog', 'aria-label': summary, className: 'dt-card sa-dock-panel',
|
|
775
|
-
style: { position: 'fixed', left, bottom, width, zIndex: 2147483000
|
|
811
|
+
style: { position: 'fixed', left, bottom, width, zIndex: 2147483000 },
|
|
776
812
|
},
|
|
777
|
-
h('div', { className: '
|
|
778
|
-
h('span', { className: '
|
|
779
|
-
h('span', { className: '
|
|
813
|
+
h('div', { className: 'sa-dock-head' },
|
|
814
|
+
h('span', { className: 'sa-dock-title' }, '主理鱼'),
|
|
815
|
+
h('span', { className: 'sa-dock-metric' },
|
|
816
|
+
h('b', null, String(running)),
|
|
817
|
+
h('span', null, ' / ' + list.length + ' 主理中'))),
|
|
818
|
+
bar,
|
|
780
819
|
list.length === 0
|
|
781
|
-
? h('div', { className: '
|
|
782
|
-
: h('div', { className: '
|
|
820
|
+
? h('div', { className: 'sa-dock-empty' }, '还没有。在「主理鱼」标签页填 owner/name 加一条。')
|
|
821
|
+
: h('div', { className: 'sa-dock-rows' }, rows),
|
|
783
822
|
list.length > 0
|
|
784
|
-
? h('div', { className: 'sa-dock-foot' }, '
|
|
823
|
+
? h('div', { className: 'sa-dock-foot' }, '详细状态与凭证在「主理鱼」标签页')
|
|
785
824
|
: null)
|
|
786
825
|
|
|
826
|
+
|
|
787
827
|
return h(React.Fragment, null, button, panel)
|
|
788
828
|
}
|
|
789
829
|
|
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.134'
|
|
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.134",
|
|
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",
|