@silicaclaw/cli 2026.3.19-9 → 2026.3.20-2

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 (278) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/DEMO_GUIDE.md +1 -1
  3. package/INSTALL.md +47 -13
  4. package/README.md +54 -19
  5. package/VERSION +1 -1
  6. package/apps/local-console/dist/apps/local-console/src/server.d.ts +51 -12
  7. package/apps/local-console/dist/apps/local-console/src/server.js +619 -183
  8. package/apps/local-console/dist/config/silicaclaw-defaults.json +19 -0
  9. package/apps/local-console/dist/packages/core/src/socialConfig.js +9 -5
  10. package/apps/local-console/dist/packages/network/src/realPreview.js +6 -2
  11. package/apps/local-console/dist/packages/network/src/relayPreview.js +8 -2
  12. package/apps/local-console/dist/packages/network/src/transport/udpLanBroadcastTransport.js +2 -1
  13. package/apps/local-console/dist/packages/network/src/webrtcPreview.js +5 -1
  14. package/apps/local-console/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
  15. package/apps/local-console/dist/packages/storage/src/socialRuntimeRepo.js +8 -4
  16. package/apps/local-console/public/app/app.js +21 -1
  17. package/apps/local-console/public/app/events.js +40 -2
  18. package/apps/local-console/public/app/network.js +32 -3
  19. package/apps/local-console/public/app/overview.js +18 -26
  20. package/apps/local-console/public/app/shell.js +18 -34
  21. package/apps/local-console/public/app/social.js +207 -28
  22. package/apps/local-console/public/app/styles.css +182 -14
  23. package/apps/local-console/public/app/template.js +76 -31
  24. package/apps/local-console/public/app/translations.js +147 -51
  25. package/apps/local-console/src/server.ts +652 -189
  26. package/apps/public-explorer/dist/apps/public-explorer/src/server.d.ts +1 -0
  27. package/apps/public-explorer/dist/apps/public-explorer/src/server.js +41 -0
  28. package/apps/public-explorer/dist/config/silicaclaw-defaults.json +19 -0
  29. package/apps/public-explorer/public/app/app.js +22 -2
  30. package/apps/public-explorer/public/app/template.js +4 -4
  31. package/apps/public-explorer/public/app/translations.js +15 -15
  32. package/apps/public-explorer/src/server.ts +11 -1
  33. package/config/silicaclaw-defaults.json +19 -0
  34. package/dist/apps/local-console/src/server.d.ts +1 -0
  35. package/dist/apps/local-console/src/server.js +555 -0
  36. package/docs/NEW_USER_INSTALL.md +14 -10
  37. package/docs/NEW_USER_OPERATIONS.md +4 -4
  38. package/docs/OPENCLAW_BRIDGE.md +15 -0
  39. package/docs/OPENCLAW_BRIDGE_ZH.md +15 -0
  40. package/docs/RELEASE_CHECKLIST.md +95 -0
  41. package/node_modules/@silicaclaw/core/dist/config/silicaclaw-defaults.json +19 -0
  42. package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.d.ts +6 -0
  43. package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.js +50 -0
  44. package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.d.ts +17 -0
  45. package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.js +145 -0
  46. package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.d.ts +2 -0
  47. package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.js +18 -0
  48. package/node_modules/@silicaclaw/core/dist/packages/core/src/index.d.ts +12 -0
  49. package/node_modules/@silicaclaw/core/dist/packages/core/src/index.js +28 -0
  50. package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.d.ts +6 -0
  51. package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.js +43 -0
  52. package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.d.ts +4 -0
  53. package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.js +23 -0
  54. package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.d.ts +4 -0
  55. package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.js +39 -0
  56. package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
  57. package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.js +103 -0
  58. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.d.ts +100 -0
  59. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.js +300 -0
  60. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.d.ts +19 -0
  61. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.js +69 -0
  62. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.d.ts +46 -0
  63. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.js +237 -0
  64. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
  65. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.js +90 -0
  66. package/node_modules/@silicaclaw/core/dist/packages/core/src/types.d.ts +59 -0
  67. package/node_modules/@silicaclaw/core/dist/packages/core/src/types.js +2 -0
  68. package/node_modules/@silicaclaw/core/src/socialConfig.ts +7 -5
  69. package/node_modules/@silicaclaw/network/dist/config/silicaclaw-defaults.json +19 -0
  70. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
  71. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
  72. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
  73. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
  74. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
  75. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
  76. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
  77. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.js +2 -0
  78. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
  79. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
  80. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
  81. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
  82. package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
  83. package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
  84. package/node_modules/@silicaclaw/network/dist/packages/network/src/index.d.ts +14 -0
  85. package/node_modules/@silicaclaw/network/dist/packages/network/src/index.js +30 -0
  86. package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.d.ts +9 -0
  87. package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.js +47 -0
  88. package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.d.ts +8 -0
  89. package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.js +24 -0
  90. package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.d.ts +105 -0
  91. package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.js +331 -0
  92. package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.d.ts +166 -0
  93. package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.js +448 -0
  94. package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
  95. package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
  96. package/node_modules/@silicaclaw/network/dist/packages/network/src/types.d.ts +6 -0
  97. package/node_modules/@silicaclaw/network/dist/packages/network/src/types.js +2 -0
  98. package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
  99. package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.js +848 -0
  100. package/node_modules/@silicaclaw/network/src/realPreview.ts +3 -2
  101. package/node_modules/@silicaclaw/network/src/relayPreview.ts +5 -2
  102. package/node_modules/@silicaclaw/network/src/transport/udpLanBroadcastTransport.ts +2 -1
  103. package/node_modules/@silicaclaw/network/src/webrtcPreview.ts +2 -1
  104. package/node_modules/@silicaclaw/storage/config/silicaclaw-defaults.json +19 -0
  105. package/node_modules/@silicaclaw/storage/dist/config/silicaclaw-defaults.json +19 -0
  106. package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.d.ts +6 -0
  107. package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.js +50 -0
  108. package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.d.ts +17 -0
  109. package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.js +145 -0
  110. package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.d.ts +2 -0
  111. package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.js +18 -0
  112. package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.d.ts +12 -0
  113. package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.js +28 -0
  114. package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.d.ts +6 -0
  115. package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.js +43 -0
  116. package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.d.ts +4 -0
  117. package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.js +23 -0
  118. package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.d.ts +4 -0
  119. package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.js +39 -0
  120. package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
  121. package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.js +103 -0
  122. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
  123. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.js +300 -0
  124. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
  125. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.js +69 -0
  126. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
  127. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.js +237 -0
  128. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
  129. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.js +90 -0
  130. package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.d.ts +59 -0
  131. package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.js +2 -0
  132. package/node_modules/@silicaclaw/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
  133. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.d.ts +3 -0
  134. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.js +19 -0
  135. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
  136. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.js +29 -0
  137. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.d.ts +61 -0
  138. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.js +67 -0
  139. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
  140. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
  141. package/node_modules/@silicaclaw/storage/dist/socialRuntimeRepo.js +8 -4
  142. package/node_modules/@silicaclaw/storage/src/socialRuntimeRepo.ts +5 -4
  143. package/node_modules/@silicaclaw/storage/tsconfig.json +1 -6
  144. package/openclaw-skills/silicaclaw-bridge-setup/SKILL.md +147 -0
  145. package/openclaw-skills/silicaclaw-bridge-setup/VERSION +1 -0
  146. package/openclaw-skills/silicaclaw-bridge-setup/agents/openai.yaml +6 -0
  147. package/openclaw-skills/silicaclaw-bridge-setup/manifest.json +27 -0
  148. package/openclaw-skills/silicaclaw-bridge-setup/references/owner-dialogue-cheatsheet-zh.md +58 -0
  149. package/openclaw-skills/silicaclaw-bridge-setup/references/runtime-setup.md +43 -0
  150. package/openclaw-skills/silicaclaw-bridge-setup/references/troubleshooting.md +24 -0
  151. package/openclaw-skills/silicaclaw-broadcast/SKILL.md +132 -0
  152. package/openclaw-skills/silicaclaw-broadcast/VERSION +1 -1
  153. package/openclaw-skills/silicaclaw-broadcast/agents/openai.yaml +2 -2
  154. package/openclaw-skills/silicaclaw-broadcast/manifest.json +3 -2
  155. package/openclaw-skills/silicaclaw-broadcast/references/owner-dialogue-cheatsheet-zh.md +81 -0
  156. package/openclaw-skills/silicaclaw-owner-push/SKILL.md +217 -0
  157. package/openclaw-skills/silicaclaw-owner-push/VERSION +1 -0
  158. package/openclaw-skills/silicaclaw-owner-push/agents/openai.yaml +6 -0
  159. package/openclaw-skills/silicaclaw-owner-push/manifest.json +30 -0
  160. package/openclaw-skills/silicaclaw-owner-push/references/owner-dialogue-cheatsheet-zh.md +87 -0
  161. package/openclaw-skills/silicaclaw-owner-push/references/push-routing-policy.md +43 -0
  162. package/openclaw-skills/silicaclaw-owner-push/references/runtime-setup.md +41 -0
  163. package/openclaw-skills/silicaclaw-owner-push/scripts/owner-push-forwarder.mjs +214 -0
  164. package/openclaw-skills/silicaclaw-owner-push/scripts/send-to-owner-via-openclaw.mjs +69 -0
  165. package/package.json +5 -1
  166. package/packages/core/dist/config/silicaclaw-defaults.json +19 -0
  167. package/packages/core/dist/packages/core/src/crypto.d.ts +6 -0
  168. package/packages/core/dist/packages/core/src/crypto.js +50 -0
  169. package/packages/core/dist/packages/core/src/directory.d.ts +17 -0
  170. package/packages/core/dist/packages/core/src/directory.js +145 -0
  171. package/packages/core/dist/packages/core/src/identity.d.ts +2 -0
  172. package/packages/core/dist/packages/core/src/identity.js +18 -0
  173. package/packages/core/dist/packages/core/src/index.d.ts +12 -0
  174. package/packages/core/dist/packages/core/src/index.js +28 -0
  175. package/packages/core/dist/packages/core/src/indexing.d.ts +6 -0
  176. package/packages/core/dist/packages/core/src/indexing.js +43 -0
  177. package/packages/core/dist/packages/core/src/presence.d.ts +4 -0
  178. package/packages/core/dist/packages/core/src/presence.js +23 -0
  179. package/packages/core/dist/packages/core/src/profile.d.ts +4 -0
  180. package/packages/core/dist/packages/core/src/profile.js +39 -0
  181. package/packages/core/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
  182. package/packages/core/dist/packages/core/src/publicProfileSummary.js +103 -0
  183. package/packages/core/dist/packages/core/src/socialConfig.d.ts +100 -0
  184. package/packages/core/dist/packages/core/src/socialConfig.js +300 -0
  185. package/packages/core/dist/packages/core/src/socialMessage.d.ts +19 -0
  186. package/packages/core/dist/packages/core/src/socialMessage.js +69 -0
  187. package/packages/core/dist/packages/core/src/socialResolver.d.ts +46 -0
  188. package/packages/core/dist/packages/core/src/socialResolver.js +237 -0
  189. package/packages/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
  190. package/packages/core/dist/packages/core/src/socialTemplate.js +90 -0
  191. package/packages/core/dist/packages/core/src/types.d.ts +59 -0
  192. package/packages/core/dist/packages/core/src/types.js +2 -0
  193. package/packages/core/src/socialConfig.ts +7 -5
  194. package/packages/network/dist/config/silicaclaw-defaults.json +19 -0
  195. package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
  196. package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
  197. package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
  198. package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
  199. package/packages/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
  200. package/packages/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
  201. package/packages/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
  202. package/packages/network/dist/packages/network/src/abstractions/transport.js +2 -0
  203. package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
  204. package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
  205. package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
  206. package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
  207. package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
  208. package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
  209. package/packages/network/dist/packages/network/src/index.d.ts +14 -0
  210. package/packages/network/dist/packages/network/src/index.js +30 -0
  211. package/packages/network/dist/packages/network/src/localEventBus.d.ts +9 -0
  212. package/packages/network/dist/packages/network/src/localEventBus.js +47 -0
  213. package/packages/network/dist/packages/network/src/mock.d.ts +8 -0
  214. package/packages/network/dist/packages/network/src/mock.js +24 -0
  215. package/packages/network/dist/packages/network/src/realPreview.d.ts +105 -0
  216. package/packages/network/dist/packages/network/src/realPreview.js +331 -0
  217. package/packages/network/dist/packages/network/src/relayPreview.d.ts +166 -0
  218. package/packages/network/dist/packages/network/src/relayPreview.js +448 -0
  219. package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
  220. package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
  221. package/packages/network/dist/packages/network/src/types.d.ts +6 -0
  222. package/packages/network/dist/packages/network/src/types.js +2 -0
  223. package/packages/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
  224. package/packages/network/dist/packages/network/src/webrtcPreview.js +848 -0
  225. package/packages/network/src/realPreview.ts +3 -2
  226. package/packages/network/src/relayPreview.ts +5 -2
  227. package/packages/network/src/transport/udpLanBroadcastTransport.ts +2 -1
  228. package/packages/network/src/webrtcPreview.ts +2 -1
  229. package/packages/storage/config/silicaclaw-defaults.json +19 -0
  230. package/packages/storage/dist/config/silicaclaw-defaults.json +19 -0
  231. package/packages/storage/dist/packages/core/src/crypto.d.ts +6 -0
  232. package/packages/storage/dist/packages/core/src/crypto.js +50 -0
  233. package/packages/storage/dist/packages/core/src/directory.d.ts +17 -0
  234. package/packages/storage/dist/packages/core/src/directory.js +145 -0
  235. package/packages/storage/dist/packages/core/src/identity.d.ts +2 -0
  236. package/packages/storage/dist/packages/core/src/identity.js +18 -0
  237. package/packages/storage/dist/packages/core/src/index.d.ts +12 -0
  238. package/packages/storage/dist/packages/core/src/index.js +28 -0
  239. package/packages/storage/dist/packages/core/src/indexing.d.ts +6 -0
  240. package/packages/storage/dist/packages/core/src/indexing.js +43 -0
  241. package/packages/storage/dist/packages/core/src/presence.d.ts +4 -0
  242. package/packages/storage/dist/packages/core/src/presence.js +23 -0
  243. package/packages/storage/dist/packages/core/src/profile.d.ts +4 -0
  244. package/packages/storage/dist/packages/core/src/profile.js +39 -0
  245. package/packages/storage/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
  246. package/packages/storage/dist/packages/core/src/publicProfileSummary.js +103 -0
  247. package/packages/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
  248. package/packages/storage/dist/packages/core/src/socialConfig.js +300 -0
  249. package/packages/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
  250. package/packages/storage/dist/packages/core/src/socialMessage.js +69 -0
  251. package/packages/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
  252. package/packages/storage/dist/packages/core/src/socialResolver.js +237 -0
  253. package/packages/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
  254. package/packages/storage/dist/packages/core/src/socialTemplate.js +90 -0
  255. package/packages/storage/dist/packages/core/src/types.d.ts +59 -0
  256. package/packages/storage/dist/packages/core/src/types.js +2 -0
  257. package/packages/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
  258. package/packages/storage/dist/packages/storage/src/index.d.ts +3 -0
  259. package/packages/storage/dist/packages/storage/src/index.js +19 -0
  260. package/packages/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
  261. package/packages/storage/dist/packages/storage/src/jsonRepo.js +29 -0
  262. package/packages/storage/dist/packages/storage/src/repos.d.ts +61 -0
  263. package/packages/storage/dist/packages/storage/src/repos.js +67 -0
  264. package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
  265. package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
  266. package/packages/storage/dist/socialRuntimeRepo.js +8 -4
  267. package/packages/storage/src/socialRuntimeRepo.ts +5 -4
  268. package/packages/storage/tsconfig.json +1 -6
  269. package/scripts/functional-check.mjs +35 -6
  270. package/scripts/install-openclaw-skill.mjs +9 -2
  271. package/scripts/openclaw-bridge-adapter.mjs +3 -1
  272. package/scripts/openclaw-bridge-client.mjs +3 -1
  273. package/scripts/openclaw-runtime-demo.mjs +3 -1
  274. package/scripts/quickstart.sh +14 -10
  275. package/scripts/release-pack.mjs +59 -1
  276. package/scripts/silicaclaw-cli.mjs +162 -50
  277. package/scripts/silicaclaw-gateway.mjs +302 -84
  278. package/scripts/validate-openclaw-skill.mjs +79 -21
@@ -0,0 +1,331 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RealNetworkAdapterPreview = void 0;
7
+ const crypto_1 = require("crypto");
8
+ const messageEnvelope_1 = require("./abstractions/messageEnvelope");
9
+ const jsonMessageEnvelopeCodec_1 = require("./codec/jsonMessageEnvelopeCodec");
10
+ const jsonTopicCodec_1 = require("./codec/jsonTopicCodec");
11
+ const udpLanBroadcastTransport_1 = require("./transport/udpLanBroadcastTransport");
12
+ const heartbeatPeerDiscovery_1 = require("./discovery/heartbeatPeerDiscovery");
13
+ const silicaclaw_defaults_json_1 = __importDefault(require("../../../config/silicaclaw-defaults.json"));
14
+ class RealNetworkAdapterPreview {
15
+ started = false;
16
+ peerId;
17
+ namespace;
18
+ transport;
19
+ envelopeCodec;
20
+ topicCodec;
21
+ peerDiscovery;
22
+ maxMessageBytes;
23
+ dedupeWindowMs;
24
+ dedupeMaxEntries;
25
+ maxFutureDriftMs;
26
+ maxPastDriftMs;
27
+ seenMessageIds = new Map();
28
+ offTransportMessage = null;
29
+ handlers = new Map();
30
+ stats = {
31
+ publish_attempted: 0,
32
+ publish_sent: 0,
33
+ received_total: 0,
34
+ delivered_total: 0,
35
+ dropped_duplicate: 0,
36
+ dropped_self: 0,
37
+ dropped_malformed: 0,
38
+ dropped_oversized: 0,
39
+ dropped_namespace_mismatch: 0,
40
+ dropped_timestamp_future_drift: 0,
41
+ dropped_timestamp_past_drift: 0,
42
+ dropped_decode_failed: 0,
43
+ dropped_topic_decode_error: 0,
44
+ dropped_handler_error: 0,
45
+ send_errors: 0,
46
+ discovery_errors: 0,
47
+ start_errors: 0,
48
+ stop_errors: 0,
49
+ received_validated: 0,
50
+ };
51
+ constructor(options = {}) {
52
+ this.peerId = options.peerId ?? `peer-${process.pid}-${Math.random().toString(36).slice(2, 10)}`;
53
+ this.namespace = this.normalizeNamespace(options.namespace ?? silicaclaw_defaults_json_1.default.network.default_namespace);
54
+ this.transport = options.transport ?? new udpLanBroadcastTransport_1.UdpLanBroadcastTransport();
55
+ this.envelopeCodec = options.envelopeCodec ?? new jsonMessageEnvelopeCodec_1.JsonMessageEnvelopeCodec();
56
+ this.topicCodec = options.topicCodec ?? new jsonTopicCodec_1.JsonTopicCodec();
57
+ this.peerDiscovery = options.peerDiscovery ?? new heartbeatPeerDiscovery_1.HeartbeatPeerDiscovery();
58
+ this.maxMessageBytes = options.maxMessageBytes ?? 64 * 1024;
59
+ this.dedupeWindowMs = options.dedupeWindowMs ?? 90_000;
60
+ this.dedupeMaxEntries = options.dedupeMaxEntries ?? 10_000;
61
+ this.maxFutureDriftMs = options.maxFutureDriftMs ?? 30_000;
62
+ this.maxPastDriftMs = options.maxPastDriftMs ?? 120_000;
63
+ }
64
+ async start() {
65
+ if (this.started) {
66
+ return;
67
+ }
68
+ try {
69
+ await this.transport.start();
70
+ }
71
+ catch (error) {
72
+ this.stats.start_errors += 1;
73
+ throw new Error(`Transport start failed: ${this.errorMessage(error)}`);
74
+ }
75
+ this.started = true;
76
+ this.offTransportMessage = this.transport.onMessage((raw) => {
77
+ this.onTransportMessage(raw);
78
+ });
79
+ try {
80
+ await this.peerDiscovery.start({
81
+ self_peer_id: this.peerId,
82
+ publishControl: async (topic, payload) => {
83
+ await this.publish(topic, payload);
84
+ },
85
+ });
86
+ }
87
+ catch (error) {
88
+ this.stats.start_errors += 1;
89
+ this.started = false;
90
+ if (this.offTransportMessage) {
91
+ this.offTransportMessage();
92
+ this.offTransportMessage = null;
93
+ }
94
+ try {
95
+ await this.transport.stop();
96
+ }
97
+ catch {
98
+ this.stats.stop_errors += 1;
99
+ }
100
+ throw new Error(`Peer discovery start failed: ${this.errorMessage(error)}`);
101
+ }
102
+ }
103
+ async stop() {
104
+ if (!this.started) {
105
+ return;
106
+ }
107
+ try {
108
+ await this.peerDiscovery.stop();
109
+ }
110
+ catch {
111
+ this.stats.discovery_errors += 1;
112
+ this.stats.stop_errors += 1;
113
+ }
114
+ if (this.offTransportMessage) {
115
+ this.offTransportMessage();
116
+ this.offTransportMessage = null;
117
+ }
118
+ try {
119
+ await this.transport.stop();
120
+ }
121
+ catch {
122
+ this.stats.stop_errors += 1;
123
+ }
124
+ this.started = false;
125
+ }
126
+ async publish(topic, data) {
127
+ if (!this.started) {
128
+ return;
129
+ }
130
+ this.stats.publish_attempted += 1;
131
+ if (!this.isValidTopic(topic)) {
132
+ this.stats.dropped_malformed += 1;
133
+ return;
134
+ }
135
+ const envelope = {
136
+ version: 1,
137
+ message_id: (0, crypto_1.randomUUID)(),
138
+ topic: this.topicKey(topic),
139
+ source_peer_id: this.peerId,
140
+ timestamp: Date.now(),
141
+ payload: this.topicCodec.encode(topic, data),
142
+ };
143
+ const raw = this.envelopeCodec.encode(envelope);
144
+ if (raw.length > this.maxMessageBytes) {
145
+ this.stats.dropped_oversized += 1;
146
+ return;
147
+ }
148
+ try {
149
+ await this.transport.send(raw);
150
+ this.stats.publish_sent += 1;
151
+ }
152
+ catch {
153
+ this.stats.send_errors += 1;
154
+ throw new Error("Transport send failed");
155
+ }
156
+ }
157
+ subscribe(topic, handler) {
158
+ if (!this.isValidTopic(topic)) {
159
+ return;
160
+ }
161
+ const key = this.topicKey(topic);
162
+ if (!this.handlers.has(key)) {
163
+ this.handlers.set(key, new Set());
164
+ }
165
+ this.handlers.get(key)?.add(handler);
166
+ }
167
+ listPeers() {
168
+ return this.peerDiscovery.listPeers();
169
+ }
170
+ getDiagnostics() {
171
+ const peers = this.listPeers();
172
+ const online = peers.filter((peer) => peer.status === "online").length;
173
+ return {
174
+ adapter: "real-preview",
175
+ peer_id: this.peerId,
176
+ namespace: this.namespace,
177
+ components: {
178
+ transport: this.transport.constructor.name,
179
+ discovery: this.peerDiscovery.constructor.name,
180
+ envelope_codec: this.envelopeCodec.constructor.name,
181
+ topic_codec: this.topicCodec.constructor.name,
182
+ },
183
+ limits: {
184
+ max_message_bytes: this.maxMessageBytes,
185
+ dedupe_window_ms: this.dedupeWindowMs,
186
+ dedupe_max_entries: this.dedupeMaxEntries,
187
+ max_future_drift_ms: this.maxFutureDriftMs,
188
+ max_past_drift_ms: this.maxPastDriftMs,
189
+ },
190
+ config: {
191
+ started: this.started,
192
+ topic_handler_count: this.handlers.size,
193
+ transport: this.transport.getConfig?.() ?? null,
194
+ discovery: this.peerDiscovery.getConfig?.() ?? null,
195
+ },
196
+ peers: {
197
+ total: peers.length,
198
+ online,
199
+ stale: Math.max(0, peers.length - online),
200
+ items: peers,
201
+ },
202
+ stats: { ...this.stats },
203
+ transport_stats: this.transport.getStats?.() ?? null,
204
+ discovery_stats: this.peerDiscovery.getStats?.() ?? null,
205
+ };
206
+ }
207
+ onTransportMessage(raw) {
208
+ this.stats.received_total += 1;
209
+ if (raw.length > this.maxMessageBytes) {
210
+ this.stats.dropped_oversized += 1;
211
+ return;
212
+ }
213
+ const decoded = this.envelopeCodec.decode(raw);
214
+ if (!decoded) {
215
+ this.stats.dropped_decode_failed += 1;
216
+ this.stats.dropped_malformed += 1;
217
+ return;
218
+ }
219
+ const validated = (0, messageEnvelope_1.validateNetworkMessageEnvelope)(decoded.envelope, {
220
+ max_future_drift_ms: this.maxFutureDriftMs,
221
+ max_past_drift_ms: this.maxPastDriftMs,
222
+ });
223
+ if (!validated.ok || !validated.envelope) {
224
+ if (validated.reason === "timestamp_future_drift") {
225
+ this.stats.dropped_timestamp_future_drift += 1;
226
+ }
227
+ else if (validated.reason === "timestamp_past_drift") {
228
+ this.stats.dropped_timestamp_past_drift += 1;
229
+ }
230
+ else {
231
+ this.stats.dropped_malformed += 1;
232
+ }
233
+ return;
234
+ }
235
+ this.stats.received_validated += 1;
236
+ const envelope = validated.envelope;
237
+ if (!envelope.topic.startsWith(`${this.namespace}:`)) {
238
+ this.stats.dropped_namespace_mismatch += 1;
239
+ return;
240
+ }
241
+ if (this.isDuplicateMessage(envelope.message_id, envelope.timestamp)) {
242
+ this.stats.dropped_duplicate += 1;
243
+ return;
244
+ }
245
+ try {
246
+ this.peerDiscovery.observeEnvelope(envelope);
247
+ }
248
+ catch {
249
+ this.stats.discovery_errors += 1;
250
+ }
251
+ if (envelope.source_peer_id === this.peerId) {
252
+ this.stats.dropped_self += 1;
253
+ return;
254
+ }
255
+ const topic = this.stripNamespace(envelope.topic);
256
+ if (!topic) {
257
+ this.stats.dropped_namespace_mismatch += 1;
258
+ return;
259
+ }
260
+ const handlers = this.handlers.get(envelope.topic);
261
+ if (!handlers || handlers.size === 0) {
262
+ return;
263
+ }
264
+ try {
265
+ const payload = this.topicCodec.decode(topic, envelope.payload);
266
+ for (const handler of handlers) {
267
+ try {
268
+ handler(payload);
269
+ this.stats.delivered_total += 1;
270
+ }
271
+ catch {
272
+ this.stats.dropped_handler_error += 1;
273
+ }
274
+ }
275
+ }
276
+ catch {
277
+ this.stats.dropped_topic_decode_error += 1;
278
+ }
279
+ }
280
+ topicKey(topic) {
281
+ return `${this.namespace}:${topic}`;
282
+ }
283
+ stripNamespace(topicKey) {
284
+ const prefix = `${this.namespace}:`;
285
+ if (!topicKey.startsWith(prefix)) {
286
+ return null;
287
+ }
288
+ return topicKey.slice(prefix.length);
289
+ }
290
+ isDuplicateMessage(messageId, timestamp) {
291
+ const now = Date.now();
292
+ this.cleanupSeenMessageIds(now);
293
+ const existing = this.seenMessageIds.get(messageId);
294
+ if (existing && now - existing <= this.dedupeWindowMs) {
295
+ return true;
296
+ }
297
+ this.seenMessageIds.set(messageId, Number.isFinite(timestamp) ? timestamp : now);
298
+ if (this.seenMessageIds.size > this.dedupeMaxEntries) {
299
+ const oldestKey = this.seenMessageIds.keys().next().value;
300
+ if (oldestKey) {
301
+ this.seenMessageIds.delete(oldestKey);
302
+ }
303
+ }
304
+ return false;
305
+ }
306
+ cleanupSeenMessageIds(now) {
307
+ for (const [id, ts] of this.seenMessageIds.entries()) {
308
+ if (now - ts > this.dedupeWindowMs) {
309
+ this.seenMessageIds.delete(id);
310
+ }
311
+ }
312
+ }
313
+ isValidTopic(topic) {
314
+ if (typeof topic !== "string") {
315
+ return false;
316
+ }
317
+ const normalized = topic.trim();
318
+ return normalized.length > 0 && !normalized.includes(":");
319
+ }
320
+ normalizeNamespace(namespace) {
321
+ const normalized = namespace.trim();
322
+ return normalized.length > 0 ? normalized : silicaclaw_defaults_json_1.default.network.default_namespace;
323
+ }
324
+ errorMessage(error) {
325
+ if (error instanceof Error) {
326
+ return error.message;
327
+ }
328
+ return String(error);
329
+ }
330
+ }
331
+ exports.RealNetworkAdapterPreview = RealNetworkAdapterPreview;
@@ -0,0 +1,166 @@
1
+ import { NetworkAdapter } from "./types";
2
+ type RelayPreviewOptions = {
3
+ peerId?: string;
4
+ namespace?: string;
5
+ signalingUrl?: string;
6
+ signalingUrls?: string[];
7
+ room?: string;
8
+ seedPeers?: string[];
9
+ bootstrapHints?: string[];
10
+ bootstrapSources?: string[];
11
+ maxMessageBytes?: number;
12
+ pollIntervalMs?: number;
13
+ maxFutureDriftMs?: number;
14
+ maxPastDriftMs?: number;
15
+ requestTimeoutMs?: number;
16
+ peerRefreshIntervalMs?: number;
17
+ };
18
+ type RelayPeer = {
19
+ peer_id: string;
20
+ status: "online";
21
+ first_seen_at: number;
22
+ last_seen_at: number;
23
+ messages_seen: number;
24
+ reconnect_attempts: number;
25
+ };
26
+ type RelayDiagnostics = {
27
+ adapter: "relay-preview";
28
+ peer_id: string;
29
+ namespace: string;
30
+ room: string;
31
+ signaling_url: string;
32
+ signaling_endpoints: string[];
33
+ active_endpoint_index: number;
34
+ bootstrap_sources: string[];
35
+ seed_peers_count: number;
36
+ bootstrap_hints_count: number;
37
+ discovery_events_total: number;
38
+ last_discovery_event_at: number;
39
+ last_join_at: number;
40
+ last_poll_at: number;
41
+ last_publish_at: number;
42
+ last_peer_refresh_at: number;
43
+ last_error_at: number;
44
+ last_error: string | null;
45
+ discovery_events: Array<{
46
+ id: string;
47
+ type: string;
48
+ at: number;
49
+ peer_id?: string;
50
+ endpoint?: string;
51
+ detail?: string;
52
+ }>;
53
+ signaling_messages_sent_total: number;
54
+ signaling_messages_received_total: number;
55
+ reconnect_attempts_total: number;
56
+ active_webrtc_peers: number;
57
+ components: {
58
+ transport: string;
59
+ discovery: string;
60
+ envelope_codec: string;
61
+ topic_codec: string;
62
+ };
63
+ limits: {
64
+ max_message_bytes: number;
65
+ max_future_drift_ms: number;
66
+ max_past_drift_ms: number;
67
+ };
68
+ config: {
69
+ started: boolean;
70
+ topic_handler_count: number;
71
+ poll_interval_ms: number;
72
+ };
73
+ peers: {
74
+ total: number;
75
+ online: number;
76
+ stale: number;
77
+ items: RelayPeer[];
78
+ };
79
+ stats: {
80
+ publish_attempted: number;
81
+ publish_sent: number;
82
+ received_total: number;
83
+ delivered_total: number;
84
+ dropped_malformed: number;
85
+ dropped_oversized: number;
86
+ dropped_namespace_mismatch: number;
87
+ dropped_timestamp_future_drift: number;
88
+ dropped_timestamp_past_drift: number;
89
+ dropped_decode_failed: number;
90
+ dropped_self: number;
91
+ dropped_topic_decode_error: number;
92
+ dropped_handler_error: number;
93
+ signaling_errors: number;
94
+ invalid_signaling_payload_total: number;
95
+ duplicate_sdp_total: number;
96
+ duplicate_ice_total: number;
97
+ start_errors: number;
98
+ stop_errors: number;
99
+ received_validated: number;
100
+ join_attempted: number;
101
+ join_succeeded: number;
102
+ poll_attempted: number;
103
+ poll_succeeded: number;
104
+ peers_refresh_attempted: number;
105
+ peers_refresh_succeeded: number;
106
+ publish_succeeded: number;
107
+ poll_skipped_inflight: number;
108
+ };
109
+ };
110
+ export declare class RelayPreviewAdapter implements NetworkAdapter {
111
+ private readonly peerId;
112
+ private readonly namespace;
113
+ private readonly signalingEndpoints;
114
+ private readonly room;
115
+ private readonly seedPeers;
116
+ private readonly bootstrapHints;
117
+ private readonly bootstrapSources;
118
+ private readonly maxMessageBytes;
119
+ private readonly pollIntervalMs;
120
+ private readonly maxFutureDriftMs;
121
+ private readonly maxPastDriftMs;
122
+ private readonly requestTimeoutMs;
123
+ private readonly peerRefreshIntervalMs;
124
+ private readonly envelopeCodec;
125
+ private readonly topicCodec;
126
+ private started;
127
+ private poller;
128
+ private handlers;
129
+ private peers;
130
+ private seenMessageIds;
131
+ private activeEndpoint;
132
+ private discoveryEvents;
133
+ private discoveryEventsTotal;
134
+ private lastDiscoveryEventAt;
135
+ private signalingMessagesSentTotal;
136
+ private signalingMessagesReceivedTotal;
137
+ private reconnectAttemptsTotal;
138
+ private activeEndpointIndex;
139
+ private lastJoinAt;
140
+ private lastPollAt;
141
+ private lastPublishAt;
142
+ private lastPeerRefreshAt;
143
+ private lastErrorAt;
144
+ private lastError;
145
+ private pollInFlight;
146
+ private currentPollDelayMs;
147
+ private stats;
148
+ constructor(options?: RelayPreviewOptions);
149
+ start(): Promise<void>;
150
+ stop(): Promise<void>;
151
+ publish(topic: string, data: any): Promise<void>;
152
+ subscribe(topic: string, handler: (data: any) => void): void;
153
+ getDiagnostics(): RelayDiagnostics;
154
+ private pollOnce;
155
+ private refreshPeers;
156
+ private onEnvelope;
157
+ private recordDiscovery;
158
+ private joinRoom;
159
+ private maybeRefreshJoin;
160
+ private get;
161
+ private post;
162
+ private requestJson;
163
+ private updatePeersFromList;
164
+ private scheduleNextPoll;
165
+ }
166
+ export {};