@oh-my-dsh/dsh-better-subagent 0.5.5-alpha.1 → 0.5.6-alpha.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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/lib/client.js +168 -352
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -42,7 +42,7 @@
42
42
 
43
43
  ```sh
44
44
  # 只安装这个插件
45
- dsh plugin --profile <profile> add @oh-my-dsh/dsh-better-subagent@0.5.5-alpha.1
45
+ dsh plugin --profile <profile> add @oh-my-dsh/dsh-better-subagent@0.5.6-alpha.1
46
46
 
47
47
  # 或安装 Better DSH(会自动带上所有独立插件)
48
48
  dsh plugin --profile <profile> add dsh-better-dsh@0.11.7
@@ -57,7 +57,7 @@ dsh plugin --profile <profile> add dsh-better-dsh@0.11.7
57
57
  | 稳定行 id | `dsh-better-subagent` |
58
58
  | 入口 / 工具 | `wait_subagent` · `/better-subagent/api/*` · 子代理设置页 |
59
59
  | 设置 | `childExitGuard`、`delegation.prompt`、`tiers.*`、两个 CLI 后端、`trustedHosts` |
60
- | npm 包 | `@oh-my-dsh/dsh-better-subagent@0.5.5-alpha.1` |
60
+ | npm 包 | `@oh-my-dsh/dsh-better-subagent@0.5.6-alpha.1` |
61
61
  | 仓库 | https://github.com/omdsh-dev/dsh-better-subagent |
62
62
 
63
63
  ## 设置
package/lib/client.js CHANGED
@@ -136,7 +136,7 @@ var zh = {
136
136
  globalOverrides: "\u6240\u6709\u9884\u8BBE\u5DF2\u5305\u542B\u5DE5\u7A0B\u9884\u8BBE\u3002",
137
137
  summary: "\u5B50\u4EE3\u7406\u6A21\u578B\u3001\u672C\u673A Codex / Claude \u4E0E\u8FD0\u884C\u8BBE\u7F6E",
138
138
  title: "\u5B50\u4EE3\u7406",
139
- intro: "\u4FDD\u5B58\u540E\u5373\u65F6\u751F\u6548\u3002",
139
+ intro: "\u51B3\u5B9A\u5B50\u4EE3\u7406\u4F7F\u7528\u54EA\u4E2A\u6A21\u578B\u3001\u4F55\u65F6\u7B49\u5F85\uFF0C\u4EE5\u53CA\u672C\u673A Codex / Claude \u662F\u5426\u53EF\u7528\u3002",
140
140
  loading: "\u6B63\u5728\u52A0\u8F7D\u8BBE\u7F6E\u2026",
141
141
  waitingForm: "\u6B63\u5728\u52A0\u8F7D\u8BBE\u7F6E\u2026",
142
142
  noFormHint: "\u6682\u65F6\u65E0\u6CD5\u52A0\u8F7D\u8BBE\u7F6E\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u6216\u68C0\u67E5\u8FDE\u63A5\u3002",
@@ -157,7 +157,7 @@ var zh = {
157
157
  tierRouteLabel: "{tier}\u6A21\u578B",
158
158
  tierEffortLabel: "{tier}\u601D\u8003\u5F3A\u5EA6",
159
159
  tierOffList: "(\u4E0D\u53EF\u7528) {route}",
160
- tiersInactive: "\u8BF7\u5148\u5728\u300C\u63D2\u4EF6 \u2192 \u5B50\u4EE3\u7406 \u2192 \u6A21\u578B\u9009\u62E9\u300D\u542F\u7528\u5E76\u6DFB\u52A0\u53EF\u7528\u6A21\u578B\uFF1B\u5F53\u524D\u4ECD\u53EF\u6CBF\u7528\u4E3B\u4F1A\u8BDD\u6A21\u578B\u3002",
160
+ tiersInactive: "\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7684\u6A21\u578B\u540D\u5355\uFF0C\u4E24\u6863\u53EA\u80FD\u6CBF\u7528\u4E3B\u4F1A\u8BDD\u6A21\u578B\uFF1B\u5728\u5BBF\u4E3B\u7684\u6A21\u578B\u8BBE\u7F6E\u91CC\u542F\u7528\u540E\u53EF\u5728\u8FD9\u91CC\u9009\u62E9\u5177\u4F53\u6A21\u578B\u3002",
161
161
  routesLoading: "\u6B63\u5728\u8BFB\u53D6\u53EF\u7528\u6A21\u578B\u2026",
162
162
  routesError: "\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u5237\u65B0\u91CD\u8BD5\u3002",
163
163
  invalidTierRoute: "{backend}\u6240\u9009\u6A21\u578B\u4E0D\u53EF\u7528\uFF0C\u8BF7\u6539\u9009\u6216\u6CBF\u7528\u4E3B\u4F1A\u8BDD\u6A21\u578B\u3002",
@@ -298,7 +298,7 @@ var en = {
298
298
  globalOverrides: "All presets already includes engineering presets.",
299
299
  summary: "Subagent models, local Codex / Claude and run settings",
300
300
  title: "Subagents",
301
- intro: "Changes apply after saving.",
301
+ intro: "Set which models subagents use, when to wait for them, and whether local Codex / Claude is available.",
302
302
  loading: "Loading settings\u2026",
303
303
  waitingForm: "Loading settings\u2026",
304
304
  noFormHint: "Settings are not loading. Refresh the page or check your connection.",
@@ -319,7 +319,7 @@ var en = {
319
319
  tierRouteLabel: "{tier} model",
320
320
  tierEffortLabel: "{tier} thinking effort",
321
321
  tierOffList: "(unavailable) {route}",
322
- tiersInactive: "Enable and add models in Plugins \u2192 Subagent \u2192 Model selection first. You can still use the main conversation model.",
322
+ tiersInactive: "No models are allowed right now, so both tiers inherit the main conversation model. Allow models in the host model settings to choose one here.",
323
323
  routesLoading: "Loading available models\u2026",
324
324
  routesError: "Available models could not be loaded. Refresh to try again.",
325
325
  invalidTierRoute: "The {backend} model is unavailable. Choose another or use the main conversation model.",
@@ -405,35 +405,25 @@ var STYLE_ID = "@oh-my-dsh/dsh-better-subagent/settings.css";
405
405
  var CSS = `.bs-root{--cfg-accent:var(--dsw-alias-state-business-primary,#4176e6);--cfg-accent-solid:var(--dsw-alias-button-primary-fill,#0f1115);--cfg-accent-fg:var(--dsw-alias-label-primary-foreground,#fff);--cfg-accent-text:color-mix(in srgb,var(--cfg-accent) 72%,var(--cfg-ink));--cfg-accent-hover:color-mix(in srgb,var(--cfg-accent-solid) 88%,var(--cfg-bg));--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 10%,transparent);--cfg-bg:var(--dsw-alias-bg-layer-1);--cfg-raised:var(--dsw-alias-bg-layer-2);--cfg-overlay:var(--dsw-alias-bg-layer-3);--cfg-sunken:color-mix(in srgb,var(--dsw-alias-label-primary) 4%,var(--dsw-alias-bg-layer-1));--cfg-ink:var(--dsw-alias-label-primary);--cfg-muted:var(--dsw-alias-label-secondary);--cfg-dim:color-mix(in srgb,var(--dsw-alias-label-tertiary) 80%,var(--cfg-ink));--cfg-line:var(--dsw-alias-border-l2);--cfg-line-strong:var(--dsw-alias-border-l3);--cfg-hover:var(--dsw-alias-interactive-bg-hover);--cfg-danger:var(--dsw-alias-state-error-primary);--cfg-warn:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 60%,var(--cfg-ink));--cfg-success:color-mix(in srgb,var(--dsw-alias-state-success-primary) 60%,var(--cfg-ink));--cfg-mono:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);color:var(--cfg-ink);font:inherit;font-size:13px;line-height:20px;font-variant-numeric:tabular-nums;min-width:0;width:100%;--bs-action-size:32px;container:bs-settings / inline-size}
406
406
  .bs-root *{box-sizing:border-box}
407
407
  .bs-root [hidden]{display:none!important}
408
- .bs-cfg{display:flex;flex-direction:column;gap:20px;max-width:960px;width:100%;margin:0 auto;min-width:0}
409
- .bs-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-height:32px}
408
+ .bs-cfg{display:flex;flex-direction:column;gap:0;max-width:none;width:100%;margin:0;min-width:0}
409
+ .bs-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-height:0;padding:2px 0 14px}
410
410
  .bs-headerMain{display:flex;flex-direction:column;gap:2px;min-width:0}
411
411
  .bs-headerIntro{color:var(--cfg-dim);font-size:12px;line-height:18px}
412
412
  .bs-headerMeta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
413
413
  .bs-title{margin:0;font-size:12px;line-height:18px;font-weight:500;color:var(--cfg-dim)}
414
- .bs-header .bs-title{font-size:20px;line-height:28px;letter-spacing:-.01em;color:var(--cfg-ink)}
415
- .bs-sectionTitle{margin:0;font-size:12px;line-height:18px;font-weight:500;color:var(--cfg-dim)}
416
- .bs-cardTitle{margin:0;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
414
+ .bs-header .bs-title{font-size:15px;line-height:22px;font-weight:500;letter-spacing:0;color:var(--cfg-ink)}
415
+ .bs-sectionTitle{margin:18px 0 0;font-size:14px;line-height:22px;font-weight:500;color:var(--cfg-ink)}
416
+ .bs-cardTitle{margin:0;font-size:14px;line-height:22px;font-weight:500;color:var(--cfg-ink)}
417
417
  .bs-hint,.bs-status{margin:0;color:var(--cfg-dim);font-size:12px;line-height:18px}
418
418
  .bs-hintWarn{color:var(--cfg-warn)}
419
419
  .bs-note{margin:0;padding:8px 10px;border:1px solid var(--cfg-line);border-radius:8px;background:var(--cfg-sunken);color:var(--cfg-muted);font-size:12px;line-height:18px}
420
420
  .bs-note[data-tone=error],.bs-hint[data-tone=error],.bs-status[data-tone=error]{color:var(--cfg-danger)}
421
421
  .bs-note[data-tone=warn]{border-color:var(--cfg-warn);color:var(--cfg-warn)}
422
422
  .bs-hint[data-tone=ok],.bs-status[data-tone=ok]{color:var(--cfg-success)}
423
- .bs-tabs{display:flex;gap:20px;padding:0;border-bottom:1px solid var(--cfg-line);overflow-x:auto;scrollbar-width:thin}
424
- .bs-tab{appearance:none;position:relative;flex:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;height:32px;padding:0 0 8px;border:0;border-radius:0;background:transparent;color:var(--cfg-muted);font:inherit;font-weight:500;cursor:pointer;white-space:nowrap}
425
- .bs-tab:hover{color:var(--cfg-ink)}
426
- .bs-tab[aria-selected=true]{color:var(--cfg-ink)}
427
- .bs-tab[aria-selected=true]::after{content:"";position:absolute;inset-inline:0;bottom:0;height:1px;background:var(--cfg-accent)}
428
- .bs-subtabs{align-self:flex-start;gap:16px;padding:0;border:0;border-bottom:1px solid var(--cfg-line);border-radius:0;background:transparent}
429
- .bs-subtabs .bs-tab{height:32px;padding:0 0 7px;border:0;border-radius:0;font-weight:400}
430
- .bs-subtabs .bs-tab:hover{background:transparent;color:var(--cfg-ink)}
431
- .bs-subtabs .bs-tab[aria-selected=true]{background:transparent;border:0;color:var(--cfg-ink);font-weight:500}
432
- .bs-tabpanel{display:flex;flex-direction:column;gap:20px;min-width:0}
433
- .bs-section{display:flex;flex-direction:column;gap:6px;min-width:0}
434
- .bs-sectionHead,.bs-cardHead{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}
423
+ .bs-section{display:flex;flex-direction:column;gap:4px;min-width:0}
424
+ .bs-sectionHead,.bs-cardHead{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:22px}
435
425
  .bs-toolbar{display:flex;align-items:center;gap:8px;min-width:0}
436
- .bs-card{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px 14px;border:1px solid var(--cfg-line);border-radius:8px;background:var(--cfg-raised)}
426
+ .bs-card{display:flex;flex-direction:column;gap:10px;min-width:0;padding:14px 16px;border:1px solid var(--cfg-line);border-radius:12px;background:var(--cfg-raised)}
437
427
  .bs-cardBody{display:flex;flex-direction:column;gap:8px;min-width:0}
438
428
  .bs-cardHead .bs-switchRow{padding:0;gap:10px}
439
429
  .bs-cardHead .bs-switchLabel{color:var(--cfg-muted);font-weight:400}
@@ -465,9 +455,9 @@ var CSS = `.bs-root{--cfg-accent:var(--dsw-alias-state-business-primary,#4176e6)
465
455
  .bs-option[aria-selected=true]{color:var(--cfg-accent-text);background:var(--cfg-accent-soft)}
466
456
  .bs-optionCheck{width:12px;flex:none}
467
457
  .bs-optionLabel{min-width:0}
468
- .bs-switchRow{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:4px 0}
458
+ .bs-switchRow{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:4px 0}.bs-section>.bs-switchRow{padding:12px 0;border-bottom:1px solid var(--cfg-line)}.bs-section>.bs-switchRow:last-of-type{border-bottom:0;padding-bottom:8px}
469
459
  .bs-switchMain{flex:1;min-width:0}
470
- .bs-switchLabel{font-weight:500}
460
+ .bs-switchLabel{font-weight:400;font-size:14px;line-height:22px}
471
461
  .bs-switch{appearance:none;display:flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:6px;background:transparent;cursor:pointer}
472
462
  .bs-switchTrack{display:block;width:32px;height:18px;padding:2px;border:1px solid var(--cfg-line-strong);border-radius:9px;background:var(--cfg-sunken)}
473
463
  .bs-switch:hover:not(:disabled) .bs-switchTrack{border-color:var(--cfg-muted)}
@@ -505,25 +495,11 @@ var CSS = `.bs-root{--cfg-accent:var(--dsw-alias-state-business-primary,#4176e6)
505
495
  .bs-badge[data-active=true]{border-color:var(--cfg-accent);color:var(--cfg-accent-text)}
506
496
  .bs-dot{width:6px;height:6px;flex:none;border-radius:50%;background:var(--cfg-dim)}
507
497
  .bs-dot[data-active=true]{background:var(--cfg-accent)}
508
- .bs-overview{display:flex;flex-direction:column;gap:2px}
509
- .bs-overviewGlyph{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-raised);color:var(--cfg-muted)}
510
- .bs-overviewMeta{font-size:12px;line-height:18px;color:var(--cfg-dim);overflow-wrap:anywhere}
511
- .bs-overviewRow{appearance:none;display:flex;align-items:center;gap:12px;width:100%;padding:8px 6px;margin-inline:-6px;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;cursor:pointer;text-align:left}
512
- .bs-overviewRow:hover,.bs-overviewRow:active{background:var(--cfg-hover)}
513
- .bs-overviewName{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
514
- .bs-overviewName>span:first-child{font-weight:500}
515
- .bs-overviewRow>svg{color:var(--cfg-dim);flex:none}
516
- .bs-routingDiagram{display:flex;flex-direction:column;gap:2px;padding:2px 0 0;min-width:0}
498
+ .bs-routingDiagram{display:flex;flex-direction:column;gap:10px;padding:2px 0 0;min-width:0}
517
499
  .bs-routingSource{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 8px;border:1px solid var(--cfg-line);border-radius:8px;background:var(--cfg-sunken);min-width:0}
518
500
  .bs-routingSourceLabel{display:inline-flex;align-items:center;gap:6px;font-weight:500}
519
501
  .bs-routingSourceLabel::before{content:"";width:6px;height:6px;flex:none;border-radius:50%;background:var(--cfg-accent)}
520
- .bs-routing{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,1.1fr) auto;gap:8px 12px;align-items:center;padding:8px 8px 8px 12px;border:0;border-radius:8px;min-width:0}
521
- .bs-routing:hover{background:var(--cfg-hover)}
522
- .bs-routingBranchGlyph{color:var(--cfg-dim);font-family:var(--cfg-mono)}
523
- .bs-routingLabel{font-weight:500}
524
- .bs-routingModel{font-size:12px;line-height:18px;color:var(--cfg-muted);overflow-wrap:anywhere}
525
502
  .bs-routingNote{margin:2px 0 0}
526
- .bs-tierGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;min-width:0}
527
503
  .bs-tierCard{min-width:0}
528
504
  .bs-tierHead{display:flex;flex-direction:column;gap:2px;min-width:0}
529
505
  .bs-empty{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-sunken)}
@@ -533,17 +509,17 @@ var CSS = `.bs-root{--cfg-accent:var(--dsw-alias-state-business-primary,#4176e6)
533
509
  .bs-metric{display:flex;flex-direction:column;gap:2px;min-width:0;padding:8px 10px;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-sunken)}
534
510
  .bs-metricLabel{font-size:12px;line-height:18px;color:var(--cfg-dim)}
535
511
  .bs-metricValue{font-size:13px;line-height:20px;font-weight:500;overflow-wrap:anywhere}
536
- .bs-footer{position:sticky;bottom:0;z-index:10;display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 0;border-top:1px solid var(--cfg-line);background:var(--cfg-bg)}
512
+ .bs-footer{position:sticky;bottom:0;z-index:50;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:14px 0 18px;border-top:1px solid var(--cfg-line);background:var(--cfg-bg)}
537
513
  .bs-footer .bs-status{flex:1;min-width:140px;font-size:12px;line-height:18px;color:var(--cfg-dim)}
538
514
  .bs-errorLink{color:var(--cfg-danger);text-align:left;white-space:normal;height:auto;min-height:28px}
539
- .bs-feedback{min-height:20px}
540
515
  .bs-spinner{width:12px;height:12px;flex:none;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:bs-spin .7s linear infinite}
541
516
  @keyframes bs-spin{to{transform:rotate(360deg)}}
542
517
  .bs-pulse{animation:bs-pulse 2s ease infinite}
543
518
  @keyframes bs-pulse{50%{opacity:.55}}
544
- @container bs-settings (max-width:760px){.bs-fieldGrid,.bs-tierGrid{grid-template-columns:minmax(0,1fr)}.bs-metricGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
545
- @container bs-settings (max-width:640px){.bs-header .bs-title{font-size:18px}.bs-sectionHead,.bs-cardHead,.bs-toolbar{flex-wrap:wrap}.bs-field{grid-template-columns:minmax(0,1fr);gap:4px}.bs-fieldLabel{padding:0}.bs-modelHead{display:none}.bs-model{grid-template-columns:minmax(0,1fr) var(--bs-action-size);gap:8px}.bs-modelCell{grid-column:1}.bs-cellLabel{display:block;font-size:12px;line-height:18px}.bs-model .bs-iconButton{grid-column:2;grid-row:1}.bs-footer .bs-status{flex-basis:100%}.bs-connectionRow{align-items:flex-start;flex-direction:column;gap:4px;padding:6px 0}.bs-connectionRow .bs-hint{text-align:start}.bs-routing{grid-template-columns:minmax(0,1fr);gap:4px;padding:8px}.bs-routingBranchGlyph{display:none}.bs-overviewRow{flex-wrap:wrap}.bs-overviewRow>.bs-badge{white-space:normal}.bs-advancedSummary{white-space:normal}}
546
- @media(pointer:coarse),(max-width:640px){.bs-root{--bs-action-size:44px}.bs-input,.bs-select,.bs-button,.bs-iconButton,.bs-switch,.bs-tab,.bs-subtabs .bs-tab{height:44px;min-height:44px}.bs-textarea{min-height:88px}.bs-switch,.bs-iconButton{width:44px}.bs-option,.bs-advanced>summary{min-height:44px}}
519
+ @container bs-settings (max-width:520px){.bs-metricGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
520
+ @container bs-settings (max-width:760px){.bs-fieldGrid{grid-template-columns:minmax(0,1fr)}}
521
+ @container bs-settings (max-width:640px){.bs-header .bs-title{font-size:15px}.bs-sectionHead,.bs-cardHead,.bs-toolbar{flex-wrap:wrap}.bs-field{grid-template-columns:minmax(0,1fr);gap:4px}.bs-fieldLabel{padding:0}.bs-modelHead{display:none}.bs-model{grid-template-columns:minmax(0,1fr) var(--bs-action-size);gap:8px}.bs-modelCell{grid-column:1}.bs-cellLabel{display:block;font-size:12px;line-height:18px}.bs-model .bs-iconButton{grid-column:2;grid-row:1}.bs-connectionRow{align-items:flex-start;flex-direction:column;gap:4px;padding:6px 0}.bs-connectionRow .bs-hint{text-align:start}.bs-advancedSummary{white-space:normal}}
522
+ @media(pointer:coarse),(max-width:640px){.bs-root{--bs-action-size:44px}.bs-input,.bs-select,.bs-button,.bs-iconButton,.bs-switch{height:44px;min-height:44px}.bs-textarea{min-height:88px}.bs-switch,.bs-iconButton{width:44px}.bs-option,.bs-advanced>summary{min-height:44px}}
547
523
  @media(prefers-reduced-motion:reduce){.bs-root *{animation:none!important;transition:none!important}}`;
548
524
  function isRecord(value) {
549
525
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -749,9 +725,6 @@ function detectionOf(capabilities, spec, backend, translate) {
749
725
  }
750
726
  return translate("missing", { executable: backend.executable });
751
727
  }
752
- function Chevron() {
753
- return h("svg", { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, "aria-hidden": true }, h("path", { d: "m9 5 7 7-7 7" }));
754
- }
755
728
  function Advanced({ summary, children, detailsRef, label }) {
756
729
  return h(
757
730
  "details",
@@ -886,39 +859,6 @@ function Select({ children: options, value, onChange, disabled, id, className, .
886
859
  )
887
860
  );
888
861
  }
889
- function Tabs({ id, label, items, value, onChange, compact, tabRefs }) {
890
- const refs = (0, import_react.useRef)({});
891
- return h(
892
- "div",
893
- { className: compact ? "bs-tabs bs-subtabs" : "bs-tabs", role: "tablist", "aria-label": label },
894
- items.map((item, index) => h("button", {
895
- key: item.id,
896
- type: "button",
897
- className: "bs-tab",
898
- role: "tab",
899
- id: id + "-tab-" + item.id,
900
- "aria-controls": id + "-panel-" + item.id,
901
- "aria-selected": value === item.id,
902
- tabIndex: value === item.id ? 0 : -1,
903
- ref: (node) => {
904
- refs.current[item.id] = node;
905
- if (tabRefs) tabRefs.current[item.id] = node;
906
- },
907
- onClick: () => onChange(item.id),
908
- onKeyDown: (event) => {
909
- let next;
910
- if (event.key === "ArrowRight") next = (index + 1) % items.length;
911
- else if (event.key === "ArrowLeft") next = (index + items.length - 1) % items.length;
912
- else if (event.key === "Home") next = 0;
913
- else if (event.key === "End") next = items.length - 1;
914
- else return;
915
- event.preventDefault();
916
- onChange(items[next].id);
917
- refs.current[items[next].id]?.focus();
918
- }
919
- }, item.active === void 0 ? null : h("span", { className: "bs-dot", "data-active": item.active, "aria-hidden": true }), item.label))
920
- );
921
- }
922
862
  function Field({ id, label, hint, showHint = true, wide, children }) {
923
863
  const hintId = "bs-hint-" + (0, import_react.useId)().replace(/[^a-zA-Z0-9_-]/g, "");
924
864
  const control = hint === void 0 || children === null || typeof children !== "object" ? children : Array.isArray(children) ? children.map((child, at) => at === 0 && (0, import_react.isValidElement)(child) ? (0, import_react.cloneElement)(child, { key: child.key ?? "control", "aria-describedby": hintId }) : child) : (0, import_react.cloneElement)(children, { "aria-describedby": hintId });
@@ -1123,11 +1063,6 @@ function TierRow({ tier, value, allowed, disabled, t: translate, onPatch }) {
1123
1063
  { className: "bs-tierHead" },
1124
1064
  h("h3", { className: "bs-cardTitle" }, title),
1125
1065
  h("p", { className: "bs-hint" }, translate(TIER_HINT_KEYS[tier]))
1126
- ),
1127
- h(
1128
- "span",
1129
- { className: "bs-badge", "data-active": current !== "" },
1130
- current === "" ? translate("tierInherit") : selected?.model ?? value.model
1131
1066
  )
1132
1067
  ),
1133
1068
  h(
@@ -1343,9 +1278,6 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1343
1278
  return () => clearTimeout(timer);
1344
1279
  }, [notice]);
1345
1280
  const [discovery, setDiscovery] = (0, import_react.useState)({});
1346
- const [tab, setTab] = (0, import_react.useState)("general");
1347
- const [backendTab, setBackendTab] = (0, import_react.useState)("codex");
1348
- const navigationTabs = (0, import_react.useRef)({});
1349
1281
  const latest = (0, import_react.useRef)(null);
1350
1282
  const requests = (0, import_react.useRef)({});
1351
1283
  const host = state?.status === "ready" ? shape(state.value) : null;
@@ -1510,7 +1442,6 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1510
1442
  const accepted = await form.mutate(ops, revision);
1511
1443
  if (accepted) {
1512
1444
  setNotice({ tone: "ok", text: translate("saved") });
1513
- navigationTabs.current[tab]?.focus();
1514
1445
  } else {
1515
1446
  setDraft(null);
1516
1447
  setGeneration((value) => value + 1);
@@ -1528,7 +1459,6 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1528
1459
  return;
1529
1460
  }
1530
1461
  setDiscardFor(null);
1531
- navigationTabs.current[tab]?.focus();
1532
1462
  requests.current = {};
1533
1463
  setDiscovery({});
1534
1464
  setDraft(null);
@@ -1536,29 +1466,11 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1536
1466
  setNotice(null);
1537
1467
  };
1538
1468
  const scopeActive = currentLive.subagents.eng || currentLive.subagents.global;
1539
- const navigate = (next, cli) => {
1540
- setTab(next);
1541
- if (cli) setBackendTab(cli);
1542
- navigationTabs.current[next]?.focus();
1469
+ const invalidSection = invalid?.titleKey?.startsWith("tier") ? "routing" : invalid?.titleKey ? "backends" : "trusted";
1470
+ const scrollToSection = (id) => {
1471
+ const doc = globalThis["document"];
1472
+ doc?.getElementById("bs-section-" + id)?.scrollIntoView?.({ block: "start" });
1543
1473
  };
1544
- const invalidTab = invalid?.titleKey?.startsWith("tier") ? "tiers" : invalid?.titleKey ? "cli" : "connection";
1545
- const status = notice !== null ? h("span", { className: "bs-status", "data-tone": notice.tone, role: notice.tone === "error" ? "alert" : "status" }, notice.text) : invalid !== null ? h("span", { className: "bs-status", role: "alert" }, h(
1546
- "button",
1547
- {
1548
- type: "button",
1549
- className: "bs-button bs-errorLink",
1550
- onClick: () => navigate(invalidTab, invalid.titleKey === "claudeTitle" ? "claude" : "codex")
1551
- },
1552
- translate(invalid.key, { backend: invalid.titleKey ? translate(invalid.titleKey) : "" })
1553
- )) : null;
1554
- const panelProps = (name) => ({
1555
- id: "bs-settings-panel-" + name,
1556
- className: "bs-tabpanel",
1557
- role: "tabpanel",
1558
- "aria-labelledby": "bs-settings-tab-" + name,
1559
- tabIndex: 0,
1560
- hidden: tab !== name
1561
- });
1562
1474
  return h(
1563
1475
  "div",
1564
1476
  { className: "bs-cfg", "data-settings-dirty": dirty, "data-settings-busy": busy },
@@ -1578,147 +1490,22 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1578
1490
  writable ? null : h("span", { className: "bs-badge", role: "status", title: translate("readonly") }, translate("readonlyShort"))
1579
1491
  )
1580
1492
  ),
1581
- h(Tabs, { id: "bs-settings", label: translate("title"), value: tab, onChange: setTab, tabRefs: navigationTabs, items: [
1582
- { id: "general", label: translate("tabGeneral") },
1583
- { id: "cli", label: translate("tabCli") },
1584
- { id: "tiers", label: translate("tabTiers") },
1585
- { id: "connection", label: translate("tabConnection") }
1586
- ] }),
1587
1493
  h(
1588
- "div",
1589
- panelProps("general"),
1494
+ "section",
1495
+ { className: "bs-section", id: "bs-section-routing", "aria-label": translate("routingTitle") },
1496
+ h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("routingTitle"))),
1497
+ h("p", { className: "bs-hint" }, translate("modelRecommendations")),
1498
+ routesState.status === "loading" ? h("p", { className: "bs-hint", role: "status" }, translate("routesLoading")) : allowed === null ? h("p", { className: "bs-note", "data-tone": "warn" }, translate("routesError")) : !allowed.enabled || allowed.routes.length === 0 ? h("p", { className: "bs-note", "data-tone": "warn" }, translate("tiersInactive")) : null,
1590
1499
  h(
1591
- "section",
1592
- { className: "bs-section", "aria-label": translate("routingTitle") },
1593
- h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("routingTitle"))),
1594
- h("p", { className: "bs-hint" }, translate("modelRecommendations")),
1500
+ "div",
1501
+ { className: "bs-routingDiagram", "data-routing": "main-agent" },
1595
1502
  h(
1596
1503
  "div",
1597
- { className: "bs-routingDiagram", "data-routing": "main-agent" },
1598
- h(
1599
- "div",
1600
- { className: "bs-routingSource", id: "bs-routing-source" },
1601
- h("span", { className: "bs-routingSourceLabel" }, translate("mainAgent")),
1602
- h("span", { className: "bs-hint" }, translate("mainAgentNote"))
1603
- ),
1604
- ...TIERS.map((tier) => {
1605
- const value = currentLive.tiers[tier];
1606
- const current = routeKey(value);
1607
- const title = translate(TIER_TITLE_KEYS[tier]);
1608
- return h(
1609
- "div",
1610
- { key: tier, className: "bs-routing" },
1611
- h("span", { className: "bs-routingBranchGlyph", "aria-hidden": true }, "\u21B3"),
1612
- h(
1613
- "div",
1614
- { className: "bs-overviewName" },
1615
- h("span", { className: "bs-routingLabel" }, title),
1616
- h("span", { className: "bs-overviewMeta" }, translate(TIER_HINT_KEYS[tier]))
1617
- ),
1618
- h("span", { className: "bs-routingModel bs-mono" }, current === "" ? translate("tierInherit") : current),
1619
- h(
1620
- "button",
1621
- {
1622
- type: "button",
1623
- id: "bs-tier-" + tier + "-change",
1624
- className: "bs-button",
1625
- "data-variant": "outline",
1626
- "data-tier-change": tier,
1627
- onClick: () => navigate("tiers")
1628
- },
1629
- translate(current === "" ? "chooseModel" : "changeModel")
1630
- )
1631
- );
1632
- })
1504
+ { className: "bs-routingSource", id: "bs-routing-source" },
1505
+ h("span", { className: "bs-routingSourceLabel" }, translate("mainAgent")),
1506
+ h("span", { className: "bs-hint" }, translate("mainAgentNote"))
1633
1507
  ),
1634
- h("p", { className: "bs-hint bs-routingNote" }, translate("routingNote"))
1635
- ),
1636
- h(
1637
- "section",
1638
- { className: "bs-section" },
1639
- h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("backendsTitle"))),
1640
- h("p", { className: "bs-hint" }, translate("backendsIntro")),
1641
- h("div", { className: "bs-overview" }, BACKENDS.map((spec) => {
1642
- const backend = currentLive.subagents[spec.cli];
1643
- const title = spec.cli === "codex" ? "Codex" : "Claude";
1644
- return h(
1645
- "button",
1646
- {
1647
- key: spec.cli,
1648
- type: "button",
1649
- id: "bs-open-" + spec.cli,
1650
- className: "bs-overviewRow",
1651
- "aria-label": translate("configureBackend", { backend: title }),
1652
- onClick: () => navigate("cli", spec.cli)
1653
- },
1654
- h("span", { className: "bs-overviewGlyph", "aria-hidden": true }, h("svg", { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }, h("path", { d: "M4 5h16v14H4Zm4 5 2 2-2 2m5 0h3" }))),
1655
- h(
1656
- "span",
1657
- { className: "bs-overviewName" },
1658
- h("span", null, title),
1659
- h("span", { className: "bs-overviewMeta bs-mono" }, backend.enabled ? translate("modelCount", { count: backend.models.length }) + (backend.defaultModel ? " \xB7 " + backend.defaultModel : "") : "")
1660
- ),
1661
- h(
1662
- "span",
1663
- { className: "bs-badge", "data-active": backend.enabled && scopeActive },
1664
- h("span", { className: "bs-dot", "data-active": backend.enabled && scopeActive, "aria-hidden": true }),
1665
- translate(!backend.enabled ? "inactive" : !scopeActive ? "scopeInactive" : "configured")
1666
- ),
1667
- h(Chevron)
1668
- );
1669
- }))
1670
- )
1671
- ),
1672
- h(
1673
- "div",
1674
- panelProps("cli"),
1675
- h(Tabs, {
1676
- id: "bs-backend",
1677
- label: translate("tabCli"),
1678
- compact: true,
1679
- value: backendTab,
1680
- onChange: setBackendTab,
1681
- items: BACKENDS.map((spec) => ({ id: spec.cli, label: spec.cli === "codex" ? "Codex" : "Claude", active: currentLive.subagents[spec.cli].enabled && scopeActive }))
1682
- }),
1683
- ...BACKENDS.map((spec) => h(
1684
- "div",
1685
- {
1686
- key: spec.cli,
1687
- id: "bs-backend-panel-" + spec.cli,
1688
- role: "tabpanel",
1689
- "aria-labelledby": "bs-backend-tab-" + spec.cli,
1690
- tabIndex: 0,
1691
- hidden: backendTab !== spec.cli
1692
- },
1693
- h(BackendCard, {
1694
- spec,
1695
- backend: currentLive.subagents[spec.cli],
1696
- disabled: !writable || busy,
1697
- capabilities,
1698
- discovery,
1699
- discoveryMatches: currentLive.subagents[spec.cli].executable === host.subagents[spec.cli].executable && currentLive.subagents[spec.cli].profile === host.subagents[spec.cli].profile,
1700
- scopeActive,
1701
- t: translate,
1702
- generation,
1703
- onPatch: (patch) => patchBackend(spec, patch),
1704
- onModelPatch: (index, patch) => patchModel(spec, index, patch),
1705
- onModelAdd: () => addModel(spec),
1706
- onModelRemove: (index) => removeModel(spec, index),
1707
- onDiscover: () => discoverModels(spec),
1708
- onDiagnostics: () => navigate("connection")
1709
- })
1710
- ))
1711
- ),
1712
- h(
1713
- "div",
1714
- panelProps("tiers"),
1715
- h(
1716
- "section",
1717
- { className: "bs-section" },
1718
- h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("tiersTitle"))),
1719
- h("p", { className: "bs-hint" }, translate("tiersIntro")),
1720
- routesState.status === "loading" ? h("p", { className: "bs-hint", role: "status" }, translate("routesLoading")) : allowed === null ? h("p", { className: "bs-note", "data-tone": "warn" }, translate("routesError")) : !allowed.enabled || allowed.routes.length === 0 ? h("p", { className: "bs-note", "data-tone": "warn" }, translate("tiersInactive")) : null,
1721
- h("div", { className: "bs-tierGrid" }, ...TIERS.map((tier) => h(TierRow, {
1508
+ ...TIERS.map((tier) => h(TierRow, {
1722
1509
  key: tier,
1723
1510
  tier,
1724
1511
  value: currentLive.tiers[tier],
@@ -1726,132 +1513,160 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1726
1513
  disabled: !writable || busy,
1727
1514
  t: translate,
1728
1515
  onPatch: (patch) => patchTier(tier, patch)
1729
- })))
1730
- )
1516
+ }))
1517
+ ),
1518
+ h("p", { className: "bs-hint bs-routingNote" }, translate("routingNote"))
1731
1519
  ),
1732
1520
  h(
1733
- "div",
1734
- panelProps("connection"),
1735
- h(
1736
- "section",
1737
- { className: "bs-section" },
1738
- h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("scopeTitle"))),
1739
- h(SwitchRow, {
1740
- id: "bs-scope-eng",
1741
- label: currentLive.subagents.global ? translate("scopeEngIncluded") : translate("scopeEng"),
1742
- hint: currentLive.subagents.global ? translate("globalOverrides") : translate("scopeEngHint"),
1743
- checked: currentLive.subagents.global ? true : currentLive.subagents.eng,
1744
- disabled: !writable || busy || currentLive.subagents.global,
1745
- onChange: (eng) => edit((current) => ({ ...current, subagents: { ...current.subagents, eng } }))
1746
- }),
1747
- h(SwitchRow, {
1748
- id: "bs-scope-global",
1749
- label: translate("scopeGlobal"),
1750
- hint: translate("scopeGlobalHint"),
1751
- checked: currentLive.subagents.global,
1752
- disabled: !writable || busy,
1753
- onChange: (global) => edit((current) => ({ ...current, subagents: { ...current.subagents, global } }))
1754
- }),
1755
- !scopeActive ? h("p", { className: "bs-note", "data-tone": "warn" }, translate("scopeNone")) : null
1756
- ),
1521
+ "section",
1522
+ { className: "bs-section", id: "bs-section-backends", "aria-label": translate("backendsTitle") },
1523
+ h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("backendsTitle"))),
1524
+ h("p", { className: "bs-hint" }, translate("backendsIntro")),
1525
+ ...BACKENDS.map((spec) => h(BackendCard, {
1526
+ key: spec.cli,
1527
+ spec,
1528
+ backend: currentLive.subagents[spec.cli],
1529
+ disabled: !writable || busy,
1530
+ capabilities,
1531
+ discovery,
1532
+ discoveryMatches: currentLive.subagents[spec.cli].executable === host.subagents[spec.cli].executable && currentLive.subagents[spec.cli].profile === host.subagents[spec.cli].profile,
1533
+ scopeActive,
1534
+ t: translate,
1535
+ generation,
1536
+ onPatch: (patch) => patchBackend(spec, patch),
1537
+ onModelPatch: (index, patch) => patchModel(spec, index, patch),
1538
+ onModelAdd: () => addModel(spec),
1539
+ onModelRemove: (index) => removeModel(spec, index),
1540
+ onDiscover: () => discoverModels(spec),
1541
+ onDiagnostics: () => scrollToSection("diagnostics")
1542
+ }))
1543
+ ),
1544
+ h(
1545
+ "section",
1546
+ { className: "bs-section", id: "bs-section-scope", "aria-label": translate("scopeTitle") },
1547
+ h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("scopeTitle"))),
1548
+ h(SwitchRow, {
1549
+ id: "bs-scope-eng",
1550
+ label: currentLive.subagents.global ? translate("scopeEngIncluded") : translate("scopeEng"),
1551
+ hint: currentLive.subagents.global ? translate("globalOverrides") : translate("scopeEngHint"),
1552
+ checked: currentLive.subagents.global ? true : currentLive.subagents.eng,
1553
+ disabled: !writable || busy || currentLive.subagents.global,
1554
+ onChange: (eng) => edit((current) => ({ ...current, subagents: { ...current.subagents, eng } }))
1555
+ }),
1556
+ h(SwitchRow, {
1557
+ id: "bs-scope-global",
1558
+ label: translate("scopeGlobal"),
1559
+ hint: translate("scopeGlobalHint"),
1560
+ checked: currentLive.subagents.global,
1561
+ disabled: !writable || busy,
1562
+ onChange: (global) => edit((current) => ({ ...current, subagents: { ...current.subagents, global } }))
1563
+ }),
1564
+ !scopeActive ? h("p", { className: "bs-note", "data-tone": "warn" }, translate("scopeNone")) : null
1565
+ ),
1566
+ h(
1567
+ "section",
1568
+ { className: "bs-section", id: "bs-section-behavior", "aria-label": translate("behaviorTitle") },
1569
+ h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("behaviorTitle"))),
1570
+ h(SwitchRow, {
1571
+ id: "bs-delegation-prompt",
1572
+ label: translate("delegationPromptLabel"),
1573
+ hint: translate("delegationPromptHint"),
1574
+ checked: currentLive.delegationPrompt,
1575
+ disabled: !writable || busy,
1576
+ onChange: (delegationPrompt) => edit((current) => ({ ...current, delegationPrompt }))
1577
+ }),
1578
+ h(SwitchRow, {
1579
+ id: "bs-child-exit-guard",
1580
+ label: translate("childExitGuardLabel"),
1581
+ hint: translate("childExitGuardHint"),
1582
+ checked: currentLive.childExitGuard,
1583
+ disabled: !writable || busy,
1584
+ onChange: (childExitGuard) => edit((current) => ({ ...current, childExitGuard }))
1585
+ })
1586
+ ),
1587
+ h(
1588
+ "section",
1589
+ { className: "bs-section", id: "bs-section-diagnostics", "aria-label": translate("readonlyDiagnostics") },
1757
1590
  h(
1758
- "section",
1759
- { className: "bs-section" },
1760
- h("div", { className: "bs-sectionHead" }, h("h3", { className: "bs-sectionTitle" }, translate("behaviorTitle"))),
1761
- h(SwitchRow, {
1762
- id: "bs-delegation-prompt",
1763
- label: translate("delegationPromptLabel"),
1764
- hint: translate("delegationPromptHint"),
1765
- checked: currentLive.delegationPrompt,
1766
- disabled: !writable || busy,
1767
- onChange: (delegationPrompt) => edit((current) => ({ ...current, delegationPrompt }))
1768
- }),
1769
- h(SwitchRow, {
1770
- id: "bs-child-exit-guard",
1771
- label: translate("childExitGuardLabel"),
1772
- hint: translate("childExitGuardHint"),
1773
- checked: currentLive.childExitGuard,
1774
- disabled: !writable || busy,
1775
- onChange: (childExitGuard) => edit((current) => ({ ...current, childExitGuard }))
1776
- })
1591
+ "div",
1592
+ { className: "bs-sectionHead" },
1593
+ h("h3", { className: "bs-sectionTitle" }, translate("readonlyDiagnostics")),
1594
+ h("button", {
1595
+ type: "button",
1596
+ id: "bs-refresh",
1597
+ className: "bs-button",
1598
+ "data-variant": "outline",
1599
+ disabled: capabilities.status === "loading" || routesState.status === "loading",
1600
+ "aria-busy": capabilities.status === "loading" || routesState.status === "loading",
1601
+ onClick: () => {
1602
+ capabilities.reload();
1603
+ routesState.reload();
1604
+ }
1605
+ }, translate("refresh"))
1777
1606
  ),
1778
1607
  h(
1779
- "section",
1780
- { className: "bs-section", "aria-label": translate("readonlyDiagnostics") },
1608
+ "div",
1609
+ { className: "bs-metricGrid" },
1781
1610
  h(
1782
1611
  "div",
1783
- { className: "bs-sectionHead" },
1784
- h("h3", { className: "bs-sectionTitle" }, translate("readonlyDiagnostics")),
1785
- h("button", {
1786
- type: "button",
1787
- id: "bs-refresh",
1788
- className: "bs-button",
1789
- "data-variant": "outline",
1790
- disabled: capabilities.status === "loading" || routesState.status === "loading",
1791
- "aria-busy": capabilities.status === "loading" || routesState.status === "loading",
1792
- onClick: () => {
1793
- capabilities.reload();
1794
- routesState.reload();
1795
- }
1796
- }, translate("refresh"))
1612
+ { className: "bs-metric" },
1613
+ h("span", { className: "bs-metricLabel" }, translate("connectionMode")),
1614
+ h("span", { className: "bs-metricValue" }, translate(writable ? "connectionWritable" : "connectionReadonly"))
1797
1615
  ),
1798
1616
  h(
1799
1617
  "div",
1800
- { className: "bs-metricGrid" },
1801
- h(
1802
- "div",
1803
- { className: "bs-metric" },
1804
- h("span", { className: "bs-metricLabel" }, translate("connectionMode")),
1805
- h("span", { className: "bs-metricValue" }, translate(writable ? "connectionWritable" : "connectionReadonly"))
1806
- ),
1807
- h(
1808
- "div",
1809
- { className: "bs-metric" },
1810
- h("span", { className: "bs-metricLabel" }, translate("capabilitiesLabel")),
1811
- h("span", { className: "bs-metricValue", role: "status" }, capabilities.status === "ready" ? translate("ready") : capabilities.status === "loading" ? translate("loading") : translate("failed"))
1812
- ),
1813
- h(
1814
- "div",
1815
- { className: "bs-metric" },
1816
- h("span", { className: "bs-metricLabel" }, translate("routesLabel")),
1817
- h("span", { className: "bs-metricValue", role: "status" }, routesState.status === "loading" ? translate("loading") : allowed === null ? translate("failed") : !allowed.enabled ? translate("inactive") : translate("modelCount", { count: allowed.routes.length }))
1818
- )
1618
+ { className: "bs-metric" },
1619
+ h("span", { className: "bs-metricLabel" }, translate("capabilitiesLabel")),
1620
+ h("span", { className: "bs-metricValue", role: "status" }, capabilities.status === "ready" ? translate("ready") : capabilities.status === "loading" ? translate("loading") : translate("failed"))
1819
1621
  ),
1820
- ...BACKENDS.map((spec) => h(
1622
+ h(
1821
1623
  "div",
1822
- { key: spec.cli, className: "bs-connectionRow", "data-backend": spec.cli },
1823
- h("span", null, spec.cli === "codex" ? "Codex" : "Claude"),
1824
- h("p", { className: "bs-hint bs-mono", role: "status" }, detectionOf(capabilities, spec, host.subagents[spec.cli], translate))
1825
- ))
1624
+ { className: "bs-metric" },
1625
+ h("span", { className: "bs-metricLabel" }, translate("routesLabel")),
1626
+ h("span", { className: "bs-metricValue", role: "status" }, routesState.status === "loading" ? translate("loading") : allowed === null ? translate("failed") : !allowed.enabled ? translate("inactive") : translate("modelCount", { count: allowed.routes.length }))
1627
+ )
1826
1628
  ),
1629
+ ...BACKENDS.map((spec) => h(
1630
+ "div",
1631
+ { key: spec.cli, className: "bs-connectionRow", "data-backend": spec.cli },
1632
+ h("span", null, spec.cli === "codex" ? "Codex" : "Claude"),
1633
+ h("p", { className: "bs-hint bs-mono", role: "status" }, detectionOf(capabilities, spec, host.subagents[spec.cli], translate))
1634
+ ))
1635
+ ),
1636
+ h(
1637
+ "section",
1638
+ { className: "bs-section", id: "bs-section-trusted", "aria-label": translate("trustedHostsAdvanced") },
1827
1639
  h(
1828
- "section",
1829
- { className: "bs-section" },
1640
+ Advanced,
1641
+ { label: translate("trustedHostsAdvanced"), summary: currentLive.trustedHosts.length ? translate("trustedCount", { count: currentLive.trustedHosts.length }) : translate("trustedDefault") },
1830
1642
  h(
1831
- Advanced,
1832
- { label: translate("trustedHostsAdvanced"), summary: currentLive.trustedHosts.length ? translate("trustedCount", { count: currentLive.trustedHosts.length }) : translate("trustedDefault") },
1833
- h(
1834
- Field,
1835
- { id: "bs-trusted-hosts", label: translate("trustedHostsLabel"), hint: translate("trustedHostsHint") },
1836
- h(HostList, {
1837
- key: generation,
1838
- hosts: currentLive.trustedHosts,
1839
- disabled: !writable || busy,
1840
- t: translate,
1841
- onChange: (trustedHosts) => edit((current) => ({ ...current, trustedHosts }))
1842
- })
1843
- )
1643
+ Field,
1644
+ { id: "bs-trusted-hosts", label: translate("trustedHostsLabel"), hint: translate("trustedHostsHint") },
1645
+ h(HostList, {
1646
+ key: generation,
1647
+ hosts: currentLive.trustedHosts,
1648
+ disabled: !writable || busy,
1649
+ t: translate,
1650
+ onChange: (trustedHosts) => edit((current) => ({ ...current, trustedHosts }))
1651
+ })
1844
1652
  )
1845
1653
  )
1846
1654
  ),
1847
- notice !== null || invalid !== null ? h("div", { className: "bs-feedback" }, status) : null,
1848
- dirty ? h(
1655
+ dirty || notice !== null || invalid !== null ? h(
1849
1656
  "div",
1850
1657
  { className: "bs-footer" },
1851
- h("span", { className: "bs-status" }, translate("changeCount", { count: changeCount })),
1658
+ h(
1659
+ "span",
1660
+ { className: "bs-status", "data-tone": notice?.tone, role: notice?.tone === "error" ? "alert" : "status" },
1661
+ notice !== null ? notice.text : invalid !== null ? h(
1662
+ "a",
1663
+ { className: "bs-errorLink", href: "#bs-section-" + invalidSection },
1664
+ translate(invalid.key, { backend: invalid.titleKey ? translate(invalid.titleKey) : "" })
1665
+ ) : translate("changeCount", { count: changeCount })
1666
+ ),
1852
1667
  h(
1853
1668
  "button",
1854
- { type: "button", className: "bs-button", "data-variant": "outline", disabled: busy, onClick: reset },
1669
+ { type: "button", className: "bs-button", "data-variant": "outline", hidden: !dirty, disabled: busy, onClick: reset },
1855
1670
  translate(discardFor === dirtyKey ? "resetConfirm" : "reset")
1856
1671
  ),
1857
1672
  h(
@@ -1860,6 +1675,7 @@ function BetterSubagentConfigPage({ form, t: translate }) {
1860
1675
  type: "button",
1861
1676
  className: "bs-button",
1862
1677
  "data-variant": "primary",
1678
+ hidden: !dirty,
1863
1679
  disabled: !writable || busy || invalid !== null,
1864
1680
  "aria-busy": busy,
1865
1681
  onClick: () => void save()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-dsh/dsh-better-subagent",
3
- "version": "0.5.5-alpha.1",
3
+ "version": "0.5.6-alpha.1",
4
4
  "description": "Standalone DSH plugin: Codex/Claude continuable CLI subagents, wait_subagent, child exit guard and model tiers. TypeScript sources compiled to ESM.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {