dsh-mcp-manager-plus 0.4.4 → 0.4.5

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.md CHANGED
@@ -5,6 +5,27 @@
5
5
 
6
6
  0.3.1 之前的开发发生在公开仓库建立之前,历史没有保留。
7
7
 
8
+ ## [0.4.5] - 2026-11-08
9
+
10
+ ### Fixed
11
+
12
+ - **DSH 0.2.2-rc.1 的设置侧边栏里,本行并排出现两个图标(左边链条例、右边齿轮)**:
13
+ 新版 shell 把导航行图标改成了 `settings.section.icon` 槽位,并把自己画的默认
14
+ 齿轮包进 `<span class="navIcon">`。于是旧的样式兜底
15
+ (`button[data-mcpmp-nav]>svg:first-child` 隐藏 + `::before` 遮罩)既隐藏不掉
16
+ 齿轮,又照常画出自己的链条,两枚图标并排 —— 用户截图里的正是这一现象。
17
+ 现在**优先把图标注册进这个槽位**(注册 id 必须等于 section 的 id `mcp`,shell
18
+ 按行的 id 取用,取不到才回落到默认齿轮);槽位存在时旧的「标记行 + 遮罩」整条
19
+ 链路直接关掉,行里只剩插件自己的链条图标。
20
+ - 没有该槽位的老版本(0.1.6-alpha.1 … 0.2.1)行为不变:页面照常注册,
21
+ 旧兜底仍接管这一行。
22
+
23
+ ### Added
24
+
25
+ - 回归用例:槽位可用时图标注册进去(id 与 section 一致、尺寸跟随槽位、颜色走
26
+ `currentColor`);槽位可用时不再启动行标记(否则就是这次的双图标);
27
+ 槽位缺失时页面仍注册、兜底仍在观察(测试总数 127 → 131)。
28
+
8
29
  ## [0.4.4] - 2026-10-15
9
30
 
10
31
  ### Fixed
package/README.en.md CHANGED
@@ -42,7 +42,7 @@ paste a whole replacement block, and renaming is just changing the name.
42
42
 
43
43
  ## Installation
44
44
 
45
- **Requirements:** DSH >= 0.1.6-alpha.1 and < 0.3.0 (tested on 0.1.6-alpha.1 and 0.2.0-rc.2).
45
+ **Requirements:** DSH >= 0.1.6-alpha.1 and < 0.3.0 (tested on 0.1.6-alpha.1, 0.2.0-rc.2 and 0.2.2-rc.1).
46
46
  DSH itself needs Node.js >= 24.2.0 and Git >= 2.31.0.
47
47
 
48
48
  ### Option 1: one-click install from the plugin market
@@ -268,6 +268,7 @@ layer in `lib/yaml.js` included).
268
268
  | `node tools/check-nav-icon.mjs` | checks that the nav icon's mask payload is a drawable 16×16 template |
269
269
  | `node tools/gen-icon-preview.cjs` | extracts icons from the dsh web bundle into the `icon-options.html` comparison page |
270
270
  | `node tools/dump-icon.cjs <IconName>` | prints an icon's SVG path for hand-written overrides |
271
+ | `node tools/verify-release.mjs [version]` | post-publish verification: the registry serves the version, a fresh install pulled its own `js-yaml`, and both halves of the "profile hoists a v5" scenario; `--sync-mirror` also waits for the npmmirror mirror |
271
272
 
272
273
  ## License
273
274
 
package/README.md CHANGED
@@ -35,7 +35,7 @@ MCP 服务器管理插件:在 DeepSeek Harness 设置界面的左侧边栏新
35
35
 
36
36
  ## 安装说明
37
37
 
38
- **版本要求:** DSH >= 0.1.6-alpha.1 且 < 0.3.0(已在 0.1.6-alpha.1 与 0.2.0-rc.2 上测试)。DSH 自身依赖 Node.js >= 24.2.0 与 Git >= 2.31.0。
38
+ **版本要求:** DSH >= 0.1.6-alpha.1 且 < 0.3.0(已在 0.1.6-alpha.1、0.2.0-rc.2 与 0.2.2-rc.1 上测试)。DSH 自身依赖 Node.js >= 24.2.0 与 Git >= 2.31.0。
39
39
 
40
40
  ### 方式一:插件市场一键安装
41
41
 
@@ -231,6 +231,7 @@ node test/run.mjs # 全部八个测试套件(共 127 项)
231
231
  | `node tools/check-nav-icon.mjs` | 校验导航图标的 mask 载荷是合法可绘制的 16×16 模板 |
232
232
  | `node tools/gen-icon-preview.cjs` | 从 dsh 前端 bundle 提取图标,生成 `icon-options.html` 对照页 |
233
233
  | `node tools/dump-icon.cjs <IconName>` | 打印某个内置图标的 SVG 路径,便于手写覆盖 |
234
+ | `node tools/verify-release.mjs [版本]` | 发布后验证:registry 是否有该版本、全新安装是否带上了自己的 `js-yaml`、以及「profile 顶层被换成 v5」的两种情形;`--sync-mirror` 顺带等 npmmirror 同步 |
234
235
 
235
236
  ## License
236
237
 
package/lib/client.js CHANGED
@@ -33,9 +33,27 @@ window.__ModuleLoader__.load({
33
33
 
34
34
  var NS = 'dsh-mcp-manager-plus';
35
35
 
36
- /** Attribute this plugin stamps on its own settings nav row (see markNavRow). */
36
+ /**
37
+ * Attribute the LEGACY nav-row fallback stamps on this plugin's row.
38
+ *
39
+ * Only shells that predate `settings.section.icon` need it: they draw a
40
+ * generic gear for any section id they do not know, and CSS can hide that
41
+ * gear only if it can find the row, so the row is tagged. On a current
42
+ * shell the icon seat owns the row and no flag is ever written (apply()
43
+ * switches the tagger off as soon as the seat is live).
44
+ */
37
45
  var NAV_ROW_FLAG = 'data-mcpmp-nav';
38
46
 
47
+ /**
48
+ * Whether the shell declared `settings.section.icon`.
49
+ *
50
+ * When it did, the registration in `apply()` puts our glyph inside the
51
+ * shell's own icon seat: the shell then owns the row and its markup, so
52
+ * the flag-and-mask fallback must keep quiet, or the row would carry two
53
+ * glyphs (the one it paints and the one we painted beside the gear).
54
+ */
55
+ var iconSlotLive = false;
56
+
39
57
  /** The dictionary, keyed for the two locales the harness ships. */
40
58
  var DICT = {
41
59
  zh: {
@@ -198,12 +216,14 @@ window.__ModuleLoader__.load({
198
216
  };
199
217
  }
200
218
 
201
- // The settings shell picks a nav-row icon from its own hard-coded table
202
- // keyed by section id, and every id it does not know — `mcp` included —
203
- // falls through to the same generic gear `general` uses. The two chain
204
- // links below are the shell's own `IconLinkOutline16` geometry, copied
205
- // verbatim so the row matches the rest of the sidebar's visual language.
206
- // They are filled (not stroked) because that is how the shipped icon draws.
219
+ // The chain-link glyph for this plugin's settings nav row.
220
+ //
221
+ // This is the shell's own `IconLinkOutline16` geometry, copied verbatim so
222
+ // the row matches the rest of the sidebar's visual language. The shapes are
223
+ // filled (not stroked) because that is how the shipped icon draws. Two
224
+ // consumers share these paths: `NavIcon` renders them into the shell's
225
+ // `settings.section.icon` seat on a current shell, and the legacy mask in
226
+ // `CSS` paints them on shells that have no such seat.
207
227
  var NAV_ICON_PATHS = [
208
228
  'M9.94133 6.50173C11.3218 7.99603 11.3218 10.3011 9.94128 11.7954C9.88691 11.8542 9.82125 11.9196 9.72099 12.0198L7.75707 13.9838C7.65709 14.0838 7.592 14.1491 7.53334 14.2034C6.03906 15.5843 3.7327 15.5854 2.23827 14.2048C2.17933 14.1503 2.11374 14.0844 2.01315 13.9838C1.91318 13.8839 1.84922 13.8188 1.79495 13.7601C0.413857 12.2657 0.413909 9.95948 1.795 8.46503C1.84923 8.4064 1.91335 8.34115 2.01321 8.24129L3.79275 6.46313C3.71814 7.08101 3.75236 7.71445 3.90115 8.33518L3.00344 9.23151C2.89398 9.34097 2.8535 9.38307 2.82251 9.41658C1.93771 10.3744 1.93704 11.8514 2.82179 12.8092C2.85279 12.8427 2.89383 12.884 3.0034 12.9936C3.11272 13.1029 3.15429 13.1442 3.18777 13.1752C4.14561 14.0603 5.62381 14.0608 6.58178 13.1758C6.61532 13.1448 6.65722 13.1032 6.76685 12.9935L8.73077 11.0296C8.83999 10.9204 8.88142 10.8787 8.91238 10.8452C9.79744 9.88728 9.7969 8.40911 8.91173 7.45124C8.88074 7.41775 8.83944 7.3762 8.73011 7.26687C8.62082 7.15757 8.58061 7.11623 8.54712 7.08526C8.37347 6.92477 8.18243 6.79361 7.98088 6.69165L9.00289 5.66964C9.17506 5.78373 9.34035 5.91265 9.49663 6.05703C9.55538 6.11135 9.62026 6.17652 9.72036 6.27662C9.82094 6.3772 9.88686 6.4428 9.94133 6.50173Z',
209
229
  'M6.06816 9.49196C4.68626 7.99724 4.68667 5.68942 6.06885 4.19487C6.12268 4.13671 6.18789 4.07306 6.28706 3.9739L8.24541 2.01416C8.34478 1.91479 8.41018 1.85055 8.46845 1.79665C9.96301 0.414902 12.2689 0.414922 13.7635 1.79665C13.8217 1.85051 13.8866 1.91559 13.9858 2.01486C14.0849 2.11394 14.1502 2.17769 14.204 2.23583C15.5861 3.7304 15.5866 6.03823 14.2047 7.53291C14.1508 7.59125 14.0854 7.65638 13.9858 7.75595L12.1994 9.54098C12.2614 8.92982 12.2185 8.30587 12.0634 7.69657L12.9956 6.76573C13.1044 6.65692 13.1458 6.61529 13.1765 6.58205C14.0621 5.62404 14.0621 4.1454 13.1765 3.18738C13.1458 3.15419 13.104 3.1135 12.9956 3.00508C12.8877 2.89716 12.8471 2.85551 12.814 2.82485C11.8559 1.9389 10.376 1.93886 9.41794 2.82485C9.38479 2.85554 9.34381 2.89622 9.23564 3.00439L7.27728 4.96413C7.16875 5.07265 7.12708 5.11322 7.09636 5.14643C6.21074 6.10441 6.21153 7.58236 7.09705 8.5404C7.12775 8.57357 7.16826 8.61575 7.27659 8.72408C7.38456 8.83205 7.42647 8.87227 7.45958 8.90293C7.62849 9.0591 7.81309 9.1881 8.00856 9.28894L6.98795 10.3095C6.82111 10.1978 6.66052 10.0715 6.50872 9.93114C6.45057 9.87733 6.38547 9.81341 6.28637 9.71431C6.1871 9.61504 6.12202 9.55018 6.06816 9.49196Z',
@@ -296,13 +316,15 @@ window.__ModuleLoader__.load({
296
316
  '.mcpmp-textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;line-height:1.55;resize:vertical}',
297
317
  '.mcpmp-input:focus,.mcpmp-select:focus,.mcpmp-textarea:focus{outline:none;border-color:var(--dsw-alias-brand-primary)}',
298
318
  '@media (max-width:640px){.mcpmp-tool{grid-template-columns:1fr;gap:2px}}',
299
- // ── settings nav row icon ────────────────────────────────────────────
300
- // The shell draws a generic gear for any section id it does not know,
301
- // and offers no way to supply a different one. Our row is tagged with
302
- // NAV_ROW_FLAG by markNavRow; hide the shell's gear in that row and
303
- // paint the chain-link glyph instead. The glyph rides a mask so it
304
- // inherits `currentColor` exactly like every other nav icon, in both
305
- // themes, with no extra element to keep in sync.
319
+ // ── legacy settings nav row icon (shells without the icon seat) ───────
320
+ // Before `settings.section.icon` existed, the shell drew a generic gear
321
+ // for any section id it did not know and offered no way to supply a
322
+ // different one. This is that workaround, kept only for those shells: a
323
+ // row tagged with NAV_ROW_FLAG hides the gear and paints the chain-link
324
+ // glyph in its place. The glyph rides a mask so it inherits
325
+ // `currentColor` exactly like every other nav icon, in both themes.
326
+ // `apply()` stops tagging rows as soon as the icon seat is live, so on a
327
+ // current shell no row ever matches these rules.
306
328
  'button[' + NAV_ROW_FLAG + ']>svg:first-child{display:none}',
307
329
  'button[' + NAV_ROW_FLAG + ']::before{content:"";flex:none;width:16px;height:16px;background-color:currentColor;'
308
330
  + '-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;'
@@ -479,6 +501,32 @@ window.__ModuleLoader__.load({
479
501
  code: h('path', { d: 'M6 4L2.5 8 6 12M10 4l3.5 4L10 12' }),
480
502
  };
481
503
 
504
+ /**
505
+ * The settings nav-row glyph, for the shell's `settings.section.icon` seat.
506
+ *
507
+ * The seat hands a square size (the same 16 the shell's own nav icons use)
508
+ * and expects back the same shape they are: one inline SVG painted in
509
+ * `currentColor`, so the row's own active/hover colour applies without this
510
+ * component knowing either theme. It is deliberately not tied to the page's
511
+ * own header icon set — the row is part of the shell's sidebar.
512
+ */
513
+ function NavIcon(props) {
514
+ var size = props !== null && typeof props.size === 'number' ? props.size : 16;
515
+ return h(
516
+ 'svg',
517
+ {
518
+ width: size,
519
+ height: size,
520
+ viewBox: '0 0 16 16',
521
+ fill: 'none',
522
+ 'aria-hidden': 'true',
523
+ },
524
+ NAV_ICON_PATHS.map(function (d, index) {
525
+ return h('path', { key: index, d: d, fill: 'currentColor' });
526
+ }),
527
+ );
528
+ }
529
+
482
530
  /**
483
531
  * Mark this plugin's own nav row so the stylesheet can swap its icon.
484
532
  *
@@ -490,10 +538,14 @@ window.__ModuleLoader__.load({
490
538
  * `:nth-child` guess) keeps working when another plugin inserts a section
491
539
  * at a neighbouring order, and it never touches a row that is not ours.
492
540
  *
541
+ * Only the legacy path calls this: with the icon seat live the shell draws
542
+ * our glyph itself and tagging the row would add a second one.
543
+ *
493
544
  * @param root - the mounted page element.
494
545
  * @returns a disposer that removes the marker.
495
546
  */
496
547
  function markNavRow(root) {
548
+ if (iconSlotLive) return function () {};
497
549
  if (root === null || typeof root.closest !== 'function') return function () {};
498
550
  var label = makeT(localeRef.current)('nav');
499
551
  // The page is mounted inside the settings panel, so the panel is the
@@ -527,15 +579,22 @@ window.__ModuleLoader__.load({
527
579
  * for environments without MutationObserver; here a missing flag is only
528
580
  * ever set, never removed, so mutations cannot ping-pong.
529
581
  *
582
+ * LEGACY path only: the whole tagger switches off the moment
583
+ * `settings.section.icon` is live. The shell then draws our glyph inside
584
+ * its own icon seat, so a flagged row would show that glyph plus the
585
+ * mask, i.e. a second icon — exactly the bug this guard exists to prevent.
586
+ *
530
587
  * @returns a disposer that disconnects the observer.
531
588
  */
532
589
  function watchNavRow() {
590
+ if (iconSlotLive) return function () {};
533
591
  if (typeof MutationObserver === 'undefined' || typeof document === 'undefined') {
534
592
  return function () {};
535
593
  }
536
594
  var scheduled = false;
537
595
  function scan() {
538
596
  scheduled = false;
597
+ if (iconSlotLive) return;
539
598
  var label = makeT(localeRef.current)('nav');
540
599
  var cells = document.querySelectorAll('button[class*="navCell"]');
541
600
  for (var i = 0; i < cells.length; i += 1) {
@@ -558,6 +617,20 @@ window.__ModuleLoader__.load({
558
617
  };
559
618
  }
560
619
 
620
+ /**
621
+ * Drop every legacy row flag.
622
+ *
623
+ * Called when the icon seat turns out to be live. The shell usually
624
+ * declares it before this plugin applies, but nothing guarantees that: if
625
+ * it declares the seat later, rows the fallback already tagged have to
626
+ * stop painting a glyph of their own, or the row ends up with two.
627
+ */
628
+ function clearNavRowFlags() {
629
+ if (typeof document === 'undefined' || typeof document.querySelectorAll !== 'function') return;
630
+ var rows = document.querySelectorAll('button[' + NAV_ROW_FLAG + ']');
631
+ for (var i = 0; i < rows.length; i += 1) rows[i].removeAttribute(NAV_ROW_FLAG);
632
+ }
633
+
561
634
  /** The row switch, styled as the pill toggle the rest of the UI uses. */
562
635
  function Switch(props) {
563
636
  return h(
@@ -1231,9 +1304,11 @@ window.__ModuleLoader__.load({
1231
1304
  var settleTimer = useRef(null);
1232
1305
  var pageRef = useRef(null);
1233
1306
 
1234
- // Swap this page's settings nav-row icon. watchNavRow already keeps the
1235
- // row flagged from registration time, so this is only a fallback for
1236
- // environments where the observer is unavailable.
1307
+ // Legacy paths only — with `settings.section.icon` live the glyph is
1308
+ // registered at apply() time and the row needs no tagging. watchNavRow
1309
+ // already keeps the row flagged from registration time, so this is a
1310
+ // fallback for environments where the observer is unavailable; both are
1311
+ // no-ops once the icon seat is live.
1237
1312
  useEffect(function () {
1238
1313
  return markNavRow(pageRef.current);
1239
1314
  }, []);
@@ -1595,9 +1670,35 @@ window.__ModuleLoader__.load({
1595
1670
  });
1596
1671
  }, 'dsh-mcp-manager-plus: settings section');
1597
1672
 
1598
- // Flag the nav row from the moment the shell first renders it, so the
1599
- // link icon shows before the page is ever opened.
1600
- ctx.effect(watchNavRow, 'dsh-mcp-manager-plus: nav row icon watch');
1673
+ // Preferred path: the shell's own icon seat for a settings section.
1674
+ // `id` must equal the section id registered above — the shell draws the
1675
+ // entry whose id matches the row it is rendering and falls back to its
1676
+ // generic gear when none does. This seat only exists on shells that
1677
+ // declare it, hence the stylesheet fallback below.
1678
+ try {
1679
+ ctx.effect(function () {
1680
+ return slots.inject('settings.section.icon', function () {
1681
+ iconSlotLive = true;
1682
+ // The seat took over the row: retire anything the legacy fallback
1683
+ // already tagged before its first render.
1684
+ clearNavRowFlags();
1685
+ return slots.register({ name: 'settings.section.icon', id: 'mcp' }, NavIcon);
1686
+ });
1687
+ }, 'dsh-mcp-manager-plus: settings nav icon');
1688
+ } catch (error) {
1689
+ // A shell without the seat parks the injection; one that rejects the
1690
+ // unknown key lands here. Either way the page must still register, so
1691
+ // the failure is reported and the fallback below takes the row.
1692
+ console.warn(
1693
+ '[dsh-mcp-manager-plus] settings.section.icon is unavailable, using the stylesheet glyph:',
1694
+ error,
1695
+ );
1696
+ }
1697
+
1698
+ // Legacy path, for shells that predate the icon seat: flag the row from
1699
+ // the moment the shell first renders it, so the link glyph shows before
1700
+ // the page is ever opened. No-op once `iconSlotLive` is set.
1701
+ ctx.effect(watchNavRow, 'dsh-mcp-manager-plus: legacy nav row icon');
1601
1702
  };
1602
1703
 
1603
1704
  return module.exports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp-manager-plus",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "MCP manager settings page for DeepSeek Harness: list, enable, configure and add MCP servers from the browser, written durably to the profile's user patch layer.",
5
5
  "license": "MIT",
6
6
  "icon": "./icon.svg",