dsh-client-auto-continue 0.13.0 → 0.14.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/lib/client.js CHANGED
@@ -90,32 +90,42 @@ var ECHO_WINDOW_MS = 10 * 60 * 1e3;
90
90
  // src/client/locales.ts
91
91
  var zh = {
92
92
  "card.title": "自动继续",
93
- "card.description": "接住意外中断的请求,等现场稳定下来,再把对话交还给 Agent。",
94
- "flow.interrupted": "检测中断",
95
- "flow.grace": "安全等待",
96
- "flow.continue": "发送继续",
97
- "repo.star": "去 GitHub 点 Star",
98
- "repo.aria": "打开 dsh-auto-continue 的 GitHub 开源地址并点 Star",
99
- "section.handoff.title": "接力方式",
100
- "section.handoff.description": "决定中断后说什么,以及什么时候暂时停手。",
101
- "section.autoloop.title": "自主循环",
102
- "section.autoloop.description": "每个回合结束后自动把对话交还给 Agent,直到手动停止。",
103
- "section.safety.title": "安全节奏",
104
- "section.safety.description": "先确认上一步,再控制等待与连续续跑的边界。",
105
- "section.recovery.title": "恢复雷达",
106
- "section.recovery.description": "扫描掉线会话,识别可恢复错误并逐步退避。",
107
- "section.loop.title": "循环断路器",
108
- "section.loop.description": "发现空转时及时换路,而不是让 Agent 原地消耗。",
109
- "section.live.title": "现场状态",
110
- "section.live.description": "看看今天接住了多少次,以及哪些会话还在暂停。",
111
- "field.paused": "暂停自动继续",
93
+ "card.description": "恢复意外中断的会话,按你的节奏继续。",
94
+ "repo.star": "觉得好用的话,点个 Star 吧",
95
+ "repo.note": "HsiangNianian 的开源插件,也欢迎反馈和 PR。",
96
+ "repo.link": "GitHub 仓库",
97
+ "repo.aria": "在新标签页打开 HsiangNianian/dsh-auto-continue 的 GitHub 仓库",
98
+ "chrome.enabled": "已启用",
99
+ "chrome.paused": "已暂停",
100
+ "chrome.saved": "所有更改已保存",
101
+ "notification.title": "自动继续设置",
102
+ "notification.enabled": "设置已保存,浏览器通知已开启。",
103
+ "notification.disabled": "设置已保存,浏览器通知已关闭。",
104
+ "notification.saved": "自动继续的设置已保存。",
105
+ "notification.blocked": "设置已保存,但浏览器尚未允许通知。请在此网站的权限设置中允许通知。",
106
+ "notification.unsupported": "设置已保存,当前浏览器不支持通知。",
107
+ "notification.failed": "设置已保存,但浏览器通知未能发出。请检查网站和系统的通知权限。",
108
+ "chrome.categories": "设置类别",
109
+ "category.general.title": "常规",
110
+ "category.general.description": "控制自动继续的启停、显示和通知。",
111
+ "category.recovery.title": "重试策略",
112
+ "category.recovery.description": "设置等待时间、次数上限和错误分类。",
113
+ "category.startup.title": "启动恢复",
114
+ "category.startup.description": "DSH 重启后,找回最近中断的会话。",
115
+ "category.prompts.title": "继续文本",
116
+ "category.prompts.description": "留空使用内置文案,跟随 DSH 的界面语言。",
117
+ "category.safety.title": "安全保护",
118
+ "category.safety.description": "避免重复执行工具,识别并打断无效循环。",
119
+ "category.status.title": "状态与日志",
120
+ "category.status.description": "查看活动记录与暂停的会话。",
121
+ "field.paused": "自动继续",
112
122
  "field.showComposerToggle": "在会话区显示自动继续开关",
113
123
  "field.showComposerToggleHint": "默认显示。隐藏开关不会暂停自动继续;点击保存后生效。",
114
124
  "composer.label": "自动继续",
115
125
  "composer.scope": "控制当前配置下所有会话的自动继续,修改立即保存。",
116
126
  "composer.saving": "正在保存自动继续设置…",
117
127
  "composer.saveFailed": "保存失败,请重试",
118
- "field.pausedHint": "全局暂停: 实时与扫描都不会再自动发送, 已排队的待发送也会取消。",
128
+ "field.pausedHint": "恢复意外中断的会话。关闭并保存后,全局暂停恢复并取消已排队的继续。",
119
129
  "field.continueText": "继续文本",
120
130
  "field.continueTextHint": "中断后自动发送的消息内容。",
121
131
  "default.continueText": LOCALIZED_TEXT_DEFAULTS.zh.continueText,
@@ -164,7 +174,7 @@ var zh = {
164
174
  "field.backoffMaxMs": "最大退避间隔 (ms)",
165
175
  "field.backoffMaxMsHint": "自适应退避的上限, 防止等待过久。",
166
176
  "field.notify": "浏览器通知",
167
- "field.notifyHint": "自动继续成功/放弃/遇到永久性错误时弹出浏览器通知, 通知带「立即续跑」与「暂停该会话 1 小时」按钮。",
177
+ "field.notifyHint": "开启后,自动继续事件和配置保存成功时会通知。切换此选项并保存后也会确认状态;首次开启需允许浏览器通知。",
168
178
  "stats.title": "今日统计",
169
179
  "stats.sent": "自动继续",
170
180
  "stats.skipped": "跳过(永久错误)",
@@ -212,32 +222,42 @@ var zh = {
212
222
  };
213
223
  var en = {
214
224
  "card.title": "Auto continue",
215
- "card.description": "Catches an interrupted request, waits for things to settle, then hands the thread back to the agent.",
216
- "flow.interrupted": "Interrupted",
217
- "flow.grace": "Safe pause",
218
- "flow.continue": "Continue",
219
- "repo.star": "Star on GitHub",
220
- "repo.aria": "Open the dsh-auto-continue repository on GitHub and star it",
221
- "section.handoff.title": "The handoff",
222
- "section.handoff.description": "Choose what gets sent after an interruption and when the relay should stand down.",
223
- "section.autoloop.title": "Autonomous loop",
224
- "section.autoloop.description": "Hand the thread back after every completed turn until manually stopped.",
225
- "section.safety.title": "Safety rhythm",
226
- "section.safety.description": "Confirm the previous step, then set the boundaries for waiting and repeated resumes.",
227
- "section.recovery.title": "Recovery radar",
228
- "section.recovery.description": "Find dropped sessions, recognize recoverable errors, and back off gracefully.",
229
- "section.loop.title": "Loop breaker",
230
- "section.loop.description": "Spot a spinning agent and route it forward before it burns time in place.",
231
- "section.live.title": "Live signal",
232
- "section.live.description": "See what the relay caught today and which sessions are still paused.",
233
- "field.paused": "Pause auto-continue",
225
+ "card.description": "Resume interrupted sessions, at your pace.",
226
+ "repo.star": "Finding it useful? Leave a Star",
227
+ "repo.note": "By HsiangNianian. Feedback and PRs welcome.",
228
+ "repo.link": "GitHub repo",
229
+ "repo.aria": "Open HsiangNianian/dsh-auto-continue on GitHub in a new tab",
230
+ "chrome.enabled": "Enabled",
231
+ "chrome.paused": "Paused",
232
+ "chrome.saved": "All changes saved",
233
+ "notification.title": "Auto-continue settings",
234
+ "notification.enabled": "Settings saved. Browser notifications are on.",
235
+ "notification.disabled": "Settings saved. Browser notifications are off.",
236
+ "notification.saved": "Your auto-continue settings have been saved.",
237
+ "notification.blocked": "Settings saved, but browser notifications are not allowed. Allow notifications in this site’s permissions.",
238
+ "notification.unsupported": "Settings saved. This browser does not support notifications.",
239
+ "notification.failed": "Settings saved, but the notification could not be sent. Check notification permissions for this site and your system.",
240
+ "chrome.categories": "Settings categories",
241
+ "category.general.title": "General",
242
+ "category.general.description": "Control automatic recovery, visibility, and notifications.",
243
+ "category.recovery.title": "Retry strategy",
244
+ "category.recovery.description": "Set wait times, retry limits, and error classification.",
245
+ "category.startup.title": "Startup recovery",
246
+ "category.startup.description": "Find recently interrupted sessions when DSH restarts.",
247
+ "category.prompts.title": "Continue text",
248
+ "category.prompts.description": "Leave blank for built-in text in the current DSH language.",
249
+ "category.safety.title": "Safety",
250
+ "category.safety.description": "Avoid duplicate tool actions and break unproductive loops.",
251
+ "category.status.title": "Status and logs",
252
+ "category.status.description": "View activity and paused sessions.",
253
+ "field.paused": "Auto-continue",
234
254
  "field.showComposerToggle": "Show auto-continue switch in the composer",
235
255
  "field.showComposerToggleHint": "Shown by default. Hiding the switch does not pause auto-continue. Click Save to apply.",
236
256
  "composer.label": "Auto-continue",
237
257
  "composer.scope": "Controls auto-continue for all sessions in this profile. Changes save immediately.",
238
258
  "composer.saving": "Saving auto-continue setting…",
239
259
  "composer.saveFailed": "Could not save. Try again.",
240
- "field.pausedHint": "Globally pause: no live or scan auto-send fires, and queued pending sends are cancelled.",
260
+ "field.pausedHint": "Resume interrupted sessions. Turn off and save to pause recovery globally and cancel queued continuations.",
241
261
  "field.continueText": "Continue text",
242
262
  "field.continueTextHint": "Message automatically sent after an interruption.",
243
263
  "default.continueText": LOCALIZED_TEXT_DEFAULTS.en.continueText,
@@ -286,7 +306,7 @@ var en = {
286
306
  "field.backoffMaxMs": "Max backoff (ms)",
287
307
  "field.backoffMaxMsHint": "Cap on the adaptive backoff interval.",
288
308
  "field.notify": "Browser notifications",
289
- "field.notifyHint": 'Notify when auto-continue fires, gives up, or hits a permanent error; notifications carry "Resume now" and "Pause this session 1h" buttons.',
309
+ "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.",
290
310
  "stats.title": "Today's stats",
291
311
  "stats.sent": "Auto-continued",
292
312
  "stats.skipped": "Skipped (permanent)",
@@ -615,19 +635,24 @@ var CardForm = class {
615
635
  }
616
636
  /**
617
637
  * Write every staged edit, then re-seed from what the Host accepted.
618
- * @returns settlement after every write and the read-back.
638
+ * @returns true only when a non-empty save was accepted and read back.
619
639
  */
620
640
  async save() {
621
641
  const plan = this.plan();
622
642
  const writes = plan.flatMap((item) => item.run === void 0 ? [] : [item.run]);
623
- if (plan.length === 0 || this.saving || writes.length !== plan.length) return;
643
+ const snapshot = this.scope.getSnapshot();
644
+ if (plan.length === 0 || this.saving || writes.length !== plan.length || snapshot.status !== "ready" || !snapshot.writable || snapshot.mode !== "host") return false;
624
645
  const edits = plan.map(({ field, staged }) => ({ field, staged }));
625
646
  this.saving = true;
626
647
  this.failed = false;
627
648
  this.publish();
628
649
  let landed = true;
629
- for (const write of writes) {
630
- landed = await write() && landed;
650
+ try {
651
+ for (const write of writes) {
652
+ landed = await write() && landed;
653
+ }
654
+ } catch {
655
+ landed = false;
631
656
  }
632
657
  if (landed) {
633
658
  for (const { field, staged } of edits) {
@@ -637,6 +662,7 @@ var CardForm = class {
637
662
  this.saving = false;
638
663
  this.failed = !landed;
639
664
  this.publish();
665
+ return landed;
640
666
  }
641
667
  /**
642
668
  * Every staged edit a save would write. An entry whose draft is not a value
@@ -661,12 +687,12 @@ var CardForm = class {
661
687
  return plan;
662
688
  }
663
689
  async clear(field) {
664
- await this.scope.unset(field);
665
- return !this.stored(field);
690
+ const accepted = await this.scope.unset(field);
691
+ return accepted !== false && !this.stored(field);
666
692
  }
667
693
  async store(field, value) {
668
- await this.scope.set(field, value);
669
- return this.userLayer()?.[field] === value;
694
+ const accepted = await this.scope.set(field, value);
695
+ return accepted !== false && this.userLayer()?.[field] === value;
670
696
  }
671
697
  stage(field, edit) {
672
698
  this.staged.set(field, edit);
@@ -713,393 +739,121 @@ var css = `
713
739
  .dshAcSwitch:disabled { opacity: .5; cursor: default; }
714
740
  .dshAcSwitch:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
715
741
  .dshAcCard {
716
- --dsh-ac-violet: #8b7cff;
717
- --dsh-ac-cyan: #45cce5;
718
- --dsh-ac-mint: #46d69d;
719
- --dsh-ac-red: #e5484d;
720
- --dsh-ac-amber: #f1b95c;
721
- isolation: isolate;
722
- position: relative;
723
- overflow: hidden;
724
- border: 1px solid var(--dsw-alias-border-l2);
725
- background: var(--dsw-alias-bg-layer-3);
726
- border-radius: 16px;
727
- list-style: none;
728
- box-shadow: 0 10px 34px rgb(0 0 0 / 8%);
729
- transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
730
- }
731
- .dshAcCard::before {
732
- content: "";
733
- z-index: 2;
734
- position: absolute;
735
- inset: 0 0 auto;
736
- height: 2px;
737
- pointer-events: none;
738
- opacity: .72;
739
- background: linear-gradient(90deg, transparent 1%, var(--dsh-ac-violet) 22%, var(--dsh-ac-cyan) 52%, var(--dsh-ac-mint) 80%, transparent 99%);
740
- }
741
- .dshAcCard::after {
742
- content: "";
743
- z-index: -1;
744
- position: absolute;
745
- width: 190px;
746
- height: 190px;
747
- top: -104px;
748
- left: -76px;
749
- pointer-events: none;
750
- border-radius: 999px;
751
- background: radial-gradient(circle, rgb(139 124 255 / 14%) 0, transparent 68%);
752
- }
753
- .dshAcCard:hover {
754
- border-color: color-mix(in srgb, var(--dsh-ac-violet) 48%, var(--dsw-alias-border-l2));
755
- box-shadow: 0 14px 42px rgb(0 0 0 / 12%);
756
- transform: translateY(-1px);
757
- }
758
- .dshAcCardOpen {
759
- background: var(--dsw-alias-bg-layer-2);
760
- border-color: color-mix(in srgb, var(--dsh-ac-violet) 42%, var(--dsw-alias-border-l2));
761
- box-shadow: 0 18px 54px rgb(0 0 0 / 14%);
762
- transform: none;
763
- }
764
- .dshAcHeaderFrame {
765
- align-items: stretch;
766
- flex-direction: column;
767
- display: flex;
768
- }
769
- .dshAcHeader {
770
- appearance: none;
771
- min-width: 0;
772
- flex: 1;
742
+ --dsh-ac-bg: var(--dsw-alias-bg-base, var(--dsw-alias-bg-layer-2));
743
+ --dsh-ac-line: var(--dsw-alias-border-l2);
744
+ --dsh-ac-text: var(--dsw-alias-label-primary);
745
+ --dsh-ac-muted: var(--dsw-alias-label-tertiary);
746
+ container: auto-continue-settings / inline-size;
747
+ color: var(--dsh-ac-text);
773
748
  font: inherit;
774
- color: inherit;
775
- text-align: left;
776
- cursor: pointer;
777
- background: none;
778
- border: 0;
779
- border-radius: 16px;
780
- align-items: center;
781
- gap: 14px;
782
- padding: 18px 18px 12px;
783
- display: flex;
784
- }
785
- .dshAcHeader:focus-visible { outline: 2px solid var(--dsh-ac-violet); outline-offset: -3px; }
786
- .dshAcRelayMark {
787
- width: 54px;
788
- height: 54px;
789
- flex: none;
790
- place-items: center;
791
- display: grid;
792
- color: var(--dsh-ac-cyan);
793
- border: 1px solid color-mix(in srgb, var(--dsh-ac-violet) 42%, var(--dsw-alias-border-l2));
794
- border-radius: 17px;
795
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 84%, var(--dsh-ac-violet) 16%);
796
- box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%), 0 8px 24px rgb(62 51 153 / 16%);
797
- }
798
- .dshAcRelayMark svg { width: 44px; height: 44px; overflow: visible; }
799
- .dshAcRelayArc { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
800
- .dshAcRelayArcEcho { opacity: .42; }
801
- .dshAcRelayNode { stroke: var(--dsw-alias-bg-layer-3); stroke-width: 1.5; }
802
- .dshAcRelayNodeStart { fill: var(--dsh-ac-amber); }
803
- .dshAcRelayNodeEnd { fill: var(--dsh-ac-mint); }
804
- .dshAcRelayPulse { fill: var(--dsh-ac-violet); opacity: .85; }
805
- .dshAcCard:hover .dshAcRelayPulse, .dshAcCardOpen .dshAcRelayPulse {
806
- animation: dshAcRelayTravel 1.8s cubic-bezier(.4, 0, .2, 1) infinite;
807
- }
808
- .dshAcHeadText { flex-direction: column; flex: 1; gap: 3px; min-width: 0; display: flex; }
809
- .dshAcName {
810
- color: var(--dsw-alias-label-primary);
811
- font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", sans-serif;
812
- font-size: 18px;
813
- font-weight: 680;
814
- letter-spacing: -.015em;
815
- line-height: 1.35;
816
- }
817
- .dshAcDescription { max-width: 660px; color: var(--dsw-alias-label-tertiary); font-size: 13px; line-height: 1.5; }
818
- .dshAcJourney { flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 4px; display: flex; }
819
- .dshAcJourneyStep {
820
- align-items: center;
821
- gap: 5px;
822
- color: var(--dsw-alias-label-secondary);
823
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
824
- font-size: 10px;
825
- font-weight: 600;
826
- line-height: 1.4;
827
- letter-spacing: .02em;
828
- display: inline-flex;
829
- }
830
- .dshAcJourneyDot { width: 5px; height: 5px; flex: none; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px rgb(255 255 255 / 3%); }
831
- .dshAcJourneyInterrupted .dshAcJourneyDot { color: var(--dsh-ac-amber); }
832
- .dshAcJourneyGrace .dshAcJourneyDot { color: var(--dsh-ac-cyan); }
833
- .dshAcJourneyContinue .dshAcJourneyDot { color: var(--dsh-ac-mint); }
834
- .dshAcJourneyLine {
835
- width: 25px;
836
- height: 1px;
837
- flex: none;
838
- opacity: .7;
839
- background: linear-gradient(90deg, var(--dsh-ac-violet), var(--dsh-ac-cyan), var(--dsh-ac-mint));
840
- background-size: 220% 100%;
841
- }
842
- .dshAcCard:hover .dshAcJourneyLine, .dshAcCardOpen .dshAcJourneyLine { animation: dshAcSignalSweep 1.8s linear infinite; }
843
- .dshAcChevron {
844
- width: 30px;
845
- height: 30px;
846
- color: var(--dsw-alias-label-tertiary);
847
- border: 1px solid var(--dsw-alias-border-l2);
848
- border-radius: 999px;
849
- flex: none;
850
- place-items: center;
851
- display: grid;
852
- transition: color .18s ease, border-color .18s ease, transform .18s ease;
853
- }
854
- .dshAcChevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
855
- .dshAcHeader:hover .dshAcChevron { color: var(--dsh-ac-violet); border-color: color-mix(in srgb, var(--dsh-ac-violet) 48%, var(--dsw-alias-border-l2)); }
856
- .dshAcChevronOpen { transform: rotate(180deg); }
857
- .dshAcGithub {
858
- min-width: 0;
859
- max-width: none;
860
- align-self: stretch;
861
- align-items: center;
862
- gap: 10px;
863
- margin: 0 18px 16px;
864
- padding: 9px 11px;
865
- color: var(--dsw-alias-label-primary);
866
- text-decoration: none;
867
- border: 1px solid var(--dsw-alias-border-l2);
868
- border-radius: 13px;
869
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 90%, var(--dsh-ac-violet) 10%);
870
- display: flex;
871
- transition: border-color .18s ease, background .18s ease, transform .18s ease;
872
- }
873
- .dshAcGithub:hover {
874
- border-color: color-mix(in srgb, var(--dsh-ac-violet) 58%, var(--dsw-alias-border-l2));
875
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 82%, var(--dsh-ac-violet) 18%);
876
- transform: translateY(-1px);
877
- }
878
- .dshAcGithub:focus-visible { outline: 2px solid var(--dsh-ac-violet); outline-offset: 2px; }
879
- .dshAcGithubIcon { width: 23px; height: 23px; flex: none; color: var(--dsw-alias-label-primary); }
880
- .dshAcGithubIcon svg { width: 100%; height: 100%; fill: currentColor; }
881
- .dshAcGithubText { min-width: 0; flex: 1; flex-direction: column; gap: 1px; display: flex; }
882
- .dshAcGithubAction { font-size: 12px; font-weight: 680; line-height: 1.4; }
883
- .dshAcGithubAction::before { content: "★"; color: var(--dsh-ac-amber); margin-right: 5px; }
884
- .dshAcGithubSlug {
885
- overflow: hidden;
886
- color: var(--dsw-alias-label-tertiary);
887
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
888
- font-size: 9.5px;
889
- line-height: 1.4;
890
- text-overflow: ellipsis;
891
- white-space: nowrap;
892
- }
893
- .dshAcExternal { width: 15px; height: 15px; flex: none; color: var(--dsw-alias-label-tertiary); }
894
- .dshAcExternal svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
895
- .dshAcBody { border-top: 1px solid var(--dsw-alias-border-l2); margin: 0 18px 12px; padding: 4px 0 0; }
896
- .dshAcReadOnly { color: var(--dsw-alias-label-tertiary); margin: 12px 0 0; font-size: 12px; line-height: 1.5; }
897
- .dshAcPending {
898
- white-space: nowrap;
899
- background: var(--dsw-alias-bg-module-platform);
900
- color: var(--dsw-alias-label-secondary);
901
- border-radius: 999px;
902
- flex: none;
903
- padding: 1px 8px;
904
- font-size: 11px;
905
- font-weight: 500;
906
- line-height: 17px;
907
- }
908
- .dshAcFooter {
909
- border-top: 1px solid var(--dsw-alias-border-l2);
910
- justify-content: flex-end;
911
- align-items: center;
912
- gap: 8px;
913
- padding: 12px 0 4px;
914
- display: flex;
915
- }
916
- .dshAcFailed { min-width: 0; color: var(--dsw-alias-label-error); flex: 1; margin: 0; font-size: 12px; line-height: 1.5; }
917
- .dshAcDiscard, .dshAcSave {
918
- appearance: none;
919
- font: inherit;
920
- cursor: pointer;
921
- border: 1px solid transparent;
922
- border-radius: 8px;
923
- padding: 5px 14px;
924
749
  font-size: 13px;
925
750
  line-height: 1.5;
926
- }
927
- .dshAcDiscard { border-color: var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary); background: none; }
928
- .dshAcDiscard:hover:not(:disabled) { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-label-dimmed); }
929
- .dshAcSave { background: var(--dsw-alias-label-primary); color: var(--dsw-alias-bg-layer-3); }
930
- .dshAcDiscard:disabled, .dshAcSave:disabled { opacity: .4; cursor: default; }
931
- .dshAcDiscard:focus-visible, .dshAcSave:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
932
- .dshAcFormCanvas { flex-direction: column; gap: 14px; padding: 12px 0 8px; display: flex; }
933
- .dshAcFormSection {
934
- --dsh-ac-section: var(--dsh-ac-violet);
935
- overflow: hidden;
936
- border: 1px solid var(--dsw-alias-border-l2);
937
- border-radius: 14px;
938
- background: var(--dsw-alias-bg-layer-3);
939
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-3) 95%, var(--dsh-ac-section) 5%);
940
- }
941
- .dshAcFormSection-handoff { --dsh-ac-section: var(--dsh-ac-mint); }
942
- .dshAcFormSection-autoloop { --dsh-ac-section: var(--dsh-ac-red); }
943
- .dshAcFormSection-safety { --dsh-ac-section: var(--dsh-ac-amber); }
944
- .dshAcFormSection-recovery { --dsh-ac-section: var(--dsh-ac-cyan); }
945
- .dshAcFormSection-loop { --dsh-ac-section: var(--dsh-ac-violet); }
946
- .dshAcFormSection-live { --dsh-ac-section: color-mix(in srgb, var(--dsh-ac-violet) 60%, var(--dsh-ac-cyan)); }
947
- .dshAcSectionHead {
948
- align-items: center;
949
- gap: 11px;
950
- padding: 13px 14px 11px;
951
- border-bottom: 1px solid var(--dsw-alias-border-l2);
952
- display: flex;
953
- }
954
- .dshAcSectionSignal {
955
- width: 4px;
956
- height: 34px;
957
- flex: none;
958
- border-radius: 999px;
959
- background: var(--dsh-ac-section);
960
- box-shadow: 0 0 18px color-mix(in srgb, var(--dsh-ac-section) 55%, transparent);
961
- }
962
- .dshAcSectionCopy { min-width: 0; flex-direction: column; gap: 2px; display: flex; }
963
- .dshAcSectionTitle {
964
- color: var(--dsw-alias-label-primary);
965
- font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", sans-serif;
966
- font-size: 14px;
967
- font-weight: 680;
968
- line-height: 1.4;
969
- }
970
- .dshAcSectionDescription { color: var(--dsw-alias-label-tertiary); font-size: 11.5px; line-height: 1.45; }
971
- .dshAcSectionGrid {
972
- grid-template-columns: repeat(2, minmax(0, 1fr));
973
- column-gap: 22px;
974
- padding: 0 14px 4px;
975
- display: grid;
976
- }
977
- .dshAcField { min-width: 0; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--dsw-alias-border-l2); display: flex; }
978
- .dshAcSectionGrid > .dshAcField:first-child { border-top: 0; }
979
- .dshAcFieldWide { grid-column: 1 / -1; }
980
- .dshAcHead { align-items: center; gap: 8px; display: flex; }
981
- .dshAcLabel { min-width: 0; color: var(--dsw-alias-label-primary); flex: 1; font-size: 13px; font-weight: 500; line-height: 1.5; }
982
- .dshAcBadges { align-items: center; gap: 8px; display: inline-flex; }
983
- .dshAcBadge {
984
- white-space: nowrap;
985
- background: var(--dsw-alias-bg-module-platform);
986
- color: var(--dsw-alias-label-secondary);
987
- border-radius: 999px;
988
- padding: 1px 8px;
989
- font-size: 11px;
990
- font-weight: 500;
991
- line-height: 17px;
992
- }
993
- .dshAcReset {
994
- font: inherit;
995
- color: var(--dsw-alias-label-secondary);
996
- cursor: pointer;
997
- background: none;
998
- border: none;
751
+ list-style: none;
999
752
  padding: 0;
1000
- font-size: 12px;
1001
- line-height: 1.5;
1002
- }
1003
- .dshAcReset:hover:not(:disabled) { color: var(--dsw-alias-label-primary); }
1004
- .dshAcReset:disabled { cursor: default; }
1005
- .dshAcInput {
1006
- box-sizing: border-box;
1007
- width: 100%;
1008
- border: 1px solid var(--dsw-alias-border-l2);
1009
- background: var(--dsw-alias-bg-layer-3);
1010
- height: 34px;
1011
- font: inherit;
1012
- color: var(--dsw-alias-label-primary);
1013
- border-radius: 8px;
1014
- padding: 0 12px;
1015
- font-size: 13px;
1016
- line-height: 1.5;
1017
- }
1018
- .dshAcInput:focus-visible { border-color: var(--dsw-alias-brand-primary); outline: none; }
1019
- .dshAcInput:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; }
1020
- .dshAcInputInvalid { border-color: var(--dsw-alias-label-error); }
1021
- .dshAcTextArea { box-sizing: border-box; height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
1022
- .dshAcSelect {
1023
- box-sizing: border-box;
1024
- width: 100%;
1025
- border: 1px solid var(--dsw-alias-border-l2);
1026
- background: var(--dsw-alias-bg-layer-3);
1027
- height: 34px;
1028
- font: inherit;
1029
- color: var(--dsw-alias-label-primary);
1030
- border-radius: 8px;
1031
- padding: 0 8px;
1032
- font-size: 13px;
1033
- line-height: 1.5;
1034
- }
1035
- .dshAcSelect:focus-visible { border-color: var(--dsw-alias-brand-primary); outline: none; }
1036
- .dshAcSelect:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; }
1037
- .dshAcInvalid { color: var(--dsw-alias-label-error); margin: 0; font-size: 12px; line-height: 1.5; }
1038
- .dshAcHint { color: var(--dsw-alias-label-tertiary); margin: 0; font-size: 12px; line-height: 1.5; }
1039
- .dshAcPanel { min-width: 0; flex-direction: column; gap: 8px; padding: 12px 0 14px; display: flex; }
1040
- .dshAcPanel + .dshAcPanel { border-left: 1px solid var(--dsw-alias-border-l2); padding-left: 20px; }
1041
- .dshAcPanelHead { align-items: center; gap: 8px; display: flex; }
1042
- .dshAcPanelTitle { color: var(--dsw-alias-label-primary); flex: 1; font-size: 13px; font-weight: 600; line-height: 1.5; }
1043
- .dshAcStats { gap: 4px 16px; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
1044
- .dshAcStats > div { justify-content: space-between; gap: 8px; display: flex; }
1045
- .dshAcStats dt { color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 1.5; }
1046
- .dshAcStats dd { color: var(--dsw-alias-label-primary); margin: 0; font-size: 12px; font-weight: 600; line-height: 1.5; }
1047
- .dshAcCodes { flex-wrap: wrap; align-items: center; gap: 6px; display: flex; }
1048
- .dshAcCode {
1049
- white-space: nowrap;
1050
- background: var(--dsw-alias-bg-module-platform);
1051
- color: var(--dsw-alias-label-secondary);
1052
- border-radius: 999px;
1053
- padding: 1px 8px;
1054
- font-size: 11px;
1055
- font-weight: 500;
1056
- line-height: 17px;
1057
- }
1058
- .dshAcPauseList { flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; display: flex; }
1059
- .dshAcPauseList li { align-items: center; gap: 8px; display: flex; }
1060
- .dshAcPauseId {
1061
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1062
- color: var(--dsw-alias-label-primary);
1063
- font-size: 12px;
1064
- line-height: 1.5;
1065
- }
1066
- @keyframes dshAcRelayTravel {
1067
- 0% { opacity: 0; transform: translate(-19px, 18px) scale(.7); }
1068
- 18% { opacity: 1; }
1069
- 82% { opacity: 1; }
1070
- 100% { opacity: 0; transform: translate(12px, 6px) scale(1.15); }
1071
- }
1072
- @keyframes dshAcSignalSweep {
1073
- from { background-position: 100% 0; }
1074
- to { background-position: -120% 0; }
1075
- }
1076
- @media (max-width: 820px) {
1077
- .dshAcSectionGrid { grid-template-columns: minmax(0, 1fr); }
1078
- .dshAcFieldWide { grid-column: auto; }
1079
- .dshAcPanel + .dshAcPanel {
1080
- border-top: 1px solid var(--dsw-alias-border-l2);
1081
- border-left: 0;
1082
- padding-left: 0;
1083
- }
1084
- }
1085
- @media (max-width: 560px) {
1086
- .dshAcHeader { align-items: flex-start; gap: 11px; padding: 15px 13px 10px; }
1087
- .dshAcRelayMark { width: 46px; height: 46px; border-radius: 14px; }
1088
- .dshAcRelayMark svg { width: 38px; height: 38px; }
1089
- .dshAcName { font-size: 16px; }
1090
- .dshAcDescription { font-size: 12px; }
1091
- .dshAcJourney { gap: 5px; }
1092
- .dshAcJourneyLine { width: 13px; }
1093
- .dshAcChevron { width: 27px; height: 27px; }
1094
- .dshAcPending { display: none; }
1095
- .dshAcGithub { margin: 0 13px 13px; }
1096
- .dshAcBody { margin-right: 13px; margin-left: 13px; }
1097
- }
1098
- @media (prefers-reduced-motion: reduce) {
1099
- .dshAcCard, .dshAcGithub, .dshAcChevron { transition: none; }
1100
- .dshAcCard:hover, .dshAcGithub:hover { transform: none; }
1101
- .dshAcRelayPulse, .dshAcJourneyLine { animation: none !important; }
1102
753
  }
754
+ .dshAcCard *, .dshAcCard *::before, .dshAcCard *::after { box-sizing: border-box; }
755
+ .dshAcCard :is(h2,h3,p) { margin: 0; }
756
+ .dshAcCard :is(button,input,textarea) { font: inherit; }
757
+ .dshAcCard button { cursor: pointer; }
758
+ .dshAcCard button:disabled { opacity: .4; cursor: default; }
759
+ .dshAcCard :is(a,button,input,textarea):focus-visible { outline: 2px solid var(--dsh-ac-text); outline-offset: 3px; }
760
+ .dshAcHeaderFrame { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 24px; margin: 20px 0; padding: 16px 18px; border-radius: 9px; color: #f9fafb; background: #23262c; }
761
+ .dshAcIntroduction { min-width: 0; }
762
+ .dshAcTitleLine { display: flex; align-items: center; gap: 10px; }
763
+ .dshAcTitleLine h2 { font-size: 17px; font-weight: 620; line-height: 1.4; white-space: nowrap; }
764
+ .dshAcStatus { white-space: nowrap; font-size: 11px; color: #dce0e6; background: #ffffff14; border-radius: 5px; padding: 2px 7px; }
765
+ .dshAcIntroduction p { margin-top: 5px; color: #b9bec8; font-size: 12px; line-height: 1.6; }
766
+ .dshAcRepository { display: flex; align-items: center; gap: 12px; min-width: 0; }
767
+ .dshAcStar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid #625032; border-radius: 50%; background: #302c25; color: #e9be6d; }
768
+ .dshAcStar svg { width: 18px; height: 18px; fill: #e9be6d12; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
769
+ .dshAcRepositoryCopy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
770
+ .dshAcRepositoryCopy strong { font-size: 13px; font-weight: 560; line-height: 1.5; }
771
+ .dshAcRepositoryCopy > span { color: #b9bec8; font-size: 10px; line-height: 1.6; }
772
+ .dshAcRepositoryCopy > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
773
+ .dshAcCard a.dshAcGithub { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-height: 38px; padding: 9px 11px; border: 1px solid transparent; border-radius: 6px; color: #202329; background: #f4f5f7; text-decoration: none; font-size: 12px; font-weight: 550; white-space: nowrap; transition: background-color 140ms ease, box-shadow 140ms ease; }
774
+ .dshAcCard a.dshAcGithub:hover { background: #fff; box-shadow: 0 0 0 3px #ffffff18; }
775
+ .dshAcCard a.dshAcGithub:focus-visible { outline-color: #e9be6d; }
776
+ .dshAcGithub > svg { flex: none; width: 17px; height: 17px; fill: currentColor; }
777
+ .dshAcGithub > svg.dshAcExternal { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; margin-left: 2px; }
778
+ .dshAcGithubShort { display: none; }
779
+ .dshAcReadOnly { padding: 10px 0; color: var(--dsh-ac-muted); }
780
+ .dshAcLayout { display: grid; grid-template-columns: 164px minmax(0, 1fr); border-top: 1px solid var(--dsh-ac-line); min-height: 462px; }
781
+ .dshAcNav { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 16px 0; position: sticky; top: 16px; align-self: start; }
782
+ .dshAcNav > button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 37px; padding: 8px 11px; border: 0; border-radius: 6px; text-align: left; background: none; color: var(--dsw-alias-label-secondary); }
783
+ .dshAcNav > button:hover, .dshAcNav > button[aria-selected=true] { color: var(--dsh-ac-text); background: var(--dsw-alias-interactive-bg-hover); }
784
+ .dshAcNav > button[aria-selected=true] { font-weight: 600; }
785
+ .dshAcInvalidMark { color: var(--dsw-alias-state-error-primary); font-weight: 600; }
786
+ .dshAcCategory { min-width: 0; padding: 20px 0 16px 26px; border-left: 1px solid var(--dsh-ac-line); }
787
+ .dshAcCategoryHeading { padding-bottom: 14px; }
788
+ .dshAcCategoryHeading h3 { font-size: 15px; font-weight: 620; }
789
+ .dshAcCategoryHeading p { color: var(--dsh-ac-muted); font-size: 12px; margin-top: 3px; }
790
+ .dshAcField { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; padding: 18px 0; border-bottom: 1px solid var(--dsh-ac-line); }
791
+ .dshAcField:last-child { border-bottom: 0; }
792
+ .dshAcFieldCopy { min-width: 0; }
793
+ .dshAcLabel { display: block; font-size: 14px; font-weight: 480; color: var(--dsh-ac-text); }
794
+ .dshAcHint { color: var(--dsh-ac-muted); font-size: 12px; line-height: 1.6; }
795
+ .dshAcFieldCopy p { margin-top: 4px; }
796
+ .dshAcFieldControl { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
797
+ .dshAcReset { padding: 0; border: 0; background: none; color: var(--dsh-ac-muted); font-size: 11px !important; white-space: nowrap; }
798
+ .dshAcReset:hover:not(:disabled) { color: var(--dsh-ac-text); text-decoration: underline; }
799
+ .dshAcInput { border: 1px solid var(--dsh-ac-line); border-radius: 6px; background: var(--dsh-ac-bg); color: var(--dsh-ac-text); padding: 8px 11px; }
800
+ .dshAcInput::placeholder { color: var(--dsh-ac-muted); opacity: .7; }
801
+ .dshAcInput[aria-invalid=true] { border-color: var(--dsw-alias-state-error-primary); }
802
+ .dshAcNumber { width: 132px; min-width: 0; font-variant-numeric: tabular-nums; }
803
+ .dshAcFieldText { display: block; }
804
+ .dshAcFieldText .dshAcFieldControl { margin-top: 10px; flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
805
+ .dshAcTextArea { display: block; width: 100%; min-height: 66px; resize: vertical; line-height: 1.6; }
806
+ .dshAcInvalid, .dshAcFailed { color: var(--dsw-alias-state-error-primary); font-size: 12px; }
807
+ .dshAcFooter { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 24px; padding: 13px 0; border-top: 1px solid var(--dsh-ac-line); background: var(--dsh-ac-bg); }
808
+ .dshAcFooter[data-dirty=true] { position: sticky; z-index: 8; bottom: 0; }
809
+ .dshAcFooter > div { display: flex; align-items: center; gap: 8px; }
810
+ .dshAcDiscard, .dshAcSave { padding: 7px 13px; border: 1px solid var(--dsh-ac-line); border-radius: 6px; font-size: 12px !important; background: var(--dsh-ac-bg); color: var(--dsh-ac-text); white-space: nowrap; }
811
+ .dshAcSave { background: var(--dsh-ac-text); color: var(--dsh-ac-bg); border-color: var(--dsh-ac-text); }
812
+ .dshAcDiscard:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
813
+ .dshAcSave:hover:not(:disabled) { opacity: .85; }
814
+ .dshAcPanel { padding: 20px 0; border-top: 1px solid var(--dsh-ac-line); }
815
+ .dshAcPanelHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
816
+ .dshAcPanelTitle { font-weight: 550; }
817
+ .dshAcStats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
818
+ .dshAcStats dt { font-size: 11px; color: var(--dsh-ac-muted); }
819
+ .dshAcStats dd { margin: 4px 0 0; font-size: 19px; font-weight: 550; font-variant-numeric: tabular-nums; }
820
+ .dshAcCodes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
821
+ .dshAcCode { font: 11px ui-monospace, SFMono-Regular, monospace; border: 1px solid var(--dsh-ac-line); border-radius: 4px; padding: 3px 6px; }
822
+ .dshAcPauseList { list-style: none; margin: 0; padding: 0; }
823
+ .dshAcPauseList li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
824
+ .dshAcPauseId { flex: 1; font: 12px ui-monospace, SFMono-Regular, monospace; }
825
+ @container auto-continue-settings (max-width: 760px) {
826
+ .dshAcHeaderFrame { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
827
+ .dshAcRepositoryCopy { display: none; }
828
+ .dshAcRepository { gap: 10px; }
829
+ .dshAcLayout { grid-template-columns: 136px minmax(0, 1fr); }
830
+ .dshAcCategory { padding-left: 20px; }
831
+ .dshAcFieldControl { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
832
+ }
833
+ @container auto-continue-settings (max-width: 560px) {
834
+ .dshAcLayout { display: block; min-height: 0; }
835
+ .dshAcNav { flex-direction: row; overflow-x: auto; position: static; padding: 12px 0; border-bottom: 1px solid var(--dsh-ac-line); }
836
+ .dshAcNav > button { flex: none; font-size: 12px; min-height: 34px; padding: 7px 10px; }
837
+ .dshAcCategory { border-left: 0; padding: 20px 0; }
838
+ .dshAcField { gap: 8px 14px; }
839
+ .dshAcLabel { font-size: 13px; }
840
+ .dshAcNumber { width: 98px; }
841
+ .dshAcFooter { align-items: flex-start; flex-direction: column; gap: 10px; }
842
+ .dshAcFooter > div { width: 100%; justify-content: flex-end; }
843
+ }
844
+ @container auto-continue-settings (max-width: 440px) {
845
+ .dshAcHeaderFrame { gap: 12px; padding: 14px; }
846
+ .dshAcTitleLine { gap: 6px; }
847
+ .dshAcTitleLine h2 { font-size: 15px; white-space: normal; }
848
+ .dshAcStatus { padding: 2px 5px; font-size: 10px; }
849
+ .dshAcIntroduction p { font-size: 11px; }
850
+ .dshAcStar, .dshAcGithubLong { display: none; }
851
+ .dshAcGithubShort { display: inline; }
852
+ .dshAcCard a.dshAcGithub { gap: 6px; padding: 8px; font-size: 11px; }
853
+ .dshAcGithub > svg.dshAcExternal { display: none; }
854
+ }
855
+ @media (prefers-reduced-motion: reduce) { .dshAcCard a.dshAcGithub { transition: none; } }
856
+
1103
857
  `;
1104
858
  function injectStyles() {
1105
859
  if (typeof document === "undefined") return;
@@ -1111,6 +865,43 @@ function injectStyles() {
1111
865
  document.head.appendChild(tag);
1112
866
  }
1113
867
 
868
+ // src/client/settings-notifications.ts
869
+ var pendingPermission;
870
+ function prepareSettingsNotification(enabled) {
871
+ try {
872
+ if (typeof Notification === "undefined") return Promise.resolve("unsupported");
873
+ if (!enabled || Notification.permission !== "default") return Promise.resolve(Notification.permission);
874
+ if (!pendingPermission) {
875
+ pendingPermission = Notification.requestPermission().catch(() => "failed").finally(() => {
876
+ pendingPermission = void 0;
877
+ });
878
+ }
879
+ return pendingPermission;
880
+ } catch {
881
+ return Promise.resolve("failed");
882
+ }
883
+ }
884
+ function showSettingsNotification(notice, locale, permission) {
885
+ const message = `notification.${notice}`;
886
+ if (permission !== "granted") {
887
+ if (notice === "disabled") return message;
888
+ return permission === "unsupported" ? "notification.unsupported" : permission === "failed" ? "notification.failed" : "notification.blocked";
889
+ }
890
+ try {
891
+ const copy = locale.startsWith("en") ? en : zh;
892
+ const notification = new Notification(copy["notification.title"], { body: copy[message] });
893
+ notification.onclick = () => {
894
+ try {
895
+ globalThis.focus?.();
896
+ } catch {
897
+ }
898
+ };
899
+ return message;
900
+ } catch {
901
+ return notice === "disabled" ? message : "notification.failed";
902
+ }
903
+ }
904
+
1114
905
  // src/client/settings-card.tsx
1115
906
  var import_jsx_runtime2 = require("react/jsx-runtime");
1116
907
  injectStyles();
@@ -1118,11 +909,13 @@ var AutoContinueSettingsCardController = class {
1118
909
  /**
1119
910
  * @param scope - the bound settings scope for the `auto-continue` namespace.
1120
911
  */
1121
- constructor(scope) {
912
+ constructor(scope, getLocale) {
1122
913
  this.scope = scope;
914
+ this.getLocale = getLocale;
1123
915
  this.composerSaving = false;
1124
916
  this.composerFailed = false;
1125
917
  this.disposed = false;
918
+ this.saveSequence = 0;
1126
919
  this.form = new CardForm(scope, [
1127
920
  booleanField("paused"),
1128
921
  booleanField("showComposerToggle"),
@@ -1161,6 +954,8 @@ var AutoContinueSettingsCardController = class {
1161
954
  projection() {
1162
955
  return {
1163
956
  ...this.form.shell(),
957
+ enabled: !(this.scope.getSnapshot().value?.paused ?? DEFAULT_CONFIG.paused),
958
+ notificationFeedback: this.notificationFeedback,
1164
959
  paused: this.form.field("paused"),
1165
960
  showComposerToggle: this.form.field("showComposerToggle"),
1166
961
  continueText: this.form.field("continueText"),
@@ -1198,7 +993,24 @@ var AutoContinueSettingsCardController = class {
1198
993
  * @returns the card's snapshot and its form actions.
1199
994
  */
1200
995
  inject() {
1201
- return { hooks: { autoContinueSettingsCard: this.store }, ...this.form.actions() };
996
+ return { hooks: { autoContinueSettingsCard: this.store }, ...this.form.actions(), save: () => void this.save() };
997
+ }
998
+ async save() {
999
+ const state2 = this.form.shell();
1000
+ const snapshot = this.scope.getSnapshot();
1001
+ if (this.disposed || !state2.available || !state2.writable || !state2.dirty || state2.invalid || state2.saving || snapshot.mode !== "host") return;
1002
+ const sequence = ++this.saveSequence;
1003
+ const before = snapshot.value?.notify ?? DEFAULT_CONFIG.notify;
1004
+ const target = this.form.field("notify").text;
1005
+ const permission = prepareSettingsNotification(target === "" ? DEFAULT_CONFIG.notify : target === "true");
1006
+ this.notificationFeedback = void 0;
1007
+ if (!await this.form.save() || this.disposed) return;
1008
+ const after = this.scope.getSnapshot().value?.notify ?? DEFAULT_CONFIG.notify;
1009
+ if (!before && !after) return;
1010
+ const result = await permission;
1011
+ if (this.disposed || sequence !== this.saveSequence || (this.scope.getSnapshot().value?.notify ?? DEFAULT_CONFIG.notify) !== after) return;
1012
+ this.notificationFeedback = showSettingsNotification(before === after ? "saved" : after ? "enabled" : "disabled", this.getLocale(), result);
1013
+ this.store.set(this.projection());
1202
1014
  }
1203
1015
  injectComposer() {
1204
1016
  return { hooks: { autoContinueComposer: this.composer }, setEnabled: (enabled) => void this.setEnabled(enabled) };
@@ -1238,222 +1050,68 @@ function AutoContinueSettingsPage(props) {
1238
1050
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AutoContinueSettingsCard, { ...props }) });
1239
1051
  }
1240
1052
  var REPOSITORY_URL = "https://github.com/HsiangNianian/dsh-auto-continue";
1241
- var REPOSITORY_SLUG = "HsiangNianian/dsh-auto-continue";
1242
- function RelayMark() {
1243
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { viewBox: "0 0 48 48", "aria-hidden": "true", focusable: "false", children: [
1244
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { className: "dshAcRelayArc", d: "M9 30c4-12 10-18 19-18 5 0 9 2 12 6" }),
1245
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { className: "dshAcRelayArc dshAcRelayArcEcho", d: "M8 35c6 3 12 3 17 0 5-3 8-8 15-9" }),
1246
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { className: "dshAcRelayNode dshAcRelayNodeStart", cx: "9", cy: "30", r: "3" }),
1247
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { className: "dshAcRelayNode dshAcRelayNodeEnd", cx: "40", cy: "18", r: "3" }),
1248
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { className: "dshAcRelayPulse", cx: "28", cy: "12", r: "2.5" })
1249
- ] });
1250
- }
1251
- function ChevronMark() {
1252
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m3.5 6 4.5 4 4.5-4" }) });
1253
- }
1053
+ var groups = [
1054
+ { id: "general", fields: ["paused", "showComposerToggle", "resumeSilentTurns", "resumeCompletedTurns", "notify"] },
1055
+ { id: "recovery", fields: ["graceMs", "cooldownMs", "maxConsecutive", "classify", "retryableErrorPatterns", "backoffFactor", "backoffMaxMs"] },
1056
+ { id: "startup", fields: ["scanOnBoot", "scanLimit", "freshMs"] },
1057
+ { id: "prompts", fields: ["continueText", "continueTextMaxTokens", "continueTextSilent", "continueTextLoop", "guardPendingText", "guardDoneText", "loopText"] },
1058
+ { id: "safety", fields: ["guardTools", "loopGuard", "loopShortChars", "loopWindowMs", "loopShortCount", "loopRepeatText", "loopToolRepeat"] },
1059
+ { id: "status", fields: ["verbose"] }
1060
+ ];
1061
+ var textDefaults = {
1062
+ continueText: "default.continueText",
1063
+ continueTextMaxTokens: "default.continueTextMaxTokens",
1064
+ continueTextSilent: "default.continueTextSilent",
1065
+ continueTextLoop: "default.continueTextLoop",
1066
+ guardPendingText: "default.guardPendingText",
1067
+ guardDoneText: "default.guardDoneText",
1068
+ loopText: "default.loopText"
1069
+ };
1254
1070
  function GitHubMark() {
1255
1071
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 2.4a9.8 9.8 0 0 0-3.1 19.1c.5.1.7-.2.7-.5v-1.9c-2.8.6-3.4-1.2-3.4-1.2-.5-1.1-1.1-1.4-1.1-1.4-.9-.6.1-.6.1-.6 1 0 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.4-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-4.9 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.8 1a9.5 9.5 0 0 1 5 0c1.9-1.3 2.8-1 2.8-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.8-2.3 4.6-4.6 4.9.4.3.7.9.7 1.8V21c0 .3.2.6.7.5A9.8 9.8 0 0 0 12 2.4Z" }) });
1256
1072
  }
1257
- function ExternalMark() {
1258
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: [
1259
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M6 3h7v7M13 3 7 9" }),
1260
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M11 9v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3" })
1261
- ] });
1262
- }
1263
- function RelayJourney(props) {
1264
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcJourney", children: [
1265
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcJourneyStep dshAcJourneyInterrupted", children: [
1266
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcJourneyDot", "aria-hidden": "true" }),
1267
- props.t("flow.interrupted")
1073
+ function RepositoryInvite({ t }) {
1074
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("aside", { className: "dshAcRepository", children: [
1075
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcStar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m12 3 2.78 5.63L21 9.53l-4.5 4.39 1.06 6.2L12 17.2l-5.56 2.92 1.06-6.2L3 9.53l6.22-.9L12 3Z" }) }) }),
1076
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcRepositoryCopy", children: [
1077
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: t("repo.star") }),
1078
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("repo.note") })
1268
1079
  ] }),
1269
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcJourneyLine", "aria-hidden": "true" }),
1270
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcJourneyStep dshAcJourneyGrace", children: [
1271
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcJourneyDot", "aria-hidden": "true" }),
1272
- props.t("flow.grace")
1273
- ] }),
1274
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcJourneyLine", "aria-hidden": "true" }),
1275
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcJourneyStep dshAcJourneyContinue", children: [
1276
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcJourneyDot", "aria-hidden": "true" }),
1277
- props.t("flow.continue")
1080
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("a", { className: "dshAcGithub", href: REPOSITORY_URL, target: "_blank", rel: "noopener noreferrer", "aria-label": t("repo.aria"), children: [
1081
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GitHubMark, {}),
1082
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcGithubLong", children: t("repo.link") }),
1083
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcGithubShort", children: "GitHub" }),
1084
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { className: "dshAcExternal", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M6 3h7v7M13 3 7 9M11 9v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3" }) })
1278
1085
  ] })
1279
1086
  ] });
1280
1087
  }
1281
- function SettingsCard(props) {
1282
- const [open, setOpen] = (0, import_react.useState)(false);
1283
- const { state: state2 } = props;
1284
- if (!state2.available) return null;
1285
- const title = props.t(props.titleKey);
1286
- const blocked = !state2.dirty || state2.invalid || state2.saving;
1287
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: open ? "dshAcCard dshAcCardOpen" : "dshAcCard", children: [
1288
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcHeaderFrame", children: [
1289
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1290
- "button",
1291
- {
1292
- type: "button",
1293
- className: "dshAcHeader",
1294
- "aria-expanded": open,
1295
- "aria-label": `${props.t(open ? "chrome.collapse" : "chrome.expand")}: ${title}`,
1296
- title: props.t(props.descriptionKey),
1297
- onClick: () => setOpen(!open),
1298
- children: [
1299
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcRelayMark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RelayMark, {}) }),
1300
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcHeadText", children: [
1301
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcName", children: title }),
1302
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcDescription", children: props.t(props.descriptionKey) }),
1303
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RelayJourney, { t: props.t })
1304
- ] }),
1305
- state2.dirty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcPending", title: props.t("chrome.unsaved"), children: props.t("chrome.unsaved") }) : null,
1306
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: open ? "dshAcChevron dshAcChevronOpen" : "dshAcChevron", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChevronMark, {}) })
1307
- ]
1308
- }
1309
- ),
1310
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1311
- "a",
1088
+ function SettingField({ name, id, state: state2, actions, disabled, t }) {
1089
+ const boolean = typeof DEFAULT_CONFIG[name] === "boolean";
1090
+ const numeric = typeof DEFAULT_CONFIG[name] === "number";
1091
+ const label = t(`field.${name}`);
1092
+ const hint = t(`field.${name}Hint`);
1093
+ const value = state2.text === "" ? DEFAULT_CONFIG[name] : state2.text === "true";
1094
+ const placeholderKey = textDefaults[name];
1095
+ const placeholder = placeholderKey ? t(placeholderKey) : name === "retryableErrorPatterns" ? t("field.retryableErrorPatternsPlaceholder") : String(DEFAULT_CONFIG[name]);
1096
+ const common = { id, disabled, "aria-describedby": `${id}-hint`, "aria-invalid": state2.invalid || void 0, value: state2.text, onChange: (event) => actions.edit(name, event.target.value) };
1097
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `dshAcField${!boolean && !numeric ? " dshAcFieldText" : ""}`, "data-field": name, children: [
1098
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcFieldCopy", children: [
1099
+ boolean ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcLabel", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "dshAcLabel", htmlFor: id, children: label }),
1100
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: state2.invalid ? "dshAcInvalid" : "dshAcHint", id: `${id}-hint`, children: state2.invalid ? t("chrome.invalidNumber") : hint })
1101
+ ] }),
1102
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcFieldControl", children: [
1103
+ state2.overridden && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dshAcReset", disabled, "aria-label": `${t("chrome.reset")}: ${label}`, onClick: () => actions.resetField(name), children: t("chrome.reset") }),
1104
+ boolean ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcSwitchTarget", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1105
+ NativeSwitch,
1312
1106
  {
1313
- className: "dshAcGithub",
1314
- href: REPOSITORY_URL,
1315
- target: "_blank",
1316
- rel: "noreferrer",
1317
- "aria-label": props.t("repo.aria"),
1318
- children: [
1319
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcGithubIcon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GitHubMark, {}) }),
1320
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcGithubText", children: [
1321
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcGithubAction", children: props.t("repo.star") }),
1322
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcGithubSlug", children: REPOSITORY_SLUG })
1323
- ] }),
1324
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcExternal", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ExternalMark, {}) })
1325
- ]
1107
+ label,
1108
+ title: hint,
1109
+ disabled,
1110
+ checked: name === "paused" ? !value : Boolean(value),
1111
+ onChange: (checked) => actions.edit(name, String(name === "paused" ? !checked : checked))
1326
1112
  }
1327
- )
1328
- ] }),
1329
- open ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcBody", children: [
1330
- !state2.writable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dshAcReadOnly", role: "status", children: props.t("chrome.readOnly") }) : null,
1331
- props.children,
1332
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcFooter", children: [
1333
- state2.failed ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dshAcFailed", role: "status", children: props.t("chrome.saveFailed") }) : null,
1334
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1335
- "button",
1336
- {
1337
- type: "button",
1338
- className: "dshAcDiscard",
1339
- disabled: !state2.dirty || state2.saving,
1340
- onClick: props.onDiscard,
1341
- children: props.t("chrome.discard")
1342
- }
1343
- ),
1344
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dshAcSave", disabled: blocked, onClick: props.onSave, children: props.t(!state2.saving ? "chrome.save" : "chrome.saving") })
1345
- ] })
1346
- ] }) : null
1347
- ] });
1348
- }
1349
- function ValueField(props) {
1350
- const className = props.invalid ? "dshAcInput dshAcInputInvalid" : "dshAcInput";
1351
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: props.wide === true ? "dshAcField dshAcFieldWide" : "dshAcField", children: [
1352
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcHead", children: [
1353
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "dshAcLabel", htmlFor: props.id, children: props.label }),
1354
- props.overridden ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcBadges", children: [
1355
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcBadge", children: props.t("chrome.overridden") }),
1356
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dshAcReset", disabled: props.disabled, onClick: props.onReset, children: props.t("chrome.reset") })
1357
- ] }) : null
1358
- ] }),
1359
- props.multiline === true ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1360
- "textarea",
1361
- {
1362
- id: props.id,
1363
- className: `${className} dshAcTextArea`,
1364
- "aria-invalid": props.invalid || void 0,
1365
- value: props.text,
1366
- placeholder: props.placeholder ?? "",
1367
- disabled: props.disabled,
1368
- rows: 4,
1369
- onChange: (event) => props.onEdit(event.target.value)
1370
- }
1371
- ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1372
- "input",
1373
- {
1374
- id: props.id,
1375
- className,
1376
- type: "text",
1377
- inputMode: props.numeric === true ? "numeric" : void 0,
1378
- "aria-invalid": props.invalid || void 0,
1379
- value: props.text,
1380
- placeholder: props.placeholder ?? "",
1381
- disabled: props.disabled,
1382
- onChange: (event) => props.onEdit(event.target.value)
1383
- }
1384
- ),
1385
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: props.invalid ? "dshAcInvalid" : "dshAcHint", children: props.invalid ? props.t("chrome.invalidNumber") : props.hint })
1386
- ] });
1387
- }
1388
- function BooleanField(props) {
1389
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: props.wide === true ? "dshAcField dshAcFieldWide" : "dshAcField", children: [
1390
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcHead", children: [
1391
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "dshAcLabel", htmlFor: props.id, children: props.label }),
1392
- props.overridden ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcBadges", children: [
1393
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcBadge", children: props.t("chrome.overridden") }),
1394
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dshAcReset", disabled: props.disabled, onClick: props.onReset, children: props.t("chrome.reset") })
1395
- ] }) : null
1396
- ] }),
1397
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1398
- "select",
1399
- {
1400
- id: props.id,
1401
- className: "dshAcSelect",
1402
- value: props.text,
1403
- disabled: props.disabled,
1404
- onChange: (event) => props.onEdit(event.target.value),
1405
- children: [
1406
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "", children: props.t("chrome.inherit") }),
1407
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "true", children: props.t("chrome.on") }),
1408
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "false", children: props.t("chrome.off") })
1409
- ]
1410
- }
1411
- ),
1412
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dshAcHint", children: props.hint })
1413
- ] });
1414
- }
1415
- function ComposerVisibilityField(props) {
1416
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcField dshAcFieldWide", children: [
1417
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcHead", children: [
1418
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcLabel", children: props.label }),
1419
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcBadges", children: [
1420
- props.overridden ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1421
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcBadge", children: props.t("chrome.overridden") }),
1422
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1423
- "button",
1424
- {
1425
- type: "button",
1426
- className: "dshAcReset",
1427
- disabled: props.disabled,
1428
- onClick: props.onReset,
1429
- children: props.t("chrome.reset")
1430
- }
1431
- )
1432
- ] }) : null,
1433
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcSwitchTarget", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1434
- NativeSwitch,
1435
- {
1436
- checked: props.text === "" ? DEFAULT_CONFIG.showComposerToggle : props.text === "true",
1437
- onChange: (checked) => props.onEdit(String(checked)),
1438
- label: props.label,
1439
- disabled: props.disabled
1440
- }
1441
- ) })
1442
- ] })
1443
- ] }),
1444
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dshAcHint", children: props.hint })
1445
- ] });
1446
- }
1447
- function SettingsSection(props) {
1448
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: `dshAcFormSection dshAcFormSection-${props.tone}`, children: [
1449
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "dshAcSectionHead", children: [
1450
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcSectionSignal", "aria-hidden": "true" }),
1451
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dshAcSectionCopy", children: [
1452
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcSectionTitle", children: props.t(props.titleKey) }),
1453
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcSectionDescription", children: props.t(props.descriptionKey) })
1454
- ] })
1455
- ] }),
1456
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dshAcSectionGrid", children: props.children })
1113
+ ) }) : numeric ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { ...common, className: "dshAcInput dshAcNumber", type: "text", inputMode: "numeric", placeholder }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", { ...common, className: "dshAcInput dshAcTextArea", rows: name === "retryableErrorPatterns" ? 3 : 2, placeholder })
1114
+ ] })
1457
1115
  ] });
1458
1116
  }
1459
1117
  function LivePanels(props) {
@@ -1573,478 +1231,73 @@ function LivePanels(props) {
1573
1231
  function AutoContinueSettingsCard(props) {
1574
1232
  const { t } = props;
1575
1233
  const state2 = props.useAutoContinueSettingsCard((snapshot) => snapshot);
1576
- const disabled = !state2.writable;
1577
- const shared = { t, disabled };
1578
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1579
- SettingsCard,
1580
- {
1581
- t,
1582
- titleKey: "card.title",
1583
- descriptionKey: "card.description",
1584
- state: state2,
1585
- onSave: props.save,
1586
- onDiscard: props.discard,
1587
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcFormCanvas", children: [
1588
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1589
- SettingsSection,
1590
- {
1591
- t,
1592
- titleKey: "section.handoff.title",
1593
- descriptionKey: "section.handoff.description",
1594
- tone: "handoff",
1595
- children: [
1596
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1597
- BooleanField,
1598
- {
1599
- wide: true,
1600
- id: "auto-continue-paused",
1601
- label: t("field.paused"),
1602
- hint: t("field.pausedHint"),
1603
- ...shared,
1604
- ...state2.paused,
1605
- onEdit: (text) => props.edit("paused", text),
1606
- onReset: () => props.resetField("paused")
1607
- }
1608
- ),
1609
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1610
- ComposerVisibilityField,
1611
- {
1612
- id: "auto-continue-show-composer-toggle",
1613
- label: t("field.showComposerToggle"),
1614
- hint: t("field.showComposerToggleHint"),
1615
- ...shared,
1616
- ...state2.showComposerToggle,
1617
- onEdit: (text) => props.edit("showComposerToggle", text),
1618
- onReset: () => props.resetField("showComposerToggle")
1619
- }
1620
- ),
1621
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1622
- ValueField,
1623
- {
1624
- id: "auto-continue-continue-text",
1625
- label: t("field.continueText"),
1626
- hint: t("field.continueTextHint"),
1627
- ...shared,
1628
- ...state2.continueText,
1629
- onEdit: (text) => props.edit("continueText", text),
1630
- placeholder: t("default.continueText"),
1631
- onReset: () => props.resetField("continueText")
1632
- }
1633
- ),
1634
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1635
- ValueField,
1636
- {
1637
- id: "auto-continue-continue-text-max-tokens",
1638
- label: t("field.continueTextMaxTokens"),
1639
- hint: t("field.continueTextMaxTokensHint"),
1640
- ...shared,
1641
- ...state2.continueTextMaxTokens,
1642
- onEdit: (text) => props.edit("continueTextMaxTokens", text),
1643
- placeholder: t("default.continueTextMaxTokens"),
1644
- onReset: () => props.resetField("continueTextMaxTokens")
1645
- }
1646
- ),
1647
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1648
- BooleanField,
1649
- {
1650
- wide: true,
1651
- id: "auto-continue-resume-silent-turns",
1652
- label: t("field.resumeSilentTurns"),
1653
- hint: t("field.resumeSilentTurnsHint"),
1654
- ...shared,
1655
- ...state2.resumeSilentTurns,
1656
- onEdit: (text) => props.edit("resumeSilentTurns", text),
1657
- onReset: () => props.resetField("resumeSilentTurns")
1658
- }
1659
- ),
1660
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1661
- ValueField,
1662
- {
1663
- wide: true,
1664
- id: "auto-continue-continue-text-silent",
1665
- label: t("field.continueTextSilent"),
1666
- hint: t("field.continueTextSilentHint"),
1667
- ...shared,
1668
- ...state2.continueTextSilent,
1669
- onEdit: (text) => props.edit("continueTextSilent", text),
1670
- placeholder: t("default.continueTextSilent"),
1671
- onReset: () => props.resetField("continueTextSilent")
1672
- }
1673
- )
1674
- ]
1675
- }
1676
- ),
1677
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1678
- SettingsSection,
1679
- {
1680
- t,
1681
- titleKey: "section.autoloop.title",
1682
- descriptionKey: "section.autoloop.description",
1683
- tone: "autoloop",
1684
- children: [
1685
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1686
- BooleanField,
1687
- {
1688
- wide: true,
1689
- id: "auto-continue-resume-completed-turns",
1690
- label: t("field.resumeCompletedTurns"),
1691
- hint: t("field.resumeCompletedTurnsHint"),
1692
- ...shared,
1693
- ...state2.resumeCompletedTurns,
1694
- onEdit: (text) => props.edit("resumeCompletedTurns", text),
1695
- onReset: () => props.resetField("resumeCompletedTurns")
1696
- }
1697
- ),
1698
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1699
- ValueField,
1700
- {
1701
- wide: true,
1702
- id: "auto-continue-continue-text-loop",
1703
- label: t("field.continueTextLoop"),
1704
- hint: t("field.continueTextLoopHint"),
1705
- ...shared,
1706
- ...state2.continueTextLoop,
1707
- onEdit: (text) => props.edit("continueTextLoop", text),
1708
- placeholder: t("default.continueTextLoop"),
1709
- onReset: () => props.resetField("continueTextLoop")
1710
- }
1711
- )
1712
- ]
1713
- }
1714
- ),
1715
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1716
- SettingsSection,
1717
- {
1718
- t,
1719
- titleKey: "section.safety.title",
1720
- descriptionKey: "section.safety.description",
1721
- tone: "safety",
1722
- children: [
1723
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1724
- BooleanField,
1725
- {
1726
- wide: true,
1727
- id: "auto-continue-guard-tools",
1728
- label: t("field.guardTools"),
1729
- hint: t("field.guardToolsHint"),
1730
- ...shared,
1731
- ...state2.guardTools,
1732
- onEdit: (text) => props.edit("guardTools", text),
1733
- onReset: () => props.resetField("guardTools")
1734
- }
1735
- ),
1736
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1737
- ValueField,
1738
- {
1739
- wide: true,
1740
- id: "auto-continue-guard-pending-text",
1741
- label: t("field.guardPendingText"),
1742
- hint: t("field.guardPendingTextHint"),
1743
- ...shared,
1744
- ...state2.guardPendingText,
1745
- onEdit: (text) => props.edit("guardPendingText", text),
1746
- placeholder: t("default.guardPendingText"),
1747
- onReset: () => props.resetField("guardPendingText")
1748
- }
1749
- ),
1750
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1751
- ValueField,
1752
- {
1753
- wide: true,
1754
- id: "auto-continue-guard-done-text",
1755
- label: t("field.guardDoneText"),
1756
- hint: t("field.guardDoneTextHint"),
1757
- ...shared,
1758
- ...state2.guardDoneText,
1759
- onEdit: (text) => props.edit("guardDoneText", text),
1760
- placeholder: t("default.guardDoneText"),
1761
- onReset: () => props.resetField("guardDoneText")
1762
- }
1763
- ),
1764
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1765
- ValueField,
1766
- {
1767
- id: "auto-continue-grace-ms",
1768
- label: t("field.graceMs"),
1769
- hint: t("field.graceMsHint"),
1770
- numeric: true,
1771
- ...shared,
1772
- ...state2.graceMs,
1773
- onEdit: (text) => props.edit("graceMs", text),
1774
- onReset: () => props.resetField("graceMs")
1775
- }
1776
- ),
1777
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1778
- ValueField,
1779
- {
1780
- id: "auto-continue-cooldown-ms",
1781
- label: t("field.cooldownMs"),
1782
- hint: t("field.cooldownMsHint"),
1783
- numeric: true,
1784
- ...shared,
1785
- ...state2.cooldownMs,
1786
- onEdit: (text) => props.edit("cooldownMs", text),
1787
- onReset: () => props.resetField("cooldownMs")
1788
- }
1789
- ),
1790
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1791
- ValueField,
1792
- {
1793
- id: "auto-continue-max-consecutive",
1794
- label: t("field.maxConsecutive"),
1795
- hint: t("field.maxConsecutiveHint"),
1796
- numeric: true,
1797
- ...shared,
1798
- ...state2.maxConsecutive,
1799
- onEdit: (text) => props.edit("maxConsecutive", text),
1800
- onReset: () => props.resetField("maxConsecutive")
1801
- }
1802
- )
1803
- ]
1804
- }
1805
- ),
1806
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1807
- SettingsSection,
1808
- {
1809
- t,
1810
- titleKey: "section.recovery.title",
1811
- descriptionKey: "section.recovery.description",
1812
- tone: "recovery",
1813
- children: [
1814
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1815
- BooleanField,
1816
- {
1817
- id: "auto-continue-scan-on-boot",
1818
- label: t("field.scanOnBoot"),
1819
- hint: t("field.scanOnBootHint"),
1820
- ...shared,
1821
- ...state2.scanOnBoot,
1822
- onEdit: (text) => props.edit("scanOnBoot", text),
1823
- onReset: () => props.resetField("scanOnBoot")
1824
- }
1825
- ),
1826
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1827
- BooleanField,
1828
- {
1829
- id: "auto-continue-classify",
1830
- label: t("field.classify"),
1831
- hint: t("field.classifyHint"),
1832
- ...shared,
1833
- ...state2.classify,
1834
- onEdit: (text) => props.edit("classify", text),
1835
- onReset: () => props.resetField("classify")
1836
- }
1837
- ),
1838
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1839
- ValueField,
1840
- {
1841
- id: "auto-continue-scan-limit",
1842
- label: t("field.scanLimit"),
1843
- hint: t("field.scanLimitHint"),
1844
- numeric: true,
1845
- ...shared,
1846
- ...state2.scanLimit,
1847
- onEdit: (text) => props.edit("scanLimit", text),
1848
- onReset: () => props.resetField("scanLimit")
1849
- }
1850
- ),
1851
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1852
- ValueField,
1853
- {
1854
- id: "auto-continue-fresh-ms",
1855
- label: t("field.freshMs"),
1856
- hint: t("field.freshMsHint"),
1857
- numeric: true,
1858
- ...shared,
1859
- ...state2.freshMs,
1860
- onEdit: (text) => props.edit("freshMs", text),
1861
- onReset: () => props.resetField("freshMs")
1862
- }
1863
- ),
1864
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1865
- ValueField,
1866
- {
1867
- wide: true,
1868
- id: "auto-continue-retryable-error-patterns",
1869
- label: t("field.retryableErrorPatterns"),
1870
- hint: t("field.retryableErrorPatternsHint"),
1871
- multiline: true,
1872
- ...shared,
1873
- ...state2.retryableErrorPatterns,
1874
- onEdit: (text) => props.edit("retryableErrorPatterns", text),
1875
- placeholder: t("field.retryableErrorPatternsPlaceholder"),
1876
- onReset: () => props.resetField("retryableErrorPatterns")
1877
- }
1878
- ),
1879
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1880
- ValueField,
1881
- {
1882
- id: "auto-continue-backoff-factor",
1883
- label: t("field.backoffFactor"),
1884
- hint: t("field.backoffFactorHint"),
1885
- numeric: true,
1886
- ...shared,
1887
- ...state2.backoffFactor,
1888
- onEdit: (text) => props.edit("backoffFactor", text),
1889
- onReset: () => props.resetField("backoffFactor")
1890
- }
1891
- ),
1892
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1893
- ValueField,
1894
- {
1895
- id: "auto-continue-backoff-max",
1896
- label: t("field.backoffMaxMs"),
1897
- hint: t("field.backoffMaxMsHint"),
1898
- numeric: true,
1899
- ...shared,
1900
- ...state2.backoffMaxMs,
1901
- onEdit: (text) => props.edit("backoffMaxMs", text),
1902
- onReset: () => props.resetField("backoffMaxMs")
1903
- }
1904
- ),
1905
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1906
- BooleanField,
1907
- {
1908
- id: "auto-continue-notify",
1909
- label: t("field.notify"),
1910
- hint: t("field.notifyHint"),
1911
- ...shared,
1912
- ...state2.notify,
1913
- onEdit: (text) => props.edit("notify", text),
1914
- onReset: () => props.resetField("notify")
1915
- }
1916
- ),
1917
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1918
- BooleanField,
1919
- {
1920
- id: "auto-continue-verbose",
1921
- label: t("field.verbose"),
1922
- hint: t("field.verboseHint"),
1923
- ...shared,
1924
- ...state2.verbose,
1925
- onEdit: (text) => props.edit("verbose", text),
1926
- onReset: () => props.resetField("verbose")
1927
- }
1928
- )
1929
- ]
1930
- }
1931
- ),
1932
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1933
- SettingsSection,
1234
+ const [active, setActive] = (0, import_react.useState)("general");
1235
+ const prefix = (0, import_react.useId)();
1236
+ const group = groups.find((item) => item.id === active);
1237
+ if (!state2.available) return null;
1238
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: "dshAcCard", children: [
1239
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "dshAcHeaderFrame", children: [
1240
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcIntroduction", children: [
1241
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcTitleLine", children: [
1242
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { children: t("card.title") }),
1243
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcStatus", children: t(state2.enabled ? "chrome.enabled" : "chrome.paused") })
1244
+ ] }),
1245
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t("card.description") })
1246
+ ] }),
1247
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RepositoryInvite, { t })
1248
+ ] }),
1249
+ !state2.writable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dshAcReadOnly", role: "status", children: t("chrome.readOnly") }),
1250
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcLayout", children: [
1251
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dshAcNav", role: "tablist", "aria-label": t("chrome.categories"), children: groups.map((item, index) => {
1252
+ const invalid = item.fields.some((name) => state2[name].invalid);
1253
+ const title = t(`category.${item.id}.title`);
1254
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1255
+ "button",
1934
1256
  {
1935
- t,
1936
- titleKey: "section.loop.title",
1937
- descriptionKey: "section.loop.description",
1938
- tone: "loop",
1257
+ type: "button",
1258
+ role: "tab",
1259
+ id: `${prefix}-tab-${item.id}`,
1260
+ "data-category": item.id,
1261
+ "aria-controls": `${prefix}-panel-${item.id}`,
1262
+ "aria-selected": active === item.id,
1263
+ tabIndex: active === item.id ? 0 : -1,
1264
+ "aria-label": invalid ? `${title}: ${t("chrome.invalidNumber")}` : title,
1265
+ onClick: () => setActive(item.id),
1266
+ onKeyDown: (event) => {
1267
+ const offset = ["ArrowRight", "ArrowDown"].includes(event.key) ? 1 : ["ArrowLeft", "ArrowUp"].includes(event.key) ? -1 : 0;
1268
+ if (!offset && event.key !== "Home" && event.key !== "End") return;
1269
+ event.preventDefault();
1270
+ const next = event.key === "Home" ? 0 : event.key === "End" ? groups.length - 1 : (index + offset + groups.length) % groups.length;
1271
+ setActive(groups[next].id);
1272
+ const button = event.currentTarget.parentElement?.querySelectorAll('[role="tab"]')[next];
1273
+ button?.focus();
1274
+ button?.scrollIntoView({ block: "nearest", inline: "nearest" });
1275
+ },
1939
1276
  children: [
1940
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1941
- BooleanField,
1942
- {
1943
- wide: true,
1944
- id: "auto-continue-loop-guard",
1945
- label: t("field.loopGuard"),
1946
- hint: t("field.loopGuardHint"),
1947
- ...shared,
1948
- ...state2.loopGuard,
1949
- onEdit: (text) => props.edit("loopGuard", text),
1950
- onReset: () => props.resetField("loopGuard")
1951
- }
1952
- ),
1953
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1954
- ValueField,
1955
- {
1956
- id: "auto-continue-loop-short-chars",
1957
- label: t("field.loopShortChars"),
1958
- hint: t("field.loopShortCharsHint"),
1959
- numeric: true,
1960
- ...shared,
1961
- ...state2.loopShortChars,
1962
- onEdit: (text) => props.edit("loopShortChars", text),
1963
- onReset: () => props.resetField("loopShortChars")
1964
- }
1965
- ),
1966
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1967
- ValueField,
1968
- {
1969
- id: "auto-continue-loop-window-ms",
1970
- label: t("field.loopWindowMs"),
1971
- hint: t("field.loopWindowMsHint"),
1972
- numeric: true,
1973
- ...shared,
1974
- ...state2.loopWindowMs,
1975
- onEdit: (text) => props.edit("loopWindowMs", text),
1976
- onReset: () => props.resetField("loopWindowMs")
1977
- }
1978
- ),
1979
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1980
- ValueField,
1981
- {
1982
- id: "auto-continue-loop-short-count",
1983
- label: t("field.loopShortCount"),
1984
- hint: t("field.loopShortCountHint"),
1985
- numeric: true,
1986
- ...shared,
1987
- ...state2.loopShortCount,
1988
- onEdit: (text) => props.edit("loopShortCount", text),
1989
- onReset: () => props.resetField("loopShortCount")
1990
- }
1991
- ),
1992
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1993
- ValueField,
1994
- {
1995
- id: "auto-continue-loop-repeat-text",
1996
- label: t("field.loopRepeatText"),
1997
- hint: t("field.loopRepeatTextHint"),
1998
- numeric: true,
1999
- ...shared,
2000
- ...state2.loopRepeatText,
2001
- onEdit: (text) => props.edit("loopRepeatText", text),
2002
- onReset: () => props.resetField("loopRepeatText")
2003
- }
2004
- ),
2005
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2006
- ValueField,
2007
- {
2008
- id: "auto-continue-loop-tool-repeat",
2009
- label: t("field.loopToolRepeat"),
2010
- hint: t("field.loopToolRepeatHint"),
2011
- numeric: true,
2012
- ...shared,
2013
- ...state2.loopToolRepeat,
2014
- onEdit: (text) => props.edit("loopToolRepeat", text),
2015
- onReset: () => props.resetField("loopToolRepeat")
2016
- }
2017
- ),
2018
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2019
- ValueField,
2020
- {
2021
- wide: true,
2022
- id: "auto-continue-loop-text",
2023
- label: t("field.loopText"),
2024
- hint: t("field.loopTextHint"),
2025
- ...shared,
2026
- ...state2.loopText,
2027
- onEdit: (text) => props.edit("loopText", text),
2028
- placeholder: t("default.loopText"),
2029
- onReset: () => props.resetField("loopText")
2030
- }
2031
- )
1277
+ title,
1278
+ invalid && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dshAcInvalidMark", "aria-hidden": "true", children: "!" })
2032
1279
  ]
2033
- }
2034
- ),
2035
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2036
- SettingsSection,
2037
- {
2038
- t,
2039
- titleKey: "section.live.title",
2040
- descriptionKey: "section.live.description",
2041
- tone: "live",
2042
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LivePanels, { t })
2043
- }
2044
- )
1280
+ },
1281
+ item.id
1282
+ );
1283
+ }) }),
1284
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dshAcCategory", role: "tabpanel", id: `${prefix}-panel-${active}`, "aria-labelledby": `${prefix}-tab-${active}`, children: [
1285
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dshAcCategoryHeading", children: [
1286
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { children: t(`category.${active}.title`) }),
1287
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t(`category.${active}.description`) })
1288
+ ] }),
1289
+ group.fields.map((name) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SettingField, { name, id: `${prefix}-${name}`, state: state2[name], actions: props, disabled: !state2.writable, t }, name)),
1290
+ active === "status" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LivePanels, { t })
2045
1291
  ] })
2046
- }
2047
- );
1292
+ ] }),
1293
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", { className: "dshAcFooter", "data-dirty": state2.dirty, children: [
1294
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: state2.failed || state2.invalid ? "dshAcInvalid" : "dshAcHint", role: "status", children: t(state2.failed ? "chrome.saveFailed" : state2.invalid ? "chrome.invalidNumber" : state2.saving ? "chrome.saving" : state2.dirty ? "chrome.unsaved" : state2.notificationFeedback ?? "chrome.saved") }),
1295
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
1296
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dshAcDiscard", disabled: !state2.dirty || state2.saving, onClick: props.discard, children: t("chrome.discard") }),
1297
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dshAcSave", disabled: !state2.dirty || state2.invalid || state2.saving || !state2.writable, onClick: props.save, children: t(state2.saving ? "chrome.saving" : "chrome.save") })
1298
+ ] })
1299
+ ] })
1300
+ ] });
2048
1301
  }
2049
1302
 
2050
1303
  // src/client/composer-toggle.tsx
@@ -2104,7 +1357,7 @@ function mountSettings(ctx, scope) {
2104
1357
  ctx.effect(() => scope.subscribe(syncLocale), "auto-continue: locale settings sync");
2105
1358
  ctx.on("locale/change", syncLocale);
2106
1359
  syncLocale();
2107
- const controller = new AutoContinueSettingsCardController(scope);
1360
+ const controller = new AutoContinueSettingsCardController(scope, () => ctx.locale.getLocale().active);
2108
1361
  ctx.effect(() => () => controller.dispose(), "auto-continue: settings form");
2109
1362
  ctx.slots.inject(
2110
1363
  "conversation.input.left",