dsh-client-auto-continue 0.8.0 → 0.8.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 +2 -6
- package/README.zh.md +2 -6
- package/lib/client.js +14 -46
- package/lib/client.js.map +3 -3
- package/lib/index.js +5 -11
- package/lib/types/client/dsh-store-compat.d.ts +39 -0
- package/lib/types/client/engine.d.ts +5 -250
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/locales.d.ts +0 -4
- package/lib/types/client/settings-card.d.ts +1 -3
- package/lib/types/client/settings-form.d.ts +1 -1
- package/lib/types/host/engine.d.ts +1 -141
- package/lib/types/index.d.ts +0 -8
- package/lib/types/shared/core.d.ts +234 -0
- package/package.json +2 -4
- package/src/client/dsh-store-compat.ts +57 -0
- package/src/client/engine.ts +17 -1639
- package/src/client/index.ts +1 -1
- package/src/client/locales.ts +0 -8
- package/src/client/settings-card.tsx +1 -27
- package/src/client/settings-form.ts +1 -1
- package/src/host/engine.ts +24 -457
- package/src/index.ts +2 -5
- package/src/shared/core.ts +458 -0
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ The browser half is a thin shell: the settings card, plus a status bridge that s
|
|
|
72
72
|
|
|
73
73
|
DSH plugins install into a **profile** (`dsh web` → `web` profile). Install, restart `dsh web`, done.
|
|
74
74
|
|
|
75
|
-
> **
|
|
75
|
+
> **Use the latest DSH (recommended: 0.1.2-alpha.1 or newer).** Run `dsh --version` before installing. Plugin v0.8.2 supports the new 0.1.2 client-store module layout and retains a fallback for DSH 0.1.0-rc.7 through 0.1.1; rc.6 and earlier remain unsupported (`list slot ... requires options.id`). Preview releases may appear on the [official DSH releases page](https://github.com/deepseek-ai/deepseek-harness/releases) before the public npm tag catches up.
|
|
76
76
|
|
|
77
77
|
### From npm (recommended)
|
|
78
78
|
|
|
@@ -162,8 +162,6 @@ auto-continue:
|
|
|
162
162
|
scanOnBoot: true
|
|
163
163
|
scanLimit: 8
|
|
164
164
|
freshMs: 900000
|
|
165
|
-
reconnectScanDelayMs: 5000
|
|
166
|
-
reconnectBackoffMs: 3000
|
|
167
165
|
verbose: true
|
|
168
166
|
classify: true
|
|
169
167
|
backoffFactor: 2
|
|
@@ -210,8 +208,6 @@ auto-continue:
|
|
|
210
208
|
| Scan on load / reconnect | `on` | Scan recently interrupted sessions on load / reconnect |
|
|
211
209
|
| Scan limit | `8` | Max sessions scanned (running / subagent sessions excluded) |
|
|
212
210
|
| Scan window (ms) | `900000` | Scan only considers interruptions inside this window |
|
|
213
|
-
| Reconnect scan delay (ms) | `5000` | Legacy — unused since the engine moved into the host (kept for config compatibility) |
|
|
214
|
-
| Reconnect backoff (ms) | `3000` | Legacy — unused since the engine moved into the host (kept for config compatibility) |
|
|
215
211
|
| Verbose logs | `on` | `[auto-continue]` console logs |
|
|
216
212
|
| Classify errors | `on` | Auto-resume transient failures only; auth / balance / model errors are skipped and notified |
|
|
217
213
|
| Backoff factor | `2` | Cooldown multiplier per consecutive failure (2 = 20s → 40s → 80s…) |
|
|
@@ -244,7 +240,7 @@ npm run test # node tests/simulate-host.mjs — 15 host-side behavioral s
|
|
|
244
240
|
|
|
245
241
|
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.
|
|
246
242
|
|
|
247
|
-
CI runs [dsh-plugin-check](https://github.com/omdsh-dev/dsh-plugin-check)
|
|
243
|
+
CI installs from the lockfile, typechecks, rebuilds and verifies committed artifacts, runs the host and dual-layout client simulations, then runs [dsh-plugin-check](https://github.com/omdsh-dev/dsh-plugin-check). The same health check gates releases.
|
|
248
244
|
|
|
249
245
|
---
|
|
250
246
|
|
package/README.zh.md
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
DSH 插件安装进 **profile**(`dsh web` 对应 `web` profile)。安装后重启 `dsh web` 即可。
|
|
74
74
|
|
|
75
|
-
>
|
|
75
|
+
> **请使用最新 DSH(推荐 0.1.2-alpha.1 或更高版本)。** 安装前先运行 `dsh --version`。插件 v0.8.2 已支持 0.1.2 的新 client-store 模块布局, 同时为 DSH 0.1.0-rc.7 至 0.1.1 保留兼容回退; rc.6 及更早版本仍不支持(`list slot ... requires options.id`)。预览版可能先发布在 [DSH 官方 Releases](https://github.com/deepseek-ai/deepseek-harness/releases), 公开 npm 标签会稍后跟进。
|
|
76
76
|
|
|
77
77
|
### 从 npm 安装(推荐)
|
|
78
78
|
|
|
@@ -162,8 +162,6 @@ auto-continue:
|
|
|
162
162
|
scanOnBoot: true
|
|
163
163
|
scanLimit: 8
|
|
164
164
|
freshMs: 900000
|
|
165
|
-
reconnectScanDelayMs: 5000
|
|
166
|
-
reconnectBackoffMs: 3000
|
|
167
165
|
verbose: true
|
|
168
166
|
classify: true
|
|
169
167
|
backoffFactor: 2
|
|
@@ -210,8 +208,6 @@ auto-continue:
|
|
|
210
208
|
| 启动/重连扫描 | 开 | 页面启动 / 重连时扫描最近中断的会话 |
|
|
211
209
|
| 扫描会话数 | `8` | 扫描最多检查的会话数(不含运行中 / 子代理会话) |
|
|
212
210
|
| 扫描时间窗 (ms) | `900000` | 扫描只处理该时间窗内的中断 |
|
|
213
|
-
| 重连扫描延迟 (ms) | `5000` | 遗留字段 — 引擎迁入宿主后不再使用(仅为配置兼容保留) |
|
|
214
|
-
| 重连退避 (ms) | `3000` | 遗留字段 — 引擎迁入宿主后不再使用(仅为配置兼容保留) |
|
|
215
211
|
| 详细日志 | 开 | 控制台输出 `[auto-continue]` 日志 |
|
|
216
212
|
| 错误分类 | 开 | 仅自动恢复临时性错误; 认证 / 余额 / 模型等永久性错误跳过并通知 |
|
|
217
213
|
| 退避系数 | `2` | 连续失败时冷却间隔的倍率(2 = 20s → 40s → 80s…) |
|
|
@@ -244,7 +240,7 @@ npm run test # node tests/simulate-host.mjs — 15 个 host 侧行为场
|
|
|
244
240
|
|
|
245
241
|
`npm run watch` 运行时, profile 的 client-hmr 行每 500ms 轮询 `lib/client.js` 并在浏览器中热重载插件——改代码无需重启服务。
|
|
246
242
|
|
|
247
|
-
CI
|
|
243
|
+
CI 会按锁文件安装依赖, 执行类型检查、重新构建并核对已提交产物, 跑 host 与双模块布局 client 模拟测试, 最后运行 [dsh-plugin-check](https://github.com/omdsh-dev/dsh-plugin-check); 发布也受同一体检门禁约束。
|
|
248
244
|
|
|
249
245
|
---
|
|
250
246
|
|
package/lib/client.js
CHANGED
|
@@ -63,10 +63,6 @@ var zh = {
|
|
|
63
63
|
"field.scanLimitHint": "最多检查多少个最近更新的会话(不含运行中与子代理会话)。",
|
|
64
64
|
"field.freshMs": "扫描时间窗 (ms)",
|
|
65
65
|
"field.freshMsHint": "扫描只处理该时间窗内的中断。",
|
|
66
|
-
"field.reconnectScanDelayMs": "重连扫描延迟 (ms)",
|
|
67
|
-
"field.reconnectScanDelayMsHint": "重连后等待宿主完成恢复再扫描。",
|
|
68
|
-
"field.reconnectBackoffMs": "重连退避 (ms)",
|
|
69
|
-
"field.reconnectBackoffMsHint": "事件流断开后的重连间隔。",
|
|
70
66
|
"field.verbose": "详细日志",
|
|
71
67
|
"field.verboseHint": "在浏览器控制台输出 [auto-continue] 日志。",
|
|
72
68
|
"field.classify": "错误分类",
|
|
@@ -148,10 +144,6 @@ var en = {
|
|
|
148
144
|
"field.scanLimitHint": "How many most-recently-updated sessions to check (running / subagent sessions excluded).",
|
|
149
145
|
"field.freshMs": "Scan window (ms)",
|
|
150
146
|
"field.freshMsHint": "Only interruptions inside this window are considered.",
|
|
151
|
-
"field.reconnectScanDelayMs": "Reconnect scan delay (ms)",
|
|
152
|
-
"field.reconnectScanDelayMsHint": "Wait for the host to finish recovering before scanning after a reconnect.",
|
|
153
|
-
"field.reconnectBackoffMs": "Reconnect backoff (ms)",
|
|
154
|
-
"field.reconnectBackoffMsHint": "Interval between event-stream reconnect attempts.",
|
|
155
147
|
"field.verbose": "Verbose logs",
|
|
156
148
|
"field.verboseHint": "Log [auto-continue] lines to the browser console.",
|
|
157
149
|
"field.classify": "Classify errors",
|
|
@@ -209,9 +201,8 @@ var en = {
|
|
|
209
201
|
|
|
210
202
|
// src/client/settings-card.tsx
|
|
211
203
|
var import_react = require("react");
|
|
212
|
-
var import_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
213
204
|
|
|
214
|
-
// src/
|
|
205
|
+
// src/shared/core.ts
|
|
215
206
|
var DEFAULT_CONFIG = {
|
|
216
207
|
continueText: "继续",
|
|
217
208
|
continueTextMaxTokens: "继续",
|
|
@@ -224,8 +215,6 @@ var DEFAULT_CONFIG = {
|
|
|
224
215
|
scanOnBoot: true,
|
|
225
216
|
scanLimit: 8,
|
|
226
217
|
freshMs: 15 * 60 * 1e3,
|
|
227
|
-
reconnectScanDelayMs: 5e3,
|
|
228
|
-
reconnectBackoffMs: 3e3,
|
|
229
218
|
verbose: true,
|
|
230
219
|
classify: true,
|
|
231
220
|
backoffFactor: 2,
|
|
@@ -240,12 +229,21 @@ var DEFAULT_CONFIG = {
|
|
|
240
229
|
loopToolRepeat: 5,
|
|
241
230
|
loopText: "(检测到你可能陷入循环, 请停止重复刚才的动作, 换一种方式继续)"
|
|
242
231
|
};
|
|
243
|
-
var lockPrefix = "dsh-auto-continue:";
|
|
244
|
-
var SEND_COUNT_WINDOW_MS = 10 * 60 * 1e3;
|
|
245
|
-
var statsKey = `${lockPrefix}stats`;
|
|
246
232
|
var RECOVERY_WINDOW_MS = 10 * 60 * 1e3;
|
|
247
233
|
var ECHO_WINDOW_MS = 10 * 60 * 1e3;
|
|
248
234
|
|
|
235
|
+
// src/client/dsh-store-compat.ts
|
|
236
|
+
function resolveSnapshotStore() {
|
|
237
|
+
const current = ["@deepseek-ai/dsh-client", "-store"].join("");
|
|
238
|
+
const legacy = ["@deepseek-ai/dsh-client-runtime", "/client"].join("");
|
|
239
|
+
try {
|
|
240
|
+
return require(current);
|
|
241
|
+
} catch {
|
|
242
|
+
return require(legacy);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
var { createSnapshotStore } = resolveSnapshotStore();
|
|
246
|
+
|
|
249
247
|
// src/client/bridge.ts
|
|
250
248
|
var EMPTY_STATS = {
|
|
251
249
|
date: "",
|
|
@@ -745,8 +743,6 @@ var AutoContinueSettingsCardController = class {
|
|
|
745
743
|
booleanField("scanOnBoot"),
|
|
746
744
|
numberField("scanLimit", 1),
|
|
747
745
|
numberField("freshMs", 0),
|
|
748
|
-
numberField("reconnectScanDelayMs", 0),
|
|
749
|
-
numberField("reconnectBackoffMs", 0),
|
|
750
746
|
booleanField("verbose"),
|
|
751
747
|
booleanField("classify"),
|
|
752
748
|
numberField("backoffFactor", 1),
|
|
@@ -760,7 +756,7 @@ var AutoContinueSettingsCardController = class {
|
|
|
760
756
|
numberField("loopToolRepeat", 2),
|
|
761
757
|
textField("loopText")
|
|
762
758
|
]);
|
|
763
|
-
this.store = this.form.bind(() => this.projection(),
|
|
759
|
+
this.store = this.form.bind(() => this.projection(), createSnapshotStore);
|
|
764
760
|
}
|
|
765
761
|
projection() {
|
|
766
762
|
return {
|
|
@@ -777,8 +773,6 @@ var AutoContinueSettingsCardController = class {
|
|
|
777
773
|
scanOnBoot: this.form.field("scanOnBoot"),
|
|
778
774
|
scanLimit: this.form.field("scanLimit"),
|
|
779
775
|
freshMs: this.form.field("freshMs"),
|
|
780
|
-
reconnectScanDelayMs: this.form.field("reconnectScanDelayMs"),
|
|
781
|
-
reconnectBackoffMs: this.form.field("reconnectBackoffMs"),
|
|
782
776
|
verbose: this.form.field("verbose"),
|
|
783
777
|
classify: this.form.field("classify"),
|
|
784
778
|
backoffFactor: this.form.field("backoffFactor"),
|
|
@@ -1182,32 +1176,6 @@ function AutoContinueSettingsCard(props) {
|
|
|
1182
1176
|
onReset: () => props.resetField("freshMs")
|
|
1183
1177
|
}
|
|
1184
1178
|
),
|
|
1185
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1186
|
-
ValueField,
|
|
1187
|
-
{
|
|
1188
|
-
id: "auto-continue-reconnect-scan-delay",
|
|
1189
|
-
label: t("field.reconnectScanDelayMs"),
|
|
1190
|
-
hint: t("field.reconnectScanDelayMsHint"),
|
|
1191
|
-
numeric: true,
|
|
1192
|
-
...shared,
|
|
1193
|
-
...state2.reconnectScanDelayMs,
|
|
1194
|
-
onEdit: (text) => props.edit("reconnectScanDelayMs", text),
|
|
1195
|
-
onReset: () => props.resetField("reconnectScanDelayMs")
|
|
1196
|
-
}
|
|
1197
|
-
),
|
|
1198
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1199
|
-
ValueField,
|
|
1200
|
-
{
|
|
1201
|
-
id: "auto-continue-reconnect-backoff",
|
|
1202
|
-
label: t("field.reconnectBackoffMs"),
|
|
1203
|
-
hint: t("field.reconnectBackoffMsHint"),
|
|
1204
|
-
numeric: true,
|
|
1205
|
-
...shared,
|
|
1206
|
-
...state2.reconnectBackoffMs,
|
|
1207
|
-
onEdit: (text) => props.edit("reconnectBackoffMs", text),
|
|
1208
|
-
onReset: () => props.resetField("reconnectBackoffMs")
|
|
1209
|
-
}
|
|
1210
|
-
),
|
|
1211
1179
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1212
1180
|
BooleanField,
|
|
1213
1181
|
{
|