dsh-remote-plugin 0.8.3 → 0.8.4

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.
Files changed (48) hide show
  1. package/apk/dsh-remote.apk +0 -0
  2. package/approval-summary.mjs +115 -0
  3. package/gateway.cjs +642 -16
  4. package/index.mjs +12 -0
  5. package/insights.mjs +1 -1
  6. package/package.json +2 -1
  7. package/plugin-center.mjs +88 -17
  8. package/plugin-transaction.mjs +19 -3
  9. package/public/admin.html +30 -28
  10. package/public/admin.js +1 -1
  11. package/public/announcements.json +31 -0
  12. package/public/app.js +40 -47
  13. package/public/approval-summary.js +78 -0
  14. package/public/build.json +2 -2
  15. package/public/cache-upgrade.js +51 -0
  16. package/public/chat-copy.js +34 -21
  17. package/public/desktop/desktop.css +18 -39
  18. package/public/desktop/desktop.html +70 -96
  19. package/public/desktop/desktop.js +15 -42
  20. package/public/e2ee-transport.js +147 -0
  21. package/public/extensions.js +6 -6
  22. package/public/history.js +48 -1
  23. package/public/index.html +74 -93
  24. package/public/md.js +36 -18
  25. package/public/motion.js +1 -1
  26. package/public/plugin-center.css +1 -0
  27. package/public/plugin-center.js +92 -11
  28. package/public/plugin.html +25 -24
  29. package/public/relay-devices.js +74 -0
  30. package/public/relay-settings.css +7 -0
  31. package/public/relay-settings.js +11 -4
  32. package/public/session-deck.css +7 -1
  33. package/public/session-deck.js +1 -1
  34. package/public/skins/blue-fish/preview.html +3 -2
  35. package/public/skins/bocchi/preview.html +5 -4
  36. package/public/skins/kita/preview.html +6 -5
  37. package/public/skins/nijika/preview.html +6 -5
  38. package/public/skins/penguin/preview.html +3 -2
  39. package/public/skins/ryo/preview.html +6 -5
  40. package/public/sponsor-entry.js +20 -21
  41. package/public/styles.css +24 -24
  42. package/public/teams.js +2 -2
  43. package/public/update.json +8 -8
  44. package/public/version.json +1 -1
  45. package/public/workflow.js +3 -4
  46. package/skills/dsh-remote-doctor/references/wiki/plugins.md +1 -1
  47. package/task-board.mjs +2 -2
  48. package/teams.mjs +7 -2
package/public/index.html CHANGED
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN">
3
3
  <head>
4
+ <meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
4
5
  <meta charset="utf-8">
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
6
7
  <meta name="theme-color" content="#0D1117">
@@ -11,25 +12,25 @@
11
12
  <script>/* 首帧前应用皮肤, 避免闪白/闪黑 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
12
13
  <link rel="manifest" href="manifest.webmanifest">
13
14
  <link rel="icon" href="icon.svg" type="image/svg+xml">
14
- <link rel="stylesheet" href="styles.css">
15
- <link rel="stylesheet" href="genui.css">
16
- <link rel="stylesheet" href="plugin-center.css">
17
- <link rel="stylesheet" href="skills.css">
18
- <link rel="stylesheet" href="doctor.css">
19
- <link rel="stylesheet" href="onboarding.css">
20
- <link rel="stylesheet" href="extensions.css">
21
- <link rel="stylesheet" href="insights.css">
22
- <link rel="stylesheet" href="workflow.css">
23
- <link rel="stylesheet" href="relay-settings.css">
24
- <link rel="stylesheet" href="subagents.css">
25
- <link rel="stylesheet" href="skins/blue-fish/skin.css">
26
- <link rel="stylesheet" href="skins/penguin/skin.css">
27
- <link rel="stylesheet" href="skins/bocchi/skin.css">
28
- <link rel="stylesheet" href="skins/kessoku/skin.css">
29
- <link rel="stylesheet" href="skins/nijika/skin.css">
30
- <link rel="stylesheet" href="skins/ryo/skin.css">
31
- <link rel="stylesheet" href="skins/kita/skin.css">
32
- <link rel="stylesheet" href="theme-picker.css">
15
+ <link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
16
+ <link rel="stylesheet" href="genui.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
17
+ <link rel="stylesheet" href="plugin-center.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
18
+ <link rel="stylesheet" href="skills.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
19
+ <link rel="stylesheet" href="doctor.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
20
+ <link rel="stylesheet" href="onboarding.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
21
+ <link rel="stylesheet" href="extensions.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
22
+ <link rel="stylesheet" href="insights.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
23
+ <link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
24
+ <link rel="stylesheet" href="relay-settings.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
25
+ <link rel="stylesheet" href="subagents.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
26
+ <link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
27
+ <link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
28
+ <link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
29
+ <link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
30
+ <link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
31
+ <link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
32
+ <link rel="stylesheet" href="skins/kita/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
33
+ <link rel="stylesheet" href="theme-picker.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
33
34
  </head>
34
35
  <body>
35
36
  <header class="topbar">
@@ -39,8 +40,8 @@
39
40
  <svg class="brand-caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m7 10 5 5 5-5"/></svg>
40
41
  </button>
41
42
  <div class="topbar-right">
42
- <button id="btn-donate" class="topbar-btn icon-btn" data-i18n-title="settings.donate" data-i18n-aria="settings.donate"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8h11v6a4 4 0 0 1-4 4H10a4 4 0 0 1-4-4Z"/><path d="M17 10h1.5a2.5 2.5 0 0 1 0 5H17M9 4c0 1 1 1.2 1 2M13 4c0 1 1 1.2 1 2M5 20h13"/></svg></button>
43
- <button id="btn-feedback" class="topbar-btn icon-btn" data-i18n-title="feedback.title" data-i18n-aria="feedback.title" aria-haspopup="menu" aria-expanded="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 11.5a7.5 7.5 0 0 1-7.5 7.5H7l-3 2 .8-3.1A7.5 7.5 0 1 1 20 11.5Z"/><path d="M8 11.5h.01M12 11.5h.01M16 11.5h.01"/></svg></button>
43
+
44
+
44
45
  <div class="ext-shortcuts">
45
46
  <button id="btn-plugin-shortcuts" class="topbar-btn icon-btn" type="button" aria-haspopup="menu" aria-controls="plugin-shortcuts-menu" aria-expanded="false" data-i18n-title="nav.plugins" data-i18n-aria="nav.plugins"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="2"/><rect x="14" y="3" width="7" height="7" rx="2"/><rect x="3" y="14" width="7" height="7" rx="2"/><rect x="14" y="14" width="7" height="7" rx="2"/></svg></button>
46
47
  <div id="plugin-shortcuts-menu" class="ext-shortcuts-menu hidden" role="menu" data-i18n-aria="nav.plugins"></div>
@@ -572,35 +573,8 @@
572
573
  </main>
573
574
 
574
575
  <!-- 反馈底部菜单(非模态) -->
575
- <div id="feedback-backdrop" class="sheet-backdrop hidden"></div>
576
- <div id="feedback-sheet" class="sheet hidden" role="menu" data-i18n-aria="feedback.title">
577
- <div class="sheet-handle" aria-hidden="true"></div>
578
- <div class="sheet-title" data-i18n="feedback.title">反馈</div>
579
- <button class="sheet-item primary" id="btn-doctor" role="menuitem">
580
- <span class="sheet-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0Z"/><path d="m9 12 2 2 4-5"/><path d="M12 2v2M2 12h2M20 12h2M12 20v2"/></svg></span>
581
- <span class="sheet-item-body"><span class="sheet-item-name" data-i18n="feedback.doctor">AI 排查问题</span><span class="sheet-item-desc" data-i18n="feedback.doctorDesc">使用你的 DSH 和模型,只读诊断</span></span>
582
- </button>
583
- <button class="sheet-item" id="btn-write-feedback" role="menuitem">
584
- <span class="sheet-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg></span>
585
- <span class="sheet-item-body"><span class="sheet-item-name" data-i18n="feedback.write">写反馈</span><span class="sheet-item-desc" data-i18n="feedback.writeDesc">App 内直接提交</span></span>
586
- </button>
587
- <a class="sheet-item primary" href="https://github.com/Blank-not-black/dsh-Remote/issues" target="_blank" rel="noopener" role="menuitem">
588
- <span class="sheet-ico"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8a8.01 8.01 0 0 0 5.47 7.59c.4.08.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></span>
589
- <span class="sheet-item-body"><span class="sheet-item-name">GitHub Issues</span><span class="sheet-item-desc" data-i18n="feedback.githubDesc">反馈 bug / 提建议</span></span>
590
- </a>
591
- <a class="sheet-item" href="https://gitee.com/Blankneverfails/dsh-Remote/issues" target="_blank" rel="noopener" role="menuitem">
592
- <span class="sheet-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="9" r="6"/><path d="M7.5 13.5 7 19a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l-.5-5.5"/><circle cx="10" cy="8.6" r=".5" fill="currentColor" stroke="none"/><circle cx="14" cy="8.6" r=".5" fill="currentColor" stroke="none"/><path d="M11 10.8c.6.5 1.4.5 2 0"/></svg></span>
593
- <span class="sheet-item-body"><span class="sheet-item-name">Gitee 反馈</span><span class="sheet-item-desc" data-i18n="feedback.giteeDesc">国内镜像,无需代理</span></span>
594
- </a>
595
- <a class="sheet-item" href="https://space.bilibili.com/419009275/dynamic" target="_blank" rel="noopener" role="menuitem">
596
- <span class="sheet-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3.5" y="6" width="17" height="11" rx="2"/><path d="M8.5 3.5v3M15.5 3.5v3"/><circle cx="9.2" cy="10.6" r=".5" fill="currentColor" stroke="none"/><circle cx="14.8" cy="10.6" r=".5" fill="currentColor" stroke="none"/><path d="M9.5 14c1.4 1 3.6 1 5 0"/></svg></span>
597
- <span class="sheet-item-body"><span class="sheet-item-name">B站交流</span><span class="sheet-item-desc" data-i18n="feedback.biliDesc">UP 动态页交流</span></span>
598
- </a>
599
- <button class="sheet-item" id="btn-copy-link" role="menuitem">
600
- <span class="sheet-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="3" width="12" height="12" rx="2"/><path d="M16 8h3a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-3"/></svg></span>
601
- <span class="sheet-item-body"><span class="sheet-item-name" data-i18n="feedback.copyLink">复制项目链接</span><span class="sheet-item-desc" data-i18n="feedback.copyDesc">手动分享给朋友</span></span>
602
- </button>
603
- </div>
576
+
577
+
604
578
 
605
579
  <!-- 统一应用内选择抽屉:替代 Android WebView 的原生 select 弹窗 -->
606
580
  <div id="custom-select-backdrop" class="sheet-backdrop custom-select-backdrop hidden"></div>
@@ -856,7 +830,7 @@
856
830
  </div>
857
831
 
858
832
  <!-- 赞赏支持模态 -->
859
- <script src="sponsor-entry.js" defer></script>
833
+
860
834
  <div id="modal-donate" class="modal hidden" role="dialog" aria-modal="true">
861
835
  <div class="modal-card">
862
836
  <div class="modal-title" data-i18n="settings.donate">赞赏支持</div>
@@ -931,6 +905,7 @@
931
905
  <span id="announcement-page"></span>
932
906
  <button id="announcement-next" class="mini-btn" type="button" data-i18n-aria="announcement.next" data-i18n-title="announcement.next" aria-label="下一条公告" title="下一条公告">›</button>
933
907
  </div>
908
+ <div class="announcement-scroll" tabindex="0" aria-label="公告内容" data-i18n-aria="announcement.label">
934
909
  <div id="announcement-title" class="modal-title"></div>
935
910
  <div id="announcement-content" class="modal-body announcement-content"></div>
936
911
  <div id="announcement-poll" class="announcement-poll hidden">
@@ -940,6 +915,7 @@
940
915
  <button id="announcement-poll-submit" class="btn primary" type="button" data-i18n="announcement.voteSubmit">提交投票</button>
941
916
  </div>
942
917
  <a id="announcement-action" class="announcement-action hidden" target="_blank" rel="noopener"></a>
918
+ </div>
943
919
  <div class="modal-actions">
944
920
  <button id="announcement-later" class="btn subtle" data-i18n="announcement.later">稍后再看</button>
945
921
  <button id="announcement-confirm" class="btn primary" data-i18n="announcement.gotIt">知道了</button>
@@ -1494,47 +1470,52 @@
1494
1470
  }
1495
1471
  }
1496
1472
  </script>
1497
- <script src="sha256.js"></script>
1498
- <script src="jsqr.min.js"></script>
1499
- <script src="i18n.js"></script>
1500
- <script src="theme.js"></script>
1501
- <script src="genui.js"></script>
1502
- <script src="chat-files.js"></script>
1503
- <script src="md.js"></script>
1504
- <script src="vendor/gsap/gsap.min.js"></script>
1505
- <script src="motion.js"></script>
1506
- <script type="module" src="morphicons-init.js"></script>
1507
- <script src="plugin-center.js"></script>
1508
- <script src="skills.js"></script>
1509
- <script src="insights.js"></script>
1510
- <script src="teams.js"></script>
1511
- <script src="task-board.js"></script>
1512
- <script src="extensions.js"></script>
1513
- <script src="diagnostics.js"></script>
1514
- <script src="doctor.js"></script>
1515
- <script src="history.js"></script>
1516
- <script src="announcement-forms.js"></script>
1517
- <script src="activity.js"></script>
1518
- <script src="turn-results.js"></script>
1519
- <script src="image-cache.js"></script>
1520
- <script src="chat-copy.js"></script>
1521
- <script src="image-preview.js"></script>
1522
- <script src="link-check.js"></script>
1523
- <script src="network.js"></script>
1524
- <script src="operations.js"></script>
1525
- <script src="workflow.js"></script>
1526
- <script src="relay-settings.js"></script>
1527
- <script src="subagents.js"></script>
1528
- <script src="session-presets.js"></script>
1529
- <script src="permission-presets.js"></script>
1530
- <script src="approval-records.js"></script>
1531
- <script src="doctor-entry.js"></script>
1532
- <script src="onboarding.js"></script>
1533
- <link rel="stylesheet" href="file-inbox.css">
1534
- <script src="file-inbox.js"></script>
1535
- <link rel="stylesheet" href="session-deck.css">
1536
- <script src="session-deck.js"></script>
1537
- <script src="lan-discovery.js"></script>
1538
- <script src="app.js"></script>
1473
+ <script src="e2ee-transport.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1474
+ <script src="sha256.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1475
+ <script src="jsqr.min.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1476
+ <script src="i18n.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1477
+ <script src="theme.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1478
+ <script src="genui.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1479
+ <script src="chat-files.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1480
+ <script src="md.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1481
+ <script src="vendor/gsap/gsap.min.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1482
+ <script src="motion.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1483
+ <script type="module" src="morphicons-init.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1484
+ <script src="plugin-center.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1485
+ <script src="skills.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1486
+ <script src="insights.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1487
+ <script src="teams.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1488
+ <script src="task-board.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1489
+ <script src="extensions.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1490
+ <script src="diagnostics.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1491
+ <script src="doctor.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1492
+ <script src="history.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1493
+ <script src="announcement-forms.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1494
+ <script src="activity.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1495
+ <script src="turn-results.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1496
+ <script src="image-cache.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1497
+ <script src="chat-copy.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1498
+ <script src="image-preview.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1499
+ <script src="link-check.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1500
+ <script src="network.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1501
+ <script src="operations.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1502
+ <script src="workflow.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1503
+ <script src="sponsor-entry.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1504
+ <script src="relay-devices.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1505
+ <script src="relay-settings.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1506
+ <script src="subagents.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1507
+ <script src="session-presets.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1508
+ <script src="permission-presets.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1509
+ <script src="approval-records.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1510
+ <script src="approval-summary.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1511
+ <script src="doctor-entry.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1512
+ <script src="onboarding.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1513
+ <link rel="stylesheet" href="file-inbox.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
1514
+ <script src="file-inbox.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1515
+ <link rel="stylesheet" href="session-deck.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
1516
+ <script src="session-deck.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1517
+ <script src="lan-discovery.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1518
+ <script src="cache-upgrade.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1519
+ <script src="app.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
1539
1520
  </body>
1540
1521
  </html>
package/public/md.js CHANGED
@@ -6,9 +6,9 @@
6
6
  * 同时支持浏览器全局 window.mdToHtml 与 Node CommonJS module.exports。
7
7
  */
8
8
  (function (root, factory) {
9
- if (typeof module === 'object' && module.exports) module.exports = factory(require('./genui.js'), require('./chat-files.js'))
10
- else root.mdToHtml = factory(root.DshGenUi, root.DshChatFiles)
11
- })(typeof self !== 'undefined' ? self : this, function (genui, files) {
9
+ if (typeof module === 'object' && module.exports) module.exports = factory(require('./genui.js'), require('./chat-files.js'), () => require('./chat-copy.js'))
10
+ else root.mdToHtml = factory(root.DshGenUi, root.DshChatFiles, () => root.DshChatCopy)
11
+ })(typeof self !== 'undefined' ? self : this, function (genui, files, chatCopy) {
12
12
  'use strict'
13
13
 
14
14
  function escapeHtml(s) {
@@ -267,38 +267,56 @@
267
267
  return html
268
268
  }
269
269
 
270
- function codeHtml(code, options) {
270
+ function codeHtml(code, options, language) {
271
271
  var pre = '<pre><code>' + escapeHtml(code) + '</code></pre>'
272
- return options?.copyCode ? '<div class="chat-code"><button type="button" class="chat-copy-button" data-chat-copy-code>' + escapeHtml(options.copyCodeLabel || '复制代码') + '</button>' + pre + '</div>' : pre
272
+ return options?.copyCode && chatCopy()?.code ? chatCopy().code(code, language, { label: options.copyCodeLabel, scope: options.copyScope }) : pre
273
+ }
274
+ // Match complete fence lines so Markdown containing its own ``` blocks can
275
+ // use a longer outer fence without splitting the content being copied.
276
+ function fencedParts(raw) {
277
+ var parts = [], cursor = 0, open = /^ {0,3}(`{3,}|~{3,})([^\n]*)(?:\n|$)/gm, match
278
+ while ((match = open.exec(raw))) {
279
+ if (match[1][0] === '`' && match[2].includes('`')) continue
280
+ if (match.index > cursor) parts.push({ text: raw.slice(cursor, match.index) })
281
+ var close = new RegExp('^ {0,3}' + match[1][0] + '{' + match[1].length + ',}[ \\t]*(?:\\n|$)', 'gm')
282
+ close.lastIndex = open.lastIndex
283
+ var end = close.exec(raw)
284
+ var source = raw.slice(open.lastIndex, end ? end.index : raw.length).replace(/\n$/, '')
285
+ var indent = match[0].match(/^ */)[0].length
286
+ if (indent) source = source.replace(new RegExp('^ {0,' + indent + '}', 'gm'), '')
287
+ parts.push({ code: source, info: match[2].trim(), closed: !!end })
288
+ cursor = end ? close.lastIndex : raw.length
289
+ open.lastIndex = cursor
290
+ if (!end) break
291
+ }
292
+ if (cursor < raw.length) parts.push({ text: raw.slice(cursor) })
293
+ return parts
273
294
  }
274
295
  function mdToHtml(text, options) {
275
296
  if (options?.imageLabel) imageLabel = String(options.imageLabel)
276
297
  var raw = String(text == null ? '' : text).replace(/\r\n?/g, '\n')
277
- var parts = raw.split(/```/)
298
+ var parts = fencedParts(raw)
278
299
  var out = ''
279
300
  for (var i = 0; i < parts.length; i++) {
280
- if (i % 2 === 1) {
281
- var code = parts[i]
282
- code = code.replace(/^\n/, '')
283
- if (code.slice(-1) === '\n') code = code.slice(0, -1)
284
- var fence = code.match(/^([^\n]*)\n([\s\S]*)$/)
301
+ var part = parts[i]
302
+ if (part.code !== undefined) {
303
+ var code = part.code
304
+ var language = part.info.toLowerCase()
285
305
  // Wait for the closing fence: streaming partial JSON stays readable as source.
286
- if (options?.richContent !== false && genui && fence && i < parts.length - 1 && fence[2].length <= 200000) {
287
- var language = fence[1].trim().toLowerCase()
306
+ if (options?.richContent !== false && genui && part.closed && code.length <= 200000) {
288
307
  try {
289
308
  if (/^(?:dsh-ui|json dsh-ui|dsh-ui json)$/.test(language)) {
290
- out += genui.render(JSON.parse(fence[2])); continue
309
+ out += genui.render(JSON.parse(code)); continue
291
310
  }
292
311
  if (language === 'html' || language === 'htm') {
293
- out += genui.html(fence[2]) + '<details><summary>HTML / 源码</summary>' + codeHtml(fence[2], options) + '</details>'; continue
312
+ out += genui.html(code) + '<details><summary>HTML / 源码</summary>' + codeHtml(code, options, language) + '</details>'; continue
294
313
  }
295
314
  } catch (_) { /* Invalid or over-budget specs remain source, never execute. */ }
296
315
  }
297
316
  // A language header belongs to the fence, not to the copied source.
298
- var content = options?.copyCode && /^[a-zA-Z0-9_+.-]{1,40}[ \t]*\n/.test(parts[i]) && fence ? fence[2] : code
299
- out += codeHtml(content, options)
317
+ out += codeHtml(code, options, part.info.split(/\s+/)[0])
300
318
  } else {
301
- var escaped = escapeHtml(parts[i])
319
+ var escaped = escapeHtml(part.text)
302
320
  out += renderLines(escaped.split('\n').map(function (line) {
303
321
  return line.replace(/^[ \t]+/, function (indent) {
304
322
  var spaces = ''
package/public/motion.js CHANGED
@@ -549,7 +549,7 @@
549
549
  if (!becameVisible) continue
550
550
  if (node.matches('.view, .ds-view, [data-motion-view]')) view(node)
551
551
  else if (node.matches('.modal, .ds-modal, .sheet-backdrop, .sheet, .ds-drawer')) overlay(node)
552
- else if (node.matches('.composer-menu, .ds-group-menu, .ds-feedback-menu, .fb-menu')) popover(node)
552
+ else if (node.matches('.composer-menu, .ds-group-menu, .fb-menu')) popover(node)
553
553
  else if (node.matches('[data-motion-panel], .wb-panel, .ds-wb-panel, .doctor-body, .settings-subpage')) panel(node)
554
554
  }
555
555
  })
@@ -28,6 +28,7 @@
28
28
  .pc-recovery button{margin-top:10px}
29
29
  .pc-controls{border:1px solid var(--dsr-line,#30363d);border-radius:14px;padding:12px;margin-bottom:20px;background:var(--dsr-panel,#161b22)}
30
30
  .pc-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
31
+ .pc-toolbar{flex-wrap:wrap}.pc-toolbar-actions{display:flex;gap:6px;align-items:center;margin-left:auto}.pc-dialog .pc-update-all{padding:8px 10px;color:var(--dsr-accent-strong,#79c0ff)}
31
32
  .pc-tabs{display:flex;gap:3px;min-width:0;padding:3px;border-radius:10px;background:var(--dsr-bg-2,#11161e)}
32
33
  .pc-tabs button{white-space:nowrap;padding:8px 14px;background:transparent;border-color:transparent;color:var(--dsr-muted,#a7b0bc);border-radius:8px}
33
34
  .pc-tabs button.active{background:var(--dsr-accent-soft,#58a6ff1f);color:var(--dsr-accent-strong,#79c0ff)}
@@ -5,7 +5,7 @@ window.DshPluginCenter = (() => {
5
5
  const expandedDetails = new Map()
6
6
  const marketCompatibility = new Map()
7
7
  let renderedInstalled = '', renderedJobs = '', filter = '', statusFilter = 'all', refreshSequence = 0, trackedOperation = '', experimentalExpanded = false
8
- const labels = { install: '安装', update: '更新', remove: '卸载', restore: '恢复', enable: '启用', disable: '停用', queued: '等待执行', running: '执行中', complete: '已完成', failed: '失败', interrupted: '已中断', active: '运行中', pending: '等待依赖', loading: '加载中', disposed: '未运行', unloading: '卸载中', inactive: '未运行' }
8
+ const labels = { install: '安装', update: '更新', 'update-all': '批量更新', remove: '卸载', restore: '恢复', enable: '启用', disable: '停用', queued: '等待执行', running: '执行中', complete: '已完成', failed: '失败', interrupted: '已中断', active: '运行中', pending: '等待依赖', loading: '加载中', disposed: '未运行', unloading: '卸载中', inactive: '未运行' }
9
9
  const stages = { queued: '等待主机启动', backup: '备份配置', snapshot: '备份插件文件', restore: '恢复并校验', 'profile-lock': '检查配置锁', cli: '执行插件命令', verify: '保存并核验', complete: '完成' }
10
10
  function compareVersions(left, right) {
11
11
  const parse = value => {
@@ -56,6 +56,13 @@ window.DshPluginCenter = (() => {
56
56
  return el
57
57
  }
58
58
  function message(text) { dialog.querySelector('.pc-message').textContent = text }
59
+ function updateAllControl() {
60
+ const control = dialog.querySelector('.pc-update-all')
61
+ control.hidden = tab !== 'installed'
62
+ control.disabled = pending || !snapshot?.writable || snapshot.busy || snapshot.capabilities?.updateAll !== true
63
+ control.title = snapshot?.capabilities?.updateAll ? '检查全部已安装的 registry 插件,确认后批量更新' : '需要升级主机端 Remote 插件以支持批量更新'
64
+ for (const tab of dialog.querySelectorAll('[data-pc-tab]')) tab.disabled = pending
65
+ }
59
66
  async function api(path, body) {
60
67
  if (!connection.valid()) throw new Error('连接已切换,请关闭后重新打开插件中心')
61
68
  const current = generation
@@ -233,6 +240,7 @@ window.DshPluginCenter = (() => {
233
240
  try { data = await api('/state') } catch (error) { if (sequence === refreshSequence) throw error; return }
234
241
  if (sequence !== refreshSequence) return
235
242
  snapshot = data
243
+ updateAllControl()
236
244
  window.DshExtensions?.remember(connection, snapshot)
237
245
  const tracked = snapshot.operations.find(job => job.id === trackedOperation)
238
246
  if (tracked && !['queued', 'running'].includes(tracked.phase)) {
@@ -284,6 +292,7 @@ window.DshPluginCenter = (() => {
284
292
  el.append(node('p', jobProgress(job), 'pc-job-progress'))
285
293
  el.append(node('p', job.message || '任务在主机端执行,可关闭窗口后回来查看。'))
286
294
  if (job.log) el.append(node('pre', job.log))
295
+ for (const target of job.targets || []) el.append(node('p', target.name + ' · ' + target.fromVersion + ' → ' + target.version + ' · ' + (labels[target.phase] || target.phase) + (target.message ? ' · ' + target.message : ''), 'pc-batch-result'))
287
296
  if (job.canRestore) {
288
297
  const restore = button('恢复更新前状态', () => reviewRestore(job))
289
298
  restore.disabled = !snapshot.writable || snapshot.busy || pending
@@ -408,36 +417,101 @@ window.DshPluginCenter = (() => {
408
417
  renderInline(target, button)
409
418
  }
410
419
  }
411
- async function mutate(action, name, version) {
420
+ async function updateAll() {
421
+ if (pending || snapshot?.busy || !snapshot?.writable || !snapshot.capabilities?.updateAll) return
422
+ const current = generation, sequence = ++detailSequence, area = dialog.querySelector('.pc-detail')
423
+ const valid = () => current === generation && sequence === detailSequence && connection.valid()
424
+ const skipped = [], targets = []
425
+ pending = true; updateAllControl(); renderInstalled(); renderedInstalled = ''
426
+ const status = node('p', '正在读取最新插件列表…')
427
+ const cancel = button('取消检查', () => {
428
+ detailSequence++; pending = false; updateAllControl(); area.replaceChildren(); renderInstalled(); renderedInstalled = ''
429
+ })
430
+ area.replaceChildren(status, cancel)
431
+ try {
432
+ await refresh()
433
+ if (!valid()) return
434
+ if (snapshot.busy || !snapshot.writable) throw new Error('主机已有任务或当前环境只读,请稍后重试')
435
+ const revision = snapshot.revision, candidates = []
436
+ for (const item of snapshot.items) {
437
+ let reason = !(item.managed && item.bundle || item.selfUpdate) ? '由主机维护或不是插件'
438
+ : /[:/\\]/.test(item.requested || '') || !item.requested || item.requested.startsWith('.') ? '本地、链接或自定义来源,请单独维护'
439
+ : compareVersions(item.version, item.version) === null ? '已装版本无法比较,请单独维护' : ''
440
+ if (reason) skipped.push(item.name + ':' + reason)
441
+ else candidates.push(item)
442
+ }
443
+ if (candidates.length > 100) throw new Error('插件超过单次批量更新的 100 项上限,请分开维护')
444
+ let checked = 0
445
+ // Each detail request has its own timeout; a large profile does not need one giant HTTP request.
446
+ for (let i = 0; i < candidates.length && valid(); i += 4) await Promise.all(candidates.slice(i, i + 4).map(async item => {
447
+ try {
448
+ const { item: latest } = await api('/details?name=' + encodeURIComponent(item.name))
449
+ if (!valid()) return
450
+ const order = compareVersions(latest?.version, item.version)
451
+ if (latest?.bundle && order !== null && order > 0) targets.push({ name: item.name, version: latest.version })
452
+ else skipped.push(item.name + ':' + (order !== null && order <= 0 ? '当前版本已是最新或高于 latest' : '目标不是可比较的 DSH 插件版本'))
453
+ } catch (error) { if (valid()) skipped.push(item.name + ':检查失败,' + error.message) }
454
+ finally { if (valid()) status.textContent = '正在检查更新:' + (++checked) + '/' + candidates.length }
455
+ }))
456
+ if (!valid()) return
457
+ await refresh()
458
+ if (!valid()) return
459
+ if (snapshot.revision !== revision || snapshot.busy) throw new Error('检查期间插件列表或任务状态已变化,请重新检查')
460
+ targets.sort((a, b) => (a.name === 'dsh-remote-plugin') - (b.name === 'dsh-remote-plugin') || a.name.localeCompare(b.name))
461
+ pending = false; updateAllControl()
462
+ if (!targets.length) {
463
+ area.replaceChildren(node('p', '没有可自动更新的插件。'))
464
+ for (const text of skipped.sort()) area.append(node('p', text))
465
+ return
466
+ }
467
+ await mutate('update-all', 'all-plugins', undefined, { targets, skipped: skipped.sort() })
468
+ } catch (error) {
469
+ if (valid()) area.replaceChildren(node('p', error.message, 'pc-detail-error'), button('重新检查全部更新', updateAll))
470
+ } finally {
471
+ if (valid()) { pending = false; updateAllControl(); renderInstalled(); renderedInstalled = '' }
472
+ }
473
+ }
474
+ async function mutate(action, name, version, batch) {
412
475
  if (pending) return
413
476
  const current = generation
414
477
  const reviewSequence = ++detailSequence
415
478
  // LAN HTTP is not a secure context; an idempotency key does not need WebCrypto.
416
479
  const id = globalThis.crypto?.randomUUID?.() || `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`
417
480
  const body = { id, action, name, ...(version ? { version } : {}), revision: snapshot.revision }
481
+ if (batch) body.targets = batch.targets
418
482
  if (name === 'dsh-remote-plugin' && action === 'update') body.confirmSelfUpdate = true
483
+ if (batch?.targets.some(target => target.name === 'dsh-remote-plugin')) body.confirmSelfUpdate = true
419
484
  const area = dialog.querySelector('.pc-detail')
420
485
  let plan
421
- if (['install', 'update', 'remove'].includes(action)) {
486
+ if (['install', 'update', 'remove', 'update-all'].includes(action)) {
422
487
  pending = true
488
+ updateAllControl()
423
489
  area.replaceChildren(node('p', '正在预检目标版本、锁文件与发布年龄策略…'))
424
490
  try {
425
491
  const response = await api('/preflight', body)
426
492
  if (current !== generation || reviewSequence !== detailSequence) return
427
493
  plan = response.plan
428
494
  if (!plan?.key) throw new Error('主机未返回可确认的预检计划,请升级主机 Remote 插件')
495
+ if (batch && (!Array.isArray(plan.targets) || !plan.targets.length)) throw new Error('主机未返回完整批量更新列表,请重新检查')
429
496
  body.preflightKey = plan.key
430
497
  } catch (error) {
431
498
  if (current !== generation || reviewSequence !== detailSequence) return
432
- area.replaceChildren(node('p', error.message, 'pc-detail-error'), button('重新预检', () => mutate(action, name, version)))
499
+ area.replaceChildren(node('p', error.message, 'pc-detail-error'), button('重新预检', () => mutate(action, name, version, batch)))
433
500
  return
434
- } finally { if (current === generation) pending = false }
501
+ } finally { if (current === generation) { pending = false; updateAllControl(); if (tab !== 'market') { renderInstalled(); renderedInstalled = '' } } }
435
502
  }
436
503
  if (current !== generation || reviewSequence !== detailSequence || !connection.valid()) return
437
- const review = card('确认' + labels[action], name + (version ? '@' + version : ''))
504
+ const review = card('确认' + labels[action], batch ? '共 ' + plan.targets.length + ' 个插件' : name + (version ? '@' + version : ''))
505
+ if (batch) {
506
+ for (const target of plan.targets) review.append(node('p', target.name + ' · ' + target.fromVersion + ' → ' + target.version))
507
+ review.append(node('p', '逐个更新,遇到失败停止后续项;操作记录显示每项结果。关闭页面后主机继续执行。恢复备份会撤销整批更新。'))
508
+ const skipped = node('details'); skipped.append(node('summary', '未更新的项目(' + batch.skipped.length + ')'))
509
+ for (const text of batch.skipped) skipped.append(node('p', text))
510
+ review.append(skipped)
511
+ }
438
512
  review.append(node('p', '目标环境:' + snapshot.profile + '。配置修改后需要重启 DSH;不会自动重启。'))
439
513
  if (body.confirmSelfUpdate) review.append(node('p', '更新当前主机的 Remote 插件本体,先备份配置与旧包,后台执行。重启 DSH 后新版本生效,连接可能短暂中断;此操作不会升级手机 App。'))
440
- const confirm = button('确认' + labels[action], () => executeMutation(body)); confirm.className = action === 'remove' ? 'pc-danger-confirm' : 'pc-primary'
514
+ const confirm = button('确认' + labels[action], () => { if (reviewSequence === detailSequence) return executeMutation(body) }); confirm.className = action === 'remove' ? 'pc-danger-confirm' : 'pc-primary'
441
515
  if (plan) {
442
516
  review.append(node('p', '执行前备份全部插件文件和配置;安装后核验配置、锁文件与已安装版本。失败可在操作记录恢复更新前状态。'))
443
517
  if (plan.baselineWarning) review.append(node('p', '更新前已存在待修复状态:' + plan.baselineWarning + '。恢复备份会回到这一状态;只有安装后一致性核验通过才会报告完成。', 'pc-detail-error'))
@@ -458,7 +532,7 @@ window.DshPluginCenter = (() => {
458
532
  review.append(label, node('p', '不批准也可取消,等待上述版本达到发布年龄后重新预检。'))
459
533
  }
460
534
  }
461
- review.append(confirm, button('取消', () => area.replaceChildren()))
535
+ review.append(confirm, button('取消', () => { detailSequence++; area.replaceChildren() }))
462
536
  area.replaceChildren(review); area.scrollIntoView({ block: 'nearest' })
463
537
  }
464
538
  function reviewRestore(job) {
@@ -473,6 +547,7 @@ window.DshPluginCenter = (() => {
473
547
  if (pending) return
474
548
  const current = generation
475
549
  pending = true
550
+ updateAllControl()
476
551
  if (tab !== 'market') { renderInstalled(); renderedInstalled = '' }
477
552
  for (const control of dialog.querySelector('.pc-detail').querySelectorAll('button')) control.disabled = true
478
553
  try {
@@ -485,7 +560,7 @@ window.DshPluginCenter = (() => {
485
560
  if (current !== generation) return
486
561
  if (error.status === 409 && body.preflightKey) {
487
562
  message(error.message)
488
- dialog.querySelector('.pc-detail').replaceChildren(button('重新预检', () => mutate(body.action, body.name, body.version)))
563
+ dialog.querySelector('.pc-detail').replaceChildren(button('重新预检', () => body.action === 'update-all' ? updateAll() : mutate(body.action, body.name, body.version)))
489
564
  return
490
565
  }
491
566
  message(error.message + ';请先查看操作记录,避免重复提交。')
@@ -511,7 +586,10 @@ window.DshPluginCenter = (() => {
511
586
  }
512
587
  timer = setTimeout(poll, 4000)
513
588
  }
514
- function pause() { generation++; refreshSequence++; clearTimeout(timer); if (dialog) dialog.open = false }
589
+ function pause() {
590
+ generation++; refreshSequence++; detailSequence++; clearTimeout(timer); pending = false
591
+ if (dialog) { dialog.open = false; dialog.querySelector('.pc-detail').replaceChildren() }
592
+ }
515
593
  async function resume() {
516
594
  if (!dialog || !connection.valid()) return
517
595
  dialog.open = true; const current = ++generation
@@ -532,6 +610,7 @@ window.DshPluginCenter = (() => {
532
610
  window.DshSkillsCenter?.close()
533
611
  tab = value; detailSequence++; expandedDetails.clear(); renderedInstalled = ''; dialog.querySelector('.pc-detail').replaceChildren()
534
612
  renderTabs(); message('')
613
+ updateAllControl()
535
614
  dialog.querySelector('.pc-market-tools').hidden = value !== 'market'; dialog.querySelector('.pc-filters').hidden = value === 'market'
536
615
  if (value === 'market') { offset = 0; return search() }
537
616
  return refresh()
@@ -539,7 +618,9 @@ window.DshPluginCenter = (() => {
539
618
  control.dataset.pcTab = value; toolbar.append(control)
540
619
  }
541
620
  const refreshButton = button('刷新', () => tab === 'market' ? (offset = 0, search(true)) : refresh()); refreshButton.className = 'pc-refresh'
542
- const toolbarRow = node('div', null, 'pc-toolbar'); toolbarRow.append(toolbar, refreshButton)
621
+ const updateAllButton = button('一键更新', updateAll); updateAllButton.className = 'pc-update-all'; updateAllButton.disabled = true
622
+ const toolbarActions = node('div', null, 'pc-toolbar-actions'); toolbarActions.append(updateAllButton, refreshButton)
623
+ const toolbarRow = node('div', null, 'pc-toolbar'); toolbarRow.append(toolbar, toolbarActions)
543
624
  const filters = node('div', null, 'pc-filters')
544
625
  const query = node('input'); query.placeholder = '筛选已安装插件'; query.setAttribute('aria-label', '筛选已安装插件')
545
626
  query.addEventListener('input', () => { filter = query.value.trim(); renderInstalled() })