dsh-client-auto-continue 0.13.0 → 0.14.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.
@@ -2,23 +2,33 @@
2
2
  export declare const zh: {
3
3
  'card.title': string;
4
4
  'card.description': string;
5
- 'flow.interrupted': string;
6
- 'flow.grace': string;
7
- 'flow.continue': string;
8
5
  'repo.star': string;
6
+ 'repo.note': string;
7
+ 'repo.link': string;
9
8
  'repo.aria': string;
10
- 'section.handoff.title': string;
11
- 'section.handoff.description': string;
12
- 'section.autoloop.title': string;
13
- 'section.autoloop.description': string;
14
- 'section.safety.title': string;
15
- 'section.safety.description': string;
16
- 'section.recovery.title': string;
17
- 'section.recovery.description': string;
18
- 'section.loop.title': string;
19
- 'section.loop.description': string;
20
- 'section.live.title': string;
21
- 'section.live.description': string;
9
+ 'chrome.enabled': string;
10
+ 'chrome.paused': string;
11
+ 'chrome.saved': string;
12
+ 'notification.title': string;
13
+ 'notification.enabled': string;
14
+ 'notification.disabled': string;
15
+ 'notification.saved': string;
16
+ 'notification.blocked': string;
17
+ 'notification.unsupported': string;
18
+ 'notification.failed': string;
19
+ 'chrome.categories': string;
20
+ 'category.general.title': string;
21
+ 'category.general.description': string;
22
+ 'category.recovery.title': string;
23
+ 'category.recovery.description': string;
24
+ 'category.startup.title': string;
25
+ 'category.startup.description': string;
26
+ 'category.prompts.title': string;
27
+ 'category.prompts.description': string;
28
+ 'category.safety.title': string;
29
+ 'category.safety.description': string;
30
+ 'category.status.title': string;
31
+ 'category.status.description': string;
22
32
  'field.paused': string;
23
33
  'field.showComposerToggle': string;
24
34
  'field.showComposerToggleHint': string;
@@ -2,9 +2,14 @@ import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
2
2
  import { type AutoContinueSettings } from './engine.ts';
3
3
  import type { ComposerToggleFace } from './composer-toggle.tsx';
4
4
  import { type SettingsScope, type SnapshotStore } from './dsh-store-compat.ts';
5
+ import type { SettingsCardKey } from './locales.ts';
5
6
  import { type CardActions, type CardFieldState, type CardShell } from './settings-form.ts';
6
7
  /** What the auto-continue card renders. */
7
8
  export interface AutoContinueSettingsCardState extends CardShell {
9
+ /** Committed global state; a staged edit does not pause the engine yet. */
10
+ enabled: boolean;
11
+ /** Feedback for the last local save, including browser permission problems. */
12
+ notificationFeedback: SettingsCardKey | undefined;
8
13
  paused: CardFieldState;
9
14
  showComposerToggle: CardFieldState;
10
15
  continueText: CardFieldState;
@@ -46,22 +51,26 @@ export interface AutoContinueSettingsCardFace extends CardActions {
46
51
  /** Bridges the `auto-continue` scope onto the card's staged form. */
47
52
  export declare class AutoContinueSettingsCardController {
48
53
  private readonly scope;
54
+ private readonly getLocale;
49
55
  private readonly form;
50
56
  private readonly store;
51
57
  private readonly composer;
52
58
  private composerSaving;
53
59
  private composerFailed;
54
60
  private disposed;
61
+ private saveSequence;
62
+ private notificationFeedback;
55
63
  /**
56
64
  * @param scope - the bound settings scope for the `auto-continue` namespace.
57
65
  */
58
- constructor(scope: SettingsScope<AutoContinueSettings>);
66
+ constructor(scope: SettingsScope<AutoContinueSettings>, getLocale: () => string);
59
67
  private projection;
60
68
  /**
61
69
  * Build the face the card's slot registration injects.
62
70
  * @returns the card's snapshot and its form actions.
63
71
  */
64
72
  inject(): AutoContinueSettingsCardFace;
73
+ private save;
65
74
  injectComposer(): ComposerToggleFace;
66
75
  private composerProjection;
67
76
  private setEnabled;
@@ -72,9 +81,5 @@ export declare class AutoContinueSettingsCardController {
72
81
  export type AutoContinueSettingsCardProps = PropsLocale<'auto-continue'> & InjectFace<AutoContinueSettingsCardFace>;
73
82
  /** The bundle page supplies no list container, unlike the legacy settings slot. */
74
83
  export declare function AutoContinueSettingsPage(props: AutoContinueSettingsCardProps): import("react").JSX.Element;
75
- /**
76
- * Render the auto-continue card.
77
- * @param props - locale copy, the card snapshot, and its form actions.
78
- * @returns the card.
79
- */
80
- export declare function AutoContinueSettingsCard(props: AutoContinueSettingsCardProps): import("react").JSX.Element;
84
+ /** Native category layout, with the selected B3 repository invitation beside the introduction. */
85
+ export declare function AutoContinueSettingsCard(props: AutoContinueSettingsCardProps): import("react").JSX.Element | null;
@@ -104,9 +104,9 @@ export declare class CardForm<T> {
104
104
  actions(): CardActions;
105
105
  /**
106
106
  * Write every staged edit, then re-seed from what the Host accepted.
107
- * @returns settlement after every write and the read-back.
107
+ * @returns true only when a non-empty save was accepted and read back.
108
108
  */
109
- save(): Promise<void>;
109
+ save(): Promise<boolean>;
110
110
  /**
111
111
  * Every staged edit a save would write. An entry whose draft is not a value
112
112
  * its field accepts carries no write: the form is still dirty, and the save
@@ -0,0 +1,8 @@
1
+ import { type SettingsCardKey } from './locales.ts';
2
+ type Permission = NotificationPermission | 'unsupported' | 'failed';
3
+ export type SettingsNotice = 'enabled' | 'disabled' | 'saved';
4
+ /** Called directly by Save, before a network await can consume user activation. */
5
+ export declare function prepareSettingsNotification(enabled: boolean): Promise<Permission>;
6
+ /** The save is already committed. Notification failures must never undo it. */
7
+ export declare function showSettingsNotification(notice: SettingsNotice, locale: string, permission: Permission): SettingsCardKey;
8
+ export {};
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 a localized continue prompt when a request is interrupted by network errors or other non-human causes",
4
- "version": "0.13.0",
4
+ "version": "0.14.0",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  "watch": "node build.mjs --watch",
48
48
  "typecheck": "tsc --noEmit",
49
49
  "test:runtime": "node tests/settings-host-live.mjs 0.1.7 && node tests/settings-host-live.mjs 0.2.0 && node tests/settings-host-live.mjs 0.2.1 && node tests/profile-compatibility.mjs 0.2.0 && node tests/profile-compatibility.mjs 0.2.1 && node tests/client-settings-services.mjs 0.2.0 && node tests/client-settings-services.mjs 0.2.1",
50
- "test": "node tests/scan-on-boot.mjs && node tests/silent-turn-boundaries.mjs && node tests/autonomous-loop.mjs && node tests/manual-resume-pauses.mjs && node tests/stats-freshness.mjs && node tests/simulate-host.mjs && node tests/settings-host-compat.mjs && node tests/simulate-client-loader.mjs && node tests/client-settings-services.mjs && node tests/client-settings-form.mjs && node tests/locale-mirror-bounded.mjs && node tests/settings-card-ui.mjs && node tests/composer-toggle.mjs && node tests/prepare-github-package.mjs",
50
+ "test": "node tests/scan-on-boot.mjs && node tests/silent-turn-boundaries.mjs && node tests/autonomous-loop.mjs && node tests/manual-resume-pauses.mjs && node tests/stats-freshness.mjs && node tests/simulate-host.mjs && node tests/settings-host-compat.mjs && node tests/simulate-client-loader.mjs && node tests/client-settings-services.mjs && node tests/client-settings-form.mjs && node tests/locale-mirror-bounded.mjs && node tests/settings-card-ui.mjs && node tests/composer-toggle.mjs && node tests/settings-notifications.mjs && node tests/prepare-github-package.mjs",
51
51
  "prepack": "npm run build"
52
52
  },
53
53
  "keywords": [
@@ -141,7 +141,7 @@ function mountSettings(ctx: ClientContext, scope: SettingsScope<AutoContinueSett
141
141
  ctx.on('locale/change', syncLocale);
142
142
  syncLocale();
143
143
 
144
- const controller = new AutoContinueSettingsCardController(scope);
144
+ const controller = new AutoContinueSettingsCardController(scope, () => ctx.locale.getLocale().active);
145
145
  ctx.effect(() => () => controller.dispose(), 'auto-continue: settings form');
146
146
 
147
147
  ctx.slots.inject('conversation.input.left', () =>
@@ -8,32 +8,42 @@ import { LOCALIZED_TEXT_DEFAULTS } from '../shared/core.ts';
8
8
  /** 简体中文词典(键集的事实来源)。 */
9
9
  export const zh = {
10
10
  'card.title': '自动继续',
11
- 'card.description': '接住意外中断的请求,等现场稳定下来,再把对话交还给 Agent。',
12
- 'flow.interrupted': '检测中断',
13
- 'flow.grace': '安全等待',
14
- 'flow.continue': '发送继续',
15
- 'repo.star': '去 GitHub 点 Star',
16
- 'repo.aria': '打开 dsh-auto-continue 的 GitHub 开源地址并点 Star',
17
- 'section.handoff.title': '接力方式',
18
- 'section.handoff.description': '决定中断后说什么,以及什么时候暂时停手。',
19
- 'section.autoloop.title': '自主循环',
20
- 'section.autoloop.description': '每个回合结束后自动把对话交还给 Agent,直到手动停止。',
21
- 'section.safety.title': '安全节奏',
22
- 'section.safety.description': '先确认上一步,再控制等待与连续续跑的边界。',
23
- 'section.recovery.title': '恢复雷达',
24
- 'section.recovery.description': '扫描掉线会话,识别可恢复错误并逐步退避。',
25
- 'section.loop.title': '循环断路器',
26
- 'section.loop.description': '发现空转时及时换路,而不是让 Agent 原地消耗。',
27
- 'section.live.title': '现场状态',
28
- 'section.live.description': '看看今天接住了多少次,以及哪些会话还在暂停。',
29
- 'field.paused': '暂停自动继续',
11
+ 'card.description': '恢复意外中断的会话,按你的节奏继续。',
12
+ 'repo.star': '觉得好用的话,点个 Star 吧',
13
+ 'repo.note': 'HsiangNianian 的开源插件,也欢迎反馈和 PR。',
14
+ 'repo.link': 'GitHub 仓库',
15
+ 'repo.aria': '在新标签页打开 HsiangNianian/dsh-auto-continue 的 GitHub 仓库',
16
+ 'chrome.enabled': '已启用',
17
+ 'chrome.paused': '已暂停',
18
+ 'chrome.saved': '所有更改已保存',
19
+ 'notification.title': '自动继续设置',
20
+ 'notification.enabled': '设置已保存,浏览器通知已开启。',
21
+ 'notification.disabled': '设置已保存,浏览器通知已关闭。',
22
+ 'notification.saved': '自动继续的设置已保存。',
23
+ 'notification.blocked': '设置已保存,但浏览器尚未允许通知。请在此网站的权限设置中允许通知。',
24
+ 'notification.unsupported': '设置已保存,当前浏览器不支持通知。',
25
+ 'notification.failed': '设置已保存,但浏览器通知未能发出。请检查网站和系统的通知权限。',
26
+ 'chrome.categories': '设置类别',
27
+ 'category.general.title': '常规',
28
+ 'category.general.description': '控制自动继续的启停、显示和通知。',
29
+ 'category.recovery.title': '重试策略',
30
+ 'category.recovery.description': '设置等待时间、次数上限和错误分类。',
31
+ 'category.startup.title': '启动恢复',
32
+ 'category.startup.description': 'DSH 重启后,找回最近中断的会话。',
33
+ 'category.prompts.title': '继续文本',
34
+ 'category.prompts.description': '留空使用内置文案,跟随 DSH 的界面语言。',
35
+ 'category.safety.title': '安全保护',
36
+ 'category.safety.description': '避免重复执行工具,识别并打断无效循环。',
37
+ 'category.status.title': '状态与日志',
38
+ 'category.status.description': '查看活动记录与暂停的会话。',
39
+ 'field.paused': '自动继续',
30
40
  'field.showComposerToggle': '在会话区显示自动继续开关',
31
41
  'field.showComposerToggleHint': '默认显示。隐藏开关不会暂停自动继续;点击保存后生效。',
32
42
  'composer.label': '自动继续',
33
43
  'composer.scope': '控制当前配置下所有会话的自动继续,修改立即保存。',
34
44
  'composer.saving': '正在保存自动继续设置…',
35
45
  'composer.saveFailed': '保存失败,请重试',
36
- 'field.pausedHint': '全局暂停: 实时与扫描都不会再自动发送, 已排队的待发送也会取消。',
46
+ 'field.pausedHint': '恢复意外中断的会话。关闭并保存后,全局暂停恢复并取消已排队的继续。',
37
47
  'field.continueText': '继续文本',
38
48
  'field.continueTextHint': '中断后自动发送的消息内容。',
39
49
  'default.continueText': LOCALIZED_TEXT_DEFAULTS.zh.continueText,
@@ -82,7 +92,7 @@ export const zh = {
82
92
  'field.backoffMaxMs': '最大退避间隔 (ms)',
83
93
  'field.backoffMaxMsHint': '自适应退避的上限, 防止等待过久。',
84
94
  'field.notify': '浏览器通知',
85
- 'field.notifyHint': '自动继续成功/放弃/遇到永久性错误时弹出浏览器通知, 通知带「立即续跑」与「暂停该会话 1 小时」按钮。',
95
+ 'field.notifyHint': '开启后,自动继续事件和配置保存成功时会通知。切换此选项并保存后也会确认状态;首次开启需允许浏览器通知。',
86
96
  'stats.title': '今日统计',
87
97
  'stats.sent': '自动继续',
88
98
  'stats.skipped': '跳过(永久错误)',
@@ -135,32 +145,42 @@ export type SettingsCardKey = keyof typeof zh;
135
145
  /** English dictionary, checked complete against the zh key set. */
136
146
  export const en: Record<SettingsCardKey, string> = {
137
147
  'card.title': 'Auto continue',
138
- 'card.description': 'Catches an interrupted request, waits for things to settle, then hands the thread back to the agent.',
139
- 'flow.interrupted': 'Interrupted',
140
- 'flow.grace': 'Safe pause',
141
- 'flow.continue': 'Continue',
142
- 'repo.star': 'Star on GitHub',
143
- 'repo.aria': 'Open the dsh-auto-continue repository on GitHub and star it',
144
- 'section.handoff.title': 'The handoff',
145
- 'section.handoff.description': 'Choose what gets sent after an interruption and when the relay should stand down.',
146
- 'section.autoloop.title': 'Autonomous loop',
147
- 'section.autoloop.description': 'Hand the thread back after every completed turn until manually stopped.',
148
- 'section.safety.title': 'Safety rhythm',
149
- 'section.safety.description': 'Confirm the previous step, then set the boundaries for waiting and repeated resumes.',
150
- 'section.recovery.title': 'Recovery radar',
151
- 'section.recovery.description': 'Find dropped sessions, recognize recoverable errors, and back off gracefully.',
152
- 'section.loop.title': 'Loop breaker',
153
- 'section.loop.description': 'Spot a spinning agent and route it forward before it burns time in place.',
154
- 'section.live.title': 'Live signal',
155
- 'section.live.description': 'See what the relay caught today and which sessions are still paused.',
156
- 'field.paused': 'Pause auto-continue',
148
+ 'card.description': 'Resume interrupted sessions, at your pace.',
149
+ 'repo.star': 'Finding it useful? Leave a Star',
150
+ 'repo.note': 'By HsiangNianian. Feedback and PRs welcome.',
151
+ 'repo.link': 'GitHub repo',
152
+ 'repo.aria': 'Open HsiangNianian/dsh-auto-continue on GitHub in a new tab',
153
+ 'chrome.enabled': 'Enabled',
154
+ 'chrome.paused': 'Paused',
155
+ 'chrome.saved': 'All changes saved',
156
+ 'notification.title': 'Auto-continue settings',
157
+ 'notification.enabled': 'Settings saved. Browser notifications are on.',
158
+ 'notification.disabled': 'Settings saved. Browser notifications are off.',
159
+ 'notification.saved': 'Your auto-continue settings have been saved.',
160
+ 'notification.blocked': 'Settings saved, but browser notifications are not allowed. Allow notifications in this site’s permissions.',
161
+ 'notification.unsupported': 'Settings saved. This browser does not support notifications.',
162
+ 'notification.failed': 'Settings saved, but the notification could not be sent. Check notification permissions for this site and your system.',
163
+ 'chrome.categories': 'Settings categories',
164
+ 'category.general.title': 'General',
165
+ 'category.general.description': 'Control automatic recovery, visibility, and notifications.',
166
+ 'category.recovery.title': 'Retry strategy',
167
+ 'category.recovery.description': 'Set wait times, retry limits, and error classification.',
168
+ 'category.startup.title': 'Startup recovery',
169
+ 'category.startup.description': 'Find recently interrupted sessions when DSH restarts.',
170
+ 'category.prompts.title': 'Continue text',
171
+ 'category.prompts.description': 'Leave blank for built-in text in the current DSH language.',
172
+ 'category.safety.title': 'Safety',
173
+ 'category.safety.description': 'Avoid duplicate tool actions and break unproductive loops.',
174
+ 'category.status.title': 'Status and logs',
175
+ 'category.status.description': 'View activity and paused sessions.',
176
+ 'field.paused': 'Auto-continue',
157
177
  'field.showComposerToggle': 'Show auto-continue switch in the composer',
158
178
  'field.showComposerToggleHint': 'Shown by default. Hiding the switch does not pause auto-continue. Click Save to apply.',
159
179
  'composer.label': 'Auto-continue',
160
180
  'composer.scope': 'Controls auto-continue for all sessions in this profile. Changes save immediately.',
161
181
  'composer.saving': 'Saving auto-continue setting…',
162
182
  'composer.saveFailed': 'Could not save. Try again.',
163
- 'field.pausedHint': 'Globally pause: no live or scan auto-send fires, and queued pending sends are cancelled.',
183
+ 'field.pausedHint': 'Resume interrupted sessions. Turn off and save to pause recovery globally and cancel queued continuations.',
164
184
  'field.continueText': 'Continue text',
165
185
  'field.continueTextHint': 'Message automatically sent after an interruption.',
166
186
  'default.continueText': LOCALIZED_TEXT_DEFAULTS.en.continueText,
@@ -209,7 +229,7 @@ export const en: Record<SettingsCardKey, string> = {
209
229
  'field.backoffMaxMs': 'Max backoff (ms)',
210
230
  'field.backoffMaxMsHint': 'Cap on the adaptive backoff interval.',
211
231
  'field.notify': 'Browser notifications',
212
- 'field.notifyHint': 'Notify when auto-continue fires, gives up, or hits a permanent error; notifications carry "Resume now" and "Pause this session 1h" buttons.',
232
+ 'field.notifyHint': 'Notify about auto-continue events and successful settings saves. Saving a change to this option also confirms its state. Allow browser notifications when first enabling it.',
213
233
  'stats.title': "Today's stats",
214
234
  'stats.sent': 'Auto-continued',
215
235
  'stats.skipped': 'Skipped (permanent)',