dsh-client-auto-continue 0.3.0 → 0.3.1

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 CHANGED
@@ -171,7 +171,7 @@ Everything is configurable from the GUI — no file or console edits needed. Ope
171
171
  npm run typecheck # tsc --noEmit
172
172
  npm run build # lib/client.js + lib/index.js + lib/types
173
173
  npm run watch # rebuild on change; host HMR hot-reloads without a page refresh
174
- npm run test # node tests/simulate.mjs — 8 behavioral scenarios
174
+ npm run test # node tests/simulate.mjs — 12 behavioral scenarios
175
175
  ```
176
176
 
177
177
  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
@@ -168,7 +168,7 @@ dsh web
168
168
  npm run typecheck # tsc --noEmit
169
169
  npm run build # lib/client.js + lib/index.js + lib/types
170
170
  npm run watch # 监听变更自动重建; 宿主 HMR 免刷新热重载
171
- npm run test # node tests/simulate.mjs — 8 个行为场景
171
+ npm run test # node tests/simulate.mjs — 12 个行为场景
172
172
  ```
173
173
 
174
174
  `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(&quot;Continue&quot;)</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(&quot;继续&quot;)</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(&quot;继续&quot;)</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
+ <!-- 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(&quot;Continue&quot;)</text>
25
+ </svg>
@@ -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(&quot;Continue&quot;)</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.0",
4
+ "version": "0.3.1",
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"