dsh-mcp 1.15.3 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -22,11 +22,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
24
  NS: () => NS,
25
+ PANEL_ID: () => PANEL_ID,
25
26
  apply: () => apply,
26
27
  inject: () => inject
27
28
  });
28
29
  module.exports = __toCommonJS(index_exports);
29
30
 
31
+ // src/client/types.ts
32
+ var MCP_PLACEMENTS = ["sidebar", "settings", "both"];
33
+ function isMcpPlacement(value) {
34
+ return value === "sidebar" || value === "settings" || value === "both";
35
+ }
36
+
30
37
  // ../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
31
38
  var external_exports = {};
32
39
  __export(external_exports, {
@@ -14978,6 +14985,30 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema = external
14978
14985
  "message": external_exports.string().readonly()
14979
14986
  }).readonly()
14980
14987
  })]);
14988
+ var _uiPrefsPlacementSchema = external_exports.union([external_exports.literal("sidebar"), external_exports.literal("settings"), external_exports.literal("both")]);
14989
+ var _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefs_result$schema = external_exports.object({
14990
+ "ok": external_exports.literal(true).readonly(),
14991
+ "placement": _uiPrefsPlacementSchema.readonly(),
14992
+ "pins": external_exports.array(external_exports.string()).readonly(),
14993
+ "aliases": external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).readonly()
14994
+ });
14995
+ var _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefsPatch_parameter_0$schema = external_exports.object({
14996
+ "placement": _uiPrefsPlacementSchema.readonly().optional(),
14997
+ "pins": external_exports.array(external_exports.string()).readonly().optional(),
14998
+ "aliases": external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).readonly().optional()
14999
+ });
15000
+ var _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefsPatch_result$schema = external_exports.union([external_exports.object({
15001
+ "ok": external_exports.literal(true).readonly(),
15002
+ "placement": _uiPrefsPlacementSchema.readonly(),
15003
+ "pins": external_exports.array(external_exports.string()).readonly(),
15004
+ "aliases": external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).readonly()
15005
+ }), external_exports.object({
15006
+ "ok": external_exports.literal(false).readonly(),
15007
+ "error": external_exports.object({
15008
+ "code": external_exports.union([external_exports.literal("MCP_INVALID_SPEC"), external_exports.literal("MCP_PREFS_UNAVAILABLE")]).readonly(),
15009
+ "message": external_exports.string().readonly()
15010
+ }).readonly()
15011
+ })]);
14981
15012
  var TYPERT_REMOTE = {
14982
15013
  package: "dsh-mcp",
14983
15014
  descriptors: [
@@ -15322,6 +15353,48 @@ var TYPERT_REMOTE = {
15322
15353
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema
15323
15354
  },
15324
15355
  sourceLocation: { "file": "lib/index.js" }
15356
+ },
15357
+ {
15358
+ id: "dsh-mcp#mcpManager/uiPrefs",
15359
+ service: "dshMcpManager",
15360
+ namespace: "mcpManager",
15361
+ method: "uiPrefs",
15362
+ invocation: { kind: "direct" },
15363
+ parameters: [],
15364
+ result: {
15365
+ mode: "strict",
15366
+ typeSymbol: "dsh-mcp/types#McpManagerUiPrefsResult",
15367
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefs_result$schema,
15368
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefs_result$schema
15369
+ },
15370
+ sourceLocation: { "file": "lib/index.js" }
15371
+ },
15372
+ {
15373
+ id: "dsh-mcp#mcpManager/uiPrefsPatch",
15374
+ service: "dshMcpManager",
15375
+ namespace: "mcpManager",
15376
+ method: "uiPrefsPatch",
15377
+ invocation: { kind: "direct" },
15378
+ parameters: [
15379
+ {
15380
+ name: "request",
15381
+ wire: "request",
15382
+ source: "json",
15383
+ codec: {
15384
+ mode: "strict",
15385
+ typeSymbol: "dsh-mcp/types#McpManagerUiPrefsPatchRequest",
15386
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefsPatch_parameter_0$schema,
15387
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefsPatch_parameter_0$schema
15388
+ }
15389
+ }
15390
+ ],
15391
+ result: {
15392
+ mode: "strict",
15393
+ typeSymbol: "dsh-mcp/types#McpManagerUiPrefsPatchResult",
15394
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefsPatch_result$schema,
15395
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_uiPrefsPatch_result$schema
15396
+ },
15397
+ sourceLocation: { "file": "lib/index.js" }
15325
15398
  }
15326
15399
  ]
15327
15400
  };
@@ -15515,12 +15588,12 @@ function createMcpManagerStore() {
15515
15588
  const style = document.createElement("style");
15516
15589
  style.setAttribute("data-plugin", "dsh-mcp");
15517
15590
  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";
15591
+ 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 `.controls__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.controls__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.controls__button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.controls__button:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n.controls__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.controls__buttonSmall {\n padding: 3px 10px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.controls__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.controls__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.controls__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.controls__control::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.controls__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.controls__controlMono {\n border-radius: 6px;\n padding: 5px 8px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n\n.controls__checkbox {\n cursor: pointer;\n}\n";
15519
15592
  document.head.appendChild(style);
15520
15593
  }
15521
15594
  }
15522
15595
  })();
15523
- var controls_default = { "button": "button", "buttonSmall": "buttonSmall", "primary": "primary", "control": "control", "controlMono": "controlMono", "checkbox": "checkbox" };
15596
+ var controls_default = { "button": "controls__button", "buttonSmall": "controls__buttonSmall", "primary": "controls__primary", "control": "controls__control", "controlMono": "controls__controlMono", "checkbox": "controls__checkbox" };
15524
15597
 
15525
15598
  // src/client/ServerForm.module.css
15526
15599
  (function() {
@@ -15530,12 +15603,12 @@ var controls_default = { "button": "button", "buttonSmall": "buttonSmall", "prim
15530
15603
  const style = document.createElement("style");
15531
15604
  style.setAttribute("data-plugin", "dsh-mcp");
15532
15605
  style.setAttribute("data-file", "ServerForm.module.css");
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";
15606
+ style.textContent = ".ServerForm__form {\n display: flex;\n flex-direction: column;\n gap: 12px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.ServerForm__titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.ServerForm__title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.ServerForm__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.ServerForm__danger {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.ServerForm__error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.ServerForm__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.ServerForm__hint,\n.ServerForm__muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.ServerForm__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.ServerForm__testResult {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n}\n\n.ServerForm__testOk {\n color: var(--dsw-alias-state-success-primary);\n}\n\n.ServerForm__testFail {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.ServerForm__oauthWaiting {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.ServerForm__oauthOk {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-success-primary);\n}\n\n.ServerForm__oauthRequired {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.ServerForm__actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n\n/* Short connection fields share a row; long ones (URL / headers / args) stay\n full width so they never turn into a two-column form. */\n.ServerForm__grid2 {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));\n gap: 12px;\n}\n\n.ServerForm__titleName {\n font-weight: 400;\n color: var(--dsw-alias-label-tertiary);\n font-family: var(--dsw-alias-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);\n}\n\n/* Behavior switches, grouped so they do not read as more input fields. */\n.ServerForm__options {\n display: flex;\n flex-direction: column;\n gap: 6px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 12px;\n background: var(--dsw-alias-bg-layer-2);\n}\n\n.ServerForm__optionsTitle {\n font-size: 12px;\n font-weight: 600;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* Keep the save row reachable in a long form without a second scroll box. */\n.ServerForm__actions {\n position: sticky;\n bottom: 0;\n padding: 8px 0 2px;\n background: linear-gradient(to top, var(--dsw-alias-bg-layer-3) 70%, transparent);\n}\n\n.ServerForm__fieldError {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* Destructive action sits alone on the left of the footer \u2014 never under the\n cursor that just clicked \u7F16\u8F91 on the row above. */\n.ServerForm__deleteAction {\n margin-right: auto;\n}\n";
15534
15607
  document.head.appendChild(style);
15535
15608
  }
15536
15609
  }
15537
15610
  })();
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" };
15611
+ var ServerForm_default = { "form": "ServerForm__form", "titleRow": "ServerForm__titleRow", "title": "ServerForm__title", "titleActions": "ServerForm__titleActions", "danger": "ServerForm__danger", "error": "ServerForm__error", "field": "ServerForm__field", "hint": "ServerForm__hint", "muted": "ServerForm__muted", "checkRow": "ServerForm__checkRow", "testResult": "ServerForm__testResult", "testOk": "ServerForm__testOk", "testFail": "ServerForm__testFail", "oauthWaiting": "ServerForm__oauthWaiting", "oauthOk": "ServerForm__oauthOk", "oauthRequired": "ServerForm__oauthRequired", "actions": "ServerForm__actions", "grid2": "ServerForm__grid2", "titleName": "ServerForm__titleName", "options": "ServerForm__options", "optionsTitle": "ServerForm__optionsTitle", "fieldError": "ServerForm__fieldError", "deleteAction": "ServerForm__deleteAction" };
15539
15612
 
15540
15613
  // src/client/ServerForm.tsx
15541
15614
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -15546,6 +15619,10 @@ function McpServerForm(props) {
15546
15619
  const [oauthPhase, setOauthPhase] = (0, import_react.useState)("idle");
15547
15620
  const injectedRef = (0, import_react.useRef)(injected);
15548
15621
  injectedRef.current = injected;
15622
+ const [nameTouched, setNameTouched] = (0, import_react.useState)(false);
15623
+ (0, import_react.useEffect)(() => {
15624
+ setNameTouched(false);
15625
+ }, [draft.id]);
15549
15626
  const update = (patch) => {
15550
15627
  setSaveError(null);
15551
15628
  actions.updateDraft(patch);
@@ -15594,6 +15671,11 @@ function McpServerForm(props) {
15594
15671
  }
15595
15672
  };
15596
15673
  const submit = async () => {
15674
+ if (!/^[A-Za-z0-9_-]{1,32}$/.test(draft.serverName.trim())) {
15675
+ setNameTouched(true);
15676
+ setSaveError(null);
15677
+ return;
15678
+ }
15597
15679
  setSaveError(null);
15598
15680
  actions.setBusy("save");
15599
15681
  try {
@@ -15643,6 +15725,7 @@ function McpServerForm(props) {
15643
15725
  return false;
15644
15726
  }
15645
15727
  };
15728
+ const nameValid = /^[A-Za-z0-9_-]{1,32}$/.test(draft.serverName.trim());
15646
15729
  const stdio = draft.transport === "stdio";
15647
15730
  const probe = test?.probe;
15648
15731
  return (
@@ -15655,41 +15738,49 @@ function McpServerForm(props) {
15655
15738
  event.preventDefault();
15656
15739
  void submit();
15657
15740
  }, children: [
15658
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.titleRow, children: [
15659
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: ServerForm_default.title, children: draft.id === null ? t("newTitle") : t("editTitle") }),
15660
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.titleActions, children: [
15661
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, onClick: () => actions.cancelEdit(), children: t("backToList") }),
15662
- 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
15741
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: ServerForm_default.titleRow, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h3", { className: ServerForm_default.title, children: [
15742
+ draft.id === null ? t("newTitle") : t("editTitle"),
15743
+ draft.id === null || draft.serverName.trim().length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: ServerForm_default.titleName, children: [
15744
+ " \xB7 ",
15745
+ draft.serverName
15663
15746
  ] })
15664
- ] }),
15747
+ ] }) }),
15665
15748
  saveError !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.error, role: "alert", children: saveError }) : null,
15666
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
15667
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("serverName") }),
15668
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15669
- "input",
15670
- {
15671
- type: "text",
15672
- className: controls_default.control,
15673
- value: draft.serverName,
15674
- placeholder: t("serverNameHint"),
15675
- onChange: (event) => update({ serverName: event.currentTarget.value })
15676
- }
15677
- )
15678
- ] }),
15679
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
15680
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("transport") }),
15681
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
15682
- "select",
15683
- {
15684
- className: controls_default.control,
15685
- value: draft.transport,
15686
- onChange: (event) => update({ transport: event.currentTarget.value }),
15687
- children: [
15688
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "stdio", children: t("transportStdio") }),
15689
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "streamable-http", children: t("transportHttp") })
15690
- ]
15691
- }
15692
- )
15749
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.grid2, children: [
15750
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
15751
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("serverName") }),
15752
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15753
+ "input",
15754
+ {
15755
+ type: "text",
15756
+ className: controls_default.control,
15757
+ value: draft.serverName,
15758
+ placeholder: t("serverNamePlaceholder"),
15759
+ autoFocus: draft.id === null,
15760
+ "aria-invalid": nameTouched && !nameValid,
15761
+ onChange: (event) => {
15762
+ setNameTouched(true);
15763
+ update({ serverName: event.currentTarget.value });
15764
+ }
15765
+ }
15766
+ ),
15767
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: nameTouched && !nameValid ? ServerForm_default.fieldError : ServerForm_default.muted, children: t("serverNameHint") })
15768
+ ] }),
15769
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
15770
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("transport") }),
15771
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
15772
+ "select",
15773
+ {
15774
+ className: controls_default.control,
15775
+ value: draft.transport,
15776
+ onChange: (event) => update({ transport: event.currentTarget.value }),
15777
+ children: [
15778
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "stdio", children: t("transportStdio") }),
15779
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "streamable-http", children: t("transportHttp") })
15780
+ ]
15781
+ }
15782
+ )
15783
+ ] })
15693
15784
  ] }),
15694
15785
  stdio ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
15695
15786
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
@@ -15772,7 +15863,51 @@ function McpServerForm(props) {
15772
15863
  )
15773
15864
  ] })
15774
15865
  ] }),
15775
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
15866
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.options, children: [
15867
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: ServerForm_default.optionsTitle, children: t("optionsTitle") }),
15868
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
15869
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15870
+ "input",
15871
+ {
15872
+ type: "checkbox",
15873
+ checked: draft.enabled,
15874
+ onChange: (event) => update({ enabled: event.currentTarget.checked })
15875
+ }
15876
+ ),
15877
+ t("enabled")
15878
+ ] }),
15879
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
15880
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15881
+ "input",
15882
+ {
15883
+ type: "checkbox",
15884
+ checked: draft.failOnStartupError,
15885
+ onChange: (event) => update({ failOnStartupError: event.currentTarget.checked })
15886
+ }
15887
+ ),
15888
+ t("failOnStartupError")
15889
+ ] }),
15890
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
15891
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15892
+ "input",
15893
+ {
15894
+ type: "checkbox",
15895
+ checked: draft.oauth,
15896
+ onChange: (event) => update({ oauth: event.currentTarget.checked })
15897
+ }
15898
+ ),
15899
+ t("oauthAuth")
15900
+ ] }),
15901
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.hint, children: t("oauthAuthHint") }),
15902
+ draft.oauth && !stdio && oauthPhase !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: oauthPhase === "authorized" ? ServerForm_default.oauthOk : ServerForm_default.oauthWaiting, role: "status", children: oauthPhase === "authorized" ? t("oauthAuthorized") : t("oauthWaiting") }) : null
15903
+ ] }),
15904
+ test !== null ? probe !== void 0 && !probe.ok && probe.oauthRequired === true ? (
15905
+ // Pending authorization is a waiting state, not a failure; once
15906
+ // authorized the panel above reports success and this clears.
15907
+ oauthPhase === "authorized" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.oauthRequired, role: "status", children: t("oauthRequired") })
15908
+ ) : /* @__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,
15909
+ testRunning && draft.transport === "streamable-http" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.muted, role: "status", children: t("testBrowserHint") }) : null,
15910
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: ServerForm_default.grid2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
15776
15911
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("toolCallTimeoutMs") }),
15777
15912
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15778
15913
  "input",
@@ -15784,49 +15919,18 @@ function McpServerForm(props) {
15784
15919
  onChange: (event) => update({ toolCallTimeoutMs: event.currentTarget.value })
15785
15920
  }
15786
15921
  )
15787
- ] }),
15788
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
15789
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15790
- "input",
15791
- {
15792
- type: "checkbox",
15793
- checked: draft.oauth,
15794
- onChange: (event) => update({ oauth: event.currentTarget.checked })
15795
- }
15796
- ),
15797
- t("oauthAuth")
15798
- ] }),
15799
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.hint, children: t("oauthAuthHint") }),
15800
- draft.oauth && !stdio && oauthPhase !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: oauthPhase === "authorized" ? ServerForm_default.oauthOk : ServerForm_default.oauthWaiting, role: "status", children: oauthPhase === "authorized" ? t("oauthAuthorized") : t("oauthWaiting") }) : null,
15801
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
15802
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15803
- "input",
15804
- {
15805
- type: "checkbox",
15806
- checked: draft.failOnStartupError,
15807
- onChange: (event) => update({ failOnStartupError: event.currentTarget.checked })
15808
- }
15809
- ),
15810
- t("failOnStartupError")
15811
- ] }),
15812
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
15813
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15814
- "input",
15922
+ ] }) }),
15923
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.actions, children: [
15924
+ draft.id === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
15925
+ "button",
15815
15926
  {
15816
- type: "checkbox",
15817
- checked: draft.enabled,
15818
- onChange: (event) => update({ enabled: event.currentTarget.checked })
15927
+ type: "button",
15928
+ className: `${controls_default.button} ${ServerForm_default.danger} ${ServerForm_default.deleteAction}`,
15929
+ disabled: busy !== null,
15930
+ onClick: () => void removeServer(),
15931
+ children: busy === "remove" ? t("removing") : t("remove")
15819
15932
  }
15820
15933
  ),
15821
- t("enabled")
15822
- ] }),
15823
- test !== null ? probe !== void 0 && !probe.ok && probe.oauthRequired === true ? (
15824
- // Pending authorization is a waiting state, not a failure; once
15825
- // authorized the panel above reports success and this clears.
15826
- oauthPhase === "authorized" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.oauthRequired, role: "status", children: t("oauthRequired") })
15827
- ) : /* @__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,
15828
- testRunning && draft.transport === "streamable-http" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.muted, role: "status", children: t("testBrowserHint") }) : null,
15829
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.actions, children: [
15830
15934
  /* @__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") }),
15831
15935
  /* @__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") }),
15832
15936
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, disabled: busy !== null, onClick: () => actions.cancelEdit(), children: t("cancel") })
@@ -15846,12 +15950,12 @@ var import_react2 = require("react");
15846
15950
  const style = document.createElement("style");
15847
15951
  style.setAttribute("data-plugin", "dsh-mcp");
15848
15952
  style.setAttribute("data-file", "ServersJsonEditor.module.css");
15849
- 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";
15953
+ style.textContent = ".ServersJsonEditor__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.ServersJsonEditor__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.ServersJsonEditor__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.ServersJsonEditor__hint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.ServersJsonEditor__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.ServersJsonEditor__notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.ServersJsonEditor__actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
15850
15954
  document.head.appendChild(style);
15851
15955
  }
15852
15956
  }
15853
15957
  })();
15854
- var ServersJsonEditor_default = { "panel": "panel", "editor": "editor", "hint": "hint", "error": "error", "notice": "notice", "actions": "actions" };
15958
+ var ServersJsonEditor_default = { "panel": "ServersJsonEditor__panel", "editor": "ServersJsonEditor__editor", "hint": "ServersJsonEditor__hint", "error": "ServersJsonEditor__error", "notice": "ServersJsonEditor__notice", "actions": "ServersJsonEditor__actions" };
15855
15959
 
15856
15960
  // src/client/ServersJsonEditor.tsx
15857
15961
  var import_jsx_runtime2 = require("react/jsx-runtime");
@@ -16049,12 +16153,12 @@ var import_react3 = require("react");
16049
16153
  const style = document.createElement("style");
16050
16154
  style.setAttribute("data-plugin", "dsh-mcp");
16051
16155
  style.setAttribute("data-file", "GlobalEnvEditor.module.css");
16052
- 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";
16156
+ style.textContent = ".GlobalEnvEditor__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.GlobalEnvEditor__hint,\n.GlobalEnvEditor__muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.GlobalEnvEditor__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.GlobalEnvEditor__name {\n width: 100%;\n}\n\n.GlobalEnvEditor__value {\n width: 100%;\n}\n\n.GlobalEnvEditor__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.GlobalEnvEditor__secretToggle.GlobalEnvEditor__secretOn {\n color: var(--dsw-alias-brand-primary);\n font-weight: 600;\n}\n\n.GlobalEnvEditor__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.GlobalEnvEditor__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.GlobalEnvEditor__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.GlobalEnvEditor__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.GlobalEnvEditor__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.GlobalEnvEditor__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.GlobalEnvEditor__retryRow {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.GlobalEnvEditor__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.GlobalEnvEditor__notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.GlobalEnvEditor__actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
16053
16157
  document.head.appendChild(style);
16054
16158
  }
16055
16159
  }
16056
16160
  })();
16057
- 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" };
16161
+ var GlobalEnvEditor_default = { "panel": "GlobalEnvEditor__panel", "hint": "GlobalEnvEditor__hint", "muted": "GlobalEnvEditor__muted", "row": "GlobalEnvEditor__row", "name": "GlobalEnvEditor__name", "value": "GlobalEnvEditor__value", "secretToggle": "GlobalEnvEditor__secretToggle", "secretOn": "GlobalEnvEditor__secretOn", "danger": "GlobalEnvEditor__danger", "overlay": "GlobalEnvEditor__overlay", "dialog": "GlobalEnvEditor__dialog", "dialogTitle": "GlobalEnvEditor__dialogTitle", "bulkText": "GlobalEnvEditor__bulkText", "retryRow": "GlobalEnvEditor__retryRow", "error": "GlobalEnvEditor__error", "notice": "GlobalEnvEditor__notice", "actions": "GlobalEnvEditor__actions" };
16058
16162
 
16059
16163
  // src/client/GlobalEnvEditor.tsx
16060
16164
  var import_jsx_runtime3 = require("react/jsx-runtime");
@@ -16270,12 +16374,12 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
16270
16374
  const style = document.createElement("style");
16271
16375
  style.setAttribute("data-plugin", "dsh-mcp");
16272
16376
  style.setAttribute("data-file", "McpSettingsSection.module.css");
16273
- 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";
16377
+ style.textContent = '.McpSettingsSection__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.McpSettingsSection__header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.McpSettingsSection__status,\n.McpSettingsSection__failureText {\n margin: 0;\n}\n\n.McpSettingsSection__status,\n.McpSettingsSection__failure {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__moduleTitle:hover {\n background: transparent !important;\n}\n\n.McpSettingsSection__caret {\n display: inline-block;\n width: 14px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__configHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.McpSettingsSection__configActions {\n display: flex;\n gap: 8px;\n}\n\n.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.McpSettingsSection__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.McpSettingsSection__rowMain {\n display: flex;\n flex: 1 1 320px;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.McpSettingsSection__rowTitle {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n\n.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__badge.McpSettingsSection__mounting {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.McpSettingsSection__badge.McpSettingsSection__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.McpSettingsSection__badge.McpSettingsSection__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.McpSettingsSection__badge.McpSettingsSection__stopped {\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__badge.McpSettingsSection__cordis {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.McpSettingsSection__badge.McpSettingsSection__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.McpSettingsSection__badge.McpSettingsSection__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.McpSettingsSection__dangerButton {\n border-color: var(--dsw-alias-state-error-primary);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.McpSettingsSection__dangerButton:hover {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n}\n\n.McpSettingsSection__note {\n margin: 6px 0 0;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.McpSettingsSection__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.McpSettingsSection__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.McpSettingsSection__muted {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__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.McpSettingsSection__rowActions {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n flex: none;\n margin-left: auto;\n}\n\n.McpSettingsSection__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.McpSettingsSection__card > .McpSettingsSection__row {\n border: 0;\n border-radius: 0;\n background: transparent;\n}\n\n/* Display-location picker: the same chip language as the injection-mode row,\n kept separate so both can sit at the top of the page without one style\n overriding the other. */\n.McpSettingsSection__placementRow {\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}\n\n.McpSettingsSection__placementLabel {\n font-weight: 600;\n}\n\n.McpSettingsSection__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.McpSettingsSection__modeLabel {\n font-weight: 600;\n}\n\n.McpSettingsSection__modeOption {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n}\n\n.McpSettingsSection__modeHint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n/* --- list controls: search + pinned filter ------------------------------- */\n\n.McpSettingsSection__listControls {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n margin-bottom: 8px;\n}\n\n.McpSettingsSection__toolSearch {\n flex: 1 1 260px;\n min-width: 200px;\n height: 30px;\n padding: 0 10px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font-size: 13px;\n}\n\n.McpSettingsSection__pinToggle {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n cursor: pointer;\n}\n\n/* --- pinned-tool strip --------------------------------------------------- */\n\n.McpSettingsSection__pinnedBlock {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin-bottom: 10px;\n padding: 8px 10px;\n border: 1px solid color-mix(in srgb, #2f6fed 45%, transparent);\n border-radius: 10px;\n background: color-mix(in srgb, #2f6fed 6%, transparent);\n}\n\n.McpSettingsSection__pinnedTitle {\n font-size: 12px;\n font-weight: 600;\n color: #1f63d6;\n}\n\n\n\n\n\n\n\n/* --- per-server tool panel ---------------------------------------------- */\n\n.McpSettingsSection__toolPanel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border-top: 1px solid var(--dsw-alias-border-l2);\n padding: 10px 14px;\n}\n\n.McpSettingsSection__aliasRow {\n display: flex;\n align-items: center;\n gap: 10px;\n flex-wrap: wrap;\n}\n\n.McpSettingsSection__aliasLabel {\n font-size: 12px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__aliasInput {\n flex: 1 1 220px;\n min-width: 160px;\n height: 28px;\n padding: 0 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font-size: 12px;\n}\n\n.McpSettingsSection__toolList {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));\n gap: 1px 14px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.McpSettingsSection__toolRow {\n display: flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n padding: 3px 4px;\n border-radius: 6px;\n font-size: 12.5px;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n/* Disabled tools stay listed but read as "off" at a glance. */\n.McpSettingsSection__toolRowOff .McpSettingsSection__toolName {\n color: var(--dsw-alias-label-tertiary);\n text-decoration: line-through;\n text-decoration-color: color-mix(in srgb, var(--dsw-alias-label-tertiary) 60%, transparent);\n}\n\n.McpSettingsSection__toolRow:hover {\n background: var(--dsw-alias-bg-layer-2);\n}\n\n.McpSettingsSection__toolName {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12.5px;\n font-family: var(--dsw-alias-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);\n}\n\n/* Hover/focus popup: the row stays one line, the full description is one\n hover away. A CSS popup rather than a native `title` so it appears\n immediately and can wrap long English descriptions. */\n.McpSettingsSection__helpWrap {\n position: relative;\n flex: none;\n display: inline-flex;\n}\n\n.McpSettingsSection__helpTip {\n display: none;\n position: absolute;\n right: 0;\n top: calc(100% + 6px);\n z-index: 40;\n width: max-content;\n max-width: 300px;\n max-height: 240px;\n overflow-y: auto;\n padding: 8px 10px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: var(--dsw-alias-bg-overlay);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n text-align: left;\n white-space: normal;\n word-break: break-word;\n}\n\n.McpSettingsSection__helpWrap:hover .McpSettingsSection__helpTip,\n.McpSettingsSection__helpWrap:focus-within .McpSettingsSection__helpTip {\n display: block;\n}\n\n\n\n.McpSettingsSection__duplicateHint {\n color: var(--dsw-alias-state-warning-primary, var(--dsw-alias-state-error-primary));\n}\n\n\n\n/* Question-mark affordance: the row truncates a long tool description, this\n shows the whole text on hover (and on focus, via the native title). */\n.McpSettingsSection__helpButton {\n flex: none;\n width: 16px;\n height: 16px;\n padding: 0 !important;\n border: 0 !important;\n border-radius: 50%;\n background: var(--dsw-alias-bg-layer-2) !important;\n font-size: 10.5px;\n line-height: 16px;\n text-align: center;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__helpButton:hover {\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-layer-2) !important;\n}\n\n/* The tool row\'s action column: one icon when unpinned, a pill once pinned.\n Grouped at the right so the eye reads "name \u2026 actions" instead of a lone\n glyph floating at the far edge. */\n\n\n.McpSettingsSection__pinGhost:hover {\n border-color: var(--dsw-alias-border-l2) !important;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-layer-2) !important;\n}\n\n\n.McpSettingsSection__pinPill .McpSettingsSection__pinGlyph {\n margin-right: 4px;\n filter: none;\n opacity: 1;\n}\n\n.McpSettingsSection__pinAll {\n margin-left: auto;\n font-size: 12px;\n}\n\n.McpSettingsSection__aliasStatus {\n font-size: 11.5px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.McpSettingsSection__pinnedHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n/* Pinned tools: one line per server, chips that hug their content \u2014 no repeated\n server column and no stretched rows. */\n.McpSettingsSection__pinnedGroups {\n display: flex;\n flex-direction: column;\n gap: 4px;\n max-height: 190px;\n overflow-y: auto;\n}\n\n.McpSettingsSection__pinnedGroup {\n display: grid;\n grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto;\n gap: 8px;\n align-items: start;\n}\n\n/* One "unpin all of this server" per group: bulk actions belong to the MCP\n they affect, not only to the whole list. */\n.McpSettingsSection__pinnedGroupClear {\n padding: 0 6px !important;\n border: 1px solid transparent !important;\n background: transparent !important;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11.5px;\n line-height: 18px;\n}\n\n.McpSettingsSection__pinnedGroupClear:hover {\n color: var(--dsw-alias-state-error-primary);\n border-color: var(--dsw-alias-border-l2) !important;\n}\n\n.McpSettingsSection__pinnedServer {\n padding-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11.5px;\n}\n\n.McpSettingsSection__pinnedChips {\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n}\n\n.McpSettingsSection__pinnedChip {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n padding: 1px 2px 1px 8px;\n border-radius: 999px;\n border: 1px solid color-mix(in srgb, #2f6fed 40%, transparent);\n background: color-mix(in srgb, #2f6fed 12%, transparent);\n color: #1f63d6;\n font-size: 11.5px;\n line-height: 18px;\n font-family: var(--dsw-alias-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);\n}\n\n.McpSettingsSection__pinnedRemove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n background: transparent;\n color: inherit;\n opacity: 0.6;\n font-size: 10px;\n line-height: 1;\n cursor: pointer;\n}\n\n.McpSettingsSection__pinnedRemove:hover {\n opacity: 1;\n}\n\n/* Pin control is text, not a lone glyph: both states are >= 44px wide and the\n hit area matches what is drawn, which the 28px icon never did. */\n.McpSettingsSection__pinOff {\n flex: none;\n padding: 0 6px !important;\n border: 1px solid var(--dsw-alias-border-l2) !important;\n border-radius: 4px;\n background: transparent !important;\n color: var(--dsw-alias-label-secondary);\n font-size: 11.5px;\n line-height: 18px;\n}\n\n.McpSettingsSection__pinOff:hover {\n color: var(--dsw-alias-brand-primary);\n background: var(--dsw-alias-bg-layer-2) !important;\n border-radius: 4px;\n}\n\n.McpSettingsSection__pinOn {\n flex: none;\n padding: 0 8px !important;\n border: 1px solid color-mix(in srgb, #2f6fed 45%, transparent) !important;\n border-radius: 999px;\n background: color-mix(in srgb, #2f6fed 12%, transparent) !important;\n color: #1f63d6;\n font-size: 11.5px;\n font-weight: 600;\n line-height: 18px;\n}\n';
16274
16378
  document.head.appendChild(style);
16275
16379
  }
16276
16380
  }
16277
16381
  })();
16278
- 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" };
16382
+ var McpSettingsSection_default = { "section": "McpSettingsSection__section", "header": "McpSettingsSection__header", "status": "McpSettingsSection__status", "failureText": "McpSettingsSection__failureText", "failure": "McpSettingsSection__failure", "active": "McpSettingsSection__active", "module": "McpSettingsSection__module", "moduleTitle": "McpSettingsSection__moduleTitle", "caret": "McpSettingsSection__caret", "configHeader": "McpSettingsSection__configHeader", "configActions": "McpSettingsSection__configActions", "inlineForm": "McpSettingsSection__inlineForm", "inlineFormItem": "McpSettingsSection__inlineFormItem", "list": "McpSettingsSection__list", "row": "McpSettingsSection__row", "rowMain": "McpSettingsSection__rowMain", "rowTitle": "McpSettingsSection__rowTitle", "serverName": "McpSettingsSection__serverName", "badge": "McpSettingsSection__badge", "mounting": "McpSettingsSection__mounting", "live": "McpSettingsSection__live", "failed": "McpSettingsSection__failed", "stopped": "McpSettingsSection__stopped", "cordis": "McpSettingsSection__cordis", "oauth": "McpSettingsSection__oauth", "oauthMiss": "McpSettingsSection__oauthMiss", "dangerButton": "McpSettingsSection__dangerButton", "note": "McpSettingsSection__note", "warn": "McpSettingsSection__warn", "path": "McpSettingsSection__path", "muted": "McpSettingsSection__muted", "rowMeta": "McpSettingsSection__rowMeta", "rowActions": "McpSettingsSection__rowActions", "card": "McpSettingsSection__card", "placementRow": "McpSettingsSection__placementRow", "placementLabel": "McpSettingsSection__placementLabel", "modeRow": "McpSettingsSection__modeRow", "modeLabel": "McpSettingsSection__modeLabel", "modeOption": "McpSettingsSection__modeOption", "modeHint": "McpSettingsSection__modeHint", "listControls": "McpSettingsSection__listControls", "toolSearch": "McpSettingsSection__toolSearch", "pinToggle": "McpSettingsSection__pinToggle", "pinnedBlock": "McpSettingsSection__pinnedBlock", "pinnedTitle": "McpSettingsSection__pinnedTitle", "toolPanel": "McpSettingsSection__toolPanel", "aliasRow": "McpSettingsSection__aliasRow", "aliasLabel": "McpSettingsSection__aliasLabel", "aliasInput": "McpSettingsSection__aliasInput", "toolList": "McpSettingsSection__toolList", "toolRow": "McpSettingsSection__toolRow", "toolRowOff": "McpSettingsSection__toolRowOff", "toolName": "McpSettingsSection__toolName", "helpWrap": "McpSettingsSection__helpWrap", "helpTip": "McpSettingsSection__helpTip", "duplicateHint": "McpSettingsSection__duplicateHint", "helpButton": "McpSettingsSection__helpButton", "pinGhost": "McpSettingsSection__pinGhost", "pinPill": "McpSettingsSection__pinPill", "pinGlyph": "McpSettingsSection__pinGlyph", "pinAll": "McpSettingsSection__pinAll", "aliasStatus": "McpSettingsSection__aliasStatus", "pinnedHeader": "McpSettingsSection__pinnedHeader", "pinnedGroups": "McpSettingsSection__pinnedGroups", "pinnedGroup": "McpSettingsSection__pinnedGroup", "pinnedGroupClear": "McpSettingsSection__pinnedGroupClear", "pinnedServer": "McpSettingsSection__pinnedServer", "pinnedChips": "McpSettingsSection__pinnedChips", "pinnedChip": "McpSettingsSection__pinnedChip", "pinnedRemove": "McpSettingsSection__pinnedRemove", "pinOff": "McpSettingsSection__pinOff", "pinOn": "McpSettingsSection__pinOn" };
16279
16383
 
16280
16384
  // src/client/McpSettingsSection.tsx
16281
16385
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -16291,11 +16395,58 @@ function phaseKey(phase) {
16291
16395
  return "statusStopped";
16292
16396
  }
16293
16397
  }
16294
- function rawOf(name) {
16398
+ function fillTemplate(template, vars) {
16399
+ return template.replace(/\{([A-Za-z0-9_]+)\}/g, (match, name) => vars[name] === void 0 ? match : String(vars[name]));
16400
+ }
16401
+ function tailOf(name) {
16402
+ const rest = name.slice(5);
16403
+ const index = rest.indexOf("__");
16404
+ return index < 0 ? rest : rest.slice(index + 2);
16405
+ }
16406
+ function serverOfName(name) {
16295
16407
  const rest = name.slice(5);
16296
- const i = rest.indexOf("__");
16297
- return i < 0 ? rest : rest.slice(i + 2);
16408
+ const index = rest.indexOf("__");
16409
+ return index < 0 ? rest : rest.slice(0, index);
16410
+ }
16411
+ function findDuplicates(tools) {
16412
+ const byServer = /* @__PURE__ */ new Map();
16413
+ for (const tool of tools) {
16414
+ const set2 = byServer.get(tool.server) ?? /* @__PURE__ */ new Set();
16415
+ set2.add(tailOf(tool.name));
16416
+ byServer.set(tool.server, set2);
16417
+ }
16418
+ const servers = [...byServer.keys()].sort();
16419
+ const duplicates = /* @__PURE__ */ new Map();
16420
+ for (let right = 0; right < servers.length; right += 1) {
16421
+ const rightSet = byServer.get(servers[right]) ?? /* @__PURE__ */ new Set();
16422
+ for (let left = 0; left < right; left += 1) {
16423
+ const leftSet = byServer.get(servers[left]) ?? /* @__PURE__ */ new Set();
16424
+ let shared = 0;
16425
+ for (const name of rightSet) if (leftSet.has(name)) shared += 1;
16426
+ const smaller = Math.min(rightSet.size, leftSet.size);
16427
+ if (shared >= 3 && shared >= smaller * 0.7) {
16428
+ duplicates.set(servers[right], { server: servers[left], count: shared });
16429
+ break;
16430
+ }
16431
+ }
16432
+ }
16433
+ return duplicates;
16298
16434
  }
16435
+ function groupPins(pins) {
16436
+ const groups = /* @__PURE__ */ new Map();
16437
+ for (const name of pins) {
16438
+ const server = serverOfName(name);
16439
+ const bucket = groups.get(server) ?? [];
16440
+ bucket.push(name);
16441
+ groups.set(server, bucket);
16442
+ }
16443
+ return [...groups.entries()].sort((left, right) => left[0].localeCompare(right[0]));
16444
+ }
16445
+ var PLACEMENT_LABEL_KEY = {
16446
+ sidebar: "placementSidebar",
16447
+ settings: "placementSettings",
16448
+ both: "placementBoth"
16449
+ };
16299
16450
  function viewToDraft(server) {
16300
16451
  return {
16301
16452
  id: server.id,
@@ -16321,7 +16472,11 @@ function McpSettingsSection(props) {
16321
16472
  const [hostMissing, setHostMissing] = (0, import_react4.useState)(false);
16322
16473
  const [tools, setTools] = (0, import_react4.useState)(null);
16323
16474
  const [toolsError, setToolsError] = (0, import_react4.useState)(null);
16475
+ const [toolQuery, setToolQuery] = (0, import_react4.useState)("");
16476
+ const [onlyPinned, setOnlyPinned] = (0, import_react4.useState)(false);
16324
16477
  const [expanded, setExpanded] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
16478
+ const [aliasDraft, setAliasDraft] = (0, import_react4.useState)({});
16479
+ const [aliasBusy, setAliasBusy] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
16325
16480
  const [refreshing, setRefreshing] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
16326
16481
  const [jsonOpen, setJsonOpen] = (0, import_react4.useState)(false);
16327
16482
  const [envOpen, setEnvOpen] = (0, import_react4.useState)(true);
@@ -16333,6 +16488,9 @@ function McpSettingsSection(props) {
16333
16488
  const [oauthIncomplete, setOauthIncomplete] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
16334
16489
  const [actionError, setActionError] = (0, import_react4.useState)(null);
16335
16490
  const [actionNotice, setActionNotice] = (0, import_react4.useState)(null);
16491
+ const [prefs, setPrefs] = (0, import_react4.useState)(props.prefs);
16492
+ const [placementSaving, setPlacementSaving] = (0, import_react4.useState)(false);
16493
+ const [placementError, setPlacementError] = (0, import_react4.useState)(null);
16336
16494
  const timersRef = (0, import_react4.useRef)([]);
16337
16495
  const oauthStoppedRef = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
16338
16496
  const oauthStatusRef = (0, import_react4.useRef)(oauthStatus);
@@ -16343,6 +16501,96 @@ function McpSettingsSection(props) {
16343
16501
  (0, import_react4.useEffect)(() => () => {
16344
16502
  for (const id of timersRef.current) window.clearTimeout(id);
16345
16503
  }, []);
16504
+ (0, import_react4.useEffect)(() => {
16505
+ setPrefs(props.prefs);
16506
+ }, [props.prefs]);
16507
+ (0, import_react4.useEffect)(() => {
16508
+ let live = true;
16509
+ void props.prefsRead().then(
16510
+ (next) => {
16511
+ if (live) setPrefs(next);
16512
+ },
16513
+ () => {
16514
+ }
16515
+ );
16516
+ return () => {
16517
+ live = false;
16518
+ };
16519
+ }, []);
16520
+ const pickPlacement = (next) => {
16521
+ if (next === prefs.placement || placementSaving) return;
16522
+ const previous = prefs.placement;
16523
+ setPrefs((current) => ({ ...current, placement: next }));
16524
+ setPlacementError(null);
16525
+ setPlacementSaving(true);
16526
+ void props.setPlacement(next).then(
16527
+ (failure) => {
16528
+ setPlacementSaving(false);
16529
+ if (failure === null) {
16530
+ if (next === "sidebar" && props.surface === "settings") props.close?.();
16531
+ return;
16532
+ }
16533
+ setPrefs((current) => ({ ...current, placement: previous }));
16534
+ setPlacementError(`${failure.code}: ${failure.message}`);
16535
+ },
16536
+ (error51) => {
16537
+ setPlacementSaving(false);
16538
+ setPrefs((current) => ({ ...current, placement: previous }));
16539
+ setPlacementError(String((error51 instanceof Error ? error51.message : error51) ?? error51));
16540
+ }
16541
+ );
16542
+ };
16543
+ const applyPins = (names, pinned) => {
16544
+ const next = new Set(prefs.pins);
16545
+ for (const name of names) {
16546
+ if (pinned) next.add(name);
16547
+ else next.delete(name);
16548
+ }
16549
+ void props.setPinned([...next]).then(
16550
+ (result) => {
16551
+ if (result.ok) setPrefs(result.prefs);
16552
+ else setActionError(`${result.failure.code}: ${result.failure.message}`);
16553
+ },
16554
+ (error51) => setActionError(String((error51 instanceof Error ? error51.message : error51) ?? error51))
16555
+ );
16556
+ };
16557
+ const saveAliasInput = (server) => {
16558
+ const words = (aliasDraft[server] ?? "").split(/[,,\s]+/).map((word) => word.trim()).filter((word) => word.length > 0);
16559
+ setAliasBusy((prev) => new Set(prev).add(server));
16560
+ void saveAliases(server, words).then(
16561
+ (ok) => {
16562
+ setAliasBusy((prev) => {
16563
+ const next = new Set(prev);
16564
+ next.delete(server);
16565
+ return next;
16566
+ });
16567
+ if (ok) {
16568
+ setAliasDraft((prev) => {
16569
+ const next = { ...prev };
16570
+ delete next[server];
16571
+ return next;
16572
+ });
16573
+ }
16574
+ },
16575
+ () => setAliasBusy((prev) => {
16576
+ const next = new Set(prev);
16577
+ next.delete(server);
16578
+ return next;
16579
+ })
16580
+ );
16581
+ };
16582
+ const saveAliases = async (server, keywords) => {
16583
+ const next = { ...prefs.aliases };
16584
+ if (keywords.length === 0) delete next[server];
16585
+ else next[server] = [...keywords];
16586
+ const result = await props.setAliases(next);
16587
+ if (result.ok) {
16588
+ setPrefs(result.prefs);
16589
+ return true;
16590
+ }
16591
+ setActionError(`${result.failure.code}: ${result.failure.message}`);
16592
+ return false;
16593
+ };
16346
16594
  const refreshTools = () => {
16347
16595
  void props.toolsList().then(
16348
16596
  (next) => {
@@ -16413,14 +16661,48 @@ function McpSettingsSection(props) {
16413
16661
  refreshTools();
16414
16662
  });
16415
16663
  };
16416
- const toggleTool = (tool) => {
16417
- const next = !tool.enabled;
16418
- setTools((prev) => prev === null ? prev : { ...prev, tools: prev.tools.map((item) => item.name === tool.name ? { ...item, enabled: next } : item) });
16419
- void props.toolsSet({ name: tool.name, enabled: next }).catch((error51) => {
16664
+ const optimisticEnabled = (names, enabled) => {
16665
+ setTools((prev) => prev === null ? prev : { ...prev, tools: prev.tools.map((item) => names.has(item.name) ? { ...item, enabled } : item) });
16666
+ };
16667
+ const persistEnabled = (names, enabled) => {
16668
+ if (names.length === 0) return;
16669
+ void Promise.all(names.map((name) => props.toolsSet({ name, enabled }))).catch((error51) => {
16420
16670
  console.error("[dsh-mcp] toolsSet failed:", error51);
16421
16671
  refreshTools();
16422
16672
  });
16423
16673
  };
16674
+ const toggleTool = (tool) => {
16675
+ const next = !tool.enabled;
16676
+ optimisticEnabled(/* @__PURE__ */ new Set([tool.name]), next);
16677
+ persistEnabled([tool.name], next);
16678
+ };
16679
+ const paintRef = (0, import_react4.useRef)(null);
16680
+ (0, import_react4.useEffect)(() => {
16681
+ const stop = () => {
16682
+ const paint = paintRef.current;
16683
+ paintRef.current = null;
16684
+ if (paint !== null) persistEnabled([...paint.names], paint.target);
16685
+ };
16686
+ window.addEventListener("pointerup", stop);
16687
+ window.addEventListener("pointercancel", stop);
16688
+ return () => {
16689
+ window.removeEventListener("pointerup", stop);
16690
+ window.removeEventListener("pointercancel", stop);
16691
+ };
16692
+ });
16693
+ const paintStart = (tool, event) => {
16694
+ if (event.button !== 0) return;
16695
+ if (event.target.closest("button, input")) return;
16696
+ const target = !tool.enabled;
16697
+ paintRef.current = { target, names: /* @__PURE__ */ new Set([tool.name]) };
16698
+ optimisticEnabled(/* @__PURE__ */ new Set([tool.name]), target);
16699
+ };
16700
+ const paintOver = (tool) => {
16701
+ const paint = paintRef.current;
16702
+ if (paint === null || paint.names.has(tool.name)) return;
16703
+ paint.names.add(tool.name);
16704
+ optimisticEnabled(/* @__PURE__ */ new Set([tool.name]), paint.target);
16705
+ };
16424
16706
  const refreshServer = (serverName) => {
16425
16707
  setRefreshing((prev) => new Set(prev).add(serverName));
16426
16708
  void Promise.all([
@@ -16443,14 +16725,6 @@ function McpSettingsSection(props) {
16443
16725
  });
16444
16726
  });
16445
16727
  };
16446
- const toggleExpand = (serverName) => {
16447
- setExpanded((prev) => {
16448
- const next = new Set(prev);
16449
- if (next.has(serverName)) next.delete(serverName);
16450
- else next.add(serverName);
16451
- return next;
16452
- });
16453
- };
16454
16728
  const hostPendingOAuth = state.servers.filter((server) => server.oauth === true && server.status.oauthRequired === true && server.oauthAuthorized !== true && !oauthStoppedRef.current.has(server.serverName)).map((server) => server.serverName);
16455
16729
  const pollKey = [.../* @__PURE__ */ new Set([...oauthWaiting, ...hostPendingOAuth])].sort().join(",");
16456
16730
  (0, import_react4.useEffect)(() => {
@@ -16582,8 +16856,33 @@ function McpSettingsSection(props) {
16582
16856
  console.error("[dsh-mcp] setEnabled failed:", error51);
16583
16857
  }
16584
16858
  };
16585
- const serverTools = (serverName) => (tools?.tools ?? []).filter((tool) => tool.server === serverName);
16586
16859
  const mode = tools?.mode ?? "search";
16860
+ const serverTools = (serverName) => {
16861
+ const needle = toolQuery.trim().toLowerCase();
16862
+ return (tools?.tools ?? []).filter((tool) => {
16863
+ if (tool.server !== serverName) return false;
16864
+ if (onlyPinned && !pinnedSet.has(tool.name)) return false;
16865
+ if (needle.length === 0) return true;
16866
+ const aliases = (prefs.aliases[serverName] ?? []).join(" ").toLowerCase();
16867
+ return `${tool.name} ${tool.description} ${aliases}`.toLowerCase().includes(needle);
16868
+ });
16869
+ };
16870
+ const allToolsOf = (serverName) => (tools?.tools ?? []).filter((tool) => tool.server === serverName).map((tool) => tool.name);
16871
+ const allPinned = (serverName) => {
16872
+ const names = allToolsOf(serverName);
16873
+ return names.length > 0 && names.every((name) => pinnedSet.has(name));
16874
+ };
16875
+ const filtering = toolQuery.trim().length > 0 || onlyPinned;
16876
+ const duplicates = findDuplicates(tools?.tools ?? []);
16877
+ const pinnedSet = new Set(prefs.pins);
16878
+ const toggleExpand = (serverName) => {
16879
+ setExpanded((prev) => {
16880
+ const next = new Set(prev);
16881
+ if (next.has(serverName)) next.delete(serverName);
16882
+ else next.add(serverName);
16883
+ return next;
16884
+ });
16885
+ };
16587
16886
  if (state.loadState === "loading") {
16588
16887
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.status, "aria-busy": "true", children: t("loading") });
16589
16888
  }
@@ -16628,6 +16927,27 @@ function McpSettingsSection(props) {
16628
16927
  inlineForm = form;
16629
16928
  }
16630
16929
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.section, children: [
16930
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.placementRow, children: [
16931
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.placementLabel, children: t("placementLabel") }),
16932
+ MCP_PLACEMENTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.modeOption, children: [
16933
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
16934
+ "input",
16935
+ {
16936
+ type: "radio",
16937
+ name: "mcp-placement",
16938
+ checked: prefs.placement === option,
16939
+ disabled: placementSaving,
16940
+ onChange: () => pickPlacement(option)
16941
+ }
16942
+ ),
16943
+ t(PLACEMENT_LABEL_KEY[option])
16944
+ ] }, option))
16945
+ ] }),
16946
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.modeHint, children: placementSaving ? t("placementSaving") : t("placementHint") }),
16947
+ placementError !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.failure, children: [
16948
+ t("placementFailed"),
16949
+ placementError
16950
+ ] }) : null,
16631
16951
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.modeRow, children: [
16632
16952
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.modeLabel, children: t("toolsModeLabel") }),
16633
16953
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.modeOption, children: [
@@ -16692,10 +17012,21 @@ function McpSettingsSection(props) {
16692
17012
  className: jsonOpen ? `${controls_default.button} ${McpSettingsSection_default.active}` : controls_default.button,
16693
17013
  "aria-expanded": jsonOpen,
16694
17014
  onClick: () => setJsonOpen((open) => !open),
16695
- children: t("serversJson")
17015
+ children: jsonOpen ? t("serversJsonBack") : t("serversJson")
16696
17016
  }
16697
17017
  ),
16698
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, onClick: beginCreate, children: t("addServer") })
17018
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17019
+ "button",
17020
+ {
17021
+ type: "button",
17022
+ className: `${controls_default.button} ${controls_default.primary}`,
17023
+ onClick: () => {
17024
+ setJsonOpen(false);
17025
+ beginCreate();
17026
+ },
17027
+ children: t("addServer")
17028
+ }
17029
+ )
16699
17030
  ] })
16700
17031
  ] }),
16701
17032
  actionError !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.warn, role: "alert", children: [
@@ -16723,114 +17054,303 @@ function McpSettingsSection(props) {
16723
17054
  }
16724
17055
  ) : null,
16725
17056
  state.draft !== null && state.draft.id === null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.inlineForm, children: inlineForm }) : null,
16726
- jsonOpen ? null : state.servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.status, children: t("empty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: McpSettingsSection_default.list, children: state.servers.flatMap((server) => {
16727
- const isExpanded = expanded.has(server.serverName);
16728
- const isRefreshing = refreshing.has(server.serverName);
16729
- const serverToolList = serverTools(server.serverName);
16730
- const declared = server.source === "cordis";
16731
- const oauthManaged = !declared && server.oauth === true;
16732
- const oauthAuthorized = server.oauthAuthorized === true;
16733
- const oauthNeedsAuth = oauthManaged && !oauthAuthorized;
16734
- const oauthUsable = server.status.phase === "live" && server.status.tools.length > 0;
16735
- const oauthBlocks = oauthNeedsAuth && !oauthUsable;
16736
- const oauthPending = oauthNeedsAuth && server.status.oauthRequired === true;
16737
- const oauthInFlight = oauthNeedsAuth && (oauthStarting.has(server.serverName) || oauthWaiting.has(server.serverName));
16738
- const oauthLinkError = oauthNeedsAuth && typeof server.status.error === "string" && server.status.error.includes("response_type=code");
16739
- const oauthLink = oauthLinks.get(server.serverName);
16740
- const oauthError = oauthErrors.get(server.serverName);
16741
- const oauthIncompleteHere = oauthIncomplete.has(server.serverName);
16742
- const card = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { className: McpSettingsSection_default.card, children: [
16743
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.row, children: [
16744
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMain, children: [
16745
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowTitle, children: [
16746
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.serverName, children: server.serverName }),
16747
- declared ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("sourceCordis") }) : null,
16748
- server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("pendingBadge") }) : server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("conflictBadge") }) : oauthPending ? (
16749
- /* A flow is waiting for the user: the pending state,
16750
- never a pre-authorization failure. */
16751
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.oauth}`, children: t("oauthBadgeWaiting") })
16752
- ) : oauthBlocks ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.oauthMiss}`, children: t("oauthBadgeUnauthorized") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default[server.status.phase]}`, children: t(phaseKey(server.status.phase)) }),
16753
- !server.enabled && server.status.phase !== "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.muted, children: t("statusStopped") }) : null
16754
- ] }),
16755
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMeta, children: [
16756
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: server.transport }),
16757
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
16758
- t("toolCount"),
16759
- ": ",
16760
- server.status.tools.length
16761
- ] }),
16762
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
16763
- t("envVars"),
16764
- ": ",
16765
- server.env.length
16766
- ] })
16767
- ] }),
16768
- server.declaredIn ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.path, title: server.declaredIn, children: [
16769
- t("declaredIn"),
16770
- ": ",
16771
- server.declaredIn
16772
- ] }) : null,
16773
- server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("conflictDeclared") }) : null,
16774
- server.needsPlugin ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("needsPluginHint") }) : null,
16775
- oauthInFlight || oauthPending && oauthLink !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.note, children: [
16776
- t("oauthInProgress"),
16777
- oauthLink !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
16778
- " \xB7 ",
16779
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: oauthLink, target: "_blank", rel: "noreferrer", children: t("oauthOpenManual") })
16780
- ] }) : null
16781
- ] }) : oauthError !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.warn, children: [
16782
- t("oauthFailed"),
16783
- ": ",
16784
- oauthError
16785
- ] }) : oauthIncompleteHere ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthNotCompleted") }) : oauthPending || oauthBlocks ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthRequiredHint") }) : oauthLinkError && !oauthUsable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthRequiredHint") }) : server.status.error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: server.status.error }) : null,
16786
- declared ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("readOnlyHint") }) : null,
16787
- server.stale ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("staleMirror") }) : null,
16788
- server.skipReason === "js-expression" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("skipJsExpr") }) : null,
16789
- server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("pendingTakeover") }) : null,
16790
- declared && server.oauthHint ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("oauthHint") }) : null
16791
- ] }),
16792
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowActions, children: [
16793
- 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") }),
16794
- oauthNeedsAuth && !server.conflict && !server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17057
+ jsonOpen ? null : state.servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.status, children: t("empty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
17058
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.listControls, children: [
17059
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17060
+ "input",
17061
+ {
17062
+ className: McpSettingsSection_default.toolSearch,
17063
+ type: "search",
17064
+ value: toolQuery,
17065
+ placeholder: t("listSearch"),
17066
+ onChange: (event) => setToolQuery(event.target.value)
17067
+ }
17068
+ ),
17069
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.pinToggle, children: [
17070
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17071
+ "input",
17072
+ {
17073
+ type: "checkbox",
17074
+ checked: onlyPinned,
17075
+ onChange: (event) => setOnlyPinned(event.target.checked)
17076
+ }
17077
+ ),
17078
+ t("onlyPinned"),
17079
+ " ",
17080
+ prefs.pins.length > 0 ? `(${prefs.pins.length})` : ""
17081
+ ] })
17082
+ ] }),
17083
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.modeHint, children: t("pinExplainer") }),
17084
+ prefs.pins.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.pinnedBlock, children: [
17085
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.pinnedHeader, children: [
17086
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.pinnedTitle, children: fillTemplate(t("pinnedTitle"), { count: prefs.pins.length }) }),
17087
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17088
+ "button",
17089
+ {
17090
+ type: "button",
17091
+ className: controls_default.button,
17092
+ onClick: () => applyPins(prefs.pins, false),
17093
+ children: t("pinnedClearAll")
17094
+ }
17095
+ )
17096
+ ] }),
17097
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.pinnedGroups, children: groupPins(prefs.pins).map(([server, names]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.pinnedGroup, children: [
17098
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.pinnedServer, children: server }),
17099
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.pinnedChips, children: names.map((name) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: McpSettingsSection_default.pinnedChip, children: [
17100
+ tailOf(name),
17101
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
16795
17102
  "button",
16796
17103
  {
16797
17104
  type: "button",
16798
- className: oauthBlocks ? `${controls_default.button} ${McpSettingsSection_default.dangerButton}` : controls_default.button,
16799
- onClick: () => void runOAuth(server),
16800
- children: oauthInFlight ? t("oauthInProgress") : t("oauthAuthorize")
17105
+ className: `${controls_default.button} ${McpSettingsSection_default.pinnedRemove}`,
17106
+ title: t("pinTooltipUnpin"),
17107
+ "aria-label": t("pinTooltipUnpin"),
17108
+ onClick: () => applyPins([name], false),
17109
+ children: "\u2715"
16801
17110
  }
16802
- ) : null,
16803
- 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") }),
16804
- 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,
16805
- 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,
16806
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => toggleExpand(server.serverName), children: isExpanded ? t("toolsCollapse") : t("toolsExpand") }),
16807
- declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => beginEdit(server), children: t("edit") })
16808
- ] })
16809
- ] }),
16810
- 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: [
17111
+ )
17112
+ ] }, name)) }),
16811
17113
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
16812
- "input",
17114
+ "button",
16813
17115
  {
16814
- type: "checkbox",
16815
- checked: tool.enabled,
16816
- onChange: () => toggleTool(tool)
17116
+ type: "button",
17117
+ className: `${controls_default.button} ${McpSettingsSection_default.pinnedGroupClear}`,
17118
+ title: t("pinnedGroupClearHint"),
17119
+ onClick: () => applyPins(names, false),
17120
+ children: t("pinnedGroupClear")
16817
17121
  }
16818
- ),
16819
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.toolName, children: rawOf(tool.name) })
16820
- ] }, tool.name)) }) }) : null
16821
- ] }, server.id);
16822
- if (state.draft !== null && state.draft.id === server.id) {
16823
- return [card, /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { className: McpSettingsSection_default.inlineFormItem, children: inlineForm }, `${server.id}-form`)];
16824
- }
16825
- return [card];
16826
- }) })
17122
+ )
17123
+ ] }, server)) })
17124
+ ] }) : null,
17125
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: McpSettingsSection_default.list, children: state.servers.flatMap((server) => {
17126
+ const isRefreshing = refreshing.has(server.serverName);
17127
+ const serverToolList = serverTools(server.serverName);
17128
+ if (filtering && serverToolList.length === 0) return [];
17129
+ const isExpanded = expanded.has(server.serverName) || filtering;
17130
+ const duplicate = duplicates.get(server.serverName);
17131
+ const declared = server.source === "cordis";
17132
+ const oauthManaged = !declared && server.oauth === true;
17133
+ const oauthAuthorized = server.oauthAuthorized === true;
17134
+ const oauthNeedsAuth = oauthManaged && !oauthAuthorized;
17135
+ const oauthUsable = server.status.phase === "live" && server.status.tools.length > 0;
17136
+ const oauthBlocks = oauthNeedsAuth && !oauthUsable;
17137
+ const oauthPending = oauthNeedsAuth && server.status.oauthRequired === true;
17138
+ const oauthInFlight = oauthNeedsAuth && (oauthStarting.has(server.serverName) || oauthWaiting.has(server.serverName));
17139
+ const oauthLinkError = oauthNeedsAuth && typeof server.status.error === "string" && server.status.error.includes("response_type=code");
17140
+ const oauthLink = oauthLinks.get(server.serverName);
17141
+ const oauthError = oauthErrors.get(server.serverName);
17142
+ const oauthIncompleteHere = oauthIncomplete.has(server.serverName);
17143
+ const card = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { className: McpSettingsSection_default.card, children: [
17144
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.row, children: [
17145
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMain, children: [
17146
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowTitle, children: [
17147
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.serverName, children: server.serverName }),
17148
+ declared ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("sourceCordis") }) : null,
17149
+ server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("pendingBadge") }) : server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("conflictBadge") }) : oauthPending ? (
17150
+ /* A flow is waiting for the user: the pending state,
17151
+ never a pre-authorization failure. */
17152
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.oauth}`, children: t("oauthBadgeWaiting") })
17153
+ ) : oauthBlocks ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.oauthMiss}`, children: t("oauthBadgeUnauthorized") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default[server.status.phase]}`, children: t(phaseKey(server.status.phase)) }),
17154
+ !server.enabled && server.status.phase !== "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.muted, children: t("statusStopped") }) : null
17155
+ ] }),
17156
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMeta, children: [
17157
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: server.transport }),
17158
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
17159
+ t("toolCount"),
17160
+ ": ",
17161
+ server.status.tools.length
17162
+ ] }),
17163
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
17164
+ t("envVars"),
17165
+ ": ",
17166
+ server.env.length
17167
+ ] }),
17168
+ duplicate === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.duplicateHint, children: fillTemplate(t("duplicateBadge"), { server: duplicate.server, count: duplicate.count }) })
17169
+ ] }),
17170
+ server.declaredIn ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.path, title: server.declaredIn, children: [
17171
+ t("declaredIn"),
17172
+ ": ",
17173
+ server.declaredIn
17174
+ ] }) : null,
17175
+ server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("conflictDeclared") }) : null,
17176
+ server.needsPlugin ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("needsPluginHint") }) : null,
17177
+ oauthInFlight || oauthPending && oauthLink !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.note, children: [
17178
+ t("oauthInProgress"),
17179
+ oauthLink !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
17180
+ " \xB7 ",
17181
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: oauthLink, target: "_blank", rel: "noreferrer", children: t("oauthOpenManual") })
17182
+ ] }) : null
17183
+ ] }) : oauthError !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.warn, children: [
17184
+ t("oauthFailed"),
17185
+ ": ",
17186
+ oauthError
17187
+ ] }) : oauthIncompleteHere ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthNotCompleted") }) : oauthPending || oauthBlocks ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthRequiredHint") }) : oauthLinkError && !oauthUsable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthRequiredHint") }) : server.status.error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: server.status.error }) : null,
17188
+ declared ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("readOnlyHint") }) : null,
17189
+ server.stale ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("staleMirror") }) : null,
17190
+ server.skipReason === "js-expression" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("skipJsExpr") }) : null,
17191
+ server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("pendingTakeover") }) : null,
17192
+ declared && server.oauthHint ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("oauthHint") }) : null
17193
+ ] }),
17194
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowActions, children: [
17195
+ declared || server.conflict || server.pendingTakeover ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17196
+ "button",
17197
+ {
17198
+ type: "button",
17199
+ className: server.enabled ? `${controls_default.button} ${McpSettingsSection_default.dangerButton}` : controls_default.button,
17200
+ disabled: isRefreshing,
17201
+ onClick: () => void toggleEnabled(server),
17202
+ children: server.enabled ? t("disable") : t("enabled")
17203
+ }
17204
+ ),
17205
+ oauthNeedsAuth && !server.conflict && !server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17206
+ "button",
17207
+ {
17208
+ type: "button",
17209
+ className: oauthBlocks ? `${controls_default.button} ${McpSettingsSection_default.dangerButton}` : controls_default.button,
17210
+ onClick: () => void runOAuth(server),
17211
+ children: oauthInFlight ? t("oauthInProgress") : t("oauthAuthorize")
17212
+ }
17213
+ ) : null,
17214
+ 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") }),
17215
+ 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,
17216
+ 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,
17217
+ filtering ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => toggleExpand(server.serverName), children: isExpanded ? t("toolsCollapse") : t("toolsExpand") }),
17218
+ declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => beginEdit(server), children: t("edit") })
17219
+ ] })
17220
+ ] }),
17221
+ isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.toolPanel, children: [
17222
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.aliasRow, children: [
17223
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.aliasLabel, children: t("aliasLabel") }),
17224
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17225
+ "input",
17226
+ {
17227
+ className: McpSettingsSection_default.aliasInput,
17228
+ value: aliasDraft[server.serverName] ?? (prefs.aliases[server.serverName] ?? []).join(","),
17229
+ placeholder: t("aliasPlaceholder"),
17230
+ title: t("aliasHint"),
17231
+ onChange: (event) => setAliasDraft((prev) => ({ ...prev, [server.serverName]: event.target.value })),
17232
+ onBlur: () => {
17233
+ if (aliasDraft[server.serverName] !== void 0) saveAliasInput(server.serverName);
17234
+ },
17235
+ onKeyDown: (event) => {
17236
+ if (event.key === "Enter") saveAliasInput(server.serverName);
17237
+ }
17238
+ }
17239
+ ),
17240
+ aliasBusy.has(server.serverName) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.aliasStatus, children: t("aliasSaving") }) : null,
17241
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17242
+ "button",
17243
+ {
17244
+ type: "button",
17245
+ className: `${controls_default.button} ${McpSettingsSection_default.pinAll}`,
17246
+ onClick: () => applyPins(allToolsOf(server.serverName), !allPinned(server.serverName)),
17247
+ title: t("pinAllHint"),
17248
+ children: allPinned(server.serverName) ? t("pinAllOff") : fillTemplate(t("pinAllOn"), { count: allToolsOf(server.serverName).length })
17249
+ }
17250
+ )
17251
+ ] }),
17252
+ 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: filtering ? t("toolsEmptyFiltered") : t("toolsEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: McpSettingsSection_default.toolList, children: serverToolList.map((tool) => {
17253
+ const isPinned = pinnedSet.has(tool.name);
17254
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
17255
+ "li",
17256
+ {
17257
+ className: tool.enabled ? McpSettingsSection_default.toolRow : `${McpSettingsSection_default.toolRow} ${McpSettingsSection_default.toolRowOff}`,
17258
+ onPointerDown: (event) => paintStart(tool, event),
17259
+ onPointerEnter: () => paintOver(tool),
17260
+ children: [
17261
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17262
+ "input",
17263
+ {
17264
+ type: "checkbox",
17265
+ checked: tool.enabled,
17266
+ title: t("toolEnableHint"),
17267
+ "aria-label": `${tool.name} ${t("toolEnableHint")}`,
17268
+ onChange: () => toggleTool(tool)
17269
+ }
17270
+ ),
17271
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.toolName, title: tool.name, children: tailOf(tool.name) }),
17272
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: McpSettingsSection_default.helpWrap, children: [
17273
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17274
+ "button",
17275
+ {
17276
+ type: "button",
17277
+ className: `${controls_default.button} ${McpSettingsSection_default.helpButton}`,
17278
+ "aria-label": t("descHelp"),
17279
+ children: "?"
17280
+ }
17281
+ ),
17282
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.helpTip, role: "tooltip", children: tool.description })
17283
+ ] }),
17284
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
17285
+ "button",
17286
+ {
17287
+ type: "button",
17288
+ className: isPinned ? `${controls_default.button} ${McpSettingsSection_default.pinOn}` : `${controls_default.button} ${McpSettingsSection_default.pinOff}`,
17289
+ "aria-pressed": isPinned,
17290
+ onClick: () => applyPins([tool.name], !isPinned),
17291
+ children: isPinned ? t("pinActionOn") : t("pinActionOff")
17292
+ }
17293
+ )
17294
+ ]
17295
+ },
17296
+ tool.name
17297
+ );
17298
+ }) })
17299
+ ] }) : null
17300
+ ] }, server.id);
17301
+ if (state.draft !== null && state.draft.id === server.id) {
17302
+ return [/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { className: McpSettingsSection_default.inlineFormItem, children: inlineForm }, `${server.id}-form`)];
17303
+ }
17304
+ return [card];
17305
+ }) })
17306
+ ] })
16827
17307
  ] })
16828
17308
  ] });
16829
17309
  }
16830
17310
 
17311
+ // src/client/McpPage.module.css
17312
+ (function() {
17313
+ if (typeof document !== "undefined") {
17314
+ const existing = document.querySelector('style[data-plugin="dsh-mcp"][data-file="McpPage.module.css"]');
17315
+ if (!existing) {
17316
+ const style = document.createElement("style");
17317
+ style.setAttribute("data-plugin", "dsh-mcp");
17318
+ style.setAttribute("data-file", "McpPage.module.css");
17319
+ style.textContent = "/* Page shell for the left-sidebar seat. Every rule is class-scoped: the sheet\n is injected into the host page globally (see scripts/build.mjs). */\n\n.McpPage__page {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n overflow-y: auto;\n}\n\n.McpPage__inner {\n display: flex;\n flex-direction: column;\n gap: 18px;\n width: 100%;\n max-width: 820px;\n margin: 0 auto;\n padding: 28px 32px 48px;\n}\n\n.McpPage__header {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.McpPage__title {\n margin: 0;\n font-size: 20px;\n line-height: 28px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n\n.McpPage__subtitle {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n";
17320
+ document.head.appendChild(style);
17321
+ }
17322
+ }
17323
+ })();
17324
+ var McpPage_default = { "page": "McpPage__page", "inner": "McpPage__inner", "header": "McpPage__header", "title": "McpPage__title", "subtitle": "McpPage__subtitle" };
17325
+
17326
+ // src/client/McpPage.tsx
17327
+ var import_jsx_runtime5 = require("react/jsx-runtime");
17328
+ function McpPage(props) {
17329
+ const t = props.t;
17330
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: McpPage_default.page, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: McpPage_default.inner, children: [
17331
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: McpPage_default.header, children: [
17332
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: McpPage_default.title, children: t("pageTitle") }),
17333
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: McpPage_default.subtitle, children: t("pageSubtitle") })
17334
+ ] }),
17335
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(McpSettingsSection, { ...props })
17336
+ ] }) });
17337
+ }
17338
+
17339
+ // src/client/McpIcon.tsx
17340
+ var import_jsx_runtime6 = require("react/jsx-runtime");
17341
+ function McpIcon(props) {
17342
+ const size = props.size ?? 16;
17343
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: [
17344
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M5.5 1.5v3M10.5 1.5v3", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" }),
17345
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3.2", y: "4.5", width: "9.6", height: "5.2", rx: "1.6", stroke: "currentColor", strokeWidth: "1.2" }),
17346
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 9.7v2.1a2 2 0 0 0 2 2h1.4", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })
17347
+ ] });
17348
+ }
17349
+
16831
17350
  // src/client/locales.ts
16832
17351
  var zh = {
16833
17352
  nav: "MCP",
17353
+ optionsTitle: "\u9009\u9879",
16834
17354
  loading: "\u6B63\u5728\u8BFB\u53D6 MCP \u670D\u52A1\u5668\u2026",
16835
17355
  loadError: "\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6 MCP \u670D\u52A1\u5668\u3002",
16836
17356
  loadErrorHostMissing: "\u5BBF\u4E3B\u7AEF\u672A\u63D0\u4F9B mcpManager \u670D\u52A1\uFF08HTTP 404\uFF09\u3002\u901A\u5E38\u662F\u63D2\u4EF6 host \u534A\u672A\u6CE8\u518C\u6216 client/host \u7248\u672C\u4E0D\u5339\u914D\uFF1A\u8BF7\u786E\u8BA4 cordis.patch.yml \u5DF2\u6CE8\u518C dsh-mcp \u884C\u3001\u91CD\u542F dsh web \u5E76\u786C\u5237\u65B0\uFF08Cmd/Ctrl+Shift+R\uFF09\uFF1B\u82E5\u5347\u7EA7\u8FC7\u63D2\u4EF6\u8BF7\u540C\u6B65\u5347\u7EA7\u5BBF\u4E3B\u3002",
@@ -16839,6 +17359,7 @@ var zh = {
16839
17359
  addServer: "\u6DFB\u52A0\u670D\u52A1\u5668",
16840
17360
  serverName: "\u670D\u52A1\u5668\u540D\u79F0\uFF08serverName\uFF09",
16841
17361
  serverNameHint: "\u5DE5\u5177\u5C06\u4EE5 mcp__<serverName>__<tool> \u547D\u540D\uFF1B1-32 \u4F4D\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u6216\u8FDE\u5B57\u7B26",
17362
+ serverNamePlaceholder: "\u4F8B\u5982 feishu-mcp",
16842
17363
  transport: "\u4F20\u8F93\u65B9\u5F0F",
16843
17364
  transportStdio: "stdio\uFF08\u672C\u5730\u5B50\u8FDB\u7A0B\uFF09",
16844
17365
  transportHttp: "streamable-http\uFF08\u8FDC\u7A0B\u670D\u52A1\uFF09",
@@ -16936,11 +17457,12 @@ var zh = {
16936
17457
  toolsHintFull: "\u5168\u91CF\u6A21\u5F0F\uFF1A\u4E0B\u65B9\u5F00\u5173\u63A7\u5236\u6BCF\u4E2A MCP \u5DE5\u5177\u662F\u5426\u6CE8\u5165\u6A21\u578B\u8BF7\u6C42\u3002",
16937
17458
  toolsLoading: "\u6B63\u5728\u8BFB\u53D6\u5DE5\u5177\u5217\u8868\u2026",
16938
17459
  toolsEmpty: "\uFF08\u6682\u65E0 MCP \u5DE5\u5177\uFF09",
16939
- refresh: "\u5237\u65B0",
16940
- refreshing: "\u5237\u65B0\u4E2D\u2026",
16941
17460
  toolsExpand: "\u5C55\u5F00\u5DE5\u5177",
16942
17461
  toolsCollapse: "\u6536\u8D77\u5DE5\u5177",
17462
+ refresh: "\u5237\u65B0",
17463
+ refreshing: "\u5237\u65B0\u4E2D\u2026",
16943
17464
  serversJson: "JSON \u7EF4\u62A4\u914D\u7F6E",
17465
+ serversJsonBack: "\u8FD4\u56DE\u5217\u8868",
16944
17466
  serversJsonLabel: "\u670D\u52A1\u5668\u914D\u7F6E JSON",
16945
17467
  serversJsonHint: "\u6574\u4E2A MCP \u670D\u52A1\u5668\u914D\u7F6E\uFF08key-value \u5BF9\u8C61\uFF0C\u670D\u52A1\u5668\u540D \u2192 \u914D\u7F6E\uFF09\uFF1A\u5E94\u7528\u540E\u5C06\u6309\u6B64\u66FF\u6362\u2014\u2014\u5DF2\u5217\u51FA\u7684\u670D\u52A1\u5668\u521B\u5EFA/\u66F4\u65B0\uFF0C\u672A\u5217\u51FA\u7684\u5C06\u88AB\u5220\u9664\uFF1Btype \u4E3A streamable_http \u6216 stdio\uFF0Cdisabled \u4E3A true \u8868\u793A\u505C\u7528\uFF1Bsecret \u73AF\u5883\u53D8\u91CF\u503C\u4E0D\u4F1A\u5BFC\u51FA\uFF08configured \u6807\u8BB0\uFF09\uFF0C\u7559\u7A7A\u5219\u4FDD\u7559\u539F\u503C\u3002",
16946
17468
  serversJsonReseed: "\u91CD\u65B0\u5BFC\u51FA",
@@ -16964,10 +17486,49 @@ var zh = {
16964
17486
  globalEnvLoadFailed: "\u8BFB\u53D6\u73AF\u5883\u53D8\u91CF\u5931\u8D25",
16965
17487
  globalEnvRetry: "\u91CD\u8BD5",
16966
17488
  globalEnvDone: "\u5DF2\u4FDD\u5B58",
16967
- configTitle: "MCP \u914D\u7F6E"
17489
+ configTitle: "MCP \u914D\u7F6E",
17490
+ panel: "MCP",
17491
+ pageTitle: "MCP \u670D\u52A1\u5668",
17492
+ pageSubtitle: "\u914D\u7F6E\u3001\u542F\u505C MCP \u670D\u52A1\u5668\uFF0C\u7BA1\u7406\u8FDB\u7A0B\u7EA7\u73AF\u5883\u53D8\u91CF\u3001\u5DE5\u5177\u7EA7\u5F00\u5173\u4E0E\u6CE8\u5165\u6A21\u5F0F\u3002",
17493
+ placementLabel: "\u663E\u793A\u4F4D\u7F6E",
17494
+ placementSidebar: "\u5DE6\u4FA7\u680F",
17495
+ placementSettings: "\u8BBE\u7F6E\u9875",
17496
+ placementBoth: "\u4E24\u8005\u90FD\u663E\u793A",
17497
+ placementHint: "\u5207\u6362\u7ACB\u5373\u751F\u6548\uFF1A\u5DE6\u4FA7\u680F\u5165\u53E3\u4E0E\u8BBE\u7F6E\u9875\u5165\u53E3\u4F1A\u6309\u9009\u62E9\u589E\u5220\uFF0C\u670D\u52A1\u5668\u914D\u7F6E\u4E0D\u53D7\u5F71\u54CD\u3002",
17498
+ placementSaving: "\u6B63\u5728\u4FDD\u5B58\u663E\u793A\u4F4D\u7F6E\u2026",
17499
+ placementFailed: "\u65E0\u6CD5\u4FDD\u5B58\u663E\u793A\u4F4D\u7F6E\uFF1A",
17500
+ listSearch: "\u641C\u7D22\u670D\u52A1\u5668 / \u5DE5\u5177\uFF08\u540D\u79F0\u3001\u63CF\u8FF0\u3001\u522B\u540D\uFF09",
17501
+ onlyPinned: "\u53EA\u770B\u5DF2\u56FA\u5B9A",
17502
+ pinnedTitle: "\u5DF2\u56FA\u5B9A\u5DE5\u5177\uFF08{count}\uFF09",
17503
+ pinnedClearAll: "\u5168\u90E8\u53D6\u6D88",
17504
+ pinnedGroupClear: "\u53D6\u6D88\u56FA\u5B9A",
17505
+ pinnedGroupClearHint: "\u53D6\u6D88\u8FD9\u53F0\u670D\u52A1\u5668\u7684\u5168\u90E8\u56FA\u5B9A\uFF08\u5176\u4ED6\u670D\u52A1\u5668\u4E0D\u53D7\u5F71\u54CD\uFF09",
17506
+ pinAllOn: "\u5168\u90E8\u56FA\u5B9A\uFF08{count}\uFF09",
17507
+ pinAllOff: "\u53D6\u6D88\u5168\u90E8\u56FA\u5B9A",
17508
+ pinAllHint: "\u628A\u8FD9\u53F0\u670D\u52A1\u5668\u7684\u5DE5\u5177\u4E00\u6B21\u6027\u56FA\u5B9A / \u53D6\u6D88\uFF08\u56FA\u5B9A = \u5E38\u9A7B\u53EF\u89C1\uFF0Csearch \u6A21\u5F0F\u4E0B\u4E5F\u4E0D\u7528\u68C0\u7D22\uFF09",
17509
+ aliasHint: "\u68C0\u7D22\u522B\u540D\uFF1A\u586B\u4E2D\u6587\u4E60\u60EF\u8BCD\uFF08\u5982 \u63D0\u4EA4\u3001MR\u3001\u8BC4\u5BA1\uFF09\uFF0Cmcp_tool_search \u4E5F\u80FD\u547D\u4E2D\u8FD9\u53F0\u670D\u52A1\u5668\u7684\u5DE5\u5177\u3002\u56DE\u8F66\u6216\u79FB\u5F00\u8F93\u5165\u6846\u5373\u4FDD\u5B58",
17510
+ pinBadge: "\u5E38\u9A7B",
17511
+ pinActionOff: "\u56FA\u5B9A",
17512
+ pinActionOn: "\u5DF2\u56FA\u5B9A",
17513
+ pinServerOn: "\u56FA\u5B9A\u6574\u53F0",
17514
+ pinServerOff: "\u53D6\u6D88\u6574\u53F0\u56FA\u5B9A",
17515
+ pinServerCount: "\u5171 {count} \u4E2A\u5DE5\u5177",
17516
+ descHelp: "\u67E5\u770B\u5B8C\u6574\u63CF\u8FF0",
17517
+ pinRemove: "\u53D6\u6D88",
17518
+ pinExplainer: "\u300C\u56FA\u5B9A\u300D= \u5E38\u9A7B\u53EF\u89C1\uFF1A\u5373\u4F7F\u6CE8\u5165\u6A21\u5F0F\u662F search\uFF0C\u8FD9\u4E9B\u5DE5\u5177\u4E5F\u59CB\u7EC8\u51FA\u73B0\u5728\u6A21\u578B\u53EF\u7528\u7684\u5DE5\u5177\u91CC\uFF0C\u4E0D\u5FC5\u518D\u68C0\u7D22\u3002\u70B9\u5DE5\u5177\u884C\u672B\u5C3E\u7684\u300C\u56FA\u5B9A\u300D/\u300C\u5DF2\u56FA\u5B9A\u300D\u5207\u6362\uFF1B\u56FA\u5B9A\u540E\u4F1A\u51FA\u73B0\u5728\u4E0B\u65B9\u7684\u300C\u5DF2\u56FA\u5B9A\u5DE5\u5177\u300D\u91CC\u3002",
17519
+ pinTooltipPin: "\u56FA\u5B9A\uFF1Asearch \u6A21\u5F0F\u4E0B\u4E5F\u5E38\u9A7B\u53EF\u89C1\uFF0C\u4E0D\u7528\u518D\u68C0\u7D22",
17520
+ pinTooltipUnpin: "\u53D6\u6D88\u56FA\u5B9A",
17521
+ toolEnableHint: "\u53D6\u6D88\u52FE\u9009 = \u8BE5\u5DE5\u5177\u4E0D\u6CE8\u5165\u6A21\u578B\uFF1B\u76F4\u63A5\u70B9\u540D\u79F0\u4E5F\u80FD\u5207\u6362\uFF0C\u6309\u4F4F\u62D6\u8FC7\u591A\u4E2A\u5DE5\u5177\u53EF\u6279\u91CF\u5207\u6362",
17522
+ toolsEmptyFiltered: "\u6CA1\u6709\u5339\u914D\u7684\u5DE5\u5177\u3002",
17523
+ duplicateBadge: "\u4E0E {server} \u91CD\u590D {count} \u4E2A",
17524
+ aliasLabel: "\u68C0\u7D22\u522B\u540D",
17525
+ aliasPlaceholder: "\u9017\u53F7\u5206\u9694\uFF0C\u5982 \u63D0\u4EA4,MR,\u8BC4\u5BA1",
17526
+ aliasSave: "\u4FDD\u5B58",
17527
+ aliasSaving: "\u4FDD\u5B58\u4E2D\u2026"
16968
17528
  };
16969
17529
  var en = {
16970
17530
  nav: "MCP",
17531
+ optionsTitle: "Options",
16971
17532
  loading: "Reading MCP servers\u2026",
16972
17533
  loadError: "MCP servers are temporarily unavailable.",
16973
17534
  loadErrorHostMissing: "The host does not expose the mcpManager service (HTTP 404). Usually the plugin host half is not registered or the client/host versions mismatch: confirm the cordis.patch.yml dsh-mcp row, restart dsh web, and hard-refresh (Cmd/Ctrl+Shift+R); after upgrading the plugin, upgrade the host to match.",
@@ -16976,6 +17537,7 @@ var en = {
16976
17537
  addServer: "Add server",
16977
17538
  serverName: "Server name (serverName)",
16978
17539
  serverNameHint: "Tools appear as mcp__<serverName>__<tool>; 1-32 letters, digits, underscores, or hyphens",
17540
+ serverNamePlaceholder: "e.g. feishu-mcp",
16979
17541
  transport: "Transport",
16980
17542
  transportStdio: "stdio (local child process)",
16981
17543
  transportHttp: "streamable-http (remote service)",
@@ -17073,11 +17635,12 @@ var en = {
17073
17635
  toolsHintFull: "Full mode: the switches below control which MCP tools are injected each request.",
17074
17636
  toolsLoading: "Reading tool list\u2026",
17075
17637
  toolsEmpty: "(no MCP tools)",
17076
- refresh: "Refresh",
17077
- refreshing: "Refreshing\u2026",
17078
17638
  toolsExpand: "Expand tools",
17079
17639
  toolsCollapse: "Collapse tools",
17640
+ refresh: "Refresh",
17641
+ refreshing: "Refreshing\u2026",
17080
17642
  serversJson: "JSON config editor",
17643
+ serversJsonBack: "Back to list",
17081
17644
  serversJsonLabel: "Server-config JSON",
17082
17645
  serversJsonHint: "The whole MCP server config as a key-value object (server name \u2192 config): applying replaces the list \u2014 listed servers are created/updated, servers absent from the document are removed; type is streamable_http or stdio, disabled: true disables the server; secret env values are never exported (a configured flag marks them), a blank value keeps the stored one.",
17083
17646
  serversJsonReseed: "Re-export",
@@ -17101,10 +17664,51 @@ var en = {
17101
17664
  globalEnvLoadFailed: "Failed to read environment variables",
17102
17665
  globalEnvRetry: "Retry",
17103
17666
  globalEnvDone: "Saved",
17104
- configTitle: "MCP config"
17667
+ configTitle: "MCP config",
17668
+ panel: "MCP",
17669
+ pageTitle: "MCP servers",
17670
+ pageSubtitle: "Configure and toggle MCP servers, process-level env vars, per-tool switches, and the injection mode.",
17671
+ placementLabel: "Show in",
17672
+ placementSidebar: "Left sidebar",
17673
+ placementSettings: "Settings",
17674
+ placementBoth: "Both",
17675
+ placementHint: "Applies immediately: the sidebar entry and the Settings page entry are added or removed; server configuration is untouched.",
17676
+ placementSaving: "Saving display location\u2026",
17677
+ placementFailed: "Could not save the display location: ",
17678
+ listSearch: "Search servers / tools (name, description, alias)",
17679
+ onlyPinned: "Pinned only",
17680
+ pinnedTitle: "Pinned tools ({count})",
17681
+ pinnedClearAll: "Unpin all",
17682
+ pinnedGroupClear: "Unpin all",
17683
+ pinnedGroupClearHint: "Unpin every tool of this server (other servers are untouched)",
17684
+ pinAllOn: "Pin all ({count})",
17685
+ pinAllOff: "Unpin all",
17686
+ pinAllHint: "Pin or unpin every tool of this server at once (pinned = always visible, no lookup in search mode)",
17687
+ aliasHint: "Search aliases: add your own words (e.g. submit, review) so mcp_tool_search also finds this server's tools. Saves on Enter or blur",
17688
+ pinBadge: "resident",
17689
+ pinActionOff: "Pin",
17690
+ pinActionOn: "Pinned",
17691
+ pinServerOn: "Pin all",
17692
+ pinServerOff: "Unpin all",
17693
+ pinServerCount: "{count} tools",
17694
+ descHelp: "Show full description",
17695
+ pinRemove: "Unpin",
17696
+ pinExplainer: `Pinning means "always visible": those tools stay in the model's tool set even in search mode, so no lookup is needed. Click "Pin" / "Pinned" at the end of a tool row; pinned tools also appear under "Pinned tools" below.`,
17697
+ pinTooltipPin: "Pin: stays visible even in search mode, no lookup needed",
17698
+ pinTooltipUnpin: "Unpin",
17699
+ toolEnableHint: "Unchecked = this tool is not injected into the model. Clicking the name toggles it too, and dragging across rows flips them in bulk",
17700
+ toolsEmptyFiltered: "No matching tools.",
17701
+ duplicateBadge: "shares {count} tools with {server}",
17702
+ aliasLabel: "Search aliases",
17703
+ aliasPlaceholder: "comma separated, e.g. submit,review,merge",
17704
+ aliasSave: "Save",
17705
+ aliasSaving: "Saving\u2026"
17105
17706
  };
17106
17707
 
17107
17708
  // src/client/index.ts
17709
+ var PANEL_ID = "mcp";
17710
+ var SETTINGS_ORDER = 25;
17711
+ var RAIL_ORDER = 20;
17108
17712
  var NS = "settings.mcp";
17109
17713
  var inject = ["slots", "locale", "remote"];
17110
17714
  async function unwrap(run) {
@@ -17115,6 +17719,19 @@ async function unwrap(run) {
17115
17719
  function failureOf(error51) {
17116
17720
  return { code: error51.code, message: error51.message };
17117
17721
  }
17722
+ async function withTimeout(promise2, ms) {
17723
+ let timer;
17724
+ try {
17725
+ return await Promise.race([
17726
+ promise2,
17727
+ new Promise((_resolve, reject) => {
17728
+ timer = setTimeout(() => reject(new Error(`timed out after ${ms}ms`)), ms);
17729
+ })
17730
+ ]);
17731
+ } finally {
17732
+ if (timer !== void 0) clearTimeout(timer);
17733
+ }
17734
+ }
17118
17735
  async function apply(ctx) {
17119
17736
  await ctx.remote.$mount(remote_contribution_default);
17120
17737
  ctx.effect(() => ctx.locale.register(NS, { zh, en }), "ui-settings-mcp: dictionaries");
@@ -17123,7 +17740,38 @@ async function apply(ctx) {
17123
17740
  if (manager === void 0) {
17124
17741
  throw new Error("dsh-mcp: remote.mcpManager namespace is not mounted after $mount");
17125
17742
  }
17126
- const injected = () => ({
17743
+ let prefs = { placement: "sidebar", pins: [], aliases: {} };
17744
+ const layout = () => ctx.get("layout");
17745
+ const activeMainPanel = () => layout()?.panelInfo?.getSnapshot().activePanelId ?? null;
17746
+ const patchPrefs = async (patch) => {
17747
+ let outcome;
17748
+ try {
17749
+ outcome = await unwrap(() => manager.uiPrefsPatch(patch));
17750
+ } catch (error51) {
17751
+ return {
17752
+ ok: false,
17753
+ failure: { code: "MCP_PREFS_UNAVAILABLE", message: String((error51 instanceof Error ? error51.message : error51) ?? error51) }
17754
+ };
17755
+ }
17756
+ if (!outcome.ok) return { ok: false, failure: failureOf(outcome.error) };
17757
+ const next = {
17758
+ placement: isMcpPlacement(outcome.placement) ? outcome.placement : prefs.placement,
17759
+ pins: [...outcome.pins ?? []],
17760
+ aliases: { ...outcome.aliases ?? {} }
17761
+ };
17762
+ const moved = next.placement !== prefs.placement;
17763
+ prefs = next;
17764
+ if (moved) sync();
17765
+ return { ok: true, prefs };
17766
+ };
17767
+ const setPlacement = async (next) => {
17768
+ if (!isMcpPlacement(next)) {
17769
+ return { code: "MCP_INVALID_SPEC", message: `unknown display location '${String(next)}'` };
17770
+ }
17771
+ const result = await patchPrefs({ placement: next });
17772
+ return result.ok ? null : result.failure;
17773
+ };
17774
+ const injected = (surface) => ({
17127
17775
  list: async () => {
17128
17776
  const result = await unwrap(() => manager.list());
17129
17777
  return result.servers;
@@ -17207,16 +17855,85 @@ async function apply(ctx) {
17207
17855
  ...result.expiresAt === void 0 ? {} : { expiresAt: result.expiresAt },
17208
17856
  ...result.error === void 0 ? {} : { error: result.error }
17209
17857
  };
17210
- }
17858
+ },
17859
+ prefs,
17860
+ setPlacement,
17861
+ setPinned: async (pins) => patchPrefs({ pins }),
17862
+ setAliases: async (aliases) => patchPrefs({ aliases }),
17863
+ prefsRead: async () => {
17864
+ const stored = await withTimeout(unwrap(() => manager.uiPrefs()), 3e3);
17865
+ prefs = {
17866
+ placement: isMcpPlacement(stored.placement) ? stored.placement : prefs.placement,
17867
+ pins: [...stored.pins ?? []],
17868
+ aliases: { ...stored.aliases ?? {} }
17869
+ };
17870
+ return prefs;
17871
+ },
17872
+ surface
17211
17873
  });
17212
- ctx.slots.inject("settings.section", () => ctx.slots.register({
17213
- name: "settings.section",
17214
- id: "mcp",
17215
- order: 25,
17216
- label: () => t("nav"),
17874
+ const stops = [];
17875
+ const stopMain = ctx.slots.inject("main", () => ctx.slots.register({
17876
+ name: "main",
17877
+ key: PANEL_ID,
17217
17878
  locale: NS,
17218
17879
  store: createMcpManagerStore,
17219
- inject: injected
17220
- }, McpSettingsSection));
17880
+ inject: () => injected("panel")
17881
+ }, McpPage));
17882
+ stops.push(stopMain);
17883
+ let stopSettings = null;
17884
+ let stopSidebar = null;
17885
+ let disposed = false;
17886
+ const sync = () => {
17887
+ if (disposed) return;
17888
+ const wantSettings = prefs.placement !== "sidebar";
17889
+ const wantSidebar = prefs.placement !== "settings";
17890
+ if (wantSettings && stopSettings === null) {
17891
+ stopSettings = ctx.slots.inject("settings.section", () => ctx.slots.register({
17892
+ name: "settings.section",
17893
+ id: "mcp",
17894
+ order: SETTINGS_ORDER,
17895
+ label: () => t("nav"),
17896
+ locale: NS,
17897
+ store: createMcpManagerStore,
17898
+ inject: () => injected("settings")
17899
+ }, McpSettingsSection));
17900
+ stops.push(stopSettings);
17901
+ } else if (!wantSettings && stopSettings !== null) {
17902
+ stopSettings();
17903
+ stopSettings = null;
17904
+ }
17905
+ if (wantSidebar && stopSidebar === null) {
17906
+ stopSidebar = ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
17907
+ name: "sidebar.panellist",
17908
+ id: PANEL_ID,
17909
+ order: RAIL_ORDER,
17910
+ label: () => t("panel"),
17911
+ locale: NS
17912
+ }, McpIcon));
17913
+ stops.push(stopSidebar);
17914
+ } else if (!wantSidebar && stopSidebar !== null) {
17915
+ stopSidebar();
17916
+ stopSidebar = null;
17917
+ if (activeMainPanel() === PANEL_ID) layout()?.selectPanel?.(null);
17918
+ }
17919
+ };
17920
+ try {
17921
+ const stored = await withTimeout(unwrap(() => manager.uiPrefs()), 3e3);
17922
+ prefs = {
17923
+ placement: isMcpPlacement(stored.placement) ? stored.placement : "sidebar",
17924
+ pins: [...stored.pins ?? []],
17925
+ aliases: { ...stored.aliases ?? {} }
17926
+ };
17927
+ } catch (error51) {
17928
+ console.warn("[dsh-mcp] could not read UI prefs; defaulting to the left sidebar:", error51);
17929
+ }
17930
+ sync();
17931
+ ctx.effect(() => () => {
17932
+ disposed = true;
17933
+ for (const stop of stops) stop();
17934
+ stops.length = 0;
17935
+ stopSettings = null;
17936
+ stopSidebar = null;
17937
+ }, "ui-settings-mcp: slot registrations");
17221
17938
  }
17222
17939
  return module.exports; } });