dsh-client-auto-continue 0.3.0 → 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.
- package/README.md +27 -5
- package/README.zh.md +27 -5
- package/docs/banner-dark.svg +25 -0
- package/docs/banner-zh-dark.svg +25 -0
- package/docs/banner-zh.svg +25 -0
- package/docs/banner.svg +25 -0
- package/docs/demo-zh.svg +50 -0
- package/docs/demo.svg +50 -0
- package/docs/social-preview.png +0 -0
- package/docs/social-preview.svg +43 -0
- package/package.json +2 -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
|
|
40
|
-
- **Adaptive backoff** — consecutive failures wait longer each time (
|
|
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.
|
|
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,13 +176,24 @@ 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
|
|
171
193
|
npm run typecheck # tsc --noEmit
|
|
172
194
|
npm run build # lib/client.js + lib/index.js + lib/types
|
|
173
195
|
npm run watch # rebuild on change; host HMR hot-reloads without a page refresh
|
|
174
|
-
npm run test # node tests/simulate.mjs —
|
|
196
|
+
npm run test # node tests/simulate.mjs — 12 behavioral scenarios
|
|
175
197
|
```
|
|
176
198
|
|
|
177
199
|
While `npm run watch` runs, the profile's client-hmr row polls `lib/client.js` every 500 ms and hot-reloads the plugin in the browser — no server restart needed for code changes.
|
package/README.zh.md
CHANGED
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
|
|
37
37
|
**智能恢复**(全部可配置):
|
|
38
38
|
|
|
39
|
-
- **错误分类** — 临时性错误(网络 / 超时 / 5xx 等)自动续跑;
|
|
40
|
-
- **自适应退避** — 连续失败时等待时间递增(
|
|
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 里配置——无需改文件或控制台。打开 **设置 → 插件配置**, 找到 **自动继续**
|
|
144
|
+
所有参数都可以在 GUI 里配置——无需改文件或控制台。打开 **设置 → 插件配置**, 找到 **自动继续** 卡片。
|
|
145
|
+
|
|
146
|
+
**卡片操作说明:**
|
|
147
|
+
|
|
148
|
+
- 修改是**暂存式**的——点「保存」之前不会写入磁盘; 有待保存草稿时卡片显示「未保存」徽章, 「放弃」可丢弃草稿
|
|
149
|
+
- 改动过的字段会带「已覆盖」徽章, 并有逐字段的「恢复默认」按钮(回到内置默认值)
|
|
150
|
+
- 布尔字段是三态:**继承**(用默认)/ 开 / 关
|
|
151
|
+
- 非法输入(非数字、小于最小值)会阻止保存并给出提示
|
|
152
|
+
- 只读部署中卡片只显示已存值, 所有控件禁用
|
|
153
|
+
- 保存后立即生效, 持久化在 `~/.dsh/settings.yaml`(卸载插件会留下该段落, 无害, 想清理可手动删除)
|
|
143
154
|
|
|
144
155
|
| 字段 | 默认 | 说明 |
|
|
145
156
|
| --- | --- | --- |
|
|
@@ -162,13 +173,24 @@ 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
|
|
168
190
|
npm run typecheck # tsc --noEmit
|
|
169
191
|
npm run build # lib/client.js + lib/index.js + lib/types
|
|
170
192
|
npm run watch # 监听变更自动重建; 宿主 HMR 免刷新热重载
|
|
171
|
-
npm run test # node tests/simulate.mjs —
|
|
193
|
+
npm run test # node tests/simulate.mjs — 12 个行为场景
|
|
172
194
|
```
|
|
173
195
|
|
|
174
196
|
`npm run watch` 运行时, profile 的 client-hmr 行每 500ms 轮询 `lib/client.js` 并在浏览器中热重载插件——改代码无需重启服务。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="260" viewBox="0 0 1200 260" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#0b1220"/>
|
|
5
|
+
<stop offset="60%" stop-color="#0c2336"/>
|
|
6
|
+
<stop offset="100%" stop-color="#111a33"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="bar" x1="0" y1="0" x2="1" y2="0">
|
|
9
|
+
<stop offset="0%" stop-color="#38bdf8"/>
|
|
10
|
+
<stop offset="100%" stop-color="#818cf8"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="1200" height="260" fill="url(#bg)"/>
|
|
14
|
+
<!-- accent bar -->
|
|
15
|
+
<rect x="0" y="252" width="1200" height="8" fill="url(#bar)"/>
|
|
16
|
+
<!-- Continue chip -->
|
|
17
|
+
<rect x="76" y="70" width="148" height="116" rx="26" fill="#f8fafc"/>
|
|
18
|
+
<text x="150" y="136" font-size="34" font-weight="700" fill="#0f172a" text-anchor="middle">Continue</text>
|
|
19
|
+
<!-- title -->
|
|
20
|
+
<text x="268" y="122" font-size="54" font-weight="800" fill="#f8fafc">dsh-auto-continue</text>
|
|
21
|
+
<!-- subtitle -->
|
|
22
|
+
<text x="270" y="164" font-size="26" fill="#94a3b8">DSH Web UI plugin — auto-continue interrupted requests</text>
|
|
23
|
+
<!-- caption -->
|
|
24
|
+
<text x="270" y="202" font-size="21" fill="#7dd3fc" font-family="ui-monospace, SFMono-Regular, Menlo, monospace">turn/end · error | interrupted | max-tokens → prompt("Continue")</text>
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="260" viewBox="0 0 1200 260" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#0b1220"/>
|
|
5
|
+
<stop offset="60%" stop-color="#0c2336"/>
|
|
6
|
+
<stop offset="100%" stop-color="#111a33"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="bar" x1="0" y1="0" x2="1" y2="0">
|
|
9
|
+
<stop offset="0%" stop-color="#38bdf8"/>
|
|
10
|
+
<stop offset="100%" stop-color="#818cf8"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="1200" height="260" fill="url(#bg)"/>
|
|
14
|
+
<!-- accent bar -->
|
|
15
|
+
<rect x="0" y="252" width="1200" height="8" fill="url(#bar)"/>
|
|
16
|
+
<!-- 继续 chip -->
|
|
17
|
+
<rect x="76" y="70" width="116" height="116" rx="26" fill="#f8fafc"/>
|
|
18
|
+
<text x="134" y="150" font-size="58" font-weight="700" fill="#0f172a" text-anchor="middle">继续</text>
|
|
19
|
+
<!-- title -->
|
|
20
|
+
<text x="236" y="122" font-size="54" font-weight="800" fill="#f8fafc">dsh-auto-continue</text>
|
|
21
|
+
<!-- subtitle -->
|
|
22
|
+
<text x="238" y="164" font-size="26" fill="#94a3b8">DSH Web UI plugin — auto-continue interrupted requests</text>
|
|
23
|
+
<!-- caption -->
|
|
24
|
+
<text x="238" y="202" font-size="21" fill="#7dd3fc" font-family="ui-monospace, SFMono-Regular, Menlo, monospace">turn/end · error | interrupted | max-tokens → prompt("继续")</text>
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="260" viewBox="0 0 1200 260" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#f8fafc"/>
|
|
5
|
+
<stop offset="60%" stop-color="#e0f2fe"/>
|
|
6
|
+
<stop offset="100%" stop-color="#e0e7ff"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="bar" x1="0" y1="0" x2="1" y2="0">
|
|
9
|
+
<stop offset="0%" stop-color="#0ea5e9"/>
|
|
10
|
+
<stop offset="100%" stop-color="#6366f1"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="1200" height="260" fill="url(#bg)"/>
|
|
14
|
+
<!-- accent bar -->
|
|
15
|
+
<rect x="0" y="252" width="1200" height="8" fill="url(#bar)"/>
|
|
16
|
+
<!-- 继续 chip -->
|
|
17
|
+
<rect x="76" y="70" width="116" height="116" rx="26" fill="#0f172a"/>
|
|
18
|
+
<text x="134" y="150" font-size="58" font-weight="700" fill="#e2e8f0" text-anchor="middle">继续</text>
|
|
19
|
+
<!-- title -->
|
|
20
|
+
<text x="236" y="122" font-size="54" font-weight="800" fill="#0f172a">dsh-auto-continue</text>
|
|
21
|
+
<!-- subtitle -->
|
|
22
|
+
<text x="238" y="164" font-size="26" fill="#475569">DSH Web UI plugin — auto-continue interrupted requests</text>
|
|
23
|
+
<!-- caption -->
|
|
24
|
+
<text x="238" y="202" font-size="21" fill="#64748b" font-family="ui-monospace, SFMono-Regular, Menlo, monospace">turn/end · error | interrupted | max-tokens → prompt("继续")</text>
|
|
25
|
+
</svg>
|
package/docs/banner.svg
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="260" viewBox="0 0 1200 260" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#f8fafc"/>
|
|
5
|
+
<stop offset="60%" stop-color="#e0f2fe"/>
|
|
6
|
+
<stop offset="100%" stop-color="#e0e7ff"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="bar" x1="0" y1="0" x2="1" y2="0">
|
|
9
|
+
<stop offset="0%" stop-color="#0ea5e9"/>
|
|
10
|
+
<stop offset="100%" stop-color="#6366f1"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="1200" height="260" fill="url(#bg)"/>
|
|
14
|
+
<!-- accent bar -->
|
|
15
|
+
<rect x="0" y="252" width="1200" height="8" fill="url(#bar)"/>
|
|
16
|
+
<!-- Continue chip -->
|
|
17
|
+
<rect x="76" y="70" width="148" height="116" rx="26" fill="#0f172a"/>
|
|
18
|
+
<text x="150" y="136" font-size="34" font-weight="700" fill="#e2e8f0" text-anchor="middle">Continue</text>
|
|
19
|
+
<!-- title -->
|
|
20
|
+
<text x="268" y="122" font-size="54" font-weight="800" fill="#0f172a">dsh-auto-continue</text>
|
|
21
|
+
<!-- subtitle -->
|
|
22
|
+
<text x="270" y="164" font-size="26" fill="#475569">DSH Web UI plugin — auto-continue interrupted requests</text>
|
|
23
|
+
<!-- caption -->
|
|
24
|
+
<text x="270" y="202" font-size="21" fill="#64748b" font-family="ui-monospace, SFMono-Regular, Menlo, monospace">turn/end · error | interrupted | max-tokens → prompt("Continue")</text>
|
|
25
|
+
</svg>
|
package/docs/demo-zh.svg
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="420" viewBox="0 0 720 420" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#0b1220"/>
|
|
5
|
+
<stop offset="100%" stop-color="#0e1a2e"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="accent" x1="0" y1="0" x2="1" y2="0">
|
|
8
|
+
<stop offset="0%" stop-color="#38bdf8"/>
|
|
9
|
+
<stop offset="100%" stop-color="#818cf8"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
<rect width="720" height="420" rx="20" fill="url(#bg)"/>
|
|
13
|
+
<!-- header -->
|
|
14
|
+
<rect x="0" y="0" width="720" height="46" rx="20" fill="#111c30"/>
|
|
15
|
+
<rect x="0" y="30" width="720" height="16" fill="#111c30"/>
|
|
16
|
+
<circle cx="22" cy="23" r="5" fill="#f87171"/><circle cx="38" cy="23" r="5" fill="#fbbf24"/><circle cx="54" cy="23" r="5" fill="#34d399"/>
|
|
17
|
+
<text x="600" y="28" font-size="13" fill="#64748b" text-anchor="end">dsh web — 会话</text>
|
|
18
|
+
<rect x="0" y="46" width="720" height="3" fill="url(#accent)" opacity="0.7"/>
|
|
19
|
+
<!-- chat area -->
|
|
20
|
+
<text x="40" y="92" font-size="14" fill="#94a3b8">你</text>
|
|
21
|
+
<rect x="40" y="100" width="300" height="34" rx="10" fill="#1e293b"/>
|
|
22
|
+
<text x="52" y="121" font-size="13" fill="#e2e8f0">优化一下这个函数</text>
|
|
23
|
+
<text x="40" y="164" font-size="14" fill="#94a3b8">助手</text>
|
|
24
|
+
<!-- 助手 typing phase A (visible 0-1.2s and 4.2-5.2s) -->
|
|
25
|
+
<g>
|
|
26
|
+
<animate attributeName="opacity" values="1;1;0;0;0;0;1;1;0" keyTimes="0;0.24;0.28;0.5;0.6;0.84;0.88;1;1" dur="5.2s" repeatCount="indefinite"/>
|
|
27
|
+
<rect x="40" y="172" width="150" height="34" rx="10" fill="#0f1b2e" stroke="#23324a"/>
|
|
28
|
+
<circle cx="70" cy="189" r="4" fill="#64748b"><animate attributeName="opacity" values="0.3;1;0.3" dur="0.9s" repeatCount="indefinite"/></circle>
|
|
29
|
+
<circle cx="88" cy="189" r="4" fill="#64748b"><animate attributeName="opacity" values="0.3;1;0.3" dur="0.9s" begin="0.3s" repeatCount="indefinite"/></circle>
|
|
30
|
+
<circle cx="106" cy="189" r="4" fill="#64748b"><animate attributeName="opacity" values="0.3;1;0.3" dur="0.9s" begin="0.6s" repeatCount="indefinite"/></circle>
|
|
31
|
+
</g>
|
|
32
|
+
<!-- error banner phase B (1.4-2.4s) -->
|
|
33
|
+
<g>
|
|
34
|
+
<animate attributeName="opacity" values="0;0;1;1;0;0" keyTimes="0;0.28;0.32;0.48;0.52;1" dur="5.2s" repeatCount="indefinite"/>
|
|
35
|
+
<rect x="40" y="236" width="420" height="40" rx="10" fill="#2a1215" stroke="#b91c1c"/>
|
|
36
|
+
<circle cx="64" cy="256" r="7" fill="#f87171"/>
|
|
37
|
+
<text x="82" y="261" font-size="13" fill="#fecaca">请求中断 — 网络错误 (UPSTREAM)</text>
|
|
38
|
+
</g>
|
|
39
|
+
<!-- auto 继续 bubble phase C (2.6-3.8s) -->
|
|
40
|
+
<g>
|
|
41
|
+
<animate attributeName="opacity" values="0;0;0;1;1;0;0" keyTimes="0;0.32;0.5;0.54;0.72;0.76;1" dur="5.2s" repeatCount="indefinite"/>
|
|
42
|
+
<rect x="40" y="300" width="150" height="36" rx="10" fill="#0c4a6e" stroke="#38bdf8" stroke-width="1.5"/>
|
|
43
|
+
<text x="52" y="323" font-size="13" fill="#e0f2fe">⏳ 自动发送: 继续</text>
|
|
44
|
+
<text x="210" y="323" font-size="12" fill="#38bdf8">来自 dsh-auto-continue</text>
|
|
45
|
+
</g>
|
|
46
|
+
<!-- 助手 resumed phase D (4.2-5.2s): same typing group reused -->
|
|
47
|
+
<!-- footer status bar -->
|
|
48
|
+
<rect x="0" y="402" width="720" height="18" fill="#0d1524"/>
|
|
49
|
+
<text x="360" y="414" font-size="11" fill="#475569" text-anchor="middle">宽限 3s → 自动「继续」→ 恢复 — 循环演示</text>
|
|
50
|
+
</svg>
|
package/docs/demo.svg
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="420" viewBox="0 0 720 420" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#0b1220"/>
|
|
5
|
+
<stop offset="100%" stop-color="#0e1a2e"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="accent" x1="0" y1="0" x2="1" y2="0">
|
|
8
|
+
<stop offset="0%" stop-color="#38bdf8"/>
|
|
9
|
+
<stop offset="100%" stop-color="#818cf8"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
<rect width="720" height="420" rx="20" fill="url(#bg)"/>
|
|
13
|
+
<!-- header -->
|
|
14
|
+
<rect x="0" y="0" width="720" height="46" rx="20" fill="#111c30"/>
|
|
15
|
+
<rect x="0" y="30" width="720" height="16" fill="#111c30"/>
|
|
16
|
+
<circle cx="22" cy="23" r="5" fill="#f87171"/><circle cx="38" cy="23" r="5" fill="#fbbf24"/><circle cx="54" cy="23" r="5" fill="#34d399"/>
|
|
17
|
+
<text x="600" y="28" font-size="13" fill="#64748b" text-anchor="end">dsh web — session</text>
|
|
18
|
+
<rect x="0" y="46" width="720" height="3" fill="url(#accent)" opacity="0.7"/>
|
|
19
|
+
<!-- chat area -->
|
|
20
|
+
<text x="40" y="92" font-size="14" fill="#94a3b8">you</text>
|
|
21
|
+
<rect x="40" y="100" width="300" height="34" rx="10" fill="#1e293b"/>
|
|
22
|
+
<text x="52" y="121" font-size="13" fill="#e2e8f0">Refactor this function</text>
|
|
23
|
+
<text x="40" y="164" font-size="14" fill="#94a3b8">agent</text>
|
|
24
|
+
<!-- agent typing phase A (visible 0-1.2s and 4.2-5.2s) -->
|
|
25
|
+
<g>
|
|
26
|
+
<animate attributeName="opacity" values="1;1;0;0;0;0;1;1;0" keyTimes="0;0.24;0.28;0.5;0.6;0.84;0.88;1;1" dur="5.2s" repeatCount="indefinite"/>
|
|
27
|
+
<rect x="40" y="172" width="150" height="34" rx="10" fill="#0f1b2e" stroke="#23324a"/>
|
|
28
|
+
<circle cx="70" cy="189" r="4" fill="#64748b"><animate attributeName="opacity" values="0.3;1;0.3" dur="0.9s" repeatCount="indefinite"/></circle>
|
|
29
|
+
<circle cx="88" cy="189" r="4" fill="#64748b"><animate attributeName="opacity" values="0.3;1;0.3" dur="0.9s" begin="0.3s" repeatCount="indefinite"/></circle>
|
|
30
|
+
<circle cx="106" cy="189" r="4" fill="#64748b"><animate attributeName="opacity" values="0.3;1;0.3" dur="0.9s" begin="0.6s" repeatCount="indefinite"/></circle>
|
|
31
|
+
</g>
|
|
32
|
+
<!-- error banner phase B (1.4-2.4s) -->
|
|
33
|
+
<g>
|
|
34
|
+
<animate attributeName="opacity" values="0;0;1;1;0;0" keyTimes="0;0.28;0.32;0.48;0.52;1" dur="5.2s" repeatCount="indefinite"/>
|
|
35
|
+
<rect x="40" y="236" width="420" height="40" rx="10" fill="#2a1215" stroke="#b91c1c"/>
|
|
36
|
+
<circle cx="64" cy="256" r="7" fill="#f87171"/>
|
|
37
|
+
<text x="82" y="261" font-size="13" fill="#fecaca">Request interrupted — network error (UPSTREAM)</text>
|
|
38
|
+
</g>
|
|
39
|
+
<!-- auto 继续 bubble phase C (2.6-3.8s) -->
|
|
40
|
+
<g>
|
|
41
|
+
<animate attributeName="opacity" values="0;0;0;1;1;0;0" keyTimes="0;0.32;0.5;0.54;0.72;0.76;1" dur="5.2s" repeatCount="indefinite"/>
|
|
42
|
+
<rect x="40" y="300" width="150" height="36" rx="10" fill="#0c4a6e" stroke="#38bdf8" stroke-width="1.5"/>
|
|
43
|
+
<text x="52" y="323" font-size="13" fill="#e0f2fe">⏳ auto-sent: 继续</text>
|
|
44
|
+
<text x="210" y="323" font-size="12" fill="#38bdf8">by dsh-auto-continue</text>
|
|
45
|
+
</g>
|
|
46
|
+
<!-- agent resumed phase D (4.2-5.2s): same typing group reused -->
|
|
47
|
+
<!-- footer status bar -->
|
|
48
|
+
<rect x="0" y="402" width="720" height="18" fill="#0d1524"/>
|
|
49
|
+
<text x="360" y="414" font-size="11" fill="#475569" text-anchor="middle">grace 3s → auto 继续 → resume — looped demo</text>
|
|
50
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="640" viewBox="0 0 1280 640" font-family="system-ui, -apple-system, 'Segoe UI', sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#0b1220"/>
|
|
5
|
+
<stop offset="55%" stop-color="#0c2336"/>
|
|
6
|
+
<stop offset="100%" stop-color="#101a30"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="glow" x1="0" y1="0" x2="1" y2="0">
|
|
9
|
+
<stop offset="0%" stop-color="#38bdf8" stop-opacity="0.16"/>
|
|
10
|
+
<stop offset="100%" stop-color="#818cf8" stop-opacity="0.16"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
<linearGradient id="bar" x1="0" y1="0" x2="1" y2="0">
|
|
13
|
+
<stop offset="0%" stop-color="#38bdf8"/>
|
|
14
|
+
<stop offset="100%" stop-color="#818cf8"/>
|
|
15
|
+
</linearGradient>
|
|
16
|
+
<linearGradient id="chip" x1="0" y1="0" x2="0" y2="1">
|
|
17
|
+
<stop offset="0%" stop-color="#f8fafc"/>
|
|
18
|
+
<stop offset="100%" stop-color="#e2e8f0"/>
|
|
19
|
+
</linearGradient>
|
|
20
|
+
</defs>
|
|
21
|
+
<rect width="1280" height="640" fill="url(#bg)"/>
|
|
22
|
+
<rect x="0" y="0" width="1280" height="300" fill="url(#glow)"/>
|
|
23
|
+
<!-- Continue chip -->
|
|
24
|
+
<rect x="88" y="120" width="250" height="180" rx="40" fill="url(#chip)"/>
|
|
25
|
+
<text x="213" y="226" font-size="64" font-weight="800" fill="#0f172a" text-anchor="middle">Continue</text>
|
|
26
|
+
<!-- title -->
|
|
27
|
+
<text x="400" y="200" font-size="76" font-weight="800" fill="#f8fafc">dsh-auto-continue</text>
|
|
28
|
+
<!-- subtitle -->
|
|
29
|
+
<text x="402" y="258" font-size="32" fill="#94a3b8">DSH Web UI plugin — auto-continue interrupted requests</text>
|
|
30
|
+
<!-- caption -->
|
|
31
|
+
<text x="402" y="316" font-size="24" fill="#7dd3fc" font-family="ui-monospace, SFMono-Regular, Menlo, monospace">turn/end · error | interrupted | max-tokens → prompt("Continue")</text>
|
|
32
|
+
<!-- feature pills -->
|
|
33
|
+
<rect x="402" y="368" width="250" height="56" rx="28" fill="#1e293b" stroke="#334155"/>
|
|
34
|
+
<text x="527" y="403" font-size="22" fill="#e2e8f0" text-anchor="middle">auto-resume on failure</text>
|
|
35
|
+
<rect x="668" y="368" width="264" height="56" rx="28" fill="#1e293b" stroke="#334155"/>
|
|
36
|
+
<text x="800" y="403" font-size="22" fill="#e2e8f0" text-anchor="middle">GUI-configurable settings</text>
|
|
37
|
+
<rect x="948" y="368" width="240" height="56" rx="28" fill="#1e293b" stroke="#334155"/>
|
|
38
|
+
<text x="1068" y="403" font-size="22" fill="#e2e8f0" text-anchor="middle">dsh plugin add</text>
|
|
39
|
+
<!-- repo line -->
|
|
40
|
+
<text x="402" y="500" font-size="26" fill="#64748b">github.com/HsiangNianian/dsh-auto-continue</text>
|
|
41
|
+
<!-- accent bar -->
|
|
42
|
+
<rect x="0" y="628" width="1280" height="12" fill="url(#bar)"/>
|
|
43
|
+
</svg>
|
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.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"lib",
|
|
21
21
|
"cordis.patch.yml",
|
|
22
22
|
"scripts",
|
|
23
|
+
"docs",
|
|
23
24
|
"README.md",
|
|
24
25
|
"README.zh.md",
|
|
25
26
|
"LICENSE"
|