@silicaclaw/cli 2026.3.19-9 → 2026.3.20-10

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 (331) hide show
  1. package/CHANGELOG.md +182 -0
  2. package/DEMO_GUIDE.md +1 -1
  3. package/INSTALL.md +53 -13
  4. package/README.md +106 -23
  5. package/VERSION +1 -1
  6. package/apps/local-console/dist/apps/local-console/src/server.d.ts +180 -14
  7. package/apps/local-console/dist/apps/local-console/src/server.js +1499 -267
  8. package/apps/local-console/dist/config/silicaclaw-defaults.json +19 -0
  9. package/apps/local-console/dist/packages/core/src/index.d.ts +2 -0
  10. package/apps/local-console/dist/packages/core/src/index.js +2 -0
  11. package/apps/local-console/dist/packages/core/src/privateCrypto.d.ts +17 -0
  12. package/apps/local-console/dist/packages/core/src/privateCrypto.js +40 -0
  13. package/apps/local-console/dist/packages/core/src/privateMessage.d.ts +23 -0
  14. package/apps/local-console/dist/packages/core/src/privateMessage.js +74 -0
  15. package/apps/local-console/dist/packages/core/src/profile.js +2 -0
  16. package/apps/local-console/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
  17. package/apps/local-console/dist/packages/core/src/publicProfileSummary.js +3 -0
  18. package/apps/local-console/dist/packages/core/src/socialConfig.js +9 -5
  19. package/apps/local-console/dist/packages/core/src/types.d.ts +40 -0
  20. package/apps/local-console/dist/packages/network/src/realPreview.js +6 -2
  21. package/apps/local-console/dist/packages/network/src/relayPreview.d.ts +12 -0
  22. package/apps/local-console/dist/packages/network/src/relayPreview.js +116 -10
  23. package/apps/local-console/dist/packages/network/src/transport/udpLanBroadcastTransport.js +2 -1
  24. package/apps/local-console/dist/packages/network/src/types.d.ts +4 -0
  25. package/apps/local-console/dist/packages/network/src/webrtcPreview.js +5 -1
  26. package/apps/local-console/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
  27. package/apps/local-console/dist/packages/storage/src/repos.d.ts +13 -1
  28. package/apps/local-console/dist/packages/storage/src/repos.js +19 -1
  29. package/apps/local-console/dist/packages/storage/src/socialRuntimeRepo.js +8 -4
  30. package/apps/local-console/public/app/app.js +486 -12
  31. package/apps/local-console/public/app/events.js +61 -2
  32. package/apps/local-console/public/app/network.js +176 -35
  33. package/apps/local-console/public/app/overview.js +75 -53
  34. package/apps/local-console/public/app/shell.js +18 -34
  35. package/apps/local-console/public/app/social.js +495 -93
  36. package/apps/local-console/public/app/styles.css +309 -15
  37. package/apps/local-console/public/app/template.js +182 -51
  38. package/apps/local-console/public/app/translations.js +476 -266
  39. package/apps/local-console/src/server.ts +1669 -271
  40. package/apps/public-explorer/dist/apps/public-explorer/src/server.d.ts +1 -0
  41. package/apps/public-explorer/dist/apps/public-explorer/src/server.js +41 -0
  42. package/apps/public-explorer/dist/config/silicaclaw-defaults.json +19 -0
  43. package/apps/public-explorer/public/app/app.js +22 -2
  44. package/apps/public-explorer/public/app/template.js +4 -4
  45. package/apps/public-explorer/public/app/translations.js +29 -29
  46. package/apps/public-explorer/src/server.ts +11 -1
  47. package/config/silicaclaw-defaults.json +19 -0
  48. package/dist/apps/local-console/src/server.d.ts +1 -0
  49. package/dist/apps/local-console/src/server.js +555 -0
  50. package/docs/NEW_USER_INSTALL.md +14 -10
  51. package/docs/NEW_USER_OPERATIONS.md +9 -9
  52. package/docs/OPENCLAW_BRIDGE.md +22 -7
  53. package/docs/OPENCLAW_BRIDGE_ZH.md +21 -6
  54. package/docs/RELEASE_CHECKLIST.md +95 -0
  55. package/node_modules/@silicaclaw/core/dist/config/silicaclaw-defaults.json +19 -0
  56. package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.d.ts +6 -0
  57. package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.js +50 -0
  58. package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.d.ts +17 -0
  59. package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.js +145 -0
  60. package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.d.ts +2 -0
  61. package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.js +18 -0
  62. package/node_modules/@silicaclaw/core/dist/packages/core/src/index.d.ts +14 -0
  63. package/node_modules/@silicaclaw/core/dist/packages/core/src/index.js +30 -0
  64. package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.d.ts +6 -0
  65. package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.js +43 -0
  66. package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.d.ts +4 -0
  67. package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.js +23 -0
  68. package/node_modules/@silicaclaw/core/dist/packages/core/src/privateCrypto.d.ts +17 -0
  69. package/node_modules/@silicaclaw/core/dist/packages/core/src/privateCrypto.js +40 -0
  70. package/node_modules/@silicaclaw/core/dist/packages/core/src/privateMessage.d.ts +23 -0
  71. package/node_modules/@silicaclaw/core/dist/packages/core/src/privateMessage.js +74 -0
  72. package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.d.ts +4 -0
  73. package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.js +41 -0
  74. package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
  75. package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.js +106 -0
  76. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.d.ts +100 -0
  77. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.js +300 -0
  78. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.d.ts +19 -0
  79. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.js +69 -0
  80. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.d.ts +46 -0
  81. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.js +237 -0
  82. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
  83. package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.js +90 -0
  84. package/node_modules/@silicaclaw/core/dist/packages/core/src/types.d.ts +99 -0
  85. package/node_modules/@silicaclaw/core/dist/packages/core/src/types.js +2 -0
  86. package/node_modules/@silicaclaw/core/src/index.ts +2 -0
  87. package/node_modules/@silicaclaw/core/src/privateCrypto.ts +57 -0
  88. package/node_modules/@silicaclaw/core/src/privateMessage.ts +101 -0
  89. package/node_modules/@silicaclaw/core/src/profile.ts +2 -0
  90. package/node_modules/@silicaclaw/core/src/publicProfileSummary.ts +7 -0
  91. package/node_modules/@silicaclaw/core/src/socialConfig.ts +7 -5
  92. package/node_modules/@silicaclaw/core/src/types.ts +44 -0
  93. package/node_modules/@silicaclaw/network/dist/config/silicaclaw-defaults.json +19 -0
  94. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
  95. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
  96. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
  97. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
  98. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
  99. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
  100. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
  101. package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.js +2 -0
  102. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
  103. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
  104. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
  105. package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
  106. package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
  107. package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
  108. package/node_modules/@silicaclaw/network/dist/packages/network/src/index.d.ts +14 -0
  109. package/node_modules/@silicaclaw/network/dist/packages/network/src/index.js +30 -0
  110. package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.d.ts +9 -0
  111. package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.js +47 -0
  112. package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.d.ts +8 -0
  113. package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.js +24 -0
  114. package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.d.ts +105 -0
  115. package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.js +331 -0
  116. package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.d.ts +178 -0
  117. package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.js +548 -0
  118. package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
  119. package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
  120. package/node_modules/@silicaclaw/network/dist/packages/network/src/types.d.ts +10 -0
  121. package/node_modules/@silicaclaw/network/dist/packages/network/src/types.js +2 -0
  122. package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
  123. package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.js +848 -0
  124. package/node_modules/@silicaclaw/network/src/realPreview.ts +3 -2
  125. package/node_modules/@silicaclaw/network/src/relayPreview.ts +125 -12
  126. package/node_modules/@silicaclaw/network/src/transport/udpLanBroadcastTransport.ts +2 -1
  127. package/node_modules/@silicaclaw/network/src/types.ts +2 -0
  128. package/node_modules/@silicaclaw/network/src/webrtcPreview.ts +2 -1
  129. package/node_modules/@silicaclaw/storage/config/silicaclaw-defaults.json +19 -0
  130. package/node_modules/@silicaclaw/storage/dist/config/silicaclaw-defaults.json +19 -0
  131. package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.d.ts +6 -0
  132. package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.js +50 -0
  133. package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.d.ts +17 -0
  134. package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.js +145 -0
  135. package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.d.ts +2 -0
  136. package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.js +18 -0
  137. package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.d.ts +14 -0
  138. package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.js +30 -0
  139. package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.d.ts +6 -0
  140. package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.js +43 -0
  141. package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.d.ts +4 -0
  142. package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.js +23 -0
  143. package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateCrypto.d.ts +17 -0
  144. package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateCrypto.js +40 -0
  145. package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateMessage.d.ts +23 -0
  146. package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateMessage.js +74 -0
  147. package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.d.ts +4 -0
  148. package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.js +41 -0
  149. package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
  150. package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.js +106 -0
  151. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
  152. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.js +300 -0
  153. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
  154. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.js +69 -0
  155. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
  156. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.js +237 -0
  157. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
  158. package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.js +90 -0
  159. package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.d.ts +99 -0
  160. package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.js +2 -0
  161. package/node_modules/@silicaclaw/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
  162. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.d.ts +3 -0
  163. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.js +19 -0
  164. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
  165. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.js +29 -0
  166. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.d.ts +73 -0
  167. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.js +85 -0
  168. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
  169. package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
  170. package/node_modules/@silicaclaw/storage/dist/socialRuntimeRepo.js +8 -4
  171. package/node_modules/@silicaclaw/storage/src/repos.ts +31 -1
  172. package/node_modules/@silicaclaw/storage/src/socialRuntimeRepo.ts +5 -4
  173. package/node_modules/@silicaclaw/storage/tsconfig.json +1 -6
  174. package/openclaw-skills/silicaclaw-bridge-setup/SKILL.md +165 -0
  175. package/openclaw-skills/silicaclaw-bridge-setup/VERSION +1 -0
  176. package/openclaw-skills/silicaclaw-bridge-setup/agents/openai.yaml +6 -0
  177. package/openclaw-skills/silicaclaw-bridge-setup/manifest.json +27 -0
  178. package/openclaw-skills/silicaclaw-bridge-setup/references/owner-dialogue-cheatsheet-zh.md +58 -0
  179. package/openclaw-skills/silicaclaw-bridge-setup/references/runtime-setup.md +43 -0
  180. package/openclaw-skills/silicaclaw-bridge-setup/references/troubleshooting.md +24 -0
  181. package/openclaw-skills/silicaclaw-broadcast/SKILL.md +150 -0
  182. package/openclaw-skills/silicaclaw-broadcast/VERSION +1 -1
  183. package/openclaw-skills/silicaclaw-broadcast/agents/openai.yaml +2 -2
  184. package/openclaw-skills/silicaclaw-broadcast/manifest.json +4 -3
  185. package/openclaw-skills/silicaclaw-broadcast/references/owner-dialogue-cheatsheet-zh.md +81 -0
  186. package/openclaw-skills/silicaclaw-network-config/SKILL.md +158 -0
  187. package/openclaw-skills/silicaclaw-network-config/VERSION +1 -0
  188. package/openclaw-skills/silicaclaw-network-config/agents/openai.yaml +6 -0
  189. package/openclaw-skills/silicaclaw-network-config/manifest.json +27 -0
  190. package/openclaw-skills/silicaclaw-network-config/references/network-modes.md +22 -0
  191. package/openclaw-skills/silicaclaw-network-config/references/owner-dialogue-cheatsheet-zh.md +47 -0
  192. package/openclaw-skills/silicaclaw-network-config/references/public-discovery.md +22 -0
  193. package/openclaw-skills/silicaclaw-owner-push/SKILL.md +235 -0
  194. package/openclaw-skills/silicaclaw-owner-push/VERSION +1 -0
  195. package/openclaw-skills/silicaclaw-owner-push/agents/openai.yaml +6 -0
  196. package/openclaw-skills/silicaclaw-owner-push/manifest.json +30 -0
  197. package/openclaw-skills/silicaclaw-owner-push/references/owner-dialogue-cheatsheet-zh.md +87 -0
  198. package/openclaw-skills/silicaclaw-owner-push/references/push-routing-policy.md +43 -0
  199. package/openclaw-skills/silicaclaw-owner-push/references/runtime-setup.md +44 -0
  200. package/openclaw-skills/silicaclaw-owner-push/scripts/owner-push-forwarder.mjs +356 -0
  201. package/openclaw-skills/silicaclaw-owner-push/scripts/send-to-owner-via-openclaw.mjs +69 -0
  202. package/package.json +5 -1
  203. package/packages/core/dist/config/silicaclaw-defaults.json +19 -0
  204. package/packages/core/dist/packages/core/src/crypto.d.ts +6 -0
  205. package/packages/core/dist/packages/core/src/crypto.js +50 -0
  206. package/packages/core/dist/packages/core/src/directory.d.ts +17 -0
  207. package/packages/core/dist/packages/core/src/directory.js +145 -0
  208. package/packages/core/dist/packages/core/src/identity.d.ts +2 -0
  209. package/packages/core/dist/packages/core/src/identity.js +18 -0
  210. package/packages/core/dist/packages/core/src/index.d.ts +14 -0
  211. package/packages/core/dist/packages/core/src/index.js +30 -0
  212. package/packages/core/dist/packages/core/src/indexing.d.ts +6 -0
  213. package/packages/core/dist/packages/core/src/indexing.js +43 -0
  214. package/packages/core/dist/packages/core/src/presence.d.ts +4 -0
  215. package/packages/core/dist/packages/core/src/presence.js +23 -0
  216. package/packages/core/dist/packages/core/src/privateCrypto.d.ts +17 -0
  217. package/packages/core/dist/packages/core/src/privateCrypto.js +40 -0
  218. package/packages/core/dist/packages/core/src/privateMessage.d.ts +23 -0
  219. package/packages/core/dist/packages/core/src/privateMessage.js +74 -0
  220. package/packages/core/dist/packages/core/src/profile.d.ts +4 -0
  221. package/packages/core/dist/packages/core/src/profile.js +41 -0
  222. package/packages/core/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
  223. package/packages/core/dist/packages/core/src/publicProfileSummary.js +106 -0
  224. package/packages/core/dist/packages/core/src/socialConfig.d.ts +100 -0
  225. package/packages/core/dist/packages/core/src/socialConfig.js +300 -0
  226. package/packages/core/dist/packages/core/src/socialMessage.d.ts +19 -0
  227. package/packages/core/dist/packages/core/src/socialMessage.js +69 -0
  228. package/packages/core/dist/packages/core/src/socialResolver.d.ts +46 -0
  229. package/packages/core/dist/packages/core/src/socialResolver.js +237 -0
  230. package/packages/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
  231. package/packages/core/dist/packages/core/src/socialTemplate.js +90 -0
  232. package/packages/core/dist/packages/core/src/types.d.ts +99 -0
  233. package/packages/core/dist/packages/core/src/types.js +2 -0
  234. package/packages/core/src/index.ts +2 -0
  235. package/packages/core/src/privateCrypto.ts +57 -0
  236. package/packages/core/src/privateMessage.ts +101 -0
  237. package/packages/core/src/profile.ts +2 -0
  238. package/packages/core/src/publicProfileSummary.ts +7 -0
  239. package/packages/core/src/socialConfig.ts +7 -5
  240. package/packages/core/src/types.ts +44 -0
  241. package/packages/network/dist/config/silicaclaw-defaults.json +19 -0
  242. package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
  243. package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
  244. package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
  245. package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
  246. package/packages/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
  247. package/packages/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
  248. package/packages/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
  249. package/packages/network/dist/packages/network/src/abstractions/transport.js +2 -0
  250. package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
  251. package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
  252. package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
  253. package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
  254. package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
  255. package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
  256. package/packages/network/dist/packages/network/src/index.d.ts +14 -0
  257. package/packages/network/dist/packages/network/src/index.js +30 -0
  258. package/packages/network/dist/packages/network/src/localEventBus.d.ts +9 -0
  259. package/packages/network/dist/packages/network/src/localEventBus.js +47 -0
  260. package/packages/network/dist/packages/network/src/mock.d.ts +8 -0
  261. package/packages/network/dist/packages/network/src/mock.js +24 -0
  262. package/packages/network/dist/packages/network/src/realPreview.d.ts +105 -0
  263. package/packages/network/dist/packages/network/src/realPreview.js +331 -0
  264. package/packages/network/dist/packages/network/src/relayPreview.d.ts +178 -0
  265. package/packages/network/dist/packages/network/src/relayPreview.js +548 -0
  266. package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
  267. package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
  268. package/packages/network/dist/packages/network/src/types.d.ts +10 -0
  269. package/packages/network/dist/packages/network/src/types.js +2 -0
  270. package/packages/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
  271. package/packages/network/dist/packages/network/src/webrtcPreview.js +848 -0
  272. package/packages/network/src/realPreview.ts +3 -2
  273. package/packages/network/src/relayPreview.ts +125 -12
  274. package/packages/network/src/transport/udpLanBroadcastTransport.ts +2 -1
  275. package/packages/network/src/types.ts +2 -0
  276. package/packages/network/src/webrtcPreview.ts +2 -1
  277. package/packages/storage/config/silicaclaw-defaults.json +19 -0
  278. package/packages/storage/dist/config/silicaclaw-defaults.json +19 -0
  279. package/packages/storage/dist/packages/core/src/crypto.d.ts +6 -0
  280. package/packages/storage/dist/packages/core/src/crypto.js +50 -0
  281. package/packages/storage/dist/packages/core/src/directory.d.ts +17 -0
  282. package/packages/storage/dist/packages/core/src/directory.js +145 -0
  283. package/packages/storage/dist/packages/core/src/identity.d.ts +2 -0
  284. package/packages/storage/dist/packages/core/src/identity.js +18 -0
  285. package/packages/storage/dist/packages/core/src/index.d.ts +14 -0
  286. package/packages/storage/dist/packages/core/src/index.js +30 -0
  287. package/packages/storage/dist/packages/core/src/indexing.d.ts +6 -0
  288. package/packages/storage/dist/packages/core/src/indexing.js +43 -0
  289. package/packages/storage/dist/packages/core/src/presence.d.ts +4 -0
  290. package/packages/storage/dist/packages/core/src/presence.js +23 -0
  291. package/packages/storage/dist/packages/core/src/privateCrypto.d.ts +17 -0
  292. package/packages/storage/dist/packages/core/src/privateCrypto.js +40 -0
  293. package/packages/storage/dist/packages/core/src/privateMessage.d.ts +23 -0
  294. package/packages/storage/dist/packages/core/src/privateMessage.js +74 -0
  295. package/packages/storage/dist/packages/core/src/profile.d.ts +4 -0
  296. package/packages/storage/dist/packages/core/src/profile.js +41 -0
  297. package/packages/storage/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
  298. package/packages/storage/dist/packages/core/src/publicProfileSummary.js +106 -0
  299. package/packages/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
  300. package/packages/storage/dist/packages/core/src/socialConfig.js +300 -0
  301. package/packages/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
  302. package/packages/storage/dist/packages/core/src/socialMessage.js +69 -0
  303. package/packages/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
  304. package/packages/storage/dist/packages/core/src/socialResolver.js +237 -0
  305. package/packages/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
  306. package/packages/storage/dist/packages/core/src/socialTemplate.js +90 -0
  307. package/packages/storage/dist/packages/core/src/types.d.ts +99 -0
  308. package/packages/storage/dist/packages/core/src/types.js +2 -0
  309. package/packages/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
  310. package/packages/storage/dist/packages/storage/src/index.d.ts +3 -0
  311. package/packages/storage/dist/packages/storage/src/index.js +19 -0
  312. package/packages/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
  313. package/packages/storage/dist/packages/storage/src/jsonRepo.js +29 -0
  314. package/packages/storage/dist/packages/storage/src/repos.d.ts +73 -0
  315. package/packages/storage/dist/packages/storage/src/repos.js +85 -0
  316. package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
  317. package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
  318. package/packages/storage/dist/socialRuntimeRepo.js +8 -4
  319. package/packages/storage/src/repos.ts +31 -1
  320. package/packages/storage/src/socialRuntimeRepo.ts +5 -4
  321. package/packages/storage/tsconfig.json +1 -6
  322. package/scripts/functional-check.mjs +35 -6
  323. package/scripts/install-openclaw-skill.mjs +9 -2
  324. package/scripts/openclaw-bridge-adapter.mjs +3 -1
  325. package/scripts/openclaw-bridge-client.mjs +3 -1
  326. package/scripts/openclaw-runtime-demo.mjs +3 -1
  327. package/scripts/quickstart.sh +14 -10
  328. package/scripts/release-pack.mjs +59 -1
  329. package/scripts/silicaclaw-cli.mjs +166 -51
  330. package/scripts/silicaclaw-gateway.mjs +410 -84
  331. package/scripts/validate-openclaw-skill.mjs +98 -21
@@ -0,0 +1,300 @@
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.parseFrontmatterObject = parseFrontmatterObject;
7
+ exports.extractFrontmatter = extractFrontmatter;
8
+ exports.normalizeSocialConfig = normalizeSocialConfig;
9
+ exports.getDefaultSocialConfig = getDefaultSocialConfig;
10
+ exports.generateDefaultSocialMdTemplate = generateDefaultSocialMdTemplate;
11
+ const silicaclaw_defaults_json_1 = __importDefault(require("../../../config/silicaclaw-defaults.json"));
12
+ const DEFAULT_SOCIAL_CONFIG = {
13
+ enabled: true,
14
+ public_enabled: false,
15
+ identity: {
16
+ display_name: "",
17
+ bio: "",
18
+ avatar_url: "",
19
+ tags: [],
20
+ },
21
+ network: {
22
+ mode: silicaclaw_defaults_json_1.default.network.default_mode,
23
+ namespace: silicaclaw_defaults_json_1.default.network.default_namespace,
24
+ adapter: "relay-preview",
25
+ port: silicaclaw_defaults_json_1.default.ports.network_default,
26
+ signaling_url: silicaclaw_defaults_json_1.default.network.global_preview.relay_url,
27
+ signaling_urls: [],
28
+ room: silicaclaw_defaults_json_1.default.network.global_preview.room,
29
+ seed_peers: [],
30
+ bootstrap_hints: [],
31
+ },
32
+ discovery: {
33
+ discoverable: true,
34
+ allow_profile_broadcast: true,
35
+ allow_presence_broadcast: true,
36
+ allow_message_broadcast: true,
37
+ },
38
+ visibility: {
39
+ show_display_name: true,
40
+ show_bio: true,
41
+ show_tags: true,
42
+ show_agent_id: true,
43
+ show_last_seen: true,
44
+ show_capabilities_summary: true,
45
+ },
46
+ openclaw: {
47
+ bind_existing_identity: true,
48
+ use_openclaw_profile_if_available: true,
49
+ },
50
+ };
51
+ function parseScalar(value) {
52
+ const trimmed = value.trim();
53
+ if (trimmed === "[]")
54
+ return [];
55
+ if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
56
+ const inner = trimmed.slice(1, -1).trim();
57
+ if (!inner)
58
+ return [];
59
+ return inner
60
+ .split(",")
61
+ .map((item) => item.trim())
62
+ .map((item) => (item.startsWith('"') && item.endsWith('"')) || (item.startsWith("'") && item.endsWith("'"))
63
+ ? item.slice(1, -1)
64
+ : item)
65
+ .filter(Boolean);
66
+ }
67
+ if (trimmed === "true")
68
+ return true;
69
+ if (trimmed === "false")
70
+ return false;
71
+ if (trimmed === "null")
72
+ return null;
73
+ if (/^-?\d+(\.\d+)?$/.test(trimmed))
74
+ return Number(trimmed);
75
+ if ((trimmed.startsWith('"') && trimmed.endsWith('"')) ||
76
+ (trimmed.startsWith("'") && trimmed.endsWith("'"))) {
77
+ return trimmed.slice(1, -1);
78
+ }
79
+ return trimmed;
80
+ }
81
+ function countIndent(line) {
82
+ let count = 0;
83
+ while (count < line.length && line[count] === " ")
84
+ count += 1;
85
+ return count;
86
+ }
87
+ function findNextSignificantLine(lines, start) {
88
+ for (let i = start; i < lines.length; i += 1) {
89
+ const raw = lines[i];
90
+ const trimmed = raw.trim();
91
+ if (!trimmed || trimmed.startsWith("#"))
92
+ continue;
93
+ return { line: trimmed, indent: countIndent(raw) };
94
+ }
95
+ return null;
96
+ }
97
+ function parseFrontmatterObject(frontmatter) {
98
+ const root = {};
99
+ const lines = frontmatter.replace(/\r\n/g, "\n").split("\n");
100
+ const stack = [{ indent: -1, value: root, kind: "object" }];
101
+ for (let i = 0; i < lines.length; i += 1) {
102
+ const raw = lines[i];
103
+ const trimmed = raw.trim();
104
+ if (!trimmed || trimmed.startsWith("#"))
105
+ continue;
106
+ const indent = countIndent(raw);
107
+ while (stack.length > 1 && indent <= stack[stack.length - 1].indent) {
108
+ stack.pop();
109
+ }
110
+ const current = stack[stack.length - 1];
111
+ if (trimmed.startsWith("- ")) {
112
+ if (current.kind !== "array") {
113
+ continue;
114
+ }
115
+ const itemRaw = trimmed.slice(2).trim();
116
+ if (!itemRaw) {
117
+ const child = {};
118
+ current.value.push(child);
119
+ stack.push({ indent, value: child, kind: "object" });
120
+ continue;
121
+ }
122
+ const keyValue = itemRaw.match(/^([A-Za-z0-9_]+):\s*(.*)$/);
123
+ if (keyValue) {
124
+ const child = {};
125
+ const key = keyValue[1];
126
+ const valueRaw = keyValue[2];
127
+ child[key] = valueRaw ? parseScalar(valueRaw) : "";
128
+ current.value.push(child);
129
+ continue;
130
+ }
131
+ current.value.push(parseScalar(itemRaw));
132
+ continue;
133
+ }
134
+ const match = trimmed.match(/^([A-Za-z0-9_]+):\s*(.*)$/);
135
+ if (!match || current.kind !== "object") {
136
+ continue;
137
+ }
138
+ const key = match[1];
139
+ const valueRaw = match[2];
140
+ const obj = current.value;
141
+ if (valueRaw) {
142
+ obj[key] = parseScalar(valueRaw);
143
+ continue;
144
+ }
145
+ const next = findNextSignificantLine(lines, i + 1);
146
+ const nextIsArray = Boolean(next && next.indent > indent && next.line.startsWith("- "));
147
+ if (nextIsArray) {
148
+ const arr = [];
149
+ obj[key] = arr;
150
+ stack.push({ indent, value: arr, kind: "array" });
151
+ continue;
152
+ }
153
+ const childObj = {};
154
+ obj[key] = childObj;
155
+ stack.push({ indent, value: childObj, kind: "object" });
156
+ }
157
+ return root;
158
+ }
159
+ function extractFrontmatter(content) {
160
+ const normalized = content.replace(/\r\n/g, "\n");
161
+ if (!normalized.startsWith("---\n")) {
162
+ return null;
163
+ }
164
+ const end = normalized.indexOf("\n---", 4);
165
+ if (end < 0) {
166
+ return null;
167
+ }
168
+ return normalized.slice(4, end).trim();
169
+ }
170
+ function asObject(value) {
171
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
172
+ return value;
173
+ }
174
+ return {};
175
+ }
176
+ function asBool(value, fallback) {
177
+ return typeof value === "boolean" ? value : fallback;
178
+ }
179
+ function asString(value, fallback) {
180
+ return typeof value === "string" ? value : fallback;
181
+ }
182
+ function asNumber(value, fallback) {
183
+ return Number.isFinite(value) ? Number(value) : fallback;
184
+ }
185
+ function asStringArray(value, fallback) {
186
+ if (!Array.isArray(value))
187
+ return fallback;
188
+ return value.map((item) => String(item).trim()).filter(Boolean);
189
+ }
190
+ function asAdapter(value, fallback) {
191
+ if (value === "mock" ||
192
+ value === "local-event-bus" ||
193
+ value === "real-preview" ||
194
+ value === "webrtc-preview" ||
195
+ value === "relay-preview") {
196
+ return value;
197
+ }
198
+ return fallback;
199
+ }
200
+ function asMode(value, fallback) {
201
+ if (value === "local" || value === "lan" || value === "global-preview") {
202
+ return value;
203
+ }
204
+ return fallback;
205
+ }
206
+ function adapterForMode(mode) {
207
+ if (mode === "local")
208
+ return "local-event-bus";
209
+ if (mode === "lan")
210
+ return "real-preview";
211
+ return "relay-preview";
212
+ }
213
+ function normalizeSocialConfig(input) {
214
+ const root = asObject(input);
215
+ const identity = asObject(root.identity);
216
+ const network = asObject(root.network);
217
+ const discovery = asObject(root.discovery);
218
+ const visibility = asObject(root.visibility);
219
+ const openclaw = asObject(root.openclaw);
220
+ const signalingUrl = asString(network.signaling_url, DEFAULT_SOCIAL_CONFIG.network.signaling_url);
221
+ const signalingUrls = asStringArray(network.signaling_urls, DEFAULT_SOCIAL_CONFIG.network.signaling_urls);
222
+ const mode = asMode(network.mode, DEFAULT_SOCIAL_CONFIG.network.mode);
223
+ return {
224
+ enabled: asBool(root.enabled, DEFAULT_SOCIAL_CONFIG.enabled),
225
+ public_enabled: asBool(root.public_enabled, DEFAULT_SOCIAL_CONFIG.public_enabled),
226
+ identity: {
227
+ display_name: asString(identity.display_name, DEFAULT_SOCIAL_CONFIG.identity.display_name),
228
+ bio: asString(identity.bio, DEFAULT_SOCIAL_CONFIG.identity.bio),
229
+ avatar_url: asString(identity.avatar_url, DEFAULT_SOCIAL_CONFIG.identity.avatar_url),
230
+ tags: asStringArray(identity.tags, DEFAULT_SOCIAL_CONFIG.identity.tags),
231
+ },
232
+ network: {
233
+ mode,
234
+ namespace: asString(network.namespace, DEFAULT_SOCIAL_CONFIG.network.namespace),
235
+ adapter: asAdapter(network.adapter, adapterForMode(mode)),
236
+ port: asNumber(network.port, DEFAULT_SOCIAL_CONFIG.network.port),
237
+ signaling_url: signalingUrl,
238
+ signaling_urls: signalingUrls.length > 0 ? signalingUrls : signalingUrl ? [signalingUrl] : [],
239
+ room: asString(network.room, DEFAULT_SOCIAL_CONFIG.network.room),
240
+ seed_peers: asStringArray(network.seed_peers, DEFAULT_SOCIAL_CONFIG.network.seed_peers),
241
+ bootstrap_hints: asStringArray(network.bootstrap_hints, DEFAULT_SOCIAL_CONFIG.network.bootstrap_hints),
242
+ },
243
+ discovery: {
244
+ discoverable: asBool(discovery.discoverable, DEFAULT_SOCIAL_CONFIG.discovery.discoverable),
245
+ allow_profile_broadcast: asBool(discovery.allow_profile_broadcast, DEFAULT_SOCIAL_CONFIG.discovery.allow_profile_broadcast),
246
+ allow_presence_broadcast: asBool(discovery.allow_presence_broadcast, DEFAULT_SOCIAL_CONFIG.discovery.allow_presence_broadcast),
247
+ allow_message_broadcast: asBool(discovery.allow_message_broadcast, DEFAULT_SOCIAL_CONFIG.discovery.allow_message_broadcast),
248
+ },
249
+ visibility: {
250
+ show_display_name: asBool(visibility.show_display_name, DEFAULT_SOCIAL_CONFIG.visibility.show_display_name),
251
+ show_bio: asBool(visibility.show_bio, DEFAULT_SOCIAL_CONFIG.visibility.show_bio),
252
+ show_tags: asBool(visibility.show_tags, DEFAULT_SOCIAL_CONFIG.visibility.show_tags),
253
+ show_agent_id: asBool(visibility.show_agent_id, DEFAULT_SOCIAL_CONFIG.visibility.show_agent_id),
254
+ show_last_seen: asBool(visibility.show_last_seen, DEFAULT_SOCIAL_CONFIG.visibility.show_last_seen),
255
+ show_capabilities_summary: asBool(visibility.show_capabilities_summary, DEFAULT_SOCIAL_CONFIG.visibility.show_capabilities_summary),
256
+ },
257
+ openclaw: {
258
+ bind_existing_identity: asBool(openclaw.bind_existing_identity, DEFAULT_SOCIAL_CONFIG.openclaw.bind_existing_identity),
259
+ use_openclaw_profile_if_available: asBool(openclaw.use_openclaw_profile_if_available, DEFAULT_SOCIAL_CONFIG.openclaw.use_openclaw_profile_if_available),
260
+ },
261
+ };
262
+ }
263
+ function getDefaultSocialConfig() {
264
+ return JSON.parse(JSON.stringify(DEFAULT_SOCIAL_CONFIG));
265
+ }
266
+ function generateDefaultSocialMdTemplate(options = {}) {
267
+ const displayName = options.display_name?.trim() || "My OpenClaw Agent";
268
+ const bio = options.bio?.trim() || "Local AI agent running on this machine";
269
+ const tags = Array.isArray(options.tags) && options.tags.length > 0 ? options.tags : ["openclaw", "local-first"];
270
+ const mode = options.mode ?? "global-preview";
271
+ const publicEnabled = typeof options.public_enabled === "boolean" ? options.public_enabled : false;
272
+ return `---
273
+ enabled: true
274
+ public_enabled: ${publicEnabled}
275
+
276
+ identity:
277
+ display_name: ${JSON.stringify(displayName)}
278
+ bio: ${JSON.stringify(bio)}
279
+ tags:
280
+ ${tags.map((tag) => ` - ${tag}`).join("\n")}
281
+
282
+ network:
283
+ mode: ${JSON.stringify(mode)}
284
+
285
+ discovery:
286
+ discoverable: true
287
+ allow_profile_broadcast: true
288
+ allow_presence_broadcast: true
289
+ allow_message_broadcast: true
290
+
291
+ openclaw:
292
+ bind_existing_identity: true
293
+ use_openclaw_profile_if_available: true
294
+ ---
295
+
296
+ # social.md
297
+
298
+ This file configures how OpenClaw integrates with SilicaClaw.
299
+ `;
300
+ }
@@ -0,0 +1,19 @@
1
+ import { AgentIdentity, SocialMessageObservationRecord, SocialMessageRecord } from "./types";
2
+ export declare function signSocialMessage(input: {
3
+ identity: AgentIdentity;
4
+ message_id: string;
5
+ display_name: string;
6
+ topic: string;
7
+ body: string;
8
+ created_at?: number;
9
+ }): SocialMessageRecord;
10
+ export declare function verifySocialMessage(record: SocialMessageRecord): boolean;
11
+ export declare function signSocialMessageObservation(input: {
12
+ identity: AgentIdentity;
13
+ observation_id: string;
14
+ message_id: string;
15
+ observed_agent_id: string;
16
+ observer_display_name: string;
17
+ observed_at?: number;
18
+ }): SocialMessageObservationRecord;
19
+ export declare function verifySocialMessageObservation(record: SocialMessageObservationRecord): boolean;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signSocialMessage = signSocialMessage;
4
+ exports.verifySocialMessage = verifySocialMessage;
5
+ exports.signSocialMessageObservation = signSocialMessageObservation;
6
+ exports.verifySocialMessageObservation = verifySocialMessageObservation;
7
+ const crypto_1 = require("./crypto");
8
+ function unsignedSocialMessage(record) {
9
+ const { signature: _signature, ...rest } = record;
10
+ return rest;
11
+ }
12
+ function signSocialMessage(input) {
13
+ const payload = {
14
+ type: "social.message",
15
+ message_id: input.message_id,
16
+ agent_id: input.identity.agent_id,
17
+ public_key: input.identity.public_key,
18
+ display_name: input.display_name,
19
+ topic: input.topic,
20
+ body: input.body,
21
+ created_at: input.created_at ?? Date.now(),
22
+ };
23
+ return {
24
+ ...payload,
25
+ signature: (0, crypto_1.signPayload)(payload, input.identity.private_key),
26
+ };
27
+ }
28
+ function verifySocialMessage(record) {
29
+ try {
30
+ if ((0, crypto_1.hashPublicKey)((0, crypto_1.fromBase64)(record.public_key)) !== record.agent_id) {
31
+ return false;
32
+ }
33
+ return (0, crypto_1.verifyPayload)(unsignedSocialMessage(record), record.signature, record.public_key);
34
+ }
35
+ catch {
36
+ return false;
37
+ }
38
+ }
39
+ function unsignedSocialMessageObservation(record) {
40
+ const { signature: _signature, ...rest } = record;
41
+ return rest;
42
+ }
43
+ function signSocialMessageObservation(input) {
44
+ const payload = {
45
+ type: "social.message.observation",
46
+ observation_id: input.observation_id,
47
+ message_id: input.message_id,
48
+ observed_agent_id: input.observed_agent_id,
49
+ observer_agent_id: input.identity.agent_id,
50
+ observer_public_key: input.identity.public_key,
51
+ observer_display_name: input.observer_display_name,
52
+ observed_at: input.observed_at ?? Date.now(),
53
+ };
54
+ return {
55
+ ...payload,
56
+ signature: (0, crypto_1.signPayload)(payload, input.identity.private_key),
57
+ };
58
+ }
59
+ function verifySocialMessageObservation(record) {
60
+ try {
61
+ if ((0, crypto_1.hashPublicKey)((0, crypto_1.fromBase64)(record.observer_public_key)) !== record.observer_agent_id) {
62
+ return false;
63
+ }
64
+ return (0, crypto_1.verifyPayload)(unsignedSocialMessageObservation(record), record.signature, record.observer_public_key);
65
+ }
66
+ catch {
67
+ return false;
68
+ }
69
+ }
@@ -0,0 +1,46 @@
1
+ import { AgentIdentity, ProfileInput, PublicProfile } from "./types";
2
+ import { DefaultSocialTemplateOptions, SocialConfig, SocialLoadMeta } from "./socialConfig";
3
+ export type SocialFileLookup = {
4
+ found: boolean;
5
+ source_path: string | null;
6
+ content: string | null;
7
+ };
8
+ export type OpenClawIdentityLookup = {
9
+ identity: AgentIdentity | null;
10
+ source_path: string | null;
11
+ };
12
+ export type OpenClawProfileLookup = {
13
+ profile: Partial<PublicProfile> | null;
14
+ source_path: string | null;
15
+ };
16
+ export type LoadedSocialConfig = {
17
+ config: SocialConfig;
18
+ meta: SocialLoadMeta;
19
+ raw_frontmatter: Record<string, unknown> | null;
20
+ };
21
+ export type ResolvedIdentityResult = {
22
+ identity: AgentIdentity;
23
+ source: "silicaclaw-existing" | "openclaw-existing" | "silicaclaw-generated";
24
+ openclaw_source_path: string | null;
25
+ };
26
+ export declare function getSocialConfigSearchPaths(rootDir?: string, homeDir?: string): string[];
27
+ export declare function findSocialMd(rootDir?: string): SocialFileLookup;
28
+ export declare function loadSocialConfig(rootDir?: string): LoadedSocialConfig;
29
+ export declare function findOpenClawIdentity(rootDir?: string, homeDir?: string): OpenClawIdentityLookup;
30
+ export declare function findOpenClawProfile(rootDir?: string, homeDir?: string): OpenClawProfileLookup;
31
+ export declare function resolveIdentityWithSocial(args: {
32
+ socialConfig: SocialConfig;
33
+ existingIdentity: AgentIdentity | null;
34
+ generatedIdentity: AgentIdentity;
35
+ rootDir?: string;
36
+ }): ResolvedIdentityResult;
37
+ export declare function resolveProfileInputWithSocial(args: {
38
+ socialConfig: SocialConfig;
39
+ agentId: string;
40
+ existingProfile: PublicProfile | null;
41
+ rootDir?: string;
42
+ }): ProfileInput;
43
+ export declare function ensureDefaultSocialMd(rootDir?: string, options?: DefaultSocialTemplateOptions): {
44
+ path: string;
45
+ created: boolean;
46
+ };
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSocialConfigSearchPaths = getSocialConfigSearchPaths;
4
+ exports.findSocialMd = findSocialMd;
5
+ exports.loadSocialConfig = loadSocialConfig;
6
+ exports.findOpenClawIdentity = findOpenClawIdentity;
7
+ exports.findOpenClawProfile = findOpenClawProfile;
8
+ exports.resolveIdentityWithSocial = resolveIdentityWithSocial;
9
+ exports.resolveProfileInputWithSocial = resolveProfileInputWithSocial;
10
+ exports.ensureDefaultSocialMd = ensureDefaultSocialMd;
11
+ const fs_1 = require("fs");
12
+ const os_1 = require("os");
13
+ const path_1 = require("path");
14
+ const crypto_1 = require("./crypto");
15
+ const socialConfig_1 = require("./socialConfig");
16
+ function getSocialConfigSearchPaths(rootDir = process.cwd(), homeDir = (0, os_1.homedir)()) {
17
+ return [
18
+ (0, path_1.resolve)(rootDir, "social.md"),
19
+ (0, path_1.resolve)(rootDir, ".openclaw", "social.md"),
20
+ (0, path_1.resolve)(homeDir, ".openclaw", "social.md"),
21
+ ];
22
+ }
23
+ function findSocialMd(rootDir = process.cwd()) {
24
+ const candidates = getSocialConfigSearchPaths(rootDir);
25
+ for (const path of candidates) {
26
+ if (!(0, fs_1.existsSync)(path))
27
+ continue;
28
+ return {
29
+ found: true,
30
+ source_path: path,
31
+ content: (0, fs_1.readFileSync)(path, "utf8"),
32
+ };
33
+ }
34
+ return {
35
+ found: false,
36
+ source_path: null,
37
+ content: null,
38
+ };
39
+ }
40
+ function loadSocialConfig(rootDir = process.cwd()) {
41
+ const lookup = findSocialMd(rootDir);
42
+ if (!lookup.found || !lookup.content || !lookup.source_path) {
43
+ return {
44
+ config: (0, socialConfig_1.normalizeSocialConfig)({}),
45
+ meta: {
46
+ found: false,
47
+ source_path: null,
48
+ parse_error: null,
49
+ loaded_at: Date.now(),
50
+ },
51
+ raw_frontmatter: null,
52
+ };
53
+ }
54
+ try {
55
+ const frontmatter = (0, socialConfig_1.extractFrontmatter)(lookup.content);
56
+ if (!frontmatter) {
57
+ return {
58
+ config: (0, socialConfig_1.normalizeSocialConfig)({}),
59
+ meta: {
60
+ found: true,
61
+ source_path: lookup.source_path,
62
+ parse_error: "frontmatter_not_found",
63
+ loaded_at: Date.now(),
64
+ },
65
+ raw_frontmatter: null,
66
+ };
67
+ }
68
+ const parsed = (0, socialConfig_1.parseFrontmatterObject)(frontmatter);
69
+ return {
70
+ config: (0, socialConfig_1.normalizeSocialConfig)(parsed),
71
+ meta: {
72
+ found: true,
73
+ source_path: lookup.source_path,
74
+ parse_error: null,
75
+ loaded_at: Date.now(),
76
+ },
77
+ raw_frontmatter: parsed,
78
+ };
79
+ }
80
+ catch (error) {
81
+ return {
82
+ config: (0, socialConfig_1.normalizeSocialConfig)({}),
83
+ meta: {
84
+ found: true,
85
+ source_path: lookup.source_path,
86
+ parse_error: error instanceof Error ? error.message : "social_parse_failed",
87
+ loaded_at: Date.now(),
88
+ },
89
+ raw_frontmatter: null,
90
+ };
91
+ }
92
+ }
93
+ function readJson(path) {
94
+ if (!(0, fs_1.existsSync)(path))
95
+ return null;
96
+ try {
97
+ return JSON.parse((0, fs_1.readFileSync)(path, "utf8"));
98
+ }
99
+ catch {
100
+ return null;
101
+ }
102
+ }
103
+ function normalizeIdentity(input) {
104
+ if (typeof input !== "object" || input === null) {
105
+ return null;
106
+ }
107
+ const value = input;
108
+ if (typeof value.public_key !== "string" || typeof value.private_key !== "string") {
109
+ return null;
110
+ }
111
+ let agentId = typeof value.agent_id === "string" ? value.agent_id : "";
112
+ if (!agentId) {
113
+ try {
114
+ agentId = (0, crypto_1.hashPublicKey)((0, crypto_1.fromBase64)(value.public_key));
115
+ }
116
+ catch {
117
+ return null;
118
+ }
119
+ }
120
+ return {
121
+ agent_id: agentId,
122
+ public_key: value.public_key,
123
+ private_key: value.private_key,
124
+ created_at: Number.isFinite(value.created_at) ? Number(value.created_at) : Date.now(),
125
+ };
126
+ }
127
+ function findOpenClawIdentity(rootDir = process.cwd(), homeDir = (0, os_1.homedir)()) {
128
+ const candidates = [
129
+ (0, path_1.resolve)(rootDir, ".openclaw", "identity.json"),
130
+ (0, path_1.resolve)(rootDir, "identity.json"),
131
+ (0, path_1.resolve)(homeDir, ".openclaw", "identity.json"),
132
+ ];
133
+ for (const path of candidates) {
134
+ const parsed = readJson(path);
135
+ const identity = normalizeIdentity(parsed);
136
+ if (identity) {
137
+ return {
138
+ identity,
139
+ source_path: path,
140
+ };
141
+ }
142
+ }
143
+ return {
144
+ identity: null,
145
+ source_path: null,
146
+ };
147
+ }
148
+ function findOpenClawProfile(rootDir = process.cwd(), homeDir = (0, os_1.homedir)()) {
149
+ const candidates = [
150
+ (0, path_1.resolve)(rootDir, ".openclaw", "profile.json"),
151
+ (0, path_1.resolve)(rootDir, "profile.json"),
152
+ (0, path_1.resolve)(homeDir, ".openclaw", "profile.json"),
153
+ ];
154
+ for (const path of candidates) {
155
+ const parsed = readJson(path);
156
+ if (typeof parsed !== "object" || parsed === null)
157
+ continue;
158
+ const profile = parsed;
159
+ return {
160
+ source_path: path,
161
+ profile: {
162
+ display_name: typeof profile.display_name === "string" ? profile.display_name : "",
163
+ bio: typeof profile.bio === "string" ? profile.bio : "",
164
+ avatar_url: typeof profile.avatar_url === "string" ? profile.avatar_url : "",
165
+ tags: Array.isArray(profile.tags)
166
+ ? profile.tags.map((tag) => String(tag).trim()).filter(Boolean)
167
+ : [],
168
+ },
169
+ };
170
+ }
171
+ return {
172
+ profile: null,
173
+ source_path: null,
174
+ };
175
+ }
176
+ function resolveIdentityWithSocial(args) {
177
+ const { socialConfig, existingIdentity, generatedIdentity } = args;
178
+ if (socialConfig.openclaw.bind_existing_identity) {
179
+ const openclaw = findOpenClawIdentity(args.rootDir ?? process.cwd());
180
+ if (openclaw.identity) {
181
+ return {
182
+ identity: openclaw.identity,
183
+ source: "openclaw-existing",
184
+ openclaw_source_path: openclaw.source_path,
185
+ };
186
+ }
187
+ }
188
+ if (existingIdentity) {
189
+ return {
190
+ identity: existingIdentity,
191
+ source: "silicaclaw-existing",
192
+ openclaw_source_path: null,
193
+ };
194
+ }
195
+ return {
196
+ identity: generatedIdentity,
197
+ source: "silicaclaw-generated",
198
+ openclaw_source_path: null,
199
+ };
200
+ }
201
+ function resolveProfileInputWithSocial(args) {
202
+ const { socialConfig, agentId, existingProfile } = args;
203
+ const openclawProfile = socialConfig.openclaw.use_openclaw_profile_if_available
204
+ ? findOpenClawProfile(args.rootDir ?? process.cwd()).profile
205
+ : null;
206
+ const baseDisplayName = existingProfile?.display_name || "";
207
+ const baseBio = existingProfile?.bio || "";
208
+ const baseAvatarUrl = existingProfile?.avatar_url || "";
209
+ const baseTags = existingProfile?.tags || [];
210
+ // Preserve values saved from local-console first; only fall back to social/openclaw defaults
211
+ // when local profile fields are empty.
212
+ const displayName = baseDisplayName || socialConfig.identity.display_name || openclawProfile?.display_name || "";
213
+ const bio = baseBio || socialConfig.identity.bio || openclawProfile?.bio || "";
214
+ const avatarUrl = baseAvatarUrl || socialConfig.identity.avatar_url || openclawProfile?.avatar_url || "";
215
+ const tags = baseTags.length > 0
216
+ ? baseTags
217
+ : socialConfig.identity.tags.length > 0
218
+ ? socialConfig.identity.tags
219
+ : openclawProfile?.tags || [];
220
+ return {
221
+ agent_id: agentId,
222
+ display_name: displayName,
223
+ bio,
224
+ avatar_url: avatarUrl,
225
+ tags,
226
+ public_enabled: existingProfile?.public_enabled ?? socialConfig.public_enabled,
227
+ };
228
+ }
229
+ function ensureDefaultSocialMd(rootDir = process.cwd(), options = {}) {
230
+ const targetPath = (0, path_1.resolve)(rootDir, "social.md");
231
+ if ((0, fs_1.existsSync)(targetPath)) {
232
+ return { path: targetPath, created: false };
233
+ }
234
+ (0, fs_1.mkdirSync)(rootDir, { recursive: true });
235
+ (0, fs_1.writeFileSync)(targetPath, (0, socialConfig_1.generateDefaultSocialMdTemplate)(options), "utf8");
236
+ return { path: targetPath, created: true };
237
+ }
@@ -0,0 +1,2 @@
1
+ import { SocialRuntimeConfig } from "./socialConfig";
2
+ export declare function generateSocialMdTemplate(runtimeConfig: SocialRuntimeConfig | null | undefined): string;