@dxos/client-services 0.3.2 → 0.3.3-main.1b7ca63
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-L2DNXWJ5.mjs} +116 -73
- package/dist/lib/browser/chunk-L2DNXWJ5.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 +170 -127
- 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 +247 -157
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/services/client-rpc-server.d.ts +2 -0
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- 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/client-rpc-server.ts +18 -1
- 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;
|
|
@@ -2489,9 +2489,21 @@ var SpaceInvitationProtocol = class {
|
|
|
2489
2489
|
var import_codec_protobuf9 = require("@dxos/codec-protobuf");
|
|
2490
2490
|
var import_debug3 = require("@dxos/debug");
|
|
2491
2491
|
var import_rpc = require("@dxos/rpc");
|
|
2492
|
-
var
|
|
2492
|
+
var import_tracing3 = require("@dxos/tracing");
|
|
2493
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
2494
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2495
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2496
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2497
|
+
else
|
|
2498
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2499
|
+
if (d = decorators[i])
|
|
2500
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2501
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2502
|
+
}
|
|
2503
|
+
var ClientRpcServer = class ClientRpcServer2 {
|
|
2493
2504
|
constructor(params) {
|
|
2494
2505
|
this._handlerCache = /* @__PURE__ */ new Map();
|
|
2506
|
+
this._callMetrics = new import_tracing3.MapCounter();
|
|
2495
2507
|
const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
|
|
2496
2508
|
this._handleCall = handleCall;
|
|
2497
2509
|
this._handleStream = handleStream;
|
|
@@ -2501,6 +2513,7 @@ var ClientRpcServer = class {
|
|
|
2501
2513
|
callHandler: (method, params2) => {
|
|
2502
2514
|
const [serviceName, methodName] = (0, import_rpc.parseMethodName)(method);
|
|
2503
2515
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).call(method2, params3);
|
|
2516
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request`);
|
|
2504
2517
|
if (this._handleCall) {
|
|
2505
2518
|
return this._handleCall(methodName, params2, handler);
|
|
2506
2519
|
} else {
|
|
@@ -2510,14 +2523,21 @@ var ClientRpcServer = class {
|
|
|
2510
2523
|
streamHandler: (method, params2) => {
|
|
2511
2524
|
const [serviceName, methodName] = (0, import_rpc.parseMethodName)(method);
|
|
2512
2525
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
2526
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request stream`);
|
|
2513
2527
|
if (this._handleStream) {
|
|
2514
|
-
return import_codec_protobuf9.Stream.unwrapPromise(this._handleStream(methodName, params2, handler))
|
|
2528
|
+
return import_codec_protobuf9.Stream.map(import_codec_protobuf9.Stream.unwrapPromise(this._handleStream(methodName, params2, handler)), (data) => {
|
|
2529
|
+
this._callMetrics.inc(`${serviceName}.${methodName} response stream`);
|
|
2530
|
+
return data;
|
|
2531
|
+
});
|
|
2515
2532
|
} else {
|
|
2516
2533
|
return handler(methodName, params2);
|
|
2517
2534
|
}
|
|
2518
2535
|
}
|
|
2519
2536
|
});
|
|
2520
2537
|
}
|
|
2538
|
+
get _services() {
|
|
2539
|
+
return Object.keys(this._serviceRegistry.services);
|
|
2540
|
+
}
|
|
2521
2541
|
async open() {
|
|
2522
2542
|
await this._rpcPeer.open();
|
|
2523
2543
|
}
|
|
@@ -2536,8 +2556,18 @@ var ClientRpcServer = class {
|
|
|
2536
2556
|
return this._handlerCache.get(serviceName);
|
|
2537
2557
|
}
|
|
2538
2558
|
};
|
|
2559
|
+
_ts_decorate3([
|
|
2560
|
+
import_tracing3.trace.metricsCounter()
|
|
2561
|
+
], ClientRpcServer.prototype, "_callMetrics", void 0);
|
|
2562
|
+
_ts_decorate3([
|
|
2563
|
+
import_tracing3.trace.info()
|
|
2564
|
+
], ClientRpcServer.prototype, "_services", null);
|
|
2565
|
+
ClientRpcServer = _ts_decorate3([
|
|
2566
|
+
import_tracing3.trace.resource()
|
|
2567
|
+
], ClientRpcServer);
|
|
2539
2568
|
|
|
2540
2569
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2570
|
+
var import_async10 = require("@dxos/async");
|
|
2541
2571
|
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
2542
2572
|
var import_credentials9 = require("@dxos/credentials");
|
|
2543
2573
|
var import_document_model = require("@dxos/document-model");
|
|
@@ -2576,10 +2606,10 @@ var getPlatform = () => {
|
|
|
2576
2606
|
};
|
|
2577
2607
|
|
|
2578
2608
|
// packages/sdk/client-services/src/version.ts
|
|
2579
|
-
var DXOS_VERSION = "0.3.
|
|
2609
|
+
var DXOS_VERSION = "0.3.3-main.1b7ca63";
|
|
2580
2610
|
|
|
2581
2611
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2582
|
-
var __dxlog_file10 = "/
|
|
2612
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2583
2613
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2584
2614
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
2585
2615
|
const diagnostics = {
|
|
@@ -2595,7 +2625,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2595
2625
|
{
|
|
2596
2626
|
(0, import_invariant9.invariant)(clientServices.LoggingService, "SystemService is not available.", {
|
|
2597
2627
|
F: __dxlog_file10,
|
|
2598
|
-
L:
|
|
2628
|
+
L: 93,
|
|
2599
2629
|
S: void 0,
|
|
2600
2630
|
A: [
|
|
2601
2631
|
"clientServices.LoggingService",
|
|
@@ -2628,6 +2658,19 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2628
2658
|
bytes,
|
|
2629
2659
|
length
|
|
2630
2660
|
}));
|
|
2661
|
+
const status = await (0, import_codec_protobuf10.getFirstStreamValue)(clientServices.NetworkService.queryStatus(), {
|
|
2662
|
+
timeout: DEFAULT_TIMEOUT
|
|
2663
|
+
}).catch(() => void 0);
|
|
2664
|
+
diagnostics.networkStatus = status;
|
|
2665
|
+
const swarmInfoDone = new import_async10.Trigger();
|
|
2666
|
+
serviceContext.networkManager.connectionLog?.update.on(async () => {
|
|
2667
|
+
const swarms = serviceContext.networkManager.connectionLog?.swarms;
|
|
2668
|
+
diagnostics.swarms = swarms;
|
|
2669
|
+
await swarmInfoDone.wake();
|
|
2670
|
+
});
|
|
2671
|
+
await swarmInfoDone.wait({
|
|
2672
|
+
timeout: DEFAULT_TIMEOUT
|
|
2673
|
+
});
|
|
2631
2674
|
}
|
|
2632
2675
|
diagnostics.config = config.values;
|
|
2633
2676
|
return diagnostics;
|
|
@@ -2641,7 +2684,7 @@ var getProperties = (space) => {
|
|
|
2641
2684
|
} catch (err) {
|
|
2642
2685
|
import_log8.log.warn(err.message, void 0, {
|
|
2643
2686
|
F: __dxlog_file10,
|
|
2644
|
-
L:
|
|
2687
|
+
L: 168,
|
|
2645
2688
|
S: void 0,
|
|
2646
2689
|
C: (f, a) => f(...a)
|
|
2647
2690
|
});
|
|
@@ -2697,7 +2740,7 @@ var getSpaceStats = async (space) => {
|
|
|
2697
2740
|
};
|
|
2698
2741
|
|
|
2699
2742
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
2700
|
-
var
|
|
2743
|
+
var import_async15 = require("@dxos/async");
|
|
2701
2744
|
var import_context9 = require("@dxos/context");
|
|
2702
2745
|
var import_credentials14 = require("@dxos/credentials");
|
|
2703
2746
|
var import_debug7 = require("@dxos/debug");
|
|
@@ -2710,11 +2753,11 @@ var import_log13 = require("@dxos/log");
|
|
|
2710
2753
|
var import_protocols10 = require("@dxos/protocols");
|
|
2711
2754
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2712
2755
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
2713
|
-
var
|
|
2756
|
+
var import_tracing5 = require("@dxos/tracing");
|
|
2714
2757
|
var import_util7 = require("@dxos/util");
|
|
2715
2758
|
|
|
2716
2759
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2717
|
-
var
|
|
2760
|
+
var import_async13 = require("@dxos/async");
|
|
2718
2761
|
var import_context8 = require("@dxos/context");
|
|
2719
2762
|
var import_credentials13 = require("@dxos/credentials");
|
|
2720
2763
|
var import_invariant11 = require("@dxos/invariant");
|
|
@@ -2726,7 +2769,7 @@ var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip"
|
|
|
2726
2769
|
var import_util6 = require("@dxos/util");
|
|
2727
2770
|
|
|
2728
2771
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2729
|
-
var
|
|
2772
|
+
var import_async12 = require("@dxos/async");
|
|
2730
2773
|
var import_client_protocol3 = require("@dxos/client-protocol");
|
|
2731
2774
|
var import_context7 = require("@dxos/context");
|
|
2732
2775
|
var import_debug4 = require("@dxos/debug");
|
|
@@ -2737,11 +2780,11 @@ var import_protocols7 = require("@dxos/protocols");
|
|
|
2737
2780
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2738
2781
|
var import_credentials10 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2739
2782
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
2740
|
-
var
|
|
2783
|
+
var import_tracing4 = require("@dxos/tracing");
|
|
2741
2784
|
var import_util5 = require("@dxos/util");
|
|
2742
2785
|
|
|
2743
2786
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2744
|
-
var
|
|
2787
|
+
var import_async11 = require("@dxos/async");
|
|
2745
2788
|
var import_context6 = require("@dxos/context");
|
|
2746
2789
|
var import_invariant10 = require("@dxos/invariant");
|
|
2747
2790
|
var import_keys8 = require("@dxos/keys");
|
|
@@ -2749,7 +2792,7 @@ var import_log9 = require("@dxos/log");
|
|
|
2749
2792
|
var import_protocols6 = require("@dxos/protocols");
|
|
2750
2793
|
var import_teleport2 = require("@dxos/teleport");
|
|
2751
2794
|
var import_util4 = require("@dxos/util");
|
|
2752
|
-
var __dxlog_file11 = "/
|
|
2795
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2753
2796
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2754
2797
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2755
2798
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2757,7 +2800,7 @@ var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
|
|
|
2757
2800
|
var NotarizationPlugin = class {
|
|
2758
2801
|
constructor() {
|
|
2759
2802
|
this._ctx = new import_context6.Context();
|
|
2760
|
-
this._extensionOpened = new
|
|
2803
|
+
this._extensionOpened = new import_async11.Event();
|
|
2761
2804
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2762
2805
|
this._processedCredentials = new import_util4.ComplexSet(import_keys8.PublicKey.hash);
|
|
2763
2806
|
this._processCredentialsTriggers = new import_util4.ComplexMap(import_keys8.PublicKey.hash);
|
|
@@ -2791,7 +2834,7 @@ var NotarizationPlugin = class {
|
|
|
2791
2834
|
"'Credentials must have an id'"
|
|
2792
2835
|
]
|
|
2793
2836
|
});
|
|
2794
|
-
const errors = new
|
|
2837
|
+
const errors = new import_async11.Trigger();
|
|
2795
2838
|
const ctx = this._ctx.derive({
|
|
2796
2839
|
onError: (err) => {
|
|
2797
2840
|
import_log9.log.warn("Notarization error", {
|
|
@@ -2808,7 +2851,7 @@ var NotarizationPlugin = class {
|
|
|
2808
2851
|
});
|
|
2809
2852
|
opCtx?.onDispose(() => ctx.dispose());
|
|
2810
2853
|
if (timeout !== 0) {
|
|
2811
|
-
(0,
|
|
2854
|
+
(0, import_async11.scheduleTask)(ctx, () => {
|
|
2812
2855
|
import_log9.log.warn("Notarization timeout", {
|
|
2813
2856
|
timeout,
|
|
2814
2857
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
@@ -2819,12 +2862,12 @@ var NotarizationPlugin = class {
|
|
|
2819
2862
|
C: (f, a) => f(...a)
|
|
2820
2863
|
});
|
|
2821
2864
|
void ctx.dispose();
|
|
2822
|
-
errors.throw(new
|
|
2865
|
+
errors.throw(new import_async11.TimeoutError(timeout, "Notarization timed out"));
|
|
2823
2866
|
}, timeout);
|
|
2824
2867
|
}
|
|
2825
2868
|
const allNotarized = Promise.all(credentials.map((credential) => this._waitUntilProcessed(credential.id)));
|
|
2826
2869
|
const peersTried = /* @__PURE__ */ new Set();
|
|
2827
|
-
const notarizeTask = new
|
|
2870
|
+
const notarizeTask = new import_async11.DeferredTask(ctx, async () => {
|
|
2828
2871
|
try {
|
|
2829
2872
|
if (this._extensions.size === 0) {
|
|
2830
2873
|
return;
|
|
@@ -2842,7 +2885,7 @@ var NotarizationPlugin = class {
|
|
|
2842
2885
|
C: (f, a) => f(...a)
|
|
2843
2886
|
});
|
|
2844
2887
|
peersTried.clear();
|
|
2845
|
-
(0,
|
|
2888
|
+
(0, import_async11.scheduleTask)(ctx, () => notarizeTask.schedule(), retryTimeout);
|
|
2846
2889
|
return;
|
|
2847
2890
|
}
|
|
2848
2891
|
peersTried.add(peer);
|
|
@@ -2864,7 +2907,7 @@ var NotarizationPlugin = class {
|
|
|
2864
2907
|
S: this,
|
|
2865
2908
|
C: (f, a) => f(...a)
|
|
2866
2909
|
});
|
|
2867
|
-
await (0,
|
|
2910
|
+
await (0, import_async11.sleep)(successDelay);
|
|
2868
2911
|
} catch (err) {
|
|
2869
2912
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2870
2913
|
import_log9.log.warn("error notarizing (recoverable)", err, {
|
|
@@ -2922,7 +2965,7 @@ var NotarizationPlugin = class {
|
|
|
2922
2965
|
if (this._processedCredentials.has(id)) {
|
|
2923
2966
|
return;
|
|
2924
2967
|
}
|
|
2925
|
-
await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new
|
|
2968
|
+
await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new import_async11.Trigger()).value.wait();
|
|
2926
2969
|
}
|
|
2927
2970
|
/**
|
|
2928
2971
|
* Requests from other peers to notarize credentials.
|
|
@@ -3009,7 +3052,7 @@ var NotarizationTeleportExtension = class extends import_teleport2.RpcExtension
|
|
|
3009
3052
|
};
|
|
3010
3053
|
|
|
3011
3054
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
3012
|
-
function
|
|
3055
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
3013
3056
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3014
3057
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3015
3058
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3019,7 +3062,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
3019
3062
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3020
3063
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3021
3064
|
}
|
|
3022
|
-
var __dxlog_file12 = "/
|
|
3065
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
3023
3066
|
var ENABLE_FEED_PURGE = false;
|
|
3024
3067
|
var DataSpace = class DataSpace2 {
|
|
3025
3068
|
constructor(params) {
|
|
@@ -3030,7 +3073,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3030
3073
|
* Error for _state === SpaceState.ERROR.
|
|
3031
3074
|
*/
|
|
3032
3075
|
this.error = void 0;
|
|
3033
|
-
this.stateUpdate = new
|
|
3076
|
+
this.stateUpdate = new import_async12.Event();
|
|
3034
3077
|
this.metrics = {};
|
|
3035
3078
|
this._inner = params.inner;
|
|
3036
3079
|
this._inner.stateUpdate.on(this._ctx, () => this.stateUpdate.emit());
|
|
@@ -3136,7 +3179,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3136
3179
|
* Initialize the data pipeline in a separate task.
|
|
3137
3180
|
*/
|
|
3138
3181
|
initializeDataPipelineAsync() {
|
|
3139
|
-
(0,
|
|
3182
|
+
(0, import_async12.scheduleTask)(this._ctx, async () => {
|
|
3140
3183
|
try {
|
|
3141
3184
|
this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
|
|
3142
3185
|
await this.initializeDataPipeline();
|
|
@@ -3186,7 +3229,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3186
3229
|
C: (f, a) => f(...a)
|
|
3187
3230
|
});
|
|
3188
3231
|
await this._initializeAndReadControlPipeline();
|
|
3189
|
-
await (0,
|
|
3232
|
+
await (0, import_async12.sleep)(1);
|
|
3190
3233
|
await this._inner.initializeDataPipeline();
|
|
3191
3234
|
this.metrics.dataPipelineOpen = /* @__PURE__ */ new Date();
|
|
3192
3235
|
await (0, import_context7.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
@@ -3341,33 +3384,33 @@ var DataSpace = class DataSpace2 {
|
|
|
3341
3384
|
this.stateUpdate.emit();
|
|
3342
3385
|
}
|
|
3343
3386
|
};
|
|
3344
|
-
|
|
3345
|
-
|
|
3387
|
+
_ts_decorate4([
|
|
3388
|
+
import_async12.synchronized
|
|
3346
3389
|
], DataSpace.prototype, "open", null);
|
|
3347
|
-
|
|
3348
|
-
|
|
3390
|
+
_ts_decorate4([
|
|
3391
|
+
import_async12.synchronized
|
|
3349
3392
|
], DataSpace.prototype, "close", null);
|
|
3350
|
-
|
|
3351
|
-
|
|
3393
|
+
_ts_decorate4([
|
|
3394
|
+
import_tracing4.trace.span({
|
|
3352
3395
|
showInBrowserTimeline: true
|
|
3353
3396
|
})
|
|
3354
3397
|
], DataSpace.prototype, "initializeDataPipeline", null);
|
|
3355
|
-
|
|
3356
|
-
|
|
3398
|
+
_ts_decorate4([
|
|
3399
|
+
import_tracing4.trace.span({
|
|
3357
3400
|
showInBrowserTimeline: true
|
|
3358
3401
|
})
|
|
3359
3402
|
], DataSpace.prototype, "_initializeAndReadControlPipeline", null);
|
|
3360
|
-
|
|
3403
|
+
_ts_decorate4([
|
|
3361
3404
|
(0, import_debug4.timed)(1e4)
|
|
3362
3405
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
3363
|
-
|
|
3364
|
-
|
|
3406
|
+
_ts_decorate4([
|
|
3407
|
+
import_async12.synchronized
|
|
3365
3408
|
], DataSpace.prototype, "activate", null);
|
|
3366
|
-
|
|
3367
|
-
|
|
3409
|
+
_ts_decorate4([
|
|
3410
|
+
import_async12.synchronized
|
|
3368
3411
|
], DataSpace.prototype, "deactivate", null);
|
|
3369
|
-
DataSpace =
|
|
3370
|
-
(0,
|
|
3412
|
+
DataSpace = _ts_decorate4([
|
|
3413
|
+
(0, import_async12.trackLeaks)("open", "close")
|
|
3371
3414
|
], DataSpace);
|
|
3372
3415
|
|
|
3373
3416
|
// packages/sdk/client-services/src/packlets/spaces/genesis.ts
|
|
@@ -3440,7 +3483,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3440
3483
|
};
|
|
3441
3484
|
|
|
3442
3485
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
3443
|
-
function
|
|
3486
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
3444
3487
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3445
3488
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3446
3489
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3450,7 +3493,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
3450
3493
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3451
3494
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3452
3495
|
}
|
|
3453
|
-
var __dxlog_file13 = "/
|
|
3496
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3454
3497
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3455
3498
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3456
3499
|
this._spaceManager = _spaceManager;
|
|
@@ -3460,7 +3503,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3460
3503
|
this._signingContext = _signingContext;
|
|
3461
3504
|
this._feedStore = _feedStore;
|
|
3462
3505
|
this._ctx = new import_context8.Context();
|
|
3463
|
-
this.updated = new
|
|
3506
|
+
this.updated = new import_async13.Event();
|
|
3464
3507
|
this._spaces = new import_util6.ComplexMap(import_keys10.PublicKey.hash);
|
|
3465
3508
|
this._isOpen = false;
|
|
3466
3509
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
@@ -3756,31 +3799,31 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3756
3799
|
return dataSpace;
|
|
3757
3800
|
}
|
|
3758
3801
|
};
|
|
3759
|
-
|
|
3760
|
-
|
|
3802
|
+
_ts_decorate5([
|
|
3803
|
+
import_async13.synchronized
|
|
3761
3804
|
], DataSpaceManager.prototype, "open", null);
|
|
3762
|
-
|
|
3763
|
-
|
|
3805
|
+
_ts_decorate5([
|
|
3806
|
+
import_async13.synchronized
|
|
3764
3807
|
], DataSpaceManager.prototype, "close", null);
|
|
3765
|
-
|
|
3766
|
-
|
|
3808
|
+
_ts_decorate5([
|
|
3809
|
+
import_async13.synchronized
|
|
3767
3810
|
], DataSpaceManager.prototype, "createSpace", null);
|
|
3768
|
-
|
|
3769
|
-
|
|
3811
|
+
_ts_decorate5([
|
|
3812
|
+
import_async13.synchronized
|
|
3770
3813
|
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
3771
|
-
DataSpaceManager =
|
|
3772
|
-
(0,
|
|
3814
|
+
DataSpaceManager = _ts_decorate5([
|
|
3815
|
+
(0, import_async13.trackLeaks)("open", "close")
|
|
3773
3816
|
], DataSpaceManager);
|
|
3774
3817
|
|
|
3775
3818
|
// packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
|
|
3776
|
-
var
|
|
3819
|
+
var import_async14 = require("@dxos/async");
|
|
3777
3820
|
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
3778
3821
|
var import_debug6 = require("@dxos/debug");
|
|
3779
3822
|
var import_invariant12 = require("@dxos/invariant");
|
|
3780
3823
|
var import_log12 = require("@dxos/log");
|
|
3781
3824
|
var import_protocols9 = require("@dxos/protocols");
|
|
3782
3825
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3783
|
-
var __dxlog_file14 = "/
|
|
3826
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3784
3827
|
var SpacesServiceImpl = class {
|
|
3785
3828
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
3786
3829
|
this._identityManager = _identityManager;
|
|
@@ -3814,7 +3857,7 @@ var SpacesServiceImpl = class {
|
|
|
3814
3857
|
}
|
|
3815
3858
|
querySpaces() {
|
|
3816
3859
|
return new import_codec_protobuf11.Stream(({ next, ctx }) => {
|
|
3817
|
-
const scheduler = new
|
|
3860
|
+
const scheduler = new import_async14.UpdateScheduler(ctx, async () => {
|
|
3818
3861
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3819
3862
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
3820
3863
|
(0, import_log12.log)("update", {
|
|
@@ -3831,9 +3874,9 @@ var SpacesServiceImpl = class {
|
|
|
3831
3874
|
}, {
|
|
3832
3875
|
maxFrequency: process.env.NODE_ENV === "test" ? void 0 : 2
|
|
3833
3876
|
});
|
|
3834
|
-
(0,
|
|
3877
|
+
(0, import_async14.scheduleTask)(ctx, async () => {
|
|
3835
3878
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3836
|
-
const subscriptions = new
|
|
3879
|
+
const subscriptions = new import_async14.EventSubscriptions();
|
|
3837
3880
|
ctx.onDispose(() => subscriptions.clear());
|
|
3838
3881
|
const subscribeSpaces = () => {
|
|
3839
3882
|
subscriptions.clear();
|
|
@@ -3868,7 +3911,7 @@ var SpacesServiceImpl = class {
|
|
|
3868
3911
|
}
|
|
3869
3912
|
subscribeMessages({ spaceKey, channel }) {
|
|
3870
3913
|
return new import_codec_protobuf11.Stream(({ ctx, next }) => {
|
|
3871
|
-
(0,
|
|
3914
|
+
(0, import_async14.scheduleTask)(ctx, async () => {
|
|
3872
3915
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3873
3916
|
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3874
3917
|
const handle = space.listen(getChannelId(channel), (message) => {
|
|
@@ -3887,7 +3930,7 @@ var SpacesServiceImpl = class {
|
|
|
3887
3930
|
}
|
|
3888
3931
|
};
|
|
3889
3932
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3890
|
-
(0,
|
|
3933
|
+
(0, import_async14.scheduleTask)(ctx, async () => {
|
|
3891
3934
|
await space.spaceState.addCredentialProcessor(processor);
|
|
3892
3935
|
if (noTail) {
|
|
3893
3936
|
close();
|
|
@@ -3994,7 +4037,7 @@ var SpacesServiceImpl = class {
|
|
|
3994
4037
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
3995
4038
|
|
|
3996
4039
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3997
|
-
function
|
|
4040
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
3998
4041
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3999
4042
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4000
4043
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4004,14 +4047,14 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
4004
4047
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4005
4048
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4006
4049
|
}
|
|
4007
|
-
var __dxlog_file15 = "/
|
|
4050
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
4008
4051
|
var ServiceContext = class ServiceContext2 {
|
|
4009
4052
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
4010
4053
|
this.storage = storage;
|
|
4011
4054
|
this.networkManager = networkManager;
|
|
4012
4055
|
this.signalManager = signalManager;
|
|
4013
4056
|
this.modelFactory = modelFactory;
|
|
4014
|
-
this.initialized = new
|
|
4057
|
+
this.initialized = new import_async15.Trigger();
|
|
4015
4058
|
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
4016
4059
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
4017
4060
|
this._instanceId = import_keys11.PublicKey.random().toHex();
|
|
@@ -4228,19 +4271,19 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4228
4271
|
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
4229
4272
|
}
|
|
4230
4273
|
};
|
|
4231
|
-
|
|
4232
|
-
|
|
4274
|
+
_ts_decorate6([
|
|
4275
|
+
import_tracing5.trace.span()
|
|
4233
4276
|
], ServiceContext.prototype, "open", null);
|
|
4234
|
-
|
|
4235
|
-
|
|
4277
|
+
_ts_decorate6([
|
|
4278
|
+
import_tracing5.trace.span()
|
|
4236
4279
|
], ServiceContext.prototype, "_initialize", null);
|
|
4237
|
-
ServiceContext =
|
|
4280
|
+
ServiceContext = _ts_decorate6([
|
|
4238
4281
|
(0, import_util7.safeInstanceof)("dxos.client-services.ServiceContext"),
|
|
4239
|
-
|
|
4282
|
+
import_tracing5.trace.resource()
|
|
4240
4283
|
], ServiceContext);
|
|
4241
4284
|
|
|
4242
4285
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4243
|
-
var
|
|
4286
|
+
var import_async18 = require("@dxos/async");
|
|
4244
4287
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
4245
4288
|
var import_context10 = require("@dxos/context");
|
|
4246
4289
|
var import_document_model2 = require("@dxos/document-model");
|
|
@@ -4255,7 +4298,7 @@ var import_network_manager2 = require("@dxos/network-manager");
|
|
|
4255
4298
|
var import_protocols12 = require("@dxos/protocols");
|
|
4256
4299
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4257
4300
|
var import_text_model = require("@dxos/text-model");
|
|
4258
|
-
var
|
|
4301
|
+
var import_tracing6 = require("@dxos/tracing");
|
|
4259
4302
|
var import_websocket_rpc = require("@dxos/websocket-rpc");
|
|
4260
4303
|
|
|
4261
4304
|
// packages/sdk/client-services/src/packlets/services/service-registry.ts
|
|
@@ -4283,7 +4326,7 @@ var ServiceRegistry = class {
|
|
|
4283
4326
|
};
|
|
4284
4327
|
|
|
4285
4328
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
4286
|
-
var
|
|
4329
|
+
var import_async16 = require("@dxos/async");
|
|
4287
4330
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
4288
4331
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4289
4332
|
var DevicesServiceImpl = class {
|
|
@@ -4311,7 +4354,7 @@ var DevicesServiceImpl = class {
|
|
|
4311
4354
|
});
|
|
4312
4355
|
}
|
|
4313
4356
|
};
|
|
4314
|
-
const subscriptions = new
|
|
4357
|
+
const subscriptions = new import_async16.EventSubscriptions();
|
|
4315
4358
|
subscriptions.add(this._identityManager.stateUpdate.on(() => {
|
|
4316
4359
|
update();
|
|
4317
4360
|
if (this._identityManager.identity) {
|
|
@@ -4330,7 +4373,7 @@ var DevicesServiceImpl = class {
|
|
|
4330
4373
|
var import_invariant14 = require("@dxos/invariant");
|
|
4331
4374
|
var import_lock_file = require("@dxos/lock-file");
|
|
4332
4375
|
var import_log14 = require("@dxos/log");
|
|
4333
|
-
function
|
|
4376
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
4334
4377
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4335
4378
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4336
4379
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4340,7 +4383,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4340
4383
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4341
4384
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4342
4385
|
}
|
|
4343
|
-
var __dxlog_file16 = "/
|
|
4386
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
|
|
4344
4387
|
var Lock = class {
|
|
4345
4388
|
constructor({ lockKey: lockPath, onAcquire, onRelease }) {
|
|
4346
4389
|
this._lockPath = lockPath;
|
|
@@ -4380,20 +4423,20 @@ var Lock = class {
|
|
|
4380
4423
|
await import_lock_file.LockFile.release(this._fileHandle);
|
|
4381
4424
|
}
|
|
4382
4425
|
};
|
|
4383
|
-
|
|
4426
|
+
_ts_decorate7([
|
|
4384
4427
|
import_log14.logInfo
|
|
4385
4428
|
], Lock.prototype, "lockKey", null);
|
|
4386
4429
|
var isLocked = (lockPath) => import_lock_file.LockFile.isLocked(lockPath);
|
|
4387
4430
|
|
|
4388
4431
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
4389
|
-
var
|
|
4432
|
+
var import_async17 = require("@dxos/async");
|
|
4390
4433
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
4391
4434
|
var import_log15 = require("@dxos/log");
|
|
4392
4435
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4393
4436
|
var import_util8 = require("@dxos/util");
|
|
4394
4437
|
var LoggingServiceImpl = class {
|
|
4395
4438
|
constructor() {
|
|
4396
|
-
this._logs = new
|
|
4439
|
+
this._logs = new import_async17.Event();
|
|
4397
4440
|
this._started = /* @__PURE__ */ new Date();
|
|
4398
4441
|
this._logProcessor = (_config, entry2) => {
|
|
4399
4442
|
this._logs.emit(entry2);
|
|
@@ -4638,7 +4681,7 @@ var SystemServiceImpl = class {
|
|
|
4638
4681
|
};
|
|
4639
4682
|
|
|
4640
4683
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4641
|
-
function
|
|
4684
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
4642
4685
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4643
4686
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4644
4687
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4648,7 +4691,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4648
4691
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4649
4692
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4650
4693
|
}
|
|
4651
|
-
var __dxlog_file17 = "/
|
|
4694
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4652
4695
|
var createDefaultModelFactory = () => {
|
|
4653
4696
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4654
4697
|
};
|
|
@@ -4675,8 +4718,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4675
4718
|
lockKey,
|
|
4676
4719
|
callbacks
|
|
4677
4720
|
} = {}) {
|
|
4678
|
-
this._tracingService =
|
|
4679
|
-
this._statusUpdate = new
|
|
4721
|
+
this._tracingService = import_tracing6.TRACE_PROCESSOR.createTraceSender();
|
|
4722
|
+
this._statusUpdate = new import_async18.Event();
|
|
4680
4723
|
this._opening = false;
|
|
4681
4724
|
this._open = false;
|
|
4682
4725
|
this._storage = storage;
|
|
@@ -5000,26 +5043,26 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
5000
5043
|
return identity;
|
|
5001
5044
|
}
|
|
5002
5045
|
};
|
|
5003
|
-
|
|
5004
|
-
|
|
5046
|
+
_ts_decorate8([
|
|
5047
|
+
import_tracing6.trace.info()
|
|
5005
5048
|
], ClientServicesHost.prototype, "_opening", void 0);
|
|
5006
|
-
|
|
5007
|
-
|
|
5049
|
+
_ts_decorate8([
|
|
5050
|
+
import_tracing6.trace.info()
|
|
5008
5051
|
], ClientServicesHost.prototype, "_open", void 0);
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5052
|
+
_ts_decorate8([
|
|
5053
|
+
import_async18.synchronized,
|
|
5054
|
+
import_tracing6.trace.span()
|
|
5012
5055
|
], ClientServicesHost.prototype, "open", null);
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5056
|
+
_ts_decorate8([
|
|
5057
|
+
import_async18.synchronized,
|
|
5058
|
+
import_tracing6.trace.span()
|
|
5016
5059
|
], ClientServicesHost.prototype, "close", null);
|
|
5017
|
-
ClientServicesHost =
|
|
5018
|
-
|
|
5060
|
+
ClientServicesHost = _ts_decorate8([
|
|
5061
|
+
import_tracing6.trace.resource()
|
|
5019
5062
|
], ClientServicesHost);
|
|
5020
5063
|
|
|
5021
5064
|
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
5022
|
-
var
|
|
5065
|
+
var import_async20 = require("@dxos/async");
|
|
5023
5066
|
var import_client_protocol7 = require("@dxos/client-protocol");
|
|
5024
5067
|
var import_context11 = require("@dxos/context");
|
|
5025
5068
|
var import_log17 = require("@dxos/log");
|
|
@@ -5028,16 +5071,16 @@ var import_network_manager3 = require("@dxos/network-manager");
|
|
|
5028
5071
|
var import_util11 = require("@dxos/util");
|
|
5029
5072
|
|
|
5030
5073
|
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
5031
|
-
var
|
|
5074
|
+
var import_async19 = require("@dxos/async");
|
|
5032
5075
|
var import_client_protocol6 = require("@dxos/client-protocol");
|
|
5033
5076
|
var import_invariant16 = require("@dxos/invariant");
|
|
5034
5077
|
var import_iframe = require("@dxos/protocols/proto/dxos/iframe");
|
|
5035
5078
|
var import_rpc2 = require("@dxos/rpc");
|
|
5036
|
-
var __dxlog_file18 = "/
|
|
5079
|
+
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/shell-runtime.ts";
|
|
5037
5080
|
var ShellRuntimeImpl = class {
|
|
5038
5081
|
constructor(_port) {
|
|
5039
5082
|
this._port = _port;
|
|
5040
|
-
this.layoutUpdate = new
|
|
5083
|
+
this.layoutUpdate = new import_async19.Event();
|
|
5041
5084
|
this._layout = import_iframe.ShellLayout.DEFAULT;
|
|
5042
5085
|
}
|
|
5043
5086
|
get layout() {
|
|
@@ -5096,7 +5139,7 @@ var ShellRuntimeImpl = class {
|
|
|
5096
5139
|
};
|
|
5097
5140
|
|
|
5098
5141
|
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
5099
|
-
function
|
|
5142
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
5100
5143
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5101
5144
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
5102
5145
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -5106,11 +5149,11 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
5106
5149
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5107
5150
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5108
5151
|
}
|
|
5109
|
-
var __dxlog_file19 = "/
|
|
5152
|
+
var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts";
|
|
5110
5153
|
var LOCK_KEY = "DXOS_RESOURCE_LOCK";
|
|
5111
5154
|
var IFrameHostRuntime = class {
|
|
5112
5155
|
constructor({ config, origin, appPort, shellPort }) {
|
|
5113
|
-
this._ready = new
|
|
5156
|
+
this._ready = new import_async20.Trigger();
|
|
5114
5157
|
this._configProvider = config;
|
|
5115
5158
|
this.origin = origin;
|
|
5116
5159
|
this._appPort = appPort;
|
|
@@ -5209,23 +5252,23 @@ var IFrameHostRuntime = class {
|
|
|
5209
5252
|
});
|
|
5210
5253
|
}
|
|
5211
5254
|
};
|
|
5212
|
-
|
|
5255
|
+
_ts_decorate9([
|
|
5213
5256
|
import_log17.logInfo
|
|
5214
5257
|
], IFrameHostRuntime.prototype, "origin", void 0);
|
|
5215
5258
|
|
|
5216
5259
|
// packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
|
|
5217
|
-
var
|
|
5260
|
+
var import_async21 = require("@dxos/async");
|
|
5218
5261
|
var import_client_protocol8 = require("@dxos/client-protocol");
|
|
5219
5262
|
var import_log18 = require("@dxos/log");
|
|
5220
5263
|
var import_network_manager4 = require("@dxos/network-manager");
|
|
5221
5264
|
var import_protocols13 = require("@dxos/protocols");
|
|
5222
5265
|
var import_rpc3 = require("@dxos/rpc");
|
|
5223
5266
|
var import_util12 = require("@dxos/util");
|
|
5224
|
-
var __dxlog_file20 = "/
|
|
5267
|
+
var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts";
|
|
5225
5268
|
var IFrameProxyRuntime = class {
|
|
5226
5269
|
constructor({ config, systemPort, shellPort }) {
|
|
5227
5270
|
this._id = String(Math.floor(Math.random() * 1e6));
|
|
5228
|
-
this._release = new
|
|
5271
|
+
this._release = new import_async21.Trigger();
|
|
5229
5272
|
this._configProvider = config;
|
|
5230
5273
|
this._systemPort = systemPort;
|
|
5231
5274
|
this._shellPort = shellPort;
|
|
@@ -5253,8 +5296,8 @@ var IFrameProxyRuntime = class {
|
|
|
5253
5296
|
let lockKey;
|
|
5254
5297
|
if (typeof navigator !== "undefined") {
|
|
5255
5298
|
lockKey = this._lockKey(origin);
|
|
5256
|
-
this._release = new
|
|
5257
|
-
const ready = new
|
|
5299
|
+
this._release = new import_async21.Trigger();
|
|
5300
|
+
const ready = new import_async21.Trigger();
|
|
5258
5301
|
void navigator.locks.request(lockKey, async () => {
|
|
5259
5302
|
ready.wake();
|
|
5260
5303
|
await this._release.wait();
|
|
@@ -5290,20 +5333,20 @@ var IFrameProxyRuntime = class {
|
|
|
5290
5333
|
};
|
|
5291
5334
|
|
|
5292
5335
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
5293
|
-
var
|
|
5336
|
+
var import_async23 = require("@dxos/async");
|
|
5294
5337
|
var import_context12 = require("@dxos/context");
|
|
5295
5338
|
var import_log20 = require("@dxos/log");
|
|
5296
5339
|
var import_messaging3 = require("@dxos/messaging");
|
|
5297
5340
|
var import_network_manager5 = require("@dxos/network-manager");
|
|
5298
5341
|
|
|
5299
5342
|
// packages/sdk/client-services/src/packlets/vault/worker-session.ts
|
|
5300
|
-
var
|
|
5343
|
+
var import_async22 = require("@dxos/async");
|
|
5301
5344
|
var import_client_protocol9 = require("@dxos/client-protocol");
|
|
5302
5345
|
var import_invariant17 = require("@dxos/invariant");
|
|
5303
5346
|
var import_log19 = require("@dxos/log");
|
|
5304
5347
|
var import_rpc4 = require("@dxos/rpc");
|
|
5305
5348
|
var import_util13 = require("@dxos/util");
|
|
5306
|
-
function
|
|
5349
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
5307
5350
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5308
5351
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
5309
5352
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -5313,10 +5356,10 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
5313
5356
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5314
5357
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5315
5358
|
}
|
|
5316
|
-
var __dxlog_file21 = "/
|
|
5359
|
+
var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-session.ts";
|
|
5317
5360
|
var WorkerSession = class {
|
|
5318
5361
|
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
5319
|
-
this._startTrigger = new
|
|
5362
|
+
this._startTrigger = new import_async22.Trigger();
|
|
5320
5363
|
this.onClose = new import_util13.Callback();
|
|
5321
5364
|
(0, import_invariant17.invariant)(serviceHost, void 0, {
|
|
5322
5365
|
F: __dxlog_file21,
|
|
@@ -5444,7 +5487,7 @@ var WorkerSession = class {
|
|
|
5444
5487
|
}
|
|
5445
5488
|
async _maybeOpenShell() {
|
|
5446
5489
|
try {
|
|
5447
|
-
await (0,
|
|
5490
|
+
await (0, import_async22.asyncTimeout)(this._shellClientRpc.open(), 1e3);
|
|
5448
5491
|
} catch {
|
|
5449
5492
|
import_log19.log.info("No shell connected.", void 0, {
|
|
5450
5493
|
F: __dxlog_file21,
|
|
@@ -5459,20 +5502,20 @@ var WorkerSession = class {
|
|
|
5459
5502
|
}).then(callback);
|
|
5460
5503
|
}
|
|
5461
5504
|
};
|
|
5462
|
-
|
|
5505
|
+
_ts_decorate10([
|
|
5463
5506
|
import_log19.logInfo
|
|
5464
5507
|
], WorkerSession.prototype, "origin", void 0);
|
|
5465
|
-
|
|
5508
|
+
_ts_decorate10([
|
|
5466
5509
|
import_log19.logInfo
|
|
5467
5510
|
], WorkerSession.prototype, "lockKey", void 0);
|
|
5468
5511
|
|
|
5469
5512
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
5470
|
-
var __dxlog_file22 = "/
|
|
5513
|
+
var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-runtime.ts";
|
|
5471
5514
|
var WorkerRuntime = class {
|
|
5472
5515
|
constructor(_configProvider) {
|
|
5473
5516
|
this._configProvider = _configProvider;
|
|
5474
5517
|
this._transportFactory = new import_network_manager5.SimplePeerTransportProxyFactory();
|
|
5475
|
-
this._ready = new
|
|
5518
|
+
this._ready = new import_async23.Trigger();
|
|
5476
5519
|
this._sessions = /* @__PURE__ */ new Set();
|
|
5477
5520
|
this._clientServices = new ClientServicesHost({
|
|
5478
5521
|
callbacks: {
|