dsh-client-auto-continue 0.14.3 → 0.16.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.
@@ -4,13 +4,15 @@
4
4
  * Since 0.8.0 the auto-continue ENGINE runs inside the host process (single
5
5
  * instance — see src/host/engine.ts), so this half only:
6
6
  * - registers the `auto-continue` settings card in the available plugin UI,
7
- * - adds a native composer switch backed by the same global pause setting,
7
+ * - adds a per-session composer mode selector backed by host settings,
8
8
  * - subscribes to the host status bridge (SSE) and shows browser
9
9
  * notifications with action buttons (Resume now / Pause 1h) via the bridge
10
10
  * action endpoint,
11
11
  * - feeds the card's stats / paused-sessions panels from the bridge state.
12
12
  */
13
13
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
14
+ // Type-only: the slot service is declared by the renderer in newer DSH SDKs.
15
+ import type {} from '@deepseek-ai/dsh-client-ui-renderer/client';
14
16
  // Type-only: pulls the locale plugin's Context merge (ctx.locale).
15
17
  import type {} from '@deepseek-ai/dsh-client-locale/client';
16
18
  // Type-only: pulls the settings-surface SlotMap merge and ctx.settingsScope.
@@ -67,6 +69,7 @@ export const inject = ['slots', 'locale'];
67
69
  export {
68
70
  pausedSessions,
69
71
  readTodayStats,
72
+ readRecoveryAttempts,
70
73
  resetTodayStats,
71
74
  unpauseSession,
72
75
  } from './bridge.ts';
@@ -151,7 +154,7 @@ function mountSettings(ctx: ClientContext, scope: SettingsScope<AutoContinueSett
151
154
  name: 'conversation.input.left',
152
155
  id: 'auto-continue',
153
156
  locale: NS,
154
- inject: () => controller.injectComposer(),
157
+ inject: (sessionId) => controller.injectComposer(sessionId),
155
158
  },
156
159
  AutoContinueComposerToggle,
157
160
  ),
@@ -36,11 +36,17 @@ export const zh = {
36
36
  'category.safety.description': '避免重复执行工具,识别并打断无效循环。',
37
37
  'category.status.title': '状态与日志',
38
38
  'category.status.description': '查看活动记录与暂停的会话。',
39
- 'field.paused': '自动继续',
40
- 'field.showComposerToggle': '在会话区显示自动继续开关',
41
- 'field.showComposerToggleHint': '默认显示。隐藏开关不会暂停自动继续;点击保存后生效。',
39
+ 'field.paused': '全局启用自动继续',
40
+ 'field.showComposerToggle': '在会话区显示模式选择',
41
+ 'field.showComposerToggleHint': '默认显示。隐藏控件不会改变会话模式;点击保存后生效。',
42
42
  'composer.label': '自动继续',
43
- 'composer.scope': '控制当前配置下所有会话的自动继续,修改立即保存。',
43
+ 'composer.scope': '只控制当前会话,立即保存并同步到其他标签页。关闭后也不再自动打断循环。',
44
+ 'composer.default': '跟随默认',
45
+ 'composer.off': '关闭',
46
+ 'composer.recover': '仅故障恢复',
47
+ 'composer.loop': '自主循环',
48
+ 'composer.paused': '全局已暂停',
49
+ 'composer.unavailable': '等待宿主连接',
44
50
  'composer.saving': '正在保存自动继续设置…',
45
51
  'composer.saveFailed': '保存失败,请重试',
46
52
  'field.pausedHint': '恢复意外中断的会话。关闭并保存后,全局暂停恢复并取消已排队的继续。循环守卫独立运行;如需停止自动打断,请同时关闭循环守卫。',
@@ -52,14 +58,17 @@ export const zh = {
52
58
  'default.continueTextMaxTokens': LOCALIZED_TEXT_DEFAULTS.zh.continueTextMaxTokens,
53
59
  'field.resumeSilentTurns': '续跑无输出回合',
54
60
  'field.resumeSilentTurnsHint': '已观察到模型活动但没有可见输出时续跑;不把空回合、图片或扩展内容误判为静默,冷却与连续上限照常生效。',
55
- 'field.resumeCompletedTurns': '自主循环(每个回合后都续跑)',
56
- 'field.resumeCompletedTurnsHint': '正常完成后经过宽限期自动续跑,不受恢复冷却和次数上限限制;仅有推理或显式无输出的回合仍消耗重试预算。暂停或关闭该选项可停止后续接力,手动停止或发送消息会取消当前待发送的继续提示。',
61
+ 'field.resumeCompletedTurns': '默认会话模式',
62
+ 'field.resumeCompletedTurnsHint': '用于没有单独设置模式的会话。仅故障恢复不会接力正常完成的回合;自主循环会在正常完成后继续。无输出和失败回合仍受重试预算约束。',
57
63
  'field.continueTextLoop': '自主循环的继续文本',
58
64
  'field.continueTextLoopHint': '自主循环每次续跑时发送的文本。',
59
65
  'default.continueTextLoop': LOCALIZED_TEXT_DEFAULTS.zh.continueTextLoop,
60
66
  'field.continueTextSilent': '无输出回合的继续文本',
61
67
  'field.continueTextSilentHint': '回合只输出推理就结束时自动发送的文本, 支持与继续文本相同的占位符。',
62
68
  'default.continueTextSilent': LOCALIZED_TEXT_DEFAULTS.zh.continueTextSilent,
69
+ 'field.continueTextInterrupted': '宿主重启后恢复的继续文本',
70
+ 'field.continueTextInterruptedHint': '启动扫描恢复重启中断的会话时发送的文本, 默认说明重启并提醒先核实再重试。',
71
+ 'default.continueTextInterrupted': LOCALIZED_TEXT_DEFAULTS.zh.continueTextInterrupted,
63
72
  'field.guardTools': '幂等护栏',
64
73
  'field.guardToolsHint': '续跑前检查上一步工具调用: 结果未确认时提示先确认状态, 已成功时提示不要重复执行, 避免重复 commit/调 API。',
65
74
  'field.guardPendingText': '结果未确认时的护栏文本',
@@ -75,7 +84,7 @@ export const zh = {
75
84
  'field.maxConsecutive': '最大连续次数',
76
85
  'field.maxConsecutiveHint': '连续恢复尝试上限;用户介入或观察到有可见输出的成功回合后清零。正常完成后的自主循环接力不计入。',
77
86
  'field.scanOnBoot': '启动恢复扫描',
78
- 'field.scanOnBootHint': '宿主启动后在扫描时间窗内等待延迟加载的中断会话,每个已就绪会话只检查一次。',
87
+ 'field.scanOnBootHint': '宿主启动后在扫描时间窗内等待延迟加载的中断会话,未重新加载的持久化会话也会被物化一并检查,每个已就绪会话只检查一次。',
79
88
  'field.scanLimit': '扫描会话数',
80
89
  'field.scanLimitHint': '每次扫描最多恢复多少个符合条件的会话,优先最近活动的会话。',
81
90
  'field.freshMs': '扫描时间窗 (ms)',
@@ -118,6 +127,18 @@ export const zh = {
118
127
  'stats.byCode': '按错误码统计',
119
128
  'stats.empty': '今天还没有自动继续记录。',
120
129
  'stats.reset': '清零',
130
+ 'recovery.title': '近期恢复尝试',
131
+ 'recovery.hint': '按会话汇总宿主最近 20 次恢复提示,重启插件后清空。正常自主续跑不计入。提示已发送不代表任务已完成;若反复恢复,请检查会话并考虑交接到新会话。',
132
+ 'recovery.empty': '尚无恢复尝试。',
133
+ 'recovery.count': '窗口内尝试',
134
+ 'recovery.consecutive': '最近发送时连续次数',
135
+ 'recovery.latest': '最近原因',
136
+ 'recovery.reason.error': '请求错误',
137
+ 'recovery.reason.max-tokens': '输出上限',
138
+ 'recovery.reason.silent': '无可见输出',
139
+ 'recovery.reason.interrupted': '宿主重启中断',
140
+ 'recovery.reason.loop-guard': '循环守卫',
141
+ 'recovery.reason.manual': '手动立即续跑',
121
142
  'pause.title': '已暂停会话',
122
143
  'pause.none': '没有暂停中的会话。',
123
144
  'pause.clearAll': '全部解除',
@@ -173,11 +194,17 @@ export const en: Record<SettingsCardKey, string> = {
173
194
  'category.safety.description': 'Avoid duplicate tool actions and break unproductive loops.',
174
195
  'category.status.title': 'Status and logs',
175
196
  'category.status.description': 'View activity and paused sessions.',
176
- 'field.paused': 'Auto-continue',
177
- 'field.showComposerToggle': 'Show auto-continue switch in the composer',
178
- 'field.showComposerToggleHint': 'Shown by default. Hiding the switch does not pause auto-continue. Click Save to apply.',
197
+ 'field.paused': 'Enable auto-continue globally',
198
+ 'field.showComposerToggle': 'Show session mode in the composer',
199
+ 'field.showComposerToggleHint': 'Shown by default. Hiding the control does not change session modes. Click Save to apply.',
179
200
  'composer.label': 'Auto-continue',
180
- 'composer.scope': 'Controls auto-continue for all sessions in this profile. Changes save immediately.',
201
+ 'composer.scope': 'Only affects this session. Saved immediately and synced across tabs. Off also disables loop-guard interruptions here.',
202
+ 'composer.default': 'Follow default',
203
+ 'composer.off': 'Off',
204
+ 'composer.recover': 'Recovery only',
205
+ 'composer.loop': 'Autonomous loop',
206
+ 'composer.paused': 'Globally paused',
207
+ 'composer.unavailable': 'Waiting for host',
181
208
  'composer.saving': 'Saving auto-continue setting…',
182
209
  'composer.saveFailed': 'Could not save. Try again.',
183
210
  'field.pausedHint': 'Resume interrupted sessions. Turn off and save to pause recovery globally and cancel queued continuations. The loop guard stays active; turn it off separately to stop automatic interruptions.',
@@ -189,14 +216,17 @@ export const en: Record<SettingsCardKey, string> = {
189
216
  'default.continueTextMaxTokens': LOCALIZED_TEXT_DEFAULTS.en.continueTextMaxTokens,
190
217
  'field.resumeSilentTurns': 'Resume silent turns',
191
218
  '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.',
192
- 'field.resumeCompletedTurns': 'Autonomous loop (continue after every turn)',
193
- 'field.resumeCompletedTurnsHint': 'Continue normal completions after grace, without the recovery cooldown or cap. Reasoning-only and explicit silent endings still consume the retry budget. Pause or disable this option to stop future handoffs; Stop or a manual message cancels the queued continuation.',
219
+ 'field.resumeCompletedTurns': 'Default session mode',
220
+ 'field.resumeCompletedTurnsHint': 'Applies to sessions without their own mode. Recovery only leaves normal completions alone; autonomous loop continues after them. Silent and failed turns still consume the retry budget.',
194
221
  'field.continueTextLoop': 'Continue text (autonomous loop)',
195
222
  'field.continueTextLoopHint': 'Text sent on each autonomous-loop continuation.',
196
223
  'default.continueTextLoop': LOCALIZED_TEXT_DEFAULTS.en.continueTextLoop,
197
224
  'field.continueTextSilent': 'Continue text (silent turn)',
198
225
  'field.continueTextSilentHint': 'Text sent when a turn ends with reasoning only; same placeholders as the continue text.',
199
226
  'default.continueTextSilent': LOCALIZED_TEXT_DEFAULTS.en.continueTextSilent,
227
+ 'field.continueTextInterrupted': 'Continue text (after harness restart)',
228
+ 'field.continueTextInterruptedHint': 'Text sent when the boot scan resumes a session interrupted by a restart; the default explains the restart and asks to verify before retrying.',
229
+ 'default.continueTextInterrupted': LOCALIZED_TEXT_DEFAULTS.en.continueTextInterrupted,
200
230
  'field.guardTools': 'Idempotency guard',
201
231
  '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.',
202
232
  'field.guardPendingText': 'Guard text (unconfirmed result)',
@@ -212,7 +242,7 @@ export const en: Record<SettingsCardKey, string> = {
212
242
  'field.maxConsecutive': 'Max consecutive',
213
243
  'field.maxConsecutiveHint': 'Consecutive recovery-attempt cap; resets on user intervention or an observed completion with visible output. Normal autonomous-loop handoffs are exempt.',
214
244
  'field.scanOnBoot': 'Scan on host startup',
215
- 'field.scanOnBootHint': 'Wait for delayed interrupted sessions during the startup scan window; inspect each settled session once.',
245
+ 'field.scanOnBootHint': 'Wait for delayed interrupted sessions during the startup scan window; persisted sessions the host never reloaded are materialized and inspected too; each settled session is inspected once.',
216
246
  'field.scanLimit': 'Scan limit',
217
247
  'field.scanLimitHint': 'Maximum eligible sessions to recover per pass, most recently active first.',
218
248
  'field.freshMs': 'Scan window (ms)',
@@ -255,6 +285,18 @@ export const en: Record<SettingsCardKey, string> = {
255
285
  'stats.byCode': 'By error code',
256
286
  'stats.empty': 'No auto-continue activity today.',
257
287
  'stats.reset': 'Reset',
288
+ 'recovery.title': 'Recent recovery attempts',
289
+ 'recovery.hint': 'Per-session counts from the last 20 recovery prompts across this host, cleared when the plugin restarts. Normal autonomous continuations are excluded. A sent prompt does not mean the task finished. If recovery keeps repeating, review the conversation and consider handing off to a fresh session.',
290
+ 'recovery.empty': 'No recovery attempts yet.',
291
+ 'recovery.count': 'Attempts in window',
292
+ 'recovery.consecutive': 'Consecutive at last send',
293
+ 'recovery.latest': 'Latest reason',
294
+ 'recovery.reason.error': 'Request error',
295
+ 'recovery.reason.max-tokens': 'Output limit',
296
+ 'recovery.reason.silent': 'No visible output',
297
+ 'recovery.reason.interrupted': 'Host restart interruption',
298
+ 'recovery.reason.loop-guard': 'Loop guard',
299
+ 'recovery.reason.manual': 'Manual resume',
258
300
  'pause.title': 'Paused sessions',
259
301
  'pause.none': 'No sessions paused.',
260
302
  'pause.clearAll': 'Clear all',
@@ -10,13 +10,17 @@
10
10
  import { useEffect, useId, useState } from 'react';
11
11
  import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
12
12
  import { DEFAULT_CONFIG, type AutoContinueSettings } from './engine.ts';
13
+ import type { SessionMode } from '../shared/core.ts';
13
14
  import type { ComposerToggleFace, ComposerToggleState } from './composer-toggle.tsx';
14
15
  import { NativeSwitch } from './native-switch.tsx';
15
16
  import { createSnapshotStore, type SettingsScope, type SnapshotStore } from './dsh-store-compat.ts';
16
17
  import {
17
18
  pausedSessions,
18
19
  readTodayStats,
20
+ readRecoveryAttempts,
21
+ readSessionPolicy,
19
22
  resetTodayStats,
23
+ setSessionMode,
20
24
  subscribeBridge,
21
25
  unpauseSession,
22
26
  } from './bridge.ts';
@@ -52,6 +56,7 @@ export interface AutoContinueSettingsCardState extends CardShell {
52
56
  resumeCompletedTurns: CardFieldState;
53
57
  continueTextLoop: CardFieldState;
54
58
  continueTextSilent: CardFieldState;
59
+ continueTextInterrupted: CardFieldState;
55
60
  guardTools: CardFieldState;
56
61
  guardPendingText: CardFieldState;
57
62
  guardDoneText: CardFieldState;
@@ -89,8 +94,9 @@ export class AutoContinueSettingsCardController {
89
94
  private readonly form: CardForm<AutoContinueSettings>;
90
95
  private readonly store: SnapshotStore<AutoContinueSettingsCardState>;
91
96
  private readonly composer: SnapshotStore<ComposerToggleState>;
92
- private composerSaving = false;
93
- private composerFailed = false;
97
+ private readonly composerSaving = new Set<string>();
98
+ private readonly composerFailed = new Set<string>();
99
+ private readonly stopComposer: () => void;
94
100
  private disposed = false;
95
101
  private saveSequence = 0;
96
102
  private notificationFeedback: SettingsCardKey | undefined;
@@ -111,6 +117,7 @@ export class AutoContinueSettingsCardController {
111
117
  booleanField('resumeCompletedTurns'),
112
118
  textField('continueTextLoop'),
113
119
  textField('continueTextSilent'),
120
+ textField('continueTextInterrupted'),
114
121
  booleanField('guardTools'),
115
122
  textField('guardPendingText'),
116
123
  textField('guardDoneText'),
@@ -136,6 +143,7 @@ export class AutoContinueSettingsCardController {
136
143
  ]);
137
144
  this.store = this.form.bind(() => this.projection(), createSnapshotStore);
138
145
  this.composer = this.form.bind(() => this.composerProjection(), createSnapshotStore);
146
+ this.stopComposer = subscribeBridge(() => this.composer.set(this.composerProjection()));
139
147
  }
140
148
 
141
149
  private projection(): AutoContinueSettingsCardState {
@@ -151,6 +159,7 @@ export class AutoContinueSettingsCardController {
151
159
  resumeCompletedTurns: this.form.field('resumeCompletedTurns'),
152
160
  continueTextLoop: this.form.field('continueTextLoop'),
153
161
  continueTextSilent: this.form.field('continueTextSilent'),
162
+ continueTextInterrupted: this.form.field('continueTextInterrupted'),
154
163
  guardTools: this.form.field('guardTools'),
155
164
  guardPendingText: this.form.field('guardPendingText'),
156
165
  guardDoneText: this.form.field('guardDoneText'),
@@ -204,33 +213,33 @@ export class AutoContinueSettingsCardController {
204
213
  this.store.set(this.projection());
205
214
  }
206
215
 
207
- injectComposer(): ComposerToggleFace {
208
- return { hooks: { autoContinueComposer: this.composer }, setEnabled: (enabled) => void this.setEnabled(enabled) };
216
+ injectComposer(sessionId: string): ComposerToggleFace {
217
+ return { hooks: { autoContinueComposer: this.composer }, sessionId, setMode: (mode) => void this.setMode(sessionId, mode) };
209
218
  }
210
219
 
211
220
  private composerProjection(): ComposerToggleState {
212
221
  const snapshot = this.scope.getSnapshot();
222
+ const policy = readSessionPolicy();
213
223
  return {
214
224
  visible: snapshot.status === 'ready' && (snapshot.value?.showComposerToggle ?? DEFAULT_CONFIG.showComposerToggle),
215
- enabled: !(snapshot.value?.paused ?? DEFAULT_CONFIG.paused),
216
- writable: canWriteSettings(snapshot),
217
- saving: this.composerSaving,
218
- failed: this.composerFailed,
225
+ policy,
226
+ writable: canWriteSettings(snapshot) && policy?.writable === true,
227
+ saving: new Set(this.composerSaving),
228
+ failed: new Set(this.composerFailed),
219
229
  };
220
230
  }
221
231
 
222
- private async setEnabled(enabled: boolean): Promise<void> {
223
- if (this.disposed || this.composerSaving || !this.composerProjection().writable) return;
224
- this.composerSaving = true;
225
- this.composerFailed = false;
232
+ private async setMode(sessionId: string, mode: SessionMode): Promise<void> {
233
+ if (this.disposed || !sessionId || this.composerSaving.has(sessionId) || !this.composerProjection().writable) return;
234
+ this.composerSaving.add(sessionId);
235
+ this.composerFailed.delete(sessionId);
226
236
  this.composer.set(this.composerProjection());
227
237
  try {
228
- const result = await this.scope.set('paused', !enabled);
229
- this.composerFailed = result === false || this.composerProjection().enabled !== enabled;
238
+ await setSessionMode(sessionId, mode);
230
239
  } catch {
231
- this.composerFailed = true;
240
+ this.composerFailed.add(sessionId);
232
241
  } finally {
233
- this.composerSaving = false;
242
+ this.composerSaving.delete(sessionId);
234
243
  if (!this.disposed) this.composer.set(this.composerProjection());
235
244
  }
236
245
  }
@@ -238,6 +247,7 @@ export class AutoContinueSettingsCardController {
238
247
  /** Release this card's subscription to the provider-owned settings form. */
239
248
  dispose(): void {
240
249
  this.disposed = true;
250
+ this.stopComposer();
241
251
  this.form.dispose();
242
252
  }
243
253
  }
@@ -262,7 +272,7 @@ const groups = [
262
272
  { id: 'general', fields: ['paused', 'showComposerToggle', 'resumeSilentTurns', 'resumeCompletedTurns', 'notify'] },
263
273
  { id: 'recovery', fields: ['graceMs', 'cooldownMs', 'maxConsecutive', 'classify', 'retryableErrorPatterns', 'backoffFactor', 'backoffMaxMs'] },
264
274
  { id: 'startup', fields: ['scanOnBoot', 'scanLimit', 'freshMs'] },
265
- { id: 'prompts', fields: ['continueText', 'continueTextMaxTokens', 'continueTextSilent', 'continueTextLoop', 'guardPendingText', 'guardDoneText', 'loopText'] },
275
+ { id: 'prompts', fields: ['continueText', 'continueTextMaxTokens', 'continueTextSilent', 'continueTextInterrupted', 'continueTextLoop', 'guardPendingText', 'guardDoneText', 'loopText'] },
266
276
  { id: 'safety', fields: ['guardTools', 'loopGuard', 'loopShortChars', 'loopWindowMs', 'loopShortCount', 'loopRepeatText', 'loopToolRepeat'] },
267
277
  { id: 'status', fields: ['verbose'] },
268
278
  ] as const satisfies ReadonlyArray<{ id: string; fields: readonly FieldName[] }>;
@@ -270,6 +280,7 @@ type Category = typeof groups[number]['id'];
270
280
  const textDefaults: Partial<Record<FieldName, SettingsCardKey>> = {
271
281
  continueText: 'default.continueText', continueTextMaxTokens: 'default.continueTextMaxTokens',
272
282
  continueTextSilent: 'default.continueTextSilent', continueTextLoop: 'default.continueTextLoop',
283
+ continueTextInterrupted: 'default.continueTextInterrupted',
273
284
  guardPendingText: 'default.guardPendingText', guardDoneText: 'default.guardDoneText', loopText: 'default.loopText',
274
285
  };
275
286
 
@@ -307,7 +318,10 @@ function SettingField({ name, id, state, actions, disabled, t }: {
307
318
  </div>
308
319
  <div className="dshAcFieldControl">
309
320
  {state.overridden && <button type="button" className="dshAcReset" disabled={disabled} aria-label={`${t('chrome.reset')}: ${label}`} onClick={() => actions.resetField(name)}>{t('chrome.reset')}</button>}
310
- {boolean ? <span className="dshAcSwitchTarget"><NativeSwitch label={label} title={hint} disabled={disabled}
321
+ {name === 'resumeCompletedTurns' ? <select id={id} className="dshAcMode" aria-label={label} aria-describedby={`${id}-hint`}
322
+ disabled={disabled} value={String(value)} onChange={event => actions.edit(name, event.target.value)}>
323
+ <option value="false">{t('composer.recover')}</option><option value="true">{t('composer.loop')}</option>
324
+ </select> : boolean ? <span className="dshAcSwitchTarget"><NativeSwitch label={label} title={hint} disabled={disabled}
311
325
  checked={name === 'paused' ? !value : Boolean(value)} onChange={checked => actions.edit(name, String(name === 'paused' ? !checked : checked))} /></span>
312
326
  : numeric ? <input {...common} className="dshAcInput dshAcNumber" type="text" inputMode="numeric" placeholder={placeholder} />
313
327
  : <textarea {...common} className="dshAcInput dshAcTextArea" rows={name === 'retryableErrorPatterns' ? 3 : 2} placeholder={placeholder} />}
@@ -334,6 +348,8 @@ function LivePanels(props: { t: (key: SettingsCardKey) => string }) {
334
348
  .sort((a, b) => b[1] - a[1])
335
349
  .slice(0, 5);
336
350
  const paused = pausedSessions();
351
+ const attempts = readRecoveryAttempts();
352
+ const sessions = [...new Set(attempts.map(attempt => attempt.sessionId))];
337
353
  return (
338
354
  <>
339
355
  <section className="dshAcPanel">
@@ -377,6 +393,30 @@ function LivePanels(props: { t: (key: SettingsCardKey) => string }) {
377
393
  </>
378
394
  )}
379
395
  </section>
396
+ <section className="dshAcPanel">
397
+ <div className="dshAcPanelHead">
398
+ <span className="dshAcPanelTitle">{t('recovery.title')}</span>
399
+ </div>
400
+ <p className="dshAcHint">{t('recovery.hint')}</p>
401
+ {sessions.length === 0 ? <p className="dshAcHint">{t('recovery.empty')}</p> : (
402
+ <ul className="dshAcPauseList">
403
+ {sessions.map(sessionId => {
404
+ const recent = attempts.filter(attempt => attempt.sessionId === sessionId);
405
+ const latest = recent[0]!;
406
+ return (
407
+ <li key={sessionId}>
408
+ <div className="dshAcRecovery">
409
+ <span className="dshAcPauseId">{sessionId}</span>
410
+ <span>{t('recovery.count')}: {recent.length} · {t('recovery.consecutive')}: {latest.consecutive}</span>
411
+ <span>{t('recovery.latest')}: {t(`recovery.reason.${latest.reason}`)}</span>
412
+ <time className="dshAcHint" dateTime={new Date(latest.at).toISOString()}>{new Date(latest.at).toLocaleString()}</time>
413
+ </div>
414
+ </li>
415
+ );
416
+ })}
417
+ </ul>
418
+ )}
419
+ </section>
380
420
  <section className="dshAcPanel">
381
421
  <div className="dshAcPanelHead">
382
422
  <span className="dshAcPanelTitle">{t('pause.title')}</span>
@@ -6,7 +6,10 @@
6
6
  */
7
7
 
8
8
  const css = `
9
- .dshAcComposer { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; flex: 0 0 auto; font: inherit; }
9
+ .dshAcComposer { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 32px; max-width: 100%; font: inherit; }
10
+ .dshAcMode { min-height: 32px; max-width: 100%; padding: 4px 6px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 6px; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; }
11
+ .dshAcMode:disabled { opacity: .5; }
12
+ .dshAcMode:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
10
13
  .dshAcComposerLabel { color: var(--dsw-alias-label-secondary); font-size: 12px; white-space: nowrap; }
11
14
  .dshAcSwitchTarget { display: inline-flex; align-items: center; min-height: 32px; }
12
15
  .dshAcSwitchTarget > button { position: relative; }
@@ -104,6 +107,7 @@ const css = `
104
107
  .dshAcPauseList { list-style: none; margin: 0; padding: 0; }
105
108
  .dshAcPauseList li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
106
109
  .dshAcPauseId { flex: 1; font: 12px ui-monospace, SFMono-Regular, monospace; }
110
+ .dshAcRecovery { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
107
111
  @container auto-continue-settings (max-width: 760px) {
108
112
  .dshAcHeaderFrame { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
109
113
  .dshAcRepositoryCopy { display: none; }