@dxos/client-services 0.3.3-main.e0ded2e → 0.3.3-main.f990aad
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-OC4A3Z5C.mjs → chunk-UUQTHQF5.mjs} +99 -56
- package/dist/lib/browser/chunk-UUQTHQF5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +148 -105
- 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 +229 -139
- 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/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 -1
- package/dist/lib/browser/chunk-OC4A3Z5C.mjs.map +0 -7
|
@@ -2420,9 +2420,21 @@ var SpaceInvitationProtocol = class {
|
|
|
2420
2420
|
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
2421
2421
|
import { raise } from "@dxos/debug";
|
|
2422
2422
|
import { parseMethodName, RpcPeer } from "@dxos/rpc";
|
|
2423
|
-
|
|
2423
|
+
import { MapCounter, trace as trace5 } from "@dxos/tracing";
|
|
2424
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
2425
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2426
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2427
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2428
|
+
else
|
|
2429
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2430
|
+
if (d = decorators[i])
|
|
2431
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2432
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2433
|
+
}
|
|
2434
|
+
var ClientRpcServer = class ClientRpcServer2 {
|
|
2424
2435
|
constructor(params) {
|
|
2425
2436
|
this._handlerCache = /* @__PURE__ */ new Map();
|
|
2437
|
+
this._callMetrics = new MapCounter();
|
|
2426
2438
|
const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
|
|
2427
2439
|
this._handleCall = handleCall;
|
|
2428
2440
|
this._handleStream = handleStream;
|
|
@@ -2432,6 +2444,7 @@ var ClientRpcServer = class {
|
|
|
2432
2444
|
callHandler: (method, params2) => {
|
|
2433
2445
|
const [serviceName, methodName] = parseMethodName(method);
|
|
2434
2446
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).call(method2, params3);
|
|
2447
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request`);
|
|
2435
2448
|
if (this._handleCall) {
|
|
2436
2449
|
return this._handleCall(methodName, params2, handler);
|
|
2437
2450
|
} else {
|
|
@@ -2441,14 +2454,21 @@ var ClientRpcServer = class {
|
|
|
2441
2454
|
streamHandler: (method, params2) => {
|
|
2442
2455
|
const [serviceName, methodName] = parseMethodName(method);
|
|
2443
2456
|
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
2457
|
+
this._callMetrics.inc(`${serviceName}.${methodName} request stream`);
|
|
2444
2458
|
if (this._handleStream) {
|
|
2445
|
-
return Stream9.unwrapPromise(this._handleStream(methodName, params2, handler))
|
|
2459
|
+
return Stream9.map(Stream9.unwrapPromise(this._handleStream(methodName, params2, handler)), (data) => {
|
|
2460
|
+
this._callMetrics.inc(`${serviceName}.${methodName} response stream`);
|
|
2461
|
+
return data;
|
|
2462
|
+
});
|
|
2446
2463
|
} else {
|
|
2447
2464
|
return handler(methodName, params2);
|
|
2448
2465
|
}
|
|
2449
2466
|
}
|
|
2450
2467
|
});
|
|
2451
2468
|
}
|
|
2469
|
+
get _services() {
|
|
2470
|
+
return Object.keys(this._serviceRegistry.services);
|
|
2471
|
+
}
|
|
2452
2472
|
async open() {
|
|
2453
2473
|
await this._rpcPeer.open();
|
|
2454
2474
|
}
|
|
@@ -2467,8 +2487,18 @@ var ClientRpcServer = class {
|
|
|
2467
2487
|
return this._handlerCache.get(serviceName);
|
|
2468
2488
|
}
|
|
2469
2489
|
};
|
|
2490
|
+
_ts_decorate3([
|
|
2491
|
+
trace5.metricsCounter()
|
|
2492
|
+
], ClientRpcServer.prototype, "_callMetrics", void 0);
|
|
2493
|
+
_ts_decorate3([
|
|
2494
|
+
trace5.info()
|
|
2495
|
+
], ClientRpcServer.prototype, "_services", null);
|
|
2496
|
+
ClientRpcServer = _ts_decorate3([
|
|
2497
|
+
trace5.resource()
|
|
2498
|
+
], ClientRpcServer);
|
|
2470
2499
|
|
|
2471
2500
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2501
|
+
import { Trigger as Trigger4 } from "@dxos/async";
|
|
2472
2502
|
import { getFirstStreamValue } from "@dxos/codec-protobuf";
|
|
2473
2503
|
import { credentialTypeFilter } from "@dxos/credentials";
|
|
2474
2504
|
import { DocumentModel } from "@dxos/document-model";
|
|
@@ -2507,7 +2537,7 @@ var getPlatform = () => {
|
|
|
2507
2537
|
};
|
|
2508
2538
|
|
|
2509
2539
|
// packages/sdk/client-services/src/version.ts
|
|
2510
|
-
var DXOS_VERSION = "0.3.3-main.
|
|
2540
|
+
var DXOS_VERSION = "0.3.3-main.f990aad";
|
|
2511
2541
|
|
|
2512
2542
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2513
2543
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -2526,7 +2556,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2526
2556
|
{
|
|
2527
2557
|
invariant9(clientServices.LoggingService, "SystemService is not available.", {
|
|
2528
2558
|
F: __dxlog_file10,
|
|
2529
|
-
L:
|
|
2559
|
+
L: 93,
|
|
2530
2560
|
S: void 0,
|
|
2531
2561
|
A: [
|
|
2532
2562
|
"clientServices.LoggingService",
|
|
@@ -2559,6 +2589,19 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
|
2559
2589
|
bytes,
|
|
2560
2590
|
length
|
|
2561
2591
|
}));
|
|
2592
|
+
const status = await getFirstStreamValue(clientServices.NetworkService.queryStatus(), {
|
|
2593
|
+
timeout: DEFAULT_TIMEOUT
|
|
2594
|
+
}).catch(() => void 0);
|
|
2595
|
+
diagnostics.networkStatus = status;
|
|
2596
|
+
const swarmInfoDone = new Trigger4();
|
|
2597
|
+
serviceContext.networkManager.connectionLog?.update.on(async () => {
|
|
2598
|
+
const swarms = serviceContext.networkManager.connectionLog?.swarms;
|
|
2599
|
+
diagnostics.swarms = swarms;
|
|
2600
|
+
await swarmInfoDone.wake();
|
|
2601
|
+
});
|
|
2602
|
+
await swarmInfoDone.wait({
|
|
2603
|
+
timeout: DEFAULT_TIMEOUT
|
|
2604
|
+
});
|
|
2562
2605
|
}
|
|
2563
2606
|
diagnostics.config = config.values;
|
|
2564
2607
|
return diagnostics;
|
|
@@ -2572,7 +2615,7 @@ var getProperties = (space) => {
|
|
|
2572
2615
|
} catch (err) {
|
|
2573
2616
|
log8.warn(err.message, void 0, {
|
|
2574
2617
|
F: __dxlog_file10,
|
|
2575
|
-
L:
|
|
2618
|
+
L: 168,
|
|
2576
2619
|
S: void 0,
|
|
2577
2620
|
C: (f, a) => f(...a)
|
|
2578
2621
|
});
|
|
@@ -2639,11 +2682,11 @@ import { CancelledError, SystemError } from "@dxos/protocols";
|
|
|
2639
2682
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
2640
2683
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2641
2684
|
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
2642
|
-
import { trace as
|
|
2685
|
+
import { trace as trace6 } from "@dxos/tracing";
|
|
2643
2686
|
import { ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
2644
2687
|
|
|
2645
2688
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2646
|
-
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as
|
|
2689
|
+
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger5 } from "@dxos/async";
|
|
2647
2690
|
import { Context as Context6, rejectOnDispose } from "@dxos/context";
|
|
2648
2691
|
import { invariant as invariant10 } from "@dxos/invariant";
|
|
2649
2692
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
@@ -2693,7 +2736,7 @@ var NotarizationPlugin = class {
|
|
|
2693
2736
|
"'Credentials must have an id'"
|
|
2694
2737
|
]
|
|
2695
2738
|
});
|
|
2696
|
-
const errors = new
|
|
2739
|
+
const errors = new Trigger5();
|
|
2697
2740
|
const ctx = this._ctx.derive({
|
|
2698
2741
|
onError: (err) => {
|
|
2699
2742
|
log9.warn("Notarization error", {
|
|
@@ -2824,7 +2867,7 @@ var NotarizationPlugin = class {
|
|
|
2824
2867
|
if (this._processedCredentials.has(id)) {
|
|
2825
2868
|
return;
|
|
2826
2869
|
}
|
|
2827
|
-
await entry(this._processCredentialsTriggers, id).orInsert(new
|
|
2870
|
+
await entry(this._processCredentialsTriggers, id).orInsert(new Trigger5()).value.wait();
|
|
2828
2871
|
}
|
|
2829
2872
|
/**
|
|
2830
2873
|
* Requests from other peers to notarize credentials.
|
|
@@ -2911,7 +2954,7 @@ var NotarizationTeleportExtension = class extends RpcExtension2 {
|
|
|
2911
2954
|
};
|
|
2912
2955
|
|
|
2913
2956
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2914
|
-
function
|
|
2957
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
2915
2958
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2916
2959
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2917
2960
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3243,32 +3286,32 @@ var DataSpace = class DataSpace2 {
|
|
|
3243
3286
|
this.stateUpdate.emit();
|
|
3244
3287
|
}
|
|
3245
3288
|
};
|
|
3246
|
-
|
|
3289
|
+
_ts_decorate4([
|
|
3247
3290
|
synchronized
|
|
3248
3291
|
], DataSpace.prototype, "open", null);
|
|
3249
|
-
|
|
3292
|
+
_ts_decorate4([
|
|
3250
3293
|
synchronized
|
|
3251
3294
|
], DataSpace.prototype, "close", null);
|
|
3252
|
-
|
|
3253
|
-
|
|
3295
|
+
_ts_decorate4([
|
|
3296
|
+
trace6.span({
|
|
3254
3297
|
showInBrowserTimeline: true
|
|
3255
3298
|
})
|
|
3256
3299
|
], DataSpace.prototype, "initializeDataPipeline", null);
|
|
3257
|
-
|
|
3258
|
-
|
|
3300
|
+
_ts_decorate4([
|
|
3301
|
+
trace6.span({
|
|
3259
3302
|
showInBrowserTimeline: true
|
|
3260
3303
|
})
|
|
3261
3304
|
], DataSpace.prototype, "_initializeAndReadControlPipeline", null);
|
|
3262
|
-
|
|
3305
|
+
_ts_decorate4([
|
|
3263
3306
|
timed(1e4)
|
|
3264
3307
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
3265
|
-
|
|
3308
|
+
_ts_decorate4([
|
|
3266
3309
|
synchronized
|
|
3267
3310
|
], DataSpace.prototype, "activate", null);
|
|
3268
|
-
|
|
3311
|
+
_ts_decorate4([
|
|
3269
3312
|
synchronized
|
|
3270
3313
|
], DataSpace.prototype, "deactivate", null);
|
|
3271
|
-
DataSpace =
|
|
3314
|
+
DataSpace = _ts_decorate4([
|
|
3272
3315
|
trackLeaks("open", "close")
|
|
3273
3316
|
], DataSpace);
|
|
3274
3317
|
|
|
@@ -3279,7 +3322,7 @@ import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credent
|
|
|
3279
3322
|
import { invariant as invariant11 } from "@dxos/invariant";
|
|
3280
3323
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3281
3324
|
import { log as log11 } from "@dxos/log";
|
|
3282
|
-
import { trace as
|
|
3325
|
+
import { trace as trace7 } from "@dxos/protocols";
|
|
3283
3326
|
import { SpaceState as SpaceState2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3284
3327
|
import { Gossip, Presence } from "@dxos/teleport-extension-gossip";
|
|
3285
3328
|
import { ComplexMap as ComplexMap3, deferFunction as deferFunction2, forEachAsync } from "@dxos/util";
|
|
@@ -3354,7 +3397,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3354
3397
|
};
|
|
3355
3398
|
|
|
3356
3399
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
3357
|
-
function
|
|
3400
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
3358
3401
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3359
3402
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3360
3403
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3390,7 +3433,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3390
3433
|
S: this,
|
|
3391
3434
|
C: (f, a) => f(...a)
|
|
3392
3435
|
});
|
|
3393
|
-
log11.trace("dxos.echo.data-space-manager.open",
|
|
3436
|
+
log11.trace("dxos.echo.data-space-manager.open", trace7.begin({
|
|
3394
3437
|
id: this._instanceId
|
|
3395
3438
|
}), {
|
|
3396
3439
|
F: __dxlog_file13,
|
|
@@ -3436,7 +3479,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3436
3479
|
space.initializeDataPipelineAsync();
|
|
3437
3480
|
}
|
|
3438
3481
|
}
|
|
3439
|
-
log11.trace("dxos.echo.data-space-manager.open",
|
|
3482
|
+
log11.trace("dxos.echo.data-space-manager.open", trace7.end({
|
|
3440
3483
|
id: this._instanceId
|
|
3441
3484
|
}), {
|
|
3442
3485
|
F: __dxlog_file13,
|
|
@@ -3670,19 +3713,19 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3670
3713
|
return dataSpace;
|
|
3671
3714
|
}
|
|
3672
3715
|
};
|
|
3673
|
-
|
|
3716
|
+
_ts_decorate5([
|
|
3674
3717
|
synchronized2
|
|
3675
3718
|
], DataSpaceManager.prototype, "open", null);
|
|
3676
|
-
|
|
3719
|
+
_ts_decorate5([
|
|
3677
3720
|
synchronized2
|
|
3678
3721
|
], DataSpaceManager.prototype, "close", null);
|
|
3679
|
-
|
|
3722
|
+
_ts_decorate5([
|
|
3680
3723
|
synchronized2
|
|
3681
3724
|
], DataSpaceManager.prototype, "createSpace", null);
|
|
3682
|
-
|
|
3725
|
+
_ts_decorate5([
|
|
3683
3726
|
synchronized2
|
|
3684
3727
|
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
3685
|
-
DataSpaceManager =
|
|
3728
|
+
DataSpaceManager = _ts_decorate5([
|
|
3686
3729
|
trackLeaks2("open", "close")
|
|
3687
3730
|
], DataSpaceManager);
|
|
3688
3731
|
|
|
@@ -3908,7 +3951,7 @@ var SpacesServiceImpl = class {
|
|
|
3908
3951
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
3909
3952
|
|
|
3910
3953
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3911
|
-
import { Trigger as
|
|
3954
|
+
import { Trigger as Trigger6 } from "@dxos/async";
|
|
3912
3955
|
import { Context as Context9 } from "@dxos/context";
|
|
3913
3956
|
import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
3914
3957
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
@@ -3918,12 +3961,12 @@ import { invariant as invariant13 } from "@dxos/invariant";
|
|
|
3918
3961
|
import { Keyring } from "@dxos/keyring";
|
|
3919
3962
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
3920
3963
|
import { log as log13 } from "@dxos/log";
|
|
3921
|
-
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as
|
|
3964
|
+
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace8 } from "@dxos/protocols";
|
|
3922
3965
|
import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3923
3966
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3924
3967
|
import { trace as Trace2 } from "@dxos/tracing";
|
|
3925
3968
|
import { safeInstanceof } from "@dxos/util";
|
|
3926
|
-
function
|
|
3969
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
3927
3970
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3928
3971
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3929
3972
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3940,7 +3983,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3940
3983
|
this.networkManager = networkManager;
|
|
3941
3984
|
this.signalManager = signalManager;
|
|
3942
3985
|
this.modelFactory = modelFactory;
|
|
3943
|
-
this.initialized = new
|
|
3986
|
+
this.initialized = new Trigger6();
|
|
3944
3987
|
this.dataServiceSubscriptions = new DataServiceSubscriptions();
|
|
3945
3988
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3946
3989
|
this._instanceId = PublicKey10.random().toHex();
|
|
@@ -3978,7 +4021,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3978
4021
|
S: this,
|
|
3979
4022
|
C: (f, a) => f(...a)
|
|
3980
4023
|
});
|
|
3981
|
-
log13.trace("dxos.sdk.service-context.open",
|
|
4024
|
+
log13.trace("dxos.sdk.service-context.open", trace8.begin({
|
|
3982
4025
|
id: this._instanceId
|
|
3983
4026
|
}), {
|
|
3984
4027
|
F: __dxlog_file15,
|
|
@@ -3994,7 +4037,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3994
4037
|
if (this.identityManager.identity) {
|
|
3995
4038
|
await this._initialize(ctx);
|
|
3996
4039
|
}
|
|
3997
|
-
log13.trace("dxos.sdk.service-context.open",
|
|
4040
|
+
log13.trace("dxos.sdk.service-context.open", trace8.end({
|
|
3998
4041
|
id: this._instanceId
|
|
3999
4042
|
}), {
|
|
4000
4043
|
F: __dxlog_file15,
|
|
@@ -4157,13 +4200,13 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4157
4200
|
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
4158
4201
|
}
|
|
4159
4202
|
};
|
|
4160
|
-
|
|
4203
|
+
_ts_decorate6([
|
|
4161
4204
|
Trace2.span()
|
|
4162
4205
|
], ServiceContext.prototype, "open", null);
|
|
4163
|
-
|
|
4206
|
+
_ts_decorate6([
|
|
4164
4207
|
Trace2.span()
|
|
4165
4208
|
], ServiceContext.prototype, "_initialize", null);
|
|
4166
|
-
ServiceContext =
|
|
4209
|
+
ServiceContext = _ts_decorate6([
|
|
4167
4210
|
safeInstanceof("dxos.client-services.ServiceContext"),
|
|
4168
4211
|
Trace2.resource()
|
|
4169
4212
|
], ServiceContext);
|
|
@@ -4193,10 +4236,10 @@ var ServiceRegistry = class {
|
|
|
4193
4236
|
};
|
|
4194
4237
|
|
|
4195
4238
|
// packages/sdk/client-services/src/packlets/locks/browser.ts
|
|
4196
|
-
import { asyncTimeout, Trigger as
|
|
4239
|
+
import { asyncTimeout, Trigger as Trigger7 } from "@dxos/async";
|
|
4197
4240
|
import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
|
|
4198
4241
|
import { log as log14, logInfo } from "@dxos/log";
|
|
4199
|
-
function
|
|
4242
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
4200
4243
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4201
4244
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4202
4245
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4214,7 +4257,7 @@ var Message;
|
|
|
4214
4257
|
var Lock = class {
|
|
4215
4258
|
constructor({ lockKey, onAcquire, onRelease }) {
|
|
4216
4259
|
this._broadcastChannel = new BroadcastChannel("vault-resource-lock");
|
|
4217
|
-
this._releaseTrigger = new
|
|
4260
|
+
this._releaseTrigger = new Trigger7();
|
|
4218
4261
|
this._lockKey = lockKey;
|
|
4219
4262
|
this._onAcquire = onAcquire;
|
|
4220
4263
|
this._onRelease = onRelease;
|
|
@@ -4274,13 +4317,13 @@ var Lock = class {
|
|
|
4274
4317
|
S: this,
|
|
4275
4318
|
C: (f, a) => f(...a)
|
|
4276
4319
|
});
|
|
4277
|
-
const acquired = new
|
|
4320
|
+
const acquired = new Trigger7();
|
|
4278
4321
|
void navigator.locks.request(this._lockKey, {
|
|
4279
4322
|
steal
|
|
4280
4323
|
}, async () => {
|
|
4281
4324
|
await this._onAcquire?.();
|
|
4282
4325
|
acquired.wake();
|
|
4283
|
-
this._releaseTrigger = new
|
|
4326
|
+
this._releaseTrigger = new Trigger7();
|
|
4284
4327
|
await this._releaseTrigger.wait();
|
|
4285
4328
|
log14("releasing lock...", void 0, {
|
|
4286
4329
|
F: __dxlog_file16,
|
|
@@ -4309,7 +4352,7 @@ var Lock = class {
|
|
|
4309
4352
|
});
|
|
4310
4353
|
}
|
|
4311
4354
|
};
|
|
4312
|
-
|
|
4355
|
+
_ts_decorate7([
|
|
4313
4356
|
logInfo
|
|
4314
4357
|
], Lock.prototype, "lockKey", null);
|
|
4315
4358
|
var isLocked = (lockPath) => {
|
|
@@ -4378,7 +4421,7 @@ import { log as log16 } from "@dxos/log";
|
|
|
4378
4421
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
4379
4422
|
import { ModelFactory } from "@dxos/model-factory";
|
|
4380
4423
|
import { createSimplePeerTransportFactory, NetworkManager } from "@dxos/network-manager";
|
|
4381
|
-
import { trace as
|
|
4424
|
+
import { trace as trace9 } from "@dxos/protocols";
|
|
4382
4425
|
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
4383
4426
|
import { TextModel } from "@dxos/text-model";
|
|
4384
4427
|
import { TRACE_PROCESSOR, trace as Trace3 } from "@dxos/tracing";
|
|
@@ -4632,7 +4675,7 @@ var SystemServiceImpl = class {
|
|
|
4632
4675
|
};
|
|
4633
4676
|
|
|
4634
4677
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4635
|
-
function
|
|
4678
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
4636
4679
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4637
4680
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4638
4681
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4802,7 +4845,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4802
4845
|
return;
|
|
4803
4846
|
}
|
|
4804
4847
|
const traceId = PublicKey11.random().toHex();
|
|
4805
|
-
log16.trace("dxos.client-services.host.open",
|
|
4848
|
+
log16.trace("dxos.client-services.host.open", trace9.begin({
|
|
4806
4849
|
id: traceId
|
|
4807
4850
|
}), {
|
|
4808
4851
|
F: __dxlog_file17,
|
|
@@ -4901,7 +4944,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4901
4944
|
S: this,
|
|
4902
4945
|
C: (f, a) => f(...a)
|
|
4903
4946
|
});
|
|
4904
|
-
log16.trace("dxos.client-services.host.open",
|
|
4947
|
+
log16.trace("dxos.client-services.host.open", trace9.end({
|
|
4905
4948
|
id: traceId
|
|
4906
4949
|
}), {
|
|
4907
4950
|
F: __dxlog_file17,
|
|
@@ -4942,7 +4985,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4942
4985
|
}
|
|
4943
4986
|
async reset() {
|
|
4944
4987
|
const traceId = PublicKey11.random().toHex();
|
|
4945
|
-
log16.trace("dxos.sdk.client-services-host.reset",
|
|
4988
|
+
log16.trace("dxos.sdk.client-services-host.reset", trace9.begin({
|
|
4946
4989
|
id: traceId
|
|
4947
4990
|
}), {
|
|
4948
4991
|
F: __dxlog_file17,
|
|
@@ -4964,7 +5007,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4964
5007
|
S: this,
|
|
4965
5008
|
C: (f, a) => f(...a)
|
|
4966
5009
|
});
|
|
4967
|
-
log16.trace("dxos.sdk.client-services-host.reset",
|
|
5010
|
+
log16.trace("dxos.sdk.client-services-host.reset", trace9.end({
|
|
4968
5011
|
id: traceId
|
|
4969
5012
|
}), {
|
|
4970
5013
|
F: __dxlog_file17,
|
|
@@ -4994,21 +5037,21 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4994
5037
|
return identity;
|
|
4995
5038
|
}
|
|
4996
5039
|
};
|
|
4997
|
-
|
|
5040
|
+
_ts_decorate8([
|
|
4998
5041
|
Trace3.info()
|
|
4999
5042
|
], ClientServicesHost.prototype, "_opening", void 0);
|
|
5000
|
-
|
|
5043
|
+
_ts_decorate8([
|
|
5001
5044
|
Trace3.info()
|
|
5002
5045
|
], ClientServicesHost.prototype, "_open", void 0);
|
|
5003
|
-
|
|
5046
|
+
_ts_decorate8([
|
|
5004
5047
|
synchronized3,
|
|
5005
5048
|
Trace3.span()
|
|
5006
5049
|
], ClientServicesHost.prototype, "open", null);
|
|
5007
|
-
|
|
5050
|
+
_ts_decorate8([
|
|
5008
5051
|
synchronized3,
|
|
5009
5052
|
Trace3.span()
|
|
5010
5053
|
], ClientServicesHost.prototype, "close", null);
|
|
5011
|
-
ClientServicesHost =
|
|
5054
|
+
ClientServicesHost = _ts_decorate8([
|
|
5012
5055
|
Trace3.resource()
|
|
5013
5056
|
], ClientServicesHost);
|
|
5014
5057
|
|
|
@@ -5045,4 +5088,4 @@ export {
|
|
|
5045
5088
|
createDefaultModelFactory,
|
|
5046
5089
|
ClientServicesHost
|
|
5047
5090
|
};
|
|
5048
|
-
//# sourceMappingURL=chunk-
|
|
5091
|
+
//# sourceMappingURL=chunk-UUQTHQF5.mjs.map
|