@dxos/network-manager 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea
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/dist/lib/browser/{chunk-NRRQ4H6U.mjs → chunk-E3P563GT.mjs} +366 -579
- package/dist/lib/{node-esm/chunk-AX4TJ2DL.mjs.map → browser/chunk-E3P563GT.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +85 -113
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/browser/transport/tcp/index.mjs +3 -18
- package/dist/lib/browser/transport/tcp/index.mjs.map +2 -2
- package/dist/lib/node-esm/{chunk-AX4TJ2DL.mjs → chunk-PKBROUZV.mjs} +366 -579
- package/dist/lib/{browser/chunk-NRRQ4H6U.mjs.map → node-esm/chunk-PKBROUZV.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +85 -113
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/lib/node-esm/transport/tcp/index.mjs +11 -31
- package/dist/lib/node-esm/transport/tcp/index.mjs.map +2 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/swarm/connection.ts":{"bytes":57047,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"src/signal/ice.ts":{"bytes":4537,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/signal/swarm-messenger.ts":{"bytes":22770,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/signal/index.ts":{"bytes":678,"imports":[{"path":"src/signal/ice.ts","kind":"import-statement","original":"./ice"},{"path":"src/signal/swarm-messenger.ts","kind":"import-statement","original":"./swarm-messenger"}],"format":"esm"},"src/swarm/peer.ts":{"bytes":48293,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/swarm/connection.ts","kind":"import-statement","original":"./connection"}],"format":"esm"},"src/swarm/swarm.ts":{"bytes":56271,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/signal/index.ts","kind":"import-statement","original":"../signal"},{"path":"src/swarm/connection.ts","kind":"import-statement","original":"./connection"},{"path":"src/swarm/peer.ts","kind":"import-statement","original":"./peer"}],"format":"esm"},"src/swarm/swarm-mapper.ts":{"bytes":12817,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/swarm/connection-limiter.ts":{"bytes":8947,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/swarm/index.ts":{"bytes":768,"imports":[{"path":"src/swarm/connection.ts","kind":"import-statement","original":"./connection"},{"path":"src/swarm/swarm.ts","kind":"import-statement","original":"./swarm"},{"path":"src/swarm/swarm-mapper.ts","kind":"import-statement","original":"./swarm-mapper"},{"path":"src/swarm/connection-limiter.ts","kind":"import-statement","original":"./connection-limiter"}],"format":"esm"},"src/connection-log.ts":{"bytes":16606,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/swarm/index.ts","kind":"import-statement","original":"./swarm"}],"format":"esm"},"src/network-manager.ts":{"bytes":28006,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/connection-log.ts","kind":"import-statement","original":"./connection-log"},{"path":"src/swarm/index.ts","kind":"import-statement","original":"./swarm"}],"format":"esm"},"src/topology/fully-connected-topology.ts":{"bytes":3934,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/topology/mmst-topology.ts":{"bytes":20961,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/topology/star-topology.ts":{"bytes":8418,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/topology/index.ts":{"bytes":760,"imports":[{"path":"src/topology/fully-connected-topology.ts","kind":"import-statement","original":"./fully-connected-topology"},{"path":"src/topology/mmst-topology.ts","kind":"import-statement","original":"./mmst-topology"},{"path":"src/topology/star-topology.ts","kind":"import-statement","original":"./star-topology"}],"format":"esm"},"src/transport/memory-transport.ts":{"bytes":24255,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/transport/transport.ts":{"bytes":3009,"imports":[],"format":"esm"},"src/transport/webrtc/rtc-connection-factory.ts":{"bytes":9060,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"#node-datachannel","kind":"dynamic-import","external":true},{"path":"#node-datachannel/polyfill","kind":"dynamic-import","external":true}],"format":"esm"},"src/transport/webrtc/rtc-transport-stats.ts":{"bytes":7336,"imports":[],"format":"esm"},"src/transport/webrtc/rtc-transport-channel.ts":{"bytes":23522,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/transport/webrtc/rtc-transport-stats.ts","kind":"import-statement","original":"./rtc-transport-stats"}],"format":"esm"},"src/transport/webrtc/utils.ts":{"bytes":3889,"imports":[],"format":"esm"},"src/transport/webrtc/rtc-peer-connection.ts":{"bytes":64935,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"src/transport/webrtc/rtc-transport-channel.ts","kind":"import-statement","original":"./rtc-transport-channel"},{"path":"src/transport/webrtc/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/transport/webrtc/rtc-transport-factory.ts":{"bytes":3420,"imports":[{"path":"src/transport/webrtc/rtc-connection-factory.ts","kind":"import-statement","original":"./rtc-connection-factory"},{"path":"src/transport/webrtc/rtc-peer-connection.ts","kind":"import-statement","original":"./rtc-peer-connection"}],"format":"esm"},"src/transport/webrtc/rtc-transport-proxy.ts":{"bytes":29877,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/transport/webrtc/rtc-transport-service.ts":{"bytes":21850,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/codec-protobuf/stream","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/transport/webrtc/rtc-transport-factory.ts","kind":"import-statement","original":"./rtc-transport-factory"}],"format":"esm"},"src/transport/webrtc/index.ts":{"bytes":751,"imports":[{"path":"src/transport/webrtc/rtc-transport-factory.ts","kind":"import-statement","original":"./rtc-transport-factory"},{"path":"src/transport/webrtc/rtc-transport-proxy.ts","kind":"import-statement","original":"./rtc-transport-proxy"},{"path":"src/transport/webrtc/rtc-transport-service.ts","kind":"import-statement","original":"./rtc-transport-service"}],"format":"esm"},"src/transport/index.ts":{"bytes":666,"imports":[{"path":"src/transport/memory-transport.ts","kind":"import-statement","original":"./memory-transport"},{"path":"src/transport/transport.ts","kind":"import-statement","original":"./transport"},{"path":"src/transport/webrtc/index.ts","kind":"import-statement","original":"./webrtc"}],"format":"esm"},"src/wire-protocol.ts":{"bytes":4254,"imports":[{"path":"@dxos/teleport","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1071,"imports":[{"path":"src/connection-log.ts","kind":"import-statement","original":"./connection-log"},{"path":"src/network-manager.ts","kind":"import-statement","original":"./network-manager"},{"path":"src/signal/index.ts","kind":"import-statement","original":"./signal"},{"path":"src/swarm/index.ts","kind":"import-statement","original":"./swarm"},{"path":"src/topology/index.ts","kind":"import-statement","original":"./topology"},{"path":"src/transport/index.ts","kind":"import-statement","original":"./transport"},{"path":"src/wire-protocol.ts","kind":"import-statement","original":"./wire-protocol"}],"format":"esm"},"src/testing/test-wire-protocol.ts":{"bytes":13637,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/teleport","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/wire-protocol.ts","kind":"import-statement","original":"../wire-protocol"}],"format":"esm"},"src/testing/test-builder.ts":{"bytes":26934,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#tcp-transport","kind":"import-statement","external":true},{"path":"src/network-manager.ts","kind":"import-statement","original":"../network-manager"},{"path":"src/topology/index.ts","kind":"import-statement","original":"../topology"},{"path":"src/transport/index.ts","kind":"import-statement","original":"../transport"},{"path":"src/testing/test-wire-protocol.ts","kind":"import-statement","original":"./test-wire-protocol"}],"format":"esm"},"src/testing/index.ts":{"bytes":481,"imports":[{"path":"src/testing/test-builder.ts","kind":"import-statement","original":"./test-builder"}],"format":"esm"},"src/transport/tcp/tcp-transport.ts":{"bytes":15144,"imports":[{"path":"node:net","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:net","kind":"dynamic-import","external":true}],"format":"esm"},"src/transport/tcp/index.ts":{"bytes":492,"imports":[{"path":"src/transport/tcp/tcp-transport.ts","kind":"import-statement","original":"./tcp-transport"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-AX4TJ2DL.mjs","kind":"import-statement"}],"exports":["Connection","ConnectionLimiter","ConnectionLog","ConnectionState","EventType","FullyConnectedTopology","MAX_CONCURRENT_INITIATING_CONNECTIONS","MMSTTopology","MemoryTransport","MemoryTransportFactory","RtcTransportProxy","RtcTransportProxyFactory","RtcTransportService","StarTopology","Swarm","SwarmMapper","SwarmMessenger","SwarmNetworkManager","TransportKind","createIceProvider","createRtcTransportFactory","createTeleportProtocolFactory"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":1107},"dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19580},"dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-AX4TJ2DL.mjs","kind":"import-statement"},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#tcp-transport","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/teleport","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TEST_SIGNAL_HOSTS","TestBuilder","TestPeer","TestSwarmConnection"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/test-builder.ts":{"bytesInOutput":6957},"src/testing/test-wire-protocol.ts":{"bytesInOutput":3900},"src/testing/index.ts":{"bytesInOutput":0}},"bytes":11413},"dist/lib/node-esm/chunk-AX4TJ2DL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":219788},"dist/lib/node-esm/chunk-AX4TJ2DL.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"#node-datachannel","kind":"dynamic-import","external":true},{"path":"#node-datachannel/polyfill","kind":"dynamic-import","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/codec-protobuf/stream","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/teleport","kind":"import-statement","external":true}],"exports":["Connection","ConnectionLimiter","ConnectionLog","ConnectionState","EventType","FullyConnectedTopology","MAX_CONCURRENT_INITIATING_CONNECTIONS","MMSTTopology","MemoryTransport","MemoryTransportFactory","RtcTransportProxy","RtcTransportProxyFactory","RtcTransportService","StarTopology","Swarm","SwarmMapper","SwarmMessenger","SwarmNetworkManager","TransportKind","createIceProvider","createRtcTransportFactory","createTeleportProtocolFactory"],"inputs":{"src/swarm/connection.ts":{"bytesInOutput":17945},"src/signal/ice.ts":{"bytesInOutput":1085},"src/signal/swarm-messenger.ts":{"bytesInOutput":6752},"src/signal/index.ts":{"bytesInOutput":0},"src/swarm/swarm.ts":{"bytesInOutput":17392},"src/swarm/peer.ts":{"bytesInOutput":14774},"src/swarm/swarm-mapper.ts":{"bytesInOutput":2765},"src/swarm/connection-limiter.ts":{"bytesInOutput":2860},"src/swarm/index.ts":{"bytesInOutput":0},"src/connection-log.ts":{"bytesInOutput":3705},"src/network-manager.ts":{"bytesInOutput":8075},"src/topology/fully-connected-topology.ts":{"bytesInOutput":1275},"src/topology/mmst-topology.ts":{"bytesInOutput":6485},"src/topology/star-topology.ts":{"bytesInOutput":2833},"src/topology/index.ts":{"bytesInOutput":0},"src/transport/memory-transport.ts":{"bytesInOutput":6970},"src/transport/transport.ts":{"bytesInOutput":263},"src/transport/webrtc/rtc-connection-factory.ts":{"bytesInOutput":1847},"src/transport/webrtc/rtc-peer-connection.ts":{"bytesInOutput":19469},"src/transport/webrtc/rtc-transport-channel.ts":{"bytesInOutput":6742},"src/transport/webrtc/rtc-transport-stats.ts":{"bytesInOutput":1668},"src/transport/webrtc/utils.ts":{"bytesInOutput":718},"src/transport/webrtc/rtc-transport-factory.ts":{"bytesInOutput":528},"src/transport/webrtc/rtc-transport-proxy.ts":{"bytesInOutput":8488},"src/transport/webrtc/rtc-transport-service.ts":{"bytesInOutput":6392},"src/transport/index.ts":{"bytesInOutput":0},"src/transport/webrtc/index.ts":{"bytesInOutput":0},"src/wire-protocol.ts":{"bytesInOutput":537}},"bytes":141136},"dist/lib/node-esm/transport/tcp/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6910},"dist/lib/node-esm/transport/tcp/index.mjs":{"imports":[{"path":"node:net","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:net","kind":"dynamic-import","external":true}],"exports":["TcpTransport","TcpTransportFactory"],"entryPoint":"src/transport/tcp/index.ts","inputs":{"src/transport/tcp/tcp-transport.ts":{"bytesInOutput":4379},"src/transport/tcp/index.ts":{"bytesInOutput":0}},"bytes":4595}}}
|
|
1
|
+
{"inputs":{"src/swarm/connection.ts":{"bytes":55115,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"src/signal/ice.ts":{"bytes":4538,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/signal/swarm-messenger.ts":{"bytes":22177,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/signal/index.ts":{"bytes":678,"imports":[{"path":"src/signal/ice.ts","kind":"import-statement","original":"./ice"},{"path":"src/signal/swarm-messenger.ts","kind":"import-statement","original":"./swarm-messenger"}],"format":"esm"},"src/swarm/peer.ts":{"bytes":47065,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/swarm/connection.ts","kind":"import-statement","original":"./connection"}],"format":"esm"},"src/swarm/swarm.ts":{"bytes":54941,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/signal/index.ts","kind":"import-statement","original":"../signal"},{"path":"src/swarm/connection.ts","kind":"import-statement","original":"./connection"},{"path":"src/swarm/peer.ts","kind":"import-statement","original":"./peer"}],"format":"esm"},"src/swarm/swarm-mapper.ts":{"bytes":12086,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/swarm/connection-limiter.ts":{"bytes":8455,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/swarm/index.ts":{"bytes":768,"imports":[{"path":"src/swarm/connection.ts","kind":"import-statement","original":"./connection"},{"path":"src/swarm/swarm.ts","kind":"import-statement","original":"./swarm"},{"path":"src/swarm/swarm-mapper.ts","kind":"import-statement","original":"./swarm-mapper"},{"path":"src/swarm/connection-limiter.ts","kind":"import-statement","original":"./connection-limiter"}],"format":"esm"},"src/connection-log.ts":{"bytes":16208,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/swarm/index.ts","kind":"import-statement","original":"./swarm"}],"format":"esm"},"src/network-manager.ts":{"bytes":27172,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/connection-log.ts","kind":"import-statement","original":"./connection-log"},{"path":"src/swarm/index.ts","kind":"import-statement","original":"./swarm"}],"format":"esm"},"src/topology/fully-connected-topology.ts":{"bytes":3536,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/topology/mmst-topology.ts":{"bytes":20376,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/topology/star-topology.ts":{"bytes":8007,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/topology/index.ts":{"bytes":760,"imports":[{"path":"src/topology/fully-connected-topology.ts","kind":"import-statement","original":"./fully-connected-topology"},{"path":"src/topology/mmst-topology.ts","kind":"import-statement","original":"./mmst-topology"},{"path":"src/topology/star-topology.ts","kind":"import-statement","original":"./star-topology"}],"format":"esm"},"src/transport/memory-transport.ts":{"bytes":23009,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/transport/transport.ts":{"bytes":3009,"imports":[],"format":"esm"},"src/transport/webrtc/rtc-connection-factory.ts":{"bytes":8665,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"#node-datachannel","kind":"dynamic-import","external":true},{"path":"#node-datachannel/polyfill","kind":"dynamic-import","external":true}],"format":"esm"},"src/transport/webrtc/rtc-transport-stats.ts":{"bytes":7336,"imports":[],"format":"esm"},"src/transport/webrtc/rtc-transport-channel.ts":{"bytes":22671,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/transport/webrtc/rtc-transport-stats.ts","kind":"import-statement","original":"./rtc-transport-stats"}],"format":"esm"},"src/transport/webrtc/utils.ts":{"bytes":3889,"imports":[],"format":"esm"},"src/transport/webrtc/rtc-peer-connection.ts":{"bytes":63948,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"src/transport/webrtc/rtc-transport-channel.ts","kind":"import-statement","original":"./rtc-transport-channel"},{"path":"src/transport/webrtc/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/transport/webrtc/rtc-transport-factory.ts":{"bytes":3420,"imports":[{"path":"src/transport/webrtc/rtc-connection-factory.ts","kind":"import-statement","original":"./rtc-connection-factory"},{"path":"src/transport/webrtc/rtc-peer-connection.ts","kind":"import-statement","original":"./rtc-peer-connection"}],"format":"esm"},"src/transport/webrtc/rtc-transport-proxy.ts":{"bytes":29114,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/transport/webrtc/rtc-transport-service.ts":{"bytes":21401,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/codec-protobuf/stream","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/transport/webrtc/rtc-transport-factory.ts","kind":"import-statement","original":"./rtc-transport-factory"}],"format":"esm"},"src/transport/webrtc/index.ts":{"bytes":751,"imports":[{"path":"src/transport/webrtc/rtc-transport-factory.ts","kind":"import-statement","original":"./rtc-transport-factory"},{"path":"src/transport/webrtc/rtc-transport-proxy.ts","kind":"import-statement","original":"./rtc-transport-proxy"},{"path":"src/transport/webrtc/rtc-transport-service.ts","kind":"import-statement","original":"./rtc-transport-service"}],"format":"esm"},"src/transport/index.ts":{"bytes":666,"imports":[{"path":"src/transport/memory-transport.ts","kind":"import-statement","original":"./memory-transport"},{"path":"src/transport/transport.ts","kind":"import-statement","original":"./transport"},{"path":"src/transport/webrtc/index.ts","kind":"import-statement","original":"./webrtc"}],"format":"esm"},"src/wire-protocol.ts":{"bytes":4254,"imports":[{"path":"@dxos/teleport","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1071,"imports":[{"path":"src/connection-log.ts","kind":"import-statement","original":"./connection-log"},{"path":"src/network-manager.ts","kind":"import-statement","original":"./network-manager"},{"path":"src/signal/index.ts","kind":"import-statement","original":"./signal"},{"path":"src/swarm/index.ts","kind":"import-statement","original":"./swarm"},{"path":"src/topology/index.ts","kind":"import-statement","original":"./topology"},{"path":"src/transport/index.ts","kind":"import-statement","original":"./transport"},{"path":"src/wire-protocol.ts","kind":"import-statement","original":"./wire-protocol"}],"format":"esm"},"src/testing/test-wire-protocol.ts":{"bytes":12575,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/teleport","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/wire-protocol.ts","kind":"import-statement","original":"../wire-protocol"}],"format":"esm"},"src/testing/test-builder.ts":{"bytes":25936,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#tcp-transport","kind":"import-statement","external":true},{"path":"src/network-manager.ts","kind":"import-statement","original":"../network-manager"},{"path":"src/topology/index.ts","kind":"import-statement","original":"../topology"},{"path":"src/transport/index.ts","kind":"import-statement","original":"../transport"},{"path":"src/testing/test-wire-protocol.ts","kind":"import-statement","original":"./test-wire-protocol"}],"format":"esm"},"src/testing/index.ts":{"bytes":481,"imports":[{"path":"src/testing/test-builder.ts","kind":"import-statement","original":"./test-builder"}],"format":"esm"},"src/transport/tcp/tcp-transport.ts":{"bytes":14208,"imports":[{"path":"node:net","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:net","kind":"dynamic-import","external":true}],"format":"esm"},"src/transport/tcp/index.ts":{"bytes":492,"imports":[{"path":"src/transport/tcp/tcp-transport.ts","kind":"import-statement","original":"./tcp-transport"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-PKBROUZV.mjs","kind":"import-statement"}],"exports":["Connection","ConnectionLimiter","ConnectionLog","ConnectionState","EventType","FullyConnectedTopology","MAX_CONCURRENT_INITIATING_CONNECTIONS","MMSTTopology","MemoryTransport","MemoryTransportFactory","RtcTransportProxy","RtcTransportProxyFactory","RtcTransportService","StarTopology","Swarm","SwarmMapper","SwarmMessenger","SwarmNetworkManager","TransportKind","createIceProvider","createRtcTransportFactory","createTeleportProtocolFactory"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":1107},"dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19154},"dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-PKBROUZV.mjs","kind":"import-statement"},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#tcp-transport","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/teleport","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TEST_SIGNAL_HOSTS","TestBuilder","TestPeer","TestSwarmConnection"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/test-builder.ts":{"bytesInOutput":6197},"src/testing/test-wire-protocol.ts":{"bytesInOutput":3194},"src/testing/index.ts":{"bytesInOutput":0}},"bytes":9947},"dist/lib/node-esm/chunk-PKBROUZV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":216150},"dist/lib/node-esm/chunk-PKBROUZV.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/messaging","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"#node-datachannel","kind":"dynamic-import","external":true},{"path":"#node-datachannel/polyfill","kind":"dynamic-import","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true},{"path":"@dxos/codec-protobuf/stream","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/mesh/bridge","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/teleport","kind":"import-statement","external":true}],"exports":["Connection","ConnectionLimiter","ConnectionLog","ConnectionState","EventType","FullyConnectedTopology","MAX_CONCURRENT_INITIATING_CONNECTIONS","MMSTTopology","MemoryTransport","MemoryTransportFactory","RtcTransportProxy","RtcTransportProxyFactory","RtcTransportService","StarTopology","Swarm","SwarmMapper","SwarmMessenger","SwarmNetworkManager","TransportKind","createIceProvider","createRtcTransportFactory","createTeleportProtocolFactory"],"inputs":{"src/swarm/connection.ts":{"bytesInOutput":16494},"src/signal/ice.ts":{"bytesInOutput":1085},"src/signal/swarm-messenger.ts":{"bytesInOutput":6293},"src/signal/index.ts":{"bytesInOutput":0},"src/swarm/swarm.ts":{"bytesInOutput":16647},"src/swarm/peer.ts":{"bytesInOutput":13895},"src/swarm/swarm-mapper.ts":{"bytesInOutput":2233},"src/swarm/connection-limiter.ts":{"bytesInOutput":2575},"src/swarm/index.ts":{"bytesInOutput":0},"src/connection-log.ts":{"bytesInOutput":3409},"src/network-manager.ts":{"bytesInOutput":7433},"src/topology/fully-connected-topology.ts":{"bytesInOutput":967},"src/topology/mmst-topology.ts":{"bytesInOutput":6025},"src/topology/star-topology.ts":{"bytesInOutput":2507},"src/topology/index.ts":{"bytesInOutput":0},"src/transport/memory-transport.ts":{"bytesInOutput":6190},"src/transport/transport.ts":{"bytesInOutput":263},"src/transport/webrtc/rtc-connection-factory.ts":{"bytesInOutput":1521},"src/transport/webrtc/rtc-peer-connection.ts":{"bytesInOutput":19296},"src/transport/webrtc/rtc-transport-channel.ts":{"bytesInOutput":6076},"src/transport/webrtc/rtc-transport-stats.ts":{"bytesInOutput":1668},"src/transport/webrtc/utils.ts":{"bytesInOutput":718},"src/transport/webrtc/rtc-transport-factory.ts":{"bytesInOutput":528},"src/transport/webrtc/rtc-transport-proxy.ts":{"bytesInOutput":7888},"src/transport/webrtc/rtc-transport-service.ts":{"bytesInOutput":6040},"src/transport/index.ts":{"bytesInOutput":0},"src/transport/webrtc/index.ts":{"bytesInOutput":0},"src/wire-protocol.ts":{"bytesInOutput":537}},"bytes":131856},"dist/lib/node-esm/transport/tcp/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6704},"dist/lib/node-esm/transport/tcp/index.mjs":{"imports":[{"path":"node:net","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:net","kind":"dynamic-import","external":true}],"exports":["TcpTransport","TcpTransportFactory"],"entryPoint":"src/transport/tcp/index.ts","inputs":{"src/transport/tcp/tcp-transport.ts":{"bytesInOutput":3714},"src/transport/tcp/index.ts":{"bytesInOutput":0}},"bytes":3930}}}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TransportKind,
|
|
9
9
|
createRtcTransportFactory,
|
|
10
10
|
createTeleportProtocolFactory
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-PKBROUZV.mjs";
|
|
12
12
|
|
|
13
13
|
// src/testing/test-builder.ts
|
|
14
14
|
import { PublicKey as PublicKey2 } from "@dxos/keys";
|
|
@@ -26,21 +26,52 @@ import { PublicKey } from "@dxos/keys";
|
|
|
26
26
|
import { log } from "@dxos/log";
|
|
27
27
|
import { TestExtension, TestExtensionWithStreams } from "@dxos/teleport";
|
|
28
28
|
import { ComplexMap } from "@dxos/util";
|
|
29
|
-
function _define_property(obj, key, value) {
|
|
30
|
-
if (key in obj) {
|
|
31
|
-
Object.defineProperty(obj, key, {
|
|
32
|
-
value,
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
writable: true
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
obj[key] = value;
|
|
39
|
-
}
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
29
|
var __dxlog_file = "/__w/dxos/dxos/packages/core/mesh/network-manager/src/testing/test-wire-protocol.ts";
|
|
43
30
|
var TestWireProtocol = class {
|
|
31
|
+
_extensionFactory;
|
|
32
|
+
connections = new ComplexMap(PublicKey.hash);
|
|
33
|
+
streamConnections = new ComplexMap(PublicKey.hash);
|
|
34
|
+
connected = new Event();
|
|
35
|
+
disconnected = new Event();
|
|
36
|
+
otherConnections = new ComplexMap(({ remotePeerId, extension }) => remotePeerId.toHex() + extension);
|
|
37
|
+
constructor(_extensionFactory = () => []) {
|
|
38
|
+
this._extensionFactory = _extensionFactory;
|
|
39
|
+
}
|
|
40
|
+
factory = createTeleportProtocolFactory(async (teleport) => {
|
|
41
|
+
log("create", {
|
|
42
|
+
remotePeerId: teleport.remotePeerId
|
|
43
|
+
}, {
|
|
44
|
+
F: __dxlog_file,
|
|
45
|
+
L: 35,
|
|
46
|
+
S: this,
|
|
47
|
+
C: (f, a) => f(...a)
|
|
48
|
+
});
|
|
49
|
+
const handleDisconnect = () => {
|
|
50
|
+
this.connections.delete(teleport.remotePeerId);
|
|
51
|
+
this.disconnected.emit(teleport.remotePeerId);
|
|
52
|
+
};
|
|
53
|
+
const extension = new TestExtension({
|
|
54
|
+
onClose: async () => handleDisconnect(),
|
|
55
|
+
onAbort: async () => handleDisconnect()
|
|
56
|
+
});
|
|
57
|
+
this.connections.set(teleport.remotePeerId, extension);
|
|
58
|
+
teleport.addExtension("test", extension);
|
|
59
|
+
this.connected.emit(teleport.remotePeerId);
|
|
60
|
+
const streamExtension = new TestExtensionWithStreams({
|
|
61
|
+
onClose: async () => {
|
|
62
|
+
this.streamConnections.delete(teleport.remotePeerId);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
this.streamConnections.set(teleport.remotePeerId, streamExtension);
|
|
66
|
+
teleport.addExtension("test-stream", streamExtension);
|
|
67
|
+
for (const { name, extension: extension2 } of this._extensionFactory()) {
|
|
68
|
+
this.otherConnections.set({
|
|
69
|
+
remotePeerId: teleport.remotePeerId,
|
|
70
|
+
extension: name
|
|
71
|
+
}, extension2);
|
|
72
|
+
teleport.addExtension(name, extension2);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
44
75
|
async waitForConnection(peerId) {
|
|
45
76
|
if (this.connections.has(peerId)) {
|
|
46
77
|
return this.connections.get(peerId);
|
|
@@ -78,72 +109,9 @@ var TestWireProtocol = class {
|
|
|
78
109
|
const connection = this.streamConnections.get(peerId);
|
|
79
110
|
return connection.closeStream(streamTag);
|
|
80
111
|
}
|
|
81
|
-
constructor(_extensionFactory = () => []) {
|
|
82
|
-
_define_property(this, "_extensionFactory", void 0);
|
|
83
|
-
_define_property(this, "connections", void 0);
|
|
84
|
-
_define_property(this, "streamConnections", void 0);
|
|
85
|
-
_define_property(this, "connected", void 0);
|
|
86
|
-
_define_property(this, "disconnected", void 0);
|
|
87
|
-
_define_property(this, "otherConnections", void 0);
|
|
88
|
-
_define_property(this, "factory", void 0);
|
|
89
|
-
this._extensionFactory = _extensionFactory;
|
|
90
|
-
this.connections = new ComplexMap(PublicKey.hash);
|
|
91
|
-
this.streamConnections = new ComplexMap(PublicKey.hash);
|
|
92
|
-
this.connected = new Event();
|
|
93
|
-
this.disconnected = new Event();
|
|
94
|
-
this.otherConnections = new ComplexMap(({ remotePeerId, extension }) => remotePeerId.toHex() + extension);
|
|
95
|
-
this.factory = createTeleportProtocolFactory(async (teleport) => {
|
|
96
|
-
log("create", {
|
|
97
|
-
remotePeerId: teleport.remotePeerId
|
|
98
|
-
}, {
|
|
99
|
-
F: __dxlog_file,
|
|
100
|
-
L: 35,
|
|
101
|
-
S: this,
|
|
102
|
-
C: (f, a) => f(...a)
|
|
103
|
-
});
|
|
104
|
-
const handleDisconnect = () => {
|
|
105
|
-
this.connections.delete(teleport.remotePeerId);
|
|
106
|
-
this.disconnected.emit(teleport.remotePeerId);
|
|
107
|
-
};
|
|
108
|
-
const extension = new TestExtension({
|
|
109
|
-
onClose: async () => handleDisconnect(),
|
|
110
|
-
onAbort: async () => handleDisconnect()
|
|
111
|
-
});
|
|
112
|
-
this.connections.set(teleport.remotePeerId, extension);
|
|
113
|
-
teleport.addExtension("test", extension);
|
|
114
|
-
this.connected.emit(teleport.remotePeerId);
|
|
115
|
-
const streamExtension = new TestExtensionWithStreams({
|
|
116
|
-
onClose: async () => {
|
|
117
|
-
this.streamConnections.delete(teleport.remotePeerId);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
this.streamConnections.set(teleport.remotePeerId, streamExtension);
|
|
121
|
-
teleport.addExtension("test-stream", streamExtension);
|
|
122
|
-
for (const { name, extension: extension2 } of this._extensionFactory()) {
|
|
123
|
-
this.otherConnections.set({
|
|
124
|
-
remotePeerId: teleport.remotePeerId,
|
|
125
|
-
extension: name
|
|
126
|
-
}, extension2);
|
|
127
|
-
teleport.addExtension(name, extension2);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
112
|
};
|
|
132
113
|
|
|
133
114
|
// src/testing/test-builder.ts
|
|
134
|
-
function _define_property2(obj, key, value) {
|
|
135
|
-
if (key in obj) {
|
|
136
|
-
Object.defineProperty(obj, key, {
|
|
137
|
-
value,
|
|
138
|
-
enumerable: true,
|
|
139
|
-
configurable: true,
|
|
140
|
-
writable: true
|
|
141
|
-
});
|
|
142
|
-
} else {
|
|
143
|
-
obj[key] = value;
|
|
144
|
-
}
|
|
145
|
-
return obj;
|
|
146
|
-
}
|
|
147
115
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/core/mesh/network-manager/src/testing/test-builder.ts";
|
|
148
116
|
var port = process.env.SIGNAL_PORT ?? 4e3;
|
|
149
117
|
var TEST_SIGNAL_HOSTS = [
|
|
@@ -152,6 +120,11 @@ var TEST_SIGNAL_HOSTS = [
|
|
|
152
120
|
}
|
|
153
121
|
];
|
|
154
122
|
var TestBuilder = class {
|
|
123
|
+
options;
|
|
124
|
+
_signalContext = new MemorySignalManagerContext();
|
|
125
|
+
constructor(options = {}) {
|
|
126
|
+
this.options = options;
|
|
127
|
+
}
|
|
155
128
|
createSignalManager() {
|
|
156
129
|
if (this.options.signalHosts) {
|
|
157
130
|
return new WebsocketSignalManager(this.options.signalHosts);
|
|
@@ -161,14 +134,33 @@ var TestBuilder = class {
|
|
|
161
134
|
createPeer(peerId = PublicKey2.random()) {
|
|
162
135
|
return new TestPeer(this, peerId, this.options.transport);
|
|
163
136
|
}
|
|
164
|
-
constructor(options = {}) {
|
|
165
|
-
_define_property2(this, "options", void 0);
|
|
166
|
-
_define_property2(this, "_signalContext", void 0);
|
|
167
|
-
this.options = options;
|
|
168
|
-
this._signalContext = new MemorySignalManagerContext();
|
|
169
|
-
}
|
|
170
137
|
};
|
|
171
138
|
var TestPeer = class {
|
|
139
|
+
testBuilder;
|
|
140
|
+
peerId;
|
|
141
|
+
transport;
|
|
142
|
+
_swarms = new ComplexMap2(PublicKey2.hash);
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
_signalManager;
|
|
147
|
+
/**
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
_networkManager;
|
|
151
|
+
_proxy;
|
|
152
|
+
_service;
|
|
153
|
+
constructor(testBuilder, peerId, transport = testBuilder.options.signalHosts ? TransportKind.WEB_RTC : TransportKind.MEMORY) {
|
|
154
|
+
this.testBuilder = testBuilder;
|
|
155
|
+
this.peerId = peerId;
|
|
156
|
+
this.transport = transport;
|
|
157
|
+
this._signalManager = this.testBuilder.createSignalManager();
|
|
158
|
+
this._networkManager = this.createNetworkManager(this.transport);
|
|
159
|
+
this._networkManager.setPeerInfo({
|
|
160
|
+
identityKey: peerId.toHex(),
|
|
161
|
+
peerKey: peerId.toHex()
|
|
162
|
+
});
|
|
163
|
+
}
|
|
172
164
|
// TODO(burdon): Move to TestBuilder.
|
|
173
165
|
createNetworkManager(transport) {
|
|
174
166
|
let transportFactory;
|
|
@@ -272,28 +264,18 @@ var TestPeer = class {
|
|
|
272
264
|
async goOnline() {
|
|
273
265
|
await this._networkManager.setConnectionState(ConnectionState.ONLINE);
|
|
274
266
|
}
|
|
275
|
-
constructor(testBuilder, peerId, transport = testBuilder.options.signalHosts ? TransportKind.WEB_RTC : TransportKind.MEMORY) {
|
|
276
|
-
_define_property2(this, "testBuilder", void 0);
|
|
277
|
-
_define_property2(this, "peerId", void 0);
|
|
278
|
-
_define_property2(this, "transport", void 0);
|
|
279
|
-
_define_property2(this, "_swarms", void 0);
|
|
280
|
-
_define_property2(this, "_signalManager", void 0);
|
|
281
|
-
_define_property2(this, "_networkManager", void 0);
|
|
282
|
-
_define_property2(this, "_proxy", void 0);
|
|
283
|
-
_define_property2(this, "_service", void 0);
|
|
284
|
-
this.testBuilder = testBuilder;
|
|
285
|
-
this.peerId = peerId;
|
|
286
|
-
this.transport = transport;
|
|
287
|
-
this._swarms = new ComplexMap2(PublicKey2.hash);
|
|
288
|
-
this._signalManager = this.testBuilder.createSignalManager();
|
|
289
|
-
this._networkManager = this.createNetworkManager(this.transport);
|
|
290
|
-
this._networkManager.setPeerInfo({
|
|
291
|
-
identityKey: peerId.toHex(),
|
|
292
|
-
peerKey: peerId.toHex()
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
267
|
};
|
|
296
268
|
var TestSwarmConnection = class {
|
|
269
|
+
peer;
|
|
270
|
+
topic;
|
|
271
|
+
extensionFactory;
|
|
272
|
+
protocol;
|
|
273
|
+
constructor(peer, topic, extensionFactory) {
|
|
274
|
+
this.peer = peer;
|
|
275
|
+
this.topic = topic;
|
|
276
|
+
this.extensionFactory = extensionFactory;
|
|
277
|
+
this.protocol = new TestWireProtocol(this.extensionFactory);
|
|
278
|
+
}
|
|
297
279
|
// TODO(burdon): Need to create new plugin instance per swarm?
|
|
298
280
|
// If so, then perhaps joinSwarm should return swarm object with access to plugins.
|
|
299
281
|
async join(topology = new FullyConnectedTopology()) {
|
|
@@ -312,16 +294,6 @@ var TestSwarmConnection = class {
|
|
|
312
294
|
await this.peer._networkManager.leaveSwarm(this.topic);
|
|
313
295
|
return this;
|
|
314
296
|
}
|
|
315
|
-
constructor(peer, topic, extensionFactory) {
|
|
316
|
-
_define_property2(this, "peer", void 0);
|
|
317
|
-
_define_property2(this, "topic", void 0);
|
|
318
|
-
_define_property2(this, "extensionFactory", void 0);
|
|
319
|
-
_define_property2(this, "protocol", void 0);
|
|
320
|
-
this.peer = peer;
|
|
321
|
-
this.topic = topic;
|
|
322
|
-
this.extensionFactory = extensionFactory;
|
|
323
|
-
this.protocol = new TestWireProtocol(this.extensionFactory);
|
|
324
|
-
}
|
|
325
297
|
};
|
|
326
298
|
export {
|
|
327
299
|
TEST_SIGNAL_HOSTS,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/test-builder.ts", "../../../../src/testing/test-wire-protocol.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport {\n MemorySignalManager,\n MemorySignalManagerContext,\n type SignalManager,\n WebsocketSignalManager,\n} from '@dxos/messaging';\nimport { schema } from '@dxos/protocols/proto';\nimport { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';\nimport { type Runtime } from '@dxos/protocols/proto/dxos/config';\nimport { type ProtoRpcPeer, createLinkedPorts, createProtoRpcPeer } from '@dxos/rpc';\nimport { ComplexMap } from '@dxos/util';\n\nimport { TcpTransportFactory } from '#tcp-transport';\n\nimport { SwarmNetworkManager } from '../network-manager';\nimport { FullyConnectedTopology } from '../topology';\nimport {\n MemoryTransportFactory,\n RtcTransportProxyFactory,\n RtcTransportService,\n type TransportFactory,\n TransportKind,\n createRtcTransportFactory,\n} from '../transport';\n\nimport { type TestTeleportExtensionFactory, TestWireProtocol } from './test-wire-protocol';\n\n// Signal server will be started by the setup script.\nconst port = process.env.SIGNAL_PORT ?? 4000;\nexport const TEST_SIGNAL_HOSTS: Runtime.Services.Signal[] = [\n { server: `ws://localhost:${port}/.well-known/dx/signal` },\n];\n\nexport type TestBuilderOptions = {\n signalHosts?: Runtime.Services.Signal[];\n bridge?: boolean;\n transport?: TransportKind;\n};\n\n/**\n * Builder used to construct networks and peers.\n */\nexport class TestBuilder {\n private _signalContext = new MemorySignalManagerContext();\n\n constructor(public readonly options: TestBuilderOptions = {}) {}\n\n createSignalManager(): WebsocketSignalManager | MemorySignalManager {\n if (this.options.signalHosts) {\n return new WebsocketSignalManager(this.options.signalHosts);\n }\n\n return new MemorySignalManager(this._signalContext);\n }\n\n createPeer(peerId: PublicKey = PublicKey.random()): TestPeer {\n return new TestPeer(this, peerId, this.options.transport);\n }\n}\n\n/**\n * Testing network peer.\n */\nexport class TestPeer {\n private readonly _swarms = new ComplexMap<PublicKey, TestSwarmConnection>(PublicKey.hash);\n\n /**\n * @internal\n */\n readonly _signalManager: SignalManager;\n\n /**\n * @internal\n */\n readonly _networkManager: SwarmNetworkManager;\n\n private _proxy?: ProtoRpcPeer<any>;\n private _service?: ProtoRpcPeer<any>;\n\n constructor(\n private readonly testBuilder: TestBuilder,\n public readonly peerId: PublicKey,\n public readonly transport: TransportKind = testBuilder.options.signalHosts\n ? TransportKind.WEB_RTC\n : TransportKind.MEMORY,\n ) {\n this._signalManager = this.testBuilder.createSignalManager();\n this._networkManager = this.createNetworkManager(this.transport);\n this._networkManager.setPeerInfo({ identityKey: peerId.toHex(), peerKey: peerId.toHex() });\n }\n\n // TODO(burdon): Move to TestBuilder.\n createNetworkManager(transport: TransportKind): SwarmNetworkManager {\n let transportFactory: TransportFactory;\n if (this.testBuilder.options.signalHosts) {\n log.info(`using ${transport} transport with signal server.`);\n switch (transport) {\n case TransportKind.MEMORY:\n throw new Error('Memory transport not supported with signal server.');\n case TransportKind.TCP:\n transportFactory = TcpTransportFactory;\n break;\n case TransportKind.WEB_RTC:\n transportFactory = createRtcTransportFactory();\n break;\n case TransportKind.WEB_RTC_PROXY:\n {\n // Simulates bridge to shared worker.\n const [proxyPort, servicePort] = createLinkedPorts();\n\n this._proxy = createProtoRpcPeer({\n port: proxyPort,\n requested: {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n },\n noHandshake: true,\n encodingOptions: {\n preserveAny: true,\n },\n });\n\n this._service = createProtoRpcPeer({\n port: servicePort,\n exposed: {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n },\n handlers: { BridgeService: new RtcTransportService() },\n noHandshake: true,\n encodingOptions: {\n preserveAny: true,\n },\n });\n\n transportFactory = new RtcTransportProxyFactory().setBridgeService(this._proxy.rpc.BridgeService);\n }\n break;\n default:\n throw new Error(`Unsupported transport: ${transport}`);\n }\n } else {\n if (transport !== TransportKind.MEMORY && transport !== TransportKind.TCP) {\n log.warn(`specified transport ${transport} but no signalling configured, using memory transport instead`);\n }\n log.info(`using ${transport} transport without signal server.`);\n transportFactory = MemoryTransportFactory;\n }\n\n return new SwarmNetworkManager({\n signalManager: this._signalManager,\n transportFactory,\n });\n }\n\n async open(): Promise<void> {\n await this._networkManager.open();\n await this._proxy?.open();\n await this._service?.open();\n }\n\n async close(): Promise<void> {\n await Promise.all(Array.from(this._swarms.values()).map((swarm) => swarm.leave()));\n this._swarms.clear();\n\n await this._proxy?.close();\n await this._service?.close();\n await this._networkManager.close();\n }\n\n getSwarm(topic: PublicKey): TestSwarmConnection {\n const swarm = this._swarms.get(topic);\n if (!swarm) {\n throw new Error(`Swarm not found for topic: ${topic}`);\n }\n\n return swarm;\n }\n\n createSwarm(topic: PublicKey, extensionFactory: TestTeleportExtensionFactory = () => []): TestSwarmConnection {\n // TODO(burdon): Multiple.\n // if (this._swarms.get(topic)) {\n // throw new Error(`Swarm already exists for topic: ${topic.truncate()}`);\n // }\n\n const swarm = new TestSwarmConnection(this, topic, extensionFactory);\n this._swarms.set(topic, swarm);\n return swarm;\n }\n\n async goOffline(): Promise<void> {\n await this._networkManager.setConnectionState(ConnectionState.OFFLINE);\n }\n\n async goOnline(): Promise<void> {\n await this._networkManager.setConnectionState(ConnectionState.ONLINE);\n }\n}\n\n// TODO(burdon): Reconcile with new Swarm concept.\nexport class TestSwarmConnection {\n protocol: TestWireProtocol;\n\n constructor(\n readonly peer: TestPeer,\n readonly topic: PublicKey,\n readonly extensionFactory: TestTeleportExtensionFactory,\n ) {\n // TODO(burdon): Configure plugins.\n // TODO(burdon): Prevent reuse?\n this.protocol = new TestWireProtocol(this.extensionFactory);\n }\n\n // TODO(burdon): Need to create new plugin instance per swarm?\n // If so, then perhaps joinSwarm should return swarm object with access to plugins.\n async join(topology = new FullyConnectedTopology()): Promise<this> {\n await this.peer._networkManager.joinSwarm({\n topic: this.topic,\n peerInfo: { peerKey: this.peer.peerId.toHex(), identityKey: this.peer.peerId.toHex() },\n protocolProvider: this.protocol.factory,\n topology,\n });\n\n return this;\n }\n\n async leave(): Promise<this> {\n await this.peer._networkManager.leaveSwarm(this.topic);\n return this;\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Event, asyncTimeout } from '@dxos/async';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { TestExtension, TestExtensionWithStreams } from '@dxos/teleport';\nimport type { TeleportExtension, TestStreamStats } from '@dxos/teleport';\nimport { ComplexMap } from '@dxos/util';\n\nimport { createTeleportProtocolFactory } from '../wire-protocol';\n\nexport type TestTeleportExtension = {\n name: string;\n extension: TeleportExtension;\n};\n\nexport type TestTeleportExtensionFactory = () => TestTeleportExtension[];\n\nexport class TestWireProtocol {\n public readonly connections = new ComplexMap<PublicKey, TestExtension>(PublicKey.hash);\n public readonly streamConnections = new ComplexMap<PublicKey, TestExtensionWithStreams>(PublicKey.hash);\n\n public readonly connected = new Event<PublicKey>();\n public readonly disconnected = new Event<PublicKey>();\n\n public readonly otherConnections = new ComplexMap<{ remotePeerId: PublicKey; extension: string }, TeleportExtension>(\n ({ remotePeerId, extension }) => remotePeerId.toHex() + extension,\n );\n\n constructor(private readonly _extensionFactory: TestTeleportExtensionFactory = () => []) {}\n\n readonly factory = createTeleportProtocolFactory(async (teleport) => {\n log('create', { remotePeerId: teleport.remotePeerId });\n const handleDisconnect = () => {\n this.connections.delete(teleport.remotePeerId);\n this.disconnected.emit(teleport.remotePeerId);\n };\n const extension = new TestExtension({\n onClose: async () => handleDisconnect(),\n onAbort: async () => handleDisconnect(),\n });\n this.connections.set(teleport.remotePeerId, extension);\n teleport.addExtension('test', extension);\n this.connected.emit(teleport.remotePeerId);\n\n const streamExtension = new TestExtensionWithStreams({\n onClose: async () => {\n this.streamConnections.delete(teleport.remotePeerId);\n },\n });\n this.streamConnections.set(teleport.remotePeerId, streamExtension);\n teleport.addExtension('test-stream', streamExtension);\n\n for (const { name, extension } of this._extensionFactory()) {\n this.otherConnections.set({ remotePeerId: teleport.remotePeerId, extension: name }, extension);\n teleport.addExtension(name, extension);\n }\n });\n\n async waitForConnection(peerId: PublicKey): Promise<TestExtension> {\n if (this.connections.has(peerId)) {\n return this.connections.get(peerId)!;\n }\n log('waitForConnection', { peerId });\n await asyncTimeout(\n this.connected.waitFor((connectedId) => connectedId.equals(peerId)),\n // TODO(nf): Make this configurable.\n 10_000,\n );\n return this.connections.get(peerId)!;\n }\n\n async testConnection(peerId: PublicKey, message?: string): Promise<void> {\n const connection = await this.waitForConnection(peerId);\n await connection.test(message);\n }\n\n async openStream(\n peerId: PublicKey,\n streamTag: string,\n streamLoadInterval: number,\n streamLoadChunkSize: number,\n ): Promise<string> {\n if (!this.streamConnections.has(peerId)) {\n throw new Error('Connection does not exist.');\n }\n const connection = this.streamConnections.get(peerId)!;\n return connection.addNewStream(streamLoadInterval, streamLoadChunkSize, streamTag);\n }\n\n async closeStream(peerId: PublicKey, streamTag: string): Promise<TestStreamStats> {\n if (!this.streamConnections.has(peerId)) {\n throw new Error('Connection does not exist.');\n }\n const connection = this.streamConnections.get(peerId)!;\n return connection.closeStream(streamTag);\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,aAAAA,kBAAiB;AAC1B,SAASC,OAAAA,YAAW;AACpB,SACEC,qBACAC,4BAEAC,8BACK;AACP,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAEhC,SAA4BC,mBAAmBC,0BAA0B;AACzE,SAASC,cAAAA,mBAAkB;AAE3B,SAASC,2BAA2B;;;ACdpC,SAASC,OAAOC,oBAAoB;AACpC,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,eAAeC,gCAAgC;AAExD,SAASC,kBAAkB
|
|
6
|
-
"names": ["PublicKey", "log", "MemorySignalManager", "MemorySignalManagerContext", "WebsocketSignalManager", "schema", "ConnectionState", "createLinkedPorts", "createProtoRpcPeer", "ComplexMap", "TcpTransportFactory", "Event", "asyncTimeout", "PublicKey", "log", "TestExtension", "TestExtensionWithStreams", "ComplexMap", "TestWireProtocol", "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,aAAAA,kBAAiB;AAC1B,SAASC,OAAAA,YAAW;AACpB,SACEC,qBACAC,4BAEAC,8BACK;AACP,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAEhC,SAA4BC,mBAAmBC,0BAA0B;AACzE,SAASC,cAAAA,mBAAkB;AAE3B,SAASC,2BAA2B;;;ACdpC,SAASC,OAAOC,oBAAoB;AACpC,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,eAAeC,gCAAgC;AAExD,SAASC,kBAAkB;;AAW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AAyB;AAM5G,UAAMP,QAAQ,IAAIQ,oBAAoB,MAAMJ,OAAOG,gBAAAA;AACnD,SAAK5D,QAAQ8D,IAAIL,OAAOJ,KAAAA;AACxB,WAAOA;EACT;EAEA,MAAMU,YAA2B;AAC/B,UAAM,KAAK3D,gBAAgB4D,mBAAmBC,gBAAgBC,OAAO;EACvE;EAEA,MAAMC,WAA0B;AAC9B,UAAM,KAAK/D,gBAAgB4D,mBAAmBC,gBAAgBG,MAAM;EACtE;AACF;AAGO,IAAMP,sBAAN,MAAMA;;;;EACXQ;EAEA,YACWC,MACAb,OACAG,kBACT;SAHSU,OAAAA;SACAb,QAAAA;SACAG,mBAAAA;AAIT,SAAKS,WAAW,IAAIE,iBAAiB,KAAKX,gBAAgB;EAC5D;;;EAIA,MAAMY,KAAKC,WAAW,IAAIC,uBAAAA,GAAyC;AACjE,UAAM,KAAKJ,KAAKlE,gBAAgBuE,UAAU;MACxClB,OAAO,KAAKA;MACZmB,UAAU;QAAE7D,SAAS,KAAKuD,KAAK3E,OAAOmB,MAAK;QAAID,aAAa,KAAKyD,KAAK3E,OAAOmB,MAAK;MAAG;MACrF+D,kBAAkB,KAAKR,SAASS;MAChCL;IACF,CAAA;AAEA,WAAO;EACT;EAEA,MAAMnB,QAAuB;AAC3B,UAAM,KAAKgB,KAAKlE,gBAAgB2E,WAAW,KAAKtB,KAAK;AACrD,WAAO;EACT;AACF;",
|
|
6
|
+
"names": ["PublicKey", "log", "MemorySignalManager", "MemorySignalManagerContext", "WebsocketSignalManager", "schema", "ConnectionState", "createLinkedPorts", "createProtoRpcPeer", "ComplexMap", "TcpTransportFactory", "Event", "asyncTimeout", "PublicKey", "log", "TestExtension", "TestExtensionWithStreams", "ComplexMap", "TestWireProtocol", "connections", "ComplexMap", "PublicKey", "hash", "streamConnections", "connected", "Event", "disconnected", "otherConnections", "remotePeerId", "extension", "toHex", "_extensionFactory", "factory", "createTeleportProtocolFactory", "teleport", "log", "handleDisconnect", "delete", "emit", "TestExtension", "onClose", "onAbort", "set", "addExtension", "streamExtension", "TestExtensionWithStreams", "name", "waitForConnection", "peerId", "has", "get", "asyncTimeout", "waitFor", "connectedId", "equals", "testConnection", "message", "connection", "test", "openStream", "streamTag", "streamLoadInterval", "streamLoadChunkSize", "Error", "addNewStream", "closeStream", "port", "process", "env", "SIGNAL_PORT", "TEST_SIGNAL_HOSTS", "server", "TestBuilder", "_signalContext", "MemorySignalManagerContext", "options", "createSignalManager", "signalHosts", "WebsocketSignalManager", "MemorySignalManager", "createPeer", "peerId", "PublicKey", "random", "TestPeer", "transport", "_swarms", "ComplexMap", "hash", "_signalManager", "_networkManager", "_proxy", "_service", "testBuilder", "TransportKind", "WEB_RTC", "MEMORY", "createNetworkManager", "setPeerInfo", "identityKey", "toHex", "peerKey", "transportFactory", "log", "info", "Error", "TCP", "TcpTransportFactory", "createRtcTransportFactory", "WEB_RTC_PROXY", "proxyPort", "servicePort", "createLinkedPorts", "createProtoRpcPeer", "requested", "BridgeService", "schema", "getService", "noHandshake", "encodingOptions", "preserveAny", "exposed", "handlers", "RtcTransportService", "RtcTransportProxyFactory", "setBridgeService", "rpc", "warn", "MemoryTransportFactory", "SwarmNetworkManager", "signalManager", "open", "close", "Promise", "all", "Array", "from", "values", "map", "swarm", "leave", "clear", "getSwarm", "topic", "get", "createSwarm", "extensionFactory", "TestSwarmConnection", "set", "goOffline", "setConnectionState", "ConnectionState", "OFFLINE", "goOnline", "ONLINE", "protocol", "peer", "TestWireProtocol", "join", "topology", "FullyConnectedTopology", "joinSwarm", "peerInfo", "protocolProvider", "factory", "leaveSwarm"]
|
|
7
7
|
}
|