@dxos/client-services 0.1.56-main.83e9b8a → 0.1.56-main.a25bb93
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-P26UKXYR.mjs → chunk-MAHWP5I6.mjs} +970 -383
- package/dist/lib/browser/chunk-MAHWP5I6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +50 -31
- 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 +12 -3
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +1113 -510
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +1260 -667
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +6 -2
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts +46 -0
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -0
- package/dist/types/src/packlets/services/index.d.ts +1 -0
- package/dist/types/src/packlets/services/index.d.ts.map +1 -1
- package/dist/types/src/packlets/services/platform.d.ts +16 -0
- package/dist/types/src/packlets/services/platform.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +4 -2
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/util.d.ts +6 -0
- package/dist/types/src/packlets/services/util.d.ts.map +1 -0
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts +12 -2
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +2 -0
- package/dist/types/src/version.d.ts.map +1 -0
- package/package.json +33 -33
- package/src/packlets/identity/authenticator.test.ts +2 -2
- package/src/packlets/identity/identity-manager.ts +1 -2
- package/src/packlets/identity/identity-service.ts +1 -2
- package/src/packlets/identity/identity.ts +1 -2
- package/src/packlets/invitations/device-invitation-protocol.ts +1 -2
- package/src/packlets/invitations/invitation-extension.ts +1 -2
- package/src/packlets/invitations/invitations-handler.ts +1 -2
- package/src/packlets/invitations/invitations-service.ts +1 -2
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -2
- package/src/packlets/locks/node.ts +1 -1
- package/src/packlets/logging/logging-service.ts +17 -9
- package/src/packlets/services/diagnostics.ts +211 -0
- package/src/packlets/services/index.ts +1 -0
- package/src/packlets/services/platform.ts +48 -0
- package/src/packlets/services/service-context.ts +3 -5
- package/src/packlets/services/service-host.test.ts +5 -5
- package/src/packlets/services/service-host.ts +23 -20
- package/src/packlets/services/service-registry.test.ts +1 -0
- package/src/packlets/services/util.ts +33 -0
- package/src/packlets/spaces/data-space-manager.ts +1 -2
- package/src/packlets/spaces/notarization-plugin.ts +1 -2
- package/src/packlets/system/system-service.test.ts +1 -0
- package/src/packlets/system/system-service.ts +34 -2
- package/src/packlets/testing/invitation-utils.ts +1 -2
- package/src/packlets/vault/shell-runtime.ts +1 -2
- package/src/packlets/vault/worker-session.ts +7 -3
- package/src/version.ts +1 -0
- package/dist/lib/browser/chunk-P26UKXYR.mjs.map +0 -7
|
@@ -6,18 +6,22 @@ import { Event } from '@dxos/async';
|
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
7
|
import { Config } from '@dxos/config';
|
|
8
8
|
import {
|
|
9
|
+
GetDiagnosticsRequest,
|
|
9
10
|
SystemService,
|
|
10
11
|
SystemStatus,
|
|
11
12
|
UpdateStatusRequest,
|
|
12
13
|
QueryStatusRequest,
|
|
13
14
|
QueryStatusResponse,
|
|
14
15
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
15
|
-
import { MaybePromise } from '@dxos/util';
|
|
16
|
+
import { jsonKeyReplacer, MaybePromise } from '@dxos/util';
|
|
17
|
+
|
|
18
|
+
import { Diagnostics } from '../services';
|
|
16
19
|
|
|
17
20
|
export type SystemServiceOptions = {
|
|
18
21
|
config?: Config;
|
|
19
22
|
statusUpdate: Event<void>;
|
|
20
23
|
getCurrentStatus: () => SystemStatus;
|
|
24
|
+
getDiagnostics: () => Promise<Partial<Diagnostics>>;
|
|
21
25
|
onUpdateStatus: (status: SystemStatus) => MaybePromise<void>;
|
|
22
26
|
onReset: () => MaybePromise<void>;
|
|
23
27
|
};
|
|
@@ -28,11 +32,20 @@ export class SystemServiceImpl implements SystemService {
|
|
|
28
32
|
private readonly _getCurrentStatus: SystemServiceOptions['getCurrentStatus'];
|
|
29
33
|
private readonly _onUpdateStatus: SystemServiceOptions['onUpdateStatus'];
|
|
30
34
|
private readonly _onReset: SystemServiceOptions['onReset'];
|
|
35
|
+
private readonly _getDiagnostics: SystemServiceOptions['getDiagnostics'];
|
|
31
36
|
|
|
32
|
-
constructor({
|
|
37
|
+
constructor({
|
|
38
|
+
config,
|
|
39
|
+
statusUpdate,
|
|
40
|
+
getDiagnostics,
|
|
41
|
+
onUpdateStatus,
|
|
42
|
+
getCurrentStatus,
|
|
43
|
+
onReset,
|
|
44
|
+
}: SystemServiceOptions) {
|
|
33
45
|
this._config = config;
|
|
34
46
|
this._statusUpdate = statusUpdate;
|
|
35
47
|
this._getCurrentStatus = getCurrentStatus;
|
|
48
|
+
this._getDiagnostics = getDiagnostics;
|
|
36
49
|
this._onUpdateStatus = onUpdateStatus;
|
|
37
50
|
this._onReset = onReset;
|
|
38
51
|
}
|
|
@@ -41,6 +54,25 @@ export class SystemServiceImpl implements SystemService {
|
|
|
41
54
|
return this._config?.values ?? {};
|
|
42
55
|
}
|
|
43
56
|
|
|
57
|
+
/**
|
|
58
|
+
* NOTE: Since this is serialized as a JSON object, we allow the option to serialize keys.
|
|
59
|
+
*/
|
|
60
|
+
async getDiagnostics({ keys }: GetDiagnosticsRequest = {}) {
|
|
61
|
+
const diagnostics = await this._getDiagnostics();
|
|
62
|
+
return {
|
|
63
|
+
timestamp: new Date(),
|
|
64
|
+
diagnostics: JSON.parse(
|
|
65
|
+
JSON.stringify(
|
|
66
|
+
diagnostics,
|
|
67
|
+
jsonKeyReplacer({
|
|
68
|
+
truncate: keys === GetDiagnosticsRequest.KEY_OPTION.TRUNCATE,
|
|
69
|
+
humanize: keys === GetDiagnosticsRequest.KEY_OPTION.HUMANIZE,
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
44
76
|
async updateStatus({ status }: UpdateStatusRequest) {
|
|
45
77
|
await this._onUpdateStatus(status);
|
|
46
78
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import invariant from 'tiny-invariant';
|
|
6
|
-
|
|
7
5
|
import { Trigger } from '@dxos/async';
|
|
8
6
|
import { AuthenticatingInvitationObservable, CancellableInvitationObservable } from '@dxos/client-protocol';
|
|
7
|
+
import { invariant } from '@dxos/invariant';
|
|
9
8
|
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
10
9
|
|
|
11
10
|
import { ServiceContext } from '../services';
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import invariant from 'tiny-invariant';
|
|
6
|
-
|
|
7
5
|
import { Event } from '@dxos/async';
|
|
8
6
|
import { appServiceBundle, AppServiceBundle, ShellRuntime, shellServiceBundle } from '@dxos/client-protocol';
|
|
7
|
+
import { invariant } from '@dxos/invariant';
|
|
9
8
|
import { PublicKey } from '@dxos/keys';
|
|
10
9
|
import { AppContextRequest, LayoutRequest, ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
|
|
11
10
|
import { createProtoRpcPeer, ProtoRpcPeer, RpcPort } from '@dxos/rpc';
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import invariant from 'tiny-invariant';
|
|
6
|
-
|
|
7
5
|
import { asyncTimeout, Trigger } from '@dxos/async';
|
|
8
6
|
import {
|
|
9
7
|
iframeServiceBundle,
|
|
@@ -11,6 +9,7 @@ import {
|
|
|
11
9
|
PROXY_CONNECTION_TIMEOUT,
|
|
12
10
|
workerServiceBundle,
|
|
13
11
|
} from '@dxos/client-protocol';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
14
13
|
import { log, logInfo } from '@dxos/log';
|
|
15
14
|
import { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';
|
|
16
15
|
import { createProtoRpcPeer, ProtoRpcPeer, RpcPort } from '@dxos/rpc';
|
|
@@ -74,6 +73,7 @@ export class WorkerSession {
|
|
|
74
73
|
port: appPort,
|
|
75
74
|
...middleware,
|
|
76
75
|
});
|
|
76
|
+
|
|
77
77
|
this._shellClientRpc = new ClientRpcServer({
|
|
78
78
|
serviceRegistry: this._serviceHost.serviceRegistry,
|
|
79
79
|
port: shellPort,
|
|
@@ -103,7 +103,7 @@ export class WorkerSession {
|
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
port: systemPort,
|
|
106
|
-
timeout:
|
|
106
|
+
timeout: 1_000, // With low timeout heartbeat may fail if the tab's thread is saturated.
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
this.bridgeService = this._iframeRpc.rpc.BridgeService;
|
|
@@ -113,10 +113,14 @@ export class WorkerSession {
|
|
|
113
113
|
log.info('opening...');
|
|
114
114
|
await Promise.all([this._clientRpc.open(), this._iframeRpc.open(), this._maybeOpenShell()]);
|
|
115
115
|
|
|
116
|
+
// Wait until the worker's RPC service has started.
|
|
116
117
|
await this._startTrigger.wait({ timeout: PROXY_CONNECTION_TIMEOUT });
|
|
118
|
+
|
|
119
|
+
// TODO(burdon): Comment required.
|
|
117
120
|
if (this.lockKey) {
|
|
118
121
|
void this._afterLockReleases(this.lockKey, () => this.close());
|
|
119
122
|
}
|
|
123
|
+
|
|
120
124
|
log.info('opened');
|
|
121
125
|
}
|
|
122
126
|
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DXOS_VERSION = "0.1.56-main.a25bb93";
|