@dxos/client-services 0.1.55 → 0.1.56-main.01afb72

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.
Files changed (91) hide show
  1. package/dist/lib/browser/{chunk-XSZIBW37.mjs → chunk-53BV3Q7V.mjs} +1131 -463
  2. package/dist/lib/browser/chunk-53BV3Q7V.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +63 -42
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +13 -4
  7. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  8. package/dist/lib/node/index.cjs +1279 -593
  9. package/dist/lib/node/index.cjs.map +4 -4
  10. package/dist/lib/node/meta.json +1 -1
  11. package/dist/lib/node/packlets/testing/index.cjs +1410 -736
  12. package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
  13. package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -1
  14. package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
  15. package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
  16. package/dist/types/src/packlets/identity/identity.d.ts +3 -2
  17. package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
  18. package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
  19. package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
  20. package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
  21. package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
  22. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
  23. package/dist/types/src/packlets/logging/logging-service.d.ts +6 -2
  24. package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
  25. package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
  26. package/dist/types/src/packlets/services/diagnostics.d.ts +46 -0
  27. package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -0
  28. package/dist/types/src/packlets/services/index.d.ts +1 -0
  29. package/dist/types/src/packlets/services/index.d.ts.map +1 -1
  30. package/dist/types/src/packlets/services/platform.d.ts +16 -0
  31. package/dist/types/src/packlets/services/platform.d.ts.map +1 -0
  32. package/dist/types/src/packlets/services/service-context.d.ts +2 -1
  33. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  34. package/dist/types/src/packlets/services/service-host.d.ts +7 -3
  35. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  36. package/dist/types/src/packlets/services/util.d.ts +6 -0
  37. package/dist/types/src/packlets/services/util.d.ts.map +1 -0
  38. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  39. package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
  40. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  41. package/dist/types/src/packlets/system/system-service.d.ts +12 -2
  42. package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
  43. package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
  44. package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
  45. package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
  46. package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
  47. package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
  48. package/dist/types/src/version.d.ts +2 -0
  49. package/dist/types/src/version.d.ts.map +1 -0
  50. package/package.json +34 -33
  51. package/src/packlets/devices/devices-service.test.ts +2 -1
  52. package/src/packlets/identity/authenticator.test.ts +2 -2
  53. package/src/packlets/identity/identity-manager.test.ts +4 -3
  54. package/src/packlets/identity/identity-manager.ts +10 -7
  55. package/src/packlets/identity/identity-service.test.ts +2 -1
  56. package/src/packlets/identity/identity-service.ts +1 -2
  57. package/src/packlets/identity/identity.test.ts +7 -6
  58. package/src/packlets/identity/identity.ts +9 -5
  59. package/src/packlets/invitations/device-invitation-protocol.test.ts +2 -1
  60. package/src/packlets/invitations/device-invitation-protocol.ts +1 -2
  61. package/src/packlets/invitations/invitation-extension.ts +1 -2
  62. package/src/packlets/invitations/invitations-handler.ts +1 -2
  63. package/src/packlets/invitations/invitations-service.ts +1 -2
  64. package/src/packlets/invitations/space-invitation-protocol.ts +1 -2
  65. package/src/packlets/locks/node.ts +1 -1
  66. package/src/packlets/logging/logging-service.ts +17 -9
  67. package/src/packlets/network/network-service.test.ts +2 -1
  68. package/src/packlets/services/client-rpc-server.ts +4 -4
  69. package/src/packlets/services/diagnostics.ts +211 -0
  70. package/src/packlets/services/index.ts +1 -0
  71. package/src/packlets/services/platform.ts +48 -0
  72. package/src/packlets/services/service-context.ts +14 -11
  73. package/src/packlets/services/service-host.test.ts +11 -10
  74. package/src/packlets/services/service-host.ts +38 -23
  75. package/src/packlets/services/service-registry.test.ts +3 -1
  76. package/src/packlets/services/util.ts +33 -0
  77. package/src/packlets/spaces/data-space-manager.ts +2 -3
  78. package/src/packlets/spaces/data-space.ts +1 -1
  79. package/src/packlets/spaces/notarization-plugin.ts +1 -2
  80. package/src/packlets/spaces/spaces-service.test.ts +2 -1
  81. package/src/packlets/spaces/spaces-service.ts +18 -12
  82. package/src/packlets/system/system-service.test.ts +1 -0
  83. package/src/packlets/system/system-service.ts +34 -2
  84. package/src/packlets/testing/invitation-utils.ts +1 -2
  85. package/src/packlets/testing/test-builder.ts +1 -1
  86. package/src/packlets/vault/iframe-host-runtime.ts +2 -1
  87. package/src/packlets/vault/shell-runtime.ts +1 -2
  88. package/src/packlets/vault/worker-runtime.ts +2 -1
  89. package/src/packlets/vault/worker-session.ts +7 -3
  90. package/src/version.ts +1 -0
  91. package/dist/lib/browser/chunk-XSZIBW37.mjs.map +0 -7
@@ -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';
@@ -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) {
@@ -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';
@@ -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) {
@@ -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: 1000, // With low timeout heartbeat may fail if the tab's thread is saturated.
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.01afb72";