dsh-mcp 1.14.0 → 1.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/CHANGELOG.en.md CHANGED
@@ -12,6 +12,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
  - **Supported DSH version**: **dsh `0.2.0-rc.2`** — the latest release is developed and verified on `0.2.0-rc.2` (declared in `package.json` → `dsh.supported`); older entries state the version verified at their time. When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
13
13
  - **Release convention**: every version entry states `- **Supported DSH version**: dsh <version>`, mirrored in the GitHub Release notes. The release body is written in **Chinese** (matching [CHANGELOG.md](CHANGELOG.md)), with heading levels mirroring the entry.
14
14
 
15
+ ## [1.14.1] - 2026-10-20
16
+
17
+ - **Supported DSH version**: **dsh `0.2.0-rc.2`**
18
+
19
+ ### Fixed
20
+
21
+ - **Plugin styles no longer leak into the host UI, and controls are styled by class only ([#14](https://github.com/ArvinQi/dsh-mcp/issues/14))**: `ServerForm.module.css` and `McpSettingsSection.module.css` each carried an unqualified `button { … }` rule, and several selectors ended in an element (`.field input`, `.row input`, `.actions button`, `.retryRow button`). The client stylesheets are injected into the host's `<head>` verbatim — the build's CSS Modules are an identity class map, not a scoping boundary — so those rules matched **every** matching element in the host page. The DSH composer's attach button (28×28, bottom-left) and send button (34×34, bottom-right) center their SVG with `display: grid; place-items: center` and declare no `padding` of their own; the leaked `padding: 5px 12px` shrank their content box from 16px / 22px to 4px / 10px, the 14px / 16px icon overflowed horizontally and was aligned to the start edge, so the icon drifted right inside the circle (measured +5.0 px and +3.0 px). **No style targets an element any more** (`button` / `input` / `select` / `textarea` / `label` / `p` are all gone): the base control styles now live in the new `src/client/controls.module.css` as classes — `.button` (with `:hover` / `:focus-visible` / `:disabled`), `.buttonSmall`, `.primary`, `.control` (shared by `<input>` / `<select>` / `<textarea>`), `.controlMono` and `.checkbox`. Components import that module for the class **names** only; their own sheets keep layout plus the `.active` / `.danger` / `.dangerButton` / `.moduleTitle` modifiers, all matched by class. Because an identity class map makes class names global, the shared classes are defined exactly once, in `controls.module.css`; specificity no longer needs tricks (the previous `:where()` wrappers are gone) — within that one sheet `.primary` follows `.button`, and the component sheets are injected after it
22
+
23
+ ### Notes
24
+
25
+ - `test/client-style-scope.test.mjs` was rewritten: (1) every selector of `src/client/*.module.css` must be a pure class chain (an element selector, `*` or `:root` fails); (2) the bundle is loaded through the shell's loader wire format and the stylesheets it actually injects are checked the same way; (3) the shared classes must be defined once, `controls.module.css` must be injected first, and the `.primary` / `.buttonSmall` / `.controlMono` rules must follow their base classes; (4) every `<button>` in the `.tsx` sources must carry `controls.button` so a missed class cannot silently render an unstyled control. It fails against the pre-fix build
26
+ - `scripts/build.mjs` strips CSS comments before computing the identity class map, so class names mentioned only in a comment no longer become dead keys; the build header now states that injected styles are global, that every rule must be a pure class selector, and that shared control classes live in `controls.module.css`
27
+ - Only the client half changed (the host `lib/index.js` and all Remote interfaces are untouched), so upgrading the plugin and hard-refreshing the DSH page is enough to see the centered icons
28
+
15
29
  ## [1.14.0] - 2026-10-13
16
30
 
17
31
  - **Supported DSH version**: **dsh `0.2.0-rc.2`**
package/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@
12
12
  - **支持版本**:**dsh `0.2.0-rc.2`** —— 最新版本在 `0.2.0-rc.2` 上开发与验证(`package.json` → `dsh.supported` 同步声明);历史版本条目各自声明当时验证的版本。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
13
13
  - **发版约定**:每个版本条目都要声明 `- **支持版本**:dsh <版本>`,并在 GitHub Release notes 中同步。Release 正文用**中文**(与本文档一致),标题层级与条目一致。
14
14
 
15
+ ## [1.14.1] - 2026-10-20
16
+
17
+ - **支持版本**:**dsh `0.2.0-rc.2`**
18
+
19
+ ### 修复
20
+
21
+ - **插件样式不再泄漏到宿主界面,控件样式一律改为 class([#14](https://github.com/ArvinQi/dsh-mcp/issues/14))**:`ServerForm.module.css` 与 `McpSettingsSection.module.css` 里各有一条没有父级限定的 `button { … }` 规则,另外还有 `.field input` / `.row input` / `.actions button` / `.retryRow button` 等以元素为右端的选择器;而客户端样式表是原样注入宿主 `<head>` 的——构建的 CSS Modules 只做恒等类名映射,没有任何作用域边界——于是这些规则命中了宿主页面上对应的**每一个**元素。DSH 输入框左下角的加号按钮(28×28)与右下角的发送按钮(34×34)靠 `display: grid; place-items: center` 让图标居中、自身不声明 `padding`,被泄漏的 `padding: 5px 12px` 把内容盒从 16px / 22px 挤到 4px / 10px,14px / 16px 的图标横向溢出、按起始边对齐,图标因此在圆内向右偏移(实测 +5.0 px 与 +3.0 px)。现在**不再有任何以元素为目标的样式**(`button` / `input` / `select` / `textarea` / `label` / `p` 全部消失):基础控件样式集中到新的 `src/client/controls.module.css`,以类名定义——`.button`(连同 `:hover` / `:focus-visible` / `:disabled`)、`.buttonSmall`、`.primary`、`.control`(`<input>` / `<select>` / `<textarea>` 共用)、`.controlMono`、`.checkbox`;各组件只从这个模块取**类名**,自己的样式表保留布局与 `.active` / `.danger` / `.dangerButton` / `.moduleTitle` 等修饰类,也全部只按 class 匹配。因为恒等类名映射下同名类就是全局的,共享类只在 `controls.module.css` 里定义一次;优先级也不再依赖技巧(此前用 `:where()` 压低权重),改为「同一个表内 `.primary` 排在 `.button` 之后 + 组件样式表固定在共享表之后注入」
22
+
23
+ ### 说明
24
+
25
+ - 重写 `test/client-style-scope.test.mjs`:① 逐条检查 `src/client/*.module.css` 的选择器,要求是纯 class 链(出现元素选择器 / `*` / `:root` 即失败);② 按宿主加载器格式装载 `lib/client.js`,检查它实际注入的样式表同样没有元素选择器;③ 断言共享控件类只定义一次、`controls.module.css` 排在其它样式表之前,且 `.primary` / `.buttonSmall` / `.controlMono` 规则顺序保证变体覆盖基础类;④ 扫描所有 `.tsx`,每个 `<button>` 必须带 `controls.button`(避免漏类名退回无样式)。用修复前的构建产物跑该测试会失败
26
+ - `scripts/build.mjs` 生成恒等类名表前先剥离 CSS 注释(注释里提到的类名不再成为死 key);构建脚本头部改为说明「注入的样式表是全局的,规则必须是纯 class 选择器,控件共享类集中在 controls.module.css」
27
+ - 本次只有客户端包内容变化(宿主 `lib/index.js` 与所有 Remote 接口未变),升级插件后硬刷新 DSH 页面即可看到图标居中
28
+
15
29
  ## [1.14.0] - 2026-10-13
16
30
 
17
31
  - **支持版本**:**dsh `0.2.0-rc.2`**
package/lib/client.js CHANGED
@@ -15507,6 +15507,21 @@ function createMcpManagerStore() {
15507
15507
  });
15508
15508
  }
15509
15509
 
15510
+ // src/client/controls.module.css
15511
+ (function() {
15512
+ if (typeof document !== "undefined") {
15513
+ const existing = document.querySelector('style[data-plugin="dsh-mcp"][data-file="controls.module.css"]');
15514
+ if (!existing) {
15515
+ const style = document.createElement("style");
15516
+ style.setAttribute("data-plugin", "dsh-mcp");
15517
+ style.setAttribute("data-file", "controls.module.css");
15518
+ style.textContent = "/* Shared control styles for the client UI.\n *\n * Every `.module.css` in this package is injected into the host page's <head>\n * verbatim \u2014 the build's class map is the identity, so there is no scoping\n * boundary and a class name is global. Two consequences:\n *\n * 1. Elements are styled by class only, never by tag. A bare `button` /\n * `input` selector would restyle the host shell (issue #14: the composer's\n * icon buttons lost their centering to a leaked `padding: 5px 12px`).\n * 2. Each class below is defined **exactly here**, once. Another stylesheet\n * re-defining `.button` would silently change every control in the plugin,\n * so components import this module only for the class *names* and keep\n * their layout/variant rules in their own file.\n */\n\n.button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\n.button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.button:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n.button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n/* Compact action, e.g. the inline \"retry\" button of the global-env editor. */\n.buttonSmall {\n padding: 3px 10px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n/* Text controls: one class for <input>, <select> and <textarea>, so no rule\n has to name an element. */\n.control {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 6px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n resize: vertical;\n}\n\n.control::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.control:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n/* Denser monospace variant: the env rows of the global-env editor. */\n.controlMono {\n border-radius: 6px;\n padding: 5px 8px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n\n.checkbox {\n cursor: pointer;\n}\n";
15519
+ document.head.appendChild(style);
15520
+ }
15521
+ }
15522
+ })();
15523
+ var controls_default = { "button": "button", "buttonSmall": "buttonSmall", "primary": "primary", "control": "control", "controlMono": "controlMono", "checkbox": "checkbox" };
15524
+
15510
15525
  // src/client/ServerForm.module.css
15511
15526
  (function() {
15512
15527
  if (typeof document !== "undefined") {
@@ -15515,12 +15530,12 @@ function createMcpManagerStore() {
15515
15530
  const style = document.createElement("style");
15516
15531
  style.setAttribute("data-plugin", "dsh-mcp");
15517
15532
  style.setAttribute("data-file", "ServerForm.module.css");
15518
- style.textContent = ".form {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.titleActions {\n display: flex;\n gap: 8px;\n}\n\nbutton {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\nbutton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.danger {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.field input,\n.field select,\n.field textarea {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 6px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n resize: vertical;\n}\n\n.field input::placeholder,\n.field textarea::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.field input:focus-visible,\n.field select:focus-visible,\n.field textarea:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.checkRow {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n\n.testResult {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n}\n\n.testOk {\n color: var(--dsw-alias-state-success-primary);\n}\n\n.testFail {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.oauthWaiting {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.oauthOk {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-success-primary);\n}\n\n.oauthRequired {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
15533
+ style.textContent = ".form {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.titleActions {\n display: flex;\n gap: 8px;\n}\n\n/* Control styling lives in class form in ./controls.module.css; this module\n only keeps its own layout and modifiers, and it must never match an element\n by tag (the sheets are injected into the host page globally, issue #14). */\n\n.danger {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.checkRow {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n\n.testResult {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n}\n\n.testOk {\n color: var(--dsw-alias-state-success-primary);\n}\n\n.testFail {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.oauthWaiting {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.oauthOk {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-success-primary);\n}\n\n.oauthRequired {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
15519
15534
  document.head.appendChild(style);
15520
15535
  }
15521
15536
  }
15522
15537
  })();
15523
- var ServerForm_default = { "form": "form", "titleRow": "titleRow", "title": "title", "titleActions": "titleActions", "primary": "primary", "danger": "danger", "error": "error", "field": "field", "hint": "hint", "muted": "muted", "checkRow": "checkRow", "testResult": "testResult", "testOk": "testOk", "testFail": "testFail", "oauthWaiting": "oauthWaiting", "oauthOk": "oauthOk", "oauthRequired": "oauthRequired", "actions": "actions" };
15538
+ var ServerForm_default = { "form": "form", "titleRow": "titleRow", "title": "title", "titleActions": "titleActions", "danger": "danger", "error": "error", "field": "field", "hint": "hint", "muted": "muted", "checkRow": "checkRow", "testResult": "testResult", "testOk": "testOk", "testFail": "testFail", "oauthWaiting": "oauthWaiting", "oauthOk": "oauthOk", "oauthRequired": "oauthRequired", "actions": "actions" };
15524
15539
 
15525
15540
  // src/client/ServerForm.tsx
15526
15541
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -15635,8 +15650,8 @@ function McpServerForm(props) {
15635
15650
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.titleRow, children: [
15636
15651
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: ServerForm_default.title, children: draft.id === null ? t("newTitle") : t("editTitle") }),
15637
15652
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.titleActions, children: [
15638
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => actions.cancelEdit(), children: t("backToList") }),
15639
- draft.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: ServerForm_default.danger, disabled: busy !== null, onClick: () => void removeServer(), children: busy === "remove" ? t("removing") : t("remove") }) : null
15653
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, onClick: () => actions.cancelEdit(), children: t("backToList") }),
15654
+ draft.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: `${controls_default.button} ${ServerForm_default.danger}`, disabled: busy !== null, onClick: () => void removeServer(), children: busy === "remove" ? t("removing") : t("remove") }) : null
15640
15655
  ] })
15641
15656
  ] }),
15642
15657
  saveError !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.error, role: "alert", children: saveError }) : null,
@@ -15646,6 +15661,7 @@ function McpServerForm(props) {
15646
15661
  "input",
15647
15662
  {
15648
15663
  type: "text",
15664
+ className: controls_default.control,
15649
15665
  value: draft.serverName,
15650
15666
  placeholder: t("serverNameHint"),
15651
15667
  onChange: (event) => update({ serverName: event.currentTarget.value })
@@ -15657,6 +15673,7 @@ function McpServerForm(props) {
15657
15673
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
15658
15674
  "select",
15659
15675
  {
15676
+ className: controls_default.control,
15660
15677
  value: draft.transport,
15661
15678
  onChange: (event) => update({ transport: event.currentTarget.value }),
15662
15679
  children: [
@@ -15673,6 +15690,7 @@ function McpServerForm(props) {
15673
15690
  "input",
15674
15691
  {
15675
15692
  type: "text",
15693
+ className: controls_default.control,
15676
15694
  value: draft.command,
15677
15695
  placeholder: t("commandPlaceholder"),
15678
15696
  onChange: (event) => update({ command: event.currentTarget.value })
@@ -15684,6 +15702,7 @@ function McpServerForm(props) {
15684
15702
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15685
15703
  "textarea",
15686
15704
  {
15705
+ className: controls_default.control,
15687
15706
  rows: 3,
15688
15707
  value: draft.argsText,
15689
15708
  placeholder: t("argsPlaceholder"),
@@ -15709,6 +15728,7 @@ function McpServerForm(props) {
15709
15728
  "input",
15710
15729
  {
15711
15730
  type: "text",
15731
+ className: controls_default.control,
15712
15732
  value: draft.cwd,
15713
15733
  placeholder: t("cwdPlaceholder"),
15714
15734
  onChange: (event) => update({ cwd: event.currentTarget.value })
@@ -15723,6 +15743,7 @@ function McpServerForm(props) {
15723
15743
  "input",
15724
15744
  {
15725
15745
  type: "url",
15746
+ className: controls_default.control,
15726
15747
  value: draft.url,
15727
15748
  placeholder: t("urlPlaceholder"),
15728
15749
  onChange: (event) => update({ url: event.currentTarget.value })
@@ -15734,6 +15755,7 @@ function McpServerForm(props) {
15734
15755
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15735
15756
  "textarea",
15736
15757
  {
15758
+ className: controls_default.control,
15737
15759
  rows: 2,
15738
15760
  value: draft.headersText,
15739
15761
  placeholder: t("headersPlaceholder"),
@@ -15748,6 +15770,7 @@ function McpServerForm(props) {
15748
15770
  "input",
15749
15771
  {
15750
15772
  type: "number",
15773
+ className: controls_default.control,
15751
15774
  min: 1,
15752
15775
  value: draft.toolCallTimeoutMs,
15753
15776
  onChange: (event) => update({ toolCallTimeoutMs: event.currentTarget.value })
@@ -15796,9 +15819,9 @@ function McpServerForm(props) {
15796
15819
  ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `${ServerForm_default.testResult} ${probe !== void 0 && probe.ok ? ServerForm_default.testOk : ServerForm_default.testFail}`, role: "status", children: probe !== void 0 && probe.ok ? `${t("testOk")} (${probe.tools.length} ${t("toolCount")}, ${test.elapsedMs}ms)` : probe !== void 0 && !probe.ok ? `${t("testFail")}: ${probe.message}` : t("testUnknown") }) : null,
15797
15820
  testRunning && draft.transport === "streamable-http" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.muted, role: "status", children: t("testBrowserHint") }) : null,
15798
15821
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.actions, children: [
15799
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: testRunning || busy !== null, onClick: () => void runTest(), children: testRunning ? t("testRunning") : t("test") }),
15800
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit", className: ServerForm_default.primary, disabled: busy !== null || testRunning, children: busy === "save" ? t("saving") : t("save") }),
15801
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy !== null, onClick: () => actions.cancelEdit(), children: t("cancel") })
15822
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, disabled: testRunning || busy !== null, onClick: () => void runTest(), children: testRunning ? t("testRunning") : t("test") }),
15823
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit", className: `${controls_default.button} ${controls_default.primary}`, disabled: busy !== null || testRunning, children: busy === "save" ? t("saving") : t("save") }),
15824
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, disabled: busy !== null, onClick: () => actions.cancelEdit(), children: t("cancel") })
15802
15825
  ] })
15803
15826
  ] });
15804
15827
  }
@@ -15814,12 +15837,12 @@ var import_react2 = require("react");
15814
15837
  const style = document.createElement("style");
15815
15838
  style.setAttribute("data-plugin", "dsh-mcp");
15816
15839
  style.setAttribute("data-file", "ServersJsonEditor.module.css");
15817
- style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.editor {\n width: 100%;\n box-sizing: border-box;\n min-height: 260px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.editor:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n\n.actions button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\n.actions button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.actions button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.actions .primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.actions .primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n";
15840
+ style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.editor {\n width: 100%;\n box-sizing: border-box;\n min-height: 260px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.editor:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
15818
15841
  document.head.appendChild(style);
15819
15842
  }
15820
15843
  }
15821
15844
  })();
15822
- var ServersJsonEditor_default = { "panel": "panel", "editor": "editor", "hint": "hint", "error": "error", "notice": "notice", "actions": "actions", "primary": "primary" };
15845
+ var ServersJsonEditor_default = { "panel": "panel", "editor": "editor", "hint": "hint", "error": "error", "notice": "notice", "actions": "actions" };
15823
15846
 
15824
15847
  // src/client/ServersJsonEditor.tsx
15825
15848
  var import_jsx_runtime2 = require("react/jsx-runtime");
@@ -16000,8 +16023,8 @@ function ServersJsonEditor({ injected, t, onApplied }) {
16000
16023
  error51 !== null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.error, role: "alert", children: error51 }) : null,
16001
16024
  notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.notice, role: "status", children: notice }) : null,
16002
16025
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: ServersJsonEditor_default.actions, children: [
16003
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: reseed, children: t("serversJsonReseed") }),
16004
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: ServersJsonEditor_default.primary, disabled: busy, onClick: apply2, children: busy ? t("serversJsonSaving") : t("serversJsonApply") })
16026
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: controls_default.button, disabled: busy, onClick: reseed, children: t("serversJsonReseed") }),
16027
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, disabled: busy, onClick: apply2, children: busy ? t("serversJsonSaving") : t("serversJsonApply") })
16005
16028
  ] })
16006
16029
  ] });
16007
16030
  }
@@ -16017,12 +16040,12 @@ var import_react3 = require("react");
16017
16040
  const style = document.createElement("style");
16018
16041
  style.setAttribute("data-plugin", "dsh-mcp");
16019
16042
  style.setAttribute("data-file", "GlobalEnvEditor.module.css");
16020
- style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.row {\n display: grid;\n grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) auto auto;\n align-items: center;\n gap: 8px;\n}\n\n.row input {\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 8px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n\n.row input:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.name {\n width: 100%;\n}\n\n.value {\n width: 100%;\n}\n\n.secretToggle {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n}\n\n.secretToggle input {\n cursor: pointer;\n}\n\n.secretToggle.secretOn {\n color: var(--dsw-alias-brand-primary);\n font-weight: 600;\n}\n\n.danger {\n border: 1px solid transparent !important;\n background: transparent !important;\n color: var(--dsw-alias-state-error-primary) !important;\n cursor: pointer;\n}\n\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.4);\n}\n\n.dialog {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: min(520px, calc(100vw - 48px));\n max-height: 80vh;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 12px;\n padding: 16px;\n background: var(--dsw-alias-bg-overlay);\n box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);\n}\n\n.dialogTitle {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n\n.bulkText {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.bulkText:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.retryRow {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.retryRow button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 3px 10px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n}\n\n.retryRow button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n\n.actions button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\n.actions button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.actions button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.actions .primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.actions .primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n";
16043
+ style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.row {\n display: grid;\n grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) auto auto;\n align-items: center;\n gap: 8px;\n}\n\n.name {\n width: 100%;\n}\n\n.value {\n width: 100%;\n}\n\n.secretToggle {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n}\n\n.secretToggle.secretOn {\n color: var(--dsw-alias-brand-primary);\n font-weight: 600;\n}\n\n.danger {\n border: 1px solid transparent !important;\n background: transparent !important;\n color: var(--dsw-alias-state-error-primary) !important;\n cursor: pointer;\n}\n\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.4);\n}\n\n.dialog {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: min(520px, calc(100vw - 48px));\n max-height: 80vh;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 12px;\n padding: 16px;\n background: var(--dsw-alias-bg-overlay);\n box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);\n}\n\n.dialogTitle {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n\n.bulkText {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.bulkText:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.retryRow {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
16021
16044
  document.head.appendChild(style);
16022
16045
  }
16023
16046
  }
16024
16047
  })();
16025
- var GlobalEnvEditor_default = { "panel": "panel", "hint": "hint", "muted": "muted", "row": "row", "name": "name", "value": "value", "secretToggle": "secretToggle", "secretOn": "secretOn", "danger": "danger", "overlay": "overlay", "dialog": "dialog", "dialogTitle": "dialogTitle", "bulkText": "bulkText", "retryRow": "retryRow", "error": "error", "notice": "notice", "actions": "actions", "primary": "primary" };
16048
+ var GlobalEnvEditor_default = { "panel": "panel", "hint": "hint", "muted": "muted", "row": "row", "name": "name", "value": "value", "secretToggle": "secretToggle", "secretOn": "secretOn", "danger": "danger", "overlay": "overlay", "dialog": "dialog", "dialogTitle": "dialogTitle", "bulkText": "bulkText", "retryRow": "retryRow", "error": "error", "notice": "notice", "actions": "actions" };
16026
16049
 
16027
16050
  // src/client/GlobalEnvEditor.tsx
16028
16051
  var import_jsx_runtime3 = require("react/jsx-runtime");
@@ -16164,7 +16187,7 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16164
16187
  "input",
16165
16188
  {
16166
16189
  type: "text",
16167
- className: GlobalEnvEditor_default.name,
16190
+ className: `${controls_default.control} ${controls_default.controlMono} ${GlobalEnvEditor_default.name}`,
16168
16191
  value: row.name,
16169
16192
  placeholder: t("globalEnvName"),
16170
16193
  "aria-label": t("globalEnvName"),
@@ -16175,7 +16198,7 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16175
16198
  "input",
16176
16199
  {
16177
16200
  type: row.secret ? "password" : "text",
16178
- className: GlobalEnvEditor_default.value,
16201
+ className: `${controls_default.control} ${controls_default.controlMono} ${GlobalEnvEditor_default.value}`,
16179
16202
  value: row.value,
16180
16203
  placeholder: row.secret && row.configured ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : t("globalEnvValue"),
16181
16204
  "aria-label": t("globalEnvValue"),
@@ -16187,6 +16210,7 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16187
16210
  "input",
16188
16211
  {
16189
16212
  type: "checkbox",
16213
+ className: controls_default.checkbox,
16190
16214
  checked: row.secret,
16191
16215
  "aria-label": t("globalEnvSecret"),
16192
16216
  onChange: (event) => update(row.key, { secret: event.currentTarget.checked })
@@ -16194,18 +16218,18 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16194
16218
  ),
16195
16219
  t("globalEnvSecret")
16196
16220
  ] }),
16197
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.danger, "aria-label": t("globalEnvRemove"), onClick: () => remove(row.key), children: "\u2715" })
16221
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${GlobalEnvEditor_default.danger}`, "aria-label": t("globalEnvRemove"), onClick: () => remove(row.key), children: "\u2715" })
16198
16222
  ] }, row.key)),
16199
16223
  loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.retryRow, children: [
16200
16224
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.error, role: "alert", children: t("globalEnvLoadFailed") }),
16201
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: reload, children: t("globalEnvRetry") })
16225
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.buttonSmall}`, onClick: reload, children: t("globalEnvRetry") })
16202
16226
  ] }) : null,
16203
16227
  error51 !== null && !loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.error, role: "alert", children: error51 }) : null,
16204
16228
  notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.notice, role: "status", children: notice }) : null,
16205
16229
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.actions, children: [
16206
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: busy, onClick: add, children: t("globalEnvAdd") }),
16207
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: busy, onClick: () => setBulkOpen(true), children: t("globalEnvBulk") }),
16208
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.primary, disabled: busy, onClick: save, children: busy ? t("globalEnvSaving") : t("globalEnvSave") })
16230
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: controls_default.button, disabled: busy, onClick: add, children: t("globalEnvAdd") }),
16231
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: controls_default.button, disabled: busy, onClick: () => setBulkOpen(true), children: t("globalEnvBulk") }),
16232
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, disabled: busy, onClick: save, children: busy ? t("globalEnvSaving") : t("globalEnvSave") })
16209
16233
  ] }),
16210
16234
  bulkOpen ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: GlobalEnvEditor_default.overlay, onClick: () => setBulkOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.dialog, role: "dialog", "aria-label": t("globalEnvBulk"), onClick: (event) => event.stopPropagation(), children: [
16211
16235
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.dialogTitle, children: t("globalEnvBulk") }),
@@ -16222,8 +16246,8 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16222
16246
  }
16223
16247
  ),
16224
16248
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.actions, children: [
16225
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => setBulkOpen(false), children: t("cancel") }),
16226
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.primary, onClick: applyBulk, children: t("globalEnvBulkOk") })
16249
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: controls_default.button, onClick: () => setBulkOpen(false), children: t("cancel") }),
16250
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, onClick: applyBulk, children: t("globalEnvBulkOk") })
16227
16251
  ] })
16228
16252
  ] }) }) : null
16229
16253
  ] });
@@ -16237,12 +16261,12 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16237
16261
  const style = document.createElement("style");
16238
16262
  style.setAttribute("data-plugin", "dsh-mcp");
16239
16263
  style.setAttribute("data-file", "McpSettingsSection.module.css");
16240
- style.textContent = ".section {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.status,\n.failure p {\n margin: 0;\n}\n\n.status,\n.failure {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.failure {\n display: flex;\n align-items: center;\n gap: 10px;\n color: var(--dsw-alias-state-error-primary);\n}\n\nbutton {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\nbutton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.active {\n border-color: var(--dsw-alias-brand-primary);\n color: var(--dsw-alias-brand-primary);\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);\n}\n\n.module {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.moduleTitle {\n display: inline-flex !important;\n align-items: center;\n gap: 6px;\n width: fit-content;\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary) !important;\n}\n\n.moduleTitle:hover {\n background: transparent !important;\n}\n\n.caret {\n display: inline-block;\n width: 14px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.configHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.configActions {\n display: flex;\n gap: 8px;\n}\n\n.inlineForm {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n}\n\n.inlineFormItem {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n list-style: none;\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.row {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 12px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.rowMain {\n display: flex;\n flex: 1 1 320px;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.rowTitle {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n\n.serverName {\n overflow: hidden;\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n flex: none;\n min-height: 18px;\n border-radius: 5px;\n padding: 1px 6px;\n font-size: 11px;\n line-height: 16px;\n white-space: nowrap;\n}\n\n.badge.mounting {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.badge.live {\n background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent);\n color: var(--dsw-alias-state-success-primary);\n}\n\n.badge.failed {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.badge.stopped {\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-tertiary);\n}\n\n.badge.cordis {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.badge.oauth {\n background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent);\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.badge.oauthMiss {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* The authorization button of an unauthorized OAuth server: red, so the\n missing authorization is visible without any warning text. */\n.dangerButton {\n border-color: var(--dsw-alias-state-error-primary);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dangerButton:hover {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n}\n\n.note {\n margin: 6px 0 0;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.warn {\n margin: 6px 0 0;\n color: var(--dsw-alias-state-warn-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.path {\n margin: 4px 0 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n overflow-wrap: anywhere;\n}\n\n.muted {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.rowMeta {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 14px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n}\n\n.rowActions {\n display: flex;\n flex: none;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-left: auto;\n}\n\n.card {\n display: flex;\n flex-direction: column;\n gap: 0;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.card > .row {\n border: 0;\n border-radius: 0;\n background: transparent;\n}\n\n.modeRow {\n display: flex;\n align-items: center;\n gap: 18px;\n flex-wrap: wrap;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 8px 14px;\n background: var(--dsw-alias-bg-layer-3);\n font-size: 13px;\n line-height: 20px;\n}\n\n.modeLabel {\n font-weight: 600;\n}\n\n.modeOption {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n}\n\n.modeHint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.toolPanel {\n border-top: 1px solid var(--dsw-alias-border-l2);\n padding: 10px 14px;\n}\n\n.toolGrid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));\n gap: 4px 14px;\n max-height: 320px;\n overflow-y: auto;\n}\n\n.toolRow {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n padding: 2px 0;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n}\n\n.toolName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
16264
+ style.textContent = ".section {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.status,\n.failureText {\n margin: 0;\n}\n\n.status,\n.failure {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.failure {\n display: flex;\n align-items: center;\n gap: 10px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* Control styling lives in class form in ./controls.module.css; these are the\n section's own variants. No rule may match an element by tag: the sheets are\n injected into the host page globally (issue #14). */\n\n.active {\n border-color: var(--dsw-alias-brand-primary);\n color: var(--dsw-alias-brand-primary);\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);\n}\n\n.module {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.moduleTitle {\n display: inline-flex !important;\n align-items: center;\n gap: 6px;\n width: fit-content;\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary) !important;\n}\n\n.moduleTitle:hover {\n background: transparent !important;\n}\n\n.caret {\n display: inline-block;\n width: 14px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.configHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.configActions {\n display: flex;\n gap: 8px;\n}\n\n.inlineForm {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n}\n\n.inlineFormItem {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n list-style: none;\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.row {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 12px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.rowMain {\n display: flex;\n flex: 1 1 320px;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.rowTitle {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n\n.serverName {\n overflow: hidden;\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n flex: none;\n min-height: 18px;\n border-radius: 5px;\n padding: 1px 6px;\n font-size: 11px;\n line-height: 16px;\n white-space: nowrap;\n}\n\n.badge.mounting {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.badge.live {\n background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent);\n color: var(--dsw-alias-state-success-primary);\n}\n\n.badge.failed {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.badge.stopped {\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-tertiary);\n}\n\n.badge.cordis {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.badge.oauth {\n background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent);\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.badge.oauthMiss {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* The authorization button of an unauthorized OAuth server: red, so the\n missing authorization is visible without any warning text. */\n.dangerButton {\n border-color: var(--dsw-alias-state-error-primary);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dangerButton:hover {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n}\n\n.note {\n margin: 6px 0 0;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.warn {\n margin: 6px 0 0;\n color: var(--dsw-alias-state-warn-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.path {\n margin: 4px 0 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n overflow-wrap: anywhere;\n}\n\n.muted {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.rowMeta {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 14px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n}\n\n.rowActions {\n display: flex;\n flex: none;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-left: auto;\n}\n\n.card {\n display: flex;\n flex-direction: column;\n gap: 0;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.card > .row {\n border: 0;\n border-radius: 0;\n background: transparent;\n}\n\n.modeRow {\n display: flex;\n align-items: center;\n gap: 18px;\n flex-wrap: wrap;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 8px 14px;\n background: var(--dsw-alias-bg-layer-3);\n font-size: 13px;\n line-height: 20px;\n}\n\n.modeLabel {\n font-weight: 600;\n}\n\n.modeOption {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n}\n\n.modeHint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.toolPanel {\n border-top: 1px solid var(--dsw-alias-border-l2);\n padding: 10px 14px;\n}\n\n.toolGrid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));\n gap: 4px 14px;\n max-height: 320px;\n overflow-y: auto;\n}\n\n.toolRow {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n padding: 2px 0;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n}\n\n.toolName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
16241
16265
  document.head.appendChild(style);
16242
16266
  }
16243
16267
  }
16244
16268
  })();
16245
- var McpSettingsSection_default = { "section": "section", "header": "header", "status": "status", "failure": "failure", "primary": "primary", "active": "active", "module": "module", "moduleTitle": "moduleTitle", "caret": "caret", "configHeader": "configHeader", "configActions": "configActions", "inlineForm": "inlineForm", "inlineFormItem": "inlineFormItem", "list": "list", "row": "row", "rowMain": "rowMain", "rowTitle": "rowTitle", "serverName": "serverName", "badge": "badge", "mounting": "mounting", "live": "live", "failed": "failed", "stopped": "stopped", "cordis": "cordis", "oauth": "oauth", "oauthMiss": "oauthMiss", "dangerButton": "dangerButton", "note": "note", "warn": "warn", "path": "path", "muted": "muted", "rowMeta": "rowMeta", "rowActions": "rowActions", "card": "card", "modeRow": "modeRow", "modeLabel": "modeLabel", "modeOption": "modeOption", "modeHint": "modeHint", "toolPanel": "toolPanel", "toolGrid": "toolGrid", "toolRow": "toolRow", "toolName": "toolName" };
16269
+ var McpSettingsSection_default = { "section": "section", "header": "header", "status": "status", "failureText": "failureText", "failure": "failure", "active": "active", "module": "module", "moduleTitle": "moduleTitle", "caret": "caret", "configHeader": "configHeader", "configActions": "configActions", "inlineForm": "inlineForm", "inlineFormItem": "inlineFormItem", "list": "list", "row": "row", "rowMain": "rowMain", "rowTitle": "rowTitle", "serverName": "serverName", "badge": "badge", "mounting": "mounting", "live": "live", "failed": "failed", "stopped": "stopped", "cordis": "cordis", "oauth": "oauth", "oauthMiss": "oauthMiss", "dangerButton": "dangerButton", "note": "note", "warn": "warn", "path": "path", "muted": "muted", "rowMeta": "rowMeta", "rowActions": "rowActions", "card": "card", "modeRow": "modeRow", "modeLabel": "modeLabel", "modeOption": "modeOption", "modeHint": "modeHint", "toolPanel": "toolPanel", "toolGrid": "toolGrid", "toolRow": "toolRow", "toolName": "toolName" };
16246
16270
 
16247
16271
  // src/client/McpSettingsSection.tsx
16248
16272
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -16556,10 +16580,10 @@ function McpSettingsSection(props) {
16556
16580
  }
16557
16581
  if (state.loadState === "error") {
16558
16582
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.failure, children: [
16559
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { role: "alert", children: t("loadError") }),
16560
- hostMissing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.muted, children: t("loadErrorHostMissing") }) : null,
16583
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.failureText, role: "alert", children: t("loadError") }),
16584
+ hostMissing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: `${McpSettingsSection_default.muted} ${McpSettingsSection_default.failureText}`, children: t("loadErrorHostMissing") }) : null,
16561
16585
  loadErrorDetail !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { className: McpSettingsSection_default.muted, children: loadErrorDetail }) : null,
16562
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
16586
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => {
16563
16587
  setLoadState("loading");
16564
16588
  load();
16565
16589
  }, children: t("retry") })
@@ -16627,7 +16651,7 @@ function McpSettingsSection(props) {
16627
16651
  "button",
16628
16652
  {
16629
16653
  type: "button",
16630
- className: McpSettingsSection_default.moduleTitle,
16654
+ className: `${controls_default.button} ${McpSettingsSection_default.moduleTitle}`,
16631
16655
  "aria-expanded": envOpen,
16632
16656
  onClick: () => setEnvOpen((open) => !open),
16633
16657
  children: [
@@ -16655,13 +16679,13 @@ function McpSettingsSection(props) {
16655
16679
  "button",
16656
16680
  {
16657
16681
  type: "button",
16658
- className: jsonOpen ? McpSettingsSection_default.active : void 0,
16682
+ className: jsonOpen ? `${controls_default.button} ${McpSettingsSection_default.active}` : controls_default.button,
16659
16683
  "aria-expanded": jsonOpen,
16660
16684
  onClick: () => setJsonOpen((open) => !open),
16661
16685
  children: t("serversJson")
16662
16686
  }
16663
16687
  ),
16664
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: McpSettingsSection_default.primary, onClick: beginCreate, children: t("addServer") })
16688
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, onClick: beginCreate, children: t("addServer") })
16665
16689
  ] })
16666
16690
  ] }),
16667
16691
  actionError !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.warn, role: "alert", children: [
@@ -16756,21 +16780,21 @@ function McpSettingsSection(props) {
16756
16780
  declared && server.oauthHint ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("oauthHint") }) : null
16757
16781
  ] }),
16758
16782
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowActions, children: [
16759
- declared || server.conflict || server.pendingTakeover ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: isRefreshing, onClick: () => void toggleEnabled(server), children: server.enabled ? t("disable") : t("enabled") }),
16783
+ declared || server.conflict || server.pendingTakeover ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: isRefreshing, onClick: () => void toggleEnabled(server), children: server.enabled ? t("disable") : t("enabled") }),
16760
16784
  oauthNeedsAuth && !server.conflict && !server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
16761
16785
  "button",
16762
16786
  {
16763
16787
  type: "button",
16764
- className: oauthBlocks ? McpSettingsSection_default.dangerButton : void 0,
16788
+ className: oauthBlocks ? `${controls_default.button} ${McpSettingsSection_default.dangerButton}` : controls_default.button,
16765
16789
  onClick: () => void runOAuth(server),
16766
16790
  children: oauthInFlight ? t("oauthInProgress") : t("oauthAuthorize")
16767
16791
  }
16768
16792
  ) : null,
16769
- declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: isRefreshing, onClick: () => refreshServer(server.serverName), children: isRefreshing ? t("refreshing") : t("refresh") }),
16770
- declared && server.adoptable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: adopting.has(server.serverName), onClick: () => void runAdopt(server), children: adopting.has(server.serverName) ? t("adopting") : t("adopt") }) : null,
16771
- server.adopted ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: adopting.has(server.serverName), onClick: () => void runAdopt(server), children: adopting.has(server.serverName) ? t("releasing") : t("release") }) : null,
16772
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => toggleExpand(server.serverName), children: isExpanded ? t("toolsCollapse") : t("toolsExpand") }),
16773
- declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => beginEdit(server), children: t("edit") })
16793
+ declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: isRefreshing, onClick: () => refreshServer(server.serverName), children: isRefreshing ? t("refreshing") : t("refresh") }),
16794
+ declared && server.adoptable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: adopting.has(server.serverName), onClick: () => void runAdopt(server), children: adopting.has(server.serverName) ? t("adopting") : t("adopt") }) : null,
16795
+ server.adopted ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: adopting.has(server.serverName), onClick: () => void runAdopt(server), children: adopting.has(server.serverName) ? t("releasing") : t("release") }) : null,
16796
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => toggleExpand(server.serverName), children: isExpanded ? t("toolsCollapse") : t("toolsExpand") }),
16797
+ declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => beginEdit(server), children: t("edit") })
16774
16798
  ] })
16775
16799
  ] }),
16776
16800
  isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.toolPanel, children: tools === null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.muted, children: toolsError ?? t("toolsLoading") }) : serverToolList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.muted, children: t("toolsEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.toolGrid, children: serverToolList.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.toolRow, title: tool.name, children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "MCP 管理界面 + tool search:可视化配置/启停/刷新 MCP 服务器与工具勾选,按需检索(tool search)热注入;工具列表稳定命中缓存、不撑爆上下文。DeepSeek Harness plugin: MCP management UI + tool search — stable tool list, cache-friendly, no context bloat.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
package/scripts/build.mjs CHANGED
@@ -9,8 +9,18 @@
9
9
  * CSS Modules are handled by an esbuild onLoad plugin: each `.module.css` is
10
10
  * rewritten to a JS module that (1) injects the stylesheet text into a
11
11
  * <style data-plugin="dsh-mcp"> tag and (2) default-exports an identity class
12
- * map (class name -> class name; the standalone plugin does not need hashed
13
- * names because its UI is scoped to the settings section it owns).
12
+ * map (class name -> class name).
13
+ *
14
+ * The identity map means **the stylesheet text is global**: it lands in the
15
+ * host page's <head> and every selector in it can match host DOM. So every
16
+ * rule must be a chain of class selectors, never a bare tag, `*`, or a
17
+ * host-wide pseudo-class like `:root`. Issue #14 is exactly that failure: a
18
+ * bare `button {}` rule restyled every button of the DSH shell and pushed the
19
+ * composer icons off-center. Control styling therefore lives in class form —
20
+ * the shared classes in `src/client/controls.module.css` are defined there
21
+ * once and every component imports that module for the class *names*.
22
+ * `test/client-style-scope.test.mjs` enforces the invariant on the sources and
23
+ * on this build's output.
14
24
  *
15
25
  * esbuild is resolved from the DSH source checkout (the only place it is
16
26
  * installed); the plugin package itself has zero runtime dependencies.
@@ -73,15 +83,22 @@ function resolveEsbuild(checkout) {
73
83
  const require = createRequire(resolveEsbuild(CHECKOUT))
74
84
  const esbuild = require('esbuild')
75
85
 
76
- /** Identity class map for one CSS module + the stylesheet text, as a JS module. */
86
+ /**
87
+ * Identity class map for one CSS module + the stylesheet text, as a JS module.
88
+ *
89
+ * The class names are read from the selectors only (comments are stripped
90
+ * first): a rule's explanatory comment may legitimately name a class that this
91
+ * file does not define, and the identity map must not grow dead keys from it.
92
+ */
77
93
  function cssModuleLoader() {
78
94
  return {
79
95
  name: 'dsh-mcp-css-modules',
80
96
  setup(build) {
81
97
  build.onLoad({ filter: /\.module\.css$/ }, (args) => {
82
98
  const css = readFileSync(args.path, 'utf8')
99
+ const selectorText = css.replace(/\/\*[\s\S]*?\*\//g, '')
83
100
  const classes = [...new Set(
84
- [...css.matchAll(/\.([A-Za-z_][A-Za-z0-9_-]*)/g)].map((match) => match[1]),
101
+ [...selectorText.matchAll(/\.([A-Za-z_][A-Za-z0-9_-]*)/g)].map((match) => match[1]),
85
102
  )]
86
103
  const map = Object.fromEntries(classes.map((name) => [name, name]))
87
104
  const file = args.path.split('/').pop()
@@ -23,24 +23,6 @@
23
23
  gap: 8px;
24
24
  }
25
25
 
26
- .row input {
27
- box-sizing: border-box;
28
- border: 1px solid var(--dsw-alias-border-l2);
29
- border-radius: 6px;
30
- padding: 5px 8px;
31
- outline: none;
32
- background: var(--dsw-alias-bg-layer-1);
33
- color: var(--dsw-alias-label-primary);
34
- font: inherit;
35
- font-size: 13px;
36
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
37
- }
38
-
39
- .row input:focus-visible {
40
- border-color: var(--dsw-alias-brand-primary);
41
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);
42
- }
43
-
44
26
  .name {
45
27
  width: 100%;
46
28
  }
@@ -61,10 +43,6 @@
61
43
  user-select: none;
62
44
  }
63
45
 
64
- .secretToggle input {
65
- cursor: pointer;
66
- }
67
-
68
46
  .secretToggle.secretOn {
69
47
  color: var(--dsw-alias-brand-primary);
70
48
  font-weight: 600;
@@ -135,22 +113,6 @@
135
113
  gap: 10px;
136
114
  }
137
115
 
138
- .retryRow button {
139
- border: 1px solid var(--dsw-alias-border-l2);
140
- border-radius: 6px;
141
- padding: 3px 10px;
142
- background: transparent;
143
- color: var(--dsw-alias-label-primary);
144
- font: inherit;
145
- font-size: 12px;
146
- line-height: 18px;
147
- cursor: pointer;
148
- }
149
-
150
- .retryRow button:hover {
151
- background: var(--dsw-alias-interactive-bg-hover);
152
- }
153
-
154
116
  .error {
155
117
  margin: 0;
156
118
  color: var(--dsw-alias-state-error-primary);
@@ -171,34 +133,3 @@
171
133
  justify-content: flex-end;
172
134
  gap: 8px;
173
135
  }
174
-
175
- .actions button {
176
- border: 1px solid var(--dsw-alias-border-l2);
177
- border-radius: 6px;
178
- padding: 5px 12px;
179
- background: transparent;
180
- color: var(--dsw-alias-label-primary);
181
- font: inherit;
182
- font-size: 13px;
183
- line-height: 20px;
184
- cursor: pointer;
185
- }
186
-
187
- .actions button:hover {
188
- background: var(--dsw-alias-interactive-bg-hover);
189
- }
190
-
191
- .actions button:disabled {
192
- cursor: not-allowed;
193
- opacity: 0.55;
194
- }
195
-
196
- .actions .primary {
197
- border-color: var(--dsw-alias-button-primary-fill);
198
- background: var(--dsw-alias-button-primary-fill);
199
- color: var(--dsw-alias-label-primary-foreground);
200
- }
201
-
202
- .actions .primary:hover {
203
- background: var(--dsw-alias-button-primary-hover);
204
- }
@@ -9,6 +9,7 @@
9
9
  import { useEffect, useRef, useState, type ReactNode } from 'react'
10
10
  import type { McpEnvVarView } from './types.ts'
11
11
  import type { McpSettingsLocaleKey } from './locales.ts'
12
+ import controls from './controls.module.css'
12
13
  import css from './GlobalEnvEditor.module.css'
13
14
 
14
15
  /** One editable row in the editor. */
@@ -185,7 +186,7 @@ export function GlobalEnvEditor({ injected, t, onApplied }: GlobalEnvEditorProps
185
186
  <div key={row.key} className={css.row}>
186
187
  <input
187
188
  type="text"
188
- className={css.name}
189
+ className={`${controls.control} ${controls.controlMono} ${css.name}`}
189
190
  value={row.name}
190
191
  placeholder={t('globalEnvName')}
191
192
  aria-label={t('globalEnvName')}
@@ -193,7 +194,7 @@ export function GlobalEnvEditor({ injected, t, onApplied }: GlobalEnvEditorProps
193
194
  />
194
195
  <input
195
196
  type={row.secret ? 'password' : 'text'}
196
- className={css.value}
197
+ className={`${controls.control} ${controls.controlMono} ${css.value}`}
197
198
  value={row.value}
198
199
  placeholder={row.secret && row.configured ? '••••••••' : t('globalEnvValue')}
199
200
  aria-label={t('globalEnvValue')}
@@ -202,13 +203,14 @@ export function GlobalEnvEditor({ injected, t, onApplied }: GlobalEnvEditorProps
202
203
  <label className={`${css.secretToggle} ${row.secret ? css.secretOn : ''}`} title={t('globalEnvSecretHint')}>
203
204
  <input
204
205
  type="checkbox"
206
+ className={controls.checkbox}
205
207
  checked={row.secret}
206
208
  aria-label={t('globalEnvSecret')}
207
209
  onChange={(event) => update(row.key, { secret: event.currentTarget.checked })}
208
210
  />
209
211
  {t('globalEnvSecret')}
210
212
  </label>
211
- <button type="button" className={css.danger} aria-label={t('globalEnvRemove')} onClick={() => remove(row.key)}>
213
+ <button type="button" className={`${controls.button} ${css.danger}`} aria-label={t('globalEnvRemove')} onClick={() => remove(row.key)}>
212
214
  ✕
213
215
  </button>
214
216
  </div>
@@ -216,15 +218,15 @@ export function GlobalEnvEditor({ injected, t, onApplied }: GlobalEnvEditorProps
216
218
  {loadFailed ? (
217
219
  <div className={css.retryRow}>
218
220
  <p className={css.error} role="alert">{t('globalEnvLoadFailed')}</p>
219
- <button type="button" onClick={reload}>{t('globalEnvRetry')}</button>
221
+ <button type="button" className={`${controls.button} ${controls.buttonSmall}`} onClick={reload}>{t('globalEnvRetry')}</button>
220
222
  </div>
221
223
  ) : null}
222
224
  {error !== null && !loadFailed ? <p className={css.error} role="alert">{error}</p> : null}
223
225
  {notice !== null ? <p className={css.notice} role="status">{notice}</p> : null}
224
226
  <div className={css.actions}>
225
- <button type="button" disabled={busy} onClick={add}>{t('globalEnvAdd')}</button>
226
- <button type="button" disabled={busy} onClick={() => setBulkOpen(true)}>{t('globalEnvBulk')}</button>
227
- <button type="button" className={css.primary} disabled={busy} onClick={save}>
227
+ <button type="button" className={controls.button} disabled={busy} onClick={add}>{t('globalEnvAdd')}</button>
228
+ <button type="button" className={controls.button} disabled={busy} onClick={() => setBulkOpen(true)}>{t('globalEnvBulk')}</button>
229
+ <button type="button" className={`${controls.button} ${controls.primary}`} disabled={busy} onClick={save}>
228
230
  {busy ? t('globalEnvSaving') : t('globalEnvSave')}
229
231
  </button>
230
232
  </div>
@@ -243,8 +245,8 @@ export function GlobalEnvEditor({ injected, t, onApplied }: GlobalEnvEditorProps
243
245
  onChange={(event) => setBulkText(event.currentTarget.value)}
244
246
  />
245
247
  <div className={css.actions}>
246
- <button type="button" onClick={() => setBulkOpen(false)}>{t('cancel')}</button>
247
- <button type="button" className={css.primary} onClick={applyBulk}>{t('globalEnvBulkOk')}</button>
248
+ <button type="button" className={controls.button} onClick={() => setBulkOpen(false)}>{t('cancel')}</button>
249
+ <button type="button" className={`${controls.button} ${controls.primary}`} onClick={applyBulk}>{t('globalEnvBulkOk')}</button>
248
250
  </div>
249
251
  </div>
250
252
  </div>
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  .status,
17
- .failure p {
17
+ .failureText {
18
18
  margin: 0;
19
19
  }
20
20
 
@@ -32,41 +32,9 @@
32
32
  color: var(--dsw-alias-state-error-primary);
33
33
  }
34
34
 
35
- button {
36
- border: 1px solid var(--dsw-alias-border-l2);
37
- border-radius: 6px;
38
- padding: 5px 12px;
39
- background: transparent;
40
- color: var(--dsw-alias-label-primary);
41
- font: inherit;
42
- font-size: 13px;
43
- line-height: 20px;
44
- cursor: pointer;
45
- }
46
-
47
- button:hover {
48
- background: var(--dsw-alias-interactive-bg-hover);
49
- }
50
-
51
- button:focus-visible {
52
- outline: 2px solid var(--dsw-alias-brand-primary);
53
- outline-offset: 1px;
54
- }
55
-
56
- button:disabled {
57
- cursor: not-allowed;
58
- opacity: 0.55;
59
- }
60
-
61
- .primary {
62
- border-color: var(--dsw-alias-button-primary-fill);
63
- background: var(--dsw-alias-button-primary-fill);
64
- color: var(--dsw-alias-label-primary-foreground);
65
- }
66
-
67
- .primary:hover {
68
- background: var(--dsw-alias-button-primary-hover);
69
- }
35
+ /* Control styling lives in class form in ./controls.module.css; these are the
36
+ section's own variants. No rule may match an element by tag: the sheets are
37
+ injected into the host page globally (issue #14). */
70
38
 
71
39
  .active {
72
40
  border-color: var(--dsw-alias-brand-primary);
@@ -10,6 +10,7 @@ import { GlobalEnvEditor, type GlobalEnvRemote } from './GlobalEnvEditor.tsx'
10
10
  import type { McpToolControlRemote } from './ToolControlSection.tsx'
11
11
  import type { McpSettingsLocaleKey } from './locales.ts'
12
12
  import { createMcpManagerStore, type McpDraft, type McpTestOutcome } from './mcp-store.ts'
13
+ import controls from './controls.module.css'
13
14
  import css from './McpSettingsSection.module.css'
14
15
 
15
16
  /** One adopt/release attempt: a business failure, or an advisory note. */
@@ -416,10 +417,10 @@ export function McpSettingsSection(props: McpSettingsSectionProps): ReactNode {
416
417
  if (state.loadState === 'error') {
417
418
  return (
418
419
  <div className={css.failure}>
419
- <p role="alert">{t('loadError')}</p>
420
- {hostMissing ? <p className={css.muted}>{t('loadErrorHostMissing')}</p> : null}
420
+ <p className={css.failureText} role="alert">{t('loadError')}</p>
421
+ {hostMissing ? <p className={`${css.muted} ${css.failureText}`}>{t('loadErrorHostMissing')}</p> : null}
421
422
  {loadErrorDetail !== null ? <pre className={css.muted}>{loadErrorDetail}</pre> : null}
422
- <button type="button" onClick={() => { setLoadState('loading'); load() }}>{t('retry')}</button>
423
+ <button type="button" className={controls.button} onClick={() => { setLoadState('loading'); load() }}>{t('retry')}</button>
423
424
  </div>
424
425
  )
425
426
  }
@@ -484,7 +485,7 @@ export function McpSettingsSection(props: McpSettingsSectionProps): ReactNode {
484
485
  <div className={css.module}>
485
486
  <button
486
487
  type="button"
487
- className={css.moduleTitle}
488
+ className={`${controls.button} ${css.moduleTitle}`}
488
489
  aria-expanded={envOpen}
489
490
  onClick={() => setEnvOpen(open => !open)}
490
491
  >
@@ -511,13 +512,13 @@ export function McpSettingsSection(props: McpSettingsSectionProps): ReactNode {
511
512
  <div className={css.configActions}>
512
513
  <button
513
514
  type="button"
514
- className={jsonOpen ? css.active : undefined}
515
+ className={jsonOpen ? `${controls.button} ${css.active}` : controls.button}
515
516
  aria-expanded={jsonOpen}
516
517
  onClick={() => setJsonOpen(open => !open)}
517
518
  >
518
519
  {t('serversJson')}
519
520
  </button>
520
- <button type="button" className={css.primary} onClick={beginCreate}>{t('addServer')}</button>
521
+ <button type="button" className={`${controls.button} ${controls.primary}`} onClick={beginCreate}>{t('addServer')}</button>
521
522
  </div>
522
523
  </div>
523
524
  {actionError !== null ? (
@@ -651,7 +652,7 @@ export function McpSettingsSection(props: McpSettingsSectionProps): ReactNode {
651
652
  </div>
652
653
  <div className={css.rowActions}>
653
654
  {declared || server.conflict || server.pendingTakeover ? null : (
654
- <button type="button" disabled={isRefreshing} onClick={() => void toggleEnabled(server)}>
655
+ <button type="button" className={controls.button} disabled={isRefreshing} onClick={() => void toggleEnabled(server)}>
655
656
  {server.enabled ? t('disable') : t('enabled')}
656
657
  </button>
657
658
  )}
@@ -663,31 +664,31 @@ export function McpSettingsSection(props: McpSettingsSectionProps): ReactNode {
663
664
  {oauthNeedsAuth && !server.conflict && !server.pendingTakeover ? (
664
665
  <button
665
666
  type="button"
666
- className={oauthBlocks ? css.dangerButton : undefined}
667
+ className={oauthBlocks ? `${controls.button} ${css.dangerButton}` : controls.button}
667
668
  onClick={() => void runOAuth(server)}
668
669
  >
669
670
  {oauthInFlight ? t('oauthInProgress') : t('oauthAuthorize')}
670
671
  </button>
671
672
  ) : null}
672
673
  {declared ? null : (
673
- <button type="button" disabled={isRefreshing} onClick={() => refreshServer(server.serverName)}>
674
+ <button type="button" className={controls.button} disabled={isRefreshing} onClick={() => refreshServer(server.serverName)}>
674
675
  {isRefreshing ? t('refreshing') : t('refresh')}
675
676
  </button>
676
677
  )}
677
678
  {declared && server.adoptable ? (
678
- <button type="button" disabled={adopting.has(server.serverName)} onClick={() => void runAdopt(server)}>
679
+ <button type="button" className={controls.button} disabled={adopting.has(server.serverName)} onClick={() => void runAdopt(server)}>
679
680
  {adopting.has(server.serverName) ? t('adopting') : t('adopt')}
680
681
  </button>
681
682
  ) : null}
682
683
  {server.adopted ? (
683
- <button type="button" disabled={adopting.has(server.serverName)} onClick={() => void runAdopt(server)}>
684
+ <button type="button" className={controls.button} disabled={adopting.has(server.serverName)} onClick={() => void runAdopt(server)}>
684
685
  {adopting.has(server.serverName) ? t('releasing') : t('release')}
685
686
  </button>
686
687
  ) : null}
687
- <button type="button" onClick={() => toggleExpand(server.serverName)}>
688
+ <button type="button" className={controls.button} onClick={() => toggleExpand(server.serverName)}>
688
689
  {isExpanded ? t('toolsCollapse') : t('toolsExpand')}
689
690
  </button>
690
- {declared ? null : <button type="button" onClick={() => beginEdit(server)}>{t('edit')}</button>}
691
+ {declared ? null : <button type="button" className={controls.button} onClick={() => beginEdit(server)}>{t('edit')}</button>}
691
692
  </div>
692
693
  </div>
693
694
  {isExpanded ? (
@@ -26,41 +26,9 @@
26
26
  gap: 8px;
27
27
  }
28
28
 
29
- button {
30
- border: 1px solid var(--dsw-alias-border-l2);
31
- border-radius: 6px;
32
- padding: 5px 12px;
33
- background: transparent;
34
- color: var(--dsw-alias-label-primary);
35
- font: inherit;
36
- font-size: 13px;
37
- line-height: 20px;
38
- cursor: pointer;
39
- }
40
-
41
- button:hover {
42
- background: var(--dsw-alias-interactive-bg-hover);
43
- }
44
-
45
- button:focus-visible {
46
- outline: 2px solid var(--dsw-alias-brand-primary);
47
- outline-offset: 1px;
48
- }
49
-
50
- button:disabled {
51
- cursor: not-allowed;
52
- opacity: 0.55;
53
- }
54
-
55
- .primary {
56
- border-color: var(--dsw-alias-button-primary-fill);
57
- background: var(--dsw-alias-button-primary-fill);
58
- color: var(--dsw-alias-label-primary-foreground);
59
- }
60
-
61
- .primary:hover {
62
- background: var(--dsw-alias-button-primary-hover);
63
- }
29
+ /* Control styling lives in class form in ./controls.module.css; this module
30
+ only keeps its own layout and modifiers, and it must never match an element
31
+ by tag (the sheets are injected into the host page globally, issue #14). */
64
32
 
65
33
  .danger {
66
34
  color: var(--dsw-alias-state-error-primary);
@@ -82,34 +50,6 @@ button:disabled {
82
50
  color: var(--dsw-alias-label-secondary);
83
51
  }
84
52
 
85
- .field input,
86
- .field select,
87
- .field textarea {
88
- width: 100%;
89
- box-sizing: border-box;
90
- border: 1px solid var(--dsw-alias-border-l2);
91
- border-radius: 8px;
92
- padding: 6px 10px;
93
- outline: none;
94
- background: var(--dsw-alias-bg-layer-1);
95
- color: var(--dsw-alias-label-primary);
96
- font: inherit;
97
- font-size: 13px;
98
- resize: vertical;
99
- }
100
-
101
- .field input::placeholder,
102
- .field textarea::placeholder {
103
- color: var(--dsw-alias-label-tertiary);
104
- }
105
-
106
- .field input:focus-visible,
107
- .field select:focus-visible,
108
- .field textarea:focus-visible {
109
- border-color: var(--dsw-alias-brand-primary);
110
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);
111
- }
112
-
113
53
  .hint,
114
54
  .muted {
115
55
  margin: 0;
@@ -7,6 +7,7 @@ import type {
7
7
  } from './mcp-store.ts'
8
8
  import { parseArgs } from './mcp-store.ts'
9
9
  import type { McpSettingsLocaleKey } from './locales.ts'
10
+ import controls from './controls.module.css'
10
11
  import css from './ServerForm.module.css'
11
12
 
12
13
  /** Poll interval of the authorization status while a flow is pending. */
@@ -179,9 +180,9 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
179
180
  <div className={css.titleRow}>
180
181
  <h3 className={css.title}>{draft.id === null ? t('newTitle') : t('editTitle')}</h3>
181
182
  <div className={css.titleActions}>
182
- <button type="button" onClick={() => actions.cancelEdit()}>{t('backToList')}</button>
183
+ <button type="button" className={controls.button} onClick={() => actions.cancelEdit()}>{t('backToList')}</button>
183
184
  {draft.id !== null ? (
184
- <button type="button" className={css.danger} disabled={busy !== null} onClick={() => void removeServer()}>
185
+ <button type="button" className={`${controls.button} ${css.danger}`} disabled={busy !== null} onClick={() => void removeServer()}>
185
186
  {busy === 'remove' ? t('removing') : t('remove')}
186
187
  </button>
187
188
  ) : null}
@@ -194,6 +195,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
194
195
  <span>{t('serverName')}</span>
195
196
  <input
196
197
  type="text"
198
+ className={controls.control}
197
199
  value={draft.serverName}
198
200
  placeholder={t('serverNameHint')}
199
201
  onChange={(event) => update({ serverName: event.currentTarget.value })}
@@ -203,6 +205,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
203
205
  <label className={css.field}>
204
206
  <span>{t('transport')}</span>
205
207
  <select
208
+ className={controls.control}
206
209
  value={draft.transport}
207
210
  onChange={(event) => update({ transport: event.currentTarget.value as McpDraft['transport'] })}
208
211
  >
@@ -217,6 +220,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
217
220
  <span>{t('command')}</span>
218
221
  <input
219
222
  type="text"
223
+ className={controls.control}
220
224
  value={draft.command}
221
225
  placeholder={t('commandPlaceholder')}
222
226
  onChange={(event) => update({ command: event.currentTarget.value })}
@@ -225,6 +229,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
225
229
  <label className={css.field}>
226
230
  <span>{t('args')}</span>
227
231
  <textarea
232
+ className={controls.control}
228
233
  rows={3}
229
234
  value={draft.argsText}
230
235
  placeholder={t('argsPlaceholder')}
@@ -241,6 +246,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
241
246
  <span>{t('cwd')}</span>
242
247
  <input
243
248
  type="text"
249
+ className={controls.control}
244
250
  value={draft.cwd}
245
251
  placeholder={t('cwdPlaceholder')}
246
252
  onChange={(event) => update({ cwd: event.currentTarget.value })}
@@ -254,6 +260,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
254
260
  <span>{t('url')}</span>
255
261
  <input
256
262
  type="url"
263
+ className={controls.control}
257
264
  value={draft.url}
258
265
  placeholder={t('urlPlaceholder')}
259
266
  onChange={(event) => update({ url: event.currentTarget.value })}
@@ -262,6 +269,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
262
269
  <label className={css.field}>
263
270
  <span>{t('headers')}</span>
264
271
  <textarea
272
+ className={controls.control}
265
273
  rows={2}
266
274
  value={draft.headersText}
267
275
  placeholder={t('headersPlaceholder')}
@@ -275,6 +283,7 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
275
283
  <span>{t('toolCallTimeoutMs')}</span>
276
284
  <input
277
285
  type="number"
286
+ className={controls.control}
278
287
  min={1}
279
288
  value={draft.toolCallTimeoutMs}
280
289
  onChange={(event) => update({ toolCallTimeoutMs: event.currentTarget.value })}
@@ -336,13 +345,13 @@ export function McpServerForm(props: McpServerFormProps): ReactNode {
336
345
  ) : null}
337
346
 
338
347
  <div className={css.actions}>
339
- <button type="button" disabled={testRunning || busy !== null} onClick={() => void runTest()}>
348
+ <button type="button" className={controls.button} disabled={testRunning || busy !== null} onClick={() => void runTest()}>
340
349
  {testRunning ? t('testRunning') : t('test')}
341
350
  </button>
342
- <button type="submit" className={css.primary} disabled={busy !== null || testRunning}>
351
+ <button type="submit" className={`${controls.button} ${controls.primary}`} disabled={busy !== null || testRunning}>
343
352
  {busy === 'save' ? t('saving') : t('save')}
344
353
  </button>
345
- <button type="button" disabled={busy !== null} onClick={() => actions.cancelEdit()}>{t('cancel')}</button>
354
+ <button type="button" className={controls.button} disabled={busy !== null} onClick={() => actions.cancelEdit()}>{t('cancel')}</button>
346
355
  </div>
347
356
  </form>
348
357
  )
@@ -57,34 +57,3 @@
57
57
  justify-content: flex-end;
58
58
  gap: 8px;
59
59
  }
60
-
61
- .actions button {
62
- border: 1px solid var(--dsw-alias-border-l2);
63
- border-radius: 6px;
64
- padding: 5px 12px;
65
- background: transparent;
66
- color: var(--dsw-alias-label-primary);
67
- font: inherit;
68
- font-size: 13px;
69
- line-height: 20px;
70
- cursor: pointer;
71
- }
72
-
73
- .actions button:hover {
74
- background: var(--dsw-alias-interactive-bg-hover);
75
- }
76
-
77
- .actions button:disabled {
78
- cursor: not-allowed;
79
- opacity: 0.55;
80
- }
81
-
82
- .actions .primary {
83
- border-color: var(--dsw-alias-button-primary-fill);
84
- background: var(--dsw-alias-button-primary-fill);
85
- color: var(--dsw-alias-label-primary-foreground);
86
- }
87
-
88
- .actions .primary:hover {
89
- background: var(--dsw-alias-button-primary-hover);
90
- }
@@ -26,6 +26,7 @@
26
26
  import { useEffect, useRef, useState, type ReactNode } from 'react'
27
27
  import type { McpServerView } from './types.ts'
28
28
  import type { McpSettingsLocaleKey } from './locales.ts'
29
+ import controls from './controls.module.css'
29
30
  import css from './ServersJsonEditor.module.css'
30
31
 
31
32
  /** One { server, env } entry submitted to the Host's upsertJson. */
@@ -239,8 +240,8 @@ export function ServersJsonEditor({ injected, t, onApplied }: ServersJsonEditorP
239
240
  {error !== null ? <p className={css.error} role="alert">{error}</p> : null}
240
241
  {notice !== null ? <p className={css.notice} role="status">{notice}</p> : null}
241
242
  <div className={css.actions}>
242
- <button type="button" disabled={busy} onClick={reseed}>{t('serversJsonReseed')}</button>
243
- <button type="button" className={css.primary} disabled={busy} onClick={apply}>
243
+ <button type="button" className={controls.button} disabled={busy} onClick={reseed}>{t('serversJsonReseed')}</button>
244
+ <button type="button" className={`${controls.button} ${controls.primary}`} disabled={busy} onClick={apply}>
244
245
  {busy ? t('serversJsonSaving') : t('serversJsonApply')}
245
246
  </button>
246
247
  </div>
@@ -30,7 +30,7 @@
30
30
  color: var(--dsw-alias-label-secondary);
31
31
  }
32
32
 
33
- .mode label {
33
+ .modeOption {
34
34
  display: inline-flex;
35
35
  align-items: center;
36
36
  gap: 4px;
@@ -38,10 +38,6 @@
38
38
  user-select: none;
39
39
  }
40
40
 
41
- .mode input {
42
- margin: 0;
43
- }
44
-
45
41
  .hint {
46
42
  margin: 0;
47
43
  font-size: 12px;
@@ -75,7 +71,7 @@
75
71
  line-height: 18px;
76
72
  }
77
73
 
78
- .row input {
74
+ .toolSwitch {
79
75
  flex: none;
80
76
  margin: 0;
81
77
  }
@@ -11,6 +11,7 @@ import type {
11
11
  McpToolInjectionMode, McpToolView, McpToolsState,
12
12
  } from './types.ts'
13
13
  import type { McpSettingsLocaleKey } from './locales.ts'
14
+ import controls from './controls.module.css'
14
15
  import css from './ToolControlSection.module.css'
15
16
 
16
17
  /** Host Remote face required by this section. */
@@ -86,6 +87,7 @@ export function ToolControlSection({ injected, t }: ToolControlSectionProps): Re
86
87
  <label key={tool.name} className={css.row} title={tool.name}>
87
88
  <input
88
89
  type="checkbox"
90
+ className={css.toolSwitch}
89
91
  checked={tool.enabled}
90
92
  onChange={() => toggle(tool)}
91
93
  />
@@ -101,7 +103,7 @@ export function ToolControlSection({ injected, t }: ToolControlSectionProps): Re
101
103
  <h3 className={css.title}>{t('toolsTitle')}</h3>
102
104
  <div className={css.mode}>
103
105
  <span className={css.modeLabel}>{t('toolsModeLabel')}</span>
104
- <label>
106
+ <label className={css.modeOption}>
105
107
  <input
106
108
  type="radio"
107
109
  name="mcp-tool-mode"
@@ -110,7 +112,7 @@ export function ToolControlSection({ injected, t }: ToolControlSectionProps): Re
110
112
  />
111
113
  {t('toolsModeFull')}
112
114
  </label>
113
- <label>
115
+ <label className={css.modeOption}>
114
116
  <input
115
117
  type="radio"
116
118
  name="mcp-tool-mode"
@@ -0,0 +1,93 @@
1
+ /* Shared control styles for the client UI.
2
+ *
3
+ * Every `.module.css` in this package is injected into the host page's <head>
4
+ * verbatim — the build's class map is the identity, so there is no scoping
5
+ * boundary and a class name is global. Two consequences:
6
+ *
7
+ * 1. Elements are styled by class only, never by tag. A bare `button` /
8
+ * `input` selector would restyle the host shell (issue #14: the composer's
9
+ * icon buttons lost their centering to a leaked `padding: 5px 12px`).
10
+ * 2. Each class below is defined **exactly here**, once. Another stylesheet
11
+ * re-defining `.button` would silently change every control in the plugin,
12
+ * so components import this module only for the class *names* and keep
13
+ * their layout/variant rules in their own file.
14
+ */
15
+
16
+ .button {
17
+ border: 1px solid var(--dsw-alias-border-l2);
18
+ border-radius: 6px;
19
+ padding: 5px 12px;
20
+ background: transparent;
21
+ color: var(--dsw-alias-label-primary);
22
+ font: inherit;
23
+ font-size: 13px;
24
+ line-height: 20px;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .button:hover {
29
+ background: var(--dsw-alias-interactive-bg-hover);
30
+ }
31
+
32
+ .button:focus-visible {
33
+ outline: 2px solid var(--dsw-alias-brand-primary);
34
+ outline-offset: 1px;
35
+ }
36
+
37
+ .button:disabled {
38
+ cursor: not-allowed;
39
+ opacity: 0.55;
40
+ }
41
+
42
+ /* Compact action, e.g. the inline "retry" button of the global-env editor. */
43
+ .buttonSmall {
44
+ padding: 3px 10px;
45
+ font-size: 12px;
46
+ line-height: 18px;
47
+ }
48
+
49
+ .primary {
50
+ border-color: var(--dsw-alias-button-primary-fill);
51
+ background: var(--dsw-alias-button-primary-fill);
52
+ color: var(--dsw-alias-label-primary-foreground);
53
+ }
54
+
55
+ .primary:hover {
56
+ background: var(--dsw-alias-button-primary-hover);
57
+ }
58
+
59
+ /* Text controls: one class for <input>, <select> and <textarea>, so no rule
60
+ has to name an element. */
61
+ .control {
62
+ width: 100%;
63
+ box-sizing: border-box;
64
+ border: 1px solid var(--dsw-alias-border-l2);
65
+ border-radius: 8px;
66
+ padding: 6px 10px;
67
+ outline: none;
68
+ background: var(--dsw-alias-bg-layer-1);
69
+ color: var(--dsw-alias-label-primary);
70
+ font: inherit;
71
+ font-size: 13px;
72
+ resize: vertical;
73
+ }
74
+
75
+ .control::placeholder {
76
+ color: var(--dsw-alias-label-tertiary);
77
+ }
78
+
79
+ .control:focus-visible {
80
+ border-color: var(--dsw-alias-brand-primary);
81
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);
82
+ }
83
+
84
+ /* Denser monospace variant: the env rows of the global-env editor. */
85
+ .controlMono {
86
+ border-radius: 6px;
87
+ padding: 5px 8px;
88
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
89
+ }
90
+
91
+ .checkbox {
92
+ cursor: pointer;
93
+ }