@dxos/client-services 0.1.56-main.a25bb93 → 0.1.56-main.ad054df
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-MAHWP5I6.mjs → chunk-U5CCSPX6.mjs} +215 -140
- package/dist/lib/browser/chunk-U5CCSPX6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -12
- 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/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +210 -133
- 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 +197 -122
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +3 -2
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +2 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +3 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -33
- package/src/packlets/devices/devices-service.test.ts +2 -1
- package/src/packlets/identity/identity-manager.test.ts +4 -3
- package/src/packlets/identity/identity-manager.ts +9 -5
- package/src/packlets/identity/identity-service.test.ts +2 -1
- package/src/packlets/identity/identity.test.ts +7 -6
- package/src/packlets/identity/identity.ts +8 -3
- package/src/packlets/invitations/device-invitation-protocol.test.ts +2 -1
- package/src/packlets/network/network-service.test.ts +2 -1
- package/src/packlets/services/client-rpc-server.ts +4 -4
- package/src/packlets/services/service-context.ts +11 -6
- package/src/packlets/services/service-host.test.ts +6 -5
- package/src/packlets/services/service-host.ts +15 -3
- package/src/packlets/services/service-registry.test.ts +2 -1
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/spaces-service.test.ts +2 -1
- package/src/packlets/testing/test-builder.ts +1 -1
- package/src/packlets/vault/iframe-host-runtime.ts +2 -1
- package/src/packlets/vault/worker-runtime.ts +2 -1
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-MAHWP5I6.mjs.map +0 -7
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Event, synchronized } from '@dxos/async';
|
|
6
6
|
import { clientServiceBundle, ClientServices } from '@dxos/client-protocol';
|
|
7
7
|
import { Config } from '@dxos/config';
|
|
8
|
+
import { Context } from '@dxos/context';
|
|
8
9
|
import { DocumentModel } from '@dxos/document-model';
|
|
9
10
|
import { DataServiceImpl } from '@dxos/echo-pipeline';
|
|
10
11
|
import { invariant } from '@dxos/invariant';
|
|
@@ -17,6 +18,7 @@ import { trace } from '@dxos/protocols';
|
|
|
17
18
|
import { SystemStatus } from '@dxos/protocols/proto/dxos/client/services';
|
|
18
19
|
import { Storage } from '@dxos/random-access-storage';
|
|
19
20
|
import { TextModel } from '@dxos/text-model';
|
|
21
|
+
import { TRACE_PROCESSOR, trace as Trace } from '@dxos/tracing';
|
|
20
22
|
|
|
21
23
|
import { DevicesServiceImpl } from '../devices';
|
|
22
24
|
import { DevtoolsServiceImpl, DevtoolsHostEvents } from '../devtools';
|
|
@@ -65,11 +67,13 @@ export type InitializeOptions = {
|
|
|
65
67
|
/**
|
|
66
68
|
* Remote service implementation.
|
|
67
69
|
*/
|
|
70
|
+
@Trace.resource()
|
|
68
71
|
export class ClientServicesHost {
|
|
69
72
|
private readonly _resourceLock?: ResourceLock;
|
|
70
73
|
private readonly _serviceRegistry: ServiceRegistry<ClientServices>;
|
|
71
74
|
private readonly _systemService: SystemServiceImpl;
|
|
72
75
|
private readonly _loggingService: LoggingServiceImpl;
|
|
76
|
+
private readonly _tracingService = TRACE_PROCESSOR.createTraceSender();
|
|
73
77
|
|
|
74
78
|
private _config?: Config;
|
|
75
79
|
private readonly _statusUpdate = new Event<void>();
|
|
@@ -80,7 +84,11 @@ export class ClientServicesHost {
|
|
|
80
84
|
private _callbacks?: ClientServicesHostCallbacks;
|
|
81
85
|
|
|
82
86
|
private _serviceContext!: ServiceContext;
|
|
87
|
+
|
|
88
|
+
@Trace.info()
|
|
83
89
|
private _opening = false;
|
|
90
|
+
|
|
91
|
+
@Trace.info()
|
|
84
92
|
private _open = false;
|
|
85
93
|
|
|
86
94
|
constructor({
|
|
@@ -106,7 +114,7 @@ export class ClientServicesHost {
|
|
|
106
114
|
lockKey,
|
|
107
115
|
onAcquire: () => {
|
|
108
116
|
if (!this._opening) {
|
|
109
|
-
void this.open();
|
|
117
|
+
void this.open(new Context());
|
|
110
118
|
}
|
|
111
119
|
},
|
|
112
120
|
onRelease: () => this.close(),
|
|
@@ -136,6 +144,7 @@ export class ClientServicesHost {
|
|
|
136
144
|
|
|
137
145
|
this._serviceRegistry = new ServiceRegistry<ClientServices>(clientServiceBundle, {
|
|
138
146
|
SystemService: this._systemService,
|
|
147
|
+
TracingService: this._tracingService,
|
|
139
148
|
});
|
|
140
149
|
}
|
|
141
150
|
|
|
@@ -200,7 +209,8 @@ export class ClientServicesHost {
|
|
|
200
209
|
}
|
|
201
210
|
|
|
202
211
|
@synchronized
|
|
203
|
-
|
|
212
|
+
@Trace.span()
|
|
213
|
+
async open(ctx: Context) {
|
|
204
214
|
if (this._open) {
|
|
205
215
|
return;
|
|
206
216
|
}
|
|
@@ -252,6 +262,7 @@ export class ClientServicesHost {
|
|
|
252
262
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
253
263
|
|
|
254
264
|
LoggingService: this._loggingService,
|
|
265
|
+
TracingService: this._tracingService,
|
|
255
266
|
|
|
256
267
|
// TODO(burdon): Move to new protobuf definitions.
|
|
257
268
|
DevtoolsHost: new DevtoolsServiceImpl({
|
|
@@ -261,7 +272,7 @@ export class ClientServicesHost {
|
|
|
261
272
|
}),
|
|
262
273
|
});
|
|
263
274
|
|
|
264
|
-
await this._serviceContext.open();
|
|
275
|
+
await this._serviceContext.open(ctx);
|
|
265
276
|
this._opening = false;
|
|
266
277
|
this._open = true;
|
|
267
278
|
this._statusUpdate.emit();
|
|
@@ -271,6 +282,7 @@ export class ClientServicesHost {
|
|
|
271
282
|
}
|
|
272
283
|
|
|
273
284
|
@synchronized
|
|
285
|
+
@Trace.span()
|
|
274
286
|
async close() {
|
|
275
287
|
if (!this._open) {
|
|
276
288
|
return;
|
|
@@ -7,6 +7,7 @@ import { expect } from 'chai';
|
|
|
7
7
|
import { Event } from '@dxos/async';
|
|
8
8
|
import { ClientServices } from '@dxos/client-protocol';
|
|
9
9
|
import { Config } from '@dxos/config';
|
|
10
|
+
import { Context } from '@dxos/context';
|
|
10
11
|
import { log } from '@dxos/log';
|
|
11
12
|
import { schema } from '@dxos/protocols';
|
|
12
13
|
import { SystemService, SystemStatus } from '@dxos/protocols/proto/dxos/client/services';
|
|
@@ -31,7 +32,7 @@ describe('service registry', () => {
|
|
|
31
32
|
test('builds a service registry', async () => {
|
|
32
33
|
const remoteSource = 'https://remote.source';
|
|
33
34
|
const serviceContext = createServiceContext();
|
|
34
|
-
await serviceContext.open();
|
|
35
|
+
await serviceContext.open(new Context());
|
|
35
36
|
|
|
36
37
|
const serviceRegistry = new ServiceRegistry(serviceBundle, {
|
|
37
38
|
SystemService: new SystemServiceImpl({
|
|
@@ -145,7 +145,7 @@ export class DataSpace {
|
|
|
145
145
|
private async _open() {
|
|
146
146
|
await this._notarizationPlugin.open();
|
|
147
147
|
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
148
|
-
await this._inner.open();
|
|
148
|
+
await this._inner.open(new Context());
|
|
149
149
|
this._state = SpaceState.CONTROL_ONLY;
|
|
150
150
|
this.stateUpdate.emit();
|
|
151
151
|
this.metrics = {};
|
|
@@ -6,6 +6,7 @@ import chai, { expect } from 'chai';
|
|
|
6
6
|
import chaiAsPromised from 'chai-as-promised';
|
|
7
7
|
|
|
8
8
|
import { Trigger } from '@dxos/async';
|
|
9
|
+
import { Context } from '@dxos/context';
|
|
9
10
|
import { PublicKey } from '@dxos/keys';
|
|
10
11
|
import { Space, SpacesService } from '@dxos/protocols/proto/dxos/client/services';
|
|
11
12
|
import { afterEach, afterTest, beforeEach, describe, test } from '@dxos/test';
|
|
@@ -22,7 +23,7 @@ describe('SpacesService', () => {
|
|
|
22
23
|
|
|
23
24
|
beforeEach(async () => {
|
|
24
25
|
serviceContext = createServiceContext();
|
|
25
|
-
await serviceContext.open();
|
|
26
|
+
await serviceContext.open(new Context());
|
|
26
27
|
spacesService = new SpacesServiceImpl(
|
|
27
28
|
serviceContext.identityManager,
|
|
28
29
|
serviceContext.spaceManager,
|
|
@@ -60,7 +60,7 @@ export const createPeers = async (numPeers: number) => {
|
|
|
60
60
|
return await Promise.all(
|
|
61
61
|
Array.from(Array(numPeers)).map(async () => {
|
|
62
62
|
const peer = createServiceContext({ signalContext });
|
|
63
|
-
await peer.open();
|
|
63
|
+
await peer.open(new Context());
|
|
64
64
|
return peer;
|
|
65
65
|
}),
|
|
66
66
|
);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Trigger } from '@dxos/async';
|
|
6
6
|
import { PROXY_CONNECTION_TIMEOUT, ShellRuntime } from '@dxos/client-protocol';
|
|
7
7
|
import { Config } from '@dxos/config';
|
|
8
|
+
import { Context } from '@dxos/context';
|
|
8
9
|
import { log, logInfo } from '@dxos/log';
|
|
9
10
|
import { MemorySignalManager, MemorySignalManagerContext, WebsocketSignalManager } from '@dxos/messaging';
|
|
10
11
|
import { createWebRTCTransportFactory, TransportFactory } from '@dxos/network-manager';
|
|
@@ -108,7 +109,7 @@ export class IFrameHostRuntime {
|
|
|
108
109
|
...middleware,
|
|
109
110
|
});
|
|
110
111
|
|
|
111
|
-
await Promise.all([this._clientServices.open(), this._clientRpc.open(), this._shellRuntime?.open()]);
|
|
112
|
+
await Promise.all([this._clientServices.open(new Context()), this._clientRpc.open(), this._shellRuntime?.open()]);
|
|
112
113
|
this._ready.wake(undefined);
|
|
113
114
|
log('started');
|
|
114
115
|
} catch (err: any) {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Trigger } from '@dxos/async';
|
|
6
6
|
import { Config } from '@dxos/config';
|
|
7
|
+
import { Context } from '@dxos/context';
|
|
7
8
|
import { log } from '@dxos/log';
|
|
8
9
|
import { MemorySignalManager, MemorySignalManagerContext, WebsocketSignalManager } from '@dxos/messaging';
|
|
9
10
|
import { WebRTCTransportProxyFactory } from '@dxos/network-manager';
|
|
@@ -57,7 +58,7 @@ export class WorkerRuntime {
|
|
|
57
58
|
transportFactory: this._transportFactory,
|
|
58
59
|
});
|
|
59
60
|
|
|
60
|
-
await this._clientServices.open();
|
|
61
|
+
await this._clientServices.open(new Context());
|
|
61
62
|
this._ready.wake(undefined);
|
|
62
63
|
log('started');
|
|
63
64
|
} catch (err: any) {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.1.56-main.
|
|
1
|
+
export const DXOS_VERSION = "0.1.56-main.ad054df";
|