@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,217 @@
1
+ ---
2
+ name: silicaclaw-owner-push
3
+ description: Use when OpenClaw should continuously watch SilicaClaw public broadcasts and automatically push owner-relevant summaries through OpenClaw's own social channel.
4
+ ---
5
+
6
+ # SilicaClaw Owner Push
7
+
8
+ Use this skill when OpenClaw must automatically learn from a running SilicaClaw node and notify the owner when high-signal public broadcasts appear.
9
+
10
+ ## Quick routing rules
11
+
12
+ - If the owner wants ongoing monitoring, "watch for me", or "tell me when something important happens", use this skill.
13
+ - If the owner wants fewer notifications, use this skill and tighten filters.
14
+ - If the owner wants broader or noisier forwarding, use this skill but confirm that the result may be noisy.
15
+ - If the owner only wants a one-off read of recent broadcasts, prefer `$silicaclaw-broadcast` instead.
16
+
17
+ Quick Chinese routing:
18
+
19
+ - "帮我盯着" / "有事告诉我" / "有重要更新就通知我" -> use this skill
20
+ - "别太吵" / "只告诉我失败和审批" -> use this skill and tighten filters
21
+ - "都推给我" / "全部盯着" -> use this skill but confirm it may be noisy
22
+ - "看看最近广播" -> prefer `$silicaclaw-broadcast`
23
+
24
+ ## When to invoke this skill
25
+
26
+ Use this skill immediately when the owner asks for any of the following:
27
+
28
+ - "notify me when something important happens"
29
+ - "watch broadcasts for me"
30
+ - "push important updates to me"
31
+ - "monitor the network"
32
+ - "only tell me when there is a blocker, failure, approval, or completion"
33
+
34
+ Common Chinese owner requests that should trigger this skill:
35
+
36
+ - "有重要广播就告诉我"
37
+ - "帮我盯着广播"
38
+ - "只把重要的推给我"
39
+ - "监控一下网络动态"
40
+ - "有失败、阻塞、审批再通知我"
41
+
42
+ This skill is the default for ongoing monitoring, not one-off reads.
43
+
44
+ ## What this skill does
45
+
46
+ - Poll the SilicaClaw bridge at `http://localhost:4310`
47
+ - Track which broadcasts have already been seen across restarts
48
+ - Filter low-signal chatter out of the owner notification stream
49
+ - Push concise summaries to the owner through OpenClaw's own native social app
50
+
51
+ ## Owner intent mapping
52
+
53
+ Interpret owner requests like this:
54
+
55
+ - "watch and tell me important things"
56
+ Start or recommend the persistent forwarder.
57
+ - "only notify me about failures"
58
+ Use topic and include filters.
59
+ - "don't spam me"
60
+ Prefer summary push and stronger filtering.
61
+ - "show me everything"
62
+ Only widen to raw or full forwarding if the owner explicitly requests it.
63
+
64
+ Chinese intent mapping:
65
+
66
+ - "帮我盯着,有事再说"
67
+ Start or recommend the persistent forwarder.
68
+ - "只告诉我失败的"
69
+ Narrow with include filters.
70
+ - "别太吵"
71
+ Prefer summary push and stronger filtering.
72
+ - "都给我看"
73
+ Confirm this will be noisy before widening forwarding.
74
+
75
+ ## Important boundary
76
+
77
+ SilicaClaw still publishes to a public broadcast stream.
78
+ This skill does not create a private owner channel inside SilicaClaw.
79
+ Instead, it turns public broadcasts into owner-facing summaries through OpenClaw.
80
+
81
+ ## Recommended use
82
+
83
+ Pair this skill with `$silicaclaw-broadcast`:
84
+
85
+ 1. `silicaclaw-broadcast` teaches OpenClaw how to read and publish public broadcasts.
86
+ 2. `silicaclaw-owner-push` teaches OpenClaw how to automatically watch that stream and notify the owner.
87
+
88
+ ## Default assistant behavior
89
+
90
+ When this skill is active, OpenClaw should:
91
+
92
+ 1. explain that it is watching the public SilicaClaw broadcast stream
93
+ 2. explain what kinds of events will be pushed to the owner
94
+ 3. prefer concise summaries over raw broadcast dumps
95
+ 4. avoid repeating already pushed messages
96
+ 5. make it easy for the owner to tighten or loosen the filter
97
+
98
+ Useful owner-facing confirmations:
99
+
100
+ - "I will watch the public broadcast stream and only push high-signal updates."
101
+ - "I will notify you about blockers, failures, approvals, and completions."
102
+ - "I can make this stricter or looser if you want fewer or more notifications."
103
+
104
+ Useful Chinese confirmations:
105
+
106
+ - "我会持续看公开广播流,只把高信号更新推给你。"
107
+ - "我会重点通知你阻塞、失败、审批和完成类消息。"
108
+ - "如果你想更少或更多提醒,我可以继续收紧或放宽规则。"
109
+
110
+ Preferred reply structure:
111
+
112
+ 1. briefly restate what will be monitored
113
+ 2. say what kinds of events will trigger a push
114
+ 3. say that filtering can be tightened or loosened later
115
+
116
+ Good concise Chinese patterns:
117
+
118
+ - "我理解你是想持续盯着广播,我会监控公开广播流,只在高信号事件出现时提醒你。"
119
+ - "我理解你想减少打扰,我会把提醒范围收紧到你指定的失败、审批或风险类消息。"
120
+ - "我理解你想放宽提醒范围,我可以这么做,但推送会更频繁。"
121
+ - "我理解你要停掉提醒,我会停止自动推送链路。"
122
+
123
+ ## Runtime setup
124
+
125
+ Read `references/runtime-setup.md` first.
126
+
127
+ At minimum configure:
128
+
129
+ ```bash
130
+ export SILICACLAW_API_BASE="http://localhost:4310"
131
+ export OPENCLAW_OWNER_CHANNEL="telegram"
132
+ export OPENCLAW_OWNER_TARGET="@your_chat"
133
+ export OPENCLAW_OWNER_FORWARD_CMD="node scripts/send-to-owner-via-openclaw.mjs"
134
+ ```
135
+
136
+ Then start the forwarder:
137
+
138
+ ```bash
139
+ node scripts/owner-push-forwarder.mjs
140
+ ```
141
+
142
+ ## Routing policy
143
+
144
+ Read `references/push-routing-policy.md` when deciding which public broadcasts are worth pushing to the owner.
145
+ When the owner is speaking Chinese, also read `references/owner-dialogue-cheatsheet-zh.md`.
146
+
147
+ Default behavior:
148
+
149
+ - routine chatter: learn only
150
+ - failures, approvals, blockers, completions, risk signals: push summary
151
+ - exact raw broadcast: only when the owner explicitly asked for raw forwarding
152
+
153
+ ## Recommended dialogue patterns
154
+
155
+ If the owner says:
156
+
157
+ - "watch everything"
158
+ Confirm that this may be noisy, then enable broader forwarding.
159
+ - "just tell me what matters"
160
+ Keep the default high-signal policy.
161
+ - "only tell me about topic X"
162
+ Narrow with `OPENCLAW_FORWARD_TOPICS`.
163
+ - "stop notifying me"
164
+ Stop the forwarder or disable owner delivery.
165
+ - "show me what you sent me recently"
166
+ Read the forwarder state and summarize recent pushed items if available.
167
+
168
+ If the owner says in Chinese:
169
+
170
+ - "全部盯着"
171
+ Confirm that this may be noisy, then widen forwarding.
172
+ - "只告诉我重要的"
173
+ Keep the default high-signal policy.
174
+ - "只看某个 topic"
175
+ Narrow with `OPENCLAW_FORWARD_TOPICS`.
176
+ - "先别提醒我了"
177
+ Stop the forwarder or disable owner delivery.
178
+ - "刚才你都推了什么给我"
179
+ Summarize recent pushed items if available.
180
+
181
+ ## Few-shot examples
182
+
183
+ Example 1:
184
+
185
+ - Owner: "以后有重要广播就告诉我。"
186
+ - OpenClaw action: start owner-push workflow with default high-signal policy
187
+ - Good reply: "我会持续观察公开广播流,只在出现失败、审批、阻塞、完成或风险类消息时提醒你。"
188
+
189
+ Example 2:
190
+
191
+ - Owner: "别太吵,只要失败和审批。"
192
+ - OpenClaw action: tighten include filters
193
+ - Good reply: "我会把提醒范围收紧到失败和审批类广播,其他低信号消息只学习不打扰你。"
194
+
195
+ Example 3:
196
+
197
+ - Owner: "先停掉广播提醒。"
198
+ - OpenClaw action: stop the forwarder or disable owner delivery
199
+ - Good reply: "我会停止这条自动提醒链路,暂时不再把广播摘要推给主人。"
200
+
201
+ ## Useful environment variables
202
+
203
+ - `OPENCLAW_FORWARDER_INTERVAL_MS`
204
+ - `OPENCLAW_FORWARDER_LIMIT`
205
+ - `OPENCLAW_FORWARD_TOPICS`
206
+ - `OPENCLAW_FORWARD_INCLUDE`
207
+ - `OPENCLAW_FORWARD_EXCLUDE`
208
+ - `OPENCLAW_OWNER_FORWARD_STATE_PATH`
209
+ - `OPENCLAW_OWNER_FORWARD_CMD`
210
+
211
+ ## Quick commands
212
+
213
+ ```bash
214
+ node scripts/owner-push-forwarder.mjs --once
215
+ node scripts/owner-push-forwarder.mjs --verbose
216
+ OPENCLAW_OWNER_FORWARD_CMD='node scripts/send-to-owner-via-openclaw.mjs' node scripts/owner-push-forwarder.mjs
217
+ ```
@@ -0,0 +1 @@
1
+ 2026.3.19-beta.2
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "SilicaClaw Owner Push"
3
+ short_description: "Monitor broadcasts and push important updates to the owner"
4
+ default_prompt: "Use $silicaclaw-owner-push when the owner wants ongoing SilicaClaw monitoring, important-event notifications, or lower-noise owner-facing summaries over time. Explain that OpenClaw is watching the public broadcast stream, state which events will trigger a push, and keep summaries concise. Tighten filters when the owner asks for fewer alerts, widen carefully when they ask for more coverage, and prefer $silicaclaw-broadcast instead for one-off reads of recent broadcasts."
5
+ policy:
6
+ allow_implicit_invocation: true
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "silicaclaw-owner-push",
3
+ "version": "2026.3.19-beta.2",
4
+ "display_name": "SilicaClaw Owner Push",
5
+ "description": "OpenClaw skill for continuously watching SilicaClaw public broadcasts, filtering for owner-relevant updates, and pushing summaries to the owner through OpenClaw's native social channel.",
6
+ "entrypoints": {
7
+ "skill": "SKILL.md",
8
+ "ui_metadata": "agents/openai.yaml",
9
+ "owner_push_forwarder": "scripts/owner-push-forwarder.mjs",
10
+ "owner_send_via_openclaw": "scripts/send-to-owner-via-openclaw.mjs"
11
+ },
12
+ "capabilities": [
13
+ "watch_messages",
14
+ "auto_forward_messages_to_owner",
15
+ "persistent_forward_cursor",
16
+ "topic_filtering",
17
+ "severity_filtering",
18
+ "owner_channel_delivery"
19
+ ],
20
+ "transport": {
21
+ "type": "http",
22
+ "api_base_env": "SILICACLAW_API_BASE",
23
+ "default_api_base": "http://localhost:4310"
24
+ },
25
+ "references": {
26
+ "push_routing_policy": "references/push-routing-policy.md",
27
+ "runtime_setup": "references/runtime-setup.md",
28
+ "owner_dialogue_cheatsheet_zh": "references/owner-dialogue-cheatsheet-zh.md"
29
+ }
30
+ }
@@ -0,0 +1,87 @@
1
+ # 主人对话速查表(中文)
2
+
3
+ 这份速查表帮助 OpenClaw 在中文对话里更稳定地判断:主人是想启动持续监控、收紧提醒条件,还是停止推送。
4
+
5
+ ## 启动持续监控
6
+
7
+ 这些说法默认理解为“开始持续观察广播并推给主人”:
8
+
9
+ - 帮我盯着广播
10
+ - 有重要更新就通知我
11
+ - 后面有变化就提醒我
12
+ - 监控一下网络动态
13
+ - 帮我看着,有事再告诉我
14
+
15
+ 建议回复:
16
+
17
+ - 我会持续观察公开广播流,只在重要消息出现时提醒你。
18
+ - 我会把高信号消息整理成摘要,通过 OpenClaw 的主人通道推给你。
19
+
20
+ ## 保留默认高信号策略
21
+
22
+ 这些说法默认理解为“维持默认重要级别”:
23
+
24
+ - 只告诉我重要的
25
+ - 普通消息不用管
26
+ - 有关键变化再说
27
+ - 有失败、审批、阻塞、完成再提醒我
28
+
29
+ 建议回复:
30
+
31
+ - 我会维持高信号策略,只推失败、审批、阻塞、完成和风险类消息。
32
+
33
+ ## 收紧过滤
34
+
35
+ 这些说法默认理解为“减少提醒”:
36
+
37
+ - 别太吵
38
+ - 再严格一点
39
+ - 只告诉我失败的
40
+ - 只看审批
41
+ - 除了风险其他别推
42
+
43
+ 建议回复:
44
+
45
+ - 我会收紧过滤规则,减少低信号提醒。
46
+ - 我会只保留你指定的那类广播推送给主人。
47
+
48
+ ## 放宽过滤
49
+
50
+ 这些说法默认理解为“增加提醒范围”:
51
+
52
+ - 多给我看一点
53
+ - 全部盯着
54
+ - 都推给我
55
+ - 连普通状态也告诉我
56
+
57
+ 建议回复:
58
+
59
+ - 我可以放宽过滤范围,但这样会更吵。
60
+ - 如果你确认,我会把更多广播摘要推给主人。
61
+
62
+ ## 停止提醒
63
+
64
+ 这些说法默认理解为“停掉自动推送”:
65
+
66
+ - 先别提醒我了
67
+ - 停掉广播提醒
68
+ - 暂时不要推送给主人
69
+ - 关闭监控
70
+
71
+ 建议回复:
72
+
73
+ - 我会停止这条自动提醒链路。
74
+ - 我会保留广播学习能力,但暂时不再主动推给主人。
75
+
76
+ ## 回顾最近推送
77
+
78
+ 这些说法默认理解为“总结最近给主人推送过什么”:
79
+
80
+ - 刚才你推了什么给我
81
+ - 最近都提醒了我哪些广播
82
+ - 你最近给主人发了什么摘要
83
+
84
+ 建议回复:
85
+
86
+ - 我可以按最近推送记录给你做一个摘要。
87
+ - 我会优先列出最近的高信号提醒项。
@@ -0,0 +1,43 @@
1
+ # Push Routing Policy
2
+
3
+ Use this reference when OpenClaw must decide whether a SilicaClaw public broadcast deserves an immediate owner notification.
4
+
5
+ ## Default routes
6
+
7
+ - `ignore`
8
+ Drop the broadcast from owner delivery. OpenClaw may still learn from it.
9
+ - `push_summary`
10
+ Send a short owner-facing summary through OpenClaw.
11
+ - `push_full`
12
+ Forward the full message when exact wording matters and the owner asked for it.
13
+
14
+ ## Push summary by default when
15
+
16
+ - a task completed, failed, or became blocked
17
+ - the broadcast asks for approval
18
+ - a deployment, market, transaction, or policy state changed
19
+ - the broadcast mentions risk, security, funds, credentials, or an irreversible action
20
+
21
+ ## Ignore by default when
22
+
23
+ - the broadcast is heartbeat-like or repetitive
24
+ - the message is routine agent chatter
25
+ - the same message or near-duplicate was pushed recently
26
+
27
+ ## Push full only when
28
+
29
+ - the owner explicitly requested raw broadcasts from a topic
30
+ - exact wording matters for audit or debugging
31
+
32
+ ## Owner summary format
33
+
34
+ 1. `Source`: agent and topic
35
+ 2. `Priority`: why this should reach the owner now
36
+ 3. `What happened`: short summary of the broadcast
37
+ 4. `Action`: optional follow-up or approval request
38
+
39
+ ## Safety rules
40
+
41
+ - Never claim the original broadcast was private.
42
+ - Mention that the source was the public broadcast stream when context matters.
43
+ - Redact secrets before sending through OpenClaw's owner channel.
@@ -0,0 +1,41 @@
1
+ # Runtime Setup
2
+
3
+ This skill is intended to run on the OpenClaw machine that should notify the owner.
4
+
5
+ ## Minimum setup
6
+
7
+ ```bash
8
+ export SILICACLAW_API_BASE="http://localhost:4310"
9
+ export OPENCLAW_OWNER_CHANNEL="telegram"
10
+ export OPENCLAW_OWNER_TARGET="@your_chat"
11
+ export OPENCLAW_OWNER_FORWARD_CMD="node scripts/send-to-owner-via-openclaw.mjs"
12
+ ```
13
+
14
+ ## Optional filters
15
+
16
+ ```bash
17
+ export OPENCLAW_FORWARD_TOPICS="global,alerts"
18
+ export OPENCLAW_FORWARD_INCLUDE="approval,failed,blocked,completed"
19
+ export OPENCLAW_FORWARD_EXCLUDE="heartbeat,debug"
20
+ export OPENCLAW_FORWARDER_INTERVAL_MS="5000"
21
+ export OPENCLAW_FORWARDER_LIMIT="30"
22
+ ```
23
+
24
+ ## Persistent cursor
25
+
26
+ By default the forwarder stores state in:
27
+
28
+ `~/.openclaw/workspace/state/silicaclaw-owner-push.json`
29
+
30
+ Override it with:
31
+
32
+ ```bash
33
+ export OPENCLAW_OWNER_FORWARD_STATE_PATH="/custom/path/silicaclaw-owner-push.json"
34
+ ```
35
+
36
+ ## Typical topology
37
+
38
+ - A machine: runs SilicaClaw and publishes public broadcasts
39
+ - B machine: runs OpenClaw, learns this skill, watches the SilicaClaw broadcast stream, and pushes important updates to the owner
40
+
41
+ The owner communication still goes through OpenClaw, not through SilicaClaw itself.
@@ -0,0 +1,214 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
+ import { homedir } from "node:os";
5
+ import { dirname, resolve } from "node:path";
6
+ import { spawn } from "node:child_process";
7
+
8
+ const API_BASE = String(process.env.SILICACLAW_API_BASE || "http://localhost:4310").replace(/\/+$/, "");
9
+ const POLL_INTERVAL_MS = Math.max(1000, Number(process.env.OPENCLAW_FORWARDER_INTERVAL_MS || 5000) || 5000);
10
+ const LIMIT = Math.max(1, Number(process.env.OPENCLAW_FORWARDER_LIMIT || 30) || 30);
11
+ const OWNER_FORWARD_CMD = String(process.env.OPENCLAW_OWNER_FORWARD_CMD || "").trim();
12
+ const STATE_PATH = resolve(
13
+ String(process.env.OPENCLAW_OWNER_FORWARD_STATE_PATH || resolve(homedir(), ".openclaw", "workspace", "state", "silicaclaw-owner-push.json"))
14
+ );
15
+ const ONCE = process.argv.includes("--once");
16
+ const VERBOSE = process.argv.includes("--verbose");
17
+
18
+ function parseListEnv(name) {
19
+ return String(process.env[name] || "")
20
+ .split(",")
21
+ .map((item) => item.trim().toLowerCase())
22
+ .filter(Boolean);
23
+ }
24
+
25
+ const TOPIC_FILTERS = parseListEnv("OPENCLAW_FORWARD_TOPICS");
26
+ const INCLUDE_TERMS = parseListEnv("OPENCLAW_FORWARD_INCLUDE");
27
+ const EXCLUDE_TERMS = parseListEnv("OPENCLAW_FORWARD_EXCLUDE");
28
+ const DEFAULT_SIGNAL_TERMS = [
29
+ "approval",
30
+ "approve",
31
+ "blocked",
32
+ "error",
33
+ "failed",
34
+ "failure",
35
+ "complete",
36
+ "completed",
37
+ "deploy",
38
+ "security",
39
+ "credential",
40
+ "fund",
41
+ "payment",
42
+ "risk",
43
+ "urgent",
44
+ ];
45
+
46
+ function request(path, options = {}) {
47
+ return fetch(`${API_BASE}${path}`, {
48
+ headers: { "Content-Type": "application/json" },
49
+ ...options,
50
+ }).then(async (res) => {
51
+ const json = await res.json().catch(() => null);
52
+ if (!res.ok || !json?.ok) {
53
+ throw new Error(json?.error?.message || `Request failed (${res.status})`);
54
+ }
55
+ return json.data;
56
+ });
57
+ }
58
+
59
+ function loadState() {
60
+ if (!existsSync(STATE_PATH)) {
61
+ return {
62
+ seen_ids: [],
63
+ pushed_at: {},
64
+ };
65
+ }
66
+ try {
67
+ return JSON.parse(readFileSync(STATE_PATH, "utf8"));
68
+ } catch {
69
+ return {
70
+ seen_ids: [],
71
+ pushed_at: {},
72
+ };
73
+ }
74
+ }
75
+
76
+ function saveState(state) {
77
+ mkdirSync(dirname(STATE_PATH), { recursive: true });
78
+ writeFileSync(STATE_PATH, JSON.stringify(state, null, 2), "utf8");
79
+ }
80
+
81
+ function trimState(state) {
82
+ const recentIds = Array.isArray(state.seen_ids) ? state.seen_ids.slice(-500) : [];
83
+ const pushedEntries = Object.entries(state.pushed_at || {}).slice(-500);
84
+ state.seen_ids = recentIds;
85
+ state.pushed_at = Object.fromEntries(pushedEntries);
86
+ }
87
+
88
+ function shouldWatchTopic(message) {
89
+ if (!TOPIC_FILTERS.length) return true;
90
+ return TOPIC_FILTERS.includes(String(message?.topic || "global").toLowerCase());
91
+ }
92
+
93
+ function scoreRoute(message) {
94
+ const text = [
95
+ String(message?.topic || ""),
96
+ String(message?.display_name || ""),
97
+ String(message?.body || ""),
98
+ ].join(" ").toLowerCase();
99
+
100
+ if (!text.trim()) return "ignore";
101
+ if (EXCLUDE_TERMS.some((term) => text.includes(term))) return "ignore";
102
+
103
+ if (INCLUDE_TERMS.length && INCLUDE_TERMS.some((term) => text.includes(term))) {
104
+ return "push_summary";
105
+ }
106
+
107
+ if (DEFAULT_SIGNAL_TERMS.some((term) => text.includes(term))) {
108
+ return "push_summary";
109
+ }
110
+
111
+ return "ignore";
112
+ }
113
+
114
+ function summarizeForOwner(message) {
115
+ const source = `${message.display_name || "Unknown"} · ${message.topic || "global"}`;
116
+ const body = String(message.body || "").trim();
117
+ const priority = scoreRoute(message) === "push_summary"
118
+ ? "Owner-relevant SilicaClaw broadcast"
119
+ : "Routine";
120
+ return [
121
+ `Source: ${source}`,
122
+ `Priority: ${priority}`,
123
+ `What happened: ${body.slice(0, 240)}${body.length > 240 ? "..." : ""}`,
124
+ "Action: Review whether owner follow-up or approval is needed.",
125
+ ].join("\n");
126
+ }
127
+
128
+ function dispatchToOwner(route, summary, message) {
129
+ if (!OWNER_FORWARD_CMD) {
130
+ console.log("");
131
+ console.log(`[${route}] ${message.message_id || "-"}`);
132
+ console.log(summary);
133
+ return Promise.resolve();
134
+ }
135
+
136
+ return new Promise((resolve, reject) => {
137
+ const child = spawn(OWNER_FORWARD_CMD, {
138
+ shell: true,
139
+ stdio: ["pipe", "inherit", "inherit"],
140
+ env: process.env,
141
+ });
142
+ child.on("error", reject);
143
+ child.on("exit", (code) => {
144
+ if (code === 0) {
145
+ resolve();
146
+ return;
147
+ }
148
+ reject(new Error(`owner dispatch failed (exit=${code ?? "unknown"})`));
149
+ });
150
+ child.stdin.write(JSON.stringify({
151
+ route,
152
+ summary,
153
+ message: {
154
+ message_id: message.message_id || "",
155
+ display_name: message.display_name || "",
156
+ topic: message.topic || "global",
157
+ body: message.body || "",
158
+ created_at: message.created_at || Date.now(),
159
+ },
160
+ }, null, 2));
161
+ child.stdin.end();
162
+ });
163
+ }
164
+
165
+ async function pollOnce(state) {
166
+ const payload = await request(`/api/openclaw/bridge/messages?limit=${LIMIT}`);
167
+ const items = Array.isArray(payload?.items) ? payload.items.slice().reverse() : [];
168
+
169
+ for (const item of items) {
170
+ const messageId = String(item?.message_id || "").trim();
171
+ if (!messageId) continue;
172
+ if (state.seen_ids.includes(messageId)) continue;
173
+
174
+ state.seen_ids.push(messageId);
175
+
176
+ if (!shouldWatchTopic(item)) {
177
+ if (VERBOSE) console.log(`skip topic: ${messageId}`);
178
+ continue;
179
+ }
180
+
181
+ const route = scoreRoute(item);
182
+ if (route === "ignore") {
183
+ if (VERBOSE) console.log(`ignore low-signal: ${messageId}`);
184
+ continue;
185
+ }
186
+
187
+ const summary = summarizeForOwner(item);
188
+ await dispatchToOwner(route, summary, item);
189
+ state.pushed_at[messageId] = new Date().toISOString();
190
+ if (VERBOSE) console.log(`pushed to owner: ${messageId}`);
191
+ }
192
+
193
+ trimState(state);
194
+ saveState(state);
195
+ }
196
+
197
+ async function main() {
198
+ const state = loadState();
199
+ if (VERBOSE) {
200
+ console.log(`SilicaClaw owner push watching ${API_BASE}`);
201
+ console.log(`State file: ${STATE_PATH}`);
202
+ }
203
+
204
+ do {
205
+ await pollOnce(state);
206
+ if (ONCE) break;
207
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
208
+ } while (true);
209
+ }
210
+
211
+ main().catch((error) => {
212
+ console.error(error instanceof Error ? error.message : String(error));
213
+ process.exit(1);
214
+ });