@dxos/client-services 0.1.57-main.e87098f → 0.1.57
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-WYYB3FSH.mjs → chunk-ZOFA377V.mjs} +222 -133
- package/dist/lib/browser/chunk-ZOFA377V.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +17 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +2 -2
- package/dist/lib/node/index.cjs +251 -162
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +235 -146
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +1 -0
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts +2 -2
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +35 -34
- package/src/packlets/devtools/network.ts +5 -1
- package/src/packlets/identity/identity-manager.test.ts +4 -0
- package/src/packlets/identity/identity-manager.ts +5 -3
- package/src/packlets/services/service-context.test.ts +2 -2
- package/src/packlets/services/service-context.ts +3 -0
- package/src/packlets/services/service-host.ts +18 -2
- package/src/packlets/spaces/data-space-manager.ts +11 -8
- package/src/packlets/spaces/data-space.ts +41 -23
- package/src/packlets/spaces/spaces-service.ts +5 -3
- package/src/packlets/vault/iframe-host-runtime.ts +2 -2
- package/src/packlets/vault/iframe-proxy-runtime.ts +2 -2
- package/src/packlets/vault/worker-runtime.ts +9 -9
- package/src/version.ts +5 -1
- package/dist/lib/browser/chunk-WYYB3FSH.mjs.map +0 -7
|
@@ -7,7 +7,7 @@ import { iframeServiceBundle, ShellRuntime, workerServiceBundle, WorkerServiceBu
|
|
|
7
7
|
import { Config } from '@dxos/config';
|
|
8
8
|
import { RemoteServiceConnectionError } from '@dxos/errors';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
|
-
import {
|
|
10
|
+
import { SimplePeerTransportService } from '@dxos/network-manager';
|
|
11
11
|
import { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';
|
|
12
12
|
import { createProtoRpcPeer, ProtoRpcPeer, RpcPort } from '@dxos/rpc';
|
|
13
13
|
import { getAsyncValue, MaybePromise, Provider } from '@dxos/util';
|
|
@@ -52,7 +52,7 @@ export class IFrameProxyRuntime {
|
|
|
52
52
|
async open(origin: string) {
|
|
53
53
|
this._config = await getAsyncValue(this._configProvider);
|
|
54
54
|
|
|
55
|
-
this._transportService = new
|
|
55
|
+
this._transportService = new SimplePeerTransportService({
|
|
56
56
|
iceServers: this._config.get('runtime.services.ice'),
|
|
57
57
|
});
|
|
58
58
|
|
|
@@ -7,7 +7,7 @@ import { Config } from '@dxos/config';
|
|
|
7
7
|
import { Context } from '@dxos/context';
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
9
|
import { MemorySignalManager, MemorySignalManagerContext, WebsocketSignalManager } from '@dxos/messaging';
|
|
10
|
-
import {
|
|
10
|
+
import { SimplePeerTransportProxyFactory } from '@dxos/network-manager';
|
|
11
11
|
import { RpcPort } from '@dxos/rpc';
|
|
12
12
|
import { MaybePromise } from '@dxos/util';
|
|
13
13
|
|
|
@@ -27,11 +27,11 @@ export type CreateSessionParams = {
|
|
|
27
27
|
* Tabs make requests to the `ClientServicesHost`, and provide a WebRTC gateway.
|
|
28
28
|
*/
|
|
29
29
|
export class WorkerRuntime {
|
|
30
|
-
private readonly _transportFactory = new
|
|
30
|
+
private readonly _transportFactory = new SimplePeerTransportProxyFactory();
|
|
31
31
|
private readonly _ready = new Trigger<Error | undefined>();
|
|
32
|
-
private readonly
|
|
33
|
-
private
|
|
34
|
-
private
|
|
32
|
+
private readonly _sessions = new Set<WorkerSession>();
|
|
33
|
+
private readonly _clientServices!: ClientServicesHost;
|
|
34
|
+
private _sessionForNetworking?: WorkerSession; // TODO(burdon): Expose to client QueryStatusResponse.
|
|
35
35
|
private _config!: Config;
|
|
36
36
|
|
|
37
37
|
// prettier-ignore
|
|
@@ -86,12 +86,12 @@ export class WorkerRuntime {
|
|
|
86
86
|
|
|
87
87
|
// When tab is closed.
|
|
88
88
|
session.onClose.set(async () => {
|
|
89
|
-
this.
|
|
89
|
+
this._sessions.delete(session);
|
|
90
90
|
this._reconnectWebrtc();
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
await session.open();
|
|
94
|
-
this.
|
|
94
|
+
this._sessions.add(session);
|
|
95
95
|
|
|
96
96
|
this._reconnectWebrtc();
|
|
97
97
|
}
|
|
@@ -103,14 +103,14 @@ export class WorkerRuntime {
|
|
|
103
103
|
log('reconnecting webrtc...');
|
|
104
104
|
// Check if current session is already closed.
|
|
105
105
|
if (this._sessionForNetworking) {
|
|
106
|
-
if (!this.
|
|
106
|
+
if (!this._sessions.has(this._sessionForNetworking)) {
|
|
107
107
|
this._sessionForNetworking = undefined;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// Select existing session.
|
|
112
112
|
if (!this._sessionForNetworking) {
|
|
113
|
-
const selected = Array.from(this.
|
|
113
|
+
const selected = Array.from(this._sessions).find((session) => session.bridgeService);
|
|
114
114
|
if (selected) {
|
|
115
115
|
this._sessionForNetworking = selected;
|
|
116
116
|
this._transportFactory.setBridgeService(selected.bridgeService);
|
package/src/version.ts
CHANGED