@auggieteo/dsh-mcp-adapter 0.1.0 → 0.1.2

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
@@ -501,9 +501,9 @@ function SecretEditor({ field, rows, onChange, disabled }) {
501
501
  {
502
502
  className: "mcp-input",
503
503
  "aria-label": `${label} value ${index + 1}`,
504
- type: "password",
504
+ type: field === "env" ? "password" : "text",
505
505
  autoComplete: "off",
506
- placeholder: row.originalKey === void 0 ? "Secret value" : "Saved value",
506
+ placeholder: row.originalKey === void 0 ? "Value" : "Saved value",
507
507
  value: row.value,
508
508
  disabled,
509
509
  onChange: (event) => update(index, { value: event.target.value })
@@ -526,6 +526,15 @@ function SecretEditor({ field, rows, onChange, disabled }) {
526
526
  ] }) })
527
527
  ] });
528
528
  }
529
+ function useEscapeClose(onClose) {
530
+ (0, import_react.useEffect)(() => {
531
+ const onKey = (event) => {
532
+ if (event.key === "Escape") onClose();
533
+ };
534
+ window.addEventListener("keydown", onKey);
535
+ return () => window.removeEventListener("keydown", onKey);
536
+ }, [onClose]);
537
+ }
529
538
  function AddServerDialog({ controller, busy, onClose }) {
530
539
  const [name, setName] = (0, import_react.useState)("");
531
540
  const [transport, setTransport] = (0, import_react.useState)("stdio");
@@ -533,6 +542,7 @@ function AddServerDialog({ controller, busy, onClose }) {
533
542
  const [url, setUrl] = (0, import_react.useState)("");
534
543
  const [argsText, setArgsText] = (0, import_react.useState)("[]");
535
544
  const [error, setError] = (0, import_react.useState)();
545
+ useEscapeClose(onClose);
536
546
  const submit = async (event) => {
537
547
  event.preventDefault();
538
548
  setError(void 0);
@@ -611,6 +621,7 @@ function AddServerDialog({ controller, busy, onClose }) {
611
621
  className: "mcp-textarea",
612
622
  value: argsText,
613
623
  disabled: busy,
624
+ placeholder: '["-y", "@modelcontextprotocol/server-github"]',
614
625
  onChange: (event) => setArgsText(event.target.value),
615
626
  spellCheck: false
616
627
  }
@@ -638,6 +649,7 @@ function AddServerDialog({ controller, busy, onClose }) {
638
649
  function ImportDialog({ controller, busy, onClose }) {
639
650
  const [text, setText] = (0, import_react.useState)('{\n "mcpServers": {\n \n }\n}');
640
651
  const [error, setError] = (0, import_react.useState)();
652
+ useEscapeClose(onClose);
641
653
  const submit = async (event) => {
642
654
  event.preventDefault();
643
655
  setError(void 0);
@@ -774,7 +786,7 @@ function ServerDetail({ controller, snapshot, name, server }) {
774
786
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mcp-row", children: [
775
787
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `mcp-status-dot ${statusClass(status.state)}` }),
776
788
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "mcp-card-title", children: name }),
777
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mcp-badge", children: status.state })
789
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `mcp-badge ${statusClass(status.state)}`, children: status.state })
778
790
  ] }),
779
791
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "mcp-muted", children: [
780
792
  status.toolCount,
@@ -1044,7 +1056,7 @@ function McpSettingsPage({ controller }) {
1044
1056
  {
1045
1057
  type: "button",
1046
1058
  className: "mcp-button mcp-button-primary",
1047
- disabled: !settings.writable,
1059
+ disabled: snapshot.busy || !settings.writable,
1048
1060
  onClick: () => setDialog("add"),
1049
1061
  children: "Add Server"
1050
1062
  }
@@ -1054,7 +1066,7 @@ function McpSettingsPage({ controller }) {
1054
1066
  {
1055
1067
  type: "button",
1056
1068
  className: "mcp-button",
1057
- disabled: !settings.writable,
1069
+ disabled: snapshot.busy || !settings.writable,
1058
1070
  onClick: () => setDialog("import"),
1059
1071
  children: "Import JSON"
1060
1072
  }
@@ -1097,63 +1109,82 @@ function McpSettingsPage({ controller }) {
1097
1109
 
1098
1110
  // src/client/styles.js
1099
1111
  var MCP_SETTINGS_CSS = `
1100
- .mcp-settings{max-width:980px;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:16px}
1112
+ .mcp-settings{width:100%;max-width:980px;min-width:0;container-type:inline-size;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:14px}
1101
1113
  .mcp-settings *{box-sizing:border-box}
1102
- .mcp-title{margin:0;font-size:18px;line-height:26px;font-weight:600}
1103
- .mcp-intro,.mcp-muted{margin:0;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}
1114
+ .mcp-title{margin:0;font-size:16px;line-height:24px;font-weight:600}
1115
+ .mcp-intro,.mcp-muted{margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}
1104
1116
  .mcp-toolbar,.mcp-actions,.mcp-row,.mcp-card-head{display:flex;align-items:center;gap:8px}
1105
1117
  .mcp-toolbar{justify-content:space-between;flex-wrap:wrap}
1106
1118
  .mcp-actions{flex-wrap:wrap}
1107
- .mcp-button{height:34px;border:1px solid var(--dsw-alias-border-l2);border-radius:17px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);padding:0 13px;font:inherit;font-size:13px;cursor:pointer}
1119
+ .mcp-button{height:32px;border:1px solid var(--dsw-alias-border-l2);border-radius:16px;background:transparent;color:var(--dsw-alias-label-primary);padding:0 13px;font:inherit;font-size:12px;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}
1108
1120
  .mcp-button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
1121
+ .mcp-button:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
1109
1122
  .mcp-button:disabled{cursor:not-allowed;opacity:.5}
1110
1123
  .mcp-button-primary{border-color:transparent;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}
1111
- .mcp-button-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-fill)}
1124
+ .mcp-button-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}
1112
1125
  .mcp-button-danger{color:var(--dsw-alias-state-error-primary)}
1126
+ .mcp-button-danger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}
1127
+ .mcp-button:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}
1113
1128
  .mcp-error,.mcp-warning{border-radius:8px;padding:9px 11px;font-size:12px;line-height:18px}
1114
1129
  .mcp-error{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);color:var(--dsw-alias-state-error-primary)}
1115
1130
  .mcp-warning{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-label)}
1116
- .mcp-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:12px;align-items:start}
1117
- .mcp-sidebar,.mcp-card,.mcp-empty,.mcp-modal-card{border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-base)}
1118
- .mcp-sidebar{padding:6px;display:flex;flex-direction:column;gap:3px}
1119
- .mcp-server-button{width:100%;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-primary);padding:9px 10px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;text-align:left;cursor:pointer;font:inherit}
1120
- .mcp-server-button:hover{background:var(--dsw-alias-interactive-bg-hover)}
1121
- .mcp-server-button[aria-current=true]{background:var(--dsw-alias-button-ghost-active-fill)}
1131
+ .mcp-layout{display:grid;grid-template-columns:208px minmax(0,1fr);gap:14px;align-items:start;min-width:0}
1132
+ .mcp-card,.mcp-empty{border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}
1133
+ .mcp-sidebar{display:flex;flex-direction:column;gap:2px;position:sticky;top:12px}
1134
+ .mcp-server-button{width:100%;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);padding:8px 10px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;text-align:left;cursor:pointer;font:inherit;transition:background .12s ease,color .12s ease}
1135
+ .mcp-server-button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
1136
+ .mcp-server-button[aria-current=true]{background:var(--dsw-alias-button-ghost-active-fill);color:var(--dsw-alias-label-primary)}
1122
1137
  .mcp-server-name{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:13px;font-weight:500}
1123
1138
  .mcp-server-count{color:var(--dsw-alias-label-tertiary);font-size:11px}
1124
- .mcp-status-dot{width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-label-quaternary)}
1139
+ .mcp-status-dot{width:7px;height:7px;border-radius:50%;background:var(--dsw-alias-label-dimmed);flex:none}
1125
1140
  .mcp-status-connected{background:var(--dsw-alias-state-success-primary)}
1126
1141
  .mcp-status-connecting{background:var(--dsw-alias-state-warn-primary)}
1142
+ .mcp-status-dot.mcp-status-connecting{animation:mcp-pulse 1.2s ease-in-out infinite}
1143
+ @keyframes mcp-pulse{0%,100%{opacity:1}50%{opacity:.35}}
1127
1144
  .mcp-status-error{background:var(--dsw-alias-state-error-primary)}
1128
- .mcp-status-disabled{background:var(--dsw-alias-label-quaternary)}
1129
- .mcp-card{padding:16px;display:flex;flex-direction:column;gap:16px;min-width:0}
1130
- .mcp-card-head{align-items:flex-start}
1131
- .mcp-card-title{margin:0;font-size:16px;line-height:24px;font-weight:600;overflow-wrap:anywhere}
1132
- .mcp-card-head .mcp-actions{margin-left:auto;justify-content:flex-end}
1133
- .mcp-badge{border:1px solid var(--dsw-alias-border-l3);border-radius:5px;padding:2px 7px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}
1134
- .mcp-form{display:flex;flex-direction:column;gap:13px}
1145
+ .mcp-status-disabled{background:var(--dsw-alias-label-dimmed)}
1146
+ .mcp-card{padding:16px;display:flex;flex-direction:column;gap:14px;min-width:0}
1147
+ .mcp-card-head{align-items:flex-start;flex-wrap:wrap}
1148
+ .mcp-card-head > div:first-child{flex:1 1 200px;min-width:0}
1149
+ .mcp-card-title{margin:0;font-size:15px;line-height:22px;font-weight:600;overflow-wrap:anywhere}
1150
+ .mcp-card-head .mcp-actions{margin-left:auto;justify-content:flex-end;flex:none}
1151
+ .mcp-badge{border:1px solid var(--dsw-alias-border-l2);border-radius:5px;padding:1px 7px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px;background:transparent}
1152
+ .mcp-badge.mcp-status-connected{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 35%, transparent);background:transparent}
1153
+ .mcp-badge.mcp-status-connecting{color:var(--dsw-alias-state-warn-label);border-color:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 35%, transparent);background:transparent}
1154
+ .mcp-badge.mcp-status-error{color:var(--dsw-alias-state-error-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 35%, transparent);background:transparent}
1155
+ .mcp-badge.mcp-status-disabled{color:var(--dsw-alias-label-dimmed);background:transparent}
1156
+ .mcp-form{display:flex;flex-direction:column;gap:12px}
1135
1157
  .mcp-field{display:flex;flex-direction:column;gap:5px;min-width:0}
1136
- .mcp-field-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
1137
- .mcp-label{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}
1138
- .mcp-input,.mcp-select,.mcp-textarea{width:100%;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;outline:none}
1139
- .mcp-input,.mcp-select{height:36px;padding:0 10px}
1140
- .mcp-textarea{min-height:82px;padding:9px 10px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;line-height:19px}
1158
+ .mcp-field-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
1159
+ .mcp-label{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:500;line-height:18px}
1160
+ .mcp-input,.mcp-select,.mcp-textarea{width:100%;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;outline:none;transition:border-color .12s ease,background .12s ease}
1161
+ .mcp-input,.mcp-select{height:34px;padding:0 10px}
1162
+ .mcp-textarea{min-height:76px;padding:8px 10px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:18px}
1163
+ .mcp-input:hover:not(:focus):not(:disabled),.mcp-select:hover:not(:focus):not(:disabled),.mcp-textarea:hover:not(:focus):not(:disabled){border-color:var(--dsw-alias-border-l3)}
1141
1164
  .mcp-input:focus,.mcp-select:focus,.mcp-textarea:focus{border-color:var(--dsw-alias-state-business-primary)}
1165
+ .mcp-input:read-only{background:transparent;border-color:transparent;color:var(--dsw-alias-label-tertiary)}
1166
+ .mcp-input::placeholder,.mcp-textarea::placeholder{color:var(--dsw-alias-label-dimmed)}
1167
+ .mcp-settings input[type=checkbox],.mcp-settings input[type=number]{accent-color:var(--dsw-alias-state-business-primary)}
1142
1168
  .mcp-checkbox{display:flex;align-items:flex-start;gap:8px;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}
1143
1169
  .mcp-checkbox input{margin-top:3px}
1144
- .mcp-section{border-top:1px solid var(--dsw-alias-border-l3);padding-top:14px;display:flex;flex-direction:column;gap:10px}
1145
- .mcp-section-title{margin:0;font-size:13px;font-weight:600;line-height:20px}
1146
- .mcp-secret-row{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(140px,1.2fr) auto;gap:7px;align-items:center}
1147
- .mcp-promotion-list{display:flex;flex-direction:column;gap:6px;max-height:260px;overflow:auto}
1148
- .mcp-promotion{border:1px solid var(--dsw-alias-border-l3);border-radius:8px;padding:8px 10px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:start}
1149
- .mcp-promotion-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow-wrap:anywhere}
1170
+ .mcp-section{border-top:1px solid var(--dsw-alias-border-l1);padding-top:12px;display:flex;flex-direction:column;gap:9px}
1171
+ .mcp-section-title{margin:0;font-size:12px;font-weight:600;line-height:18px;color:var(--dsw-alias-label-secondary)}
1172
+ .mcp-secret-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) auto;gap:7px;align-items:center}
1173
+ .mcp-secret-row > *{min-width:0}
1174
+ .mcp-promotion-list{display:flex;flex-direction:column;gap:2px;max-height:240px;overflow:auto}
1175
+ .mcp-promotion{border-radius:8px;padding:8px 10px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:start;cursor:pointer;transition:background .12s ease}
1176
+ .mcp-promotion:hover{background:var(--dsw-alias-interactive-bg-hover)}
1177
+ .mcp-promotion-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}
1150
1178
  .mcp-promotion-description{display:block;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:17px}
1151
- .mcp-empty{padding:34px 20px;text-align:center;display:flex;align-items:center;flex-direction:column;gap:10px}
1152
- .mcp-overlay{position:fixed;inset:0;background:rgba(0,0,0,.28);display:flex;align-items:center;justify-content:center;padding:20px;z-index:1000}
1153
- .mcp-modal-card{width:min(620px,100%);max-height:min(760px,90vh);overflow:auto;padding:18px;display:flex;flex-direction:column;gap:14px;box-shadow:0 18px 60px rgba(0,0,0,.24)}
1154
- .mcp-modal-title{margin:0;font-size:16px;line-height:24px}
1155
- .mcp-confirm{border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px}
1156
- @media(max-width:760px){.mcp-layout{grid-template-columns:1fr}.mcp-sidebar{max-height:190px;overflow:auto}.mcp-field-row{grid-template-columns:1fr}.mcp-card-head{flex-direction:column}.mcp-card-head .mcp-actions{margin-left:0}.mcp-secret-row{grid-template-columns:1fr}.mcp-toolbar{align-items:flex-start}}
1179
+ .mcp-empty{padding:30px 20px;text-align:center;display:flex;align-items:center;flex-direction:column;gap:10px}
1180
+ .mcp-overlay{position:fixed;inset:0;background:var(--dsw-alias-bg-mask-1);display:flex;align-items:center;justify-content:center;padding:20px;z-index:1200;animation:mcp-fade .12s ease}
1181
+ .mcp-modal-card{width:min(560px,100%);max-height:min(760px,90vh);overflow:auto;padding:18px;display:flex;flex-direction:column;gap:13px;border:1px solid var(--dsw-alias-border-l1);border-radius:14px;background:var(--dsw-alias-bg-overlay);box-shadow:0 18px 60px rgba(0,0,0,.32);animation:mcp-pop .16s ease}
1182
+ @keyframes mcp-fade{from{opacity:0}to{opacity:1}}
1183
+ @keyframes mcp-pop{from{opacity:0;transform:translateY(6px) scale(.98)}to{opacity:1;transform:none}}
1184
+ .mcp-modal-title{margin:0;font-size:15px;line-height:22px;font-weight:600}
1185
+ .mcp-confirm{border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px;background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent)}
1186
+ @container (max-width:660px){.mcp-layout{grid-template-columns:minmax(0,1fr)}.mcp-sidebar{position:static;flex-direction:row;overflow-x:auto;padding-bottom:2px}.mcp-server-button{width:auto;flex:none;white-space:nowrap}}
1187
+ @container (max-width:480px){.mcp-field-row{grid-template-columns:minmax(0,1fr)}.mcp-secret-row{grid-template-columns:minmax(0,1fr) auto}.mcp-secret-row .mcp-input:first-child{grid-column:1 / -1}.mcp-card-head .mcp-actions{margin-left:0;width:100%}.mcp-toolbar{align-items:flex-start}}
1157
1188
  `;
1158
1189
  function installMcpSettingsStyles() {
1159
1190
  const id = "dsh-mcp-adapter-settings";
package/lib/client.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client/index.jsx", "../src/client/McpSettingsPage.jsx", "../src/client/settings-controller.js", "../src/client/styles.js"],
4
- "sourcesContent": ["import { McpSettingsPage } from './McpSettingsPage.jsx'\nimport {\n MCP_RPC_CHANNEL,\n MCP_SETTINGS_NAMESPACE,\n McpSettingsController,\n} from './settings-controller.js'\nimport { installMcpSettingsStyles } from './styles.js'\n\nexport const inject = ['slots', 'settingsScope', 'connection']\n\nexport function apply(ctx) {\n const scope = ctx.settingsScope.bind({ namespace: MCP_SETTINGS_NAMESPACE })\n const describe = ctx.settingsScope.describe()\n const controller = new McpSettingsController({\n scope,\n describe,\n settingsApi: ctx.connection.api.settings,\n rpc: (endpoint, payload, signal) =>\n ctx.connection.rpc.call(MCP_RPC_CHANNEL, endpoint, payload, signal),\n })\n\n ctx.effect(() => installMcpSettingsStyles(), 'mcp-adapter: Settings styles')\n ctx.effect(() => () => controller.dispose(), 'mcp-adapter: Settings controller')\n ctx.slots.inject('settings.section', () =>\n ctx.slots.register(\n {\n name: 'settings.section',\n id: 'mcp',\n order: 30,\n label: 'MCP',\n inject: () => ({ controller }),\n },\n McpSettingsPage,\n ),\n )\n}\n", "import React, { useEffect, useMemo, useState, useSyncExternalStore } from 'react'\n\nimport {\n normalizeServerConfig,\n parseArgs,\n parseMcpImport,\n secretKeysFromView,\n secretRowOps,\n} from './settings-controller.js'\n\nfunction statusFor(overview, name) {\n return overview.status.servers.find((entry) => entry.name === name) ?? {\n name,\n state: 'disconnected',\n toolCount: 0,\n }\n}\n\nfunction catalogFor(overview, name) {\n return overview.catalog.servers.find((entry) => entry.name === name)?.tools ?? []\n}\n\nfunction statusClass(state) {\n if (state === 'connected') return 'mcp-status-connected'\n if (state === 'connecting') return 'mcp-status-connecting'\n if (state === 'error') return 'mcp-status-error'\n if (state === 'disabled') return 'mcp-status-disabled'\n return ''\n}\n\nfunction secretRows(keys) {\n return keys.map((key) => ({ originalKey: key, key, value: '' }))\n}\n\nfunction SecretEditor({ field, rows, onChange, disabled }) {\n const label = field === 'env' ? 'Environment variables' : 'HTTP headers'\n const add = () => onChange([...rows, { key: '', value: '' }])\n const update = (index, patch) => {\n onChange(rows.map((row, position) => position === index ? { ...row, ...patch } : row))\n }\n const remove = (index) => onChange(rows.filter((_, position) => position !== index))\n\n return (\n <div className=\"mcp-section\">\n <div>\n <h4 className=\"mcp-section-title\">{label}</h4>\n <p className=\"mcp-muted\">\n Existing secret values stay saved when their value field remains blank.\n </p>\n </div>\n {rows.map((row, index) => (\n <div className=\"mcp-secret-row\" key={`${row.originalKey ?? 'new'}-${index}`}>\n <input\n className=\"mcp-input\"\n aria-label={`${label} key ${index + 1}`}\n placeholder={field === 'env' ? 'API_TOKEN' : 'Authorization'}\n value={row.key}\n disabled={disabled}\n onChange={(event) => update(index, { key: event.target.value })}\n />\n <input\n className=\"mcp-input\"\n aria-label={`${label} value ${index + 1}`}\n type=\"password\"\n autoComplete=\"off\"\n placeholder={row.originalKey === undefined ? 'Secret value' : 'Saved value'}\n value={row.value}\n disabled={disabled}\n onChange={(event) => update(index, { value: event.target.value })}\n />\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-danger\"\n disabled={disabled}\n onClick={() => remove(index)}\n >\n Remove\n </button>\n </div>\n ))}\n <div>\n <button type=\"button\" className=\"mcp-button\" disabled={disabled} onClick={add}>\n Add {field === 'env' ? 'variable' : 'header'}\n </button>\n </div>\n </div>\n )\n}\n\nfunction AddServerDialog({ controller, busy, onClose }) {\n const [name, setName] = useState('')\n const [transport, setTransport] = useState('stdio')\n const [command, setCommand] = useState('')\n const [url, setUrl] = useState('')\n const [argsText, setArgsText] = useState('[]')\n const [error, setError] = useState()\n\n const submit = async (event) => {\n event.preventDefault()\n setError(undefined)\n let config\n try {\n config = normalizeServerConfig(\n name,\n transport === 'stdio'\n ? { command, args: parseArgs(argsText) }\n : { url },\n )\n } catch (nextError) {\n setError(nextError instanceof Error ? nextError.message : String(nextError))\n return\n }\n if (await controller.addServer(name, config)) onClose()\n }\n\n return (\n <div className=\"mcp-overlay\" role=\"presentation\" onMouseDown={(event) => {\n if (event.target === event.currentTarget) onClose()\n }}>\n <form className=\"mcp-modal-card\" aria-label=\"Add MCP Server\" onSubmit={submit}>\n <div className=\"mcp-card-head\">\n <div>\n <h3 className=\"mcp-modal-title\">Add Server</h3>\n <p className=\"mcp-muted\">Configure one stdio command or one HTTP URL.</p>\n </div>\n <button type=\"button\" className=\"mcp-button\" onClick={onClose}>Close</button>\n </div>\n {error !== undefined && <div className=\"mcp-error\" role=\"alert\">{error}</div>}\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Name</span>\n <input\n autoFocus\n className=\"mcp-input\"\n value={name}\n disabled={busy}\n onChange={(event) => setName(event.target.value)}\n placeholder=\"github\"\n />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Transport</span>\n <select\n className=\"mcp-select\"\n value={transport}\n disabled={busy}\n onChange={(event) => setTransport(event.target.value)}\n >\n <option value=\"stdio\">stdio</option>\n <option value=\"http\">Streamable HTTP</option>\n </select>\n </label>\n {transport === 'stdio' ? (\n <>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Command</span>\n <input\n className=\"mcp-input\"\n value={command}\n disabled={busy}\n onChange={(event) => setCommand(event.target.value)}\n placeholder=\"npx\"\n />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Args as a JSON array</span>\n <textarea\n className=\"mcp-textarea\"\n value={argsText}\n disabled={busy}\n onChange={(event) => setArgsText(event.target.value)}\n spellCheck={false}\n />\n </label>\n </>\n ) : (\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">URL</span>\n <input\n className=\"mcp-input\"\n value={url}\n disabled={busy}\n onChange={(event) => setUrl(event.target.value)}\n placeholder=\"https://example.com/mcp\"\n />\n </label>\n )}\n <div className=\"mcp-actions\">\n <button type=\"submit\" className=\"mcp-button mcp-button-primary\" disabled={busy}>\n {busy ? 'Adding\u2026' : 'Add Server'}\n </button>\n <button type=\"button\" className=\"mcp-button\" disabled={busy} onClick={onClose}>\n Cancel\n </button>\n </div>\n </form>\n </div>\n )\n}\n\nfunction ImportDialog({ controller, busy, onClose }) {\n const [text, setText] = useState('{\\n \"mcpServers\": {\\n \\n }\\n}')\n const [error, setError] = useState()\n const submit = async (event) => {\n event.preventDefault()\n setError(undefined)\n try {\n parseMcpImport(text)\n } catch (nextError) {\n setError(nextError instanceof Error ? nextError.message : String(nextError))\n return\n }\n const result = await controller.importJson(text)\n if (result) onClose()\n else setError('The Host rejected this import. Review the page error and retry.')\n }\n\n return (\n <div className=\"mcp-overlay\" role=\"presentation\" onMouseDown={(event) => {\n if (event.target === event.currentTarget) onClose()\n }}>\n <form className=\"mcp-modal-card\" aria-label=\"Import MCP Servers\" onSubmit={submit}>\n <div className=\"mcp-card-head\">\n <div>\n <h3 className=\"mcp-modal-title\">Import JSON</h3>\n <p className=\"mcp-muted\">Paste a standard object with an mcpServers property.</p>\n </div>\n <button type=\"button\" className=\"mcp-button\" onClick={onClose}>Close</button>\n </div>\n {error !== undefined && <div className=\"mcp-error\" role=\"alert\">{error}</div>}\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">MCP Config JSON</span>\n <textarea\n autoFocus\n className=\"mcp-textarea\"\n style={{ minHeight: 280 }}\n value={text}\n disabled={busy}\n spellCheck={false}\n onChange={(event) => setText(event.target.value)}\n />\n </label>\n <div className=\"mcp-actions\">\n <button type=\"submit\" className=\"mcp-button mcp-button-primary\" disabled={busy}>\n {busy ? 'Importing\u2026' : 'Import Servers'}\n </button>\n <button type=\"button\" className=\"mcp-button\" disabled={busy} onClick={onClose}>\n Cancel\n </button>\n </div>\n </form>\n </div>\n )\n}\n\nfunction ServerDetail({ controller, snapshot, name, server }) {\n const status = statusFor(snapshot.overview, name)\n const tools = catalogFor(snapshot.overview, name)\n const transport = typeof server.command === 'string' ? 'stdio' : 'http'\n const [draft, setDraft] = useState(() => ({\n transport,\n command: server.command ?? '',\n url: server.url ?? '',\n argsText: JSON.stringify(server.args ?? [], null, 2),\n disabled: server.disabled === true,\n autoAllow: server.autoAllow === true,\n idleTimeoutMinutes: String(server.idleTimeoutMinutes ?? 10),\n }))\n const [rowSets, setRowSets] = useState(() => ({\n env: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'env')),\n headers: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'headers')),\n }))\n const activeSecretField = draft.transport === 'stdio' ? 'env' : 'headers'\n const rows = rowSets[activeSecretField]\n const [dirty, setDirty] = useState(false)\n const [formError, setFormError] = useState()\n const [confirmDelete, setConfirmDelete] = useState(false)\n\n useEffect(() => {\n if (dirty) return\n const nextTransport = typeof server.command === 'string' ? 'stdio' : 'http'\n setDraft({\n transport: nextTransport,\n command: server.command ?? '',\n url: server.url ?? '',\n argsText: JSON.stringify(server.args ?? [], null, 2),\n disabled: server.disabled === true,\n autoAllow: server.autoAllow === true,\n idleTimeoutMinutes: String(server.idleTimeoutMinutes ?? 10),\n })\n setRowSets({\n env: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'env')),\n headers: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'headers')),\n })\n }, [dirty, name, server, snapshot.settingsDocument.view])\n\n const changeDraft = (patch) => {\n setDirty(true)\n setDraft((current) => ({ ...current, ...patch }))\n }\n const changeRows = (next) => {\n setDirty(true)\n setRowSets((current) => ({ ...current, [activeSecretField]: next }))\n }\n const save = async (event) => {\n event.preventDefault()\n setFormError(undefined)\n try {\n const nextTransport = draft.transport\n normalizeServerConfig(name, {\n ...(nextTransport === 'stdio'\n ? { command: draft.command, args: parseArgs(draft.argsText) }\n : { url: draft.url }),\n disabled: draft.disabled,\n autoAllow: draft.autoAllow,\n idleTimeoutMinutes: Number(draft.idleTimeoutMinutes),\n promotedTools: server.promotedTools,\n })\n const field = nextTransport === 'stdio' ? 'env' : 'headers'\n secretRowOps(\n name,\n field,\n rows,\n secretKeysFromView(snapshot.settingsDocument.view, name, field),\n )\n } catch (nextError) {\n setFormError(nextError instanceof Error ? nextError.message : String(nextError))\n return\n }\n if (await controller.saveServer(name, draft, rows)) {\n setRowSets((current) => ({\n ...current,\n [activeSecretField]: rows.map((row) => ({\n originalKey: row.key.trim(),\n key: row.key.trim(),\n value: '',\n })),\n }))\n setDirty(false)\n }\n }\n const remove = async () => {\n if (await controller.deleteServer(name)) setConfirmDelete(false)\n }\n\n return (\n <div className=\"mcp-card\">\n <div className=\"mcp-card-head\">\n <div>\n <div className=\"mcp-row\">\n <span className={`mcp-status-dot ${statusClass(status.state)}`} />\n <h2 className=\"mcp-card-title\">{name}</h2>\n <span className=\"mcp-badge\">{status.state}</span>\n </div>\n <p className=\"mcp-muted\">\n {status.toolCount} {status.toolCount === 1 ? 'tool' : 'tools'} cached\n {status.transport === undefined ? '' : ` \u00B7 ${status.transport}`}\n </p>\n </div>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button\"\n disabled={snapshot.busy || draft.disabled}\n onClick={() => void controller.reconnect(name)}\n >\n Reconnect\n </button>\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-danger\"\n disabled={snapshot.busy}\n onClick={() => setConfirmDelete(true)}\n >\n Delete\n </button>\n </div>\n </div>\n\n {status.message !== undefined && status.state === 'error' && (\n <div className=\"mcp-error\" role=\"alert\">{status.message}</div>\n )}\n {confirmDelete && (\n <div className=\"mcp-confirm\">\n <strong>Delete {name}?</strong>\n <span className=\"mcp-muted\">This removes its Config and disconnects the Server.</span>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-danger\"\n disabled={snapshot.busy}\n onClick={() => void remove()}\n >\n Confirm delete\n </button>\n <button type=\"button\" className=\"mcp-button\" onClick={() => setConfirmDelete(false)}>\n Cancel\n </button>\n </div>\n </div>\n )}\n\n <form className=\"mcp-form\" onSubmit={save}>\n {formError !== undefined && <div className=\"mcp-error\" role=\"alert\">{formError}</div>}\n <div className=\"mcp-field-row\">\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Name</span>\n <input className=\"mcp-input\" value={name} readOnly />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Transport</span>\n <select\n className=\"mcp-select\"\n value={draft.transport}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ transport: event.target.value })}\n >\n <option value=\"stdio\">stdio</option>\n <option value=\"http\">Streamable HTTP</option>\n </select>\n </label>\n </div>\n\n {draft.transport === 'stdio' ? (\n <>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Command</span>\n <input\n className=\"mcp-input\"\n value={draft.command}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ command: event.target.value })}\n />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Args as a JSON array</span>\n <textarea\n className=\"mcp-textarea\"\n value={draft.argsText}\n disabled={snapshot.busy}\n spellCheck={false}\n onChange={(event) => changeDraft({ argsText: event.target.value })}\n />\n </label>\n <SecretEditor field=\"env\" rows={rows} onChange={changeRows} disabled={snapshot.busy} />\n </>\n ) : (\n <>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">URL</span>\n <input\n className=\"mcp-input\"\n value={draft.url}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ url: event.target.value })}\n />\n </label>\n <SecretEditor field=\"headers\" rows={rows} onChange={changeRows} disabled={snapshot.busy} />\n </>\n )}\n\n <div className=\"mcp-field-row\">\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Idle timeout in minutes</span>\n <input\n className=\"mcp-input\"\n type=\"number\"\n min=\"0.1\"\n step=\"0.1\"\n value={draft.idleTimeoutMinutes}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ idleTimeoutMinutes: event.target.value })}\n />\n </label>\n <div className=\"mcp-field\">\n <span className=\"mcp-label\">Call policy</span>\n <label className=\"mcp-checkbox\">\n <input\n type=\"checkbox\"\n checked={draft.autoAllow}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ autoAllow: event.target.checked })}\n />\n Auto-allow calls from this Server\n </label>\n </div>\n </div>\n <label className=\"mcp-checkbox\">\n <input\n type=\"checkbox\"\n checked={draft.disabled}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ disabled: event.target.checked })}\n />\n Disable this Server\n </label>\n <div className=\"mcp-actions\">\n <button\n type=\"submit\"\n className=\"mcp-button mcp-button-primary\"\n disabled={snapshot.busy || !dirty}\n >\n {snapshot.busy ? 'Saving\u2026' : 'Save Server'}\n </button>\n {dirty && <span className=\"mcp-muted\">Unsaved changes</span>}\n </div>\n </form>\n\n <div className=\"mcp-section\">\n <div>\n <h3 className=\"mcp-section-title\">Promotions</h3>\n <p className=\"mcp-muted\">\n Promote selected MCP tools as native tools named {name}__tool.\n </p>\n </div>\n {tools.length === 0 ? (\n <div className=\"mcp-warning\">\n No cached tools are available. Reconnect to discover this Server.\n </div>\n ) : (\n <div className=\"mcp-promotion-list\">\n {tools.map((tool) => {\n const checked = (server.promotedTools ?? []).includes(tool.name)\n return (\n <label className=\"mcp-promotion\" key={tool.name}>\n <input\n type=\"checkbox\"\n checked={checked}\n disabled={snapshot.busy}\n onChange={() => void controller.togglePromotion(name, tool.name)}\n />\n <span>\n <span className=\"mcp-promotion-name\">{tool.name}</span>\n {tool.description !== undefined && (\n <span className=\"mcp-promotion-description\">{tool.description}</span>\n )}\n </span>\n </label>\n )\n })}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport function McpSettingsPage({ controller }) {\n const snapshot = useSyncExternalStore(controller.subscribe, controller.getSnapshot)\n const [selected, setSelected] = useState()\n const [dialog, setDialog] = useState()\n const settings = snapshot.settings\n const servers = settings.value?.mcpServers ?? {}\n const names = useMemo(() => Object.keys(servers).sort(), [servers])\n\n useEffect(() => controller.mount(), [controller])\n useEffect(() => {\n if (selected === undefined || !Object.hasOwn(servers, selected)) {\n setSelected(names[0])\n }\n }, [names, selected, servers])\n\n if (settings.status === 'loading') {\n return <section className=\"mcp-settings\"><p className=\"mcp-muted\">Loading MCP Settings\u2026</p></section>\n }\n if (settings.status !== 'ready') {\n return (\n <section className=\"mcp-settings\">\n <h1 className=\"mcp-title\">MCP</h1>\n <div className=\"mcp-error\" role=\"alert\">\n {settings.error?.message ?? 'MCP Settings are unavailable.'}\n </div>\n </section>\n )\n }\n\n return (\n <section className=\"mcp-settings\">\n <div className=\"mcp-toolbar\">\n <div>\n <h1 className=\"mcp-title\">MCP</h1>\n <p className=\"mcp-intro\">Connect MCP Servers and choose how their tools reach the Agent.</p>\n </div>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button\"\n disabled={snapshot.busy || !settings.writable}\n onClick={() => setDialog('import')}\n >\n Import JSON\n </button>\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-primary\"\n disabled={snapshot.busy || !settings.writable}\n onClick={() => setDialog('add')}\n >\n Add Server\n </button>\n </div>\n </div>\n\n {!settings.writable && (\n <div className=\"mcp-warning\">The active Settings Provider is read-only.</div>\n )}\n {snapshot.error !== undefined && (\n <div className=\"mcp-error\" role=\"alert\">{snapshot.error}</div>\n )}\n\n {names.length === 0 ? (\n <div className=\"mcp-empty\">\n <h2 className=\"mcp-card-title\">No MCP Servers</h2>\n <p className=\"mcp-muted\">Add a Server or import an existing mcpServers Config.</p>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-primary\"\n disabled={!settings.writable}\n onClick={() => setDialog('add')}\n >\n Add Server\n </button>\n <button\n type=\"button\"\n className=\"mcp-button\"\n disabled={!settings.writable}\n onClick={() => setDialog('import')}\n >\n Import JSON\n </button>\n </div>\n </div>\n ) : (\n <div className=\"mcp-layout\">\n <nav className=\"mcp-sidebar\" aria-label=\"MCP Servers\">\n {names.map((name) => {\n const status = statusFor(snapshot.overview, name)\n return (\n <button\n type=\"button\"\n className=\"mcp-server-button\"\n aria-current={name === selected}\n key={name}\n onClick={() => setSelected(name)}\n >\n <span className={`mcp-status-dot ${statusClass(status.state)}`} />\n <span className=\"mcp-server-name\">{name}</span>\n <span className=\"mcp-server-count\">{status.toolCount}</span>\n </button>\n )\n })}\n </nav>\n {selected !== undefined && servers[selected] !== undefined && (\n <ServerDetail\n key={selected}\n controller={controller}\n snapshot={snapshot}\n name={selected}\n server={servers[selected]}\n />\n )}\n </div>\n )}\n\n {dialog === 'add' && (\n <AddServerDialog controller={controller} busy={snapshot.busy} onClose={() => setDialog()} />\n )}\n {dialog === 'import' && (\n <ImportDialog controller={controller} busy={snapshot.busy} onClose={() => setDialog()} />\n )}\n </section>\n )\n}\n", "export const MCP_SETTINGS_NAMESPACE = 'mcp'\nexport const MCP_RPC_CHANNEL = '/mcp-adapter'\n\nconst SERVER_FIELDS = new Set([\n 'command',\n 'args',\n 'env',\n 'url',\n 'headers',\n 'disabled',\n 'autoAllow',\n 'lifecycle',\n 'idleTimeoutMinutes',\n 'promotedTools',\n])\n\nfunction isRecord(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction messageOf(error) {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction requireStringRecord(value, label) {\n if (value === undefined) return {}\n if (!isRecord(value)) throw new Error(`${label} must be an object of string values`)\n for (const [key, entry] of Object.entries(value)) {\n if (key.trim() === '' || typeof entry !== 'string') {\n throw new Error(`${label} must contain non-empty keys and string values`)\n }\n }\n return value\n}\n\nexport function normalizeServerConfig(name, input) {\n if (typeof name !== 'string' || name.trim() === '') {\n throw new Error('Server name cannot be empty')\n }\n if (!isRecord(input)) throw new Error(`Server ${JSON.stringify(name)} must be an object`)\n for (const key of Object.keys(input)) {\n if (!SERVER_FIELDS.has(key)) {\n throw new Error(`Server ${JSON.stringify(name)} has unknown field ${JSON.stringify(key)}`)\n }\n }\n\n const hasCommand = typeof input.command === 'string'\n const hasUrl = typeof input.url === 'string'\n if (hasCommand === hasUrl) {\n throw new Error(`Server ${JSON.stringify(name)} needs exactly one of command or url`)\n }\n if (hasCommand && input.command.trim() === '') {\n throw new Error(`Server ${JSON.stringify(name)} command cannot be empty`)\n }\n if (hasUrl) {\n let url\n try {\n url = new URL(input.url)\n } catch {\n throw new Error(`Server ${JSON.stringify(name)} URL must be absolute`)\n }\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n throw new Error(`Server ${JSON.stringify(name)} URL must use HTTP or HTTPS`)\n }\n }\n\n const args = input.args ?? []\n if (!Array.isArray(args) || args.some((entry) => typeof entry !== 'string')) {\n throw new Error(`Server ${JSON.stringify(name)} args must be an array of strings`)\n }\n const env = requireStringRecord(input.env, `Server ${JSON.stringify(name)} env`)\n const headers = requireStringRecord(input.headers, `Server ${JSON.stringify(name)} headers`)\n if (hasCommand && Object.keys(headers).length > 0) {\n throw new Error(`Server ${JSON.stringify(name)} headers require HTTP transport`)\n }\n if (hasUrl && (args.length > 0 || Object.keys(env).length > 0)) {\n throw new Error(`Server ${JSON.stringify(name)} args and env require stdio transport`)\n }\n\n const idleTimeoutMinutes = input.idleTimeoutMinutes ?? 10\n if (!Number.isFinite(idleTimeoutMinutes) || idleTimeoutMinutes <= 0) {\n throw new Error(`Server ${JSON.stringify(name)} idle timeout must be positive`)\n }\n const promotedTools = input.promotedTools ?? []\n if (\n !Array.isArray(promotedTools) ||\n promotedTools.some((entry) => typeof entry !== 'string' || entry.trim() === '') ||\n new Set(promotedTools).size !== promotedTools.length\n ) {\n throw new Error(`Server ${JSON.stringify(name)} promotedTools must contain unique names`)\n }\n\n return {\n ...(hasCommand ? { command: input.command.trim(), args, env } : {\n url: input.url.trim(),\n headers,\n }),\n disabled: input.disabled === true,\n autoAllow: input.autoAllow === true,\n lifecycle: 'lazy',\n idleTimeoutMinutes,\n promotedTools,\n }\n}\n\nexport function parseMcpImport(text) {\n let parsed\n try {\n parsed = JSON.parse(text)\n } catch (error) {\n throw new Error(`Invalid JSON: ${messageOf(error)}`)\n }\n if (!isRecord(parsed) || !isRecord(parsed.mcpServers)) {\n throw new Error('Import JSON must contain an mcpServers object')\n }\n const servers = {}\n for (const [name, config] of Object.entries(parsed.mcpServers)) {\n servers[name] = normalizeServerConfig(name, config)\n }\n if (Object.keys(servers).length === 0) {\n throw new Error('Import JSON contains no Servers')\n }\n return servers\n}\n\nexport function parseArgs(text) {\n let parsed\n try {\n parsed = JSON.parse(text)\n } catch (error) {\n throw new Error(`Args must be a JSON array: ${messageOf(error)}`)\n }\n if (!Array.isArray(parsed) || parsed.some((entry) => typeof entry !== 'string')) {\n throw new Error('Args must be a JSON array of strings')\n }\n return parsed\n}\n\nexport function secretKeysFromView(view, serverName, field) {\n const namespace = view?.namespaces?.find((entry) => entry.ns === MCP_SETTINGS_NAMESPACE)\n if (namespace === undefined) return []\n return namespace.secrets\n .filter(\n (secret) =>\n secret.set === true &&\n secret.path.length === 4 &&\n secret.path[0] === 'mcpServers' &&\n secret.path[1] === serverName &&\n secret.path[2] === field,\n )\n .map((secret) => secret.path[3])\n .sort()\n}\n\nexport function secretRowOps(serverName, field, rows, existingKeys) {\n const unsetKeys = new Set()\n const sets = []\n const retained = new Set()\n for (const row of rows) {\n const originalKey = typeof row.originalKey === 'string' ? row.originalKey : undefined\n const key = typeof row.key === 'string' ? row.key.trim() : ''\n const value = typeof row.value === 'string' ? row.value : ''\n if (row.removed) {\n if (originalKey !== undefined) unsetKeys.add(originalKey)\n continue\n }\n if (key === '') throw new Error(`${field} keys cannot be empty`)\n if (retained.has(key)) throw new Error(`${field} key ${JSON.stringify(key)} is duplicated`)\n retained.add(key)\n if (originalKey !== undefined && originalKey !== key) {\n unsetKeys.add(originalKey)\n if (value === '') {\n throw new Error(`Enter a new value when renaming secret key ${JSON.stringify(originalKey)}`)\n }\n }\n if (value !== '') {\n sets.push({ op: 'set', path: ['mcpServers', serverName, field, key], value })\n } else if (originalKey === undefined && !existingKeys.includes(key)) {\n throw new Error(`Enter a value for new ${field} key ${JSON.stringify(key)}`)\n }\n }\n for (const key of existingKeys) {\n if (!rows.some((row) => row.originalKey === key || (!row.removed && row.key === key))) {\n unsetKeys.add(key)\n }\n }\n return [\n ...[...unsetKeys].map((key) => ({\n op: 'unset',\n path: ['mcpServers', serverName, field, key],\n })),\n ...sets,\n ]\n}\n\nfunction overviewEmpty() {\n return { status: { servers: [] }, catalog: { servers: [] } }\n}\n\nexport class McpSettingsController {\n constructor({ scope, describe, settingsApi, rpc, pollIntervalMs = 3_000 }) {\n this.scope = scope\n this.describe = describe\n this.settingsApi = settingsApi\n this.rpc = rpc\n this.pollIntervalMs = pollIntervalMs\n this.listeners = new Set()\n this.overview = overviewEmpty()\n this.actionError = undefined\n this.overviewError = undefined\n this.pendingWrites = 0\n this.mounted = 0\n this.stopPoll = undefined\n this.loadingOverview = undefined\n this.tail = Promise.resolve()\n this.disposed = false\n this.unsubscribeScope = scope.subscribe(() => {\n this.publish()\n if (this.mounted > 0) void this.loadOverview()\n })\n this.unsubscribeDescribe = describe.subscribe(() => this.publish())\n this.snapshot = this.projection()\n\n this.subscribe = (listener) => {\n this.listeners.add(listener)\n return () => this.listeners.delete(listener)\n }\n this.getSnapshot = () => this.snapshot\n }\n\n projection() {\n return {\n settings: this.scope.getSnapshot(),\n settingsDocument: this.describe.getSnapshot(),\n overview: this.overview,\n error: this.actionError ?? this.overviewError,\n busy: this.pendingWrites > 0,\n }\n }\n\n publish() {\n this.snapshot = this.projection()\n for (const listener of this.listeners) listener()\n }\n\n mount() {\n if (this.disposed) return () => {}\n this.mounted += 1\n if (this.mounted === 1) {\n void this.describe.ensure().catch((error) => {\n this.actionError = `Could not load MCP Settings: ${messageOf(error)}`\n this.publish()\n })\n void this.loadOverview()\n const id = setInterval(() => void this.loadOverview(), this.pollIntervalMs)\n this.stopPoll = () => clearInterval(id)\n }\n return () => {\n this.mounted -= 1\n if (this.mounted === 0) {\n this.stopPoll?.()\n this.stopPoll = undefined\n }\n }\n }\n\n async loadOverview() {\n if (this.disposed) return\n if (this.loadingOverview !== undefined) return this.loadingOverview\n const request = (async () => {\n try {\n const result = await this.rpc('overview', {})\n if (!result.ok) throw new Error(result.error.message)\n this.overview = result.value\n this.overviewError = undefined\n } catch (error) {\n this.overviewError = `Could not load MCP status: ${messageOf(error)}`\n } finally {\n this.loadingOverview = undefined\n this.publish()\n }\n })()\n this.loadingOverview = request\n return request\n }\n\n enqueue(label, operation) {\n this.pendingWrites += 1\n this.actionError = undefined\n this.publish()\n const run = this.tail.then(async () => {\n try {\n await operation()\n await this.loadOverview()\n return true\n } catch (error) {\n this.actionError = `${label}: ${messageOf(error)}`\n return false\n } finally {\n this.pendingWrites -= 1\n this.publish()\n }\n })\n this.tail = run.then(() => undefined)\n return run\n }\n\n async settingsWrite(method, input) {\n const revision = this.scope.getSnapshot().revision\n if (revision === undefined) throw new Error('Settings have not loaded yet')\n const response = await this.settingsApi[method]({\n ns: MCP_SETTINGS_NAMESPACE,\n ...input,\n expectedRevision: revision,\n })\n if (!response.result.ok) throw new Error(response.result.error.message)\n this.describe.acceptView(response.result.value)\n }\n\n addServer(name, config) {\n return this.enqueue('Could not add Server', async () => {\n const normalizedName = name.trim()\n const current = this.scope.getSnapshot().value?.mcpServers ?? {}\n if (Object.hasOwn(current, normalizedName)) {\n throw new Error(`Server ${JSON.stringify(normalizedName)} already exists`)\n }\n const server = normalizeServerConfig(normalizedName, config)\n await this.settingsWrite('update', {\n patch: { mcpServers: { [normalizedName]: server } },\n })\n })\n }\n\n importJson(text) {\n return this.enqueue('Could not import Servers', async () => {\n const servers = parseMcpImport(text)\n const current = this.scope.getSnapshot().value?.mcpServers ?? {}\n const replacesExisting = Object.keys(servers).some((name) => Object.hasOwn(current, name))\n if (!replacesExisting) {\n await this.settingsWrite('update', { patch: { mcpServers: servers } })\n return\n }\n await this.settingsWrite('mutate', {\n ops: Object.entries(servers).map(([name, server]) => ({\n op: 'set',\n path: ['mcpServers', name],\n value: server,\n })),\n })\n })\n }\n\n deleteServer(name) {\n return this.enqueue('Could not delete Server', () =>\n this.settingsWrite('mutate', {\n ops: [{ op: 'unset', path: ['mcpServers', name] }],\n }),\n )\n }\n\n setServerField(name, field, value) {\n return this.enqueue(`Could not update ${field}`, () =>\n this.settingsWrite('mutate', {\n ops: [{ op: 'set', path: ['mcpServers', name, field], value }],\n }),\n )\n }\n\n saveServer(name, draft, secretRows) {\n return this.enqueue('Could not save Server', async () => {\n const existing = this.scope.getSnapshot().value?.mcpServers?.[name]\n if (existing === undefined) throw new Error(`Server ${JSON.stringify(name)} no longer exists`)\n const args = draft.transport === 'stdio' ? parseArgs(draft.argsText) : []\n const candidate = normalizeServerConfig(name, {\n ...(draft.transport === 'stdio'\n ? { command: draft.command, args, env: {} }\n : { url: draft.url, headers: {} }),\n disabled: draft.disabled,\n autoAllow: draft.autoAllow,\n idleTimeoutMinutes: Number(draft.idleTimeoutMinutes),\n promotedTools: existing.promotedTools,\n })\n const ops = [\n { op: 'set', path: ['mcpServers', name, 'disabled'], value: candidate.disabled },\n { op: 'set', path: ['mcpServers', name, 'autoAllow'], value: candidate.autoAllow },\n {\n op: 'set',\n path: ['mcpServers', name, 'idleTimeoutMinutes'],\n value: candidate.idleTimeoutMinutes,\n },\n ]\n if (draft.transport === 'stdio') {\n ops.push(\n { op: 'set', path: ['mcpServers', name, 'command'], value: candidate.command },\n { op: 'set', path: ['mcpServers', name, 'args'], value: candidate.args },\n { op: 'unset', path: ['mcpServers', name, 'url'] },\n { op: 'unset', path: ['mcpServers', name, 'headers'] },\n ...secretRowOps(name, 'env', secretRows, secretKeysFromView(\n this.describe.getSnapshot().view,\n name,\n 'env',\n )),\n )\n } else {\n ops.push(\n { op: 'set', path: ['mcpServers', name, 'url'], value: candidate.url },\n { op: 'unset', path: ['mcpServers', name, 'command'] },\n { op: 'unset', path: ['mcpServers', name, 'args'] },\n { op: 'unset', path: ['mcpServers', name, 'env'] },\n ...secretRowOps(name, 'headers', secretRows, secretKeysFromView(\n this.describe.getSnapshot().view,\n name,\n 'headers',\n )),\n )\n }\n await this.settingsWrite('mutate', { ops })\n })\n }\n\n togglePromotion(name, toolName) {\n const tools = this.scope.getSnapshot().value?.mcpServers?.[name]?.promotedTools ?? []\n const next = tools.includes(toolName)\n ? tools.filter((entry) => entry !== toolName)\n : [...tools, toolName]\n return this.setServerField(name, 'promotedTools', next)\n }\n\n reconnect(name) {\n return this.enqueue('Could not reconnect Server', async () => {\n const result = await this.rpc('reconnect', { server: name })\n if (!result.ok) {\n await this.loadOverview()\n throw new Error(result.error.message)\n }\n this.overview = result.value\n })\n }\n\n async dispose() {\n if (this.disposed) return\n this.disposed = true\n this.stopPoll?.()\n this.unsubscribeScope?.()\n this.unsubscribeDescribe?.()\n await this.tail\n this.listeners.clear()\n }\n}\n", "export const MCP_SETTINGS_CSS = `\n.mcp-settings{max-width:980px;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:16px}\n.mcp-settings *{box-sizing:border-box}\n.mcp-title{margin:0;font-size:18px;line-height:26px;font-weight:600}\n.mcp-intro,.mcp-muted{margin:0;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}\n.mcp-toolbar,.mcp-actions,.mcp-row,.mcp-card-head{display:flex;align-items:center;gap:8px}\n.mcp-toolbar{justify-content:space-between;flex-wrap:wrap}\n.mcp-actions{flex-wrap:wrap}\n.mcp-button{height:34px;border:1px solid var(--dsw-alias-border-l2);border-radius:17px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);padding:0 13px;font:inherit;font-size:13px;cursor:pointer}\n.mcp-button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}\n.mcp-button:disabled{cursor:not-allowed;opacity:.5}\n.mcp-button-primary{border-color:transparent;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}\n.mcp-button-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-fill)}\n.mcp-button-danger{color:var(--dsw-alias-state-error-primary)}\n.mcp-error,.mcp-warning{border-radius:8px;padding:9px 11px;font-size:12px;line-height:18px}\n.mcp-error{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);color:var(--dsw-alias-state-error-primary)}\n.mcp-warning{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-label)}\n.mcp-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:12px;align-items:start}\n.mcp-sidebar,.mcp-card,.mcp-empty,.mcp-modal-card{border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-base)}\n.mcp-sidebar{padding:6px;display:flex;flex-direction:column;gap:3px}\n.mcp-server-button{width:100%;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-primary);padding:9px 10px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;text-align:left;cursor:pointer;font:inherit}\n.mcp-server-button:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.mcp-server-button[aria-current=true]{background:var(--dsw-alias-button-ghost-active-fill)}\n.mcp-server-name{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:13px;font-weight:500}\n.mcp-server-count{color:var(--dsw-alias-label-tertiary);font-size:11px}\n.mcp-status-dot{width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-label-quaternary)}\n.mcp-status-connected{background:var(--dsw-alias-state-success-primary)}\n.mcp-status-connecting{background:var(--dsw-alias-state-warn-primary)}\n.mcp-status-error{background:var(--dsw-alias-state-error-primary)}\n.mcp-status-disabled{background:var(--dsw-alias-label-quaternary)}\n.mcp-card{padding:16px;display:flex;flex-direction:column;gap:16px;min-width:0}\n.mcp-card-head{align-items:flex-start}\n.mcp-card-title{margin:0;font-size:16px;line-height:24px;font-weight:600;overflow-wrap:anywhere}\n.mcp-card-head .mcp-actions{margin-left:auto;justify-content:flex-end}\n.mcp-badge{border:1px solid var(--dsw-alias-border-l3);border-radius:5px;padding:2px 7px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}\n.mcp-form{display:flex;flex-direction:column;gap:13px}\n.mcp-field{display:flex;flex-direction:column;gap:5px;min-width:0}\n.mcp-field-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}\n.mcp-label{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}\n.mcp-input,.mcp-select,.mcp-textarea{width:100%;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;outline:none}\n.mcp-input,.mcp-select{height:36px;padding:0 10px}\n.mcp-textarea{min-height:82px;padding:9px 10px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;line-height:19px}\n.mcp-input:focus,.mcp-select:focus,.mcp-textarea:focus{border-color:var(--dsw-alias-state-business-primary)}\n.mcp-checkbox{display:flex;align-items:flex-start;gap:8px;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}\n.mcp-checkbox input{margin-top:3px}\n.mcp-section{border-top:1px solid var(--dsw-alias-border-l3);padding-top:14px;display:flex;flex-direction:column;gap:10px}\n.mcp-section-title{margin:0;font-size:13px;font-weight:600;line-height:20px}\n.mcp-secret-row{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(140px,1.2fr) auto;gap:7px;align-items:center}\n.mcp-promotion-list{display:flex;flex-direction:column;gap:6px;max-height:260px;overflow:auto}\n.mcp-promotion{border:1px solid var(--dsw-alias-border-l3);border-radius:8px;padding:8px 10px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:start}\n.mcp-promotion-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow-wrap:anywhere}\n.mcp-promotion-description{display:block;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:17px}\n.mcp-empty{padding:34px 20px;text-align:center;display:flex;align-items:center;flex-direction:column;gap:10px}\n.mcp-overlay{position:fixed;inset:0;background:rgba(0,0,0,.28);display:flex;align-items:center;justify-content:center;padding:20px;z-index:1000}\n.mcp-modal-card{width:min(620px,100%);max-height:min(760px,90vh);overflow:auto;padding:18px;display:flex;flex-direction:column;gap:14px;box-shadow:0 18px 60px rgba(0,0,0,.24)}\n.mcp-modal-title{margin:0;font-size:16px;line-height:24px}\n.mcp-confirm{border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px}\n@media(max-width:760px){.mcp-layout{grid-template-columns:1fr}.mcp-sidebar{max-height:190px;overflow:auto}.mcp-field-row{grid-template-columns:1fr}.mcp-card-head{flex-direction:column}.mcp-card-head .mcp-actions{margin-left:0}.mcp-secret-row{grid-template-columns:1fr}.mcp-toolbar{align-items:flex-start}}\n`\n\nexport function installMcpSettingsStyles() {\n const id = 'dsh-mcp-adapter-settings'\n const existing = document.querySelector(`style[data-plugin-css=\"${id}\"]`)\n if (existing !== null) return () => {}\n const style = document.createElement('style')\n style.dataset.pluginCss = id\n style.textContent = MCP_SETTINGS_CSS\n document.head.appendChild(style)\n return () => style.remove()\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0E;;;ACAnE,IAAM,yBAAyB;AAC/B,IAAM,kBAAkB;AAE/B,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,SAAS,OAAO;AACvB,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,UAAU,OAAO;AACxB,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AAEA,SAAS,oBAAoB,OAAO,OAAO;AACzC,MAAI,UAAU,OAAW,QAAO,CAAC;AACjC,MAAI,CAAC,SAAS,KAAK,EAAG,OAAM,IAAI,MAAM,GAAG,KAAK,qCAAqC;AACnF,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,QAAI,IAAI,KAAK,MAAM,MAAM,OAAO,UAAU,UAAU;AAClD,YAAM,IAAI,MAAM,GAAG,KAAK,gDAAgD;AAAA,IAC1E;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,sBAAsB,MAAM,OAAO;AACjD,MAAI,OAAO,SAAS,YAAY,KAAK,KAAK,MAAM,IAAI;AAClD,UAAM,IAAI,MAAM,6BAA6B;AAAA,EAC/C;AACA,MAAI,CAAC,SAAS,KAAK,EAAG,OAAM,IAAI,MAAM,UAAU,KAAK,UA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MAC9B;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { McpSettingsPage } from './McpSettingsPage.jsx'\nimport {\n MCP_RPC_CHANNEL,\n MCP_SETTINGS_NAMESPACE,\n McpSettingsController,\n} from './settings-controller.js'\nimport { installMcpSettingsStyles } from './styles.js'\n\nexport const inject = ['slots', 'settingsScope', 'connection']\n\nexport function apply(ctx) {\n const scope = ctx.settingsScope.bind({ namespace: MCP_SETTINGS_NAMESPACE })\n const describe = ctx.settingsScope.describe()\n const controller = new McpSettingsController({\n scope,\n describe,\n settingsApi: ctx.connection.api.settings,\n rpc: (endpoint, payload, signal) =>\n ctx.connection.rpc.call(MCP_RPC_CHANNEL, endpoint, payload, signal),\n })\n\n ctx.effect(() => installMcpSettingsStyles(), 'mcp-adapter: Settings styles')\n ctx.effect(() => () => controller.dispose(), 'mcp-adapter: Settings controller')\n ctx.slots.inject('settings.section', () =>\n ctx.slots.register(\n {\n name: 'settings.section',\n id: 'mcp',\n order: 30,\n label: 'MCP',\n inject: () => ({ controller }),\n },\n McpSettingsPage,\n ),\n )\n}\n", "import React, { useEffect, useMemo, useState, useSyncExternalStore } from 'react'\n\nimport {\n normalizeServerConfig,\n parseArgs,\n parseMcpImport,\n secretKeysFromView,\n secretRowOps,\n} from './settings-controller.js'\n\nfunction statusFor(overview, name) {\n return overview.status.servers.find((entry) => entry.name === name) ?? {\n name,\n state: 'disconnected',\n toolCount: 0,\n }\n}\n\nfunction catalogFor(overview, name) {\n return overview.catalog.servers.find((entry) => entry.name === name)?.tools ?? []\n}\n\nfunction statusClass(state) {\n if (state === 'connected') return 'mcp-status-connected'\n if (state === 'connecting') return 'mcp-status-connecting'\n if (state === 'error') return 'mcp-status-error'\n if (state === 'disabled') return 'mcp-status-disabled'\n return ''\n}\n\nfunction secretRows(keys) {\n return keys.map((key) => ({ originalKey: key, key, value: '' }))\n}\n\nfunction SecretEditor({ field, rows, onChange, disabled }) {\n const label = field === 'env' ? 'Environment variables' : 'HTTP headers'\n const add = () => onChange([...rows, { key: '', value: '' }])\n const update = (index, patch) => {\n onChange(rows.map((row, position) => position === index ? { ...row, ...patch } : row))\n }\n const remove = (index) => onChange(rows.filter((_, position) => position !== index))\n\n return (\n <div className=\"mcp-section\">\n <div>\n <h4 className=\"mcp-section-title\">{label}</h4>\n <p className=\"mcp-muted\">\n Existing secret values stay saved when their value field remains blank.\n </p>\n </div>\n {rows.map((row, index) => (\n <div className=\"mcp-secret-row\" key={`${row.originalKey ?? 'new'}-${index}`}>\n <input\n className=\"mcp-input\"\n aria-label={`${label} key ${index + 1}`}\n placeholder={field === 'env' ? 'API_TOKEN' : 'Authorization'}\n value={row.key}\n disabled={disabled}\n onChange={(event) => update(index, { key: event.target.value })}\n />\n <input\n className=\"mcp-input\"\n aria-label={`${label} value ${index + 1}`}\n type={field === 'env' ? 'password' : 'text'}\n autoComplete=\"off\"\n placeholder={row.originalKey === undefined ? 'Value' : 'Saved value'}\n value={row.value}\n disabled={disabled}\n onChange={(event) => update(index, { value: event.target.value })}\n />\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-danger\"\n disabled={disabled}\n onClick={() => remove(index)}\n >\n Remove\n </button>\n </div>\n ))}\n <div>\n <button type=\"button\" className=\"mcp-button\" disabled={disabled} onClick={add}>\n Add {field === 'env' ? 'variable' : 'header'}\n </button>\n </div>\n </div>\n )\n}\n\nfunction useEscapeClose(onClose) {\n useEffect(() => {\n const onKey = (event) => {\n if (event.key === 'Escape') onClose()\n }\n window.addEventListener('keydown', onKey)\n return () => window.removeEventListener('keydown', onKey)\n }, [onClose])\n}\n\nfunction AddServerDialog({ controller, busy, onClose }) {\n const [name, setName] = useState('')\n const [transport, setTransport] = useState('stdio')\n const [command, setCommand] = useState('')\n const [url, setUrl] = useState('')\n const [argsText, setArgsText] = useState('[]')\n const [error, setError] = useState()\n useEscapeClose(onClose)\n const submit = async (event) => {\n event.preventDefault()\n setError(undefined)\n let config\n try {\n config = normalizeServerConfig(\n name,\n transport === 'stdio'\n ? { command, args: parseArgs(argsText) }\n : { url },\n )\n } catch (nextError) {\n setError(nextError instanceof Error ? nextError.message : String(nextError))\n return\n }\n if (await controller.addServer(name, config)) onClose()\n }\n\n return (\n <div className=\"mcp-overlay\" role=\"presentation\" onMouseDown={(event) => {\n if (event.target === event.currentTarget) onClose()\n }}>\n <form className=\"mcp-modal-card\" aria-label=\"Add MCP Server\" onSubmit={submit}>\n <div className=\"mcp-card-head\">\n <div>\n <h3 className=\"mcp-modal-title\">Add Server</h3>\n <p className=\"mcp-muted\">Configure one stdio command or one HTTP URL.</p>\n </div>\n <button type=\"button\" className=\"mcp-button\" onClick={onClose}>Close</button>\n </div>\n {error !== undefined && <div className=\"mcp-error\" role=\"alert\">{error}</div>}\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Name</span>\n <input\n autoFocus\n className=\"mcp-input\"\n value={name}\n disabled={busy}\n onChange={(event) => setName(event.target.value)}\n placeholder=\"github\"\n />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Transport</span>\n <select\n className=\"mcp-select\"\n value={transport}\n disabled={busy}\n onChange={(event) => setTransport(event.target.value)}\n >\n <option value=\"stdio\">stdio</option>\n <option value=\"http\">Streamable HTTP</option>\n </select>\n </label>\n {transport === 'stdio' ? (\n <>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Command</span>\n <input\n className=\"mcp-input\"\n value={command}\n disabled={busy}\n onChange={(event) => setCommand(event.target.value)}\n placeholder=\"npx\"\n />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Args as a JSON array</span>\n <textarea\n className=\"mcp-textarea\"\n value={argsText}\n disabled={busy}\n placeholder={'[\"-y\", \"@modelcontextprotocol/server-github\"]'}\n onChange={(event) => setArgsText(event.target.value)}\n spellCheck={false}\n />\n </label>\n </>\n ) : (\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">URL</span>\n <input\n className=\"mcp-input\"\n value={url}\n disabled={busy}\n onChange={(event) => setUrl(event.target.value)}\n placeholder=\"https://example.com/mcp\"\n />\n </label>\n )}\n <div className=\"mcp-actions\">\n <button type=\"submit\" className=\"mcp-button mcp-button-primary\" disabled={busy}>\n {busy ? 'Adding\u2026' : 'Add Server'}\n </button>\n <button type=\"button\" className=\"mcp-button\" disabled={busy} onClick={onClose}>\n Cancel\n </button>\n </div>\n </form>\n </div>\n )\n}\n\nfunction ImportDialog({ controller, busy, onClose }) {\n const [text, setText] = useState('{\\n \"mcpServers\": {\\n \\n }\\n}')\n const [error, setError] = useState()\n useEscapeClose(onClose)\n const submit = async (event) => {\n event.preventDefault()\n setError(undefined)\n try {\n parseMcpImport(text)\n } catch (nextError) {\n setError(nextError instanceof Error ? nextError.message : String(nextError))\n return\n }\n const result = await controller.importJson(text)\n if (result) onClose()\n else setError('The Host rejected this import. Review the page error and retry.')\n }\n\n return (\n <div className=\"mcp-overlay\" role=\"presentation\" onMouseDown={(event) => {\n if (event.target === event.currentTarget) onClose()\n }}>\n <form className=\"mcp-modal-card\" aria-label=\"Import MCP Servers\" onSubmit={submit}>\n <div className=\"mcp-card-head\">\n <div>\n <h3 className=\"mcp-modal-title\">Import JSON</h3>\n <p className=\"mcp-muted\">Paste a standard object with an mcpServers property.</p>\n </div>\n <button type=\"button\" className=\"mcp-button\" onClick={onClose}>Close</button>\n </div>\n {error !== undefined && <div className=\"mcp-error\" role=\"alert\">{error}</div>}\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">MCP Config JSON</span>\n <textarea\n autoFocus\n className=\"mcp-textarea\"\n style={{ minHeight: 280 }}\n value={text}\n disabled={busy}\n spellCheck={false}\n onChange={(event) => setText(event.target.value)}\n />\n </label>\n <div className=\"mcp-actions\">\n <button type=\"submit\" className=\"mcp-button mcp-button-primary\" disabled={busy}>\n {busy ? 'Importing\u2026' : 'Import Servers'}\n </button>\n <button type=\"button\" className=\"mcp-button\" disabled={busy} onClick={onClose}>\n Cancel\n </button>\n </div>\n </form>\n </div>\n )\n}\n\nfunction ServerDetail({ controller, snapshot, name, server }) {\n const status = statusFor(snapshot.overview, name)\n const tools = catalogFor(snapshot.overview, name)\n const transport = typeof server.command === 'string' ? 'stdio' : 'http'\n const [draft, setDraft] = useState(() => ({\n transport,\n command: server.command ?? '',\n url: server.url ?? '',\n argsText: JSON.stringify(server.args ?? [], null, 2),\n disabled: server.disabled === true,\n autoAllow: server.autoAllow === true,\n idleTimeoutMinutes: String(server.idleTimeoutMinutes ?? 10),\n }))\n const [rowSets, setRowSets] = useState(() => ({\n env: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'env')),\n headers: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'headers')),\n }))\n const activeSecretField = draft.transport === 'stdio' ? 'env' : 'headers'\n const rows = rowSets[activeSecretField]\n const [dirty, setDirty] = useState(false)\n const [formError, setFormError] = useState()\n const [confirmDelete, setConfirmDelete] = useState(false)\n\n useEffect(() => {\n if (dirty) return\n const nextTransport = typeof server.command === 'string' ? 'stdio' : 'http'\n setDraft({\n transport: nextTransport,\n command: server.command ?? '',\n url: server.url ?? '',\n argsText: JSON.stringify(server.args ?? [], null, 2),\n disabled: server.disabled === true,\n autoAllow: server.autoAllow === true,\n idleTimeoutMinutes: String(server.idleTimeoutMinutes ?? 10),\n })\n setRowSets({\n env: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'env')),\n headers: secretRows(secretKeysFromView(snapshot.settingsDocument.view, name, 'headers')),\n })\n }, [dirty, name, server, snapshot.settingsDocument.view])\n\n const changeDraft = (patch) => {\n setDirty(true)\n setDraft((current) => ({ ...current, ...patch }))\n }\n const changeRows = (next) => {\n setDirty(true)\n setRowSets((current) => ({ ...current, [activeSecretField]: next }))\n }\n const save = async (event) => {\n event.preventDefault()\n setFormError(undefined)\n try {\n const nextTransport = draft.transport\n normalizeServerConfig(name, {\n ...(nextTransport === 'stdio'\n ? { command: draft.command, args: parseArgs(draft.argsText) }\n : { url: draft.url }),\n disabled: draft.disabled,\n autoAllow: draft.autoAllow,\n idleTimeoutMinutes: Number(draft.idleTimeoutMinutes),\n promotedTools: server.promotedTools,\n })\n const field = nextTransport === 'stdio' ? 'env' : 'headers'\n secretRowOps(\n name,\n field,\n rows,\n secretKeysFromView(snapshot.settingsDocument.view, name, field),\n )\n } catch (nextError) {\n setFormError(nextError instanceof Error ? nextError.message : String(nextError))\n return\n }\n if (await controller.saveServer(name, draft, rows)) {\n setRowSets((current) => ({\n ...current,\n [activeSecretField]: rows.map((row) => ({\n originalKey: row.key.trim(),\n key: row.key.trim(),\n value: '',\n })),\n }))\n setDirty(false)\n }\n }\n const remove = async () => {\n if (await controller.deleteServer(name)) setConfirmDelete(false)\n }\n\n return (\n <div className=\"mcp-card\">\n <div className=\"mcp-card-head\">\n <div>\n <div className=\"mcp-row\">\n <span className={`mcp-status-dot ${statusClass(status.state)}`} />\n <h2 className=\"mcp-card-title\">{name}</h2>\n <span className={`mcp-badge ${statusClass(status.state)}`}>{status.state}</span>\n </div>\n <p className=\"mcp-muted\">\n {status.toolCount} {status.toolCount === 1 ? 'tool' : 'tools'} cached\n {status.transport === undefined ? '' : ` \u00B7 ${status.transport}`}\n </p>\n </div>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button\"\n disabled={snapshot.busy || draft.disabled}\n onClick={() => void controller.reconnect(name)}\n >\n Reconnect\n </button>\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-danger\"\n disabled={snapshot.busy}\n onClick={() => setConfirmDelete(true)}\n >\n Delete\n </button>\n </div>\n </div>\n\n {status.message !== undefined && status.state === 'error' && (\n <div className=\"mcp-error\" role=\"alert\">{status.message}</div>\n )}\n {confirmDelete && (\n <div className=\"mcp-confirm\">\n <strong>Delete {name}?</strong>\n <span className=\"mcp-muted\">This removes its Config and disconnects the Server.</span>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-danger\"\n disabled={snapshot.busy}\n onClick={() => void remove()}\n >\n Confirm delete\n </button>\n <button type=\"button\" className=\"mcp-button\" onClick={() => setConfirmDelete(false)}>\n Cancel\n </button>\n </div>\n </div>\n )}\n\n <form className=\"mcp-form\" onSubmit={save}>\n {formError !== undefined && <div className=\"mcp-error\" role=\"alert\">{formError}</div>}\n <div className=\"mcp-field-row\">\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Name</span>\n <input className=\"mcp-input\" value={name} readOnly />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Transport</span>\n <select\n className=\"mcp-select\"\n value={draft.transport}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ transport: event.target.value })}\n >\n <option value=\"stdio\">stdio</option>\n <option value=\"http\">Streamable HTTP</option>\n </select>\n </label>\n </div>\n\n {draft.transport === 'stdio' ? (\n <>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Command</span>\n <input\n className=\"mcp-input\"\n value={draft.command}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ command: event.target.value })}\n />\n </label>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Args as a JSON array</span>\n <textarea\n className=\"mcp-textarea\"\n value={draft.argsText}\n disabled={snapshot.busy}\n spellCheck={false}\n onChange={(event) => changeDraft({ argsText: event.target.value })}\n />\n </label>\n <SecretEditor field=\"env\" rows={rows} onChange={changeRows} disabled={snapshot.busy} />\n </>\n ) : (\n <>\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">URL</span>\n <input\n className=\"mcp-input\"\n value={draft.url}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ url: event.target.value })}\n />\n </label>\n <SecretEditor field=\"headers\" rows={rows} onChange={changeRows} disabled={snapshot.busy} />\n </>\n )}\n\n <div className=\"mcp-field-row\">\n <label className=\"mcp-field\">\n <span className=\"mcp-label\">Idle timeout in minutes</span>\n <input\n className=\"mcp-input\"\n type=\"number\"\n min=\"0.1\"\n step=\"0.1\"\n value={draft.idleTimeoutMinutes}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ idleTimeoutMinutes: event.target.value })}\n />\n </label>\n <div className=\"mcp-field\">\n <span className=\"mcp-label\">Call policy</span>\n <label className=\"mcp-checkbox\">\n <input\n type=\"checkbox\"\n checked={draft.autoAllow}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ autoAllow: event.target.checked })}\n />\n Auto-allow calls from this Server\n </label>\n </div>\n </div>\n <label className=\"mcp-checkbox\">\n <input\n type=\"checkbox\"\n checked={draft.disabled}\n disabled={snapshot.busy}\n onChange={(event) => changeDraft({ disabled: event.target.checked })}\n />\n Disable this Server\n </label>\n <div className=\"mcp-actions\">\n <button\n type=\"submit\"\n className=\"mcp-button mcp-button-primary\"\n disabled={snapshot.busy || !dirty}\n >\n {snapshot.busy ? 'Saving\u2026' : 'Save Server'}\n </button>\n {dirty && <span className=\"mcp-muted\">Unsaved changes</span>}\n </div>\n </form>\n\n <div className=\"mcp-section\">\n <div>\n <h3 className=\"mcp-section-title\">Promotions</h3>\n <p className=\"mcp-muted\">\n Promote selected MCP tools as native tools named {name}__tool.\n </p>\n </div>\n {tools.length === 0 ? (\n <div className=\"mcp-warning\">\n No cached tools are available. Reconnect to discover this Server.\n </div>\n ) : (\n <div className=\"mcp-promotion-list\">\n {tools.map((tool) => {\n const checked = (server.promotedTools ?? []).includes(tool.name)\n return (\n <label className=\"mcp-promotion\" key={tool.name}>\n <input\n type=\"checkbox\"\n checked={checked}\n disabled={snapshot.busy}\n onChange={() => void controller.togglePromotion(name, tool.name)}\n />\n <span>\n <span className=\"mcp-promotion-name\">{tool.name}</span>\n {tool.description !== undefined && (\n <span className=\"mcp-promotion-description\">{tool.description}</span>\n )}\n </span>\n </label>\n )\n })}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nexport function McpSettingsPage({ controller }) {\n const snapshot = useSyncExternalStore(controller.subscribe, controller.getSnapshot)\n const [selected, setSelected] = useState()\n const [dialog, setDialog] = useState()\n const settings = snapshot.settings\n const servers = settings.value?.mcpServers ?? {}\n const names = useMemo(() => Object.keys(servers).sort(), [servers])\n\n useEffect(() => controller.mount(), [controller])\n useEffect(() => {\n if (selected === undefined || !Object.hasOwn(servers, selected)) {\n setSelected(names[0])\n }\n }, [names, selected, servers])\n\n if (settings.status === 'loading') {\n return <section className=\"mcp-settings\"><p className=\"mcp-muted\">Loading MCP Settings\u2026</p></section>\n }\n if (settings.status !== 'ready') {\n return (\n <section className=\"mcp-settings\">\n <h1 className=\"mcp-title\">MCP</h1>\n <div className=\"mcp-error\" role=\"alert\">\n {settings.error?.message ?? 'MCP Settings are unavailable.'}\n </div>\n </section>\n )\n }\n\n return (\n <section className=\"mcp-settings\">\n <div className=\"mcp-toolbar\">\n <div>\n <h1 className=\"mcp-title\">MCP</h1>\n <p className=\"mcp-intro\">Connect MCP Servers and choose how their tools reach the Agent.</p>\n </div>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button\"\n disabled={snapshot.busy || !settings.writable}\n onClick={() => setDialog('import')}\n >\n Import JSON\n </button>\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-primary\"\n disabled={snapshot.busy || !settings.writable}\n onClick={() => setDialog('add')}\n >\n Add Server\n </button>\n </div>\n </div>\n\n {!settings.writable && (\n <div className=\"mcp-warning\">The active Settings Provider is read-only.</div>\n )}\n {snapshot.error !== undefined && (\n <div className=\"mcp-error\" role=\"alert\">{snapshot.error}</div>\n )}\n\n {names.length === 0 ? (\n <div className=\"mcp-empty\">\n <h2 className=\"mcp-card-title\">No MCP Servers</h2>\n <p className=\"mcp-muted\">Add a Server or import an existing mcpServers Config.</p>\n <div className=\"mcp-actions\">\n <button\n type=\"button\"\n className=\"mcp-button mcp-button-primary\"\n disabled={snapshot.busy || !settings.writable}\n onClick={() => setDialog('add')}\n >\n Add Server\n </button>\n <button\n type=\"button\"\n className=\"mcp-button\"\n disabled={snapshot.busy || !settings.writable}\n onClick={() => setDialog('import')}\n >\n Import JSON\n </button>\n </div>\n </div>\n ) : (\n <div className=\"mcp-layout\">\n <nav className=\"mcp-sidebar\" aria-label=\"MCP Servers\">\n {names.map((name) => {\n const status = statusFor(snapshot.overview, name)\n return (\n <button\n type=\"button\"\n className=\"mcp-server-button\"\n aria-current={name === selected}\n key={name}\n onClick={() => setSelected(name)}\n >\n <span className={`mcp-status-dot ${statusClass(status.state)}`} />\n <span className=\"mcp-server-name\">{name}</span>\n <span className=\"mcp-server-count\">{status.toolCount}</span>\n </button>\n )\n })}\n </nav>\n {selected !== undefined && servers[selected] !== undefined && (\n <ServerDetail\n key={selected}\n controller={controller}\n snapshot={snapshot}\n name={selected}\n server={servers[selected]}\n />\n )}\n </div>\n )}\n\n {dialog === 'add' && (\n <AddServerDialog controller={controller} busy={snapshot.busy} onClose={() => setDialog()} />\n )}\n {dialog === 'import' && (\n <ImportDialog controller={controller} busy={snapshot.busy} onClose={() => setDialog()} />\n )}\n </section>\n )\n}\n", "export const MCP_SETTINGS_NAMESPACE = 'mcp'\nexport const MCP_RPC_CHANNEL = '/mcp-adapter'\n\nconst SERVER_FIELDS = new Set([\n 'command',\n 'args',\n 'env',\n 'url',\n 'headers',\n 'disabled',\n 'autoAllow',\n 'lifecycle',\n 'idleTimeoutMinutes',\n 'promotedTools',\n])\n\nfunction isRecord(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction messageOf(error) {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction requireStringRecord(value, label) {\n if (value === undefined) return {}\n if (!isRecord(value)) throw new Error(`${label} must be an object of string values`)\n for (const [key, entry] of Object.entries(value)) {\n if (key.trim() === '' || typeof entry !== 'string') {\n throw new Error(`${label} must contain non-empty keys and string values`)\n }\n }\n return value\n}\n\nexport function normalizeServerConfig(name, input) {\n if (typeof name !== 'string' || name.trim() === '') {\n throw new Error('Server name cannot be empty')\n }\n if (!isRecord(input)) throw new Error(`Server ${JSON.stringify(name)} must be an object`)\n for (const key of Object.keys(input)) {\n if (!SERVER_FIELDS.has(key)) {\n throw new Error(`Server ${JSON.stringify(name)} has unknown field ${JSON.stringify(key)}`)\n }\n }\n\n const hasCommand = typeof input.command === 'string'\n const hasUrl = typeof input.url === 'string'\n if (hasCommand === hasUrl) {\n throw new Error(`Server ${JSON.stringify(name)} needs exactly one of command or url`)\n }\n if (hasCommand && input.command.trim() === '') {\n throw new Error(`Server ${JSON.stringify(name)} command cannot be empty`)\n }\n if (hasUrl) {\n let url\n try {\n url = new URL(input.url)\n } catch {\n throw new Error(`Server ${JSON.stringify(name)} URL must be absolute`)\n }\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n throw new Error(`Server ${JSON.stringify(name)} URL must use HTTP or HTTPS`)\n }\n }\n\n const args = input.args ?? []\n if (!Array.isArray(args) || args.some((entry) => typeof entry !== 'string')) {\n throw new Error(`Server ${JSON.stringify(name)} args must be an array of strings`)\n }\n const env = requireStringRecord(input.env, `Server ${JSON.stringify(name)} env`)\n const headers = requireStringRecord(input.headers, `Server ${JSON.stringify(name)} headers`)\n if (hasCommand && Object.keys(headers).length > 0) {\n throw new Error(`Server ${JSON.stringify(name)} headers require HTTP transport`)\n }\n if (hasUrl && (args.length > 0 || Object.keys(env).length > 0)) {\n throw new Error(`Server ${JSON.stringify(name)} args and env require stdio transport`)\n }\n\n const idleTimeoutMinutes = input.idleTimeoutMinutes ?? 10\n if (!Number.isFinite(idleTimeoutMinutes) || idleTimeoutMinutes <= 0) {\n throw new Error(`Server ${JSON.stringify(name)} idle timeout must be positive`)\n }\n const promotedTools = input.promotedTools ?? []\n if (\n !Array.isArray(promotedTools) ||\n promotedTools.some((entry) => typeof entry !== 'string' || entry.trim() === '') ||\n new Set(promotedTools).size !== promotedTools.length\n ) {\n throw new Error(`Server ${JSON.stringify(name)} promotedTools must contain unique names`)\n }\n\n return {\n ...(hasCommand ? { command: input.command.trim(), args, env } : {\n url: input.url.trim(),\n headers,\n }),\n disabled: input.disabled === true,\n autoAllow: input.autoAllow === true,\n lifecycle: 'lazy',\n idleTimeoutMinutes,\n promotedTools,\n }\n}\n\nexport function parseMcpImport(text) {\n let parsed\n try {\n parsed = JSON.parse(text)\n } catch (error) {\n throw new Error(`Invalid JSON: ${messageOf(error)}`)\n }\n if (!isRecord(parsed) || !isRecord(parsed.mcpServers)) {\n throw new Error('Import JSON must contain an mcpServers object')\n }\n const servers = {}\n for (const [name, config] of Object.entries(parsed.mcpServers)) {\n servers[name] = normalizeServerConfig(name, config)\n }\n if (Object.keys(servers).length === 0) {\n throw new Error('Import JSON contains no Servers')\n }\n return servers\n}\n\nexport function parseArgs(text) {\n let parsed\n try {\n parsed = JSON.parse(text)\n } catch (error) {\n throw new Error(`Args must be a JSON array: ${messageOf(error)}`)\n }\n if (!Array.isArray(parsed) || parsed.some((entry) => typeof entry !== 'string')) {\n throw new Error('Args must be a JSON array of strings')\n }\n return parsed\n}\n\nexport function secretKeysFromView(view, serverName, field) {\n const namespace = view?.namespaces?.find((entry) => entry.ns === MCP_SETTINGS_NAMESPACE)\n if (namespace === undefined) return []\n return namespace.secrets\n .filter(\n (secret) =>\n secret.set === true &&\n secret.path.length === 4 &&\n secret.path[0] === 'mcpServers' &&\n secret.path[1] === serverName &&\n secret.path[2] === field,\n )\n .map((secret) => secret.path[3])\n .sort()\n}\n\nexport function secretRowOps(serverName, field, rows, existingKeys) {\n const unsetKeys = new Set()\n const sets = []\n const retained = new Set()\n for (const row of rows) {\n const originalKey = typeof row.originalKey === 'string' ? row.originalKey : undefined\n const key = typeof row.key === 'string' ? row.key.trim() : ''\n const value = typeof row.value === 'string' ? row.value : ''\n if (row.removed) {\n if (originalKey !== undefined) unsetKeys.add(originalKey)\n continue\n }\n if (key === '') throw new Error(`${field} keys cannot be empty`)\n if (retained.has(key)) throw new Error(`${field} key ${JSON.stringify(key)} is duplicated`)\n retained.add(key)\n if (originalKey !== undefined && originalKey !== key) {\n unsetKeys.add(originalKey)\n if (value === '') {\n throw new Error(`Enter a new value when renaming secret key ${JSON.stringify(originalKey)}`)\n }\n }\n if (value !== '') {\n sets.push({ op: 'set', path: ['mcpServers', serverName, field, key], value })\n } else if (originalKey === undefined && !existingKeys.includes(key)) {\n throw new Error(`Enter a value for new ${field} key ${JSON.stringify(key)}`)\n }\n }\n for (const key of existingKeys) {\n if (!rows.some((row) => row.originalKey === key || (!row.removed && row.key === key))) {\n unsetKeys.add(key)\n }\n }\n return [\n ...[...unsetKeys].map((key) => ({\n op: 'unset',\n path: ['mcpServers', serverName, field, key],\n })),\n ...sets,\n ]\n}\n\nfunction overviewEmpty() {\n return { status: { servers: [] }, catalog: { servers: [] } }\n}\n\nexport class McpSettingsController {\n constructor({ scope, describe, settingsApi, rpc, pollIntervalMs = 3_000 }) {\n this.scope = scope\n this.describe = describe\n this.settingsApi = settingsApi\n this.rpc = rpc\n this.pollIntervalMs = pollIntervalMs\n this.listeners = new Set()\n this.overview = overviewEmpty()\n this.actionError = undefined\n this.overviewError = undefined\n this.pendingWrites = 0\n this.mounted = 0\n this.stopPoll = undefined\n this.loadingOverview = undefined\n this.tail = Promise.resolve()\n this.disposed = false\n this.unsubscribeScope = scope.subscribe(() => {\n this.publish()\n if (this.mounted > 0) void this.loadOverview()\n })\n this.unsubscribeDescribe = describe.subscribe(() => this.publish())\n this.snapshot = this.projection()\n\n this.subscribe = (listener) => {\n this.listeners.add(listener)\n return () => this.listeners.delete(listener)\n }\n this.getSnapshot = () => this.snapshot\n }\n\n projection() {\n return {\n settings: this.scope.getSnapshot(),\n settingsDocument: this.describe.getSnapshot(),\n overview: this.overview,\n error: this.actionError ?? this.overviewError,\n busy: this.pendingWrites > 0,\n }\n }\n\n publish() {\n this.snapshot = this.projection()\n for (const listener of this.listeners) listener()\n }\n\n mount() {\n if (this.disposed) return () => {}\n this.mounted += 1\n if (this.mounted === 1) {\n void this.describe.ensure().catch((error) => {\n this.actionError = `Could not load MCP Settings: ${messageOf(error)}`\n this.publish()\n })\n void this.loadOverview()\n const id = setInterval(() => void this.loadOverview(), this.pollIntervalMs)\n this.stopPoll = () => clearInterval(id)\n }\n return () => {\n this.mounted -= 1\n if (this.mounted === 0) {\n this.stopPoll?.()\n this.stopPoll = undefined\n }\n }\n }\n\n async loadOverview() {\n if (this.disposed) return\n if (this.loadingOverview !== undefined) return this.loadingOverview\n const request = (async () => {\n try {\n const result = await this.rpc('overview', {})\n if (!result.ok) throw new Error(result.error.message)\n this.overview = result.value\n this.overviewError = undefined\n } catch (error) {\n this.overviewError = `Could not load MCP status: ${messageOf(error)}`\n } finally {\n this.loadingOverview = undefined\n this.publish()\n }\n })()\n this.loadingOverview = request\n return request\n }\n\n enqueue(label, operation) {\n this.pendingWrites += 1\n this.actionError = undefined\n this.publish()\n const run = this.tail.then(async () => {\n try {\n await operation()\n await this.loadOverview()\n return true\n } catch (error) {\n this.actionError = `${label}: ${messageOf(error)}`\n return false\n } finally {\n this.pendingWrites -= 1\n this.publish()\n }\n })\n this.tail = run.then(() => undefined)\n return run\n }\n\n async settingsWrite(method, input) {\n const revision = this.scope.getSnapshot().revision\n if (revision === undefined) throw new Error('Settings have not loaded yet')\n const response = await this.settingsApi[method]({\n ns: MCP_SETTINGS_NAMESPACE,\n ...input,\n expectedRevision: revision,\n })\n if (!response.result.ok) throw new Error(response.result.error.message)\n this.describe.acceptView(response.result.value)\n }\n\n addServer(name, config) {\n return this.enqueue('Could not add Server', async () => {\n const normalizedName = name.trim()\n const current = this.scope.getSnapshot().value?.mcpServers ?? {}\n if (Object.hasOwn(current, normalizedName)) {\n throw new Error(`Server ${JSON.stringify(normalizedName)} already exists`)\n }\n const server = normalizeServerConfig(normalizedName, config)\n await this.settingsWrite('update', {\n patch: { mcpServers: { [normalizedName]: server } },\n })\n })\n }\n\n importJson(text) {\n return this.enqueue('Could not import Servers', async () => {\n const servers = parseMcpImport(text)\n const current = this.scope.getSnapshot().value?.mcpServers ?? {}\n const replacesExisting = Object.keys(servers).some((name) => Object.hasOwn(current, name))\n if (!replacesExisting) {\n await this.settingsWrite('update', { patch: { mcpServers: servers } })\n return\n }\n await this.settingsWrite('mutate', {\n ops: Object.entries(servers).map(([name, server]) => ({\n op: 'set',\n path: ['mcpServers', name],\n value: server,\n })),\n })\n })\n }\n\n deleteServer(name) {\n return this.enqueue('Could not delete Server', () =>\n this.settingsWrite('mutate', {\n ops: [{ op: 'unset', path: ['mcpServers', name] }],\n }),\n )\n }\n\n setServerField(name, field, value) {\n return this.enqueue(`Could not update ${field}`, () =>\n this.settingsWrite('mutate', {\n ops: [{ op: 'set', path: ['mcpServers', name, field], value }],\n }),\n )\n }\n\n saveServer(name, draft, secretRows) {\n return this.enqueue('Could not save Server', async () => {\n const existing = this.scope.getSnapshot().value?.mcpServers?.[name]\n if (existing === undefined) throw new Error(`Server ${JSON.stringify(name)} no longer exists`)\n const args = draft.transport === 'stdio' ? parseArgs(draft.argsText) : []\n const candidate = normalizeServerConfig(name, {\n ...(draft.transport === 'stdio'\n ? { command: draft.command, args, env: {} }\n : { url: draft.url, headers: {} }),\n disabled: draft.disabled,\n autoAllow: draft.autoAllow,\n idleTimeoutMinutes: Number(draft.idleTimeoutMinutes),\n promotedTools: existing.promotedTools,\n })\n const ops = [\n { op: 'set', path: ['mcpServers', name, 'disabled'], value: candidate.disabled },\n { op: 'set', path: ['mcpServers', name, 'autoAllow'], value: candidate.autoAllow },\n {\n op: 'set',\n path: ['mcpServers', name, 'idleTimeoutMinutes'],\n value: candidate.idleTimeoutMinutes,\n },\n ]\n if (draft.transport === 'stdio') {\n ops.push(\n { op: 'set', path: ['mcpServers', name, 'command'], value: candidate.command },\n { op: 'set', path: ['mcpServers', name, 'args'], value: candidate.args },\n { op: 'unset', path: ['mcpServers', name, 'url'] },\n { op: 'unset', path: ['mcpServers', name, 'headers'] },\n ...secretRowOps(name, 'env', secretRows, secretKeysFromView(\n this.describe.getSnapshot().view,\n name,\n 'env',\n )),\n )\n } else {\n ops.push(\n { op: 'set', path: ['mcpServers', name, 'url'], value: candidate.url },\n { op: 'unset', path: ['mcpServers', name, 'command'] },\n { op: 'unset', path: ['mcpServers', name, 'args'] },\n { op: 'unset', path: ['mcpServers', name, 'env'] },\n ...secretRowOps(name, 'headers', secretRows, secretKeysFromView(\n this.describe.getSnapshot().view,\n name,\n 'headers',\n )),\n )\n }\n await this.settingsWrite('mutate', { ops })\n })\n }\n\n togglePromotion(name, toolName) {\n const tools = this.scope.getSnapshot().value?.mcpServers?.[name]?.promotedTools ?? []\n const next = tools.includes(toolName)\n ? tools.filter((entry) => entry !== toolName)\n : [...tools, toolName]\n return this.setServerField(name, 'promotedTools', next)\n }\n\n reconnect(name) {\n return this.enqueue('Could not reconnect Server', async () => {\n const result = await this.rpc('reconnect', { server: name })\n if (!result.ok) {\n await this.loadOverview()\n throw new Error(result.error.message)\n }\n this.overview = result.value\n })\n }\n\n async dispose() {\n if (this.disposed) return\n this.disposed = true\n this.stopPoll?.()\n this.unsubscribeScope?.()\n this.unsubscribeDescribe?.()\n await this.tail\n this.listeners.clear()\n }\n}\n", "export const MCP_SETTINGS_CSS = `\n.mcp-settings{width:100%;max-width:980px;min-width:0;container-type:inline-size;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:14px}\n.mcp-settings *{box-sizing:border-box}\n.mcp-title{margin:0;font-size:16px;line-height:24px;font-weight:600}\n.mcp-intro,.mcp-muted{margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}\n.mcp-toolbar,.mcp-actions,.mcp-row,.mcp-card-head{display:flex;align-items:center;gap:8px}\n.mcp-toolbar{justify-content:space-between;flex-wrap:wrap}\n.mcp-actions{flex-wrap:wrap}\n.mcp-button{height:32px;border:1px solid var(--dsw-alias-border-l2);border-radius:16px;background:transparent;color:var(--dsw-alias-label-primary);padding:0 13px;font:inherit;font-size:12px;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}\n.mcp-button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}\n.mcp-button:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}\n.mcp-button:disabled{cursor:not-allowed;opacity:.5}\n.mcp-button-primary{border-color:transparent;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}\n.mcp-button-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}\n.mcp-button-danger{color:var(--dsw-alias-state-error-primary)}\n.mcp-button-danger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}\n.mcp-button:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}\n.mcp-error,.mcp-warning{border-radius:8px;padding:9px 11px;font-size:12px;line-height:18px}\n.mcp-error{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);color:var(--dsw-alias-state-error-primary)}\n.mcp-warning{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-label)}\n.mcp-layout{display:grid;grid-template-columns:208px minmax(0,1fr);gap:14px;align-items:start;min-width:0}\n.mcp-card,.mcp-empty{border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}\n.mcp-sidebar{display:flex;flex-direction:column;gap:2px;position:sticky;top:12px}\n.mcp-server-button{width:100%;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);padding:8px 10px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;text-align:left;cursor:pointer;font:inherit;transition:background .12s ease,color .12s ease}\n.mcp-server-button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}\n.mcp-server-button[aria-current=true]{background:var(--dsw-alias-button-ghost-active-fill);color:var(--dsw-alias-label-primary)}\n.mcp-server-name{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:13px;font-weight:500}\n.mcp-server-count{color:var(--dsw-alias-label-tertiary);font-size:11px}\n.mcp-status-dot{width:7px;height:7px;border-radius:50%;background:var(--dsw-alias-label-dimmed);flex:none}\n.mcp-status-connected{background:var(--dsw-alias-state-success-primary)}\n.mcp-status-connecting{background:var(--dsw-alias-state-warn-primary)}\n.mcp-status-dot.mcp-status-connecting{animation:mcp-pulse 1.2s ease-in-out infinite}\n@keyframes mcp-pulse{0%,100%{opacity:1}50%{opacity:.35}}\n.mcp-status-error{background:var(--dsw-alias-state-error-primary)}\n.mcp-status-disabled{background:var(--dsw-alias-label-dimmed)}\n.mcp-card{padding:16px;display:flex;flex-direction:column;gap:14px;min-width:0}\n.mcp-card-head{align-items:flex-start;flex-wrap:wrap}\n.mcp-card-head > div:first-child{flex:1 1 200px;min-width:0}\n.mcp-card-title{margin:0;font-size:15px;line-height:22px;font-weight:600;overflow-wrap:anywhere}\n.mcp-card-head .mcp-actions{margin-left:auto;justify-content:flex-end;flex:none}\n.mcp-badge{border:1px solid var(--dsw-alias-border-l2);border-radius:5px;padding:1px 7px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px;background:transparent}\n.mcp-badge.mcp-status-connected{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 35%, transparent);background:transparent}\n.mcp-badge.mcp-status-connecting{color:var(--dsw-alias-state-warn-label);border-color:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 35%, transparent);background:transparent}\n.mcp-badge.mcp-status-error{color:var(--dsw-alias-state-error-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 35%, transparent);background:transparent}\n.mcp-badge.mcp-status-disabled{color:var(--dsw-alias-label-dimmed);background:transparent}\n.mcp-form{display:flex;flex-direction:column;gap:12px}\n.mcp-field{display:flex;flex-direction:column;gap:5px;min-width:0}\n.mcp-field-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}\n.mcp-label{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:500;line-height:18px}\n.mcp-input,.mcp-select,.mcp-textarea{width:100%;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;outline:none;transition:border-color .12s ease,background .12s ease}\n.mcp-input,.mcp-select{height:34px;padding:0 10px}\n.mcp-textarea{min-height:76px;padding:8px 10px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:18px}\n.mcp-input:hover:not(:focus):not(:disabled),.mcp-select:hover:not(:focus):not(:disabled),.mcp-textarea:hover:not(:focus):not(:disabled){border-color:var(--dsw-alias-border-l3)}\n.mcp-input:focus,.mcp-select:focus,.mcp-textarea:focus{border-color:var(--dsw-alias-state-business-primary)}\n.mcp-input:read-only{background:transparent;border-color:transparent;color:var(--dsw-alias-label-tertiary)}\n.mcp-input::placeholder,.mcp-textarea::placeholder{color:var(--dsw-alias-label-dimmed)}\n.mcp-settings input[type=checkbox],.mcp-settings input[type=number]{accent-color:var(--dsw-alias-state-business-primary)}\n.mcp-checkbox{display:flex;align-items:flex-start;gap:8px;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}\n.mcp-checkbox input{margin-top:3px}\n.mcp-section{border-top:1px solid var(--dsw-alias-border-l1);padding-top:12px;display:flex;flex-direction:column;gap:9px}\n.mcp-section-title{margin:0;font-size:12px;font-weight:600;line-height:18px;color:var(--dsw-alias-label-secondary)}\n.mcp-secret-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) auto;gap:7px;align-items:center}\n.mcp-secret-row > *{min-width:0}\n.mcp-promotion-list{display:flex;flex-direction:column;gap:2px;max-height:240px;overflow:auto}\n.mcp-promotion{border-radius:8px;padding:8px 10px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:start;cursor:pointer;transition:background .12s ease}\n.mcp-promotion:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.mcp-promotion-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}\n.mcp-promotion-description{display:block;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:17px}\n.mcp-empty{padding:30px 20px;text-align:center;display:flex;align-items:center;flex-direction:column;gap:10px}\n.mcp-overlay{position:fixed;inset:0;background:var(--dsw-alias-bg-mask-1);display:flex;align-items:center;justify-content:center;padding:20px;z-index:1200;animation:mcp-fade .12s ease}\n.mcp-modal-card{width:min(560px,100%);max-height:min(760px,90vh);overflow:auto;padding:18px;display:flex;flex-direction:column;gap:13px;border:1px solid var(--dsw-alias-border-l1);border-radius:14px;background:var(--dsw-alias-bg-overlay);box-shadow:0 18px 60px rgba(0,0,0,.32);animation:mcp-pop .16s ease}\n@keyframes mcp-fade{from{opacity:0}to{opacity:1}}\n@keyframes mcp-pop{from{opacity:0;transform:translateY(6px) scale(.98)}to{opacity:1;transform:none}}\n.mcp-modal-title{margin:0;font-size:15px;line-height:22px;font-weight:600}\n.mcp-confirm{border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px;background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent)}\n@container (max-width:660px){.mcp-layout{grid-template-columns:minmax(0,1fr)}.mcp-sidebar{position:static;flex-direction:row;overflow-x:auto;padding-bottom:2px}.mcp-server-button{width:auto;flex:none;white-space:nowrap}}\n@container (max-width:480px){.mcp-field-row{grid-template-columns:minmax(0,1fr)}.mcp-secret-row{grid-template-columns:minmax(0,1fr) auto}.mcp-secret-row .mcp-input:first-child{grid-column:1 / -1}.mcp-card-head .mcp-actions{margin-left:0;width:100%}.mcp-toolbar{align-items:flex-start}}\n`\n\nexport function installMcpSettingsStyles() {\n const id = 'dsh-mcp-adapter-settings'\n const existing = document.querySelector(`style[data-plugin-css=\"${id}\"]`)\n if (existing !== null) return () => {}\n const style = document.createElement('style')\n style.dataset.pluginCss = id\n style.textContent = MCP_SETTINGS_CSS\n document.head.appendChild(style)\n return () => style.remove()\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0E;;;ACAnE,IAAM,yBAAyB;AAC/B,IAAM,kBAAkB;AAE/B,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;A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A,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,QAAQ,OAAO,EAAE,WAAW;AAAA,MAC9B;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["secretRows"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auggieteo/dsh-mcp-adapter",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "DSH plugin connecting the agent to MCP servers through one mcp proxy tool and a Settings > MCP page. Mirrors pi-mcp-adapter's major features.",
5
5
  "type": "module",
6
6
  "license": "MIT",