dsh-mcp 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.en.md +40 -1
- package/CHANGELOG.md +40 -1
- package/README.en.md +42 -15
- package/README.md +36 -13
- package/lib/client.js +383 -51
- package/lib/index.js +179 -14
- package/lib/oauth.js +187 -10
- package/lib/probe.js +7 -1
- package/lib/system-ca.js +166 -0
- package/lib/transport.js +16 -0
- package/package.json +2 -2
- package/scripts/build.mjs +21 -4
- package/scripts/test.mjs +1 -0
- package/src/client/GlobalEnvEditor.module.css +0 -69
- package/src/client/GlobalEnvEditor.tsx +11 -9
- package/src/client/McpSettingsSection.module.css +25 -36
- package/src/client/McpSettingsSection.tsx +228 -16
- package/src/client/ServerForm.module.css +22 -63
- package/src/client/ServerForm.tsx +92 -15
- package/src/client/ServersJsonEditor.module.css +0 -31
- package/src/client/ServersJsonEditor.tsx +3 -2
- package/src/client/ToolControlSection.module.css +2 -6
- package/src/client/ToolControlSection.tsx +4 -2
- package/src/client/controls.module.css +93 -0
- package/src/client/index.ts +27 -0
- package/src/client/locales.ts +28 -4
- package/src/client/remote-contribution.js +98 -0
- package/src/client/types.ts +49 -1
package/lib/client.js
CHANGED
|
@@ -14578,10 +14578,12 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema = external_export
|
|
|
14578
14578
|
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14579
14579
|
"failOnStartupError": external_exports.boolean().readonly(),
|
|
14580
14580
|
"oauth": external_exports.boolean().readonly().optional(),
|
|
14581
|
+
"oauthAuthorized": external_exports.boolean().readonly().optional(),
|
|
14581
14582
|
"status": external_exports.object({
|
|
14582
14583
|
"phase": external_exports.union([external_exports.literal("failed"), external_exports.literal("stopped"), external_exports.literal("mounting"), external_exports.literal("live")]).readonly(),
|
|
14583
14584
|
"tools": external_exports.array(external_exports.string()).readonly(),
|
|
14584
|
-
"error": external_exports.string().readonly().optional()
|
|
14585
|
+
"error": external_exports.string().readonly().optional(),
|
|
14586
|
+
"oauthRequired": external_exports.boolean().readonly().optional()
|
|
14585
14587
|
}).readonly(),
|
|
14586
14588
|
"source": external_exports.union([external_exports.literal("plugin"), external_exports.literal("cordis")]).readonly().optional(),
|
|
14587
14589
|
"readOnly": external_exports.boolean().readonly().optional(),
|
|
@@ -14642,7 +14644,8 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema = external_export
|
|
|
14642
14644
|
})).readonly()
|
|
14643
14645
|
}), external_exports.object({
|
|
14644
14646
|
"ok": external_exports.literal(false).readonly(),
|
|
14645
|
-
"message": external_exports.string().readonly()
|
|
14647
|
+
"message": external_exports.string().readonly(),
|
|
14648
|
+
"oauthRequired": external_exports.boolean().readonly().optional()
|
|
14646
14649
|
})]).readonly(),
|
|
14647
14650
|
"elapsedMs": external_exports.number().readonly()
|
|
14648
14651
|
});
|
|
@@ -14694,10 +14697,12 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema = external_expo
|
|
|
14694
14697
|
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14695
14698
|
"failOnStartupError": external_exports.boolean().readonly(),
|
|
14696
14699
|
"oauth": external_exports.boolean().readonly().optional(),
|
|
14700
|
+
"oauthAuthorized": external_exports.boolean().readonly().optional(),
|
|
14697
14701
|
"status": external_exports.object({
|
|
14698
14702
|
"phase": external_exports.union([external_exports.literal("failed"), external_exports.literal("stopped"), external_exports.literal("mounting"), external_exports.literal("live")]).readonly(),
|
|
14699
14703
|
"tools": external_exports.array(external_exports.string()).readonly(),
|
|
14700
|
-
"error": external_exports.string().readonly().optional()
|
|
14704
|
+
"error": external_exports.string().readonly().optional(),
|
|
14705
|
+
"oauthRequired": external_exports.boolean().readonly().optional()
|
|
14701
14706
|
}).readonly(),
|
|
14702
14707
|
"source": external_exports.union([external_exports.literal("plugin"), external_exports.literal("cordis")]).readonly().optional(),
|
|
14703
14708
|
"readOnly": external_exports.boolean().readonly().optional(),
|
|
@@ -14773,10 +14778,12 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema = external_
|
|
|
14773
14778
|
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14774
14779
|
"failOnStartupError": external_exports.boolean().readonly(),
|
|
14775
14780
|
"oauth": external_exports.boolean().readonly().optional(),
|
|
14781
|
+
"oauthAuthorized": external_exports.boolean().readonly().optional(),
|
|
14776
14782
|
"status": external_exports.object({
|
|
14777
14783
|
"phase": external_exports.union([external_exports.literal("failed"), external_exports.literal("stopped"), external_exports.literal("mounting"), external_exports.literal("live")]).readonly(),
|
|
14778
14784
|
"tools": external_exports.array(external_exports.string()).readonly(),
|
|
14779
|
-
"error": external_exports.string().readonly().optional()
|
|
14785
|
+
"error": external_exports.string().readonly().optional(),
|
|
14786
|
+
"oauthRequired": external_exports.boolean().readonly().optional()
|
|
14780
14787
|
}).readonly(),
|
|
14781
14788
|
"source": external_exports.union([external_exports.literal("plugin"), external_exports.literal("cordis")]).readonly().optional(),
|
|
14782
14789
|
"readOnly": external_exports.boolean().readonly().optional(),
|
|
@@ -14894,10 +14901,12 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema = external_expor
|
|
|
14894
14901
|
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14895
14902
|
"failOnStartupError": external_exports.boolean().readonly(),
|
|
14896
14903
|
"oauth": external_exports.boolean().readonly().optional(),
|
|
14904
|
+
"oauthAuthorized": external_exports.boolean().readonly().optional(),
|
|
14897
14905
|
"status": external_exports.object({
|
|
14898
14906
|
"phase": external_exports.union([external_exports.literal("failed"), external_exports.literal("stopped"), external_exports.literal("mounting"), external_exports.literal("live")]).readonly(),
|
|
14899
14907
|
"tools": external_exports.array(external_exports.string()).readonly(),
|
|
14900
|
-
"error": external_exports.string().readonly().optional()
|
|
14908
|
+
"error": external_exports.string().readonly().optional(),
|
|
14909
|
+
"oauthRequired": external_exports.boolean().readonly().optional()
|
|
14901
14910
|
}).readonly(),
|
|
14902
14911
|
"source": external_exports.union([external_exports.literal("plugin"), external_exports.literal("cordis")]).readonly().optional(),
|
|
14903
14912
|
"readOnly": external_exports.boolean().readonly().optional(),
|
|
@@ -14935,6 +14944,40 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema = external_exp
|
|
|
14935
14944
|
"message": external_exports.string().readonly()
|
|
14936
14945
|
}).readonly()
|
|
14937
14946
|
})]);
|
|
14947
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema = external_exports.object({
|
|
14948
|
+
"id": external_exports.intersection(external_exports.string(), external_exports.unknown()).readonly().optional(),
|
|
14949
|
+
"serverName": external_exports.string().readonly().optional(),
|
|
14950
|
+
"url": external_exports.string().readonly().optional()
|
|
14951
|
+
});
|
|
14952
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema = external_exports.union([external_exports.object({
|
|
14953
|
+
"ok": external_exports.literal(true).readonly(),
|
|
14954
|
+
"serverName": external_exports.string().readonly(),
|
|
14955
|
+
"url": external_exports.string().readonly()
|
|
14956
|
+
}), external_exports.object({
|
|
14957
|
+
"ok": external_exports.literal(false).readonly(),
|
|
14958
|
+
"error": external_exports.object({
|
|
14959
|
+
"code": external_exports.union([external_exports.literal("MCP_OAUTH_INVALID"), external_exports.literal("MCP_OAUTH_START_FAILED")]).readonly(),
|
|
14960
|
+
"message": external_exports.string().readonly()
|
|
14961
|
+
}).readonly()
|
|
14962
|
+
})]);
|
|
14963
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema = external_exports.object({
|
|
14964
|
+
"serverName": external_exports.string().readonly()
|
|
14965
|
+
});
|
|
14966
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema = external_exports.union([external_exports.object({
|
|
14967
|
+
"ok": external_exports.literal(true).readonly(),
|
|
14968
|
+
"serverName": external_exports.string().readonly(),
|
|
14969
|
+
"authorized": external_exports.boolean().readonly(),
|
|
14970
|
+
"pending": external_exports.boolean().readonly(),
|
|
14971
|
+
"url": external_exports.string().readonly().optional(),
|
|
14972
|
+
"expiresAt": external_exports.number().readonly().optional(),
|
|
14973
|
+
"error": external_exports.string().readonly().optional()
|
|
14974
|
+
}), external_exports.object({
|
|
14975
|
+
"ok": external_exports.literal(false).readonly(),
|
|
14976
|
+
"error": external_exports.object({
|
|
14977
|
+
"code": external_exports.literal("MCP_OAUTH_INVALID").readonly(),
|
|
14978
|
+
"message": external_exports.string().readonly()
|
|
14979
|
+
}).readonly()
|
|
14980
|
+
})]);
|
|
14938
14981
|
var TYPERT_REMOTE = {
|
|
14939
14982
|
package: "@deepseek-ai/dsh-mcp-manager",
|
|
14940
14983
|
descriptors: [
|
|
@@ -15225,6 +15268,60 @@ var TYPERT_REMOTE = {
|
|
|
15225
15268
|
create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema
|
|
15226
15269
|
},
|
|
15227
15270
|
sourceLocation: { "file": "lib/index.js" }
|
|
15271
|
+
},
|
|
15272
|
+
{
|
|
15273
|
+
id: "@deepseek-ai/dsh-mcp-manager#mcpManager/oauthStart",
|
|
15274
|
+
service: "mcpManager",
|
|
15275
|
+
namespace: "mcpManager",
|
|
15276
|
+
method: "oauthStart",
|
|
15277
|
+
invocation: { kind: "direct" },
|
|
15278
|
+
parameters: [
|
|
15279
|
+
{
|
|
15280
|
+
name: "request",
|
|
15281
|
+
wire: "request",
|
|
15282
|
+
source: "json",
|
|
15283
|
+
codec: {
|
|
15284
|
+
mode: "strict",
|
|
15285
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStartRequest",
|
|
15286
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema,
|
|
15287
|
+
create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema
|
|
15288
|
+
}
|
|
15289
|
+
}
|
|
15290
|
+
],
|
|
15291
|
+
result: {
|
|
15292
|
+
mode: "strict",
|
|
15293
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStartResult",
|
|
15294
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema,
|
|
15295
|
+
create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema
|
|
15296
|
+
},
|
|
15297
|
+
sourceLocation: { "file": "lib/index.js" }
|
|
15298
|
+
},
|
|
15299
|
+
{
|
|
15300
|
+
id: "@deepseek-ai/dsh-mcp-manager#mcpManager/oauthStatus",
|
|
15301
|
+
service: "mcpManager",
|
|
15302
|
+
namespace: "mcpManager",
|
|
15303
|
+
method: "oauthStatus",
|
|
15304
|
+
invocation: { kind: "direct" },
|
|
15305
|
+
parameters: [
|
|
15306
|
+
{
|
|
15307
|
+
name: "request",
|
|
15308
|
+
wire: "request",
|
|
15309
|
+
source: "json",
|
|
15310
|
+
codec: {
|
|
15311
|
+
mode: "strict",
|
|
15312
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStatusRequest",
|
|
15313
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema,
|
|
15314
|
+
create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema
|
|
15315
|
+
}
|
|
15316
|
+
}
|
|
15317
|
+
],
|
|
15318
|
+
result: {
|
|
15319
|
+
mode: "strict",
|
|
15320
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStatusResult",
|
|
15321
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema,
|
|
15322
|
+
create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema
|
|
15323
|
+
},
|
|
15324
|
+
sourceLocation: { "file": "lib/index.js" }
|
|
15228
15325
|
}
|
|
15229
15326
|
]
|
|
15230
15327
|
};
|
|
@@ -15410,6 +15507,21 @@ function createMcpManagerStore() {
|
|
|
15410
15507
|
});
|
|
15411
15508
|
}
|
|
15412
15509
|
|
|
15510
|
+
// src/client/controls.module.css
|
|
15511
|
+
(function() {
|
|
15512
|
+
if (typeof document !== "undefined") {
|
|
15513
|
+
const existing = document.querySelector('style[data-plugin="dsh-mcp"][data-file="controls.module.css"]');
|
|
15514
|
+
if (!existing) {
|
|
15515
|
+
const style = document.createElement("style");
|
|
15516
|
+
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15517
|
+
style.setAttribute("data-file", "controls.module.css");
|
|
15518
|
+
style.textContent = "/* Shared control styles for the client UI.\n *\n * Every `.module.css` in this package is injected into the host page's <head>\n * verbatim \u2014 the build's class map is the identity, so there is no scoping\n * boundary and a class name is global. Two consequences:\n *\n * 1. Elements are styled by class only, never by tag. A bare `button` /\n * `input` selector would restyle the host shell (issue #14: the composer's\n * icon buttons lost their centering to a leaked `padding: 5px 12px`).\n * 2. Each class below is defined **exactly here**, once. Another stylesheet\n * re-defining `.button` would silently change every control in the plugin,\n * so components import this module only for the class *names* and keep\n * their layout/variant rules in their own file.\n */\n\n.button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\n.button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.button:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n.button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n/* Compact action, e.g. the inline \"retry\" button of the global-env editor. */\n.buttonSmall {\n padding: 3px 10px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n/* Text controls: one class for <input>, <select> and <textarea>, so no rule\n has to name an element. */\n.control {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 6px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n resize: vertical;\n}\n\n.control::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.control:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n/* Denser monospace variant: the env rows of the global-env editor. */\n.controlMono {\n border-radius: 6px;\n padding: 5px 8px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n\n.checkbox {\n cursor: pointer;\n}\n";
|
|
15519
|
+
document.head.appendChild(style);
|
|
15520
|
+
}
|
|
15521
|
+
}
|
|
15522
|
+
})();
|
|
15523
|
+
var controls_default = { "button": "button", "buttonSmall": "buttonSmall", "primary": "primary", "control": "control", "controlMono": "controlMono", "checkbox": "checkbox" };
|
|
15524
|
+
|
|
15413
15525
|
// src/client/ServerForm.module.css
|
|
15414
15526
|
(function() {
|
|
15415
15527
|
if (typeof document !== "undefined") {
|
|
@@ -15418,28 +15530,61 @@ function createMcpManagerStore() {
|
|
|
15418
15530
|
const style = document.createElement("style");
|
|
15419
15531
|
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15420
15532
|
style.setAttribute("data-file", "ServerForm.module.css");
|
|
15421
|
-
style.textContent = ".form {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.titleActions {\n display: flex;\n gap: 8px;\n}\n\
|
|
15533
|
+
style.textContent = ".form {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.titleActions {\n display: flex;\n gap: 8px;\n}\n\n/* Control styling lives in class form in ./controls.module.css; this module\n only keeps its own layout and modifiers, and it must never match an element\n by tag (the sheets are injected into the host page globally, issue #14). */\n\n.danger {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.checkRow {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n\n.testResult {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n}\n\n.testOk {\n color: var(--dsw-alias-state-success-primary);\n}\n\n.testFail {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.oauthWaiting {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.oauthOk {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-success-primary);\n}\n\n.oauthRequired {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
|
|
15422
15534
|
document.head.appendChild(style);
|
|
15423
15535
|
}
|
|
15424
15536
|
}
|
|
15425
15537
|
})();
|
|
15426
|
-
var ServerForm_default = { "form": "form", "titleRow": "titleRow", "title": "title", "titleActions": "titleActions", "
|
|
15538
|
+
var ServerForm_default = { "form": "form", "titleRow": "titleRow", "title": "title", "titleActions": "titleActions", "danger": "danger", "error": "error", "field": "field", "hint": "hint", "muted": "muted", "checkRow": "checkRow", "testResult": "testResult", "testOk": "testOk", "testFail": "testFail", "oauthWaiting": "oauthWaiting", "oauthOk": "oauthOk", "oauthRequired": "oauthRequired", "actions": "actions" };
|
|
15427
15539
|
|
|
15428
15540
|
// src/client/ServerForm.tsx
|
|
15429
15541
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
15542
|
+
var OAUTH_POLL_MS = 5e3;
|
|
15430
15543
|
function McpServerForm(props) {
|
|
15431
15544
|
const { draft, busy, testRunning, test, t, actions, injected, onSaved } = props;
|
|
15432
15545
|
const [saveError, setSaveError] = (0, import_react.useState)(null);
|
|
15546
|
+
const [oauthPhase, setOauthPhase] = (0, import_react.useState)("idle");
|
|
15547
|
+
const injectedRef = (0, import_react.useRef)(injected);
|
|
15548
|
+
injectedRef.current = injected;
|
|
15433
15549
|
const update = (patch) => {
|
|
15434
15550
|
setSaveError(null);
|
|
15435
15551
|
actions.updateDraft(patch);
|
|
15436
15552
|
};
|
|
15553
|
+
(0, import_react.useEffect)(() => {
|
|
15554
|
+
setOauthPhase("idle");
|
|
15555
|
+
}, [draft.id, draft.serverName]);
|
|
15556
|
+
(0, import_react.useEffect)(() => {
|
|
15557
|
+
if (oauthPhase !== "waiting") return;
|
|
15558
|
+
const serverName = draft.serverName.trim();
|
|
15559
|
+
if (serverName.length === 0) return;
|
|
15560
|
+
let cancelled = false;
|
|
15561
|
+
const tick = async () => {
|
|
15562
|
+
try {
|
|
15563
|
+
const status = await injectedRef.current.oauthStatus(serverName);
|
|
15564
|
+
if (cancelled) return;
|
|
15565
|
+
if (status.authorized) setOauthPhase("authorized");
|
|
15566
|
+
else if (!status.pending) setOauthPhase("idle");
|
|
15567
|
+
} catch (error51) {
|
|
15568
|
+
console.error("[dsh-mcp] oauthStatus failed:", error51);
|
|
15569
|
+
}
|
|
15570
|
+
};
|
|
15571
|
+
void tick();
|
|
15572
|
+
const timer = window.setInterval(() => {
|
|
15573
|
+
void tick();
|
|
15574
|
+
}, OAUTH_POLL_MS);
|
|
15575
|
+
return () => {
|
|
15576
|
+
cancelled = true;
|
|
15577
|
+
window.clearInterval(timer);
|
|
15578
|
+
};
|
|
15579
|
+
}, [oauthPhase, draft.serverName]);
|
|
15437
15580
|
const errorText = (error51) => error51 instanceof Error ? error51.message : String(error51);
|
|
15438
15581
|
const runTest = async () => {
|
|
15439
15582
|
setSaveError(null);
|
|
15440
15583
|
actions.setTestRunning(true);
|
|
15441
15584
|
try {
|
|
15442
|
-
|
|
15585
|
+
const outcome = await injected.test(draft);
|
|
15586
|
+
actions.setTest(outcome);
|
|
15587
|
+
if (outcome.probe.ok === false && outcome.probe.oauthRequired === true) setOauthPhase("waiting");
|
|
15443
15588
|
} catch (error51) {
|
|
15444
15589
|
console.error("[dsh-mcp] test failed:", error51);
|
|
15445
15590
|
actions.setTest(null);
|
|
@@ -15505,8 +15650,8 @@ function McpServerForm(props) {
|
|
|
15505
15650
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.titleRow, children: [
|
|
15506
15651
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: ServerForm_default.title, children: draft.id === null ? t("newTitle") : t("editTitle") }),
|
|
15507
15652
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.titleActions, children: [
|
|
15508
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => actions.cancelEdit(), children: t("backToList") }),
|
|
15509
|
-
draft.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: ServerForm_default.danger
|
|
15653
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, onClick: () => actions.cancelEdit(), children: t("backToList") }),
|
|
15654
|
+
draft.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: `${controls_default.button} ${ServerForm_default.danger}`, disabled: busy !== null, onClick: () => void removeServer(), children: busy === "remove" ? t("removing") : t("remove") }) : null
|
|
15510
15655
|
] })
|
|
15511
15656
|
] }),
|
|
15512
15657
|
saveError !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.error, role: "alert", children: saveError }) : null,
|
|
@@ -15516,6 +15661,7 @@ function McpServerForm(props) {
|
|
|
15516
15661
|
"input",
|
|
15517
15662
|
{
|
|
15518
15663
|
type: "text",
|
|
15664
|
+
className: controls_default.control,
|
|
15519
15665
|
value: draft.serverName,
|
|
15520
15666
|
placeholder: t("serverNameHint"),
|
|
15521
15667
|
onChange: (event) => update({ serverName: event.currentTarget.value })
|
|
@@ -15527,6 +15673,7 @@ function McpServerForm(props) {
|
|
|
15527
15673
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
15528
15674
|
"select",
|
|
15529
15675
|
{
|
|
15676
|
+
className: controls_default.control,
|
|
15530
15677
|
value: draft.transport,
|
|
15531
15678
|
onChange: (event) => update({ transport: event.currentTarget.value }),
|
|
15532
15679
|
children: [
|
|
@@ -15543,6 +15690,7 @@ function McpServerForm(props) {
|
|
|
15543
15690
|
"input",
|
|
15544
15691
|
{
|
|
15545
15692
|
type: "text",
|
|
15693
|
+
className: controls_default.control,
|
|
15546
15694
|
value: draft.command,
|
|
15547
15695
|
placeholder: t("commandPlaceholder"),
|
|
15548
15696
|
onChange: (event) => update({ command: event.currentTarget.value })
|
|
@@ -15554,6 +15702,7 @@ function McpServerForm(props) {
|
|
|
15554
15702
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15555
15703
|
"textarea",
|
|
15556
15704
|
{
|
|
15705
|
+
className: controls_default.control,
|
|
15557
15706
|
rows: 3,
|
|
15558
15707
|
value: draft.argsText,
|
|
15559
15708
|
placeholder: t("argsPlaceholder"),
|
|
@@ -15579,6 +15728,7 @@ function McpServerForm(props) {
|
|
|
15579
15728
|
"input",
|
|
15580
15729
|
{
|
|
15581
15730
|
type: "text",
|
|
15731
|
+
className: controls_default.control,
|
|
15582
15732
|
value: draft.cwd,
|
|
15583
15733
|
placeholder: t("cwdPlaceholder"),
|
|
15584
15734
|
onChange: (event) => update({ cwd: event.currentTarget.value })
|
|
@@ -15593,6 +15743,7 @@ function McpServerForm(props) {
|
|
|
15593
15743
|
"input",
|
|
15594
15744
|
{
|
|
15595
15745
|
type: "url",
|
|
15746
|
+
className: controls_default.control,
|
|
15596
15747
|
value: draft.url,
|
|
15597
15748
|
placeholder: t("urlPlaceholder"),
|
|
15598
15749
|
onChange: (event) => update({ url: event.currentTarget.value })
|
|
@@ -15604,6 +15755,7 @@ function McpServerForm(props) {
|
|
|
15604
15755
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15605
15756
|
"textarea",
|
|
15606
15757
|
{
|
|
15758
|
+
className: controls_default.control,
|
|
15607
15759
|
rows: 2,
|
|
15608
15760
|
value: draft.headersText,
|
|
15609
15761
|
placeholder: t("headersPlaceholder"),
|
|
@@ -15618,6 +15770,7 @@ function McpServerForm(props) {
|
|
|
15618
15770
|
"input",
|
|
15619
15771
|
{
|
|
15620
15772
|
type: "number",
|
|
15773
|
+
className: controls_default.control,
|
|
15621
15774
|
min: 1,
|
|
15622
15775
|
value: draft.toolCallTimeoutMs,
|
|
15623
15776
|
onChange: (event) => update({ toolCallTimeoutMs: event.currentTarget.value })
|
|
@@ -15636,6 +15789,7 @@ function McpServerForm(props) {
|
|
|
15636
15789
|
t("oauthAuth")
|
|
15637
15790
|
] }),
|
|
15638
15791
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.hint, children: t("oauthAuthHint") }),
|
|
15792
|
+
draft.oauth && !stdio && oauthPhase !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: oauthPhase === "authorized" ? ServerForm_default.oauthOk : ServerForm_default.oauthWaiting, role: "status", children: oauthPhase === "authorized" ? t("oauthAuthorized") : t("oauthWaiting") }) : null,
|
|
15639
15793
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.checkRow, children: [
|
|
15640
15794
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15641
15795
|
"input",
|
|
@@ -15658,12 +15812,16 @@ function McpServerForm(props) {
|
|
|
15658
15812
|
),
|
|
15659
15813
|
t("enabled")
|
|
15660
15814
|
] }),
|
|
15661
|
-
test !== null ?
|
|
15815
|
+
test !== null ? probe !== void 0 && !probe.ok && probe.oauthRequired === true ? (
|
|
15816
|
+
// Pending authorization is a waiting state, not a failure; once
|
|
15817
|
+
// authorized the panel above reports success and this clears.
|
|
15818
|
+
oauthPhase === "authorized" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.oauthRequired, role: "status", children: t("oauthRequired") })
|
|
15819
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `${ServerForm_default.testResult} ${probe !== void 0 && probe.ok ? ServerForm_default.testOk : ServerForm_default.testFail}`, role: "status", children: probe !== void 0 && probe.ok ? `${t("testOk")} (${probe.tools.length} ${t("toolCount")}, ${test.elapsedMs}ms)` : probe !== void 0 && !probe.ok ? `${t("testFail")}: ${probe.message}` : t("testUnknown") }) : null,
|
|
15662
15820
|
testRunning && draft.transport === "streamable-http" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.muted, role: "status", children: t("testBrowserHint") }) : null,
|
|
15663
15821
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.actions, children: [
|
|
15664
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: testRunning || busy !== null, onClick: () => void runTest(), children: testRunning ? t("testRunning") : t("test") }),
|
|
15665
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit", className:
|
|
15666
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy !== null, onClick: () => actions.cancelEdit(), children: t("cancel") })
|
|
15822
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, disabled: testRunning || busy !== null, onClick: () => void runTest(), children: testRunning ? t("testRunning") : t("test") }),
|
|
15823
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit", className: `${controls_default.button} ${controls_default.primary}`, disabled: busy !== null || testRunning, children: busy === "save" ? t("saving") : t("save") }),
|
|
15824
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: controls_default.button, disabled: busy !== null, onClick: () => actions.cancelEdit(), children: t("cancel") })
|
|
15667
15825
|
] })
|
|
15668
15826
|
] });
|
|
15669
15827
|
}
|
|
@@ -15679,12 +15837,12 @@ var import_react2 = require("react");
|
|
|
15679
15837
|
const style = document.createElement("style");
|
|
15680
15838
|
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15681
15839
|
style.setAttribute("data-file", "ServersJsonEditor.module.css");
|
|
15682
|
-
style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.editor {\n width: 100%;\n box-sizing: border-box;\n min-height: 260px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.editor:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n
|
|
15840
|
+
style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.editor {\n width: 100%;\n box-sizing: border-box;\n min-height: 260px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.editor:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
|
|
15683
15841
|
document.head.appendChild(style);
|
|
15684
15842
|
}
|
|
15685
15843
|
}
|
|
15686
15844
|
})();
|
|
15687
|
-
var ServersJsonEditor_default = { "panel": "panel", "editor": "editor", "hint": "hint", "error": "error", "notice": "notice", "actions": "actions"
|
|
15845
|
+
var ServersJsonEditor_default = { "panel": "panel", "editor": "editor", "hint": "hint", "error": "error", "notice": "notice", "actions": "actions" };
|
|
15688
15846
|
|
|
15689
15847
|
// src/client/ServersJsonEditor.tsx
|
|
15690
15848
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -15865,8 +16023,8 @@ function ServersJsonEditor({ injected, t, onApplied }) {
|
|
|
15865
16023
|
error51 !== null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.error, role: "alert", children: error51 }) : null,
|
|
15866
16024
|
notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.notice, role: "status", children: notice }) : null,
|
|
15867
16025
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: ServersJsonEditor_default.actions, children: [
|
|
15868
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: reseed, children: t("serversJsonReseed") }),
|
|
15869
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className:
|
|
16026
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: controls_default.button, disabled: busy, onClick: reseed, children: t("serversJsonReseed") }),
|
|
16027
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, disabled: busy, onClick: apply2, children: busy ? t("serversJsonSaving") : t("serversJsonApply") })
|
|
15870
16028
|
] })
|
|
15871
16029
|
] });
|
|
15872
16030
|
}
|
|
@@ -15882,12 +16040,12 @@ var import_react3 = require("react");
|
|
|
15882
16040
|
const style = document.createElement("style");
|
|
15883
16041
|
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15884
16042
|
style.setAttribute("data-file", "GlobalEnvEditor.module.css");
|
|
15885
|
-
style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.row {\n display: grid;\n grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) auto auto;\n align-items: center;\n gap: 8px;\n}\n\n.
|
|
16043
|
+
style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.row {\n display: grid;\n grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) auto auto;\n align-items: center;\n gap: 8px;\n}\n\n.name {\n width: 100%;\n}\n\n.value {\n width: 100%;\n}\n\n.secretToggle {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n}\n\n.secretToggle.secretOn {\n color: var(--dsw-alias-brand-primary);\n font-weight: 600;\n}\n\n.danger {\n border: 1px solid transparent !important;\n background: transparent !important;\n color: var(--dsw-alias-state-error-primary) !important;\n cursor: pointer;\n}\n\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.4);\n}\n\n.dialog {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: min(520px, calc(100vw - 48px));\n max-height: 80vh;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 12px;\n padding: 16px;\n background: var(--dsw-alias-bg-overlay);\n box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);\n}\n\n.dialogTitle {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n\n.bulkText {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.bulkText:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.retryRow {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
|
|
15886
16044
|
document.head.appendChild(style);
|
|
15887
16045
|
}
|
|
15888
16046
|
}
|
|
15889
16047
|
})();
|
|
15890
|
-
var GlobalEnvEditor_default = { "panel": "panel", "hint": "hint", "muted": "muted", "row": "row", "name": "name", "value": "value", "secretToggle": "secretToggle", "secretOn": "secretOn", "danger": "danger", "overlay": "overlay", "dialog": "dialog", "dialogTitle": "dialogTitle", "bulkText": "bulkText", "retryRow": "retryRow", "error": "error", "notice": "notice", "actions": "actions"
|
|
16048
|
+
var GlobalEnvEditor_default = { "panel": "panel", "hint": "hint", "muted": "muted", "row": "row", "name": "name", "value": "value", "secretToggle": "secretToggle", "secretOn": "secretOn", "danger": "danger", "overlay": "overlay", "dialog": "dialog", "dialogTitle": "dialogTitle", "bulkText": "bulkText", "retryRow": "retryRow", "error": "error", "notice": "notice", "actions": "actions" };
|
|
15891
16049
|
|
|
15892
16050
|
// src/client/GlobalEnvEditor.tsx
|
|
15893
16051
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -16029,7 +16187,7 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
|
16029
16187
|
"input",
|
|
16030
16188
|
{
|
|
16031
16189
|
type: "text",
|
|
16032
|
-
className: GlobalEnvEditor_default.name
|
|
16190
|
+
className: `${controls_default.control} ${controls_default.controlMono} ${GlobalEnvEditor_default.name}`,
|
|
16033
16191
|
value: row.name,
|
|
16034
16192
|
placeholder: t("globalEnvName"),
|
|
16035
16193
|
"aria-label": t("globalEnvName"),
|
|
@@ -16040,7 +16198,7 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
|
16040
16198
|
"input",
|
|
16041
16199
|
{
|
|
16042
16200
|
type: row.secret ? "password" : "text",
|
|
16043
|
-
className: GlobalEnvEditor_default.value
|
|
16201
|
+
className: `${controls_default.control} ${controls_default.controlMono} ${GlobalEnvEditor_default.value}`,
|
|
16044
16202
|
value: row.value,
|
|
16045
16203
|
placeholder: row.secret && row.configured ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : t("globalEnvValue"),
|
|
16046
16204
|
"aria-label": t("globalEnvValue"),
|
|
@@ -16052,6 +16210,7 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
|
16052
16210
|
"input",
|
|
16053
16211
|
{
|
|
16054
16212
|
type: "checkbox",
|
|
16213
|
+
className: controls_default.checkbox,
|
|
16055
16214
|
checked: row.secret,
|
|
16056
16215
|
"aria-label": t("globalEnvSecret"),
|
|
16057
16216
|
onChange: (event) => update(row.key, { secret: event.currentTarget.checked })
|
|
@@ -16059,18 +16218,18 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
|
16059
16218
|
),
|
|
16060
16219
|
t("globalEnvSecret")
|
|
16061
16220
|
] }),
|
|
16062
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.danger
|
|
16221
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${GlobalEnvEditor_default.danger}`, "aria-label": t("globalEnvRemove"), onClick: () => remove(row.key), children: "\u2715" })
|
|
16063
16222
|
] }, row.key)),
|
|
16064
16223
|
loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.retryRow, children: [
|
|
16065
16224
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.error, role: "alert", children: t("globalEnvLoadFailed") }),
|
|
16066
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: reload, children: t("globalEnvRetry") })
|
|
16225
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.buttonSmall}`, onClick: reload, children: t("globalEnvRetry") })
|
|
16067
16226
|
] }) : null,
|
|
16068
16227
|
error51 !== null && !loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.error, role: "alert", children: error51 }) : null,
|
|
16069
16228
|
notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.notice, role: "status", children: notice }) : null,
|
|
16070
16229
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.actions, children: [
|
|
16071
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: busy, onClick: add, children: t("globalEnvAdd") }),
|
|
16072
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: busy, onClick: () => setBulkOpen(true), children: t("globalEnvBulk") }),
|
|
16073
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className:
|
|
16230
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: controls_default.button, disabled: busy, onClick: add, children: t("globalEnvAdd") }),
|
|
16231
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: controls_default.button, disabled: busy, onClick: () => setBulkOpen(true), children: t("globalEnvBulk") }),
|
|
16232
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, disabled: busy, onClick: save, children: busy ? t("globalEnvSaving") : t("globalEnvSave") })
|
|
16074
16233
|
] }),
|
|
16075
16234
|
bulkOpen ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: GlobalEnvEditor_default.overlay, onClick: () => setBulkOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.dialog, role: "dialog", "aria-label": t("globalEnvBulk"), onClick: (event) => event.stopPropagation(), children: [
|
|
16076
16235
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.dialogTitle, children: t("globalEnvBulk") }),
|
|
@@ -16087,8 +16246,8 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
|
16087
16246
|
}
|
|
16088
16247
|
),
|
|
16089
16248
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.actions, children: [
|
|
16090
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => setBulkOpen(false), children: t("cancel") }),
|
|
16091
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className:
|
|
16249
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: controls_default.button, onClick: () => setBulkOpen(false), children: t("cancel") }),
|
|
16250
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, onClick: applyBulk, children: t("globalEnvBulkOk") })
|
|
16092
16251
|
] })
|
|
16093
16252
|
] }) }) : null
|
|
16094
16253
|
] });
|
|
@@ -16102,12 +16261,12 @@ function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
|
16102
16261
|
const style = document.createElement("style");
|
|
16103
16262
|
style.setAttribute("data-plugin", "dsh-mcp");
|
|
16104
16263
|
style.setAttribute("data-file", "McpSettingsSection.module.css");
|
|
16105
|
-
style.textContent = ".section {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.status,\n.
|
|
16264
|
+
style.textContent = ".section {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.status,\n.failureText {\n margin: 0;\n}\n\n.status,\n.failure {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.failure {\n display: flex;\n align-items: center;\n gap: 10px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* Control styling lives in class form in ./controls.module.css; these are the\n section's own variants. No rule may match an element by tag: the sheets are\n injected into the host page globally (issue #14). */\n\n.active {\n border-color: var(--dsw-alias-brand-primary);\n color: var(--dsw-alias-brand-primary);\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);\n}\n\n.module {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.moduleTitle {\n display: inline-flex !important;\n align-items: center;\n gap: 6px;\n width: fit-content;\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary) !important;\n}\n\n.moduleTitle:hover {\n background: transparent !important;\n}\n\n.caret {\n display: inline-block;\n width: 14px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.configHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.configActions {\n display: flex;\n gap: 8px;\n}\n\n.inlineForm {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n}\n\n.inlineFormItem {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n list-style: none;\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.row {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 12px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.rowMain {\n display: flex;\n flex: 1 1 320px;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.rowTitle {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n\n.serverName {\n overflow: hidden;\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n flex: none;\n min-height: 18px;\n border-radius: 5px;\n padding: 1px 6px;\n font-size: 11px;\n line-height: 16px;\n white-space: nowrap;\n}\n\n.badge.mounting {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.badge.live {\n background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent);\n color: var(--dsw-alias-state-success-primary);\n}\n\n.badge.failed {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.badge.stopped {\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-tertiary);\n}\n\n.badge.cordis {\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent);\n color: var(--dsw-alias-brand-primary);\n}\n\n.badge.oauth {\n background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent);\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.badge.oauthMiss {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* The authorization button of an unauthorized OAuth server: red, so the\n missing authorization is visible without any warning text. */\n.dangerButton {\n border-color: var(--dsw-alias-state-error-primary);\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dangerButton:hover {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);\n}\n\n.note {\n margin: 6px 0 0;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.warn {\n margin: 6px 0 0;\n color: var(--dsw-alias-state-warn-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.path {\n margin: 4px 0 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n overflow-wrap: anywhere;\n}\n\n.muted {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.rowMeta {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 14px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n}\n\n.rowActions {\n display: flex;\n flex: none;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-left: auto;\n}\n\n.card {\n display: flex;\n flex-direction: column;\n gap: 0;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.card > .row {\n border: 0;\n border-radius: 0;\n background: transparent;\n}\n\n.modeRow {\n display: flex;\n align-items: center;\n gap: 18px;\n flex-wrap: wrap;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 8px 14px;\n background: var(--dsw-alias-bg-layer-3);\n font-size: 13px;\n line-height: 20px;\n}\n\n.modeLabel {\n font-weight: 600;\n}\n\n.modeOption {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n}\n\n.modeHint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.toolPanel {\n border-top: 1px solid var(--dsw-alias-border-l2);\n padding: 10px 14px;\n}\n\n.toolGrid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));\n gap: 4px 14px;\n max-height: 320px;\n overflow-y: auto;\n}\n\n.toolRow {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n padding: 2px 0;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n}\n\n.toolName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
|
|
16106
16265
|
document.head.appendChild(style);
|
|
16107
16266
|
}
|
|
16108
16267
|
}
|
|
16109
16268
|
})();
|
|
16110
|
-
var McpSettingsSection_default = { "section": "section", "header": "header", "status": "status", "
|
|
16269
|
+
var McpSettingsSection_default = { "section": "section", "header": "header", "status": "status", "failureText": "failureText", "failure": "failure", "active": "active", "module": "module", "moduleTitle": "moduleTitle", "caret": "caret", "configHeader": "configHeader", "configActions": "configActions", "inlineForm": "inlineForm", "inlineFormItem": "inlineFormItem", "list": "list", "row": "row", "rowMain": "rowMain", "rowTitle": "rowTitle", "serverName": "serverName", "badge": "badge", "mounting": "mounting", "live": "live", "failed": "failed", "stopped": "stopped", "cordis": "cordis", "oauth": "oauth", "oauthMiss": "oauthMiss", "dangerButton": "dangerButton", "note": "note", "warn": "warn", "path": "path", "muted": "muted", "rowMeta": "rowMeta", "rowActions": "rowActions", "card": "card", "modeRow": "modeRow", "modeLabel": "modeLabel", "modeOption": "modeOption", "modeHint": "modeHint", "toolPanel": "toolPanel", "toolGrid": "toolGrid", "toolRow": "toolRow", "toolName": "toolName" };
|
|
16111
16270
|
|
|
16112
16271
|
// src/client/McpSettingsSection.tsx
|
|
16113
16272
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -16145,7 +16304,7 @@ function viewToDraft(server) {
|
|
|
16145
16304
|
};
|
|
16146
16305
|
}
|
|
16147
16306
|
function McpSettingsSection(props) {
|
|
16148
|
-
const { list, save, remove, test, adopt, release } = props;
|
|
16307
|
+
const { list, save, remove, test, adopt, release, oauthStart, oauthStatus } = props;
|
|
16149
16308
|
const state = props.useStore((snapshot) => snapshot);
|
|
16150
16309
|
const { setLoadState, setServers, beginCreate, beginEdit, cancelEdit, updateDraft, setBusy, setTestRunning, setTest } = props.actions;
|
|
16151
16310
|
const t = props.t;
|
|
@@ -16158,9 +16317,19 @@ function McpSettingsSection(props) {
|
|
|
16158
16317
|
const [jsonOpen, setJsonOpen] = (0, import_react4.useState)(false);
|
|
16159
16318
|
const [envOpen, setEnvOpen] = (0, import_react4.useState)(true);
|
|
16160
16319
|
const [adopting, setAdopting] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
|
|
16320
|
+
const [oauthWaiting, setOauthWaiting] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
|
|
16321
|
+
const [oauthStarting, setOauthStarting] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
|
|
16322
|
+
const [oauthLinks, setOauthLinks] = (0, import_react4.useState)(() => /* @__PURE__ */ new Map());
|
|
16323
|
+
const [oauthErrors, setOauthErrors] = (0, import_react4.useState)(() => /* @__PURE__ */ new Map());
|
|
16324
|
+
const [oauthIncomplete, setOauthIncomplete] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
|
|
16161
16325
|
const [actionError, setActionError] = (0, import_react4.useState)(null);
|
|
16162
16326
|
const [actionNotice, setActionNotice] = (0, import_react4.useState)(null);
|
|
16163
16327
|
const timersRef = (0, import_react4.useRef)([]);
|
|
16328
|
+
const oauthStoppedRef = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
|
|
16329
|
+
const oauthStatusRef = (0, import_react4.useRef)(oauthStatus);
|
|
16330
|
+
oauthStatusRef.current = oauthStatus;
|
|
16331
|
+
const tRef = (0, import_react4.useRef)(t);
|
|
16332
|
+
tRef.current = t;
|
|
16164
16333
|
let inlineForm = null;
|
|
16165
16334
|
(0, import_react4.useEffect)(() => () => {
|
|
16166
16335
|
for (const id of timersRef.current) window.clearTimeout(id);
|
|
@@ -16273,6 +16442,68 @@ function McpSettingsSection(props) {
|
|
|
16273
16442
|
return next;
|
|
16274
16443
|
});
|
|
16275
16444
|
};
|
|
16445
|
+
const hostPendingOAuth = state.servers.filter((server) => server.oauth === true && server.status.oauthRequired === true && server.oauthAuthorized !== true && !oauthStoppedRef.current.has(server.serverName)).map((server) => server.serverName);
|
|
16446
|
+
const pollKey = [.../* @__PURE__ */ new Set([...oauthWaiting, ...hostPendingOAuth])].sort().join(",");
|
|
16447
|
+
(0, import_react4.useEffect)(() => {
|
|
16448
|
+
if (pollKey.length === 0) return;
|
|
16449
|
+
const names = pollKey.split(",");
|
|
16450
|
+
let cancelled = false;
|
|
16451
|
+
const tick = async () => {
|
|
16452
|
+
const results = await Promise.all(names.map(async (name) => {
|
|
16453
|
+
try {
|
|
16454
|
+
return { name, status: await oauthStatusRef.current(name) };
|
|
16455
|
+
} catch (error51) {
|
|
16456
|
+
console.error("[dsh-mcp] oauthStatus failed:", error51);
|
|
16457
|
+
return { name, status: null };
|
|
16458
|
+
}
|
|
16459
|
+
}));
|
|
16460
|
+
if (cancelled) return;
|
|
16461
|
+
const authorized = results.filter((entry) => entry.status?.authorized === true).map((entry) => entry.name);
|
|
16462
|
+
const failed = results.filter((entry) => entry.status !== null && !entry.status.authorized && entry.status.error !== void 0).map((entry) => ({ name: entry.name, error: entry.status?.error ?? "" }));
|
|
16463
|
+
const gone = results.filter((entry) => entry.status !== null && !entry.status.authorized && entry.status.error === void 0 && !entry.status.pending).map((entry) => entry.name);
|
|
16464
|
+
for (const entry of failed) {
|
|
16465
|
+
oauthStoppedRef.current.add(entry.name);
|
|
16466
|
+
setOauthErrors((prev) => new Map(prev).set(entry.name, entry.error));
|
|
16467
|
+
}
|
|
16468
|
+
for (const name of gone) {
|
|
16469
|
+
oauthStoppedRef.current.add(name);
|
|
16470
|
+
setOauthIncomplete((prev) => new Set(prev).add(name));
|
|
16471
|
+
}
|
|
16472
|
+
const finished = /* @__PURE__ */ new Set([
|
|
16473
|
+
...authorized,
|
|
16474
|
+
...failed.map((entry) => entry.name),
|
|
16475
|
+
...gone
|
|
16476
|
+
]);
|
|
16477
|
+
if (finished.size === 0) return;
|
|
16478
|
+
setOauthWaiting((prev) => {
|
|
16479
|
+
const next = new Set(prev);
|
|
16480
|
+
for (const name of finished) next.delete(name);
|
|
16481
|
+
return next;
|
|
16482
|
+
});
|
|
16483
|
+
if (authorized.length === 0) return;
|
|
16484
|
+
setOauthErrors((prev) => {
|
|
16485
|
+
const next = new Map(prev);
|
|
16486
|
+
for (const name of authorized) next.delete(name);
|
|
16487
|
+
return next;
|
|
16488
|
+
});
|
|
16489
|
+
setOauthIncomplete((prev) => {
|
|
16490
|
+
const next = new Set(prev);
|
|
16491
|
+
for (const name of authorized) next.delete(name);
|
|
16492
|
+
return next;
|
|
16493
|
+
});
|
|
16494
|
+
setActionError(null);
|
|
16495
|
+
setActionNotice(tRef.current("oauthAuthorized"));
|
|
16496
|
+
refreshServer("");
|
|
16497
|
+
};
|
|
16498
|
+
void tick();
|
|
16499
|
+
const timer = window.setInterval(() => {
|
|
16500
|
+
void tick();
|
|
16501
|
+
}, OAUTH_POLL_MS);
|
|
16502
|
+
return () => {
|
|
16503
|
+
cancelled = true;
|
|
16504
|
+
window.clearInterval(timer);
|
|
16505
|
+
};
|
|
16506
|
+
}, [pollKey]);
|
|
16276
16507
|
const runAdopt = async (server) => {
|
|
16277
16508
|
const giveBack = server.adopted === true;
|
|
16278
16509
|
const confirmKey = giveBack ? server.needsPlugin === true ? "releaseConfirmNeedsPlugin" : "releaseConfirm" : "adoptConfirm";
|
|
@@ -16295,6 +16526,35 @@ function McpSettingsSection(props) {
|
|
|
16295
16526
|
load();
|
|
16296
16527
|
}
|
|
16297
16528
|
};
|
|
16529
|
+
const runOAuth = async (server) => {
|
|
16530
|
+
setActionError(null);
|
|
16531
|
+
setActionNotice(null);
|
|
16532
|
+
oauthStoppedRef.current.delete(server.serverName);
|
|
16533
|
+
setOauthErrors((prev) => {
|
|
16534
|
+
const next = new Map(prev);
|
|
16535
|
+
next.delete(server.serverName);
|
|
16536
|
+
return next;
|
|
16537
|
+
});
|
|
16538
|
+
setOauthIncomplete((prev) => {
|
|
16539
|
+
const next = new Set(prev);
|
|
16540
|
+
next.delete(server.serverName);
|
|
16541
|
+
return next;
|
|
16542
|
+
});
|
|
16543
|
+
setOauthStarting((prev) => new Set(prev).add(server.serverName));
|
|
16544
|
+
try {
|
|
16545
|
+
const url2 = await oauthStart({ id: server.id, serverName: server.serverName });
|
|
16546
|
+
setOauthLinks((prev) => new Map(prev).set(server.serverName, url2));
|
|
16547
|
+
setOauthWaiting((prev) => new Set(prev).add(server.serverName));
|
|
16548
|
+
} catch (error51) {
|
|
16549
|
+
setActionError(`${tRef.current("oauthStartFailed")}: ${String((error51 instanceof Error ? error51.message : error51) ?? error51)}`);
|
|
16550
|
+
} finally {
|
|
16551
|
+
setOauthStarting((prev) => {
|
|
16552
|
+
const next = new Set(prev);
|
|
16553
|
+
next.delete(server.serverName);
|
|
16554
|
+
return next;
|
|
16555
|
+
});
|
|
16556
|
+
}
|
|
16557
|
+
};
|
|
16298
16558
|
const toggleEnabled = async (server) => {
|
|
16299
16559
|
const target = !server.enabled;
|
|
16300
16560
|
const draft = viewToDraft(server);
|
|
@@ -16320,10 +16580,10 @@ function McpSettingsSection(props) {
|
|
|
16320
16580
|
}
|
|
16321
16581
|
if (state.loadState === "error") {
|
|
16322
16582
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.failure, children: [
|
|
16323
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { role: "alert", children: t("loadError") }),
|
|
16324
|
-
hostMissing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.muted
|
|
16583
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.failureText, role: "alert", children: t("loadError") }),
|
|
16584
|
+
hostMissing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: `${McpSettingsSection_default.muted} ${McpSettingsSection_default.failureText}`, children: t("loadErrorHostMissing") }) : null,
|
|
16325
16585
|
loadErrorDetail !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { className: McpSettingsSection_default.muted, children: loadErrorDetail }) : null,
|
|
16326
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
|
|
16586
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => {
|
|
16327
16587
|
setLoadState("loading");
|
|
16328
16588
|
load();
|
|
16329
16589
|
}, children: t("retry") })
|
|
@@ -16347,7 +16607,7 @@ function McpSettingsSection(props) {
|
|
|
16347
16607
|
test: state.test,
|
|
16348
16608
|
t,
|
|
16349
16609
|
actions,
|
|
16350
|
-
injected: { save, remove, test, list },
|
|
16610
|
+
injected: { save, remove, test, list, oauthStart, oauthStatus },
|
|
16351
16611
|
onSaved: () => {
|
|
16352
16612
|
const serverName = state.draft.serverName;
|
|
16353
16613
|
timersRef.current.push(window.setTimeout(() => refreshServer(serverName), 2e3));
|
|
@@ -16391,7 +16651,7 @@ function McpSettingsSection(props) {
|
|
|
16391
16651
|
"button",
|
|
16392
16652
|
{
|
|
16393
16653
|
type: "button",
|
|
16394
|
-
className: McpSettingsSection_default.moduleTitle
|
|
16654
|
+
className: `${controls_default.button} ${McpSettingsSection_default.moduleTitle}`,
|
|
16395
16655
|
"aria-expanded": envOpen,
|
|
16396
16656
|
onClick: () => setEnvOpen((open) => !open),
|
|
16397
16657
|
children: [
|
|
@@ -16419,13 +16679,13 @@ function McpSettingsSection(props) {
|
|
|
16419
16679
|
"button",
|
|
16420
16680
|
{
|
|
16421
16681
|
type: "button",
|
|
16422
|
-
className: jsonOpen ? McpSettingsSection_default.active :
|
|
16682
|
+
className: jsonOpen ? `${controls_default.button} ${McpSettingsSection_default.active}` : controls_default.button,
|
|
16423
16683
|
"aria-expanded": jsonOpen,
|
|
16424
16684
|
onClick: () => setJsonOpen((open) => !open),
|
|
16425
16685
|
children: t("serversJson")
|
|
16426
16686
|
}
|
|
16427
16687
|
),
|
|
16428
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className:
|
|
16688
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: `${controls_default.button} ${controls_default.primary}`, onClick: beginCreate, children: t("addServer") })
|
|
16429
16689
|
] })
|
|
16430
16690
|
] }),
|
|
16431
16691
|
actionError !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.warn, role: "alert", children: [
|
|
@@ -16458,13 +16718,28 @@ function McpSettingsSection(props) {
|
|
|
16458
16718
|
const isRefreshing = refreshing.has(server.serverName);
|
|
16459
16719
|
const serverToolList = serverTools(server.serverName);
|
|
16460
16720
|
const declared = server.source === "cordis";
|
|
16721
|
+
const oauthManaged = !declared && server.oauth === true;
|
|
16722
|
+
const oauthAuthorized = server.oauthAuthorized === true;
|
|
16723
|
+
const oauthNeedsAuth = oauthManaged && !oauthAuthorized;
|
|
16724
|
+
const oauthUsable = server.status.phase === "live" && server.status.tools.length > 0;
|
|
16725
|
+
const oauthBlocks = oauthNeedsAuth && !oauthUsable;
|
|
16726
|
+
const oauthPending = oauthNeedsAuth && server.status.oauthRequired === true;
|
|
16727
|
+
const oauthInFlight = oauthNeedsAuth && (oauthStarting.has(server.serverName) || oauthWaiting.has(server.serverName));
|
|
16728
|
+
const oauthLinkError = oauthNeedsAuth && typeof server.status.error === "string" && server.status.error.includes("response_type=code");
|
|
16729
|
+
const oauthLink = oauthLinks.get(server.serverName);
|
|
16730
|
+
const oauthError = oauthErrors.get(server.serverName);
|
|
16731
|
+
const oauthIncompleteHere = oauthIncomplete.has(server.serverName);
|
|
16461
16732
|
const card = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { className: McpSettingsSection_default.card, children: [
|
|
16462
16733
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.row, children: [
|
|
16463
16734
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMain, children: [
|
|
16464
16735
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowTitle, children: [
|
|
16465
16736
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.serverName, children: server.serverName }),
|
|
16466
16737
|
declared ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("sourceCordis") }) : null,
|
|
16467
|
-
server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("pendingBadge") }) : server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("conflictBadge") }) :
|
|
16738
|
+
server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("pendingBadge") }) : server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.cordis}`, children: t("conflictBadge") }) : oauthPending ? (
|
|
16739
|
+
/* A flow is waiting for the user: the pending state,
|
|
16740
|
+
never a pre-authorization failure. */
|
|
16741
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.oauth}`, children: t("oauthBadgeWaiting") })
|
|
16742
|
+
) : oauthBlocks ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default.oauthMiss}`, children: t("oauthBadgeUnauthorized") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default[server.status.phase]}`, children: t(phaseKey(server.status.phase)) }),
|
|
16468
16743
|
!server.enabled && server.status.phase !== "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.muted, children: t("statusStopped") }) : null
|
|
16469
16744
|
] }),
|
|
16470
16745
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMeta, children: [
|
|
@@ -16487,7 +16762,17 @@ function McpSettingsSection(props) {
|
|
|
16487
16762
|
] }) : null,
|
|
16488
16763
|
server.conflict ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("conflictDeclared") }) : null,
|
|
16489
16764
|
server.needsPlugin ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("needsPluginHint") }) : null,
|
|
16490
|
-
|
|
16765
|
+
oauthInFlight || oauthPending && oauthLink !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.note, children: [
|
|
16766
|
+
t("oauthInProgress"),
|
|
16767
|
+
oauthLink !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
16768
|
+
" \xB7 ",
|
|
16769
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: oauthLink, target: "_blank", rel: "noreferrer", children: t("oauthOpenManual") })
|
|
16770
|
+
] }) : null
|
|
16771
|
+
] }) : oauthError !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: McpSettingsSection_default.warn, children: [
|
|
16772
|
+
t("oauthFailed"),
|
|
16773
|
+
": ",
|
|
16774
|
+
oauthError
|
|
16775
|
+
] }) : oauthIncompleteHere ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthNotCompleted") }) : oauthPending || oauthBlocks ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthRequiredHint") }) : oauthLinkError && !oauthUsable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("oauthRequiredHint") }) : server.status.error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: server.status.error }) : null,
|
|
16491
16776
|
declared ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("readOnlyHint") }) : null,
|
|
16492
16777
|
server.stale ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.note, children: t("staleMirror") }) : null,
|
|
16493
16778
|
server.skipReason === "js-expression" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("skipJsExpr") }) : null,
|
|
@@ -16495,12 +16780,21 @@ function McpSettingsSection(props) {
|
|
|
16495
16780
|
declared && server.oauthHint ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.warn, children: t("oauthHint") }) : null
|
|
16496
16781
|
] }),
|
|
16497
16782
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowActions, children: [
|
|
16498
|
-
declared || server.conflict || server.pendingTakeover ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: isRefreshing, onClick: () => void toggleEnabled(server), children: server.enabled ? t("disable") : t("enabled") }),
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16783
|
+
declared || server.conflict || server.pendingTakeover ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: isRefreshing, onClick: () => void toggleEnabled(server), children: server.enabled ? t("disable") : t("enabled") }),
|
|
16784
|
+
oauthNeedsAuth && !server.conflict && !server.pendingTakeover ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
16785
|
+
"button",
|
|
16786
|
+
{
|
|
16787
|
+
type: "button",
|
|
16788
|
+
className: oauthBlocks ? `${controls_default.button} ${McpSettingsSection_default.dangerButton}` : controls_default.button,
|
|
16789
|
+
onClick: () => void runOAuth(server),
|
|
16790
|
+
children: oauthInFlight ? t("oauthInProgress") : t("oauthAuthorize")
|
|
16791
|
+
}
|
|
16792
|
+
) : null,
|
|
16793
|
+
declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: isRefreshing, onClick: () => refreshServer(server.serverName), children: isRefreshing ? t("refreshing") : t("refresh") }),
|
|
16794
|
+
declared && server.adoptable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: adopting.has(server.serverName), onClick: () => void runAdopt(server), children: adopting.has(server.serverName) ? t("adopting") : t("adopt") }) : null,
|
|
16795
|
+
server.adopted ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, disabled: adopting.has(server.serverName), onClick: () => void runAdopt(server), children: adopting.has(server.serverName) ? t("releasing") : t("release") }) : null,
|
|
16796
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => toggleExpand(server.serverName), children: isExpanded ? t("toolsCollapse") : t("toolsExpand") }),
|
|
16797
|
+
declared ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: controls_default.button, onClick: () => beginEdit(server), children: t("edit") })
|
|
16504
16798
|
] })
|
|
16505
16799
|
] }),
|
|
16506
16800
|
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.toolPanel, children: tools === null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.muted, children: toolsError ?? t("toolsLoading") }) : serverToolList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.muted, children: t("toolsEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.toolGrid, children: serverToolList.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.toolRow, title: tool.name, children: [
|
|
@@ -16564,7 +16858,19 @@ var zh = {
|
|
|
16564
16858
|
toolCallTimeoutMs: "\u5DE5\u5177\u8C03\u7528\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",
|
|
16565
16859
|
failOnStartupError: "\u542F\u52A8\u8FDE\u63A5\u5931\u8D25\u65F6\u62D2\u7EDD\u6302\u8F7D",
|
|
16566
16860
|
oauthAuth: "\u4F7F\u7528 OAuth \u6388\u6743\uFF08\u6D4F\u89C8\u5668\u6388\u6743 + token \u6258\u7BA1\uFF09",
|
|
16567
|
-
oauthAuthHint: "\u4EC5\u5F53\u8BE5\u670D\u52A1\u5668\u786E\u5B9E\u4F7F\u7528 OAuth\uFF08MCP \u6388\u6743\u7801 + PKCE\uFF09\u65F6\u52FE\u9009\
|
|
16861
|
+
oauthAuthHint: "\u4EC5\u5F53\u8BE5\u670D\u52A1\u5668\u786E\u5B9E\u4F7F\u7528 OAuth\uFF08MCP \u6388\u6743\u7801 + PKCE\uFF09\u65F6\u52FE\u9009\uFF1B\u7528\u9759\u6001 token \u6216\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\u8BA4\u8BC1\u7684\u670D\u52A1\u5668\u8BF7\u52FF\u52FE\u9009\u3002",
|
|
16862
|
+
oauthAuthorize: "OAuth \u6388\u6743",
|
|
16863
|
+
oauthInProgress: "\u6388\u6743\u4E2D\u2026",
|
|
16864
|
+
oauthWaiting: "\u6388\u6743\u4E2D\u2026\uFF08\u6BCF 5 \u79D2\u81EA\u52A8\u68C0\u6D4B\uFF0C\u5B8C\u6210\u524D\u4E0D\u4F1A\u63D0\u793A\u5931\u8D25\uFF09",
|
|
16865
|
+
oauthAuthorized: "\u6388\u6743\u6210\u529F",
|
|
16866
|
+
oauthRequired: "\u9700\u8981 OAuth \u6388\u6743\uFF1A\u8BF7\u56DE\u5230\u5217\u8868\u70B9\u51FB\u300COAuth \u6388\u6743\u300D\u5B8C\u6210\u6388\u6743\uFF0C\u672C\u9875\u4F1A\u81EA\u52A8\u68C0\u6D4B\u7ED3\u679C\u3002",
|
|
16867
|
+
oauthBadgeWaiting: "\u7B49\u5F85\u6388\u6743",
|
|
16868
|
+
oauthBadgeUnauthorized: "\u672A\u6388\u6743",
|
|
16869
|
+
oauthRequiredHint: "\u672A\u6388\u6743\uFF1A\u70B9\u51FB\u300COAuth \u6388\u6743\u300D\u5728\u6D4F\u89C8\u5668\u5B8C\u6210\u6388\u6743\u5373\u53EF\u3002",
|
|
16870
|
+
oauthStartFailed: "\u65E0\u6CD5\u5F00\u59CB OAuth \u6388\u6743\uFF08\u82E5\u521A\u5347\u7EA7\u8FC7\u63D2\u4EF6\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u5F00 DeepSeek Harness \u540E\u518D\u8BD5\uFF09",
|
|
16871
|
+
oauthFailed: "\u6388\u6743\u5931\u8D25",
|
|
16872
|
+
oauthNotCompleted: "\u6388\u6743\u672A\u5B8C\u6210\uFF08\u672A\u68C0\u6D4B\u5230\u6388\u6743\u7ED3\u679C\uFF0C\u53EF\u91CD\u65B0\u70B9\u51FB\u6388\u6743\uFF09",
|
|
16873
|
+
oauthOpenManual: "\u6D4F\u89C8\u5668\u6CA1\u6253\u5F00\uFF1F\u70B9\u6B64\u6253\u5F00\u6388\u6743\u9875",
|
|
16568
16874
|
statusMounting: "\u8FDE\u63A5\u4E2D",
|
|
16569
16875
|
statusLive: "\u5DF2\u8FDE\u63A5",
|
|
16570
16876
|
statusFailed: "\u6302\u8F7D\u5931\u8D25",
|
|
@@ -16594,7 +16900,7 @@ var zh = {
|
|
|
16594
16900
|
edit: "\u7F16\u8F91",
|
|
16595
16901
|
test: "\u6D4B\u8BD5\u8FDE\u63A5",
|
|
16596
16902
|
testRunning: "\u6B63\u5728\u6D4B\u8BD5\u2026",
|
|
16597
|
-
testBrowserHint: "\u6B63\u5728\u6D4B\u8BD5\u2026\u82E5\
|
|
16903
|
+
testBrowserHint: "\u6B63\u5728\u6D4B\u8BD5\u8FDE\u63A5\u2026\u82E5\u8BE5\u670D\u52A1\u5668\u9700\u8981 OAuth \u6388\u6743\uFF0C\u4F1A\u663E\u793A\u300C\u9700\u8981\u6388\u6743\u300D\uFF0C\u8BF7\u56DE\u5230\u5217\u8868\u70B9\u51FB\u300COAuth \u6388\u6743\u300D\u5B8C\u6210\u6388\u6743\uFF0C\u672C\u9875\u4F1A\u81EA\u52A8\u68C0\u6D4B\u7ED3\u679C\u3002",
|
|
16598
16904
|
testOk: "\u8FDE\u63A5\u6210\u529F",
|
|
16599
16905
|
testFail: "\u8FDE\u63A5\u5931\u8D25",
|
|
16600
16906
|
testUnknown: "\u672A\u77E5\u7ED3\u679C",
|
|
@@ -16689,7 +16995,19 @@ var en = {
|
|
|
16689
16995
|
toolCallTimeoutMs: "Tool-call timeout (ms)",
|
|
16690
16996
|
failOnStartupError: "Reject the mount when the startup connection fails",
|
|
16691
16997
|
oauthAuth: "Use OAuth authorization (browser authorization + token storage)",
|
|
16692
|
-
oauthAuthHint: "Tick only when the server really uses OAuth (MCP authorization-code + PKCE)
|
|
16998
|
+
oauthAuthHint: "Tick only when the server really uses OAuth (MCP authorization-code + PKCE); leave it off for servers that authenticate with static tokens or custom headers.",
|
|
16999
|
+
oauthAuthorize: "Authorize",
|
|
17000
|
+
oauthInProgress: "Authorizing\u2026",
|
|
17001
|
+
oauthWaiting: "Authorizing\u2026 (checked every 5s; nothing is reported as failed before it completes)",
|
|
17002
|
+
oauthAuthorized: "Authorization complete",
|
|
17003
|
+
oauthRequired: 'OAuth authorization required: go back to the list and click "Authorize"; this page detects the result automatically.',
|
|
17004
|
+
oauthBadgeWaiting: "Awaiting authorization",
|
|
17005
|
+
oauthBadgeUnauthorized: "Not authorized",
|
|
17006
|
+
oauthRequiredHint: 'Not authorized: click "Authorize" and finish in the browser.',
|
|
17007
|
+
oauthStartFailed: "Could not start OAuth authorization (if the plugin was just upgraded, quit and reopen DeepSeek Harness and retry)",
|
|
17008
|
+
oauthFailed: "Authorization failed",
|
|
17009
|
+
oauthNotCompleted: "Authorization did not complete (no result detected; click to retry)",
|
|
17010
|
+
oauthOpenManual: "Browser did not open? Open the authorization page",
|
|
16693
17011
|
statusMounting: "Connecting",
|
|
16694
17012
|
statusLive: "Connected",
|
|
16695
17013
|
statusFailed: "Mount failed",
|
|
@@ -16719,7 +17037,7 @@ var en = {
|
|
|
16719
17037
|
edit: "Edit",
|
|
16720
17038
|
test: "Test connection",
|
|
16721
17039
|
testRunning: "Testing\u2026",
|
|
16722
|
-
testBrowserHint:
|
|
17040
|
+
testBrowserHint: 'Testing\u2026 if this server needs OAuth authorization it shows "authorization required": go back to the list and click "Authorize"; this page detects the result automatically.',
|
|
16723
17041
|
testOk: "Connection succeeded",
|
|
16724
17042
|
testFail: "Connection failed",
|
|
16725
17043
|
testUnknown: "Unknown result",
|
|
@@ -16867,6 +17185,20 @@ async function apply(ctx) {
|
|
|
16867
17185
|
failure: null,
|
|
16868
17186
|
...result.warning === void 0 ? {} : { warning: result.warning }
|
|
16869
17187
|
};
|
|
17188
|
+
},
|
|
17189
|
+
oauthStart: async (request) => {
|
|
17190
|
+
const result = await unwrap(() => manager.oauthStart(request));
|
|
17191
|
+
return result.url;
|
|
17192
|
+
},
|
|
17193
|
+
oauthStatus: async (serverName) => {
|
|
17194
|
+
const result = await unwrap(() => manager.oauthStatus({ serverName }));
|
|
17195
|
+
return {
|
|
17196
|
+
authorized: result.authorized,
|
|
17197
|
+
pending: result.pending,
|
|
17198
|
+
...result.url === void 0 ? {} : { url: result.url },
|
|
17199
|
+
...result.expiresAt === void 0 ? {} : { expiresAt: result.expiresAt },
|
|
17200
|
+
...result.error === void 0 ? {} : { error: result.error }
|
|
17201
|
+
};
|
|
16870
17202
|
}
|
|
16871
17203
|
});
|
|
16872
17204
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|