@xxxyz/dsh-mcp-manager 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +9 -2
- package/lib/index.js +8 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -35,6 +35,7 @@ const factory = (require) => {
|
|
|
35
35
|
'.mcpm-row{border:1px solid var(--dsw-alias-border-l2, rgba(128,128,128,.35));border-radius:8px;padding:10px 12px;display:flex;flex-direction:column;gap:8px}' +
|
|
36
36
|
'.mcpm-row-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}' +
|
|
37
37
|
'.mcpm-name{font-weight:600}' +
|
|
38
|
+
'.mcpm-idx{display:inline-block;min-width:20px;font-family:monospace;font-size:11px;opacity:.55;flex:none}' +
|
|
38
39
|
'.mcpm-chip{font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2, rgba(128,128,128,.5));white-space:nowrap}' +
|
|
39
40
|
'.mcpm-chip.on{background:rgba(46,160,67,.18);border-color:rgba(46,160,67,.55)}' +
|
|
40
41
|
'.mcpm-chip.off{background:rgba(128,128,128,.15)}' +
|
|
@@ -244,7 +245,12 @@ const factory = (require) => {
|
|
|
244
245
|
}).catch((e) => setToolPreviewErr(String((e && e.message) || e))).then(() => setToolPreviewBusy(false))
|
|
245
246
|
}
|
|
246
247
|
|
|
247
|
-
const
|
|
248
|
+
const all = state.rows || []
|
|
249
|
+
// Newest first: patch blocks are appended to the file, so the last row
|
|
250
|
+
// of a level section is the most recently added/edited one. Sections
|
|
251
|
+
// keep their order (project → global → loader); loader stays as-is.
|
|
252
|
+
const newestFirst = (lv) => all.filter((r) => r.level === lv).reverse()
|
|
253
|
+
const rows = newestFirst('project').concat(newestFirst('global'), all.filter((r) => r.level === 'loader'))
|
|
248
254
|
const maskKv = (obj) => {
|
|
249
255
|
if (!obj) return null
|
|
250
256
|
return Object.keys(obj).map((k) => k + ': ' + String(obj[k]).replace(/^(.{4}).*$/, '$1****')).join(' ')
|
|
@@ -332,8 +338,9 @@ const factory = (require) => {
|
|
|
332
338
|
? React.createElement('div', { className: 'mcpm-sub' }, '加载中…')
|
|
333
339
|
: rows.length === 0
|
|
334
340
|
? React.createElement('div', { className: 'mcpm-sub' }, '暂无 MCP 服务。点击“+ 新增 MCP 服务”添加。')
|
|
335
|
-
: rows.map((row) => React.createElement('div', { key: row.id, className: 'mcpm-row' },
|
|
341
|
+
: rows.map((row, i) => React.createElement('div', { key: row.id, className: 'mcpm-row' },
|
|
336
342
|
React.createElement('div', { className: 'mcpm-row-head' },
|
|
343
|
+
React.createElement('span', { className: 'mcpm-idx' }, String(i + 1)),
|
|
337
344
|
React.createElement('span', { className: 'mcpm-name' }, row.serverName),
|
|
338
345
|
React.createElement('span', { className: 'mcpm-chip ' + (row.disabled ? 'off' : 'on') }, row.disabled ? '已禁用' : '已启用'),
|
|
339
346
|
React.createElement('span', { className: 'mcpm-chip' }, LEVEL_LABEL[row.level] || row.level),
|
package/lib/index.js
CHANGED
|
@@ -524,6 +524,14 @@ export default {
|
|
|
524
524
|
let t = trimmed;
|
|
525
525
|
if (t.startsWith('- '))
|
|
526
526
|
t = t.slice(2).trim();
|
|
527
|
+
if (inConfig && nested && nested.type === 'list' && trimmed.startsWith('- ')) {
|
|
528
|
+
// Scalar list items (args): take the whole item — never key/value-split
|
|
529
|
+
// it. A quoted value like "F:/path/x.py" contains a colon; splitting
|
|
530
|
+
// would drop `"F` as a bogus key and leave the trailing quote on the
|
|
531
|
+
// value. Map lists (headers/env) have no `- ` prefix and are unaffected.
|
|
532
|
+
nested.current.push(unquote(t));
|
|
533
|
+
continue;
|
|
534
|
+
}
|
|
527
535
|
const kv = splitKV(t);
|
|
528
536
|
if (!kv) {
|
|
529
537
|
if (inConfig && nested && nested.type === 'list')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xxxyz/dsh-mcp-manager",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"description": "DSH-standard MCP manager plugin: Settings UI + HTTP API + model-facing mcp_manager_* tools. Install with one command: dsh plugin --profile web add @xxxyz/dsh-mcp-manager@latest",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|