dsh-client-auto-continue 0.3.1 → 0.3.2

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.
Files changed (3) hide show
  1. package/README.md +26 -4
  2. package/README.zh.md +26 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -36,10 +36,10 @@ For [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh we
36
36
 
37
37
  **Smart recovery** (all configurable):
38
38
 
39
- - **Error classification** — transient failures (network / timeout / 5xx…) are auto-resumed; permanent ones (auth, balance, unknown model, context overflow) are **skipped** and notified, because retrying them never helps
40
- - **Adaptive backoff** — consecutive failures wait longer each time (e.g. 20s → 40s → 80s), instead of hammering a broken upstream
39
+ - **Error classification** — transient failures (network / timeout / 5xx / 429…) are auto-resumed; permanent ones are **skipped** and notified, because retrying them never helps. A failure counts as permanent when its HTTP status is 401/403 or its code/message matches auth, credential/API-key, balance/quota, unknown-model, or context-length/overflow keywords. Turn classification off to resume everything
40
+ - **Adaptive backoff** — consecutive failures wait longer each time (cooldown × factor: 20s → 40s → 80s), capped at the max backoff, instead of hammering a broken upstream
41
41
  - **Templated continue text** — `continueText` supports `{code}` `{message}` `{status}` `{tool}` `{turn}` placeholders, so the resume message can carry the failure context ("继续 (git push failed: UPSTREAM)")
42
- - **Browser notifications** — optional alerts when auto-continue fires, gives up, or hits a permanent error
42
+ - **Browser notifications** — optional alerts when auto-continue fires, gives up, or hits a permanent error; the browser asks for permission on first use, and nothing is shown again after a denial
43
43
 
44
44
  It watches the live event streams and reacts to:
45
45
 
@@ -60,6 +60,8 @@ The plugin opens two extra SSE streams in the browser — `events.mux` (session
60
60
 
61
61
  On page load / reconnect it also scans the most recently updated sessions: a session whose last turn ended with a non-human reason **within the scan window** (default 15 minutes), with no later `turn/start` or user message, gets resumed automatically too (e.g. the host crashed while the browser was closed).
62
62
 
63
+ With the page open in several tabs, a localStorage mutex plus a shared per-session cooldown stamp guarantee exactly one tab sends — no duplicated 「继续」.
64
+
63
65
  All knobs live in the plugin's settings card — see [Configuration](#configuration).
64
66
 
65
67
  ---
@@ -142,7 +144,16 @@ dsh web
142
144
 
143
145
  ## Configuration
144
146
 
145
- Everything is configurable from the GUI — no file or console edits needed. Open **Settings → Plugin configuration** and find the **Auto continue** card. Changes are staged and written on **Save**, apply immediately, and persist in `~/.dsh/settings.yaml`.
147
+ Everything is configurable from the GUI — no file or console edits needed. Open **Settings → Plugin configuration** and find the **Auto continue** card.
148
+
149
+ **How the card works:**
150
+
151
+ - Edits are **staged** — nothing reaches the disk until you hit **Save**; an unsaved badge marks the card while drafts are pending, and **Discard** drops them
152
+ - A field you changed shows an **Overridden** badge with a per-field **Reset to default** button that restores the built-in value
153
+ - Boolean fields are **tri-state**: *Inherit* (use the default) / *On* / *Off*
154
+ - Invalid drafts (non-numbers, values below the minimum) block the save with a hint
155
+ - In a read-only deployment the card shows the stored values but disables every control
156
+ - Changes apply immediately after Save and persist in `~/.dsh/settings.yaml` (uninstalling the plugin leaves the section behind — harmless, delete it by hand if you like)
146
157
 
147
158
  | Field | Default | Description |
148
159
  | --- | --- | --- |
@@ -165,6 +176,17 @@ Everything is configurable from the GUI — no file or console edits needed. Ope
165
176
 
166
177
  ---
167
178
 
179
+ ## Privacy & permissions
180
+
181
+ The plugin is browser-only and touches **no files, credentials, or network beyond the dsh host**:
182
+
183
+ - It opens the same two read-only event streams the web UI already uses (no extra server, no third-party endpoints)
184
+ - The only write it ever performs is `sessions.prompt` — the same call the Send button makes — with the text you configured
185
+ - Browser storage is limited to small `localStorage` keys for cross-tab coordination
186
+ - Browser notifications are opt-in (`notify` setting) and permission is requested on first use only
187
+
188
+ ---
189
+
168
190
  ## Development
169
191
 
170
192
  ```bash
package/README.zh.md CHANGED
@@ -36,10 +36,10 @@
36
36
 
37
37
  **智能恢复**(全部可配置):
38
38
 
39
- - **错误分类** — 临时性错误(网络 / 超时 / 5xx 等)自动续跑; 永久性错误(认证、余额不足、模型不存在、上下文超限)跳过并通知, 因为重试也没用
40
- - **自适应退避** — 连续失败时等待时间递增( 20s → 40s → 80s), 不再对故障上游狂轰滥炸
39
+ - **错误分类** — 临时性错误(网络 / 超时 / 5xx / 429 等)自动续跑; 永久性错误跳过并通知, 因为重试也没用。判定为永久性的条件: HTTP 状态码 401/403, 或 code/message 命中认证、凭据/API Key、余额/配额、模型不存在、上下文长度/超限等关键词。关闭分类后则全部自动继续
40
+ - **自适应退避** — 连续失败时等待时间递增(冷却 × 系数: 20s → 40s → 80s), 有上限, 不再对故障上游狂轰滥炸
41
41
  - **模板化继续文本** — `continueText` 支持 `{code}` `{message}` `{status}` `{tool}` `{turn}` 占位符, 续跑消息可携带失败上下文(如「继续 (git push 失败: UPSTREAM)」)
42
- - **浏览器通知** — 可选: 自动继续成功 / 放弃 / 遇到永久性错误时弹出提醒
42
+ - **浏览器通知** — 可选: 自动继续成功 / 放弃 / 遇到永久性错误时弹出提醒; 首次使用时请求权限, 被拒绝后不再打扰
43
43
 
44
44
  插件监听实时事件流, 对以下情况作出反应:
45
45
 
@@ -60,6 +60,8 @@
60
60
 
61
61
  页面启动 / 重连时, 插件还会扫描最近更新的会话: 若某个会话的最后一个回合在**扫描时间窗**(默认 15 分钟)内以非人为原因结束, 且之后没有新的 `turn/start` 或用户消息, 也会被自动续跑(例如浏览器关闭期间宿主崩溃的情况)。
62
62
 
63
+ 多个标签页同时打开时, 通过 localStorage 互斥锁 + 共享的每会话冷却记录保证**只有一个标签页发送**——不会重复出现两条「继续」。
64
+
63
65
  所有参数都在插件的设置卡片中调整——见 [配置](#配置)。
64
66
 
65
67
  ---
@@ -139,7 +141,16 @@ dsh web
139
141
 
140
142
  ## 配置
141
143
 
142
- 所有参数都可以在 GUI 里配置——无需改文件或控制台。打开 **设置 → 插件配置**, 找到 **自动继续** 卡片。修改后点 **保存** 生效, 立即应用, 并持久化到 `~/.dsh/settings.yaml`。
144
+ 所有参数都可以在 GUI 里配置——无需改文件或控制台。打开 **设置 → 插件配置**, 找到 **自动继续** 卡片。
145
+
146
+ **卡片操作说明:**
147
+
148
+ - 修改是**暂存式**的——点「保存」之前不会写入磁盘; 有待保存草稿时卡片显示「未保存」徽章, 「放弃」可丢弃草稿
149
+ - 改动过的字段会带「已覆盖」徽章, 并有逐字段的「恢复默认」按钮(回到内置默认值)
150
+ - 布尔字段是三态:**继承**(用默认)/ 开 / 关
151
+ - 非法输入(非数字、小于最小值)会阻止保存并给出提示
152
+ - 只读部署中卡片只显示已存值, 所有控件禁用
153
+ - 保存后立即生效, 持久化在 `~/.dsh/settings.yaml`(卸载插件会留下该段落, 无害, 想清理可手动删除)
143
154
 
144
155
  | 字段 | 默认 | 说明 |
145
156
  | --- | --- | --- |
@@ -162,6 +173,17 @@ dsh web
162
173
 
163
174
  ---
164
175
 
176
+ ## 隐私与权限
177
+
178
+ 插件是纯浏览器端, **不触碰任何文件、凭据, 也不访问 dsh 宿主以外的网络**:
179
+
180
+ - 只复用 webui 本身就在用的两条只读事件流(无额外服务、无第三方端点)
181
+ - 唯一会执行的写入是 `sessions.prompt`——与点「发送」按钮完全相同的调用, 内容为你配置的文本
182
+ - 浏览器存储仅限于少量 `localStorage` 键(跨标签页协调用)
183
+ - 浏览器通知是可选开启的(`notify` 设置), 仅在首次使用时请求一次权限
184
+
185
+ ---
186
+
165
187
  ## 开发
166
188
 
167
189
  ```bash
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-client-auto-continue",
3
3
  "description": "DSH Web UI plugin: automatically sends \"继续\" (continue) when a request is interrupted by network errors or other non-human causes",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",