dsh-mcp 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.en.md +29 -0
- package/CHANGELOG.md +29 -0
- package/README.en.md +23 -5
- package/README.md +19 -4
- package/lib/client.js +989 -388
- package/lib/index.js +322 -13
- package/lib/oauth.js +46 -5
- package/package.json +1 -1
- package/src/client/GlobalEnvEditor.module.css +194 -0
- package/src/client/GlobalEnvEditor.tsx +245 -0
- package/src/client/McpSettingsSection.module.css +67 -0
- package/src/client/McpSettingsSection.tsx +82 -18
- package/src/client/ServerForm.module.css +0 -47
- package/src/client/ServerForm.tsx +25 -70
- package/src/client/ServersJsonEditor.module.css +90 -0
- package/src/client/ServersJsonEditor.tsx +226 -0
- package/src/client/index.ts +21 -3
- package/src/client/locales.ts +54 -4
- package/src/client/mcp-store.ts +4 -54
- package/src/client/remote-contribution.js +163 -2
- package/src/client/types.ts +2 -0
package/lib/client.js
CHANGED
|
@@ -27,7 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(index_exports);
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/external.js
|
|
31
31
|
var external_exports = {};
|
|
32
32
|
__export(external_exports, {
|
|
33
33
|
$brand: () => $brand,
|
|
@@ -270,7 +270,7 @@ __export(external_exports, {
|
|
|
270
270
|
xor: () => xor
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/index.js
|
|
274
274
|
var core_exports2 = {};
|
|
275
275
|
__export(core_exports2, {
|
|
276
276
|
$ZodAny: () => $ZodAny,
|
|
@@ -549,7 +549,7 @@ __export(core_exports2, {
|
|
|
549
549
|
version: () => version
|
|
550
550
|
});
|
|
551
551
|
|
|
552
|
-
//
|
|
552
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/core.js
|
|
553
553
|
var _a;
|
|
554
554
|
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
555
555
|
status: "aborted"
|
|
@@ -626,7 +626,7 @@ function config(newConfig) {
|
|
|
626
626
|
return globalConfig;
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
-
//
|
|
629
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/util.js
|
|
630
630
|
var util_exports = {};
|
|
631
631
|
__export(util_exports, {
|
|
632
632
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -1322,7 +1322,7 @@ var Class = class {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
};
|
|
1324
1324
|
|
|
1325
|
-
//
|
|
1325
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/errors.js
|
|
1326
1326
|
var initializer = (inst, def) => {
|
|
1327
1327
|
inst.name = "$ZodError";
|
|
1328
1328
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -1461,7 +1461,7 @@ function prettifyError(error51) {
|
|
|
1461
1461
|
return lines.join("\n");
|
|
1462
1462
|
}
|
|
1463
1463
|
|
|
1464
|
-
//
|
|
1464
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/parse.js
|
|
1465
1465
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
1466
1466
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
1467
1467
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -1549,7 +1549,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1549
1549
|
};
|
|
1550
1550
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
1551
1551
|
|
|
1552
|
-
//
|
|
1552
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/regexes.js
|
|
1553
1553
|
var regexes_exports = {};
|
|
1554
1554
|
__export(regexes_exports, {
|
|
1555
1555
|
base64: () => base64,
|
|
@@ -1708,7 +1708,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
|
1708
1708
|
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
|
|
1709
1709
|
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
1710
1710
|
|
|
1711
|
-
//
|
|
1711
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/checks.js
|
|
1712
1712
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1713
1713
|
var _a3;
|
|
1714
1714
|
inst._zod ?? (inst._zod = {});
|
|
@@ -2256,7 +2256,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
2256
2256
|
};
|
|
2257
2257
|
});
|
|
2258
2258
|
|
|
2259
|
-
//
|
|
2259
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/doc.js
|
|
2260
2260
|
var Doc = class {
|
|
2261
2261
|
constructor(args = []) {
|
|
2262
2262
|
this.content = [];
|
|
@@ -2292,14 +2292,14 @@ var Doc = class {
|
|
|
2292
2292
|
}
|
|
2293
2293
|
};
|
|
2294
2294
|
|
|
2295
|
-
//
|
|
2295
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/versions.js
|
|
2296
2296
|
var version = {
|
|
2297
2297
|
major: 4,
|
|
2298
2298
|
minor: 4,
|
|
2299
2299
|
patch: 3
|
|
2300
2300
|
};
|
|
2301
2301
|
|
|
2302
|
-
//
|
|
2302
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/schemas.js
|
|
2303
2303
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
2304
2304
|
var _a3;
|
|
2305
2305
|
inst ?? (inst = {});
|
|
@@ -4392,7 +4392,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
4392
4392
|
}
|
|
4393
4393
|
}
|
|
4394
4394
|
|
|
4395
|
-
//
|
|
4395
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/index.js
|
|
4396
4396
|
var locales_exports = {};
|
|
4397
4397
|
__export(locales_exports, {
|
|
4398
4398
|
ar: () => ar_default,
|
|
@@ -4449,7 +4449,7 @@ __export(locales_exports, {
|
|
|
4449
4449
|
zhTW: () => zh_TW_default
|
|
4450
4450
|
});
|
|
4451
4451
|
|
|
4452
|
-
//
|
|
4452
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ar.js
|
|
4453
4453
|
var error = () => {
|
|
4454
4454
|
const Sizable = {
|
|
4455
4455
|
string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
|
|
@@ -4556,7 +4556,7 @@ function ar_default() {
|
|
|
4556
4556
|
};
|
|
4557
4557
|
}
|
|
4558
4558
|
|
|
4559
|
-
//
|
|
4559
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/az.js
|
|
4560
4560
|
var error2 = () => {
|
|
4561
4561
|
const Sizable = {
|
|
4562
4562
|
string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
|
|
@@ -4662,7 +4662,7 @@ function az_default() {
|
|
|
4662
4662
|
};
|
|
4663
4663
|
}
|
|
4664
4664
|
|
|
4665
|
-
//
|
|
4665
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/be.js
|
|
4666
4666
|
function getBelarusianPlural(count, one, few, many) {
|
|
4667
4667
|
const absCount = Math.abs(count);
|
|
4668
4668
|
const lastDigit = absCount % 10;
|
|
@@ -4819,7 +4819,7 @@ function be_default() {
|
|
|
4819
4819
|
};
|
|
4820
4820
|
}
|
|
4821
4821
|
|
|
4822
|
-
//
|
|
4822
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/bg.js
|
|
4823
4823
|
var error4 = () => {
|
|
4824
4824
|
const Sizable = {
|
|
4825
4825
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
|
|
@@ -4940,7 +4940,7 @@ function bg_default() {
|
|
|
4940
4940
|
};
|
|
4941
4941
|
}
|
|
4942
4942
|
|
|
4943
|
-
//
|
|
4943
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ca.js
|
|
4944
4944
|
var error5 = () => {
|
|
4945
4945
|
const Sizable = {
|
|
4946
4946
|
string: { unit: "car\xE0cters", verb: "contenir" },
|
|
@@ -5049,7 +5049,7 @@ function ca_default() {
|
|
|
5049
5049
|
};
|
|
5050
5050
|
}
|
|
5051
5051
|
|
|
5052
|
-
//
|
|
5052
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/cs.js
|
|
5053
5053
|
var error6 = () => {
|
|
5054
5054
|
const Sizable = {
|
|
5055
5055
|
string: { unit: "znak\u016F", verb: "m\xEDt" },
|
|
@@ -5161,7 +5161,7 @@ function cs_default() {
|
|
|
5161
5161
|
};
|
|
5162
5162
|
}
|
|
5163
5163
|
|
|
5164
|
-
//
|
|
5164
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/da.js
|
|
5165
5165
|
var error7 = () => {
|
|
5166
5166
|
const Sizable = {
|
|
5167
5167
|
string: { unit: "tegn", verb: "havde" },
|
|
@@ -5277,7 +5277,7 @@ function da_default() {
|
|
|
5277
5277
|
};
|
|
5278
5278
|
}
|
|
5279
5279
|
|
|
5280
|
-
//
|
|
5280
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/de.js
|
|
5281
5281
|
var error8 = () => {
|
|
5282
5282
|
const Sizable = {
|
|
5283
5283
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
@@ -5386,7 +5386,7 @@ function de_default() {
|
|
|
5386
5386
|
};
|
|
5387
5387
|
}
|
|
5388
5388
|
|
|
5389
|
-
//
|
|
5389
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/el.js
|
|
5390
5390
|
var error9 = () => {
|
|
5391
5391
|
const Sizable = {
|
|
5392
5392
|
string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
@@ -5496,7 +5496,7 @@ function el_default() {
|
|
|
5496
5496
|
};
|
|
5497
5497
|
}
|
|
5498
5498
|
|
|
5499
|
-
//
|
|
5499
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/en.js
|
|
5500
5500
|
var error10 = () => {
|
|
5501
5501
|
const Sizable = {
|
|
5502
5502
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -5609,7 +5609,7 @@ function en_default() {
|
|
|
5609
5609
|
};
|
|
5610
5610
|
}
|
|
5611
5611
|
|
|
5612
|
-
//
|
|
5612
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/eo.js
|
|
5613
5613
|
var error11 = () => {
|
|
5614
5614
|
const Sizable = {
|
|
5615
5615
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
@@ -5719,7 +5719,7 @@ function eo_default() {
|
|
|
5719
5719
|
};
|
|
5720
5720
|
}
|
|
5721
5721
|
|
|
5722
|
-
//
|
|
5722
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/es.js
|
|
5723
5723
|
var error12 = () => {
|
|
5724
5724
|
const Sizable = {
|
|
5725
5725
|
string: { unit: "caracteres", verb: "tener" },
|
|
@@ -5852,7 +5852,7 @@ function es_default() {
|
|
|
5852
5852
|
};
|
|
5853
5853
|
}
|
|
5854
5854
|
|
|
5855
|
-
//
|
|
5855
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/fa.js
|
|
5856
5856
|
var error13 = () => {
|
|
5857
5857
|
const Sizable = {
|
|
5858
5858
|
string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
@@ -5967,7 +5967,7 @@ function fa_default() {
|
|
|
5967
5967
|
};
|
|
5968
5968
|
}
|
|
5969
5969
|
|
|
5970
|
-
//
|
|
5970
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/fi.js
|
|
5971
5971
|
var error14 = () => {
|
|
5972
5972
|
const Sizable = {
|
|
5973
5973
|
string: { unit: "merkki\xE4", subject: "merkkijonon" },
|
|
@@ -6080,7 +6080,7 @@ function fi_default() {
|
|
|
6080
6080
|
};
|
|
6081
6081
|
}
|
|
6082
6082
|
|
|
6083
|
-
//
|
|
6083
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/fr.js
|
|
6084
6084
|
var error15 = () => {
|
|
6085
6085
|
const Sizable = {
|
|
6086
6086
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -6206,7 +6206,7 @@ function fr_default() {
|
|
|
6206
6206
|
};
|
|
6207
6207
|
}
|
|
6208
6208
|
|
|
6209
|
-
//
|
|
6209
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/fr-CA.js
|
|
6210
6210
|
var error16 = () => {
|
|
6211
6211
|
const Sizable = {
|
|
6212
6212
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -6314,7 +6314,7 @@ function fr_CA_default() {
|
|
|
6314
6314
|
};
|
|
6315
6315
|
}
|
|
6316
6316
|
|
|
6317
|
-
//
|
|
6317
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/he.js
|
|
6318
6318
|
var error17 = () => {
|
|
6319
6319
|
const TypeNames = {
|
|
6320
6320
|
string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
|
|
@@ -6509,7 +6509,7 @@ function he_default() {
|
|
|
6509
6509
|
};
|
|
6510
6510
|
}
|
|
6511
6511
|
|
|
6512
|
-
//
|
|
6512
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/hr.js
|
|
6513
6513
|
var error18 = () => {
|
|
6514
6514
|
const Sizable = {
|
|
6515
6515
|
string: { unit: "znakova", verb: "imati" },
|
|
@@ -6632,7 +6632,7 @@ function hr_default() {
|
|
|
6632
6632
|
};
|
|
6633
6633
|
}
|
|
6634
6634
|
|
|
6635
|
-
//
|
|
6635
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/hu.js
|
|
6636
6636
|
var error19 = () => {
|
|
6637
6637
|
const Sizable = {
|
|
6638
6638
|
string: { unit: "karakter", verb: "legyen" },
|
|
@@ -6741,7 +6741,7 @@ function hu_default() {
|
|
|
6741
6741
|
};
|
|
6742
6742
|
}
|
|
6743
6743
|
|
|
6744
|
-
//
|
|
6744
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/hy.js
|
|
6745
6745
|
function getArmenianPlural(count, one, many) {
|
|
6746
6746
|
return Math.abs(count) === 1 ? one : many;
|
|
6747
6747
|
}
|
|
@@ -6889,7 +6889,7 @@ function hy_default() {
|
|
|
6889
6889
|
};
|
|
6890
6890
|
}
|
|
6891
6891
|
|
|
6892
|
-
//
|
|
6892
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/id.js
|
|
6893
6893
|
var error21 = () => {
|
|
6894
6894
|
const Sizable = {
|
|
6895
6895
|
string: { unit: "karakter", verb: "memiliki" },
|
|
@@ -6996,7 +6996,7 @@ function id_default() {
|
|
|
6996
6996
|
};
|
|
6997
6997
|
}
|
|
6998
6998
|
|
|
6999
|
-
//
|
|
6999
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/is.js
|
|
7000
7000
|
var error22 = () => {
|
|
7001
7001
|
const Sizable = {
|
|
7002
7002
|
string: { unit: "stafi", verb: "a\xF0 hafa" },
|
|
@@ -7106,7 +7106,7 @@ function is_default() {
|
|
|
7106
7106
|
};
|
|
7107
7107
|
}
|
|
7108
7108
|
|
|
7109
|
-
//
|
|
7109
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/it.js
|
|
7110
7110
|
var error23 = () => {
|
|
7111
7111
|
const Sizable = {
|
|
7112
7112
|
string: { unit: "caratteri", verb: "avere" },
|
|
@@ -7215,7 +7215,7 @@ function it_default() {
|
|
|
7215
7215
|
};
|
|
7216
7216
|
}
|
|
7217
7217
|
|
|
7218
|
-
//
|
|
7218
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ja.js
|
|
7219
7219
|
var error24 = () => {
|
|
7220
7220
|
const Sizable = {
|
|
7221
7221
|
string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
|
|
@@ -7323,7 +7323,7 @@ function ja_default() {
|
|
|
7323
7323
|
};
|
|
7324
7324
|
}
|
|
7325
7325
|
|
|
7326
|
-
//
|
|
7326
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ka.js
|
|
7327
7327
|
var error25 = () => {
|
|
7328
7328
|
const Sizable = {
|
|
7329
7329
|
string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
@@ -7436,7 +7436,7 @@ function ka_default() {
|
|
|
7436
7436
|
};
|
|
7437
7437
|
}
|
|
7438
7438
|
|
|
7439
|
-
//
|
|
7439
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/km.js
|
|
7440
7440
|
var error26 = () => {
|
|
7441
7441
|
const Sizable = {
|
|
7442
7442
|
string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
@@ -7547,12 +7547,12 @@ function km_default() {
|
|
|
7547
7547
|
};
|
|
7548
7548
|
}
|
|
7549
7549
|
|
|
7550
|
-
//
|
|
7550
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/kh.js
|
|
7551
7551
|
function kh_default() {
|
|
7552
7552
|
return km_default();
|
|
7553
7553
|
}
|
|
7554
7554
|
|
|
7555
|
-
//
|
|
7555
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ko.js
|
|
7556
7556
|
var error27 = () => {
|
|
7557
7557
|
const Sizable = {
|
|
7558
7558
|
string: { unit: "\uBB38\uC790", verb: "to have" },
|
|
@@ -7664,7 +7664,7 @@ function ko_default() {
|
|
|
7664
7664
|
};
|
|
7665
7665
|
}
|
|
7666
7666
|
|
|
7667
|
-
//
|
|
7667
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/lt.js
|
|
7668
7668
|
var capitalizeFirstCharacter = (text) => {
|
|
7669
7669
|
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
7670
7670
|
};
|
|
@@ -7868,7 +7868,7 @@ function lt_default() {
|
|
|
7868
7868
|
};
|
|
7869
7869
|
}
|
|
7870
7870
|
|
|
7871
|
-
//
|
|
7871
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/mk.js
|
|
7872
7872
|
var error29 = () => {
|
|
7873
7873
|
const Sizable = {
|
|
7874
7874
|
string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
@@ -7978,7 +7978,7 @@ function mk_default() {
|
|
|
7978
7978
|
};
|
|
7979
7979
|
}
|
|
7980
7980
|
|
|
7981
|
-
//
|
|
7981
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ms.js
|
|
7982
7982
|
var error30 = () => {
|
|
7983
7983
|
const Sizable = {
|
|
7984
7984
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
@@ -8086,7 +8086,7 @@ function ms_default() {
|
|
|
8086
8086
|
};
|
|
8087
8087
|
}
|
|
8088
8088
|
|
|
8089
|
-
//
|
|
8089
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/nl.js
|
|
8090
8090
|
var error31 = () => {
|
|
8091
8091
|
const Sizable = {
|
|
8092
8092
|
string: { unit: "tekens", verb: "heeft" },
|
|
@@ -8197,7 +8197,7 @@ function nl_default() {
|
|
|
8197
8197
|
};
|
|
8198
8198
|
}
|
|
8199
8199
|
|
|
8200
|
-
//
|
|
8200
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/no.js
|
|
8201
8201
|
var error32 = () => {
|
|
8202
8202
|
const Sizable = {
|
|
8203
8203
|
string: { unit: "tegn", verb: "\xE5 ha" },
|
|
@@ -8306,7 +8306,7 @@ function no_default() {
|
|
|
8306
8306
|
};
|
|
8307
8307
|
}
|
|
8308
8308
|
|
|
8309
|
-
//
|
|
8309
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ota.js
|
|
8310
8310
|
var error33 = () => {
|
|
8311
8311
|
const Sizable = {
|
|
8312
8312
|
string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
|
|
@@ -8416,7 +8416,7 @@ function ota_default() {
|
|
|
8416
8416
|
};
|
|
8417
8417
|
}
|
|
8418
8418
|
|
|
8419
|
-
//
|
|
8419
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ps.js
|
|
8420
8420
|
var error34 = () => {
|
|
8421
8421
|
const Sizable = {
|
|
8422
8422
|
string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
|
|
@@ -8531,7 +8531,7 @@ function ps_default() {
|
|
|
8531
8531
|
};
|
|
8532
8532
|
}
|
|
8533
8533
|
|
|
8534
|
-
//
|
|
8534
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/pl.js
|
|
8535
8535
|
var error35 = () => {
|
|
8536
8536
|
const Sizable = {
|
|
8537
8537
|
string: { unit: "znak\xF3w", verb: "mie\u0107" },
|
|
@@ -8641,7 +8641,7 @@ function pl_default() {
|
|
|
8641
8641
|
};
|
|
8642
8642
|
}
|
|
8643
8643
|
|
|
8644
|
-
//
|
|
8644
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/pt.js
|
|
8645
8645
|
var error36 = () => {
|
|
8646
8646
|
const Sizable = {
|
|
8647
8647
|
string: { unit: "caracteres", verb: "ter" },
|
|
@@ -8750,7 +8750,7 @@ function pt_default() {
|
|
|
8750
8750
|
};
|
|
8751
8751
|
}
|
|
8752
8752
|
|
|
8753
|
-
//
|
|
8753
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ro.js
|
|
8754
8754
|
var error37 = () => {
|
|
8755
8755
|
const Sizable = {
|
|
8756
8756
|
string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
|
|
@@ -8870,7 +8870,7 @@ function ro_default() {
|
|
|
8870
8870
|
};
|
|
8871
8871
|
}
|
|
8872
8872
|
|
|
8873
|
-
//
|
|
8873
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ru.js
|
|
8874
8874
|
function getRussianPlural(count, one, few, many) {
|
|
8875
8875
|
const absCount = Math.abs(count);
|
|
8876
8876
|
const lastDigit = absCount % 10;
|
|
@@ -9027,7 +9027,7 @@ function ru_default() {
|
|
|
9027
9027
|
};
|
|
9028
9028
|
}
|
|
9029
9029
|
|
|
9030
|
-
//
|
|
9030
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/sl.js
|
|
9031
9031
|
var error39 = () => {
|
|
9032
9032
|
const Sizable = {
|
|
9033
9033
|
string: { unit: "znakov", verb: "imeti" },
|
|
@@ -9137,7 +9137,7 @@ function sl_default() {
|
|
|
9137
9137
|
};
|
|
9138
9138
|
}
|
|
9139
9139
|
|
|
9140
|
-
//
|
|
9140
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/sv.js
|
|
9141
9141
|
var error40 = () => {
|
|
9142
9142
|
const Sizable = {
|
|
9143
9143
|
string: { unit: "tecken", verb: "att ha" },
|
|
@@ -9248,7 +9248,7 @@ function sv_default() {
|
|
|
9248
9248
|
};
|
|
9249
9249
|
}
|
|
9250
9250
|
|
|
9251
|
-
//
|
|
9251
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ta.js
|
|
9252
9252
|
var error41 = () => {
|
|
9253
9253
|
const Sizable = {
|
|
9254
9254
|
string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
@@ -9359,7 +9359,7 @@ function ta_default() {
|
|
|
9359
9359
|
};
|
|
9360
9360
|
}
|
|
9361
9361
|
|
|
9362
|
-
//
|
|
9362
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/th.js
|
|
9363
9363
|
var error42 = () => {
|
|
9364
9364
|
const Sizable = {
|
|
9365
9365
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -9470,7 +9470,7 @@ function th_default() {
|
|
|
9470
9470
|
};
|
|
9471
9471
|
}
|
|
9472
9472
|
|
|
9473
|
-
//
|
|
9473
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/tr.js
|
|
9474
9474
|
var error43 = () => {
|
|
9475
9475
|
const Sizable = {
|
|
9476
9476
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
@@ -9576,7 +9576,7 @@ function tr_default() {
|
|
|
9576
9576
|
};
|
|
9577
9577
|
}
|
|
9578
9578
|
|
|
9579
|
-
//
|
|
9579
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/uk.js
|
|
9580
9580
|
var error44 = () => {
|
|
9581
9581
|
const Sizable = {
|
|
9582
9582
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -9685,12 +9685,12 @@ function uk_default() {
|
|
|
9685
9685
|
};
|
|
9686
9686
|
}
|
|
9687
9687
|
|
|
9688
|
-
//
|
|
9688
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ua.js
|
|
9689
9689
|
function ua_default() {
|
|
9690
9690
|
return uk_default();
|
|
9691
9691
|
}
|
|
9692
9692
|
|
|
9693
|
-
//
|
|
9693
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/ur.js
|
|
9694
9694
|
var error45 = () => {
|
|
9695
9695
|
const Sizable = {
|
|
9696
9696
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -9801,7 +9801,7 @@ function ur_default() {
|
|
|
9801
9801
|
};
|
|
9802
9802
|
}
|
|
9803
9803
|
|
|
9804
|
-
//
|
|
9804
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/uz.js
|
|
9805
9805
|
var error46 = () => {
|
|
9806
9806
|
const Sizable = {
|
|
9807
9807
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
@@ -9912,7 +9912,7 @@ function uz_default() {
|
|
|
9912
9912
|
};
|
|
9913
9913
|
}
|
|
9914
9914
|
|
|
9915
|
-
//
|
|
9915
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/vi.js
|
|
9916
9916
|
var error47 = () => {
|
|
9917
9917
|
const Sizable = {
|
|
9918
9918
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
@@ -10021,7 +10021,7 @@ function vi_default() {
|
|
|
10021
10021
|
};
|
|
10022
10022
|
}
|
|
10023
10023
|
|
|
10024
|
-
//
|
|
10024
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/zh-CN.js
|
|
10025
10025
|
var error48 = () => {
|
|
10026
10026
|
const Sizable = {
|
|
10027
10027
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
@@ -10131,7 +10131,7 @@ function zh_CN_default() {
|
|
|
10131
10131
|
};
|
|
10132
10132
|
}
|
|
10133
10133
|
|
|
10134
|
-
//
|
|
10134
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/zh-TW.js
|
|
10135
10135
|
var error49 = () => {
|
|
10136
10136
|
const Sizable = {
|
|
10137
10137
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
@@ -10239,7 +10239,7 @@ function zh_TW_default() {
|
|
|
10239
10239
|
};
|
|
10240
10240
|
}
|
|
10241
10241
|
|
|
10242
|
-
//
|
|
10242
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/locales/yo.js
|
|
10243
10243
|
var error50 = () => {
|
|
10244
10244
|
const Sizable = {
|
|
10245
10245
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
@@ -10347,7 +10347,7 @@ function yo_default() {
|
|
|
10347
10347
|
};
|
|
10348
10348
|
}
|
|
10349
10349
|
|
|
10350
|
-
//
|
|
10350
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/registries.js
|
|
10351
10351
|
var _a2;
|
|
10352
10352
|
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
10353
10353
|
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
@@ -10397,7 +10397,7 @@ function registry() {
|
|
|
10397
10397
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
10398
10398
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
10399
10399
|
|
|
10400
|
-
//
|
|
10400
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/api.js
|
|
10401
10401
|
// @__NO_SIDE_EFFECTS__
|
|
10402
10402
|
function _string(Class2, params) {
|
|
10403
10403
|
return new Class2({
|
|
@@ -11436,7 +11436,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
11436
11436
|
return inst;
|
|
11437
11437
|
}
|
|
11438
11438
|
|
|
11439
|
-
//
|
|
11439
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/to-json-schema.js
|
|
11440
11440
|
function initializeContext(params) {
|
|
11441
11441
|
let target = params?.target ?? "draft-2020-12";
|
|
11442
11442
|
if (target === "draft-4")
|
|
@@ -11795,7 +11795,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
11795
11795
|
return finalize(ctx, schema);
|
|
11796
11796
|
};
|
|
11797
11797
|
|
|
11798
|
-
//
|
|
11798
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/json-schema-processors.js
|
|
11799
11799
|
var formatMap = {
|
|
11800
11800
|
guid: "uuid",
|
|
11801
11801
|
url: "uri",
|
|
@@ -12339,7 +12339,7 @@ function toJSONSchema(input, params) {
|
|
|
12339
12339
|
return finalize(ctx, input);
|
|
12340
12340
|
}
|
|
12341
12341
|
|
|
12342
|
-
//
|
|
12342
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/json-schema-generator.js
|
|
12343
12343
|
var JSONSchemaGenerator = class {
|
|
12344
12344
|
/** @deprecated Access via ctx instead */
|
|
12345
12345
|
get metadataRegistry() {
|
|
@@ -12414,10 +12414,10 @@ var JSONSchemaGenerator = class {
|
|
|
12414
12414
|
}
|
|
12415
12415
|
};
|
|
12416
12416
|
|
|
12417
|
-
//
|
|
12417
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/core/json-schema.js
|
|
12418
12418
|
var json_schema_exports = {};
|
|
12419
12419
|
|
|
12420
|
-
//
|
|
12420
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/schemas.js
|
|
12421
12421
|
var schemas_exports2 = {};
|
|
12422
12422
|
__export(schemas_exports2, {
|
|
12423
12423
|
ZodAny: () => ZodAny,
|
|
@@ -12588,7 +12588,7 @@ __export(schemas_exports2, {
|
|
|
12588
12588
|
xor: () => xor
|
|
12589
12589
|
});
|
|
12590
12590
|
|
|
12591
|
-
//
|
|
12591
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/checks.js
|
|
12592
12592
|
var checks_exports2 = {};
|
|
12593
12593
|
__export(checks_exports2, {
|
|
12594
12594
|
endsWith: () => _endsWith,
|
|
@@ -12622,7 +12622,7 @@ __export(checks_exports2, {
|
|
|
12622
12622
|
uppercase: () => _uppercase
|
|
12623
12623
|
});
|
|
12624
12624
|
|
|
12625
|
-
//
|
|
12625
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/iso.js
|
|
12626
12626
|
var iso_exports = {};
|
|
12627
12627
|
__export(iso_exports, {
|
|
12628
12628
|
ZodISODate: () => ZodISODate,
|
|
@@ -12663,7 +12663,7 @@ function duration2(params) {
|
|
|
12663
12663
|
return _isoDuration(ZodISODuration, params);
|
|
12664
12664
|
}
|
|
12665
12665
|
|
|
12666
|
-
//
|
|
12666
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/errors.js
|
|
12667
12667
|
var initializer2 = (inst, issues) => {
|
|
12668
12668
|
$ZodError.init(inst, issues);
|
|
12669
12669
|
inst.name = "ZodError";
|
|
@@ -12703,7 +12703,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
|
|
|
12703
12703
|
Parent: Error
|
|
12704
12704
|
});
|
|
12705
12705
|
|
|
12706
|
-
//
|
|
12706
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/parse.js
|
|
12707
12707
|
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
12708
12708
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
12709
12709
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -12717,7 +12717,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
12717
12717
|
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
12718
12718
|
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
12719
12719
|
|
|
12720
|
-
//
|
|
12720
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/schemas.js
|
|
12721
12721
|
var _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
12722
12722
|
function _installLazyMethods(inst, group, methods) {
|
|
12723
12723
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -14007,7 +14007,7 @@ function preprocess(fn, schema) {
|
|
|
14007
14007
|
});
|
|
14008
14008
|
}
|
|
14009
14009
|
|
|
14010
|
-
//
|
|
14010
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/compat.js
|
|
14011
14011
|
var ZodIssueCode = {
|
|
14012
14012
|
invalid_type: "invalid_type",
|
|
14013
14013
|
too_big: "too_big",
|
|
@@ -14033,7 +14033,7 @@ var ZodFirstPartyTypeKind;
|
|
|
14033
14033
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
14034
14034
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
14035
14035
|
|
|
14036
|
-
//
|
|
14036
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/from-json-schema.js
|
|
14037
14037
|
var z = {
|
|
14038
14038
|
...schemas_exports2,
|
|
14039
14039
|
...checks_exports2,
|
|
@@ -14513,7 +14513,7 @@ function fromJSONSchema(schema, params) {
|
|
|
14513
14513
|
return convertSchema(normalized, ctx);
|
|
14514
14514
|
}
|
|
14515
14515
|
|
|
14516
|
-
//
|
|
14516
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/coerce.js
|
|
14517
14517
|
var coerce_exports = {};
|
|
14518
14518
|
__export(coerce_exports, {
|
|
14519
14519
|
bigint: () => bigint3,
|
|
@@ -14538,7 +14538,7 @@ function date4(params) {
|
|
|
14538
14538
|
return _coercedDate(ZodDate, params);
|
|
14539
14539
|
}
|
|
14540
14540
|
|
|
14541
|
-
//
|
|
14541
|
+
// ../../../../.nvm/versions/node/v24.19.0/lib/node_modules/@deepseek-ai/dsh/node_modules/zod/v4/classic/external.js
|
|
14542
14542
|
config(en_default());
|
|
14543
14543
|
|
|
14544
14544
|
// src/client/remote-contribution.js
|
|
@@ -14572,7 +14572,8 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema = external_export
|
|
|
14572
14572
|
"env": external_exports.array(external_exports.object({
|
|
14573
14573
|
"name": external_exports.string().readonly(),
|
|
14574
14574
|
"secret": external_exports.boolean().readonly(),
|
|
14575
|
-
"configured": external_exports.boolean().readonly()
|
|
14575
|
+
"configured": external_exports.boolean().readonly(),
|
|
14576
|
+
"value": external_exports.string().readonly().optional()
|
|
14576
14577
|
})).readonly(),
|
|
14577
14578
|
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14578
14579
|
"failOnStartupError": external_exports.boolean().readonly(),
|
|
@@ -14604,7 +14605,7 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema = external_e
|
|
|
14604
14605
|
"name": external_exports.string().readonly(),
|
|
14605
14606
|
"secret": external_exports.boolean().readonly(),
|
|
14606
14607
|
"value": external_exports.string().readonly().optional()
|
|
14607
|
-
})).readonly()
|
|
14608
|
+
})).readonly().optional()
|
|
14608
14609
|
});
|
|
14609
14610
|
var _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema = external_exports.object({
|
|
14610
14611
|
"ok": external_exports.literal(true).readonly(),
|
|
@@ -14641,7 +14642,7 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema = external
|
|
|
14641
14642
|
"name": external_exports.string().readonly(),
|
|
14642
14643
|
"secret": external_exports.boolean().readonly(),
|
|
14643
14644
|
"value": external_exports.string().readonly().optional()
|
|
14644
|
-
})).readonly()
|
|
14645
|
+
})).readonly().optional()
|
|
14645
14646
|
});
|
|
14646
14647
|
var _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema = external_exports.union([external_exports.object({
|
|
14647
14648
|
"ok": external_exports.literal(true).readonly(),
|
|
@@ -14661,7 +14662,8 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema = external_expo
|
|
|
14661
14662
|
"env": external_exports.array(external_exports.object({
|
|
14662
14663
|
"name": external_exports.string().readonly(),
|
|
14663
14664
|
"secret": external_exports.boolean().readonly(),
|
|
14664
|
-
"configured": external_exports.boolean().readonly()
|
|
14665
|
+
"configured": external_exports.boolean().readonly(),
|
|
14666
|
+
"value": external_exports.string().readonly().optional()
|
|
14665
14667
|
})).readonly(),
|
|
14666
14668
|
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14667
14669
|
"failOnStartupError": external_exports.boolean().readonly(),
|
|
@@ -14678,6 +14680,69 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema = external_expo
|
|
|
14678
14680
|
"message": external_exports.string().readonly()
|
|
14679
14681
|
}).readonly()
|
|
14680
14682
|
})]);
|
|
14683
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema = external_exports.object({
|
|
14684
|
+
"servers": external_exports.array(external_exports.object({
|
|
14685
|
+
"server": external_exports.object({
|
|
14686
|
+
"serverName": external_exports.string().readonly(),
|
|
14687
|
+
"transport": external_exports.union([external_exports.literal("stdio"), external_exports.literal("streamable-http")]).readonly(),
|
|
14688
|
+
"enabled": external_exports.boolean().readonly().optional(),
|
|
14689
|
+
"command": external_exports.string().readonly().optional(),
|
|
14690
|
+
"args": external_exports.array(external_exports.string()).readonly().optional(),
|
|
14691
|
+
"cwd": external_exports.string().readonly().optional(),
|
|
14692
|
+
"url": external_exports.string().readonly().optional(),
|
|
14693
|
+
"headers": external_exports.union([external_exports.record(external_exports.string(), external_exports.string()), external_exports.array(external_exports.object({
|
|
14694
|
+
"name": external_exports.string().readonly(),
|
|
14695
|
+
"value": external_exports.string().readonly()
|
|
14696
|
+
})).readonly()]).readonly().optional(),
|
|
14697
|
+
"toolCallTimeoutMs": external_exports.number().readonly().optional(),
|
|
14698
|
+
"failOnStartupError": external_exports.boolean().readonly().optional()
|
|
14699
|
+
}).readonly(),
|
|
14700
|
+
"env": external_exports.array(external_exports.object({
|
|
14701
|
+
"name": external_exports.string().readonly(),
|
|
14702
|
+
"secret": external_exports.boolean().readonly().optional(),
|
|
14703
|
+
"value": external_exports.string().readonly().optional()
|
|
14704
|
+
})).readonly().optional()
|
|
14705
|
+
})).readonly()
|
|
14706
|
+
});
|
|
14707
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema = external_exports.union([external_exports.object({
|
|
14708
|
+
"ok": external_exports.literal(true).readonly(),
|
|
14709
|
+
"added": external_exports.number().readonly(),
|
|
14710
|
+
"updated": external_exports.number().readonly(),
|
|
14711
|
+
"removed": external_exports.number().readonly(),
|
|
14712
|
+
"servers": external_exports.array(external_exports.object({
|
|
14713
|
+
"id": external_exports.intersection(external_exports.string(), external_exports.unknown()).readonly(),
|
|
14714
|
+
"serverName": external_exports.string().readonly(),
|
|
14715
|
+
"transport": external_exports.union([external_exports.literal("stdio"), external_exports.literal("streamable-http")]).readonly(),
|
|
14716
|
+
"enabled": external_exports.boolean().readonly(),
|
|
14717
|
+
"command": external_exports.string().readonly(),
|
|
14718
|
+
"args": external_exports.array(external_exports.string()).readonly(),
|
|
14719
|
+
"cwd": external_exports.string().readonly(),
|
|
14720
|
+
"url": external_exports.string().readonly(),
|
|
14721
|
+
"headers": external_exports.array(external_exports.object({
|
|
14722
|
+
"name": external_exports.string().readonly(),
|
|
14723
|
+
"value": external_exports.string().readonly()
|
|
14724
|
+
})).readonly(),
|
|
14725
|
+
"env": external_exports.array(external_exports.object({
|
|
14726
|
+
"name": external_exports.string().readonly(),
|
|
14727
|
+
"secret": external_exports.boolean().readonly(),
|
|
14728
|
+
"configured": external_exports.boolean().readonly(),
|
|
14729
|
+
"value": external_exports.string().readonly().optional()
|
|
14730
|
+
})).readonly(),
|
|
14731
|
+
"toolCallTimeoutMs": external_exports.number().readonly(),
|
|
14732
|
+
"failOnStartupError": external_exports.boolean().readonly(),
|
|
14733
|
+
"status": external_exports.object({
|
|
14734
|
+
"phase": external_exports.union([external_exports.literal("failed"), external_exports.literal("stopped"), external_exports.literal("mounting"), external_exports.literal("live")]).readonly(),
|
|
14735
|
+
"tools": external_exports.array(external_exports.string()).readonly(),
|
|
14736
|
+
"error": external_exports.string().readonly().optional()
|
|
14737
|
+
}).readonly()
|
|
14738
|
+
})).readonly()
|
|
14739
|
+
}), external_exports.object({
|
|
14740
|
+
"ok": external_exports.literal(false).readonly(),
|
|
14741
|
+
"error": external_exports.object({
|
|
14742
|
+
"code": external_exports.union([external_exports.literal("MCP_SERVER_NOT_FOUND"), external_exports.literal("MCP_SERVER_NAME_CONFLICT"), external_exports.literal("MCP_INVALID_SPEC"), external_exports.literal("MCP_MOUNT_FAILED")]).readonly(),
|
|
14743
|
+
"message": external_exports.string().readonly()
|
|
14744
|
+
}).readonly()
|
|
14745
|
+
})]);
|
|
14681
14746
|
var _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema = external_exports.object({
|
|
14682
14747
|
"ok": external_exports.literal(true).readonly(),
|
|
14683
14748
|
"tools": external_exports.array(external_exports.object({
|
|
@@ -14715,6 +14780,37 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema = external_e
|
|
|
14715
14780
|
"message": external_exports.string().readonly()
|
|
14716
14781
|
}).readonly()
|
|
14717
14782
|
})]);
|
|
14783
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema = external_exports.object({
|
|
14784
|
+
"ok": external_exports.literal(true).readonly(),
|
|
14785
|
+
"vars": external_exports.array(external_exports.object({
|
|
14786
|
+
"name": external_exports.string().readonly(),
|
|
14787
|
+
"secret": external_exports.boolean().readonly(),
|
|
14788
|
+
"configured": external_exports.boolean().readonly(),
|
|
14789
|
+
"value": external_exports.string().readonly().optional()
|
|
14790
|
+
})).readonly()
|
|
14791
|
+
});
|
|
14792
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema = external_exports.object({
|
|
14793
|
+
"vars": external_exports.array(external_exports.object({
|
|
14794
|
+
"name": external_exports.string().readonly(),
|
|
14795
|
+
"secret": external_exports.boolean().readonly().optional(),
|
|
14796
|
+
"value": external_exports.string().readonly().optional()
|
|
14797
|
+
})).readonly()
|
|
14798
|
+
});
|
|
14799
|
+
var _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema = external_exports.union([external_exports.object({
|
|
14800
|
+
"ok": external_exports.literal(true).readonly(),
|
|
14801
|
+
"vars": external_exports.array(external_exports.object({
|
|
14802
|
+
"name": external_exports.string().readonly(),
|
|
14803
|
+
"secret": external_exports.boolean().readonly(),
|
|
14804
|
+
"configured": external_exports.boolean().readonly(),
|
|
14805
|
+
"value": external_exports.string().readonly().optional()
|
|
14806
|
+
})).readonly()
|
|
14807
|
+
}), external_exports.object({
|
|
14808
|
+
"ok": external_exports.literal(false).readonly(),
|
|
14809
|
+
"error": external_exports.object({
|
|
14810
|
+
"code": external_exports.union([external_exports.literal("MCP_INVALID_SPEC")]).readonly(),
|
|
14811
|
+
"message": external_exports.string().readonly()
|
|
14812
|
+
}).readonly()
|
|
14813
|
+
})]);
|
|
14718
14814
|
var TYPERT_REMOTE = {
|
|
14719
14815
|
package: "@deepseek-ai/dsh-mcp-manager",
|
|
14720
14816
|
descriptors: [
|
|
@@ -14807,6 +14903,31 @@ var TYPERT_REMOTE = {
|
|
|
14807
14903
|
},
|
|
14808
14904
|
sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 329, "column": 9 }
|
|
14809
14905
|
},
|
|
14906
|
+
{
|
|
14907
|
+
id: "@deepseek-ai/dsh-mcp-manager#mcpManager/upsertJson",
|
|
14908
|
+
service: "mcpManager",
|
|
14909
|
+
namespace: "mcpManager",
|
|
14910
|
+
method: "upsertJson",
|
|
14911
|
+
invocation: { kind: "direct" },
|
|
14912
|
+
parameters: [
|
|
14913
|
+
{
|
|
14914
|
+
name: "request",
|
|
14915
|
+
wire: "request",
|
|
14916
|
+
source: "json",
|
|
14917
|
+
codec: {
|
|
14918
|
+
mode: "strict",
|
|
14919
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonRequest",
|
|
14920
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema
|
|
14921
|
+
}
|
|
14922
|
+
}
|
|
14923
|
+
],
|
|
14924
|
+
result: {
|
|
14925
|
+
mode: "strict",
|
|
14926
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonResult",
|
|
14927
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema
|
|
14928
|
+
},
|
|
14929
|
+
sourceLocation: { "file": "lib/index.js" }
|
|
14930
|
+
},
|
|
14810
14931
|
{
|
|
14811
14932
|
id: "@deepseek-ai/dsh-mcp-manager#mcpManager/toolsList",
|
|
14812
14933
|
service: "mcpManager",
|
|
@@ -14870,168 +14991,56 @@ var TYPERT_REMOTE = {
|
|
|
14870
14991
|
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema
|
|
14871
14992
|
},
|
|
14872
14993
|
sourceLocation: { "file": "lib/index.js" }
|
|
14994
|
+
},
|
|
14995
|
+
{
|
|
14996
|
+
id: "@deepseek-ai/dsh-mcp-manager#mcpManager/envList",
|
|
14997
|
+
service: "mcpManager",
|
|
14998
|
+
namespace: "mcpManager",
|
|
14999
|
+
method: "envList",
|
|
15000
|
+
invocation: { kind: "direct" },
|
|
15001
|
+
parameters: [],
|
|
15002
|
+
result: {
|
|
15003
|
+
mode: "strict",
|
|
15004
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvListResult",
|
|
15005
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema
|
|
15006
|
+
},
|
|
15007
|
+
sourceLocation: { "file": "lib/index.js" }
|
|
15008
|
+
},
|
|
15009
|
+
{
|
|
15010
|
+
id: "@deepseek-ai/dsh-mcp-manager#mcpManager/envSet",
|
|
15011
|
+
service: "mcpManager",
|
|
15012
|
+
namespace: "mcpManager",
|
|
15013
|
+
method: "envSet",
|
|
15014
|
+
invocation: { kind: "direct" },
|
|
15015
|
+
parameters: [
|
|
15016
|
+
{
|
|
15017
|
+
name: "request",
|
|
15018
|
+
wire: "request",
|
|
15019
|
+
source: "json",
|
|
15020
|
+
codec: {
|
|
15021
|
+
mode: "strict",
|
|
15022
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetRequest",
|
|
15023
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema
|
|
15024
|
+
}
|
|
15025
|
+
}
|
|
15026
|
+
],
|
|
15027
|
+
result: {
|
|
15028
|
+
mode: "strict",
|
|
15029
|
+
typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetResult",
|
|
15030
|
+
schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema
|
|
15031
|
+
},
|
|
15032
|
+
sourceLocation: { "file": "lib/index.js" }
|
|
14873
15033
|
}
|
|
14874
15034
|
]
|
|
14875
15035
|
};
|
|
14876
15036
|
var remote_contribution_default = TYPERT_REMOTE;
|
|
14877
15037
|
|
|
14878
15038
|
// src/client/McpSettingsSection.tsx
|
|
14879
|
-
var
|
|
15039
|
+
var import_react4 = require("react");
|
|
14880
15040
|
|
|
14881
15041
|
// src/client/ServerForm.tsx
|
|
14882
15042
|
var import_react = require("react");
|
|
14883
15043
|
|
|
14884
|
-
// src/client/mcp-store.ts
|
|
14885
|
-
var import_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
14886
|
-
var DEFAULT_TOOL_CALL_TIMEOUT_MS = 6e4;
|
|
14887
|
-
var envRowSeq = 0;
|
|
14888
|
-
function nextEnvRowKey() {
|
|
14889
|
-
envRowSeq += 1;
|
|
14890
|
-
return `env-${envRowSeq}`;
|
|
14891
|
-
}
|
|
14892
|
-
function createEnvRowDraft() {
|
|
14893
|
-
return { key: nextEnvRowKey(), name: "", secret: false, value: "", configured: false };
|
|
14894
|
-
}
|
|
14895
|
-
function emptyDraft() {
|
|
14896
|
-
return {
|
|
14897
|
-
id: null,
|
|
14898
|
-
serverName: "",
|
|
14899
|
-
transport: "stdio",
|
|
14900
|
-
enabled: true,
|
|
14901
|
-
command: "",
|
|
14902
|
-
argsText: "",
|
|
14903
|
-
cwd: "",
|
|
14904
|
-
url: "",
|
|
14905
|
-
headersText: "",
|
|
14906
|
-
env: [],
|
|
14907
|
-
toolCallTimeoutMs: String(DEFAULT_TOOL_CALL_TIMEOUT_MS),
|
|
14908
|
-
// Reject the mount by default when the startup connection fails, so a
|
|
14909
|
-
// broken server never registers stale tools.
|
|
14910
|
-
failOnStartupError: true
|
|
14911
|
-
};
|
|
14912
|
-
}
|
|
14913
|
-
function draftFromServer(server) {
|
|
14914
|
-
return {
|
|
14915
|
-
id: server.id,
|
|
14916
|
-
serverName: server.serverName,
|
|
14917
|
-
transport: server.transport,
|
|
14918
|
-
enabled: server.enabled,
|
|
14919
|
-
command: server.command,
|
|
14920
|
-
argsText: server.args.join("\n"),
|
|
14921
|
-
cwd: server.cwd,
|
|
14922
|
-
url: server.url,
|
|
14923
|
-
headersText: server.headers.map((header) => `${header.name}: ${header.value}`).join("\n"),
|
|
14924
|
-
env: server.env.map((entry) => ({
|
|
14925
|
-
key: nextEnvRowKey(),
|
|
14926
|
-
name: entry.name,
|
|
14927
|
-
secret: entry.secret,
|
|
14928
|
-
value: "",
|
|
14929
|
-
configured: entry.configured
|
|
14930
|
-
})),
|
|
14931
|
-
toolCallTimeoutMs: String(server.toolCallTimeoutMs),
|
|
14932
|
-
failOnStartupError: server.failOnStartupError
|
|
14933
|
-
};
|
|
14934
|
-
}
|
|
14935
|
-
function parseLines(text) {
|
|
14936
|
-
return text.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
14937
|
-
}
|
|
14938
|
-
function parseHeaders(text) {
|
|
14939
|
-
const headers = [];
|
|
14940
|
-
for (const line of parseLines(text)) {
|
|
14941
|
-
const separator = line.indexOf(":");
|
|
14942
|
-
if (separator <= 0) continue;
|
|
14943
|
-
const name = line.slice(0, separator).trim();
|
|
14944
|
-
const value = line.slice(separator + 1).trim();
|
|
14945
|
-
if (name.length > 0) headers.push({ name, value });
|
|
14946
|
-
}
|
|
14947
|
-
return headers;
|
|
14948
|
-
}
|
|
14949
|
-
function parseTimeout(text) {
|
|
14950
|
-
const value = Number(text);
|
|
14951
|
-
return Number.isInteger(value) && value > 0 ? value : DEFAULT_TOOL_CALL_TIMEOUT_MS;
|
|
14952
|
-
}
|
|
14953
|
-
function draftToSubmission(draft) {
|
|
14954
|
-
return {
|
|
14955
|
-
server: {
|
|
14956
|
-
serverName: draft.serverName.trim(),
|
|
14957
|
-
transport: draft.transport,
|
|
14958
|
-
enabled: draft.enabled,
|
|
14959
|
-
command: draft.command.trim(),
|
|
14960
|
-
args: parseLines(draft.argsText),
|
|
14961
|
-
cwd: draft.cwd.trim(),
|
|
14962
|
-
url: draft.url.trim(),
|
|
14963
|
-
headers: parseHeaders(draft.headersText),
|
|
14964
|
-
toolCallTimeoutMs: parseTimeout(draft.toolCallTimeoutMs),
|
|
14965
|
-
failOnStartupError: draft.failOnStartupError
|
|
14966
|
-
},
|
|
14967
|
-
env: draft.env.map((row) => ({
|
|
14968
|
-
name: row.name.trim(),
|
|
14969
|
-
secret: row.secret,
|
|
14970
|
-
...row.secret && row.value.trim().length === 0 ? {} : { value: row.value }
|
|
14971
|
-
}))
|
|
14972
|
-
};
|
|
14973
|
-
}
|
|
14974
|
-
function failureLocaleKey(code) {
|
|
14975
|
-
switch (code) {
|
|
14976
|
-
case "MCP_SERVER_NAME_CONFLICT":
|
|
14977
|
-
return "serverNameConflict";
|
|
14978
|
-
case "MCP_SERVER_NOT_FOUND":
|
|
14979
|
-
return "notFound";
|
|
14980
|
-
case "MCP_INVALID_SPEC":
|
|
14981
|
-
return "invalidSpec";
|
|
14982
|
-
case "MCP_MOUNT_FAILED":
|
|
14983
|
-
return "mountFailed";
|
|
14984
|
-
default:
|
|
14985
|
-
return "failureTitle";
|
|
14986
|
-
}
|
|
14987
|
-
}
|
|
14988
|
-
function createMcpManagerStore() {
|
|
14989
|
-
return (0, import_client.defineStore)({
|
|
14990
|
-
init: () => ({
|
|
14991
|
-
loadState: "loading",
|
|
14992
|
-
servers: [],
|
|
14993
|
-
draft: null,
|
|
14994
|
-
busy: null,
|
|
14995
|
-
testRunning: false,
|
|
14996
|
-
test: null
|
|
14997
|
-
}),
|
|
14998
|
-
actions: {
|
|
14999
|
-
setLoadState: (d, state) => {
|
|
15000
|
-
d.loadState = state;
|
|
15001
|
-
},
|
|
15002
|
-
setServers: (d, servers) => {
|
|
15003
|
-
d.servers = servers;
|
|
15004
|
-
},
|
|
15005
|
-
beginCreate: (d) => {
|
|
15006
|
-
d.draft = emptyDraft();
|
|
15007
|
-
d.test = null;
|
|
15008
|
-
},
|
|
15009
|
-
beginEdit: (d, server) => {
|
|
15010
|
-
d.draft = draftFromServer(server);
|
|
15011
|
-
d.test = null;
|
|
15012
|
-
},
|
|
15013
|
-
cancelEdit: (d) => {
|
|
15014
|
-
d.draft = null;
|
|
15015
|
-
d.test = null;
|
|
15016
|
-
d.busy = null;
|
|
15017
|
-
},
|
|
15018
|
-
updateDraft: (d, patch) => {
|
|
15019
|
-
if (d.draft === null) return;
|
|
15020
|
-
d.draft = { ...d.draft, ...patch };
|
|
15021
|
-
},
|
|
15022
|
-
setBusy: (d, busy) => {
|
|
15023
|
-
d.busy = busy;
|
|
15024
|
-
},
|
|
15025
|
-
setTestRunning: (d, running) => {
|
|
15026
|
-
d.testRunning = running;
|
|
15027
|
-
},
|
|
15028
|
-
setTest: (d, test) => {
|
|
15029
|
-
d.test = test;
|
|
15030
|
-
}
|
|
15031
|
-
}
|
|
15032
|
-
});
|
|
15033
|
-
}
|
|
15034
|
-
|
|
15035
15044
|
// src/client/ServerForm.module.css
|
|
15036
15045
|
(function() {
|
|
15037
15046
|
if (typeof document !== "undefined") {
|
|
@@ -15040,12 +15049,12 @@ function createMcpManagerStore() {
|
|
|
15040
15049
|
const style = document.createElement("style");
|
|
15041
15050
|
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15042
15051
|
style.setAttribute("data-file", "ServerForm.module.css");
|
|
15043
|
-
style.textContent = ".form {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.titleActions {\n display: flex;\n gap: 8px;\n}\n\nbutton {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\nbutton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.danger {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.field input,\n.field select,\n.field textarea {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 6px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n resize: vertical;\n}\n\n.field input::placeholder,\n.field textarea::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.field input:focus-visible,\n.field select:focus-visible,\n.field textarea:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.
|
|
15052
|
+
style.textContent = ".form {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.titleRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.title {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.titleActions {\n display: flex;\n gap: 8px;\n}\n\nbutton {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\nbutton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.danger {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.field input,\n.field select,\n.field textarea {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 6px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n resize: vertical;\n}\n\n.field input::placeholder,\n.field textarea::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.field input:focus-visible,\n.field select:focus-visible,\n.field textarea:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.checkRow {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n\n.testResult {\n margin: 0;\n font-size: 13px;\n line-height: 20px;\n}\n\n.testOk {\n color: var(--dsw-alias-state-success-primary);\n}\n\n.testFail {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n";
|
|
15044
15053
|
document.head.appendChild(style);
|
|
15045
15054
|
}
|
|
15046
15055
|
}
|
|
15047
15056
|
})();
|
|
15048
|
-
var ServerForm_default = { "form": "form", "titleRow": "titleRow", "title": "title", "titleActions": "titleActions", "primary": "primary", "danger": "danger", "error": "error", "field": "field", "
|
|
15057
|
+
var ServerForm_default = { "form": "form", "titleRow": "titleRow", "title": "title", "titleActions": "titleActions", "primary": "primary", "danger": "danger", "error": "error", "field": "field", "hint": "hint", "muted": "muted", "checkRow": "checkRow", "testResult": "testResult", "testOk": "testOk", "testFail": "testFail", "actions": "actions" };
|
|
15049
15058
|
|
|
15050
15059
|
// src/client/ServerForm.tsx
|
|
15051
15060
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -15056,22 +15065,16 @@ function McpServerForm(props) {
|
|
|
15056
15065
|
setSaveError(null);
|
|
15057
15066
|
actions.updateDraft(patch);
|
|
15058
15067
|
};
|
|
15059
|
-
const
|
|
15060
|
-
update({ env: draft.env.map((row) => row.key === key ? { ...row, ...patch } : row) });
|
|
15061
|
-
};
|
|
15062
|
-
const removeEnvRow = (key) => {
|
|
15063
|
-
update({ env: draft.env.filter((row) => row.key !== key) });
|
|
15064
|
-
};
|
|
15065
|
-
const addEnvRow = () => {
|
|
15066
|
-
update({ env: [...draft.env, createEnvRowDraft()] });
|
|
15067
|
-
};
|
|
15068
|
+
const errorText = (error51) => error51 instanceof Error ? error51.message : String(error51);
|
|
15068
15069
|
const runTest = async () => {
|
|
15069
15070
|
setSaveError(null);
|
|
15070
15071
|
actions.setTestRunning(true);
|
|
15071
15072
|
try {
|
|
15072
15073
|
actions.setTest(await injected.test(draft));
|
|
15073
|
-
} catch {
|
|
15074
|
+
} catch (error51) {
|
|
15075
|
+
console.error("[dsh-mcp] test failed:", error51);
|
|
15074
15076
|
actions.setTest(null);
|
|
15077
|
+
setSaveError(errorText(error51));
|
|
15075
15078
|
} finally {
|
|
15076
15079
|
actions.setTestRunning(false);
|
|
15077
15080
|
}
|
|
@@ -15082,14 +15085,15 @@ function McpServerForm(props) {
|
|
|
15082
15085
|
try {
|
|
15083
15086
|
const failure = await injected.save(draft);
|
|
15084
15087
|
if (failure !== null) {
|
|
15085
|
-
setSaveError(
|
|
15088
|
+
setSaveError(`${failure.code}: ${failure.message}`);
|
|
15086
15089
|
return;
|
|
15087
15090
|
}
|
|
15088
|
-
await refresh();
|
|
15091
|
+
if (!await refresh()) return;
|
|
15089
15092
|
actions.cancelEdit();
|
|
15090
15093
|
onSaved?.();
|
|
15091
|
-
} catch {
|
|
15092
|
-
|
|
15094
|
+
} catch (error51) {
|
|
15095
|
+
console.error("[dsh-mcp] save failed:", error51);
|
|
15096
|
+
setSaveError(errorText(error51));
|
|
15093
15097
|
} finally {
|
|
15094
15098
|
actions.setBusy(null);
|
|
15095
15099
|
}
|
|
@@ -15101,13 +15105,14 @@ function McpServerForm(props) {
|
|
|
15101
15105
|
try {
|
|
15102
15106
|
const failure = await injected.remove(draft.id);
|
|
15103
15107
|
if (failure !== null) {
|
|
15104
|
-
setSaveError(failure.message);
|
|
15108
|
+
setSaveError(`${failure.code}: ${failure.message}`);
|
|
15105
15109
|
return;
|
|
15106
15110
|
}
|
|
15107
|
-
await refresh();
|
|
15111
|
+
if (!await refresh()) return;
|
|
15108
15112
|
actions.cancelEdit();
|
|
15109
|
-
} catch {
|
|
15110
|
-
|
|
15113
|
+
} catch (error51) {
|
|
15114
|
+
console.error("[dsh-mcp] remove failed:", error51);
|
|
15115
|
+
setSaveError(errorText(error51));
|
|
15111
15116
|
} finally {
|
|
15112
15117
|
actions.setBusy(null);
|
|
15113
15118
|
}
|
|
@@ -15115,7 +15120,11 @@ function McpServerForm(props) {
|
|
|
15115
15120
|
const refresh = async () => {
|
|
15116
15121
|
try {
|
|
15117
15122
|
actions.setServers(await injected.list());
|
|
15118
|
-
|
|
15123
|
+
return true;
|
|
15124
|
+
} catch (error51) {
|
|
15125
|
+
console.error("[dsh-mcp] refresh failed:", error51);
|
|
15126
|
+
setSaveError(errorText(error51));
|
|
15127
|
+
return false;
|
|
15119
15128
|
}
|
|
15120
15129
|
};
|
|
15121
15130
|
const stdio = draft.transport === "stdio";
|
|
@@ -15221,52 +15230,6 @@ function McpServerForm(props) {
|
|
|
15221
15230
|
)
|
|
15222
15231
|
] })
|
|
15223
15232
|
] }),
|
|
15224
|
-
stdio ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("fieldset", { className: ServerForm_default.envBlock, children: [
|
|
15225
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("legend", { children: t("envVars") }),
|
|
15226
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: ServerForm_default.hint, children: t("envHint") }),
|
|
15227
|
-
draft.env.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: ServerForm_default.muted, children: [
|
|
15228
|
-
t("envVars"),
|
|
15229
|
-
": 0"
|
|
15230
|
-
] }) : null,
|
|
15231
|
-
draft.env.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ServerForm_default.envRow, children: [
|
|
15232
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15233
|
-
"input",
|
|
15234
|
-
{
|
|
15235
|
-
type: "text",
|
|
15236
|
-
className: ServerForm_default.envName,
|
|
15237
|
-
value: row.name,
|
|
15238
|
-
placeholder: t("envName"),
|
|
15239
|
-
"aria-label": t("envName"),
|
|
15240
|
-
onChange: (event) => updateEnvRow(row.key, { name: event.currentTarget.value })
|
|
15241
|
-
}
|
|
15242
|
-
),
|
|
15243
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15244
|
-
"input",
|
|
15245
|
-
{
|
|
15246
|
-
type: row.secret ? "password" : "text",
|
|
15247
|
-
className: ServerForm_default.envValue,
|
|
15248
|
-
value: row.value,
|
|
15249
|
-
placeholder: row.secret && row.configured ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : t("envValue"),
|
|
15250
|
-
"aria-label": t("envValue"),
|
|
15251
|
-
onChange: (event) => updateEnvRow(row.key, { value: event.currentTarget.value })
|
|
15252
|
-
}
|
|
15253
|
-
),
|
|
15254
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.secretToggle, children: [
|
|
15255
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15256
|
-
"input",
|
|
15257
|
-
{
|
|
15258
|
-
type: "checkbox",
|
|
15259
|
-
checked: row.secret,
|
|
15260
|
-
title: t("envSecretHint"),
|
|
15261
|
-
onChange: (event) => updateEnvRow(row.key, { secret: event.currentTarget.checked })
|
|
15262
|
-
}
|
|
15263
|
-
),
|
|
15264
|
-
t("envSecret")
|
|
15265
|
-
] }),
|
|
15266
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: ServerForm_default.danger, "aria-label": t("removeEnvVar"), onClick: () => removeEnvRow(row.key), children: "\u2715" })
|
|
15267
|
-
] }, row.key)),
|
|
15268
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: addEnvRow, children: t("addEnvVar") })
|
|
15269
|
-
] }) : null,
|
|
15270
15233
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: ServerForm_default.field, children: [
|
|
15271
15234
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("toolCallTimeoutMs") }),
|
|
15272
15235
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -15311,6 +15274,410 @@ function McpServerForm(props) {
|
|
|
15311
15274
|
] });
|
|
15312
15275
|
}
|
|
15313
15276
|
|
|
15277
|
+
// src/client/ServersJsonEditor.tsx
|
|
15278
|
+
var import_react2 = require("react");
|
|
15279
|
+
|
|
15280
|
+
// src/client/ServersJsonEditor.module.css
|
|
15281
|
+
(function() {
|
|
15282
|
+
if (typeof document !== "undefined") {
|
|
15283
|
+
const existing = document.querySelector('style[data-plugin="dsh-mcp"][data-file="ServersJsonEditor.module.css"]');
|
|
15284
|
+
if (!existing) {
|
|
15285
|
+
const style = document.createElement("style");
|
|
15286
|
+
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15287
|
+
style.setAttribute("data-file", "ServersJsonEditor.module.css");
|
|
15288
|
+
style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.editor {\n width: 100%;\n box-sizing: border-box;\n min-height: 260px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.editor:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.hint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n\n.actions button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\n.actions button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.actions button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.actions .primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.actions .primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n";
|
|
15289
|
+
document.head.appendChild(style);
|
|
15290
|
+
}
|
|
15291
|
+
}
|
|
15292
|
+
})();
|
|
15293
|
+
var ServersJsonEditor_default = { "panel": "panel", "editor": "editor", "hint": "hint", "error": "error", "notice": "notice", "actions": "actions", "primary": "primary" };
|
|
15294
|
+
|
|
15295
|
+
// src/client/ServersJsonEditor.tsx
|
|
15296
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
15297
|
+
function serversToJsonText(servers) {
|
|
15298
|
+
const document2 = servers.map((server) => {
|
|
15299
|
+
const entry = {
|
|
15300
|
+
serverName: server.serverName,
|
|
15301
|
+
transport: server.transport,
|
|
15302
|
+
enabled: server.enabled
|
|
15303
|
+
};
|
|
15304
|
+
if (server.transport === "stdio") {
|
|
15305
|
+
entry.command = server.command;
|
|
15306
|
+
entry.args = [...server.args];
|
|
15307
|
+
if (server.cwd.length > 0) entry.cwd = server.cwd;
|
|
15308
|
+
} else {
|
|
15309
|
+
entry.url = server.url;
|
|
15310
|
+
}
|
|
15311
|
+
if (server.headers.length > 0) {
|
|
15312
|
+
entry.headers = Object.fromEntries(server.headers.map((header) => [header.name, header.value]));
|
|
15313
|
+
}
|
|
15314
|
+
entry.toolCallTimeoutMs = server.toolCallTimeoutMs;
|
|
15315
|
+
entry.failOnStartupError = server.failOnStartupError;
|
|
15316
|
+
entry.env = server.env.map((row) => row.secret ? { name: row.name, secret: true, configured: row.configured } : { name: row.name, secret: false, ...row.value !== void 0 && row.value.length > 0 ? { value: row.value } : {} });
|
|
15317
|
+
return entry;
|
|
15318
|
+
});
|
|
15319
|
+
return `${JSON.stringify(document2, null, 2)}
|
|
15320
|
+
`;
|
|
15321
|
+
}
|
|
15322
|
+
function parseServersJson(text) {
|
|
15323
|
+
let value;
|
|
15324
|
+
try {
|
|
15325
|
+
value = JSON.parse(text);
|
|
15326
|
+
} catch (error51) {
|
|
15327
|
+
return { ok: false, error: error51 instanceof Error ? error51.message : String(error51) };
|
|
15328
|
+
}
|
|
15329
|
+
if (!Array.isArray(value)) {
|
|
15330
|
+
return { ok: false, error: "JSON \u9876\u5C42\u5FC5\u987B\u662F\u670D\u52A1\u5668\u914D\u7F6E\u6570\u7EC4\uFF1A[ { serverName, transport, ... }, ... ]" };
|
|
15331
|
+
}
|
|
15332
|
+
if (value.length === 0) {
|
|
15333
|
+
return { ok: false, error: "\u914D\u7F6E\u5217\u8868\u4E0D\u80FD\u4E3A\u7A7A" };
|
|
15334
|
+
}
|
|
15335
|
+
const servers = [];
|
|
15336
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15337
|
+
for (const item of value) {
|
|
15338
|
+
if (item === null || typeof item !== "object" || Array.isArray(item)) {
|
|
15339
|
+
return { ok: false, error: "\u6BCF\u4E2A\u6761\u76EE\u5FC5\u987B\u662F\u5BF9\u8C61\uFF1A{ serverName, transport, ... }" };
|
|
15340
|
+
}
|
|
15341
|
+
const server = item;
|
|
15342
|
+
const serverName = typeof server.serverName === "string" ? server.serverName.trim() : "";
|
|
15343
|
+
if (serverName.length === 0) return { ok: false, error: "serverName \u4E0D\u80FD\u4E3A\u7A7A" };
|
|
15344
|
+
if (seen.has(serverName)) return { ok: false, error: `serverName "${serverName}" \u91CD\u590D` };
|
|
15345
|
+
seen.add(serverName);
|
|
15346
|
+
const transport = server.transport;
|
|
15347
|
+
if (transport !== "stdio" && transport !== "streamable-http") {
|
|
15348
|
+
return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}" \u7684 transport \u5FC5\u987B\u662F stdio \u6216 streamable-http` };
|
|
15349
|
+
}
|
|
15350
|
+
if (transport === "stdio" && (typeof server.command !== "string" || server.command.trim().length === 0)) {
|
|
15351
|
+
return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}"\uFF08stdio\uFF09\u7F3A\u5C11 command` };
|
|
15352
|
+
}
|
|
15353
|
+
if (transport === "streamable-http" && typeof server.url !== "string") {
|
|
15354
|
+
return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}"\uFF08streamable-http\uFF09\u7F3A\u5C11 url` };
|
|
15355
|
+
}
|
|
15356
|
+
if (server.headers !== void 0) {
|
|
15357
|
+
const headers = server.headers;
|
|
15358
|
+
const okHeaders = headers !== null && typeof headers === "object" && !Array.isArray(headers) || Array.isArray(headers) && headers.every((h) => h !== null && typeof h === "object" && typeof h.name === "string");
|
|
15359
|
+
if (!okHeaders) return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}" \u7684 headers \u5FC5\u987B\u662F { "\u540D\u79F0": "\u503C" } \u5BF9\u8C61\u6216 { name, value } \u6570\u7EC4` };
|
|
15360
|
+
}
|
|
15361
|
+
const envValue = server.env;
|
|
15362
|
+
const env = Array.isArray(envValue) ? envValue : [];
|
|
15363
|
+
for (const row of env) {
|
|
15364
|
+
const r = row;
|
|
15365
|
+
if (r === null || typeof r !== "object" || typeof r.name !== "string" || r.name.trim().length === 0) {
|
|
15366
|
+
return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}" \u7684 env \u6761\u76EE\u7F3A\u5C11\u5408\u6CD5\u7684 name` };
|
|
15367
|
+
}
|
|
15368
|
+
if (r.secret !== void 0 && typeof r.secret !== "boolean") {
|
|
15369
|
+
return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}" \u7684 env \u6761\u76EE "${r.name}" \u7684 secret \u5FC5\u987B\u662F\u5E03\u5C14\u503C` };
|
|
15370
|
+
}
|
|
15371
|
+
if (r.value !== void 0 && typeof r.value !== "string") {
|
|
15372
|
+
return { ok: false, error: `\u670D\u52A1\u5668 "${serverName}" \u7684 env \u6761\u76EE "${r.name}" \u7684 value \u5FC5\u987B\u662F\u5B57\u7B26\u4E32` };
|
|
15373
|
+
}
|
|
15374
|
+
}
|
|
15375
|
+
servers.push({ server, env });
|
|
15376
|
+
}
|
|
15377
|
+
return { ok: true, servers };
|
|
15378
|
+
}
|
|
15379
|
+
function ServersJsonEditor({ injected, t, onApplied }) {
|
|
15380
|
+
const [text, setText] = (0, import_react2.useState)("");
|
|
15381
|
+
const [error51, setError] = (0, import_react2.useState)(null);
|
|
15382
|
+
const [notice, setNotice] = (0, import_react2.useState)(null);
|
|
15383
|
+
const [busy, setBusy] = (0, import_react2.useState)(false);
|
|
15384
|
+
const [loaded, setLoaded] = (0, import_react2.useState)(false);
|
|
15385
|
+
const seqRef = (0, import_react2.useRef)(0);
|
|
15386
|
+
(0, import_react2.useEffect)(() => {
|
|
15387
|
+
if (loaded) return;
|
|
15388
|
+
let current = true;
|
|
15389
|
+
void injected.list().then(
|
|
15390
|
+
(servers) => {
|
|
15391
|
+
if (!current) return;
|
|
15392
|
+
setText(serversToJsonText(servers));
|
|
15393
|
+
setLoaded(true);
|
|
15394
|
+
setError(null);
|
|
15395
|
+
},
|
|
15396
|
+
() => {
|
|
15397
|
+
if (current) setError("\u65E0\u6CD5\u8BFB\u53D6\u670D\u52A1\u5668\u5217\u8868");
|
|
15398
|
+
}
|
|
15399
|
+
);
|
|
15400
|
+
return () => {
|
|
15401
|
+
current = false;
|
|
15402
|
+
};
|
|
15403
|
+
}, [injected, loaded]);
|
|
15404
|
+
const reseed = () => {
|
|
15405
|
+
const seq = ++seqRef.current;
|
|
15406
|
+
setBusy(true);
|
|
15407
|
+
setNotice(null);
|
|
15408
|
+
void injected.list().then(
|
|
15409
|
+
(servers) => {
|
|
15410
|
+
if (seq !== seqRef.current) return;
|
|
15411
|
+
setText(serversToJsonText(servers));
|
|
15412
|
+
setError(null);
|
|
15413
|
+
},
|
|
15414
|
+
() => {
|
|
15415
|
+
if (seq === seqRef.current) setError("\u65E0\u6CD5\u8BFB\u53D6\u670D\u52A1\u5668\u5217\u8868");
|
|
15416
|
+
}
|
|
15417
|
+
).finally(() => {
|
|
15418
|
+
if (seq === seqRef.current) setBusy(false);
|
|
15419
|
+
});
|
|
15420
|
+
};
|
|
15421
|
+
const apply2 = () => {
|
|
15422
|
+
const parsed = parseServersJson(text);
|
|
15423
|
+
if (!parsed.ok) {
|
|
15424
|
+
setError(parsed.error);
|
|
15425
|
+
return;
|
|
15426
|
+
}
|
|
15427
|
+
const seq = ++seqRef.current;
|
|
15428
|
+
setBusy(true);
|
|
15429
|
+
setError(null);
|
|
15430
|
+
setNotice(null);
|
|
15431
|
+
void injected.upsertJson(parsed.servers).then(
|
|
15432
|
+
(result) => {
|
|
15433
|
+
if (seq !== seqRef.current) return;
|
|
15434
|
+
setNotice(`${t("serversJsonDone")}: +${result.added} / ~${result.updated} / -${result.removed}`);
|
|
15435
|
+
onApplied();
|
|
15436
|
+
},
|
|
15437
|
+
(error52) => {
|
|
15438
|
+
if (seq !== seqRef.current) return;
|
|
15439
|
+
setError(error52 instanceof Error ? error52.message : String(error52));
|
|
15440
|
+
}
|
|
15441
|
+
).finally(() => {
|
|
15442
|
+
if (seq === seqRef.current) setBusy(false);
|
|
15443
|
+
});
|
|
15444
|
+
};
|
|
15445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: ServersJsonEditor_default.panel, children: [
|
|
15446
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
15447
|
+
"textarea",
|
|
15448
|
+
{
|
|
15449
|
+
className: ServersJsonEditor_default.editor,
|
|
15450
|
+
rows: 16,
|
|
15451
|
+
spellCheck: false,
|
|
15452
|
+
"aria-label": t("serversJsonLabel"),
|
|
15453
|
+
value: text,
|
|
15454
|
+
onChange: (event) => setText(event.currentTarget.value)
|
|
15455
|
+
}
|
|
15456
|
+
),
|
|
15457
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.hint, children: t("serversJsonHint") }),
|
|
15458
|
+
error51 !== null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.error, role: "alert", children: error51 }) : null,
|
|
15459
|
+
notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: ServersJsonEditor_default.notice, role: "status", children: notice }) : null,
|
|
15460
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: ServersJsonEditor_default.actions, children: [
|
|
15461
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: reseed, children: t("serversJsonReseed") }),
|
|
15462
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: ServersJsonEditor_default.primary, disabled: busy, onClick: apply2, children: busy ? t("serversJsonSaving") : t("serversJsonApply") })
|
|
15463
|
+
] })
|
|
15464
|
+
] });
|
|
15465
|
+
}
|
|
15466
|
+
|
|
15467
|
+
// src/client/GlobalEnvEditor.tsx
|
|
15468
|
+
var import_react3 = require("react");
|
|
15469
|
+
|
|
15470
|
+
// src/client/GlobalEnvEditor.module.css
|
|
15471
|
+
(function() {
|
|
15472
|
+
if (typeof document !== "undefined") {
|
|
15473
|
+
const existing = document.querySelector('style[data-plugin="dsh-mcp"][data-file="GlobalEnvEditor.module.css"]');
|
|
15474
|
+
if (!existing) {
|
|
15475
|
+
const style = document.createElement("style");
|
|
15476
|
+
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15477
|
+
style.setAttribute("data-file", "GlobalEnvEditor.module.css");
|
|
15478
|
+
style.textContent = ".panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.hint,\n.muted {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.row {\n display: grid;\n grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) auto auto;\n align-items: center;\n gap: 8px;\n}\n\n.row input {\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 8px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n\n.row input:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.name {\n width: 100%;\n}\n\n.value {\n width: 100%;\n}\n\n.secretToggle {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.danger {\n border: 1px solid transparent !important;\n background: transparent !important;\n color: var(--dsw-alias-state-error-primary) !important;\n cursor: pointer;\n}\n\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.4);\n}\n\n.dialog {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: min(520px, calc(100vw - 48px));\n max-height: 80vh;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 12px;\n padding: 16px;\n background: var(--dsw-alias-bg-overlay);\n box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);\n}\n\n.dialogTitle {\n margin: 0;\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n\n.bulkText {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 8px 10px;\n outline: none;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n resize: vertical;\n}\n\n.bulkText:focus-visible {\n border-color: var(--dsw-alias-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent);\n}\n\n.retryRow {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.retryRow button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 3px 10px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n}\n\n.retryRow button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.error {\n margin: 0;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.notice {\n margin: 0;\n color: var(--dsw-alias-state-success-primary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n\n.actions button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\n.actions button:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.actions button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.actions .primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.actions .primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n";
|
|
15479
|
+
document.head.appendChild(style);
|
|
15480
|
+
}
|
|
15481
|
+
}
|
|
15482
|
+
})();
|
|
15483
|
+
var GlobalEnvEditor_default = { "panel": "panel", "hint": "hint", "muted": "muted", "row": "row", "name": "name", "value": "value", "secretToggle": "secretToggle", "danger": "danger", "overlay": "overlay", "dialog": "dialog", "dialogTitle": "dialogTitle", "bulkText": "bulkText", "retryRow": "retryRow", "error": "error", "notice": "notice", "actions": "actions", "primary": "primary" };
|
|
15484
|
+
|
|
15485
|
+
// src/client/GlobalEnvEditor.tsx
|
|
15486
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
15487
|
+
var rowSeq = 0;
|
|
15488
|
+
function nextKey() {
|
|
15489
|
+
rowSeq += 1;
|
|
15490
|
+
return `genv-${rowSeq}`;
|
|
15491
|
+
}
|
|
15492
|
+
function emptyRow() {
|
|
15493
|
+
return { key: nextKey(), name: "", secret: false, value: "", configured: false };
|
|
15494
|
+
}
|
|
15495
|
+
function GlobalEnvEditor({ injected, t, onApplied }) {
|
|
15496
|
+
const [rows, setRows] = (0, import_react3.useState)([]);
|
|
15497
|
+
const [error51, setError] = (0, import_react3.useState)(null);
|
|
15498
|
+
const [notice, setNotice] = (0, import_react3.useState)(null);
|
|
15499
|
+
const [busy, setBusy] = (0, import_react3.useState)(false);
|
|
15500
|
+
const [loaded, setLoaded] = (0, import_react3.useState)(false);
|
|
15501
|
+
const [loadFailed, setLoadFailed] = (0, import_react3.useState)(false);
|
|
15502
|
+
const [bulkOpen, setBulkOpen] = (0, import_react3.useState)(false);
|
|
15503
|
+
const [bulkText, setBulkText] = (0, import_react3.useState)("");
|
|
15504
|
+
const seqRef = (0, import_react3.useRef)(0);
|
|
15505
|
+
const reload = () => {
|
|
15506
|
+
const seq = ++seqRef.current;
|
|
15507
|
+
setLoadFailed(false);
|
|
15508
|
+
void injected.envList().then(
|
|
15509
|
+
(state) => {
|
|
15510
|
+
if (seq !== seqRef.current) return;
|
|
15511
|
+
setRows(state.vars.map((row) => ({
|
|
15512
|
+
key: nextKey(),
|
|
15513
|
+
name: row.name,
|
|
15514
|
+
secret: row.secret,
|
|
15515
|
+
value: "",
|
|
15516
|
+
configured: row.configured
|
|
15517
|
+
})));
|
|
15518
|
+
setLoaded(true);
|
|
15519
|
+
setError(null);
|
|
15520
|
+
},
|
|
15521
|
+
(error52) => {
|
|
15522
|
+
if (seq !== seqRef.current) return;
|
|
15523
|
+
setLoadFailed(true);
|
|
15524
|
+
setError(error52 instanceof Error ? error52.message : String(error52));
|
|
15525
|
+
}
|
|
15526
|
+
);
|
|
15527
|
+
};
|
|
15528
|
+
(0, import_react3.useEffect)(() => {
|
|
15529
|
+
if (loaded) return;
|
|
15530
|
+
reload();
|
|
15531
|
+
}, [injected, loaded]);
|
|
15532
|
+
const update = (key, patch) => {
|
|
15533
|
+
setRows((prev) => prev.map((row) => row.key === key ? { ...row, ...patch } : row));
|
|
15534
|
+
};
|
|
15535
|
+
const remove = (key) => {
|
|
15536
|
+
setRows((prev) => prev.filter((row) => row.key !== key));
|
|
15537
|
+
};
|
|
15538
|
+
const add = () => {
|
|
15539
|
+
setRows((prev) => [...prev, emptyRow()]);
|
|
15540
|
+
};
|
|
15541
|
+
const applyBulk = () => {
|
|
15542
|
+
const parsed = bulkText.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
|
|
15543
|
+
if (parsed.length === 0) {
|
|
15544
|
+
setBulkOpen(false);
|
|
15545
|
+
return;
|
|
15546
|
+
}
|
|
15547
|
+
const next = [];
|
|
15548
|
+
for (const line of parsed) {
|
|
15549
|
+
const eq = line.indexOf("=");
|
|
15550
|
+
if (eq <= 0) {
|
|
15551
|
+
next.push({ key: nextKey(), name: line, secret: false, value: "", configured: false });
|
|
15552
|
+
continue;
|
|
15553
|
+
}
|
|
15554
|
+
const name = line.slice(0, eq).trim();
|
|
15555
|
+
const value = line.slice(eq + 1);
|
|
15556
|
+
if (name.length === 0) continue;
|
|
15557
|
+
next.push({ key: nextKey(), name, secret: false, value, configured: false });
|
|
15558
|
+
}
|
|
15559
|
+
if (next.length > 0) setRows((prev) => [...prev, ...next]);
|
|
15560
|
+
setBulkOpen(false);
|
|
15561
|
+
setBulkText("");
|
|
15562
|
+
};
|
|
15563
|
+
const save = () => {
|
|
15564
|
+
const vars = [];
|
|
15565
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15566
|
+
for (const row of rows) {
|
|
15567
|
+
const name = row.name.trim();
|
|
15568
|
+
if (name.length === 0) {
|
|
15569
|
+
if (row.value.trim().length > 0) {
|
|
15570
|
+
setError("\u5B58\u5728\u672A\u586B\u5199\u53D8\u91CF\u540D\u7684\u884C");
|
|
15571
|
+
return;
|
|
15572
|
+
}
|
|
15573
|
+
continue;
|
|
15574
|
+
}
|
|
15575
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
15576
|
+
setError(`\u53D8\u91CF\u540D "${name}" \u5FC5\u987B\u662F\u5B57\u6BCD/\u6570\u5B57/\u4E0B\u5212\u7EBF\uFF0C\u4E14\u4EE5\u5B57\u6BCD\u6216\u4E0B\u5212\u7EBF\u5F00\u5934`);
|
|
15577
|
+
return;
|
|
15578
|
+
}
|
|
15579
|
+
if (seen.has(name)) {
|
|
15580
|
+
setError(`\u53D8\u91CF\u540D "${name}" \u91CD\u590D`);
|
|
15581
|
+
return;
|
|
15582
|
+
}
|
|
15583
|
+
seen.add(name);
|
|
15584
|
+
vars.push({
|
|
15585
|
+
name,
|
|
15586
|
+
secret: row.secret,
|
|
15587
|
+
...row.secret ? {} : row.value.trim().length > 0 ? { value: row.value } : {}
|
|
15588
|
+
});
|
|
15589
|
+
}
|
|
15590
|
+
const seq = ++seqRef.current;
|
|
15591
|
+
setBusy(true);
|
|
15592
|
+
setError(null);
|
|
15593
|
+
setNotice(null);
|
|
15594
|
+
void injected.envSet(vars).then(
|
|
15595
|
+
() => {
|
|
15596
|
+
if (seq !== seqRef.current) return;
|
|
15597
|
+
setNotice(t("globalEnvDone"));
|
|
15598
|
+
onApplied();
|
|
15599
|
+
},
|
|
15600
|
+
(error52) => {
|
|
15601
|
+
if (seq !== seqRef.current) return;
|
|
15602
|
+
setError(error52 instanceof Error ? error52.message : String(error52));
|
|
15603
|
+
}
|
|
15604
|
+
).finally(() => {
|
|
15605
|
+
if (seq === seqRef.current) setBusy(false);
|
|
15606
|
+
});
|
|
15607
|
+
};
|
|
15608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.panel, children: [
|
|
15609
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.hint, children: t("globalEnvHint") }),
|
|
15610
|
+
rows.length === 0 && !loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.muted, children: t("globalEnvEmpty") }) : null,
|
|
15611
|
+
rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.row, children: [
|
|
15612
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
15613
|
+
"input",
|
|
15614
|
+
{
|
|
15615
|
+
type: "text",
|
|
15616
|
+
className: GlobalEnvEditor_default.name,
|
|
15617
|
+
value: row.name,
|
|
15618
|
+
placeholder: t("globalEnvName"),
|
|
15619
|
+
"aria-label": t("globalEnvName"),
|
|
15620
|
+
onChange: (event) => update(row.key, { name: event.currentTarget.value })
|
|
15621
|
+
}
|
|
15622
|
+
),
|
|
15623
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
15624
|
+
"input",
|
|
15625
|
+
{
|
|
15626
|
+
type: row.secret ? "password" : "text",
|
|
15627
|
+
className: GlobalEnvEditor_default.value,
|
|
15628
|
+
value: row.value,
|
|
15629
|
+
placeholder: row.secret && row.configured ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : t("globalEnvValue"),
|
|
15630
|
+
"aria-label": t("globalEnvValue"),
|
|
15631
|
+
onChange: (event) => update(row.key, { value: event.currentTarget.value })
|
|
15632
|
+
}
|
|
15633
|
+
),
|
|
15634
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: GlobalEnvEditor_default.secretToggle, children: [
|
|
15635
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
15636
|
+
"input",
|
|
15637
|
+
{
|
|
15638
|
+
type: "checkbox",
|
|
15639
|
+
checked: row.secret,
|
|
15640
|
+
title: t("globalEnvSecretHint"),
|
|
15641
|
+
onChange: (event) => update(row.key, { secret: event.currentTarget.checked })
|
|
15642
|
+
}
|
|
15643
|
+
),
|
|
15644
|
+
t("globalEnvSecret")
|
|
15645
|
+
] }),
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.danger, "aria-label": t("globalEnvRemove"), onClick: () => remove(row.key), children: "\u2715" })
|
|
15647
|
+
] }, row.key)),
|
|
15648
|
+
loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.retryRow, children: [
|
|
15649
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.error, role: "alert", children: t("globalEnvLoadFailed") }),
|
|
15650
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: reload, children: t("globalEnvRetry") })
|
|
15651
|
+
] }) : null,
|
|
15652
|
+
error51 !== null && !loadFailed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.error, role: "alert", children: error51 }) : null,
|
|
15653
|
+
notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.notice, role: "status", children: notice }) : null,
|
|
15654
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.actions, children: [
|
|
15655
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: busy, onClick: add, children: t("globalEnvAdd") }),
|
|
15656
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: busy, onClick: () => setBulkOpen(true), children: t("globalEnvBulk") }),
|
|
15657
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.primary, disabled: busy, onClick: save, children: busy ? t("globalEnvSaving") : t("globalEnvSave") })
|
|
15658
|
+
] }),
|
|
15659
|
+
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: [
|
|
15660
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.dialogTitle, children: t("globalEnvBulk") }),
|
|
15661
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: GlobalEnvEditor_default.hint, children: t("globalEnvBulkPrompt") }),
|
|
15662
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
15663
|
+
"textarea",
|
|
15664
|
+
{
|
|
15665
|
+
className: GlobalEnvEditor_default.bulkText,
|
|
15666
|
+
rows: 8,
|
|
15667
|
+
autoFocus: true,
|
|
15668
|
+
spellCheck: false,
|
|
15669
|
+
value: bulkText,
|
|
15670
|
+
onChange: (event) => setBulkText(event.currentTarget.value)
|
|
15671
|
+
}
|
|
15672
|
+
),
|
|
15673
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: GlobalEnvEditor_default.actions, children: [
|
|
15674
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => setBulkOpen(false), children: t("cancel") }),
|
|
15675
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: GlobalEnvEditor_default.primary, onClick: applyBulk, children: t("globalEnvBulkOk") })
|
|
15676
|
+
] })
|
|
15677
|
+
] }) }) : null
|
|
15678
|
+
] });
|
|
15679
|
+
}
|
|
15680
|
+
|
|
15314
15681
|
// src/client/McpSettingsSection.module.css
|
|
15315
15682
|
(function() {
|
|
15316
15683
|
if (typeof document !== "undefined") {
|
|
@@ -15319,15 +15686,15 @@ function McpServerForm(props) {
|
|
|
15319
15686
|
const style = document.createElement("style");
|
|
15320
15687
|
style.setAttribute("data-plugin", "dsh-mcp");
|
|
15321
15688
|
style.setAttribute("data-file", "McpSettingsSection.module.css");
|
|
15322
|
-
style.textContent = ".section {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.status,\n.failure p {\n margin: 0;\n}\n\n.status,\n.failure {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.failure {\n display: flex;\n align-items: center;\n gap: 10px;\n color: var(--dsw-alias-state-error-primary);\n}\n\nbutton {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\nbutton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.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: center;\n justify-content: space-between;\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-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.rowTitle {\n display: flex;\n align-items: center;\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 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.muted {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.rowMeta {\n display: flex;\n gap: 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 flex: none;\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";
|
|
15689
|
+
style.textContent = ".section {\n display: flex;\n flex-direction: column;\n gap: 14px;\n width: 100%;\n max-width: 760px;\n color: var(--dsw-alias-label-primary);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.status,\n.failure p {\n margin: 0;\n}\n\n.status,\n.failure {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.failure {\n display: flex;\n align-items: center;\n gap: 10px;\n color: var(--dsw-alias-state-error-primary);\n}\n\nbutton {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 5px 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n cursor: pointer;\n}\n\nbutton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\nbutton:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.primary {\n border-color: var(--dsw-alias-button-primary-fill);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.primary:hover {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n.active {\n border-color: var(--dsw-alias-brand-primary);\n color: var(--dsw-alias-brand-primary);\n background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);\n}\n\n.module {\n display: flex;\n flex-direction: column;\n gap: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 10px 14px;\n background: var(--dsw-alias-bg-layer-3);\n}\n\n.moduleTitle {\n display: inline-flex !important;\n align-items: center;\n gap: 6px;\n width: fit-content;\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n font-weight: 600;\n font-size: 14px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary) !important;\n}\n\n.moduleTitle:hover {\n background: transparent !important;\n}\n\n.caret {\n display: inline-block;\n width: 14px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.configHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.configActions {\n display: flex;\n gap: 8px;\n}\n\n.inlineForm {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n}\n\n.inlineFormItem {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 10px;\n padding: 12px 14px;\n background: var(--dsw-alias-bg-layer-2);\n list-style: none;\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.row {\n display: flex;\n align-items: center;\n justify-content: space-between;\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-direction: column;\n gap: 4px;\n min-width: 0;\n}\n\n.rowTitle {\n display: flex;\n align-items: center;\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 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.muted {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.rowMeta {\n display: flex;\n gap: 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 flex: none;\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";
|
|
15323
15690
|
document.head.appendChild(style);
|
|
15324
15691
|
}
|
|
15325
15692
|
}
|
|
15326
15693
|
})();
|
|
15327
|
-
var McpSettingsSection_default = { "section": "section", "header": "header", "status": "status", "failure": "failure", "primary": "primary", "list": "list", "row": "row", "rowMain": "rowMain", "rowTitle": "rowTitle", "serverName": "serverName", "badge": "badge", "mounting": "mounting", "live": "live", "failed": "failed", "stopped": "stopped", "muted": "muted", "rowMeta": "rowMeta", "rowActions": "rowActions", "card": "card", "modeRow": "modeRow", "modeLabel": "modeLabel", "modeOption": "modeOption", "modeHint": "modeHint", "toolPanel": "toolPanel", "toolGrid": "toolGrid", "toolRow": "toolRow", "toolName": "toolName" };
|
|
15694
|
+
var McpSettingsSection_default = { "section": "section", "header": "header", "status": "status", "failure": "failure", "primary": "primary", "active": "active", "module": "module", "moduleTitle": "moduleTitle", "caret": "caret", "configHeader": "configHeader", "configActions": "configActions", "inlineForm": "inlineForm", "inlineFormItem": "inlineFormItem", "list": "list", "row": "row", "rowMain": "rowMain", "rowTitle": "rowTitle", "serverName": "serverName", "badge": "badge", "mounting": "mounting", "live": "live", "failed": "failed", "stopped": "stopped", "muted": "muted", "rowMeta": "rowMeta", "rowActions": "rowActions", "card": "card", "modeRow": "modeRow", "modeLabel": "modeLabel", "modeOption": "modeOption", "modeHint": "modeHint", "toolPanel": "toolPanel", "toolGrid": "toolGrid", "toolRow": "toolRow", "toolName": "toolName" };
|
|
15328
15695
|
|
|
15329
15696
|
// src/client/McpSettingsSection.tsx
|
|
15330
|
-
var
|
|
15697
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
15331
15698
|
function phaseKey(phase) {
|
|
15332
15699
|
switch (phase) {
|
|
15333
15700
|
case "mounting":
|
|
@@ -15356,13 +15723,6 @@ function viewToDraft(server) {
|
|
|
15356
15723
|
cwd: server.cwd,
|
|
15357
15724
|
url: server.url,
|
|
15358
15725
|
headersText: server.headers.map((header) => `${header.name}: ${header.value}`).join("\n"),
|
|
15359
|
-
env: server.env.map((entry, index) => ({
|
|
15360
|
-
key: `view-${index}`,
|
|
15361
|
-
name: entry.name,
|
|
15362
|
-
secret: entry.secret,
|
|
15363
|
-
value: "",
|
|
15364
|
-
configured: entry.configured
|
|
15365
|
-
})),
|
|
15366
15726
|
toolCallTimeoutMs: String(server.toolCallTimeoutMs),
|
|
15367
15727
|
failOnStartupError: server.failOnStartupError
|
|
15368
15728
|
};
|
|
@@ -15372,13 +15732,16 @@ function McpSettingsSection(props) {
|
|
|
15372
15732
|
const state = props.useStore((snapshot) => snapshot);
|
|
15373
15733
|
const { setLoadState, setServers, beginCreate, beginEdit, cancelEdit, updateDraft, setBusy, setTestRunning, setTest } = props.actions;
|
|
15374
15734
|
const t = props.t;
|
|
15375
|
-
const [loadErrorDetail, setLoadErrorDetail] = (0,
|
|
15376
|
-
const [tools, setTools] = (0,
|
|
15377
|
-
const [toolsError, setToolsError] = (0,
|
|
15378
|
-
const [expanded, setExpanded] = (0,
|
|
15379
|
-
const [refreshing, setRefreshing] = (0,
|
|
15380
|
-
const
|
|
15381
|
-
(0,
|
|
15735
|
+
const [loadErrorDetail, setLoadErrorDetail] = (0, import_react4.useState)(null);
|
|
15736
|
+
const [tools, setTools] = (0, import_react4.useState)(null);
|
|
15737
|
+
const [toolsError, setToolsError] = (0, import_react4.useState)(null);
|
|
15738
|
+
const [expanded, setExpanded] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
|
|
15739
|
+
const [refreshing, setRefreshing] = (0, import_react4.useState)(/* @__PURE__ */ new Set());
|
|
15740
|
+
const [jsonOpen, setJsonOpen] = (0, import_react4.useState)(false);
|
|
15741
|
+
const [envOpen, setEnvOpen] = (0, import_react4.useState)(true);
|
|
15742
|
+
const timersRef = (0, import_react4.useRef)([]);
|
|
15743
|
+
let inlineForm = null;
|
|
15744
|
+
(0, import_react4.useEffect)(() => () => {
|
|
15382
15745
|
for (const id of timersRef.current) window.clearTimeout(id);
|
|
15383
15746
|
}, []);
|
|
15384
15747
|
const refreshTools = () => {
|
|
@@ -15410,7 +15773,7 @@ function McpSettingsSection(props) {
|
|
|
15410
15773
|
);
|
|
15411
15774
|
refreshTools();
|
|
15412
15775
|
};
|
|
15413
|
-
(0,
|
|
15776
|
+
(0, import_react4.useEffect)(() => {
|
|
15414
15777
|
let current = true;
|
|
15415
15778
|
void list().then(
|
|
15416
15779
|
(servers) => {
|
|
@@ -15505,13 +15868,13 @@ function McpSettingsSection(props) {
|
|
|
15505
15868
|
const serverTools = (serverName) => (tools?.tools ?? []).filter((tool) => tool.server === serverName);
|
|
15506
15869
|
const mode = tools?.mode ?? "search";
|
|
15507
15870
|
if (state.loadState === "loading") {
|
|
15508
|
-
return /* @__PURE__ */ (0,
|
|
15871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.status, "aria-busy": "true", children: t("loading") });
|
|
15509
15872
|
}
|
|
15510
15873
|
if (state.loadState === "error") {
|
|
15511
|
-
return /* @__PURE__ */ (0,
|
|
15512
|
-
/* @__PURE__ */ (0,
|
|
15513
|
-
loadErrorDetail !== null ? /* @__PURE__ */ (0,
|
|
15514
|
-
/* @__PURE__ */ (0,
|
|
15874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.failure, children: [
|
|
15875
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { role: "alert", children: t("loadError") }),
|
|
15876
|
+
loadErrorDetail !== null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { className: McpSettingsSection_default.muted, children: loadErrorDetail }) : null,
|
|
15877
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
|
|
15515
15878
|
setLoadState("loading");
|
|
15516
15879
|
load();
|
|
15517
15880
|
}, children: t("retry") })
|
|
@@ -15526,7 +15889,7 @@ function McpSettingsSection(props) {
|
|
|
15526
15889
|
setTest,
|
|
15527
15890
|
setServers
|
|
15528
15891
|
};
|
|
15529
|
-
|
|
15892
|
+
const form = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
15530
15893
|
McpServerForm,
|
|
15531
15894
|
{
|
|
15532
15895
|
draft: state.draft,
|
|
@@ -15543,13 +15906,13 @@ function McpSettingsSection(props) {
|
|
|
15543
15906
|
}
|
|
15544
15907
|
}
|
|
15545
15908
|
);
|
|
15909
|
+
inlineForm = form;
|
|
15546
15910
|
}
|
|
15547
|
-
return /* @__PURE__ */ (0,
|
|
15548
|
-
/* @__PURE__ */ (0,
|
|
15549
|
-
|
|
15550
|
-
/* @__PURE__ */ (0,
|
|
15551
|
-
|
|
15552
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
15911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.section, children: [
|
|
15912
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.modeRow, children: [
|
|
15913
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.modeLabel, children: t("toolsModeLabel") }),
|
|
15914
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.modeOption, children: [
|
|
15915
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
15553
15916
|
"input",
|
|
15554
15917
|
{
|
|
15555
15918
|
type: "radio",
|
|
@@ -15560,8 +15923,8 @@ function McpSettingsSection(props) {
|
|
|
15560
15923
|
),
|
|
15561
15924
|
t("toolsModeSearch")
|
|
15562
15925
|
] }),
|
|
15563
|
-
/* @__PURE__ */ (0,
|
|
15564
|
-
/* @__PURE__ */ (0,
|
|
15926
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: McpSettingsSection_default.modeOption, children: [
|
|
15927
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
15565
15928
|
"input",
|
|
15566
15929
|
{
|
|
15567
15930
|
type: "radio",
|
|
@@ -15573,53 +15936,115 @@ function McpSettingsSection(props) {
|
|
|
15573
15936
|
t("toolsModeFull")
|
|
15574
15937
|
] })
|
|
15575
15938
|
] }),
|
|
15576
|
-
/* @__PURE__ */ (0,
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
|
|
15592
|
-
|
|
15593
|
-
|
|
15594
|
-
|
|
15939
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.modeHint, children: toolsError !== null ? toolsError : tools === null ? t("toolsLoading") : mode === "search" ? t("toolsHintSearch") : t("toolsHintFull") }),
|
|
15940
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.module, children: [
|
|
15941
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
15942
|
+
"button",
|
|
15943
|
+
{
|
|
15944
|
+
type: "button",
|
|
15945
|
+
className: McpSettingsSection_default.moduleTitle,
|
|
15946
|
+
"aria-expanded": envOpen,
|
|
15947
|
+
onClick: () => setEnvOpen((open) => !open),
|
|
15948
|
+
children: [
|
|
15949
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.caret, children: envOpen ? "\u25BE" : "\u25B8" }),
|
|
15950
|
+
t("globalEnv")
|
|
15951
|
+
]
|
|
15952
|
+
}
|
|
15953
|
+
),
|
|
15954
|
+
envOpen ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
15955
|
+
GlobalEnvEditor,
|
|
15956
|
+
{
|
|
15957
|
+
injected: { envList: props.envList, envSet: props.envSet },
|
|
15958
|
+
t,
|
|
15959
|
+
onApplied: () => {
|
|
15960
|
+
refreshServer("");
|
|
15961
|
+
}
|
|
15962
|
+
}
|
|
15963
|
+
) : null
|
|
15964
|
+
] }),
|
|
15965
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.module, children: [
|
|
15966
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.configHeader, children: [
|
|
15967
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.moduleTitle, children: t("configTitle") }),
|
|
15968
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.configActions, children: [
|
|
15969
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
15970
|
+
"button",
|
|
15971
|
+
{
|
|
15972
|
+
type: "button",
|
|
15973
|
+
className: jsonOpen ? McpSettingsSection_default.active : void 0,
|
|
15974
|
+
"aria-expanded": jsonOpen,
|
|
15975
|
+
onClick: () => setJsonOpen((open) => !open),
|
|
15976
|
+
children: t("serversJson")
|
|
15977
|
+
}
|
|
15978
|
+
),
|
|
15979
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: McpSettingsSection_default.primary, onClick: beginCreate, children: t("addServer") })
|
|
15980
|
+
] })
|
|
15981
|
+
] }),
|
|
15982
|
+
jsonOpen ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
15983
|
+
ServersJsonEditor,
|
|
15984
|
+
{
|
|
15985
|
+
injected: { list: props.list, upsertJson: props.upsertJson },
|
|
15986
|
+
t,
|
|
15987
|
+
onApplied: () => {
|
|
15988
|
+
refreshServer("");
|
|
15989
|
+
refreshTools();
|
|
15990
|
+
setJsonOpen(false);
|
|
15991
|
+
timersRef.current.push(window.setTimeout(() => refreshServer(""), 2e3));
|
|
15992
|
+
timersRef.current.push(window.setTimeout(() => refreshServer(""), 6e3));
|
|
15993
|
+
}
|
|
15994
|
+
}
|
|
15995
|
+
) : null,
|
|
15996
|
+
state.draft !== null && state.draft.id === null ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: McpSettingsSection_default.inlineForm, children: inlineForm }) : null,
|
|
15997
|
+
jsonOpen ? null : state.servers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: McpSettingsSection_default.status, children: t("empty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: McpSettingsSection_default.list, children: state.servers.flatMap((server) => {
|
|
15998
|
+
const isExpanded = expanded.has(server.serverName);
|
|
15999
|
+
const isRefreshing = refreshing.has(server.serverName);
|
|
16000
|
+
const serverToolList = serverTools(server.serverName);
|
|
16001
|
+
const card = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { className: McpSettingsSection_default.card, children: [
|
|
16002
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.row, children: [
|
|
16003
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMain, children: [
|
|
16004
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowTitle, children: [
|
|
16005
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.serverName, children: server.serverName }),
|
|
16006
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `${McpSettingsSection_default.badge} ${McpSettingsSection_default[server.status.phase]}`, children: t(phaseKey(server.status.phase)) }),
|
|
16007
|
+
!server.enabled && server.status.phase !== "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.muted, children: t("statusStopped") }) : null
|
|
15595
16008
|
] }),
|
|
15596
|
-
/* @__PURE__ */ (0,
|
|
15597
|
-
|
|
15598
|
-
":
|
|
15599
|
-
|
|
16009
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowMeta, children: [
|
|
16010
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: server.transport }),
|
|
16011
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
16012
|
+
t("toolCount"),
|
|
16013
|
+
": ",
|
|
16014
|
+
server.status.tools.length
|
|
16015
|
+
] }),
|
|
16016
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
16017
|
+
t("envVars"),
|
|
16018
|
+
": ",
|
|
16019
|
+
server.env.length
|
|
16020
|
+
] })
|
|
15600
16021
|
] })
|
|
16022
|
+
] }),
|
|
16023
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: McpSettingsSection_default.rowActions, children: [
|
|
16024
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: isRefreshing, onClick: () => void toggleEnabled(server), children: server.enabled ? t("disable") : t("enabled") }),
|
|
16025
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: isRefreshing, onClick: () => refreshServer(server.serverName), children: isRefreshing ? t("refreshing") : t("refresh") }),
|
|
16026
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => toggleExpand(server.serverName), children: isExpanded ? t("toolsCollapse") : t("toolsExpand") }),
|
|
16027
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => beginEdit(server), children: t("edit") })
|
|
15601
16028
|
] })
|
|
15602
16029
|
] }),
|
|
15603
|
-
/* @__PURE__ */ (0,
|
|
15604
|
-
/* @__PURE__ */ (0,
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
"
|
|
15613
|
-
|
|
15614
|
-
|
|
15615
|
-
|
|
15616
|
-
|
|
15617
|
-
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
|
|
15621
|
-
] }, server.id);
|
|
15622
|
-
}) })
|
|
16030
|
+
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: [
|
|
16031
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
16032
|
+
"input",
|
|
16033
|
+
{
|
|
16034
|
+
type: "checkbox",
|
|
16035
|
+
checked: tool.enabled,
|
|
16036
|
+
onChange: () => toggleTool(tool)
|
|
16037
|
+
}
|
|
16038
|
+
),
|
|
16039
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: McpSettingsSection_default.toolName, children: rawOf(tool.name) })
|
|
16040
|
+
] }, tool.name)) }) }) : null
|
|
16041
|
+
] }, server.id);
|
|
16042
|
+
if (state.draft !== null && state.draft.id === server.id) {
|
|
16043
|
+
return [card, /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { className: McpSettingsSection_default.inlineFormItem, children: inlineForm }, `${server.id}-form`)];
|
|
16044
|
+
}
|
|
16045
|
+
return [card];
|
|
16046
|
+
}) })
|
|
16047
|
+
] })
|
|
15623
16048
|
] });
|
|
15624
16049
|
}
|
|
15625
16050
|
|
|
@@ -15647,9 +16072,9 @@ var zh = {
|
|
|
15647
16072
|
url: "\u670D\u52A1\u5668 URL",
|
|
15648
16073
|
urlPlaceholder: "\u4F8B\u5982 http://localhost:3000/mcp",
|
|
15649
16074
|
headers: "\u8BF7\u6C42\u5934",
|
|
15650
|
-
headersPlaceholder: '\u6BCF\u884C\u4E00\u4E2A "\u540D\u79F0: \u503C"',
|
|
16075
|
+
headersPlaceholder: '\u6BCF\u884C\u4E00\u4E2A "\u540D\u79F0: \u503C"\uFF1B\u503C\u652F\u6301 ${ENV} \u73AF\u5883\u53D8\u91CF\u66FF\u6362',
|
|
15651
16076
|
envVars: "\u73AF\u5883\u53D8\u91CF",
|
|
15652
|
-
envHint: "\u6CE8\u5165\
|
|
16077
|
+
envHint: "stdio\uFF1A\u6CE8\u5165\u5B50\u8FDB\u7A0B\uFF1BHTTP\uFF1A\u4F9B\u8BF7\u6C42\u5934 ${\u53D8\u91CF} \u66FF\u6362\uFF08\u5982 Authorization: Bearer ${TOKEN}\uFF09\u3002\u6807\u8BB0\u4E3A secret \u7684\u503C\u5199\u5165\u51ED\u636E\u6587\u6863\uFF0C\u4E0D\u5728\u6B64\u660E\u6587\u4FDD\u5B58",
|
|
15653
16078
|
envName: "\u53D8\u91CF\u540D",
|
|
15654
16079
|
envValue: "\u503C",
|
|
15655
16080
|
envSecret: "secret",
|
|
@@ -15695,7 +16120,32 @@ var zh = {
|
|
|
15695
16120
|
refresh: "\u5237\u65B0",
|
|
15696
16121
|
refreshing: "\u5237\u65B0\u4E2D\u2026",
|
|
15697
16122
|
toolsExpand: "\u5C55\u5F00\u5DE5\u5177",
|
|
15698
|
-
toolsCollapse: "\u6536\u8D77\u5DE5\u5177"
|
|
16123
|
+
toolsCollapse: "\u6536\u8D77\u5DE5\u5177",
|
|
16124
|
+
serversJson: "JSON \u7EF4\u62A4\u914D\u7F6E",
|
|
16125
|
+
serversJsonLabel: "\u670D\u52A1\u5668\u914D\u7F6E JSON",
|
|
16126
|
+
serversJsonHint: "\u6574\u4E2A MCP \u670D\u52A1\u5668\u914D\u7F6E\u5217\u8868\uFF08\u6570\u7EC4\uFF09\uFF1A\u5E94\u7528\u540E\u5C06\u6309\u6B64\u5217\u8868\u66FF\u6362\u2014\u2014\u5DF2\u5217\u51FA\u7684\u670D\u52A1\u5668\u521B\u5EFA/\u66F4\u65B0\uFF0C\u672A\u5217\u51FA\u7684\u5C06\u88AB\u5220\u9664\uFF1Bsecret \u73AF\u5883\u53D8\u91CF\u503C\u4E0D\u4F1A\u5BFC\u51FA\uFF08configured \u6807\u8BB0\uFF09\uFF0C\u7559\u7A7A\u5219\u4FDD\u7559\u539F\u503C\u3002",
|
|
16127
|
+
serversJsonReseed: "\u91CD\u65B0\u5BFC\u51FA",
|
|
16128
|
+
serversJsonApply: "\u5E94\u7528",
|
|
16129
|
+
serversJsonSaving: "\u5E94\u7528\u4E2D\u2026",
|
|
16130
|
+
serversJsonDone: "\u5DF2\u5E94\u7528",
|
|
16131
|
+
globalEnv: "\u8FDB\u7A0B\u73AF\u5883\u53D8\u91CF",
|
|
16132
|
+
globalEnvHint: "\u8FDB\u7A0B\u7EA7\u73AF\u5883\u53D8\u91CF\uFF0C\u4F9B\u6240\u6709 MCP \u670D\u52A1\u5668\u7684\u8BF7\u6C42\u5934\u66FF\u6362\u5F15\u7528\uFF08headers \u503C\u5199 ${\u53D8\u91CF\u540D} \u6216\u76F4\u63A5\u5199\u53D8\u91CF\u540D\uFF09\u3002secret \u503C\u5199\u5165\u51ED\u636E\u6587\u6863\uFF0C\u4E0D\u5728\u6B64\u660E\u6587\u663E\u793A\uFF1B\u7559\u7A7A\u4FDD\u7559\u539F\u503C\u3002",
|
|
16133
|
+
globalEnvName: "\u53D8\u91CF\u540D",
|
|
16134
|
+
globalEnvValue: "\u503C",
|
|
16135
|
+
globalEnvSecret: "secret",
|
|
16136
|
+
globalEnvSecretHint: "\u503C\u53EA\u5199\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u89C1\uFF1B\u7559\u7A7A\u8868\u793A\u4FDD\u7559\u539F\u503C",
|
|
16137
|
+
globalEnvAdd: "\u6DFB\u52A0\u53D8\u91CF",
|
|
16138
|
+
globalEnvBulk: "\u6279\u91CF\u6DFB\u52A0",
|
|
16139
|
+
globalEnvBulkPrompt: "\u6BCF\u884C\u4E00\u4E2A\u53D8\u91CF\uFF0C\u683C\u5F0F NAME=value\uFF1B\u53EA\u586B NAME \u7684\u884C\u5C06\u4F5C\u4E3A\u4EC5\u53D8\u91CF\u540D\u884C\u6DFB\u52A0\u3002",
|
|
16140
|
+
globalEnvBulkOk: "\u6DFB\u52A0",
|
|
16141
|
+
globalEnvSave: "\u4FDD\u5B58",
|
|
16142
|
+
globalEnvSaving: "\u4FDD\u5B58\u4E2D\u2026",
|
|
16143
|
+
globalEnvRemove: "\u79FB\u9664\u8BE5\u53D8\u91CF",
|
|
16144
|
+
globalEnvEmpty: "\uFF08\u6682\u65E0\u8FDB\u7A0B\u73AF\u5883\u53D8\u91CF\uFF09",
|
|
16145
|
+
globalEnvLoadFailed: "\u8BFB\u53D6\u73AF\u5883\u53D8\u91CF\u5931\u8D25",
|
|
16146
|
+
globalEnvRetry: "\u91CD\u8BD5",
|
|
16147
|
+
globalEnvDone: "\u5DF2\u4FDD\u5B58",
|
|
16148
|
+
configTitle: "MCP \u914D\u7F6E"
|
|
15699
16149
|
};
|
|
15700
16150
|
var en = {
|
|
15701
16151
|
nav: "MCP",
|
|
@@ -15720,9 +16170,9 @@ var en = {
|
|
|
15720
16170
|
url: "Server URL",
|
|
15721
16171
|
urlPlaceholder: "e.g. http://localhost:3000/mcp",
|
|
15722
16172
|
headers: "Headers",
|
|
15723
|
-
headersPlaceholder: 'One "Name: value" per line',
|
|
16173
|
+
headersPlaceholder: 'One "Name: value" per line; values support ${ENV} substitution',
|
|
15724
16174
|
envVars: "Environment variables",
|
|
15725
|
-
envHint: "
|
|
16175
|
+
envHint: "stdio: injected into the child process; HTTP: used for ${VAR} substitution in headers (e.g. Authorization: Bearer ${TOKEN}). Secret values are stored in the credentials document, never shown here",
|
|
15726
16176
|
envName: "Name",
|
|
15727
16177
|
envValue: "Value",
|
|
15728
16178
|
envSecret: "secret",
|
|
@@ -15768,9 +16218,150 @@ var en = {
|
|
|
15768
16218
|
refresh: "Refresh",
|
|
15769
16219
|
refreshing: "Refreshing\u2026",
|
|
15770
16220
|
toolsExpand: "Expand tools",
|
|
15771
|
-
toolsCollapse: "Collapse tools"
|
|
16221
|
+
toolsCollapse: "Collapse tools",
|
|
16222
|
+
serversJson: "JSON config editor",
|
|
16223
|
+
serversJsonLabel: "Server-config JSON",
|
|
16224
|
+
serversJsonHint: "The whole MCP server list (array): applying replaces the list \u2014 listed servers are created/updated, existing servers absent from the document are removed; secret env values are never exported (a configured flag marks them), a blank value keeps the stored one.",
|
|
16225
|
+
serversJsonReseed: "Re-export",
|
|
16226
|
+
serversJsonApply: "Apply",
|
|
16227
|
+
serversJsonSaving: "Applying\u2026",
|
|
16228
|
+
serversJsonDone: "Applied",
|
|
16229
|
+
globalEnv: "Process env vars",
|
|
16230
|
+
globalEnvHint: "Process-level environment variables referenced by every server's header substitution (write ${NAME} or a bare name in a header value). Secret values are stored in the credentials document, never shown here; blank keeps the stored value.",
|
|
16231
|
+
globalEnvName: "Name",
|
|
16232
|
+
globalEnvValue: "Value",
|
|
16233
|
+
globalEnvSecret: "secret",
|
|
16234
|
+
globalEnvSecretHint: "Write-only; a blank value keeps the stored one",
|
|
16235
|
+
globalEnvAdd: "Add variable",
|
|
16236
|
+
globalEnvBulk: "Add many",
|
|
16237
|
+
globalEnvBulkPrompt: "One variable per line, as NAME=value; a bare NAME adds a name-only row.",
|
|
16238
|
+
globalEnvBulkOk: "Add",
|
|
16239
|
+
globalEnvSave: "Save",
|
|
16240
|
+
globalEnvSaving: "Saving\u2026",
|
|
16241
|
+
globalEnvRemove: "Remove this variable",
|
|
16242
|
+
globalEnvEmpty: "(no process env vars)",
|
|
16243
|
+
globalEnvLoadFailed: "Failed to read environment variables",
|
|
16244
|
+
globalEnvRetry: "Retry",
|
|
16245
|
+
globalEnvDone: "Saved",
|
|
16246
|
+
configTitle: "MCP config"
|
|
15772
16247
|
};
|
|
15773
16248
|
|
|
16249
|
+
// src/client/mcp-store.ts
|
|
16250
|
+
var import_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
16251
|
+
var DEFAULT_TOOL_CALL_TIMEOUT_MS = 6e4;
|
|
16252
|
+
function emptyDraft() {
|
|
16253
|
+
return {
|
|
16254
|
+
id: null,
|
|
16255
|
+
serverName: "",
|
|
16256
|
+
transport: "stdio",
|
|
16257
|
+
enabled: true,
|
|
16258
|
+
command: "",
|
|
16259
|
+
argsText: "",
|
|
16260
|
+
cwd: "",
|
|
16261
|
+
url: "",
|
|
16262
|
+
headersText: "",
|
|
16263
|
+
toolCallTimeoutMs: String(DEFAULT_TOOL_CALL_TIMEOUT_MS),
|
|
16264
|
+
// Reject the mount by default when the startup connection fails, so a
|
|
16265
|
+
// broken server never registers stale tools.
|
|
16266
|
+
failOnStartupError: true
|
|
16267
|
+
};
|
|
16268
|
+
}
|
|
16269
|
+
function draftFromServer(server) {
|
|
16270
|
+
return {
|
|
16271
|
+
id: server.id,
|
|
16272
|
+
serverName: server.serverName,
|
|
16273
|
+
transport: server.transport,
|
|
16274
|
+
enabled: server.enabled,
|
|
16275
|
+
command: server.command,
|
|
16276
|
+
argsText: server.args.join("\n"),
|
|
16277
|
+
cwd: server.cwd,
|
|
16278
|
+
url: server.url,
|
|
16279
|
+
headersText: server.headers.map((header) => `${header.name}: ${header.value}`).join("\n"),
|
|
16280
|
+
toolCallTimeoutMs: String(server.toolCallTimeoutMs),
|
|
16281
|
+
failOnStartupError: server.failOnStartupError
|
|
16282
|
+
};
|
|
16283
|
+
}
|
|
16284
|
+
function parseLines(text) {
|
|
16285
|
+
return text.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
16286
|
+
}
|
|
16287
|
+
function parseHeaders(text) {
|
|
16288
|
+
const headers = [];
|
|
16289
|
+
for (const line of parseLines(text)) {
|
|
16290
|
+
const separator = line.indexOf(":");
|
|
16291
|
+
if (separator <= 0) continue;
|
|
16292
|
+
const name = line.slice(0, separator).trim();
|
|
16293
|
+
const value = line.slice(separator + 1).trim();
|
|
16294
|
+
if (name.length > 0) headers.push({ name, value });
|
|
16295
|
+
}
|
|
16296
|
+
return headers;
|
|
16297
|
+
}
|
|
16298
|
+
function parseTimeout(text) {
|
|
16299
|
+
const value = Number(text);
|
|
16300
|
+
return Number.isInteger(value) && value > 0 ? value : DEFAULT_TOOL_CALL_TIMEOUT_MS;
|
|
16301
|
+
}
|
|
16302
|
+
function draftToSubmission(draft) {
|
|
16303
|
+
return {
|
|
16304
|
+
server: {
|
|
16305
|
+
serverName: draft.serverName.trim(),
|
|
16306
|
+
transport: draft.transport,
|
|
16307
|
+
enabled: draft.enabled,
|
|
16308
|
+
command: draft.command.trim(),
|
|
16309
|
+
args: parseLines(draft.argsText),
|
|
16310
|
+
cwd: draft.cwd.trim(),
|
|
16311
|
+
url: draft.url.trim(),
|
|
16312
|
+
headers: parseHeaders(draft.headersText),
|
|
16313
|
+
toolCallTimeoutMs: parseTimeout(draft.toolCallTimeoutMs),
|
|
16314
|
+
failOnStartupError: draft.failOnStartupError
|
|
16315
|
+
}
|
|
16316
|
+
};
|
|
16317
|
+
}
|
|
16318
|
+
function createMcpManagerStore() {
|
|
16319
|
+
return (0, import_client.defineStore)({
|
|
16320
|
+
init: () => ({
|
|
16321
|
+
loadState: "loading",
|
|
16322
|
+
servers: [],
|
|
16323
|
+
draft: null,
|
|
16324
|
+
busy: null,
|
|
16325
|
+
testRunning: false,
|
|
16326
|
+
test: null
|
|
16327
|
+
}),
|
|
16328
|
+
actions: {
|
|
16329
|
+
setLoadState: (d, state) => {
|
|
16330
|
+
d.loadState = state;
|
|
16331
|
+
},
|
|
16332
|
+
setServers: (d, servers) => {
|
|
16333
|
+
d.servers = servers;
|
|
16334
|
+
},
|
|
16335
|
+
beginCreate: (d) => {
|
|
16336
|
+
d.draft = emptyDraft();
|
|
16337
|
+
d.test = null;
|
|
16338
|
+
},
|
|
16339
|
+
beginEdit: (d, server) => {
|
|
16340
|
+
d.draft = draftFromServer(server);
|
|
16341
|
+
d.test = null;
|
|
16342
|
+
},
|
|
16343
|
+
cancelEdit: (d) => {
|
|
16344
|
+
d.draft = null;
|
|
16345
|
+
d.test = null;
|
|
16346
|
+
d.busy = null;
|
|
16347
|
+
},
|
|
16348
|
+
updateDraft: (d, patch) => {
|
|
16349
|
+
if (d.draft === null) return;
|
|
16350
|
+
d.draft = { ...d.draft, ...patch };
|
|
16351
|
+
},
|
|
16352
|
+
setBusy: (d, busy) => {
|
|
16353
|
+
d.busy = busy;
|
|
16354
|
+
},
|
|
16355
|
+
setTestRunning: (d, running) => {
|
|
16356
|
+
d.testRunning = running;
|
|
16357
|
+
},
|
|
16358
|
+
setTest: (d, test) => {
|
|
16359
|
+
d.test = test;
|
|
16360
|
+
}
|
|
16361
|
+
}
|
|
16362
|
+
});
|
|
16363
|
+
}
|
|
16364
|
+
|
|
15774
16365
|
// src/client/index.ts
|
|
15775
16366
|
var NS = "settings.mcp";
|
|
15776
16367
|
var inject = ["slots", "locale", "remote"];
|
|
@@ -15799,8 +16390,7 @@ async function apply(ctx) {
|
|
|
15799
16390
|
const submission = draftToSubmission(draft);
|
|
15800
16391
|
const result = await manager.upsert({
|
|
15801
16392
|
...draft.id === null ? {} : { id: draft.id },
|
|
15802
|
-
server: submission.server
|
|
15803
|
-
env: submission.env
|
|
16393
|
+
server: submission.server
|
|
15804
16394
|
});
|
|
15805
16395
|
if (result.ok) return null;
|
|
15806
16396
|
return failureOf(result.error);
|
|
@@ -15810,12 +16400,15 @@ async function apply(ctx) {
|
|
|
15810
16400
|
if (result.ok) return null;
|
|
15811
16401
|
return failureOf(result.error);
|
|
15812
16402
|
},
|
|
16403
|
+
upsertJson: async (servers) => {
|
|
16404
|
+
const result = await unwrap(() => manager.upsertJson({ servers }));
|
|
16405
|
+
return { added: result.added, updated: result.updated, removed: result.removed, servers: result.servers };
|
|
16406
|
+
},
|
|
15813
16407
|
test: async (draft) => {
|
|
15814
16408
|
const submission = draftToSubmission(draft);
|
|
15815
16409
|
const result = await unwrap(() => manager.test({
|
|
15816
16410
|
...draft.id === null ? {} : { id: draft.id },
|
|
15817
|
-
server: submission.server
|
|
15818
|
-
env: submission.env
|
|
16411
|
+
server: submission.server
|
|
15819
16412
|
}));
|
|
15820
16413
|
return { probe: result.probe, elapsedMs: result.elapsedMs };
|
|
15821
16414
|
},
|
|
@@ -15830,6 +16423,14 @@ async function apply(ctx) {
|
|
|
15830
16423
|
toolsMode: async (request) => {
|
|
15831
16424
|
const result = await unwrap(() => manager.toolsMode({ mode: request.mode }));
|
|
15832
16425
|
return { ok: result.ok };
|
|
16426
|
+
},
|
|
16427
|
+
envList: async () => {
|
|
16428
|
+
const result = await unwrap(() => manager.envList());
|
|
16429
|
+
return { vars: result.vars };
|
|
16430
|
+
},
|
|
16431
|
+
envSet: async (vars) => {
|
|
16432
|
+
const result = await unwrap(() => manager.envSet({ vars }));
|
|
16433
|
+
return { vars: result.vars };
|
|
15833
16434
|
}
|
|
15834
16435
|
});
|
|
15835
16436
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|