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