dsh-client-auto-continue 0.11.8 → 0.12.0
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 +111 -61
- package/README.zh.md +111 -61
- package/docs/screenshots/01-settings-section.png +0 -0
- package/docs/screenshots/01-settings-section.zh.png +0 -0
- package/docs/screenshots/02-settings-card.png +0 -0
- package/docs/screenshots/02-settings-card.zh.png +0 -0
- package/docs/screenshots/07-card-panels.png +0 -0
- package/docs/screenshots/07-card-panels.zh.png +0 -0
- package/docs/screenshots/README.md +35 -0
- package/lib/client.js +116 -10
- package/lib/client.js.map +2 -2
- package/lib/index.js +268 -99
- package/lib/types/client/locales.d.ts +12 -0
- package/lib/types/client/settings-card.d.ts +4 -0
- package/lib/types/host/engine.d.ts +20 -11
- package/lib/types/index.d.ts +161 -11
- package/lib/types/shared/core.d.ts +22 -4
- package/package.json +9 -3
- package/src/client/locales.ts +34 -10
- package/src/client/settings-card.tsx +63 -1
- package/src/client/styles.ts +2 -0
- package/src/host/engine.ts +247 -96
- package/src/index.ts +78 -27
- package/src/shared/core.ts +43 -4
package/lib/client.js
CHANGED
|
@@ -40,6 +40,8 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
40
40
|
zh: {
|
|
41
41
|
continueText: "继续",
|
|
42
42
|
continueTextMaxTokens: "继续",
|
|
43
|
+
continueTextSilent: "继续。你上一轮只输出了内部推理, 既没有回复也没有调用工具, 用户什么都没看到。每一轮都要以工具调用或可见回复结束。",
|
|
44
|
+
continueTextLoop: "继续",
|
|
43
45
|
guardPendingText: "(上一步工具「{tool}」可能未完成, 先确认状态再继续, 不要重复执行)",
|
|
44
46
|
guardDoneText: "(上一步工具「{tool}」已完成, 结果: {result}; 不要重复执行, 直接继续)",
|
|
45
47
|
loopText: "(检测到你可能陷入循环, 请停止重复刚才的动作, 换一种方式继续)"
|
|
@@ -47,6 +49,8 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
47
49
|
en: {
|
|
48
50
|
continueText: "Continue",
|
|
49
51
|
continueTextMaxTokens: "Continue",
|
|
52
|
+
continueTextSilent: "Continue. Your previous turn ended with internal reasoning only, with no message and no tool call, so nothing reached the user. Always finish a turn with a tool call or a visible answer.",
|
|
53
|
+
continueTextLoop: "Continue",
|
|
50
54
|
guardPendingText: '(The previous tool "{tool}" may not have completed. Check its state before continuing and do not run it again.)',
|
|
51
55
|
guardDoneText: '(The previous tool "{tool}" completed successfully. Result: {result}; do not run it again. Continue from there.)',
|
|
52
56
|
loopText: "(You may be stuck in a loop. Stop repeating the last action and continue with a different approach.)"
|
|
@@ -55,6 +59,9 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
55
59
|
var DEFAULT_CONFIG = {
|
|
56
60
|
locale: "zh",
|
|
57
61
|
...LOCALIZED_TEXT_DEFAULTS.zh,
|
|
62
|
+
resumeSilentTurns: true,
|
|
63
|
+
resumeCompletedTurns: false,
|
|
64
|
+
continueTextLoop: "",
|
|
58
65
|
guardTools: true,
|
|
59
66
|
graceMs: 3e3,
|
|
60
67
|
cooldownMs: 2e4,
|
|
@@ -90,6 +97,8 @@ var zh = {
|
|
|
90
97
|
"repo.aria": "打开 dsh-auto-continue 的 GitHub 开源地址并点 Star",
|
|
91
98
|
"section.handoff.title": "接力方式",
|
|
92
99
|
"section.handoff.description": "决定中断后说什么,以及什么时候暂时停手。",
|
|
100
|
+
"section.autoloop.title": "自主循环",
|
|
101
|
+
"section.autoloop.description": "每个回合结束后自动把对话交还给 Agent,直到手动停止。",
|
|
93
102
|
"section.safety.title": "安全节奏",
|
|
94
103
|
"section.safety.description": "先确认上一步,再控制等待与连续续跑的边界。",
|
|
95
104
|
"section.recovery.title": "恢复雷达",
|
|
@@ -106,6 +115,16 @@ var zh = {
|
|
|
106
115
|
"field.continueTextMaxTokens": "超限时的继续文本",
|
|
107
116
|
"field.continueTextMaxTokensHint": "达到输出 token 上限时自动发送的文本, 支持与继续文本相同的占位符。",
|
|
108
117
|
"default.continueTextMaxTokens": LOCALIZED_TEXT_DEFAULTS.zh.continueTextMaxTokens,
|
|
118
|
+
"field.resumeSilentTurns": "续跑无输出回合",
|
|
119
|
+
"field.resumeSilentTurnsHint": "已观察到模型活动但没有可见输出时续跑;不把空回合、图片或扩展内容误判为静默,冷却与连续上限照常生效。",
|
|
120
|
+
"field.resumeCompletedTurns": "自主循环(每个回合后都续跑)",
|
|
121
|
+
"field.resumeCompletedTurnsHint": "每个正常完成的回合结束后立即把对话交还给 Agent,无限循环直到你手动停止或发送消息。连续失败上限只对失败生效,成功的回合不计入。",
|
|
122
|
+
"field.continueTextLoop": "自主循环的继续文本",
|
|
123
|
+
"field.continueTextLoopHint": "自主循环每次续跑时发送的文本。",
|
|
124
|
+
"default.continueTextLoop": LOCALIZED_TEXT_DEFAULTS.zh.continueTextLoop,
|
|
125
|
+
"field.continueTextSilent": "无输出回合的继续文本",
|
|
126
|
+
"field.continueTextSilentHint": "回合只输出推理就结束时自动发送的文本, 支持与继续文本相同的占位符。",
|
|
127
|
+
"default.continueTextSilent": LOCALIZED_TEXT_DEFAULTS.zh.continueTextSilent,
|
|
109
128
|
"field.guardTools": "幂等护栏",
|
|
110
129
|
"field.guardToolsHint": "续跑前检查上一步工具调用: 结果未确认时提示先确认状态, 已成功时提示不要重复执行, 避免重复 commit/调 API。",
|
|
111
130
|
"field.guardPendingText": "结果未确认时的护栏文本",
|
|
@@ -119,13 +138,13 @@ var zh = {
|
|
|
119
138
|
"field.cooldownMs": "冷却时间 (ms)",
|
|
120
139
|
"field.cooldownMsHint": "同一会话两次自动「继续」的最小间隔, 失败尝试也计入。",
|
|
121
140
|
"field.maxConsecutive": "最大连续次数",
|
|
122
|
-
"field.maxConsecutiveHint": "
|
|
123
|
-
"field.scanOnBoot": "
|
|
124
|
-
"field.scanOnBootHint": "
|
|
141
|
+
"field.maxConsecutiveHint": "同一会话连续自动「继续」的上限;直到用户介入或成功回合产生已确认的可见输出才清零。",
|
|
142
|
+
"field.scanOnBoot": "启动恢复扫描",
|
|
143
|
+
"field.scanOnBootHint": "宿主启动后在扫描时间窗内等待延迟加载的中断会话,每个已就绪会话只检查一次。",
|
|
125
144
|
"field.scanLimit": "扫描会话数",
|
|
126
|
-
"field.scanLimitHint": "
|
|
145
|
+
"field.scanLimitHint": "每次扫描最多恢复多少个符合条件的会话,优先最近活动的会话。",
|
|
127
146
|
"field.freshMs": "扫描时间窗 (ms)",
|
|
128
|
-
"field.freshMsHint": "
|
|
147
|
+
"field.freshMsHint": "只处理该时间窗内的中断;启动轮询也会在这段时间后结束。",
|
|
129
148
|
"field.verbose": "详细日志",
|
|
130
149
|
"field.verboseHint": "在浏览器控制台输出 [auto-continue] 日志。",
|
|
131
150
|
"field.classify": "错误分类",
|
|
@@ -194,6 +213,8 @@ var en = {
|
|
|
194
213
|
"repo.aria": "Open the dsh-auto-continue repository on GitHub and star it",
|
|
195
214
|
"section.handoff.title": "The handoff",
|
|
196
215
|
"section.handoff.description": "Choose what gets sent after an interruption and when the relay should stand down.",
|
|
216
|
+
"section.autoloop.title": "Autonomous loop",
|
|
217
|
+
"section.autoloop.description": "Hand the thread back after every completed turn until manually stopped.",
|
|
197
218
|
"section.safety.title": "Safety rhythm",
|
|
198
219
|
"section.safety.description": "Confirm the previous step, then set the boundaries for waiting and repeated resumes.",
|
|
199
220
|
"section.recovery.title": "Recovery radar",
|
|
@@ -210,6 +231,16 @@ var en = {
|
|
|
210
231
|
"field.continueTextMaxTokens": "Continue text (max tokens)",
|
|
211
232
|
"field.continueTextMaxTokensHint": "Text sent when the output token ceiling is reached; same placeholders as the continue text.",
|
|
212
233
|
"default.continueTextMaxTokens": LOCALIZED_TEXT_DEFAULTS.en.continueTextMaxTokens,
|
|
234
|
+
"field.resumeSilentTurns": "Resume silent turns",
|
|
235
|
+
"field.resumeSilentTurnsHint": "Resume observed model activity without visible output. No-op turns, images and extension blocks are not treated as silent; cooldown and retry limits still apply.",
|
|
236
|
+
"field.resumeCompletedTurns": "Autonomous loop (continue after every turn)",
|
|
237
|
+
"field.resumeCompletedTurnsHint": "Hand the thread back to the agent after every completed turn, looping until you press stop or send a message. The consecutive-failure cap only throttles failures; successful turns never count.",
|
|
238
|
+
"field.continueTextLoop": "Continue text (autonomous loop)",
|
|
239
|
+
"field.continueTextLoopHint": "Text sent on each autonomous-loop continuation.",
|
|
240
|
+
"default.continueTextLoop": LOCALIZED_TEXT_DEFAULTS.en.continueTextLoop,
|
|
241
|
+
"field.continueTextSilent": "Continue text (silent turn)",
|
|
242
|
+
"field.continueTextSilentHint": "Text sent when a turn ends with reasoning only; same placeholders as the continue text.",
|
|
243
|
+
"default.continueTextSilent": LOCALIZED_TEXT_DEFAULTS.en.continueTextSilent,
|
|
213
244
|
"field.guardTools": "Idempotency guard",
|
|
214
245
|
"field.guardToolsHint": "Before resuming, inspect the last tool call: if its result is unconfirmed, tell the model to check state first; if it succeeded, tell it not to rerun — avoids duplicate commits / API calls.",
|
|
215
246
|
"field.guardPendingText": "Guard text (unconfirmed result)",
|
|
@@ -223,13 +254,13 @@ var en = {
|
|
|
223
254
|
"field.cooldownMs": "Cooldown (ms)",
|
|
224
255
|
"field.cooldownMsHint": "Minimum interval between auto-continues per session; failed attempts count too.",
|
|
225
256
|
"field.maxConsecutive": "Max consecutive",
|
|
226
|
-
"field.maxConsecutiveHint": "Max consecutive auto-continues per session;
|
|
227
|
-
"field.scanOnBoot": "Scan on
|
|
228
|
-
"field.scanOnBootHint": "
|
|
257
|
+
"field.maxConsecutiveHint": "Max consecutive auto-continues per session; resets only after user intervention or a completed turn with confirmed visible output.",
|
|
258
|
+
"field.scanOnBoot": "Scan on host startup",
|
|
259
|
+
"field.scanOnBootHint": "Wait for delayed interrupted sessions during the startup scan window; inspect each settled session once.",
|
|
229
260
|
"field.scanLimit": "Scan limit",
|
|
230
|
-
"field.scanLimitHint": "
|
|
261
|
+
"field.scanLimitHint": "Maximum eligible sessions to recover per pass, most recently active first.",
|
|
231
262
|
"field.freshMs": "Scan window (ms)",
|
|
232
|
-
"field.freshMsHint": "Only interruptions inside this window are considered.",
|
|
263
|
+
"field.freshMsHint": "Only interruptions inside this window are considered; startup polling also ends after this duration.",
|
|
233
264
|
"field.verbose": "Verbose logs",
|
|
234
265
|
"field.verboseHint": "Log [auto-continue] lines to the browser console.",
|
|
235
266
|
"field.classify": "Classify errors",
|
|
@@ -628,6 +659,7 @@ var css = `
|
|
|
628
659
|
--dsh-ac-violet: #8b7cff;
|
|
629
660
|
--dsh-ac-cyan: #45cce5;
|
|
630
661
|
--dsh-ac-mint: #46d69d;
|
|
662
|
+
--dsh-ac-red: #e5484d;
|
|
631
663
|
--dsh-ac-amber: #f1b95c;
|
|
632
664
|
isolation: isolate;
|
|
633
665
|
position: relative;
|
|
@@ -850,6 +882,7 @@ var css = `
|
|
|
850
882
|
background: color-mix(in srgb, var(--dsw-alias-bg-layer-3) 95%, var(--dsh-ac-section) 5%);
|
|
851
883
|
}
|
|
852
884
|
.dshAcFormSection-handoff { --dsh-ac-section: var(--dsh-ac-mint); }
|
|
885
|
+
.dshAcFormSection-autoloop { --dsh-ac-section: var(--dsh-ac-red); }
|
|
853
886
|
.dshAcFormSection-safety { --dsh-ac-section: var(--dsh-ac-amber); }
|
|
854
887
|
.dshAcFormSection-recovery { --dsh-ac-section: var(--dsh-ac-cyan); }
|
|
855
888
|
.dshAcFormSection-loop { --dsh-ac-section: var(--dsh-ac-violet); }
|
|
@@ -1033,6 +1066,10 @@ var AutoContinueSettingsCardController = class {
|
|
|
1033
1066
|
booleanField("paused"),
|
|
1034
1067
|
textField("continueText"),
|
|
1035
1068
|
textField("continueTextMaxTokens"),
|
|
1069
|
+
booleanField("resumeSilentTurns"),
|
|
1070
|
+
booleanField("resumeCompletedTurns"),
|
|
1071
|
+
textField("continueTextLoop"),
|
|
1072
|
+
textField("continueTextSilent"),
|
|
1036
1073
|
booleanField("guardTools"),
|
|
1037
1074
|
textField("guardPendingText"),
|
|
1038
1075
|
textField("guardDoneText"),
|
|
@@ -1064,6 +1101,10 @@ var AutoContinueSettingsCardController = class {
|
|
|
1064
1101
|
paused: this.form.field("paused"),
|
|
1065
1102
|
continueText: this.form.field("continueText"),
|
|
1066
1103
|
continueTextMaxTokens: this.form.field("continueTextMaxTokens"),
|
|
1104
|
+
resumeSilentTurns: this.form.field("resumeSilentTurns"),
|
|
1105
|
+
resumeCompletedTurns: this.form.field("resumeCompletedTurns"),
|
|
1106
|
+
continueTextLoop: this.form.field("continueTextLoop"),
|
|
1107
|
+
continueTextSilent: this.form.field("continueTextSilent"),
|
|
1067
1108
|
guardTools: this.form.field("guardTools"),
|
|
1068
1109
|
guardPendingText: this.form.field("guardPendingText"),
|
|
1069
1110
|
guardDoneText: this.form.field("guardDoneText"),
|
|
@@ -1465,6 +1506,71 @@ function AutoContinueSettingsCard(props) {
|
|
|
1465
1506
|
placeholder: t("default.continueTextMaxTokens"),
|
|
1466
1507
|
onReset: () => props.resetField("continueTextMaxTokens")
|
|
1467
1508
|
}
|
|
1509
|
+
),
|
|
1510
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1511
|
+
BooleanField,
|
|
1512
|
+
{
|
|
1513
|
+
wide: true,
|
|
1514
|
+
id: "auto-continue-resume-silent-turns",
|
|
1515
|
+
label: t("field.resumeSilentTurns"),
|
|
1516
|
+
hint: t("field.resumeSilentTurnsHint"),
|
|
1517
|
+
...shared,
|
|
1518
|
+
...state2.resumeSilentTurns,
|
|
1519
|
+
onEdit: (text) => props.edit("resumeSilentTurns", text),
|
|
1520
|
+
onReset: () => props.resetField("resumeSilentTurns")
|
|
1521
|
+
}
|
|
1522
|
+
),
|
|
1523
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1524
|
+
ValueField,
|
|
1525
|
+
{
|
|
1526
|
+
wide: true,
|
|
1527
|
+
id: "auto-continue-continue-text-silent",
|
|
1528
|
+
label: t("field.continueTextSilent"),
|
|
1529
|
+
hint: t("field.continueTextSilentHint"),
|
|
1530
|
+
...shared,
|
|
1531
|
+
...state2.continueTextSilent,
|
|
1532
|
+
onEdit: (text) => props.edit("continueTextSilent", text),
|
|
1533
|
+
placeholder: t("default.continueTextSilent"),
|
|
1534
|
+
onReset: () => props.resetField("continueTextSilent")
|
|
1535
|
+
}
|
|
1536
|
+
)
|
|
1537
|
+
]
|
|
1538
|
+
}
|
|
1539
|
+
),
|
|
1540
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1541
|
+
SettingsSection,
|
|
1542
|
+
{
|
|
1543
|
+
t,
|
|
1544
|
+
titleKey: "section.autoloop.title",
|
|
1545
|
+
descriptionKey: "section.autoloop.description",
|
|
1546
|
+
tone: "autoloop",
|
|
1547
|
+
children: [
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1549
|
+
BooleanField,
|
|
1550
|
+
{
|
|
1551
|
+
wide: true,
|
|
1552
|
+
id: "auto-continue-resume-completed-turns",
|
|
1553
|
+
label: t("field.resumeCompletedTurns"),
|
|
1554
|
+
hint: t("field.resumeCompletedTurnsHint"),
|
|
1555
|
+
...shared,
|
|
1556
|
+
...state2.resumeCompletedTurns,
|
|
1557
|
+
onEdit: (text) => props.edit("resumeCompletedTurns", text),
|
|
1558
|
+
onReset: () => props.resetField("resumeCompletedTurns")
|
|
1559
|
+
}
|
|
1560
|
+
),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1562
|
+
ValueField,
|
|
1563
|
+
{
|
|
1564
|
+
wide: true,
|
|
1565
|
+
id: "auto-continue-continue-text-loop",
|
|
1566
|
+
label: t("field.continueTextLoop"),
|
|
1567
|
+
hint: t("field.continueTextLoopHint"),
|
|
1568
|
+
...shared,
|
|
1569
|
+
...state2.continueTextLoop,
|
|
1570
|
+
onEdit: (text) => props.edit("continueTextLoop", text),
|
|
1571
|
+
placeholder: t("default.continueTextLoop"),
|
|
1572
|
+
onReset: () => props.resetField("continueTextLoop")
|
|
1573
|
+
}
|
|
1468
1574
|
)
|
|
1469
1575
|
]
|
|
1470
1576
|
}
|