most-box 0.1.9 → 0.2.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.
Files changed (157) hide show
  1. package/README.md +16 -3
  2. package/out/admin/index.html +0 -0
  3. package/out/app/index.html +0 -0
  4. package/out/assets/AppShell-CQhg6DJU.js +1 -0
  5. package/out/assets/ChatUi-BepWs-ZU.js +1 -0
  6. package/out/assets/LanguageToggle-CtzCCAYv.js +1 -0
  7. package/out/assets/{LogoIcon-CYQ7cHd5.js → LogoIcon-Dxto3Sb4.js} +1 -1
  8. package/out/assets/{MarketingLayout-BTIbv4fW.js → MarketingLayout-BQw0IS2i.js} +1 -1
  9. package/out/assets/MarketingThemeToggle-DBaC9bjz.js +1 -0
  10. package/out/assets/MilkdownEditor-BqJzntYE.js +1054 -0
  11. package/out/assets/MoveModal-4D9n11Kw.js +1 -0
  12. package/out/assets/Nav-9MDdvgNs.js +1 -0
  13. package/out/assets/NoteSidebar-C-rIt32H.js +1 -0
  14. package/out/assets/OpenSidebarButton-Dd0JmKuE.js +1 -0
  15. package/out/assets/PemBlock-C8dEIzu-.js +1 -0
  16. package/out/assets/SidebarAccount-ClS-N0lq.js +1 -0
  17. package/out/assets/arrow-right-urE9Rd7j.js +1 -0
  18. package/out/assets/channelApi-BwQU0-h1.js +1 -0
  19. package/out/assets/check-DUNsD2t6.js +1 -0
  20. package/out/assets/chevron-down-D6mpsfv4.js +1 -0
  21. package/out/assets/{circle-alert-CqEQz6P4.js → circle-alert-W0iyN4sC.js} +1 -1
  22. package/out/assets/cloud-BMyOoC2x.js +1 -0
  23. package/out/assets/code-B1Cb_Icm.js +1 -0
  24. package/out/assets/{copy-CM-qWlbv.js → copy-C1MttOli.js} +1 -1
  25. package/out/assets/{dist-CvatM4u8.js → dist-8QDHqrPN.js} +1 -1
  26. package/out/assets/{dist-BmtYO1GG.js → dist-B0JrbG7f.js} +5 -5
  27. package/out/assets/{dist-DBpw-A8y.js → dist-BFSyuOuw.js} +1 -1
  28. package/out/assets/{dist-D5Cf0hK8.js → dist-BPs0Xns9.js} +2 -2
  29. package/out/assets/{dist-BQV5zYG_.js → dist-Br_5lLVO.js} +9 -9
  30. package/out/assets/{dist-CrzjJUOw.js → dist-BzqqCPi2.js} +1 -1
  31. package/out/assets/dist-C3lbe8SW.js +9 -0
  32. package/out/assets/{dist-CWJ3323z.js → dist-CfU9fwWz.js} +1 -1
  33. package/out/assets/{dist-BdmTLuCI.js → dist-DCX0ws1K.js} +1 -1
  34. package/out/assets/{dist-DrumcFOX.js → dist-DJdv-Ma3.js} +1 -1
  35. package/out/assets/{dist-C5HibLEW.js → dist-chOCTzB2.js} +1 -1
  36. package/out/assets/{download-0rM8xVCe.js → download-y7SZXu6E.js} +1 -1
  37. package/out/assets/downloadValidation-B0p9Ai_9.js +1 -0
  38. package/out/assets/filePreview-UI9NH34f.js +1 -0
  39. package/out/assets/format-CR8oUWq6.js +1 -0
  40. package/out/assets/game-CdU3xnZo.js +1 -0
  41. package/out/assets/{hard-drive-CCdIvSap.js → hard-drive-D13Qbobu.js} +1 -1
  42. package/out/assets/image-DJCA16l_.js +1 -0
  43. package/out/assets/index-BdaFEQG-.css +1 -0
  44. package/out/assets/index-QxXZzOUL.js +33 -0
  45. package/out/assets/index.lazy-BBTTFanX.js +1 -0
  46. package/out/assets/index.lazy-BG4ZylHD.js +2 -0
  47. package/out/assets/index.lazy-Bi-6ZXZX.js +1 -0
  48. package/out/assets/index.lazy-BixWVr0B.js +1 -0
  49. package/out/assets/index.lazy-BjFwNYy5.js +3 -0
  50. package/out/assets/index.lazy-C8EIQsXY.js +2 -0
  51. package/out/assets/index.lazy-CarNe2uu.js +1 -0
  52. package/out/assets/index.lazy-DEuGu3H3.js +1 -0
  53. package/out/assets/index.lazy-GPyILCA7.js +3 -0
  54. package/out/assets/index.lazy-I8ofndXl.js +1 -0
  55. package/out/assets/index.lazy-TxhWsA7y.js +1 -0
  56. package/out/assets/index.lazy-azfky8k7.js +1 -0
  57. package/out/assets/{key-round-tIqGrtt_.js → key-round-CZniN9lv.js} +1 -1
  58. package/out/assets/lock-D5OSNhep.js +1 -0
  59. package/out/assets/log-out-B6phyZ5z.js +1 -0
  60. package/out/assets/{music-BkZKq879.js → music-CbUskKgg.js} +1 -1
  61. package/out/assets/{notebook-pen-B4VSbweh.js → notebook-pen-DqKDQ6MJ.js} +1 -1
  62. package/out/assets/play-BIl8q9eU.js +1 -0
  63. package/out/assets/plus-BxxbpH6Q.js +1 -0
  64. package/out/assets/{save-BzjzC3eV.js → save-DkH1n_Ov.js} +1 -1
  65. package/out/assets/search-BQi5Z0E-.js +1 -0
  66. package/out/assets/{send-DtQInX0y.js → send-Cl6NtD2T.js} +1 -1
  67. package/out/assets/{trash-2-BhMrUgGM.js → trash-2-BBjpgK_f.js} +1 -1
  68. package/out/assets/triangle-alert-l98G8u9O.js +1 -0
  69. package/out/assets/upload-ByP6Ydde.js +1 -0
  70. package/out/assets/{useChannelMessages-Bs1hEJyd.js → useChannelMessages-BgbYfF2c.js} +2 -2
  71. package/out/assets/useGameRoom-DPmweWwe.js +1 -0
  72. package/out/assets/{wallet-YxbxCi7C.js → wallet-c7zIhNSM.js} +1 -1
  73. package/out/assets/{wifi-v3JpPCNm.js → wifi-Bm4biAjc.js} +1 -1
  74. package/out/chat/index.html +0 -0
  75. package/out/chat/join/index.html +0 -0
  76. package/out/demo/index.html +0 -0
  77. package/out/download/index.html +6 -2
  78. package/out/game/gandengyan/index.html +0 -0
  79. package/out/game/index.html +0 -0
  80. package/out/game/zhajinhua/index.html +0 -0
  81. package/out/index.html +6 -2
  82. package/out/note/index.html +0 -0
  83. package/out/ping/index.html +6 -2
  84. package/out/web3/index.html +0 -0
  85. package/package.json +2 -2
  86. package/server/index.js +9 -0
  87. package/server/src/core/channelAttachment.js +7 -3
  88. package/server/src/core/channelIdentity.js +50 -0
  89. package/server/src/core/cid.js +6 -1
  90. package/server/src/core/cidTopic.js +18 -4
  91. package/server/src/core/displayPath.js +10 -0
  92. package/server/src/core/gameRoom.js +2 -2
  93. package/server/src/core/mostLink.js +45 -25
  94. package/server/src/core/ownerMetadata.js +34 -0
  95. package/server/src/core/userSyncKeys.js +36 -0
  96. package/server/src/http/app.js +71 -149
  97. package/server/src/http/dataPath.js +26 -0
  98. package/server/src/http/errors.js +8 -4
  99. package/server/src/http/nodeStatus.js +13 -13
  100. package/server/src/http/rateLimit.js +39 -0
  101. package/server/src/http/routePolicy.js +43 -0
  102. package/server/src/index.js +1909 -759
  103. package/server/src/node/offlineSwarm.js +20 -0
  104. package/server/src/utils/api.js +1 -15
  105. package/server/src/utils/downloadMessages.js +17 -18
  106. package/server/src/utils/errors.js +3 -1
  107. package/server/src/utils/noteUtils.js +27 -3
  108. package/out/assets/AppShell-DmZQwVA9.js +0 -1
  109. package/out/assets/ChatUi-CVGqjFdx.js +0 -1
  110. package/out/assets/MilkdownEditor-BL8xE7u9.js +0 -1054
  111. package/out/assets/MoveModal-BKkVBvrS.js +0 -1
  112. package/out/assets/Nav-BDGeJnbC.js +0 -1
  113. package/out/assets/NoteSidebar-BIJ8_m5K.js +0 -1
  114. package/out/assets/OpenSidebarButton-Di62DGiu.js +0 -1
  115. package/out/assets/PemBlock-Dxx6k9MH.js +0 -1
  116. package/out/assets/SidebarAccount-CCHZLGdP.js +0 -1
  117. package/out/assets/admin-BepWGXWG.js +0 -2
  118. package/out/assets/app-3D79fY3w.js +0 -1
  119. package/out/assets/arrow-right-D0sGC8QA.js +0 -1
  120. package/out/assets/channelApi-CL7YsIQ-.js +0 -1
  121. package/out/assets/chat-B56sk6od.js +0 -1
  122. package/out/assets/check-DdfnsLKm.js +0 -1
  123. package/out/assets/chevron-down-Xlb3wTxd.js +0 -1
  124. package/out/assets/circle-check-CwAH4dgJ.js +0 -1
  125. package/out/assets/cloud-CcPRoob1.js +0 -1
  126. package/out/assets/code-Dr6STnCn.js +0 -1
  127. package/out/assets/database-DQ7ZtUT9.js +0 -1
  128. package/out/assets/dateTime-D1koKRQU.js +0 -1
  129. package/out/assets/demo-B_6rlIjn.js +0 -3
  130. package/out/assets/dist-BGtXa07s.js +0 -9
  131. package/out/assets/download-BLPU-Kzq.js +0 -1
  132. package/out/assets/downloadMessages-7Xbd-HhS.js +0 -1
  133. package/out/assets/ed25519-BEctXF0E.js +0 -1
  134. package/out/assets/filePreview-BvbHWUTG.js +0 -1
  135. package/out/assets/folder-CcbCxm-k.js +0 -1
  136. package/out/assets/game-B0zuqnOh.js +0 -1
  137. package/out/assets/gandengyan-DbQC7hCK.js +0 -1
  138. package/out/assets/index-BLhmAher.css +0 -1
  139. package/out/assets/index-Cf23WD2V.js +0 -29
  140. package/out/assets/join-DQHXjlfH.js +0 -1
  141. package/out/assets/note-DmWqGSS2.js +0 -2
  142. package/out/assets/ping-JILckfMu.js +0 -1
  143. package/out/assets/play-BIl5vwqS.js +0 -1
  144. package/out/assets/plus-DHvLpuuw.js +0 -1
  145. package/out/assets/routes-Dyckj88f.js +0 -1
  146. package/out/assets/search-C-EpsDNl.js +0 -1
  147. package/out/assets/sun-C3IUQTpa.js +0 -1
  148. package/out/assets/tools-BEctXF0E.js +0 -1
  149. package/out/assets/triangle-alert-DUODU79n.js +0 -1
  150. package/out/assets/upload-CpDM23UH.js +0 -1
  151. package/out/assets/useGameRoom-C6UgmIGG.js +0 -1
  152. package/out/assets/web3-CRX1YFmw.js +0 -3
  153. package/out/assets/zhajinhua-QDmSZbOp.js +0 -1
  154. package/out/web3/ed25519/index.html +0 -0
  155. package/out/web3/tools/index.html +0 -0
  156. /package/out/assets/{gandengyan-8eWJAjpY.css → index-8eWJAjpY.css} +0 -0
  157. /package/out/assets/{zhajinhua-BZc4blbW.css → index-BZc4blbW.css} +0 -0
@@ -1,9 +1,13 @@
1
- <!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="stylesheet" href="/assets/index-BLhmAher.css" data-precedence="default"/><title>MostBox - 网络连通性</title><meta name="theme-color" content="#5e6ad2"/><meta name="description" content="测试到全球主流网站的网络连通性和延迟"/><link rel="modulepreload" href="/assets/index-Cf23WD2V.js"/><link rel="modulepreload" href="/assets/jsx-runtime-Bt-cYkS5.js"/><link rel="modulepreload" href="/assets/ping-JILckfMu.js"/><link rel="modulepreload" href="/assets/MarketingLayout-BTIbv4fW.js"/><link rel="modulepreload" href="/assets/LogoIcon-CYQ7cHd5.js"/><link rel="modulepreload" href="/assets/cloud-CcPRoob1.js"/><link rel="modulepreload" href="/assets/music-BkZKq879.js"/><link rel="modulepreload" href="/assets/play-BIl5vwqS.js"/><link rel="modulepreload" href="/assets/search-C-EpsDNl.js"/><link rel="modulepreload" href="/assets/send-DtQInX0y.js"/><link rel="modulepreload" href="/assets/wifi-v3JpPCNm.js"/><link rel="icon" href="/logo.svg" type="image/svg+xml"/><script>
1
+ <!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="stylesheet" href="/assets/index-BdaFEQG-.css" data-precedence="default"/><title>MostBox - 网络连通性</title><meta name="theme-color" content="#5e6ad2"/><meta name="description" content="测试到全球主流网站的网络连通性和延迟"/><link rel="modulepreload" href="/assets/index-QxXZzOUL.js"/><link rel="modulepreload" href="/assets/jsx-runtime-Bt-cYkS5.js"/><link rel="icon" href="/logo.svg" type="image/svg+xml"/><script>
2
2
  (function() {
3
3
  var theme = localStorage.getItem('theme');
4
4
  if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
5
5
  document.documentElement.setAttribute('data-theme', 'dark');
6
6
  }
7
+ var locale = localStorage.getItem('mostbox.locale');
8
+ var normalizedLocale = locale === 'en' ? 'en' : 'zh-CN';
9
+ document.documentElement.setAttribute('lang', normalizedLocale);
10
+ document.documentElement.setAttribute('data-locale', normalizedLocale);
7
11
  })();
8
12
  </script></head><body><script>
9
13
  window.onerror = function(message, source, lineno, colno, error) {
@@ -12,4 +16,4 @@
12
16
  window.onunhandledrejection = function(event) {
13
17
  console.error('[Unhandled Promise Rejection]', event.reason);
14
18
  };
15
- </script><!--$--><div class="mkt-layout"><nav class="mkt-nav"><div class="mkt-nav-inner"><a href="/" class="mkt-nav-logo"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.4"></rect><rect x="14" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="2" y="14" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="14" y="14" width="8" height="8" rx="2" fill="var(--accent)"></rect></svg>MOST PEOPLE</a><div class="mkt-nav-cta"><button class="mkt-theme-toggle" aria-label="切换主题"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"></path></svg></button><a href="/download/" class="btn btn-primary mkt-nav-preview"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载客户端</a><a href="/app/" class="btn btn-secondary">打开 Web</a></div></div></nav><main class="mkt-layout-main"><div class="ping-page"><div class="ping-header"><div class="ping-title-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wifi ping-title-icon" aria-hidden="true"><path d="M12 20h.01"></path><path d="M2 8.82a15 15 0 0 1 20 0"></path><path d="M5 12.859a10 10 0 0 1 14 0"></path><path d="M8.5 16.429a5 5 0 0 1 7 0"></path></svg><div><h1 class="ping-title">网络连通性</h1><p class="ping-subtitle">通过向对应网站发送请求进行测试,延迟值仅供参考。</p></div></div><button class="btn btn-icon" aria-label="重新测试全部" title="重新测试全部"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-grid"><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search" aria-hidden="true"><path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://google.com" target="_blank" rel="noreferrer" class="ping-card-name">Google</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Google" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud" aria-hidden="true"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://cloudflare.com" target="_blank" rel="noreferrer" class="ping-card-name">Cloudflare</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Cloudflare" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play" aria-hidden="true"><path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://youtube.com" target="_blank" rel="noreferrer" class="ping-card-name">YouTube</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 YouTube" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-terminal" aria-hidden="true"><path d="M12 19h8"></path><path d="m4 17 6-6-6-6"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://github.com" target="_blank" rel="noreferrer" class="ping-card-name">GitHub</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 GitHub" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bot" aria-hidden="true"><path d="M12 8V4H8"></path><rect width="16" height="12" x="4" y="8" rx="2"></rect><path d="M2 14h2"></path><path d="M20 14h2"></path><path d="M15 13v2"></path><path d="M9 13v2"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://chatgpt.com" target="_blank" rel="noreferrer" class="ping-card-name">ChatGPT</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 ChatGPT" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-at-sign" aria-hidden="true"><circle cx="12" cy="12" r="4"></circle><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://x.com" target="_blank" rel="noreferrer" class="ping-card-name">X</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 X" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-camera" aria-hidden="true"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"></path><circle cx="12" cy="13" r="3"></circle></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://instagram.com" target="_blank" rel="noreferrer" class="ping-card-name">Instagram</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Instagram" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square" aria-hidden="true"><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://reddit.com" target="_blank" rel="noreferrer" class="ping-card-name">Reddit</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Reddit" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open" aria-hidden="true"><path d="M12 7v14"></path><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://wikipedia.org" target="_blank" rel="noreferrer" class="ping-card-name">Wikipedia</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Wikipedia" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-smartphone" aria-hidden="true"><rect width="14" height="20" x="5" y="2" rx="2" ry="2"></rect><path d="M12 18h.01"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://apple.com" target="_blank" rel="noreferrer" class="ping-card-name">Apple</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Apple" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send" aria-hidden="true"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"></path><path d="m21.854 2.147-10.94 10.939"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://telegram.org" target="_blank" rel="noreferrer" class="ping-card-name">Telegram</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Telegram" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-messages-square" aria-hidden="true"><path d="M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path><path d="M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://discord.com" target="_blank" rel="noreferrer" class="ping-card-name">Discord</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Discord" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-music" aria-hidden="true"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://tiktok.com" target="_blank" rel="noreferrer" class="ping-card-name">TikTok</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 TikTok" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package" aria-hidden="true"><path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path><path d="M12 22V12"></path><polyline points="3.29 7 12 12 20.71 7"></polyline><path d="m7.5 4.27 9 5.15"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://npmjs.com" target="_blank" rel="noreferrer" class="ping-card-name">npm</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 npm" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle" aria-hidden="true"><path d="M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://vercel.com" target="_blank" rel="noreferrer" class="ping-card-name">Vercel</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Vercel" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div></div></div></main><footer class="mkt-footer"><div class="mkt-container"><div class="mkt-footer-inner"><div class="mkt-footer-links"><a href="/">关于</a><a class="active" href="/ping/" data-status="active" aria-current="page">网络</a><a href="https://github.com/most-people/most" target="_blank" rel="noopener noreferrer">GitHub</a></div><span class="mkt-footer-copy">© <!-- -->2026<!-- --> MOST PEOPLE · MIT License</span></div></div></footer></div><script>(function(a,f){let l;try{l=JSON.parse(sessionStorage.getItem(a)||"{}")}catch{return}const n=l?.[f||history.state?.__TSR_key];let c=!1;for(const t in n){const e=n[t],o=e?.scrollX,s=e?.scrollY;if(Number.isFinite(o)&&Number.isFinite(s)){if(t==="window")scrollTo(o,s),c=!0;else if(t)try{const r=document.querySelector(t);r&&(r.scrollLeft=o,r.scrollTop=s)}catch{}}}if(c)return;const i=location.hash.slice(1);if(i){const t=history.state?.__hashScrollIntoViewOptions??!0;if(t){const e=document.getElementById(i);e&&e.scrollIntoView(t)}return}scrollTo(0,0)})("tsr-scroll-restoration-v1_3");document.currentScript.remove()</script><!--/$--><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["/assets/index-Cf23WD2V.js","/assets/jsx-runtime-Bt-cYkS5.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"/assets/index-Cf23WD2V.js"}}],css:$R[8]=["/assets/index-BLhmAher.css"]},"/ping/":$R[9]={preloads:$R[10]=["/assets/ping-JILckfMu.js","/assets/MarketingLayout-BTIbv4fW.js","/assets/LogoIcon-CYQ7cHd5.js","/assets/cloud-CcPRoob1.js","/assets/music-BkZKq879.js","/assets/play-BIl5vwqS.js","/assets/search-C-EpsDNl.js","/assets/send-DtQInX0y.js","/assets/wifi-v3JpPCNm.js"]}}},matches:$R[11]=[$R[12]={i:"__root__",u:1781235812146,s:"success",ssr:!0},$R[13]={i:"pingping",u:1781235812149,s:"success",ssr:!0}],lastMatchId:"pingping"})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="/assets/index-Cf23WD2V.js"></script></body></html>
19
+ </script><!--$--><div class="mkt-layout"><nav class="mkt-nav"><div class="mkt-nav-inner"><a href="/" class="mkt-nav-logo"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.4"></rect><rect x="14" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="2" y="14" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="14" y="14" width="8" height="8" rx="2" fill="var(--accent)"></rect></svg>MOST PEOPLE</a><div class="mkt-nav-cta"><button type="button" class="mkt-theme-toggle" aria-label="切换主题" title="切换主题"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"></path></svg></button><button type="button" class="language-toggle mkt-theme-toggle" aria-label="切换到英文" title="切换到英文"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages" aria-hidden="true"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg></button><a href="/download/" class="btn btn-primary mkt-nav-preview"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载客户端</a><button type="button" class="btn btn-secondary">开始使用</button></div></div></nav><main class="mkt-layout-main"><div class="ping-page"><div class="ping-header"><div class="ping-title-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wifi ping-title-icon" aria-hidden="true"><path d="M12 20h.01"></path><path d="M2 8.82a15 15 0 0 1 20 0"></path><path d="M5 12.859a10 10 0 0 1 14 0"></path><path d="M8.5 16.429a5 5 0 0 1 7 0"></path></svg><div><h1 class="ping-title">网络连通性</h1><p class="ping-subtitle">通过向对应网站发送请求进行测试,延迟值仅供参考。</p></div></div><button class="btn btn-icon" aria-label="重新测试全部" title="重新测试全部"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-grid"><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search" aria-hidden="true"><path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://google.com" target="_blank" rel="noreferrer" class="ping-card-name">Google</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Google" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud" aria-hidden="true"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://cloudflare.com" target="_blank" rel="noreferrer" class="ping-card-name">Cloudflare</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Cloudflare" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play" aria-hidden="true"><path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://youtube.com" target="_blank" rel="noreferrer" class="ping-card-name">YouTube</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 YouTube" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-terminal" aria-hidden="true"><path d="M12 19h8"></path><path d="m4 17 6-6-6-6"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://github.com" target="_blank" rel="noreferrer" class="ping-card-name">GitHub</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 GitHub" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bot" aria-hidden="true"><path d="M12 8V4H8"></path><rect width="16" height="12" x="4" y="8" rx="2"></rect><path d="M2 14h2"></path><path d="M20 14h2"></path><path d="M15 13v2"></path><path d="M9 13v2"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://chatgpt.com" target="_blank" rel="noreferrer" class="ping-card-name">ChatGPT</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 ChatGPT" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-at-sign" aria-hidden="true"><circle cx="12" cy="12" r="4"></circle><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://x.com" target="_blank" rel="noreferrer" class="ping-card-name">X</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 X" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-camera" aria-hidden="true"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"></path><circle cx="12" cy="13" r="3"></circle></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://instagram.com" target="_blank" rel="noreferrer" class="ping-card-name">Instagram</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Instagram" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square" aria-hidden="true"><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://reddit.com" target="_blank" rel="noreferrer" class="ping-card-name">Reddit</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Reddit" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open" aria-hidden="true"><path d="M12 7v14"></path><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://wikipedia.org" target="_blank" rel="noreferrer" class="ping-card-name">Wikipedia</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Wikipedia" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-smartphone" aria-hidden="true"><rect width="14" height="20" x="5" y="2" rx="2" ry="2"></rect><path d="M12 18h.01"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://apple.com" target="_blank" rel="noreferrer" class="ping-card-name">Apple</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Apple" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send" aria-hidden="true"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"></path><path d="m21.854 2.147-10.94 10.939"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://telegram.org" target="_blank" rel="noreferrer" class="ping-card-name">Telegram</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Telegram" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-messages-square" aria-hidden="true"><path d="M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path><path d="M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://discord.com" target="_blank" rel="noreferrer" class="ping-card-name">Discord</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Discord" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-music" aria-hidden="true"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://tiktok.com" target="_blank" rel="noreferrer" class="ping-card-name">TikTok</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 TikTok" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package" aria-hidden="true"><path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path><path d="M12 22V12"></path><polyline points="3.29 7 12 12 20.71 7"></polyline><path d="m7.5 4.27 9 5.15"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://npmjs.com" target="_blank" rel="noreferrer" class="ping-card-name">npm</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 npm" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div><div class="ping-card pending"><div class="ping-card-top"><span class="ping-card-icon"><span class="brand-icon-wrap"><span class="brand-icon-fallback "><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle" aria-hidden="true"><path d="M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"></path></svg></span><span class="brand-icon-real "><span></span></span></span></span><a href="https://vercel.com" target="_blank" rel="noreferrer" class="ping-card-name">Vercel</a><button class="ping-card-refresh" disabled="" aria-label="重新测试 Vercel" title="重新测试"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw ping-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></button></div><div class="ping-card-bottom"><span class="ping-pulse-dot"></span><span class="ping-latency is-muted">--</span></div></div></div></div></main><footer class="mkt-footer"><div class="mkt-container"><div class="mkt-footer-inner"><div class="mkt-footer-links"><a href="/">关于</a><a class="active" href="/ping/" data-status="active" aria-current="page">网络</a><a href="https://github.com/most-people/most" target="_blank" rel="noopener noreferrer">GitHub</a></div><span class="mkt-footer-copy">© <!-- -->2026<!-- --> MOST PEOPLE · MIT License</span></div></div></footer></div><script>(function(a,f){let l;try{l=JSON.parse(sessionStorage.getItem(a)||"{}")}catch{return}const n=l?.[f||history.state?.__TSR_key];let c=!1;for(const t in n){const e=n[t],o=e?.scrollX,s=e?.scrollY;if(Number.isFinite(o)&&Number.isFinite(s)){if(t==="window")scrollTo(o,s),c=!0;else if(t)try{const r=document.querySelector(t);r&&(r.scrollLeft=o,r.scrollTop=s)}catch{}}}if(c)return;const i=location.hash.slice(1);if(i){const t=history.state?.__hashScrollIntoViewOptions??!0;if(t){const e=document.getElementById(i);e&&e.scrollIntoView(t)}return}scrollTo(0,0)})("tsr-scroll-restoration-v1_3");document.currentScript.remove()</script><!--/$--><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["/assets/index-QxXZzOUL.js","/assets/jsx-runtime-Bt-cYkS5.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"/assets/index-QxXZzOUL.js"}}],css:$R[8]=["/assets/index-BdaFEQG-.css"]}}},matches:$R[9]=[$R[10]={i:"__root__",u:1781463960225,s:"success",ssr:!0},$R[11]={i:"pingping",u:1781463960228,s:"success",ssr:!0}],lastMatchId:"pingping"})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="/assets/index-QxXZzOUL.js"></script></body></html>
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "most-box",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "description": "MostBox - P2P file sharing application",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
@@ -24,7 +24,7 @@
24
24
  "serve": "npm run build && node server/index.js",
25
25
  "test": "node --test server/tests/**/*.test.js",
26
26
  "test:unit": "node --test server/tests/unit/*.test.js",
27
- "test:frontend": "node --test app/tests/*.test.js",
27
+ "test:frontend": "node --test src/tests/*.test.js",
28
28
  "test:protocol": "node --test --test-name-pattern \"extracts CID and filename|matches golden CID samples|publishes a file from Buffer|lists published files|pulls through local seed nodes\" server/tests/unit/cid.test.js server/tests/integration/cid.test.js server/tests/integration/engine.test.js",
29
29
  "typecheck": "tsc -p tsconfig.typecheck.json",
30
30
  "typecheck:strict-router": "tsc -p tsconfig.strict-router.json",
package/server/index.js CHANGED
@@ -116,6 +116,15 @@ function bindEngineEvents({
116
116
  )
117
117
  engine.on('channel:joined', data => wsBroadcast('channel:joined', data))
118
118
  engine.on('channel:left', data => wsBroadcast('channel:left', data))
119
+ engine.on('user:metadata:updated', data => {
120
+ appendNodeLog({
121
+ event: 'node:user-sync:updated',
122
+ message: 'User metadata synced',
123
+ data,
124
+ })
125
+ wsBroadcast('user:metadata:updated', data)
126
+ safeBroadcastNodeStatus()
127
+ })
119
128
 
120
129
  return {
121
130
  markReady() {
@@ -24,7 +24,7 @@ export function normalizeChannelAttachment(input) {
24
24
  const cid = String(input.cid || '').trim()
25
25
  const cidValidation = validateCidString(cid)
26
26
  if (!cidValidation.valid) {
27
- throw new ValidationError(cidValidation.error)
27
+ throw new ValidationError(cidValidation.errorCode, cidValidation.errorCode)
28
28
  }
29
29
 
30
30
  const fileName = sanitizeFilename(String(input.fileName || ''))
@@ -33,8 +33,12 @@ export function normalizeChannelAttachment(input) {
33
33
  }
34
34
 
35
35
  const parsed = parseMostLink(String(input.link || '').trim())
36
- if (parsed.error) {
37
- throw new ValidationError(parsed.error)
36
+ if (parsed.errorCode) {
37
+ throw new ValidationError(
38
+ parsed.errorCode,
39
+ parsed.errorCode,
40
+ parsed.details
41
+ )
38
42
  }
39
43
  if (parsed.cid !== cid) {
40
44
  throw new ValidationError('attachment link CID mismatch')
@@ -0,0 +1,50 @@
1
+ import crypto from 'node:crypto'
2
+
3
+ export const CHAT_FILE_ROOT = 'chat-file'
4
+ export const TRANSIENT_CHANNEL_TYPES = new Set(['game'])
5
+ export const CHANNEL_DISCOVERY_TIMEOUT = 600
6
+ export const CHANNEL_CANDIDATE_TTL = 30 * 1000
7
+
8
+ const CHANNEL_FINGERPRINT_BYTES = 8
9
+ const CHANNEL_WRITER_ID_BYTES = 8
10
+ const CHANNEL_KEY_SEPARATOR = '.'
11
+
12
+ export function normalizeChannelDisplayName(input, fallbackAddress = '') {
13
+ const value = String(input || '').trim()
14
+ if (value) return value.slice(0, 50)
15
+ return fallbackAddress ? fallbackAddress.slice(0, 10) : ''
16
+ }
17
+
18
+ export function normalizeChannelAvatar(input) {
19
+ const value = String(input || '').trim()
20
+ return value ? value.slice(0, 4096) : ''
21
+ }
22
+
23
+ export function normalizeChannelId(input) {
24
+ return String(input || '').trim()
25
+ }
26
+
27
+ export function createChannelFingerprint() {
28
+ return crypto.randomBytes(CHANNEL_FINGERPRINT_BYTES).toString('hex')
29
+ }
30
+
31
+ export function createChannelWriterId() {
32
+ return crypto.randomBytes(CHANNEL_WRITER_ID_BYTES).toString('hex')
33
+ }
34
+
35
+ export function buildChannelKey(channelId, fingerprint) {
36
+ return `${channelId}${CHANNEL_KEY_SEPARATOR}${fingerprint}`
37
+ }
38
+
39
+ export function normalizeChannelKey(input) {
40
+ return String(input || '').trim()
41
+ }
42
+
43
+ export function getChannelFingerprintFromKey(channelId, channelKey) {
44
+ const prefix = `${channelId}${CHANNEL_KEY_SEPARATOR}`
45
+ return channelKey.startsWith(prefix) ? channelKey.slice(prefix.length) : ''
46
+ }
47
+
48
+ export function uniqueStrings(values = []) {
49
+ return [...new Set(values.map(value => String(value || '').trim()).filter(Boolean))]
50
+ }
@@ -7,7 +7,12 @@ import fs from 'node:fs'
7
7
  import { Readable } from 'node:stream'
8
8
  import { importer } from 'ipfs-unixfs-importer'
9
9
 
10
- export { validateCidString, parseMostLink } from './mostLink.js'
10
+ export {
11
+ MOST_LINK_ERROR_CODES,
12
+ validateCidString,
13
+ parseMostLink,
14
+ buildMostLink,
15
+ } from './mostLink.js'
11
16
 
12
17
  /**
13
18
  * 用于 CID 计算的虚拟 Blockstore
@@ -1,18 +1,32 @@
1
1
  import b4a from 'b4a'
2
2
  import { CID } from 'multiformats/cid'
3
- import { validateCidString } from './cid.js'
3
+ import { MOST_LINK_ERROR_CODES, validateCidString } from './cid.js'
4
4
  import { ValidationError } from '../utils/errors.js'
5
5
 
6
+ const CID_INFO_ERROR_MESSAGES = {
7
+ [MOST_LINK_ERROR_CODES.CID_EMPTY]: 'CID is required',
8
+ [MOST_LINK_ERROR_CODES.INVALID_CID_FORMAT]: 'Invalid CID format',
9
+ [MOST_LINK_ERROR_CODES.CID_V1_REQUIRED]: 'CID v1 required',
10
+ [MOST_LINK_ERROR_CODES.CID_DIGEST_LENGTH]: 'CID digest must be 32 bytes',
11
+ }
12
+
13
+ function cidValidationError(errorCode) {
14
+ return new ValidationError(
15
+ CID_INFO_ERROR_MESSAGES[errorCode] || errorCode,
16
+ errorCode
17
+ )
18
+ }
19
+
6
20
  export function getCidInfo(cid) {
7
21
  try {
8
22
  const validation = validateCidString(cid)
9
23
  if (!validation.valid) {
10
- throw new ValidationError(validation.error)
24
+ throw cidValidationError(validation.errorCode)
11
25
  }
12
26
  const parsedCid = CID.parse(cid)
13
27
  const topic = b4a.from(parsedCid.multihash.digest)
14
28
  if (topic.length !== 32) {
15
- throw new ValidationError('CID digest must be 32 bytes')
29
+ throw cidValidationError(MOST_LINK_ERROR_CODES.CID_DIGEST_LENGTH)
16
30
  }
17
31
  const topicHex = b4a.toString(topic, 'hex')
18
32
  return {
@@ -24,6 +38,6 @@ export function getCidInfo(cid) {
24
38
  if (err instanceof ValidationError) {
25
39
  throw err
26
40
  }
27
- throw new ValidationError('Invalid CID format')
41
+ throw cidValidationError(MOST_LINK_ERROR_CODES.INVALID_CID_FORMAT)
28
42
  }
29
43
  }
@@ -0,0 +1,10 @@
1
+ export function getPathBaseName(fileName) {
2
+ const parts = String(fileName || '').split('/').filter(Boolean)
3
+ return parts[parts.length - 1] || 'unnamed_file'
4
+ }
5
+
6
+ export function getDisplayPathFolder(fileName) {
7
+ const parts = String(fileName || '').split('/').filter(Boolean)
8
+ parts.pop()
9
+ return parts.join('/')
10
+ }
@@ -35,12 +35,12 @@ export function gameRoomCodeToChannelName(gameId, roomCode) {
35
35
  const normalizedGameId = normalizeGameId(gameId)
36
36
  const code = normalizeGameRoomCode(roomCode)
37
37
  if (!normalizedGameId || !isValidGameRoomCode(code)) return ''
38
- return `game-${normalizedGameId}-${code.toLowerCase()}`
38
+ return `game.${normalizedGameId}.${code.toLowerCase()}`
39
39
  }
40
40
 
41
41
  export function channelNameToGameRoom(input) {
42
42
  const value = String(input || '').trim().toLowerCase()
43
- const match = /^game-([a-z0-9]+)-([a-z0-9]+)$/.exec(value)
43
+ const match = /^game\.([a-z0-9]+)\.([a-z0-9]+)$/.exec(value)
44
44
  if (!match) return null
45
45
  const gameId = normalizeGameId(match[1])
46
46
  const roomCode = normalizeGameRoomCode(match[2])
@@ -1,37 +1,53 @@
1
1
  import { CID } from 'multiformats/cid'
2
2
 
3
+ export const MOST_LINK_ERROR_CODES = {
4
+ CID_EMPTY: 'cid_empty',
5
+ INVALID_CID_FORMAT: 'invalid_cid_format',
6
+ CID_V1_REQUIRED: 'cid_v1_required',
7
+ CID_DIGEST_LENGTH: 'cid_digest_length',
8
+ LINK_EMPTY: 'link_empty',
9
+ INVALID_URL: 'invalid_url',
10
+ INVALID_PROTOCOL: 'invalid_protocol',
11
+ UNSUPPORTED_PATH: 'unsupported_path',
12
+ FILENAME_REQUIRED: 'filename_required',
13
+ UNSUPPORTED_QUERY_PARAM: 'unsupported_query_param',
14
+ }
15
+
16
+ function invalidCid(errorCode) {
17
+ return { valid: false, errorCode }
18
+ }
19
+
20
+ function invalidLink(errorCode, details) {
21
+ return {
22
+ cid: '',
23
+ errorCode,
24
+ ...(details ? { details } : {}),
25
+ }
26
+ }
27
+
3
28
  /**
4
29
  * 验证 CID 字符串
5
30
  * @param {string} cidString - 要验证的 CID 字符串
6
- * @returns {{ valid: boolean, error?: string }}
31
+ * @returns {{ valid: boolean, errorCode?: string }}
7
32
  */
8
33
  export function validateCidString(cidString) {
9
34
  if (!cidString || typeof cidString !== 'string') {
10
- return { valid: false, error: 'CID must be a non-empty string' }
35
+ return invalidCid(MOST_LINK_ERROR_CODES.CID_EMPTY)
11
36
  }
12
37
 
13
38
  let parsed
14
39
  try {
15
40
  parsed = CID.parse(cidString)
16
41
  } catch {
17
- return {
18
- valid: false,
19
- error: 'Invalid CID format',
20
- }
42
+ return invalidCid(MOST_LINK_ERROR_CODES.INVALID_CID_FORMAT)
21
43
  }
22
44
 
23
45
  if (parsed.version !== 1) {
24
- return {
25
- valid: false,
26
- error: 'Invalid CID format: CID v1 required',
27
- }
46
+ return invalidCid(MOST_LINK_ERROR_CODES.CID_V1_REQUIRED)
28
47
  }
29
48
 
30
49
  if (parsed.multihash.digest.length !== 32) {
31
- return {
32
- valid: false,
33
- error: 'CID digest must be 32 bytes',
34
- }
50
+ return invalidCid(MOST_LINK_ERROR_CODES.CID_DIGEST_LENGTH)
35
51
  }
36
52
 
37
53
  return { valid: true }
@@ -40,26 +56,26 @@ export function validateCidString(cidString) {
40
56
  /**
41
57
  * 解析 most:// 链接并提取 CID 与用户可见文件名
42
58
  * @param {string} link - most://<cid>?filename=... 格式的链接
43
- * @returns {{ cid: string, fileName?: string, error?: string }}
59
+ * @returns {{ cid: string, fileName?: string, errorCode?: string, details?: Record<string, string> }}
44
60
  */
45
61
  export function parseMostLink(link) {
46
62
  if (!link || typeof link !== 'string') {
47
- return { cid: '', error: 'Link must be a non-empty string' }
63
+ return invalidLink(MOST_LINK_ERROR_CODES.LINK_EMPTY)
48
64
  }
49
65
 
50
66
  let url
51
67
  try {
52
68
  url = new URL(link)
53
69
  } catch {
54
- return { cid: '', error: 'Link must be a valid most:// URL' }
70
+ return invalidLink(MOST_LINK_ERROR_CODES.INVALID_URL)
55
71
  }
56
72
 
57
73
  if (url.protocol !== 'most:') {
58
- return { cid: '', error: 'Link must use most:// protocol' }
74
+ return invalidLink(MOST_LINK_ERROR_CODES.INVALID_PROTOCOL)
59
75
  }
60
76
 
61
77
  if (url.pathname && url.pathname !== '/') {
62
- return { cid: '', error: 'Link path is not supported' }
78
+ return invalidLink(MOST_LINK_ERROR_CODES.UNSUPPORTED_PATH)
63
79
  }
64
80
 
65
81
  const cidString = url.hostname
@@ -70,19 +86,23 @@ export function parseMostLink(link) {
70
86
 
71
87
  const validation = validateCidString(cidString)
72
88
  if (!validation.valid) {
73
- return { cid: '', error: validation.error }
89
+ return invalidLink(validation.errorCode)
74
90
  }
75
91
 
76
92
  if (!fileName || !fileName.trim()) {
77
- return { cid: '', error: 'filename is required' }
93
+ return invalidLink(MOST_LINK_ERROR_CODES.FILENAME_REQUIRED)
78
94
  }
79
95
 
80
96
  if (unsupportedParam) {
81
- return {
82
- cid: '',
83
- error: `Unsupported query parameter: ${unsupportedParam}`,
84
- }
97
+ return invalidLink(
98
+ MOST_LINK_ERROR_CODES.UNSUPPORTED_QUERY_PARAM,
99
+ { param: unsupportedParam }
100
+ )
85
101
  }
86
102
 
87
103
  return { cid: cidString, fileName }
88
104
  }
105
+
106
+ export function buildMostLink(cid, fileName) {
107
+ return `most://${cid}?filename=${encodeURIComponent(fileName)}`
108
+ }
@@ -0,0 +1,34 @@
1
+ export const DEFAULT_OWNER_BUCKET = '__local__'
2
+
3
+ export function normalizeOwnerAddress(address) {
4
+ const value = String(address || '').trim()
5
+ return /^0x[a-fA-F0-9]{40}$/.test(value) ? value.toLowerCase() : ''
6
+ }
7
+
8
+ export function getOwnerBucketKey(address) {
9
+ return normalizeOwnerAddress(address) || DEFAULT_OWNER_BUCKET
10
+ }
11
+
12
+ export function normalizeMetadataBuckets(input) {
13
+ if (!input || typeof input !== 'object' || Array.isArray(input)) {
14
+ return {}
15
+ }
16
+ const buckets = {}
17
+ for (const [rawOwner, records] of Object.entries(input)) {
18
+ const ownerKey =
19
+ rawOwner === DEFAULT_OWNER_BUCKET
20
+ ? DEFAULT_OWNER_BUCKET
21
+ : normalizeOwnerAddress(rawOwner)
22
+ if (!ownerKey || !Array.isArray(records)) continue
23
+ buckets[ownerKey] = records.map(record => ({ ...record }))
24
+ }
25
+ return buckets
26
+ }
27
+
28
+ export function cloneMetadataRecord(record, ownerAddress = '') {
29
+ return {
30
+ ...record,
31
+ ownerAddress:
32
+ ownerAddress && ownerAddress !== DEFAULT_OWNER_BUCKET ? ownerAddress : '',
33
+ }
34
+ }
@@ -0,0 +1,36 @@
1
+ import crypto from 'node:crypto'
2
+
3
+ export const USER_SYNC_SCHEMA_VERSION = 1
4
+ export const USER_SYNC_NAMESPACE_PREFIX = 'user.sync.'
5
+
6
+ const USER_SYNC_KEY_HEX_LENGTH = 64
7
+
8
+ export function normalizeUserSyncKey(input) {
9
+ const value = String(input || '').trim().replace(/^0x/i, '').toLowerCase()
10
+ return /^[0-9a-f]+$/.test(value) && value.length === USER_SYNC_KEY_HEX_LENGTH
11
+ ? value
12
+ : ''
13
+ }
14
+
15
+ export function deriveUserSyncId(syncTopicKey) {
16
+ return crypto
17
+ .createHash('sha256')
18
+ .update(Buffer.from(syncTopicKey, 'hex'))
19
+ .digest('hex')
20
+ .slice(0, 24)
21
+ }
22
+
23
+ export function getUserSyncName(syncId) {
24
+ return `${USER_SYNC_NAMESPACE_PREFIX}${syncId}`
25
+ }
26
+
27
+ export function getSyncTimestamp(input, fallback = Date.now()) {
28
+ const numeric = Number(input)
29
+ if (Number.isFinite(numeric) && numeric > 0) return Math.floor(numeric)
30
+ const parsed = Date.parse(String(input || ''))
31
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback
32
+ }
33
+
34
+ export function getNextSyncTimestamp(previous) {
35
+ return Math.max(Date.now(), getSyncTimestamp(previous, 0) + 1)
36
+ }