dsh-session-superagent 0.9.142 → 0.9.143

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,27 @@
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.143] - 2026-11-03 —— 弹层在窄窗口不再溢出(JS 夹 + CSS 兜底)
6
+
7
+ ### 为什么
8
+ 弹层宽度是固定 368px,`left` 会夹在窗口内,但**宽度本身没夹** —— 窗口 < 400px 时右侧整块被切掉。
9
+ 360px 出图确认:卡片右边缘直接跑到画面外。
10
+
11
+ ### 改法(两道)
12
+ 1. **JS**:`width = Math.min(368, max(240, innerWidth - 16))`;
13
+ 2. **CSS 兜底**:`.sa-dock-panel { max-width: calc(100vw - 16px); box-sizing: border-box }`
14
+ —— 即使 JS 算错,也不会溢出。
15
+
16
+ ### 测试
17
+ 新增 1 例:把视口设成 360,断言弹层宽 344(=360-16)、左边距 ≥8、右边不溢出。
18
+ 为此给测试桩加了 `setViewport(width)`(不再让测试去碰沙箱内部)。
19
+
20
+ ### 证据
21
+ ```
22
+ node --test → 255/255
23
+ 出图:360px 容器下的弹层,仓库名省略号截断,卡片完整可见
24
+ ```
25
+
5
26
  ## [0.9.142] - 2026-11-03 —— 窄屏扫一遍:设置页单列布局太挤
6
27
 
7
28
  ### 为什么
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.142-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.143-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
 
@@ -123,7 +123,7 @@ dsh plugin install /path/to/dsh-session-superagent
123
123
  ## 开发
124
124
 
125
125
  ```sh
126
- node --test # 254 项单测
126
+ node --test # 255 项单测
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.142'
17
+ const CLIENT_VERSION = '0.9.143'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -127,7 +127,7 @@ window.__ModuleLoader__.load({
127
127
  const DOCK_CSS = `
128
128
  /* 弹层:卡片 + 一行摘要 + 比例条,全部走 dt-* 与 --dsw-alias-* token(官方弹层的做法) */
129
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; }
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; max-width: calc(100vw - 16px); box-sizing: border-box; }
131
131
  .sa-dock-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 8px; }
132
132
  .sa-dock-title { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--dsw-alias-label-primary); }
133
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; }
@@ -735,7 +735,9 @@ window.__ModuleLoader__.load({
735
735
  if (!open) return button
736
736
 
737
737
  // 空态没什么内容,窄一点更像提示而不是一张空表格
738
- const width = list.length === 0 ? 252 : PANEL_W
738
+ // 弹层宽度是固定的,但窗口可能更窄:按可视宽度夹一下,别溢出屏幕
739
+ const viewport = Number(window && window.innerWidth) || 1200
740
+ const width = Math.min(list.length === 0 ? 252 : PANEL_W, Math.max(240, viewport - 16))
739
741
  const left = anchor
740
742
  ? Math.max(8, Math.min(anchor.x - width / 2, (window.innerWidth || 1200) - width - 8))
741
743
  : 8
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.142'
43
+ export const SERVER_VERSION = '0.9.143'
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.142",
3
+ "version": "0.9.143",
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",