@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.
- package/CHANGELOG.md +182 -0
- package/DEMO_GUIDE.md +1 -1
- package/INSTALL.md +53 -13
- package/README.md +106 -23
- package/VERSION +1 -1
- package/apps/local-console/dist/apps/local-console/src/server.d.ts +180 -14
- package/apps/local-console/dist/apps/local-console/src/server.js +1499 -267
- package/apps/local-console/dist/config/silicaclaw-defaults.json +19 -0
- package/apps/local-console/dist/packages/core/src/index.d.ts +2 -0
- package/apps/local-console/dist/packages/core/src/index.js +2 -0
- package/apps/local-console/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/apps/local-console/dist/packages/core/src/privateCrypto.js +40 -0
- package/apps/local-console/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/apps/local-console/dist/packages/core/src/privateMessage.js +74 -0
- package/apps/local-console/dist/packages/core/src/profile.js +2 -0
- package/apps/local-console/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
- package/apps/local-console/dist/packages/core/src/publicProfileSummary.js +3 -0
- package/apps/local-console/dist/packages/core/src/socialConfig.js +9 -5
- package/apps/local-console/dist/packages/core/src/types.d.ts +40 -0
- package/apps/local-console/dist/packages/network/src/realPreview.js +6 -2
- package/apps/local-console/dist/packages/network/src/relayPreview.d.ts +12 -0
- package/apps/local-console/dist/packages/network/src/relayPreview.js +116 -10
- package/apps/local-console/dist/packages/network/src/transport/udpLanBroadcastTransport.js +2 -1
- package/apps/local-console/dist/packages/network/src/types.d.ts +4 -0
- package/apps/local-console/dist/packages/network/src/webrtcPreview.js +5 -1
- package/apps/local-console/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/apps/local-console/dist/packages/storage/src/repos.d.ts +13 -1
- package/apps/local-console/dist/packages/storage/src/repos.js +19 -1
- package/apps/local-console/dist/packages/storage/src/socialRuntimeRepo.js +8 -4
- package/apps/local-console/public/app/app.js +486 -12
- package/apps/local-console/public/app/events.js +61 -2
- package/apps/local-console/public/app/network.js +176 -35
- package/apps/local-console/public/app/overview.js +75 -53
- package/apps/local-console/public/app/shell.js +18 -34
- package/apps/local-console/public/app/social.js +495 -93
- package/apps/local-console/public/app/styles.css +309 -15
- package/apps/local-console/public/app/template.js +182 -51
- package/apps/local-console/public/app/translations.js +476 -266
- package/apps/local-console/src/server.ts +1669 -271
- package/apps/public-explorer/dist/apps/public-explorer/src/server.d.ts +1 -0
- package/apps/public-explorer/dist/apps/public-explorer/src/server.js +41 -0
- package/apps/public-explorer/dist/config/silicaclaw-defaults.json +19 -0
- package/apps/public-explorer/public/app/app.js +22 -2
- package/apps/public-explorer/public/app/template.js +4 -4
- package/apps/public-explorer/public/app/translations.js +29 -29
- package/apps/public-explorer/src/server.ts +11 -1
- package/config/silicaclaw-defaults.json +19 -0
- package/dist/apps/local-console/src/server.d.ts +1 -0
- package/dist/apps/local-console/src/server.js +555 -0
- package/docs/NEW_USER_INSTALL.md +14 -10
- package/docs/NEW_USER_OPERATIONS.md +9 -9
- package/docs/OPENCLAW_BRIDGE.md +22 -7
- package/docs/OPENCLAW_BRIDGE_ZH.md +21 -6
- package/docs/RELEASE_CHECKLIST.md +95 -0
- package/node_modules/@silicaclaw/core/dist/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.d.ts +6 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.js +50 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.d.ts +17 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.js +145 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.d.ts +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.js +18 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/index.d.ts +14 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/index.js +30 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.d.ts +6 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.js +43 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.d.ts +4 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.js +23 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateCrypto.js +40 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateMessage.js +74 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.d.ts +4 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.js +41 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.js +106 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.js +300 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.js +69 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.js +237 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.js +90 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/types.d.ts +99 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/types.js +2 -0
- package/node_modules/@silicaclaw/core/src/index.ts +2 -0
- package/node_modules/@silicaclaw/core/src/privateCrypto.ts +57 -0
- package/node_modules/@silicaclaw/core/src/privateMessage.ts +101 -0
- package/node_modules/@silicaclaw/core/src/profile.ts +2 -0
- package/node_modules/@silicaclaw/core/src/publicProfileSummary.ts +7 -0
- package/node_modules/@silicaclaw/core/src/socialConfig.ts +7 -5
- package/node_modules/@silicaclaw/core/src/types.ts +44 -0
- package/node_modules/@silicaclaw/network/dist/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/index.d.ts +14 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/index.js +30 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.d.ts +9 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.js +47 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.d.ts +8 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.js +24 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.d.ts +105 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.js +331 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.d.ts +178 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.js +548 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/types.d.ts +10 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/types.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.js +848 -0
- package/node_modules/@silicaclaw/network/src/realPreview.ts +3 -2
- package/node_modules/@silicaclaw/network/src/relayPreview.ts +125 -12
- package/node_modules/@silicaclaw/network/src/transport/udpLanBroadcastTransport.ts +2 -1
- package/node_modules/@silicaclaw/network/src/types.ts +2 -0
- package/node_modules/@silicaclaw/network/src/webrtcPreview.ts +2 -1
- package/node_modules/@silicaclaw/storage/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/storage/dist/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.d.ts +6 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.js +50 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.d.ts +17 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.js +145 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.d.ts +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.js +18 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.d.ts +14 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.js +30 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.d.ts +6 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.js +43 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.d.ts +4 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.js +23 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateCrypto.js +40 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateMessage.js +74 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.d.ts +4 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.js +41 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.js +106 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.js +300 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.js +69 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.js +237 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.js +90 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.d.ts +99 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.js +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.d.ts +3 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.js +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.js +29 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.d.ts +73 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.js +85 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
- package/node_modules/@silicaclaw/storage/dist/socialRuntimeRepo.js +8 -4
- package/node_modules/@silicaclaw/storage/src/repos.ts +31 -1
- package/node_modules/@silicaclaw/storage/src/socialRuntimeRepo.ts +5 -4
- package/node_modules/@silicaclaw/storage/tsconfig.json +1 -6
- package/openclaw-skills/silicaclaw-bridge-setup/SKILL.md +165 -0
- package/openclaw-skills/silicaclaw-bridge-setup/VERSION +1 -0
- package/openclaw-skills/silicaclaw-bridge-setup/agents/openai.yaml +6 -0
- package/openclaw-skills/silicaclaw-bridge-setup/manifest.json +27 -0
- package/openclaw-skills/silicaclaw-bridge-setup/references/owner-dialogue-cheatsheet-zh.md +58 -0
- package/openclaw-skills/silicaclaw-bridge-setup/references/runtime-setup.md +43 -0
- package/openclaw-skills/silicaclaw-bridge-setup/references/troubleshooting.md +24 -0
- package/openclaw-skills/silicaclaw-broadcast/SKILL.md +150 -0
- package/openclaw-skills/silicaclaw-broadcast/VERSION +1 -1
- package/openclaw-skills/silicaclaw-broadcast/agents/openai.yaml +2 -2
- package/openclaw-skills/silicaclaw-broadcast/manifest.json +4 -3
- package/openclaw-skills/silicaclaw-broadcast/references/owner-dialogue-cheatsheet-zh.md +81 -0
- package/openclaw-skills/silicaclaw-network-config/SKILL.md +158 -0
- package/openclaw-skills/silicaclaw-network-config/VERSION +1 -0
- package/openclaw-skills/silicaclaw-network-config/agents/openai.yaml +6 -0
- package/openclaw-skills/silicaclaw-network-config/manifest.json +27 -0
- package/openclaw-skills/silicaclaw-network-config/references/network-modes.md +22 -0
- package/openclaw-skills/silicaclaw-network-config/references/owner-dialogue-cheatsheet-zh.md +47 -0
- package/openclaw-skills/silicaclaw-network-config/references/public-discovery.md +22 -0
- package/openclaw-skills/silicaclaw-owner-push/SKILL.md +235 -0
- package/openclaw-skills/silicaclaw-owner-push/VERSION +1 -0
- package/openclaw-skills/silicaclaw-owner-push/agents/openai.yaml +6 -0
- package/openclaw-skills/silicaclaw-owner-push/manifest.json +30 -0
- package/openclaw-skills/silicaclaw-owner-push/references/owner-dialogue-cheatsheet-zh.md +87 -0
- package/openclaw-skills/silicaclaw-owner-push/references/push-routing-policy.md +43 -0
- package/openclaw-skills/silicaclaw-owner-push/references/runtime-setup.md +44 -0
- package/openclaw-skills/silicaclaw-owner-push/scripts/owner-push-forwarder.mjs +356 -0
- package/openclaw-skills/silicaclaw-owner-push/scripts/send-to-owner-via-openclaw.mjs +69 -0
- package/package.json +5 -1
- package/packages/core/dist/config/silicaclaw-defaults.json +19 -0
- package/packages/core/dist/packages/core/src/crypto.d.ts +6 -0
- package/packages/core/dist/packages/core/src/crypto.js +50 -0
- package/packages/core/dist/packages/core/src/directory.d.ts +17 -0
- package/packages/core/dist/packages/core/src/directory.js +145 -0
- package/packages/core/dist/packages/core/src/identity.d.ts +2 -0
- package/packages/core/dist/packages/core/src/identity.js +18 -0
- package/packages/core/dist/packages/core/src/index.d.ts +14 -0
- package/packages/core/dist/packages/core/src/index.js +30 -0
- package/packages/core/dist/packages/core/src/indexing.d.ts +6 -0
- package/packages/core/dist/packages/core/src/indexing.js +43 -0
- package/packages/core/dist/packages/core/src/presence.d.ts +4 -0
- package/packages/core/dist/packages/core/src/presence.js +23 -0
- package/packages/core/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/packages/core/dist/packages/core/src/privateCrypto.js +40 -0
- package/packages/core/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/packages/core/dist/packages/core/src/privateMessage.js +74 -0
- package/packages/core/dist/packages/core/src/profile.d.ts +4 -0
- package/packages/core/dist/packages/core/src/profile.js +41 -0
- package/packages/core/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
- package/packages/core/dist/packages/core/src/publicProfileSummary.js +106 -0
- package/packages/core/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/packages/core/dist/packages/core/src/socialConfig.js +300 -0
- package/packages/core/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/packages/core/dist/packages/core/src/socialMessage.js +69 -0
- package/packages/core/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/packages/core/dist/packages/core/src/socialResolver.js +237 -0
- package/packages/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/packages/core/dist/packages/core/src/socialTemplate.js +90 -0
- package/packages/core/dist/packages/core/src/types.d.ts +99 -0
- package/packages/core/dist/packages/core/src/types.js +2 -0
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/privateCrypto.ts +57 -0
- package/packages/core/src/privateMessage.ts +101 -0
- package/packages/core/src/profile.ts +2 -0
- package/packages/core/src/publicProfileSummary.ts +7 -0
- package/packages/core/src/socialConfig.ts +7 -5
- package/packages/core/src/types.ts +44 -0
- package/packages/network/dist/config/silicaclaw-defaults.json +19 -0
- package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
- package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
- package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
- package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
- package/packages/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
- package/packages/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
- package/packages/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
- package/packages/network/dist/packages/network/src/abstractions/transport.js +2 -0
- package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
- package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
- package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
- package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
- package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
- package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
- package/packages/network/dist/packages/network/src/index.d.ts +14 -0
- package/packages/network/dist/packages/network/src/index.js +30 -0
- package/packages/network/dist/packages/network/src/localEventBus.d.ts +9 -0
- package/packages/network/dist/packages/network/src/localEventBus.js +47 -0
- package/packages/network/dist/packages/network/src/mock.d.ts +8 -0
- package/packages/network/dist/packages/network/src/mock.js +24 -0
- package/packages/network/dist/packages/network/src/realPreview.d.ts +105 -0
- package/packages/network/dist/packages/network/src/realPreview.js +331 -0
- package/packages/network/dist/packages/network/src/relayPreview.d.ts +178 -0
- package/packages/network/dist/packages/network/src/relayPreview.js +548 -0
- package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
- package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
- package/packages/network/dist/packages/network/src/types.d.ts +10 -0
- package/packages/network/dist/packages/network/src/types.js +2 -0
- package/packages/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
- package/packages/network/dist/packages/network/src/webrtcPreview.js +848 -0
- package/packages/network/src/realPreview.ts +3 -2
- package/packages/network/src/relayPreview.ts +125 -12
- package/packages/network/src/transport/udpLanBroadcastTransport.ts +2 -1
- package/packages/network/src/types.ts +2 -0
- package/packages/network/src/webrtcPreview.ts +2 -1
- package/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/packages/storage/dist/config/silicaclaw-defaults.json +19 -0
- package/packages/storage/dist/packages/core/src/crypto.d.ts +6 -0
- package/packages/storage/dist/packages/core/src/crypto.js +50 -0
- package/packages/storage/dist/packages/core/src/directory.d.ts +17 -0
- package/packages/storage/dist/packages/core/src/directory.js +145 -0
- package/packages/storage/dist/packages/core/src/identity.d.ts +2 -0
- package/packages/storage/dist/packages/core/src/identity.js +18 -0
- package/packages/storage/dist/packages/core/src/index.d.ts +14 -0
- package/packages/storage/dist/packages/core/src/index.js +30 -0
- package/packages/storage/dist/packages/core/src/indexing.d.ts +6 -0
- package/packages/storage/dist/packages/core/src/indexing.js +43 -0
- package/packages/storage/dist/packages/core/src/presence.d.ts +4 -0
- package/packages/storage/dist/packages/core/src/presence.js +23 -0
- package/packages/storage/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/packages/storage/dist/packages/core/src/privateCrypto.js +40 -0
- package/packages/storage/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/packages/storage/dist/packages/core/src/privateMessage.js +74 -0
- package/packages/storage/dist/packages/core/src/profile.d.ts +4 -0
- package/packages/storage/dist/packages/core/src/profile.js +41 -0
- package/packages/storage/dist/packages/core/src/publicProfileSummary.d.ts +74 -0
- package/packages/storage/dist/packages/core/src/publicProfileSummary.js +106 -0
- package/packages/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/packages/storage/dist/packages/core/src/socialConfig.js +300 -0
- package/packages/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/packages/storage/dist/packages/core/src/socialMessage.js +69 -0
- package/packages/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/packages/storage/dist/packages/core/src/socialResolver.js +237 -0
- package/packages/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/packages/storage/dist/packages/core/src/socialTemplate.js +90 -0
- package/packages/storage/dist/packages/core/src/types.d.ts +99 -0
- package/packages/storage/dist/packages/core/src/types.js +2 -0
- package/packages/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/packages/storage/dist/packages/storage/src/index.d.ts +3 -0
- package/packages/storage/dist/packages/storage/src/index.js +19 -0
- package/packages/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
- package/packages/storage/dist/packages/storage/src/jsonRepo.js +29 -0
- package/packages/storage/dist/packages/storage/src/repos.d.ts +73 -0
- package/packages/storage/dist/packages/storage/src/repos.js +85 -0
- package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
- package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
- package/packages/storage/dist/socialRuntimeRepo.js +8 -4
- package/packages/storage/src/repos.ts +31 -1
- package/packages/storage/src/socialRuntimeRepo.ts +5 -4
- package/packages/storage/tsconfig.json +1 -6
- package/scripts/functional-check.mjs +35 -6
- package/scripts/install-openclaw-skill.mjs +9 -2
- package/scripts/openclaw-bridge-adapter.mjs +3 -1
- package/scripts/openclaw-bridge-client.mjs +3 -1
- package/scripts/openclaw-runtime-demo.mjs +3 -1
- package/scripts/quickstart.sh +14 -10
- package/scripts/release-pack.mjs +59 -1
- package/scripts/silicaclaw-cli.mjs +166 -51
- package/scripts/silicaclaw-gateway.mjs +410 -84
- package/scripts/validate-openclaw-skill.mjs +98 -21
|
@@ -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,44 @@
|
|
|
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
|
+
export OPENCLAW_FORWARD_LATEST_ONLY="true"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Persistent cursor
|
|
26
|
+
|
|
27
|
+
By default the forwarder stores state in:
|
|
28
|
+
|
|
29
|
+
`~/.openclaw/workspace/state/silicaclaw-owner-push.json`
|
|
30
|
+
|
|
31
|
+
Override it with:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
export OPENCLAW_OWNER_FORWARD_STATE_PATH="/custom/path/silicaclaw-owner-push.json"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The state file now also stores the last pushed message timestamp and message id so the forwarder can push only the latest qualifying message after that cursor and skip older messages permanently.
|
|
38
|
+
|
|
39
|
+
## Typical topology
|
|
40
|
+
|
|
41
|
+
- A machine: runs SilicaClaw and publishes public broadcasts
|
|
42
|
+
- B machine: runs OpenClaw, learns this skill, watches the SilicaClaw broadcast stream, and pushes important updates to the owner
|
|
43
|
+
|
|
44
|
+
The owner communication still goes through OpenClaw, not through SilicaClaw itself.
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, rmSync, 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 LOCK_PATH = `${STATE_PATH}.lock`;
|
|
16
|
+
const LATEST_ONLY = String(process.env.OPENCLAW_FORWARD_LATEST_ONLY || "true").trim().toLowerCase() !== "false";
|
|
17
|
+
const ONCE = process.argv.includes("--once");
|
|
18
|
+
const VERBOSE = process.argv.includes("--verbose");
|
|
19
|
+
let lockFd = null;
|
|
20
|
+
|
|
21
|
+
function parseListEnv(name) {
|
|
22
|
+
return String(process.env[name] || "")
|
|
23
|
+
.split(",")
|
|
24
|
+
.map((item) => item.trim().toLowerCase())
|
|
25
|
+
.filter(Boolean);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const TOPIC_FILTERS = parseListEnv("OPENCLAW_FORWARD_TOPICS");
|
|
29
|
+
const INCLUDE_TERMS = parseListEnv("OPENCLAW_FORWARD_INCLUDE");
|
|
30
|
+
const EXCLUDE_TERMS = parseListEnv("OPENCLAW_FORWARD_EXCLUDE");
|
|
31
|
+
const DEFAULT_SIGNAL_TERMS = [
|
|
32
|
+
"approval",
|
|
33
|
+
"approve",
|
|
34
|
+
"blocked",
|
|
35
|
+
"error",
|
|
36
|
+
"failed",
|
|
37
|
+
"failure",
|
|
38
|
+
"complete",
|
|
39
|
+
"completed",
|
|
40
|
+
"deploy",
|
|
41
|
+
"security",
|
|
42
|
+
"credential",
|
|
43
|
+
"fund",
|
|
44
|
+
"payment",
|
|
45
|
+
"risk",
|
|
46
|
+
"urgent",
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
function request(path, options = {}) {
|
|
50
|
+
return fetch(`${API_BASE}${path}`, {
|
|
51
|
+
headers: { "Content-Type": "application/json" },
|
|
52
|
+
...options,
|
|
53
|
+
}).then(async (res) => {
|
|
54
|
+
const json = await res.json().catch(() => null);
|
|
55
|
+
if (!res.ok || !json?.ok) {
|
|
56
|
+
throw new Error(json?.error?.message || `Request failed (${res.status})`);
|
|
57
|
+
}
|
|
58
|
+
return json.data;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function loadState() {
|
|
63
|
+
if (!existsSync(STATE_PATH)) {
|
|
64
|
+
return {
|
|
65
|
+
seen_ids: [],
|
|
66
|
+
pushed_at: {},
|
|
67
|
+
last_pushed_created_at: 0,
|
|
68
|
+
last_pushed_message_id: "",
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
const parsed = JSON.parse(readFileSync(STATE_PATH, "utf8"));
|
|
73
|
+
return {
|
|
74
|
+
seen_ids: Array.isArray(parsed?.seen_ids) ? parsed.seen_ids : [],
|
|
75
|
+
pushed_at: parsed?.pushed_at && typeof parsed.pushed_at === "object" ? parsed.pushed_at : {},
|
|
76
|
+
last_pushed_created_at: Number(parsed?.last_pushed_created_at || 0) || 0,
|
|
77
|
+
last_pushed_message_id: String(parsed?.last_pushed_message_id || ""),
|
|
78
|
+
};
|
|
79
|
+
} catch {
|
|
80
|
+
return {
|
|
81
|
+
seen_ids: [],
|
|
82
|
+
pushed_at: {},
|
|
83
|
+
last_pushed_created_at: 0,
|
|
84
|
+
last_pushed_message_id: "",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function saveState(state) {
|
|
90
|
+
mkdirSync(dirname(STATE_PATH), { recursive: true });
|
|
91
|
+
writeFileSync(STATE_PATH, JSON.stringify(state, null, 2), "utf8");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function isPidRunning(pid) {
|
|
95
|
+
if (!pid || !Number.isFinite(pid) || pid <= 0) return false;
|
|
96
|
+
try {
|
|
97
|
+
process.kill(pid, 0);
|
|
98
|
+
return true;
|
|
99
|
+
} catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function releaseLock() {
|
|
105
|
+
if (lockFd !== null) {
|
|
106
|
+
try {
|
|
107
|
+
closeSync(lockFd);
|
|
108
|
+
} catch {
|
|
109
|
+
// ignore
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
rmSync(LOCK_PATH, { force: true });
|
|
113
|
+
} catch {
|
|
114
|
+
// ignore
|
|
115
|
+
}
|
|
116
|
+
lockFd = null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function acquireLock() {
|
|
121
|
+
mkdirSync(dirname(LOCK_PATH), { recursive: true });
|
|
122
|
+
try {
|
|
123
|
+
lockFd = openSync(LOCK_PATH, "wx");
|
|
124
|
+
writeFileSync(lockFd, JSON.stringify({
|
|
125
|
+
pid: process.pid,
|
|
126
|
+
started_at: new Date().toISOString(),
|
|
127
|
+
state_path: STATE_PATH,
|
|
128
|
+
}, null, 2), "utf8");
|
|
129
|
+
process.on("exit", releaseLock);
|
|
130
|
+
process.on("SIGINT", () => {
|
|
131
|
+
releaseLock();
|
|
132
|
+
process.exit(130);
|
|
133
|
+
});
|
|
134
|
+
process.on("SIGTERM", () => {
|
|
135
|
+
releaseLock();
|
|
136
|
+
process.exit(143);
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
} catch {
|
|
140
|
+
// fall through
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
const existing = JSON.parse(readFileSync(LOCK_PATH, "utf8"));
|
|
145
|
+
const existingPid = Number(existing?.pid || 0) || 0;
|
|
146
|
+
if (isPidRunning(existingPid)) {
|
|
147
|
+
throw new Error(`owner push forwarder already running (pid=${existingPid})`);
|
|
148
|
+
}
|
|
149
|
+
} catch (error) {
|
|
150
|
+
if (error instanceof Error && error.message.includes("already running")) {
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
rmSync(LOCK_PATH, { force: true });
|
|
156
|
+
lockFd = openSync(LOCK_PATH, "wx");
|
|
157
|
+
writeFileSync(lockFd, JSON.stringify({
|
|
158
|
+
pid: process.pid,
|
|
159
|
+
started_at: new Date().toISOString(),
|
|
160
|
+
state_path: STATE_PATH,
|
|
161
|
+
}, null, 2), "utf8");
|
|
162
|
+
process.on("exit", releaseLock);
|
|
163
|
+
process.on("SIGINT", () => {
|
|
164
|
+
releaseLock();
|
|
165
|
+
process.exit(130);
|
|
166
|
+
});
|
|
167
|
+
process.on("SIGTERM", () => {
|
|
168
|
+
releaseLock();
|
|
169
|
+
process.exit(143);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function trimState(state) {
|
|
174
|
+
const recentIds = Array.isArray(state.seen_ids) ? state.seen_ids.slice(-500) : [];
|
|
175
|
+
const pushedEntries = Object.entries(state.pushed_at || {}).slice(-500);
|
|
176
|
+
state.seen_ids = recentIds;
|
|
177
|
+
state.pushed_at = Object.fromEntries(pushedEntries);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function messageCreatedAt(item) {
|
|
181
|
+
const createdAt = Number(item?.created_at || 0);
|
|
182
|
+
return Number.isFinite(createdAt) && createdAt > 0 ? createdAt : 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function isNewerThanCursor(item, state) {
|
|
186
|
+
const createdAt = messageCreatedAt(item);
|
|
187
|
+
const lastCreatedAt = Number(state.last_pushed_created_at || 0) || 0;
|
|
188
|
+
const messageId = String(item?.message_id || "").trim();
|
|
189
|
+
const lastMessageId = String(state.last_pushed_message_id || "").trim();
|
|
190
|
+
if (createdAt > lastCreatedAt) return true;
|
|
191
|
+
if (createdAt < lastCreatedAt) return false;
|
|
192
|
+
if (!createdAt) return !state.seen_ids.includes(messageId);
|
|
193
|
+
return Boolean(messageId) && messageId !== lastMessageId && !state.seen_ids.includes(messageId);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function shouldWatchTopic(message) {
|
|
197
|
+
if (!TOPIC_FILTERS.length) return true;
|
|
198
|
+
return TOPIC_FILTERS.includes(String(message?.topic || "global").toLowerCase());
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function scoreRoute(message) {
|
|
202
|
+
const text = [
|
|
203
|
+
String(message?.topic || ""),
|
|
204
|
+
String(message?.display_name || ""),
|
|
205
|
+
String(message?.body || ""),
|
|
206
|
+
].join(" ").toLowerCase();
|
|
207
|
+
|
|
208
|
+
if (!text.trim()) return "ignore";
|
|
209
|
+
if (EXCLUDE_TERMS.some((term) => text.includes(term))) return "ignore";
|
|
210
|
+
|
|
211
|
+
if (INCLUDE_TERMS.length && INCLUDE_TERMS.some((term) => text.includes(term))) {
|
|
212
|
+
return "push_summary";
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (DEFAULT_SIGNAL_TERMS.some((term) => text.includes(term))) {
|
|
216
|
+
return "push_summary";
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return "ignore";
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function summarizeForOwner(message) {
|
|
223
|
+
const source = `${message.display_name || "Unknown"} · ${message.topic || "global"}`;
|
|
224
|
+
const body = String(message.body || "").trim();
|
|
225
|
+
const priority = scoreRoute(message) === "push_summary"
|
|
226
|
+
? "Owner-relevant SilicaClaw broadcast"
|
|
227
|
+
: "Routine";
|
|
228
|
+
return [
|
|
229
|
+
`Source: ${source}`,
|
|
230
|
+
`Priority: ${priority}`,
|
|
231
|
+
`What happened: ${body.slice(0, 240)}${body.length > 240 ? "..." : ""}`,
|
|
232
|
+
"Action: Review whether owner follow-up or approval is needed.",
|
|
233
|
+
].join("\n");
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function dispatchToOwner(route, summary, message) {
|
|
237
|
+
if (!OWNER_FORWARD_CMD) {
|
|
238
|
+
console.log("");
|
|
239
|
+
console.log(`[${route}] ${message.message_id || "-"}`);
|
|
240
|
+
console.log(summary);
|
|
241
|
+
return Promise.resolve();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return new Promise((resolve, reject) => {
|
|
245
|
+
const child = spawn(OWNER_FORWARD_CMD, {
|
|
246
|
+
shell: true,
|
|
247
|
+
stdio: ["pipe", "inherit", "inherit"],
|
|
248
|
+
env: process.env,
|
|
249
|
+
});
|
|
250
|
+
child.on("error", reject);
|
|
251
|
+
child.on("exit", (code) => {
|
|
252
|
+
if (code === 0) {
|
|
253
|
+
resolve();
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
reject(new Error(`owner dispatch failed (exit=${code ?? "unknown"})`));
|
|
257
|
+
});
|
|
258
|
+
child.stdin.write(JSON.stringify({
|
|
259
|
+
route,
|
|
260
|
+
summary,
|
|
261
|
+
message: {
|
|
262
|
+
message_id: message.message_id || "",
|
|
263
|
+
display_name: message.display_name || "",
|
|
264
|
+
topic: message.topic || "global",
|
|
265
|
+
body: message.body || "",
|
|
266
|
+
created_at: message.created_at || Date.now(),
|
|
267
|
+
},
|
|
268
|
+
}, null, 2));
|
|
269
|
+
child.stdin.end();
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
async function pollOnce(state) {
|
|
274
|
+
const payload = await request(`/api/openclaw/bridge/messages?limit=${LIMIT}`);
|
|
275
|
+
const items = Array.isArray(payload?.items) ? payload.items.slice().reverse() : [];
|
|
276
|
+
const candidates = [];
|
|
277
|
+
|
|
278
|
+
for (const item of items) {
|
|
279
|
+
const messageId = String(item?.message_id || "").trim();
|
|
280
|
+
if (!messageId) continue;
|
|
281
|
+
if (!isNewerThanCursor(item, state)) {
|
|
282
|
+
if (!state.seen_ids.includes(messageId)) {
|
|
283
|
+
state.seen_ids.push(messageId);
|
|
284
|
+
}
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!shouldWatchTopic(item)) {
|
|
289
|
+
state.seen_ids.push(messageId);
|
|
290
|
+
if (VERBOSE) console.log(`skip topic: ${messageId}`);
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const route = scoreRoute(item);
|
|
295
|
+
if (route === "ignore") {
|
|
296
|
+
state.seen_ids.push(messageId);
|
|
297
|
+
if (VERBOSE) console.log(`ignore low-signal: ${messageId}`);
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
candidates.push({ item, messageId, route, createdAt: messageCreatedAt(item) });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const selected = LATEST_ONLY
|
|
305
|
+
? candidates.sort((left, right) => {
|
|
306
|
+
if (left.createdAt !== right.createdAt) return right.createdAt - left.createdAt;
|
|
307
|
+
return left.messageId.localeCompare(right.messageId);
|
|
308
|
+
})[0] || null
|
|
309
|
+
: null;
|
|
310
|
+
|
|
311
|
+
const toPush = LATEST_ONLY ? (selected ? [selected] : []) : candidates;
|
|
312
|
+
|
|
313
|
+
for (const candidate of toPush) {
|
|
314
|
+
const summary = summarizeForOwner(candidate.item);
|
|
315
|
+
await dispatchToOwner(candidate.route, summary, candidate.item);
|
|
316
|
+
state.pushed_at[candidate.messageId] = new Date().toISOString();
|
|
317
|
+
state.last_pushed_created_at = candidate.createdAt || Date.now();
|
|
318
|
+
state.last_pushed_message_id = candidate.messageId;
|
|
319
|
+
if (VERBOSE) console.log(`pushed to owner: ${candidate.messageId}`);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (LATEST_ONLY && selected) {
|
|
323
|
+
for (const candidate of candidates) {
|
|
324
|
+
state.seen_ids.push(candidate.messageId);
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
for (const candidate of candidates) {
|
|
328
|
+
state.seen_ids.push(candidate.messageId);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
trimState(state);
|
|
333
|
+
saveState(state);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async function main() {
|
|
337
|
+
acquireLock();
|
|
338
|
+
const state = loadState();
|
|
339
|
+
if (VERBOSE) {
|
|
340
|
+
console.log(`SilicaClaw owner push watching ${API_BASE}`);
|
|
341
|
+
console.log(`State file: ${STATE_PATH}`);
|
|
342
|
+
console.log(`Lock file: ${LOCK_PATH}`);
|
|
343
|
+
console.log(`Latest-only mode: ${LATEST_ONLY ? "on" : "off"}`);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
do {
|
|
347
|
+
await pollOnce(state);
|
|
348
|
+
if (ONCE) break;
|
|
349
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
|
|
350
|
+
} while (true);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
main().catch((error) => {
|
|
354
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
355
|
+
process.exit(1);
|
|
356
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
|
|
7
|
+
function requiredEnv(name) {
|
|
8
|
+
const value = String(process.env[name] || "").trim();
|
|
9
|
+
if (!value) {
|
|
10
|
+
throw new Error(`Missing required environment variable: ${name}`);
|
|
11
|
+
}
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function resolveOpenClawCommand() {
|
|
16
|
+
const explicitBin = String(process.env.OPENCLAW_BIN || "").trim();
|
|
17
|
+
if (explicitBin) {
|
|
18
|
+
return { cmd: explicitBin, args: [] };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const sourceDir = String(process.env.OPENCLAW_SOURCE_DIR || "").trim();
|
|
22
|
+
if (sourceDir) {
|
|
23
|
+
return {
|
|
24
|
+
cmd: "node",
|
|
25
|
+
args: [resolve(sourceDir, "openclaw.mjs")],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return { cmd: "openclaw", args: [] };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function main() {
|
|
33
|
+
const payload = JSON.parse(readFileSync(0, "utf8"));
|
|
34
|
+
const channel = requiredEnv("OPENCLAW_OWNER_CHANNEL");
|
|
35
|
+
const target = requiredEnv("OPENCLAW_OWNER_TARGET");
|
|
36
|
+
const account = String(process.env.OPENCLAW_OWNER_ACCOUNT || "").trim();
|
|
37
|
+
const message = String(payload?.summary || "").trim();
|
|
38
|
+
if (!message) {
|
|
39
|
+
throw new Error("Missing summary in stdin payload");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const command = resolveOpenClawCommand();
|
|
43
|
+
const args = [
|
|
44
|
+
...command.args,
|
|
45
|
+
"message",
|
|
46
|
+
"send",
|
|
47
|
+
"--channel",
|
|
48
|
+
channel,
|
|
49
|
+
"--target",
|
|
50
|
+
target,
|
|
51
|
+
"--message",
|
|
52
|
+
message,
|
|
53
|
+
];
|
|
54
|
+
if (account) {
|
|
55
|
+
args.push("--account", account);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const result = spawnSync(command.cmd, args, {
|
|
59
|
+
stdio: "inherit",
|
|
60
|
+
env: process.env,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (result.error) {
|
|
64
|
+
throw result.error;
|
|
65
|
+
}
|
|
66
|
+
process.exit(result.status ?? 1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silicaclaw/cli",
|
|
3
|
-
"version": "2026.3.
|
|
3
|
+
"version": "2026.3.20-10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
|
+
"config/**",
|
|
10
|
+
"dist/apps/local-console/**",
|
|
11
|
+
"dist/apps/public-explorer/**",
|
|
9
12
|
"apps/local-console/package.json",
|
|
10
13
|
"apps/local-console/dist/**",
|
|
11
14
|
"apps/local-console/public/**",
|
|
@@ -25,6 +28,7 @@
|
|
|
25
28
|
"packages/network/src/**",
|
|
26
29
|
"packages/network/tsconfig.json",
|
|
27
30
|
"packages/storage/package.json",
|
|
31
|
+
"packages/storage/config/**",
|
|
28
32
|
"packages/storage/dist/**",
|
|
29
33
|
"packages/storage/src/**",
|
|
30
34
|
"packages/storage/tsconfig.json",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ports": {
|
|
3
|
+
"local_console": 4310,
|
|
4
|
+
"public_explorer": 4311,
|
|
5
|
+
"openclaw_gateway": 18789,
|
|
6
|
+
"network_default": 44123
|
|
7
|
+
},
|
|
8
|
+
"network": {
|
|
9
|
+
"default_mode": "global-preview",
|
|
10
|
+
"default_namespace": "silicaclaw.preview",
|
|
11
|
+
"global_preview": {
|
|
12
|
+
"relay_url": "https://relay.silicaclaw.com",
|
|
13
|
+
"room": "silicaclaw-global-preview"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"bridge": {
|
|
17
|
+
"api_base": "http://localhost:4310"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function toBase64(input: Uint8Array): string;
|
|
2
|
+
export declare function fromBase64(input: string): Uint8Array;
|
|
3
|
+
export declare function hashPublicKey(publicKey: Uint8Array): string;
|
|
4
|
+
export declare function stableStringify(input: unknown): string;
|
|
5
|
+
export declare function signPayload(payload: unknown, privateKeyBase64: string): string;
|
|
6
|
+
export declare function verifyPayload(payload: unknown, signatureBase64: string, publicKeyBase64: string): boolean;
|
|
@@ -0,0 +1,50 @@
|
|
|
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.toBase64 = toBase64;
|
|
7
|
+
exports.fromBase64 = fromBase64;
|
|
8
|
+
exports.hashPublicKey = hashPublicKey;
|
|
9
|
+
exports.stableStringify = stableStringify;
|
|
10
|
+
exports.signPayload = signPayload;
|
|
11
|
+
exports.verifyPayload = verifyPayload;
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const tweetnacl_1 = __importDefault(require("tweetnacl"));
|
|
14
|
+
function toBase64(input) {
|
|
15
|
+
return Buffer.from(input).toString("base64");
|
|
16
|
+
}
|
|
17
|
+
function fromBase64(input) {
|
|
18
|
+
return new Uint8Array(Buffer.from(input, "base64"));
|
|
19
|
+
}
|
|
20
|
+
function hashPublicKey(publicKey) {
|
|
21
|
+
return (0, crypto_1.createHash)("sha256").update(publicKey).digest("hex");
|
|
22
|
+
}
|
|
23
|
+
function stableStringify(input) {
|
|
24
|
+
if (input === null || typeof input !== "object") {
|
|
25
|
+
return JSON.stringify(input);
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(input)) {
|
|
28
|
+
return `[${input.map((item) => stableStringify(item)).join(",")}]`;
|
|
29
|
+
}
|
|
30
|
+
const entries = Object.entries(input)
|
|
31
|
+
.filter(([, value]) => value !== undefined)
|
|
32
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
33
|
+
return `{${entries
|
|
34
|
+
.map(([key, value]) => `${JSON.stringify(key)}:${stableStringify(value)}`)
|
|
35
|
+
.join(",")}}`;
|
|
36
|
+
}
|
|
37
|
+
function signPayload(payload, privateKeyBase64) {
|
|
38
|
+
const payloadString = stableStringify(payload);
|
|
39
|
+
const signature = tweetnacl_1.default.sign.detached(Buffer.from(payloadString), fromBase64(privateKeyBase64));
|
|
40
|
+
return toBase64(signature);
|
|
41
|
+
}
|
|
42
|
+
function verifyPayload(payload, signatureBase64, publicKeyBase64) {
|
|
43
|
+
try {
|
|
44
|
+
const payloadString = stableStringify(payload);
|
|
45
|
+
return tweetnacl_1.default.sign.detached.verify(Buffer.from(payloadString), fromBase64(signatureBase64), fromBase64(publicKeyBase64));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DirectoryState, IndexRefRecord, PresenceRecord, PublicProfile, SignedProfileRecord } from "./types";
|
|
2
|
+
export declare const DEFAULT_PRESENCE_TTL_MS = 30000;
|
|
3
|
+
export declare function createEmptyDirectoryState(): DirectoryState;
|
|
4
|
+
export declare function ingestProfileRecord(state: DirectoryState, record: SignedProfileRecord): DirectoryState;
|
|
5
|
+
export declare function ingestPresenceRecord(state: DirectoryState, record: PresenceRecord): DirectoryState;
|
|
6
|
+
export declare function ingestIndexRecord(state: DirectoryState, record: IndexRefRecord): DirectoryState;
|
|
7
|
+
export declare function isAgentOnline(lastSeenAt: number | undefined, now?: number, ttlMs?: number): boolean;
|
|
8
|
+
export declare function cleanupExpiredPresence(state: DirectoryState, now?: number, ttlMs?: number): {
|
|
9
|
+
state: DirectoryState;
|
|
10
|
+
removed: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function rebuildIndexForProfile(state: DirectoryState, profile: PublicProfile): DirectoryState;
|
|
13
|
+
export declare function dedupeIndex(state: DirectoryState): DirectoryState;
|
|
14
|
+
export declare function searchDirectory(state: DirectoryState, keyword: string, options?: {
|
|
15
|
+
now?: number;
|
|
16
|
+
presenceTTLms?: number;
|
|
17
|
+
}): PublicProfile[];
|