@dxos/client-services 0.3.2 → 0.3.3-main.5b114d4
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-5YN7ZUGL.mjs → chunk-5W67VD6D.mjs} +44 -30
- package/dist/lib/browser/chunk-5W67VD6D.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +2 -2
- package/dist/lib/node/index.cjs +93 -79
- 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 +116 -102
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/services/diagnostics.d.ts +4 -1
- package/dist/types/src/packlets/services/diagnostics.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 -35
- package/src/packlets/services/diagnostics.ts +23 -0
- package/src/version.ts +1 -5
- package/dist/lib/browser/chunk-5YN7ZUGL.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -413,7 +413,7 @@ var import_context2 = require("@dxos/context");
|
|
|
413
413
|
var import_credentials = require("@dxos/credentials");
|
|
414
414
|
var import_log = require("@dxos/log");
|
|
415
415
|
var import_protocols = require("@dxos/protocols");
|
|
416
|
-
var __dxlog_file = "/
|
|
416
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
|
|
417
417
|
var Credential = import_protocols.schema.getCodecForType("dxos.halo.credentials.Credential");
|
|
418
418
|
var createAuthProvider = (signer) => async (nonce) => {
|
|
419
419
|
const credential = await signer.createCredential({
|
|
@@ -544,7 +544,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
544
544
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
545
545
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
546
546
|
}
|
|
547
|
-
var __dxlog_file2 = "/
|
|
547
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
548
548
|
var Identity = class Identity2 {
|
|
549
549
|
constructor({ space, signer, identityKey, deviceKey }) {
|
|
550
550
|
this.stateUpdate = new import_async5.Event();
|
|
@@ -726,7 +726,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
726
726
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
727
727
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
728
728
|
}
|
|
729
|
-
var __dxlog_file3 = "/
|
|
729
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
730
730
|
var IdentityManager = class IdentityManager2 {
|
|
731
731
|
// TODO(burdon): IdentityManagerParams.
|
|
732
732
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -1086,7 +1086,7 @@ var import_codec_protobuf7 = require("@dxos/codec-protobuf");
|
|
|
1086
1086
|
var import_credentials6 = require("@dxos/credentials");
|
|
1087
1087
|
var import_debug2 = require("@dxos/debug");
|
|
1088
1088
|
var import_invariant3 = require("@dxos/invariant");
|
|
1089
|
-
var __dxlog_file4 = "/
|
|
1089
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1090
1090
|
var IdentityServiceImpl = class {
|
|
1091
1091
|
constructor(_createIdentity, _identityManager, _keyring) {
|
|
1092
1092
|
this._createIdentity = _createIdentity;
|
|
@@ -1155,7 +1155,7 @@ var IdentityServiceImpl = class {
|
|
|
1155
1155
|
// packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
|
|
1156
1156
|
var import_invariant4 = require("@dxos/invariant");
|
|
1157
1157
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
1158
|
-
var __dxlog_file5 = "/
|
|
1158
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
|
|
1159
1159
|
var DeviceInvitationProtocol = class {
|
|
1160
1160
|
constructor(_keyring, _getIdentity, _acceptIdentity) {
|
|
1161
1161
|
this._keyring = _keyring;
|
|
@@ -1265,7 +1265,7 @@ var import_protocols3 = require("@dxos/protocols");
|
|
|
1265
1265
|
var import_services2 = require("@dxos/protocols/proto/dxos/client/services");
|
|
1266
1266
|
var import_invitations = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
1267
1267
|
var import_teleport = require("@dxos/teleport");
|
|
1268
|
-
var __dxlog_file6 = "/
|
|
1268
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
|
|
1269
1269
|
var OPTIONS_TIMEOUT = 1e4;
|
|
1270
1270
|
var MAX_OTP_ATTEMPTS = 3;
|
|
1271
1271
|
var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
@@ -1596,7 +1596,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1596
1596
|
var isAuthenticationRequired = (invitation) => invitation.authMethod !== import_services2.Invitation.AuthMethod.NONE;
|
|
1597
1597
|
|
|
1598
1598
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1599
|
-
var __dxlog_file7 = "/
|
|
1599
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
|
|
1600
1600
|
var InvitationsHandler = class {
|
|
1601
1601
|
/**
|
|
1602
1602
|
* @internal
|
|
@@ -2155,7 +2155,7 @@ var import_codec_protobuf8 = require("@dxos/codec-protobuf");
|
|
|
2155
2155
|
var import_invariant7 = require("@dxos/invariant");
|
|
2156
2156
|
var import_log6 = require("@dxos/log");
|
|
2157
2157
|
var import_services4 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2158
|
-
var __dxlog_file8 = "/
|
|
2158
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
|
|
2159
2159
|
var InvitationsServiceImpl = class {
|
|
2160
2160
|
constructor(_invitationsHandler, _getHandler) {
|
|
2161
2161
|
this._invitationsHandler = _invitationsHandler;
|
|
@@ -2337,7 +2337,7 @@ var import_feed_store3 = require("@dxos/feed-store");
|
|
|
2337
2337
|
var import_invariant8 = require("@dxos/invariant");
|
|
2338
2338
|
var import_log7 = require("@dxos/log");
|
|
2339
2339
|
var import_services5 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2340
|
-
var __dxlog_file9 = "/
|
|
2340
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
|
|
2341
2341
|
var SpaceInvitationProtocol = class {
|
|
2342
2342
|
constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
|
|
2343
2343
|
this._spaceManager = _spaceManager;
|
|
@@ -2538,6 +2538,7 @@ var ClientRpcServer = class {
|
|
|
2538
2538
|
};
|
|
2539
2539
|
|
|
2540
2540
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2541
|
+
var import_async10 = require("@dxos/async");
|
|
2541
2542
|
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
2542
2543
|
var import_credentials9 = require("@dxos/credentials");
|
|
2543
2544
|
var import_document_model = require("@dxos/document-model");
|
|
@@ -2576,10 +2577,10 @@ var getPlatform = () => {
|
|
|
2576
2577
|
};
|
|
2577
2578
|
|
|
2578
2579
|
// packages/sdk/client-services/src/version.ts
|
|
2579
|
-
var DXOS_VERSION = "0.3.
|
|
2580
|
+
var DXOS_VERSION = "0.3.3-main.5b114d4";
|
|
2580
2581
|
|
|
2581
2582
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2582
|
-
var __dxlog_file10 = "/
|
|
2583
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2583
2584
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2584
2585
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
2585
2586
|
const diagnostics = {
|
|
@@ -2595,7 +2596,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2595
2596
|
{
|
|
2596
2597
|
(0, import_invariant9.invariant)(clientServices.LoggingService, "SystemService is not available.", {
|
|
2597
2598
|
F: __dxlog_file10,
|
|
2598
|
-
L:
|
|
2599
|
+
L: 93,
|
|
2599
2600
|
S: void 0,
|
|
2600
2601
|
A: [
|
|
2601
2602
|
"clientServices.LoggingService",
|
|
@@ -2628,6 +2629,19 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2628
2629
|
bytes,
|
|
2629
2630
|
length
|
|
2630
2631
|
}));
|
|
2632
|
+
const status = await (0, import_codec_protobuf10.getFirstStreamValue)(clientServices.NetworkService.queryStatus(), {
|
|
2633
|
+
timeout: DEFAULT_TIMEOUT
|
|
2634
|
+
}).catch(() => void 0);
|
|
2635
|
+
diagnostics.networkStatus = status;
|
|
2636
|
+
const swarmInfoDone = new import_async10.Trigger();
|
|
2637
|
+
serviceContext.networkManager.connectionLog?.update.on(async () => {
|
|
2638
|
+
const swarms = serviceContext.networkManager.connectionLog?.swarms;
|
|
2639
|
+
diagnostics.swarms = swarms;
|
|
2640
|
+
await swarmInfoDone.wake();
|
|
2641
|
+
});
|
|
2642
|
+
await swarmInfoDone.wait({
|
|
2643
|
+
timeout: DEFAULT_TIMEOUT
|
|
2644
|
+
});
|
|
2631
2645
|
}
|
|
2632
2646
|
diagnostics.config = config.values;
|
|
2633
2647
|
return diagnostics;
|
|
@@ -2641,7 +2655,7 @@ var getProperties = (space) => {
|
|
|
2641
2655
|
} catch (err) {
|
|
2642
2656
|
import_log8.log.warn(err.message, void 0, {
|
|
2643
2657
|
F: __dxlog_file10,
|
|
2644
|
-
L:
|
|
2658
|
+
L: 168,
|
|
2645
2659
|
S: void 0,
|
|
2646
2660
|
C: (f, a) => f(...a)
|
|
2647
2661
|
});
|
|
@@ -2697,7 +2711,7 @@ var getSpaceStats = async (space) => {
|
|
|
2697
2711
|
};
|
|
2698
2712
|
|
|
2699
2713
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
2700
|
-
var
|
|
2714
|
+
var import_async15 = require("@dxos/async");
|
|
2701
2715
|
var import_context9 = require("@dxos/context");
|
|
2702
2716
|
var import_credentials14 = require("@dxos/credentials");
|
|
2703
2717
|
var import_debug7 = require("@dxos/debug");
|
|
@@ -2714,7 +2728,7 @@ var import_tracing4 = require("@dxos/tracing");
|
|
|
2714
2728
|
var import_util7 = require("@dxos/util");
|
|
2715
2729
|
|
|
2716
2730
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2717
|
-
var
|
|
2731
|
+
var import_async13 = require("@dxos/async");
|
|
2718
2732
|
var import_context8 = require("@dxos/context");
|
|
2719
2733
|
var import_credentials13 = require("@dxos/credentials");
|
|
2720
2734
|
var import_invariant11 = require("@dxos/invariant");
|
|
@@ -2726,7 +2740,7 @@ var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip"
|
|
|
2726
2740
|
var import_util6 = require("@dxos/util");
|
|
2727
2741
|
|
|
2728
2742
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2729
|
-
var
|
|
2743
|
+
var import_async12 = require("@dxos/async");
|
|
2730
2744
|
var import_client_protocol3 = require("@dxos/client-protocol");
|
|
2731
2745
|
var import_context7 = require("@dxos/context");
|
|
2732
2746
|
var import_debug4 = require("@dxos/debug");
|
|
@@ -2741,7 +2755,7 @@ var import_tracing3 = require("@dxos/tracing");
|
|
|
2741
2755
|
var import_util5 = require("@dxos/util");
|
|
2742
2756
|
|
|
2743
2757
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2744
|
-
var
|
|
2758
|
+
var import_async11 = require("@dxos/async");
|
|
2745
2759
|
var import_context6 = require("@dxos/context");
|
|
2746
2760
|
var import_invariant10 = require("@dxos/invariant");
|
|
2747
2761
|
var import_keys8 = require("@dxos/keys");
|
|
@@ -2749,7 +2763,7 @@ var import_log9 = require("@dxos/log");
|
|
|
2749
2763
|
var import_protocols6 = require("@dxos/protocols");
|
|
2750
2764
|
var import_teleport2 = require("@dxos/teleport");
|
|
2751
2765
|
var import_util4 = require("@dxos/util");
|
|
2752
|
-
var __dxlog_file11 = "/
|
|
2766
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2753
2767
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2754
2768
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2755
2769
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2757,7 +2771,7 @@ var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
|
|
|
2757
2771
|
var NotarizationPlugin = class {
|
|
2758
2772
|
constructor() {
|
|
2759
2773
|
this._ctx = new import_context6.Context();
|
|
2760
|
-
this._extensionOpened = new
|
|
2774
|
+
this._extensionOpened = new import_async11.Event();
|
|
2761
2775
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2762
2776
|
this._processedCredentials = new import_util4.ComplexSet(import_keys8.PublicKey.hash);
|
|
2763
2777
|
this._processCredentialsTriggers = new import_util4.ComplexMap(import_keys8.PublicKey.hash);
|
|
@@ -2791,7 +2805,7 @@ var NotarizationPlugin = class {
|
|
|
2791
2805
|
"'Credentials must have an id'"
|
|
2792
2806
|
]
|
|
2793
2807
|
});
|
|
2794
|
-
const errors = new
|
|
2808
|
+
const errors = new import_async11.Trigger();
|
|
2795
2809
|
const ctx = this._ctx.derive({
|
|
2796
2810
|
onError: (err) => {
|
|
2797
2811
|
import_log9.log.warn("Notarization error", {
|
|
@@ -2808,7 +2822,7 @@ var NotarizationPlugin = class {
|
|
|
2808
2822
|
});
|
|
2809
2823
|
opCtx?.onDispose(() => ctx.dispose());
|
|
2810
2824
|
if (timeout !== 0) {
|
|
2811
|
-
(0,
|
|
2825
|
+
(0, import_async11.scheduleTask)(ctx, () => {
|
|
2812
2826
|
import_log9.log.warn("Notarization timeout", {
|
|
2813
2827
|
timeout,
|
|
2814
2828
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
@@ -2819,12 +2833,12 @@ var NotarizationPlugin = class {
|
|
|
2819
2833
|
C: (f, a) => f(...a)
|
|
2820
2834
|
});
|
|
2821
2835
|
void ctx.dispose();
|
|
2822
|
-
errors.throw(new
|
|
2836
|
+
errors.throw(new import_async11.TimeoutError(timeout, "Notarization timed out"));
|
|
2823
2837
|
}, timeout);
|
|
2824
2838
|
}
|
|
2825
2839
|
const allNotarized = Promise.all(credentials.map((credential) => this._waitUntilProcessed(credential.id)));
|
|
2826
2840
|
const peersTried = /* @__PURE__ */ new Set();
|
|
2827
|
-
const notarizeTask = new
|
|
2841
|
+
const notarizeTask = new import_async11.DeferredTask(ctx, async () => {
|
|
2828
2842
|
try {
|
|
2829
2843
|
if (this._extensions.size === 0) {
|
|
2830
2844
|
return;
|
|
@@ -2842,7 +2856,7 @@ var NotarizationPlugin = class {
|
|
|
2842
2856
|
C: (f, a) => f(...a)
|
|
2843
2857
|
});
|
|
2844
2858
|
peersTried.clear();
|
|
2845
|
-
(0,
|
|
2859
|
+
(0, import_async11.scheduleTask)(ctx, () => notarizeTask.schedule(), retryTimeout);
|
|
2846
2860
|
return;
|
|
2847
2861
|
}
|
|
2848
2862
|
peersTried.add(peer);
|
|
@@ -2864,7 +2878,7 @@ var NotarizationPlugin = class {
|
|
|
2864
2878
|
S: this,
|
|
2865
2879
|
C: (f, a) => f(...a)
|
|
2866
2880
|
});
|
|
2867
|
-
await (0,
|
|
2881
|
+
await (0, import_async11.sleep)(successDelay);
|
|
2868
2882
|
} catch (err) {
|
|
2869
2883
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2870
2884
|
import_log9.log.warn("error notarizing (recoverable)", err, {
|
|
@@ -2922,7 +2936,7 @@ var NotarizationPlugin = class {
|
|
|
2922
2936
|
if (this._processedCredentials.has(id)) {
|
|
2923
2937
|
return;
|
|
2924
2938
|
}
|
|
2925
|
-
await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new
|
|
2939
|
+
await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new import_async11.Trigger()).value.wait();
|
|
2926
2940
|
}
|
|
2927
2941
|
/**
|
|
2928
2942
|
* Requests from other peers to notarize credentials.
|
|
@@ -3019,7 +3033,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
3019
3033
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3020
3034
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3021
3035
|
}
|
|
3022
|
-
var __dxlog_file12 = "/
|
|
3036
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
3023
3037
|
var ENABLE_FEED_PURGE = false;
|
|
3024
3038
|
var DataSpace = class DataSpace2 {
|
|
3025
3039
|
constructor(params) {
|
|
@@ -3030,7 +3044,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3030
3044
|
* Error for _state === SpaceState.ERROR.
|
|
3031
3045
|
*/
|
|
3032
3046
|
this.error = void 0;
|
|
3033
|
-
this.stateUpdate = new
|
|
3047
|
+
this.stateUpdate = new import_async12.Event();
|
|
3034
3048
|
this.metrics = {};
|
|
3035
3049
|
this._inner = params.inner;
|
|
3036
3050
|
this._inner.stateUpdate.on(this._ctx, () => this.stateUpdate.emit());
|
|
@@ -3136,7 +3150,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3136
3150
|
* Initialize the data pipeline in a separate task.
|
|
3137
3151
|
*/
|
|
3138
3152
|
initializeDataPipelineAsync() {
|
|
3139
|
-
(0,
|
|
3153
|
+
(0, import_async12.scheduleTask)(this._ctx, async () => {
|
|
3140
3154
|
try {
|
|
3141
3155
|
this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
|
|
3142
3156
|
await this.initializeDataPipeline();
|
|
@@ -3186,7 +3200,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3186
3200
|
C: (f, a) => f(...a)
|
|
3187
3201
|
});
|
|
3188
3202
|
await this._initializeAndReadControlPipeline();
|
|
3189
|
-
await (0,
|
|
3203
|
+
await (0, import_async12.sleep)(1);
|
|
3190
3204
|
await this._inner.initializeDataPipeline();
|
|
3191
3205
|
this.metrics.dataPipelineOpen = /* @__PURE__ */ new Date();
|
|
3192
3206
|
await (0, import_context7.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
@@ -3342,10 +3356,10 @@ var DataSpace = class DataSpace2 {
|
|
|
3342
3356
|
}
|
|
3343
3357
|
};
|
|
3344
3358
|
_ts_decorate3([
|
|
3345
|
-
|
|
3359
|
+
import_async12.synchronized
|
|
3346
3360
|
], DataSpace.prototype, "open", null);
|
|
3347
3361
|
_ts_decorate3([
|
|
3348
|
-
|
|
3362
|
+
import_async12.synchronized
|
|
3349
3363
|
], DataSpace.prototype, "close", null);
|
|
3350
3364
|
_ts_decorate3([
|
|
3351
3365
|
import_tracing3.trace.span({
|
|
@@ -3361,13 +3375,13 @@ _ts_decorate3([
|
|
|
3361
3375
|
(0, import_debug4.timed)(1e4)
|
|
3362
3376
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
3363
3377
|
_ts_decorate3([
|
|
3364
|
-
|
|
3378
|
+
import_async12.synchronized
|
|
3365
3379
|
], DataSpace.prototype, "activate", null);
|
|
3366
3380
|
_ts_decorate3([
|
|
3367
|
-
|
|
3381
|
+
import_async12.synchronized
|
|
3368
3382
|
], DataSpace.prototype, "deactivate", null);
|
|
3369
3383
|
DataSpace = _ts_decorate3([
|
|
3370
|
-
(0,
|
|
3384
|
+
(0, import_async12.trackLeaks)("open", "close")
|
|
3371
3385
|
], DataSpace);
|
|
3372
3386
|
|
|
3373
3387
|
// packages/sdk/client-services/src/packlets/spaces/genesis.ts
|
|
@@ -3450,7 +3464,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
3450
3464
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3451
3465
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3452
3466
|
}
|
|
3453
|
-
var __dxlog_file13 = "/
|
|
3467
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3454
3468
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3455
3469
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3456
3470
|
this._spaceManager = _spaceManager;
|
|
@@ -3460,7 +3474,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3460
3474
|
this._signingContext = _signingContext;
|
|
3461
3475
|
this._feedStore = _feedStore;
|
|
3462
3476
|
this._ctx = new import_context8.Context();
|
|
3463
|
-
this.updated = new
|
|
3477
|
+
this.updated = new import_async13.Event();
|
|
3464
3478
|
this._spaces = new import_util6.ComplexMap(import_keys10.PublicKey.hash);
|
|
3465
3479
|
this._isOpen = false;
|
|
3466
3480
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
@@ -3757,30 +3771,30 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3757
3771
|
}
|
|
3758
3772
|
};
|
|
3759
3773
|
_ts_decorate4([
|
|
3760
|
-
|
|
3774
|
+
import_async13.synchronized
|
|
3761
3775
|
], DataSpaceManager.prototype, "open", null);
|
|
3762
3776
|
_ts_decorate4([
|
|
3763
|
-
|
|
3777
|
+
import_async13.synchronized
|
|
3764
3778
|
], DataSpaceManager.prototype, "close", null);
|
|
3765
3779
|
_ts_decorate4([
|
|
3766
|
-
|
|
3780
|
+
import_async13.synchronized
|
|
3767
3781
|
], DataSpaceManager.prototype, "createSpace", null);
|
|
3768
3782
|
_ts_decorate4([
|
|
3769
|
-
|
|
3783
|
+
import_async13.synchronized
|
|
3770
3784
|
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
3771
3785
|
DataSpaceManager = _ts_decorate4([
|
|
3772
|
-
(0,
|
|
3786
|
+
(0, import_async13.trackLeaks)("open", "close")
|
|
3773
3787
|
], DataSpaceManager);
|
|
3774
3788
|
|
|
3775
3789
|
// packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
|
|
3776
|
-
var
|
|
3790
|
+
var import_async14 = require("@dxos/async");
|
|
3777
3791
|
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
3778
3792
|
var import_debug6 = require("@dxos/debug");
|
|
3779
3793
|
var import_invariant12 = require("@dxos/invariant");
|
|
3780
3794
|
var import_log12 = require("@dxos/log");
|
|
3781
3795
|
var import_protocols9 = require("@dxos/protocols");
|
|
3782
3796
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3783
|
-
var __dxlog_file14 = "/
|
|
3797
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3784
3798
|
var SpacesServiceImpl = class {
|
|
3785
3799
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
3786
3800
|
this._identityManager = _identityManager;
|
|
@@ -3814,7 +3828,7 @@ var SpacesServiceImpl = class {
|
|
|
3814
3828
|
}
|
|
3815
3829
|
querySpaces() {
|
|
3816
3830
|
return new import_codec_protobuf11.Stream(({ next, ctx }) => {
|
|
3817
|
-
const scheduler = new
|
|
3831
|
+
const scheduler = new import_async14.UpdateScheduler(ctx, async () => {
|
|
3818
3832
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3819
3833
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
3820
3834
|
(0, import_log12.log)("update", {
|
|
@@ -3831,9 +3845,9 @@ var SpacesServiceImpl = class {
|
|
|
3831
3845
|
}, {
|
|
3832
3846
|
maxFrequency: process.env.NODE_ENV === "test" ? void 0 : 2
|
|
3833
3847
|
});
|
|
3834
|
-
(0,
|
|
3848
|
+
(0, import_async14.scheduleTask)(ctx, async () => {
|
|
3835
3849
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3836
|
-
const subscriptions = new
|
|
3850
|
+
const subscriptions = new import_async14.EventSubscriptions();
|
|
3837
3851
|
ctx.onDispose(() => subscriptions.clear());
|
|
3838
3852
|
const subscribeSpaces = () => {
|
|
3839
3853
|
subscriptions.clear();
|
|
@@ -3868,7 +3882,7 @@ var SpacesServiceImpl = class {
|
|
|
3868
3882
|
}
|
|
3869
3883
|
subscribeMessages({ spaceKey, channel }) {
|
|
3870
3884
|
return new import_codec_protobuf11.Stream(({ ctx, next }) => {
|
|
3871
|
-
(0,
|
|
3885
|
+
(0, import_async14.scheduleTask)(ctx, async () => {
|
|
3872
3886
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3873
3887
|
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3874
3888
|
const handle = space.listen(getChannelId(channel), (message) => {
|
|
@@ -3887,7 +3901,7 @@ var SpacesServiceImpl = class {
|
|
|
3887
3901
|
}
|
|
3888
3902
|
};
|
|
3889
3903
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3890
|
-
(0,
|
|
3904
|
+
(0, import_async14.scheduleTask)(ctx, async () => {
|
|
3891
3905
|
await space.spaceState.addCredentialProcessor(processor);
|
|
3892
3906
|
if (noTail) {
|
|
3893
3907
|
close();
|
|
@@ -4004,14 +4018,14 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
4004
4018
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4005
4019
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4006
4020
|
}
|
|
4007
|
-
var __dxlog_file15 = "/
|
|
4021
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
4008
4022
|
var ServiceContext = class ServiceContext2 {
|
|
4009
4023
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
4010
4024
|
this.storage = storage;
|
|
4011
4025
|
this.networkManager = networkManager;
|
|
4012
4026
|
this.signalManager = signalManager;
|
|
4013
4027
|
this.modelFactory = modelFactory;
|
|
4014
|
-
this.initialized = new
|
|
4028
|
+
this.initialized = new import_async15.Trigger();
|
|
4015
4029
|
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
4016
4030
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
4017
4031
|
this._instanceId = import_keys11.PublicKey.random().toHex();
|
|
@@ -4240,7 +4254,7 @@ ServiceContext = _ts_decorate5([
|
|
|
4240
4254
|
], ServiceContext);
|
|
4241
4255
|
|
|
4242
4256
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4243
|
-
var
|
|
4257
|
+
var import_async18 = require("@dxos/async");
|
|
4244
4258
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
4245
4259
|
var import_context10 = require("@dxos/context");
|
|
4246
4260
|
var import_document_model2 = require("@dxos/document-model");
|
|
@@ -4283,7 +4297,7 @@ var ServiceRegistry = class {
|
|
|
4283
4297
|
};
|
|
4284
4298
|
|
|
4285
4299
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
4286
|
-
var
|
|
4300
|
+
var import_async16 = require("@dxos/async");
|
|
4287
4301
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
4288
4302
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4289
4303
|
var DevicesServiceImpl = class {
|
|
@@ -4311,7 +4325,7 @@ var DevicesServiceImpl = class {
|
|
|
4311
4325
|
});
|
|
4312
4326
|
}
|
|
4313
4327
|
};
|
|
4314
|
-
const subscriptions = new
|
|
4328
|
+
const subscriptions = new import_async16.EventSubscriptions();
|
|
4315
4329
|
subscriptions.add(this._identityManager.stateUpdate.on(() => {
|
|
4316
4330
|
update();
|
|
4317
4331
|
if (this._identityManager.identity) {
|
|
@@ -4340,7 +4354,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4340
4354
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4341
4355
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4342
4356
|
}
|
|
4343
|
-
var __dxlog_file16 = "/
|
|
4357
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
|
|
4344
4358
|
var Lock = class {
|
|
4345
4359
|
constructor({ lockKey: lockPath, onAcquire, onRelease }) {
|
|
4346
4360
|
this._lockPath = lockPath;
|
|
@@ -4386,14 +4400,14 @@ _ts_decorate6([
|
|
|
4386
4400
|
var isLocked = (lockPath) => import_lock_file.LockFile.isLocked(lockPath);
|
|
4387
4401
|
|
|
4388
4402
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
4389
|
-
var
|
|
4403
|
+
var import_async17 = require("@dxos/async");
|
|
4390
4404
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
4391
4405
|
var import_log15 = require("@dxos/log");
|
|
4392
4406
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4393
4407
|
var import_util8 = require("@dxos/util");
|
|
4394
4408
|
var LoggingServiceImpl = class {
|
|
4395
4409
|
constructor() {
|
|
4396
|
-
this._logs = new
|
|
4410
|
+
this._logs = new import_async17.Event();
|
|
4397
4411
|
this._started = /* @__PURE__ */ new Date();
|
|
4398
4412
|
this._logProcessor = (_config, entry2) => {
|
|
4399
4413
|
this._logs.emit(entry2);
|
|
@@ -4648,7 +4662,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4648
4662
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4649
4663
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4650
4664
|
}
|
|
4651
|
-
var __dxlog_file17 = "/
|
|
4665
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4652
4666
|
var createDefaultModelFactory = () => {
|
|
4653
4667
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4654
4668
|
};
|
|
@@ -4676,7 +4690,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4676
4690
|
callbacks
|
|
4677
4691
|
} = {}) {
|
|
4678
4692
|
this._tracingService = import_tracing5.TRACE_PROCESSOR.createTraceSender();
|
|
4679
|
-
this._statusUpdate = new
|
|
4693
|
+
this._statusUpdate = new import_async18.Event();
|
|
4680
4694
|
this._opening = false;
|
|
4681
4695
|
this._open = false;
|
|
4682
4696
|
this._storage = storage;
|
|
@@ -5007,11 +5021,11 @@ _ts_decorate7([
|
|
|
5007
5021
|
import_tracing5.trace.info()
|
|
5008
5022
|
], ClientServicesHost.prototype, "_open", void 0);
|
|
5009
5023
|
_ts_decorate7([
|
|
5010
|
-
|
|
5024
|
+
import_async18.synchronized,
|
|
5011
5025
|
import_tracing5.trace.span()
|
|
5012
5026
|
], ClientServicesHost.prototype, "open", null);
|
|
5013
5027
|
_ts_decorate7([
|
|
5014
|
-
|
|
5028
|
+
import_async18.synchronized,
|
|
5015
5029
|
import_tracing5.trace.span()
|
|
5016
5030
|
], ClientServicesHost.prototype, "close", null);
|
|
5017
5031
|
ClientServicesHost = _ts_decorate7([
|
|
@@ -5019,7 +5033,7 @@ ClientServicesHost = _ts_decorate7([
|
|
|
5019
5033
|
], ClientServicesHost);
|
|
5020
5034
|
|
|
5021
5035
|
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
5022
|
-
var
|
|
5036
|
+
var import_async20 = require("@dxos/async");
|
|
5023
5037
|
var import_client_protocol7 = require("@dxos/client-protocol");
|
|
5024
5038
|
var import_context11 = require("@dxos/context");
|
|
5025
5039
|
var import_log17 = require("@dxos/log");
|
|
@@ -5028,16 +5042,16 @@ var import_network_manager3 = require("@dxos/network-manager");
|
|
|
5028
5042
|
var import_util11 = require("@dxos/util");
|
|
5029
5043
|
|
|
5030
5044
|
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
5031
|
-
var
|
|
5045
|
+
var import_async19 = require("@dxos/async");
|
|
5032
5046
|
var import_client_protocol6 = require("@dxos/client-protocol");
|
|
5033
5047
|
var import_invariant16 = require("@dxos/invariant");
|
|
5034
5048
|
var import_iframe = require("@dxos/protocols/proto/dxos/iframe");
|
|
5035
5049
|
var import_rpc2 = require("@dxos/rpc");
|
|
5036
|
-
var __dxlog_file18 = "/
|
|
5050
|
+
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/shell-runtime.ts";
|
|
5037
5051
|
var ShellRuntimeImpl = class {
|
|
5038
5052
|
constructor(_port) {
|
|
5039
5053
|
this._port = _port;
|
|
5040
|
-
this.layoutUpdate = new
|
|
5054
|
+
this.layoutUpdate = new import_async19.Event();
|
|
5041
5055
|
this._layout = import_iframe.ShellLayout.DEFAULT;
|
|
5042
5056
|
}
|
|
5043
5057
|
get layout() {
|
|
@@ -5106,11 +5120,11 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
5106
5120
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5107
5121
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5108
5122
|
}
|
|
5109
|
-
var __dxlog_file19 = "/
|
|
5123
|
+
var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts";
|
|
5110
5124
|
var LOCK_KEY = "DXOS_RESOURCE_LOCK";
|
|
5111
5125
|
var IFrameHostRuntime = class {
|
|
5112
5126
|
constructor({ config, origin, appPort, shellPort }) {
|
|
5113
|
-
this._ready = new
|
|
5127
|
+
this._ready = new import_async20.Trigger();
|
|
5114
5128
|
this._configProvider = config;
|
|
5115
5129
|
this.origin = origin;
|
|
5116
5130
|
this._appPort = appPort;
|
|
@@ -5214,18 +5228,18 @@ _ts_decorate8([
|
|
|
5214
5228
|
], IFrameHostRuntime.prototype, "origin", void 0);
|
|
5215
5229
|
|
|
5216
5230
|
// packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
|
|
5217
|
-
var
|
|
5231
|
+
var import_async21 = require("@dxos/async");
|
|
5218
5232
|
var import_client_protocol8 = require("@dxos/client-protocol");
|
|
5219
5233
|
var import_log18 = require("@dxos/log");
|
|
5220
5234
|
var import_network_manager4 = require("@dxos/network-manager");
|
|
5221
5235
|
var import_protocols13 = require("@dxos/protocols");
|
|
5222
5236
|
var import_rpc3 = require("@dxos/rpc");
|
|
5223
5237
|
var import_util12 = require("@dxos/util");
|
|
5224
|
-
var __dxlog_file20 = "/
|
|
5238
|
+
var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts";
|
|
5225
5239
|
var IFrameProxyRuntime = class {
|
|
5226
5240
|
constructor({ config, systemPort, shellPort }) {
|
|
5227
5241
|
this._id = String(Math.floor(Math.random() * 1e6));
|
|
5228
|
-
this._release = new
|
|
5242
|
+
this._release = new import_async21.Trigger();
|
|
5229
5243
|
this._configProvider = config;
|
|
5230
5244
|
this._systemPort = systemPort;
|
|
5231
5245
|
this._shellPort = shellPort;
|
|
@@ -5253,8 +5267,8 @@ var IFrameProxyRuntime = class {
|
|
|
5253
5267
|
let lockKey;
|
|
5254
5268
|
if (typeof navigator !== "undefined") {
|
|
5255
5269
|
lockKey = this._lockKey(origin);
|
|
5256
|
-
this._release = new
|
|
5257
|
-
const ready = new
|
|
5270
|
+
this._release = new import_async21.Trigger();
|
|
5271
|
+
const ready = new import_async21.Trigger();
|
|
5258
5272
|
void navigator.locks.request(lockKey, async () => {
|
|
5259
5273
|
ready.wake();
|
|
5260
5274
|
await this._release.wait();
|
|
@@ -5290,14 +5304,14 @@ var IFrameProxyRuntime = class {
|
|
|
5290
5304
|
};
|
|
5291
5305
|
|
|
5292
5306
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
5293
|
-
var
|
|
5307
|
+
var import_async23 = require("@dxos/async");
|
|
5294
5308
|
var import_context12 = require("@dxos/context");
|
|
5295
5309
|
var import_log20 = require("@dxos/log");
|
|
5296
5310
|
var import_messaging3 = require("@dxos/messaging");
|
|
5297
5311
|
var import_network_manager5 = require("@dxos/network-manager");
|
|
5298
5312
|
|
|
5299
5313
|
// packages/sdk/client-services/src/packlets/vault/worker-session.ts
|
|
5300
|
-
var
|
|
5314
|
+
var import_async22 = require("@dxos/async");
|
|
5301
5315
|
var import_client_protocol9 = require("@dxos/client-protocol");
|
|
5302
5316
|
var import_invariant17 = require("@dxos/invariant");
|
|
5303
5317
|
var import_log19 = require("@dxos/log");
|
|
@@ -5313,10 +5327,10 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
5313
5327
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5314
5328
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5315
5329
|
}
|
|
5316
|
-
var __dxlog_file21 = "/
|
|
5330
|
+
var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-session.ts";
|
|
5317
5331
|
var WorkerSession = class {
|
|
5318
5332
|
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
5319
|
-
this._startTrigger = new
|
|
5333
|
+
this._startTrigger = new import_async22.Trigger();
|
|
5320
5334
|
this.onClose = new import_util13.Callback();
|
|
5321
5335
|
(0, import_invariant17.invariant)(serviceHost, void 0, {
|
|
5322
5336
|
F: __dxlog_file21,
|
|
@@ -5444,7 +5458,7 @@ var WorkerSession = class {
|
|
|
5444
5458
|
}
|
|
5445
5459
|
async _maybeOpenShell() {
|
|
5446
5460
|
try {
|
|
5447
|
-
await (0,
|
|
5461
|
+
await (0, import_async22.asyncTimeout)(this._shellClientRpc.open(), 1e3);
|
|
5448
5462
|
} catch {
|
|
5449
5463
|
import_log19.log.info("No shell connected.", void 0, {
|
|
5450
5464
|
F: __dxlog_file21,
|
|
@@ -5467,12 +5481,12 @@ _ts_decorate9([
|
|
|
5467
5481
|
], WorkerSession.prototype, "lockKey", void 0);
|
|
5468
5482
|
|
|
5469
5483
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
5470
|
-
var __dxlog_file22 = "/
|
|
5484
|
+
var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-runtime.ts";
|
|
5471
5485
|
var WorkerRuntime = class {
|
|
5472
5486
|
constructor(_configProvider) {
|
|
5473
5487
|
this._configProvider = _configProvider;
|
|
5474
5488
|
this._transportFactory = new import_network_manager5.SimplePeerTransportProxyFactory();
|
|
5475
|
-
this._ready = new
|
|
5489
|
+
this._ready = new import_async23.Trigger();
|
|
5476
5490
|
this._sessions = /* @__PURE__ */ new Set();
|
|
5477
5491
|
this._clientServices = new ClientServicesHost({
|
|
5478
5492
|
callbacks: {
|