@dxos/client-services 0.1.53-main.528b72b → 0.1.53-main.5bcfb84
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-RKD47ENR.mjs → chunk-EYXOVYW5.mjs} +185 -102
- package/dist/lib/browser/chunk-EYXOVYW5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -2
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +19 -2
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +187 -98
- 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 +194 -95
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +6 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +11 -2
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +2 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +7 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/packlets/identity/identity.ts +21 -26
- package/src/packlets/services/service-context.ts +9 -7
- package/src/packlets/services/service-host.test.ts +50 -2
- package/src/packlets/services/service-host.ts +9 -0
- package/src/packlets/spaces/data-space-manager.test.ts +72 -118
- package/src/packlets/spaces/data-space-manager.ts +13 -3
- package/src/packlets/spaces/data-space.ts +66 -20
- package/src/packlets/spaces/notarization-plugin.test.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.ts +5 -1
- package/src/packlets/spaces/spaces-service.ts +26 -8
- package/src/packlets/testing/test-builder.ts +35 -2
- package/src/packlets/vault/worker-runtime.ts +1 -1
- package/dist/lib/browser/chunk-RKD47ENR.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -545,15 +545,15 @@ var Identity = class {
|
|
|
545
545
|
this._signer = signer;
|
|
546
546
|
this.identityKey = identityKey;
|
|
547
547
|
this.deviceKey = deviceKey;
|
|
548
|
-
this._deviceStateMachine =
|
|
548
|
+
this._deviceStateMachine = new import_credentials2.DeviceStateMachine({
|
|
549
549
|
identityKey: this.identityKey,
|
|
550
550
|
deviceKey: this.deviceKey,
|
|
551
551
|
onUpdate: () => this.stateUpdate.emit()
|
|
552
|
-
})
|
|
553
|
-
this._profileStateMachine =
|
|
552
|
+
});
|
|
553
|
+
this._profileStateMachine = new import_credentials2.ProfileStateMachine({
|
|
554
554
|
identityKey: this.identityKey,
|
|
555
555
|
onUpdate: () => this.stateUpdate.emit()
|
|
556
|
-
})
|
|
556
|
+
});
|
|
557
557
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
558
558
|
trustedKeysProvider: () => this.authorizedDeviceKeys,
|
|
559
559
|
update: this.stateUpdate,
|
|
@@ -562,27 +562,27 @@ var Identity = class {
|
|
|
562
562
|
}
|
|
563
563
|
// TODO(burdon): Expose state object?
|
|
564
564
|
get authorizedDeviceKeys() {
|
|
565
|
-
return this._deviceStateMachine.
|
|
565
|
+
return this._deviceStateMachine.authorizedDeviceKeys;
|
|
566
566
|
}
|
|
567
567
|
async open() {
|
|
568
|
-
await this.
|
|
569
|
-
await this.
|
|
568
|
+
await this.space.spaceState.addCredentialProcessor(this._deviceStateMachine);
|
|
569
|
+
await this.space.spaceState.addCredentialProcessor(this._profileStateMachine);
|
|
570
570
|
await this.space.open();
|
|
571
571
|
}
|
|
572
572
|
async close() {
|
|
573
573
|
await this.authVerifier.close();
|
|
574
|
-
await this.
|
|
575
|
-
await this.
|
|
574
|
+
await this.space.spaceState.removeCredentialProcessor(this._profileStateMachine);
|
|
575
|
+
await this.space.spaceState.removeCredentialProcessor(this._deviceStateMachine);
|
|
576
576
|
await this.space.close();
|
|
577
577
|
}
|
|
578
578
|
async ready() {
|
|
579
|
-
await this._deviceStateMachine.
|
|
579
|
+
await this._deviceStateMachine.deviceChainReady.wait();
|
|
580
580
|
await this.controlPipeline.state.waitUntilReachedTargetTimeframe({
|
|
581
581
|
timeout: import_client_protocol.LOAD_CONTROL_FEEDS_TIMEOUT
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
584
|
get profileDocument() {
|
|
585
|
-
return this._profileStateMachine.
|
|
585
|
+
return this._profileStateMachine.profile;
|
|
586
586
|
}
|
|
587
587
|
/**
|
|
588
588
|
* @test-only
|
|
@@ -597,7 +597,7 @@ var Identity = class {
|
|
|
597
597
|
return this.space.genesisFeedKey;
|
|
598
598
|
}
|
|
599
599
|
get deviceCredentialChain() {
|
|
600
|
-
return this._deviceStateMachine.
|
|
600
|
+
return this._deviceStateMachine.deviceCredentialChain;
|
|
601
601
|
}
|
|
602
602
|
getAdmissionCredentials() {
|
|
603
603
|
var _a, _b;
|
|
@@ -612,8 +612,8 @@ var Identity = class {
|
|
|
612
612
|
* Requires identity to be ready.
|
|
613
613
|
*/
|
|
614
614
|
getIdentityCredentialSigner() {
|
|
615
|
-
(0, import_tiny_invariant.default)(this._deviceStateMachine.
|
|
616
|
-
return (0, import_credentials2.createCredentialSignerWithChain)(this._signer, this._deviceStateMachine.
|
|
615
|
+
(0, import_tiny_invariant.default)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.");
|
|
616
|
+
return (0, import_credentials2.createCredentialSignerWithChain)(this._signer, this._deviceStateMachine.deviceCredentialChain, this.deviceKey);
|
|
617
617
|
}
|
|
618
618
|
/**
|
|
619
619
|
* Issues credentials as device.
|
|
@@ -630,7 +630,7 @@ var Identity = class {
|
|
|
630
630
|
dataFeedKey
|
|
631
631
|
}, {
|
|
632
632
|
F: __dxlog_file2,
|
|
633
|
-
L:
|
|
633
|
+
L: 151,
|
|
634
634
|
S: this,
|
|
635
635
|
C: (f, a) => f(...a)
|
|
636
636
|
});
|
|
@@ -2210,6 +2210,9 @@ var NotarizationPlugin = class {
|
|
|
2210
2210
|
this._processedCredentials = new import_util3.ComplexSet(import_keys7.PublicKey.hash);
|
|
2211
2211
|
this._processCredentialsTriggers = new import_util3.ComplexMap(import_keys7.PublicKey.hash);
|
|
2212
2212
|
}
|
|
2213
|
+
get hasWriter() {
|
|
2214
|
+
return !!this._writer;
|
|
2215
|
+
}
|
|
2213
2216
|
async open() {
|
|
2214
2217
|
}
|
|
2215
2218
|
async close() {
|
|
@@ -2223,7 +2226,7 @@ var NotarizationPlugin = class {
|
|
|
2223
2226
|
credentials
|
|
2224
2227
|
}, {
|
|
2225
2228
|
F: __dxlog_file8,
|
|
2226
|
-
L:
|
|
2229
|
+
L: 91,
|
|
2227
2230
|
S: this,
|
|
2228
2231
|
C: (f, a) => f(...a)
|
|
2229
2232
|
});
|
|
@@ -2235,7 +2238,7 @@ var NotarizationPlugin = class {
|
|
|
2235
2238
|
err
|
|
2236
2239
|
}, {
|
|
2237
2240
|
F: __dxlog_file8,
|
|
2238
|
-
L:
|
|
2241
|
+
L: 100,
|
|
2239
2242
|
S: this,
|
|
2240
2243
|
C: (f, a) => f(...a)
|
|
2241
2244
|
});
|
|
@@ -2251,7 +2254,7 @@ var NotarizationPlugin = class {
|
|
|
2251
2254
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
2252
2255
|
}, {
|
|
2253
2256
|
F: __dxlog_file8,
|
|
2254
|
-
L:
|
|
2257
|
+
L: 112,
|
|
2255
2258
|
S: this,
|
|
2256
2259
|
C: (f, a) => f(...a)
|
|
2257
2260
|
});
|
|
@@ -2274,7 +2277,7 @@ var NotarizationPlugin = class {
|
|
|
2274
2277
|
retryIn: retryTimeout
|
|
2275
2278
|
}, {
|
|
2276
2279
|
F: __dxlog_file8,
|
|
2277
|
-
L:
|
|
2280
|
+
L: 137,
|
|
2278
2281
|
S: this,
|
|
2279
2282
|
C: (f, a) => f(...a)
|
|
2280
2283
|
});
|
|
@@ -2288,7 +2291,7 @@ var NotarizationPlugin = class {
|
|
|
2288
2291
|
credentialId: credentials.map((credential) => credential.id)
|
|
2289
2292
|
}, {
|
|
2290
2293
|
F: __dxlog_file8,
|
|
2291
|
-
L:
|
|
2294
|
+
L: 144,
|
|
2292
2295
|
S: this,
|
|
2293
2296
|
C: (f, a) => f(...a)
|
|
2294
2297
|
});
|
|
@@ -2297,7 +2300,7 @@ var NotarizationPlugin = class {
|
|
|
2297
2300
|
});
|
|
2298
2301
|
(0, import_log8.log)("success", void 0, {
|
|
2299
2302
|
F: __dxlog_file8,
|
|
2300
|
-
L:
|
|
2303
|
+
L: 148,
|
|
2301
2304
|
S: this,
|
|
2302
2305
|
C: (f, a) => f(...a)
|
|
2303
2306
|
});
|
|
@@ -2306,7 +2309,7 @@ var NotarizationPlugin = class {
|
|
|
2306
2309
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2307
2310
|
import_log8.log.warn("error notarizing (recoverable)", err, {
|
|
2308
2311
|
F: __dxlog_file8,
|
|
2309
|
-
L:
|
|
2312
|
+
L: 152,
|
|
2310
2313
|
S: this,
|
|
2311
2314
|
C: (f, a) => f(...a)
|
|
2312
2315
|
});
|
|
@@ -2324,7 +2327,7 @@ var NotarizationPlugin = class {
|
|
|
2324
2327
|
]);
|
|
2325
2328
|
(0, import_log8.log)("done", void 0, {
|
|
2326
2329
|
F: __dxlog_file8,
|
|
2327
|
-
L:
|
|
2330
|
+
L: 163,
|
|
2328
2331
|
S: this,
|
|
2329
2332
|
C: (f, a) => f(...a)
|
|
2330
2333
|
});
|
|
@@ -2335,7 +2338,7 @@ var NotarizationPlugin = class {
|
|
|
2335
2338
|
/**
|
|
2336
2339
|
* Called with credentials arriving from the control pipeline.
|
|
2337
2340
|
*/
|
|
2338
|
-
async
|
|
2341
|
+
async processCredential(credential) {
|
|
2339
2342
|
var _a;
|
|
2340
2343
|
if (!credential.id) {
|
|
2341
2344
|
return;
|
|
@@ -2377,7 +2380,7 @@ var NotarizationPlugin = class {
|
|
|
2377
2380
|
peer: extension.localPeerId
|
|
2378
2381
|
}, {
|
|
2379
2382
|
F: __dxlog_file8,
|
|
2380
|
-
L:
|
|
2383
|
+
L: 212,
|
|
2381
2384
|
S: this,
|
|
2382
2385
|
C: (f, a) => f(...a)
|
|
2383
2386
|
});
|
|
@@ -2389,7 +2392,7 @@ var NotarizationPlugin = class {
|
|
|
2389
2392
|
peer: extension.localPeerId
|
|
2390
2393
|
}, {
|
|
2391
2394
|
F: __dxlog_file8,
|
|
2392
|
-
L:
|
|
2395
|
+
L: 217,
|
|
2393
2396
|
S: this,
|
|
2394
2397
|
C: (f, a) => f(...a)
|
|
2395
2398
|
});
|
|
@@ -2446,6 +2449,7 @@ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/sr
|
|
|
2446
2449
|
var DataSpace = class DataSpace2 {
|
|
2447
2450
|
constructor(params) {
|
|
2448
2451
|
this._ctx = new import_context6.Context();
|
|
2452
|
+
this._notarizationPlugin = new NotarizationPlugin();
|
|
2449
2453
|
this._state = import_services6.SpaceState.CLOSED;
|
|
2450
2454
|
/**
|
|
2451
2455
|
* Error for _state === SpaceState.ERROR.
|
|
@@ -2468,8 +2472,8 @@ var DataSpace = class DataSpace2 {
|
|
|
2468
2472
|
update: this._inner.stateUpdate,
|
|
2469
2473
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
2470
2474
|
});
|
|
2471
|
-
this._notarizationPluginConsumer = this._inner.spaceState.registerProcessor(new NotarizationPlugin());
|
|
2472
2475
|
this._cache = params.cache;
|
|
2476
|
+
this._state = params.initialState;
|
|
2473
2477
|
}
|
|
2474
2478
|
get key() {
|
|
2475
2479
|
return this._inner.key;
|
|
@@ -2491,25 +2495,36 @@ var DataSpace = class DataSpace2 {
|
|
|
2491
2495
|
return this._presence;
|
|
2492
2496
|
}
|
|
2493
2497
|
get notarizationPlugin() {
|
|
2494
|
-
return this.
|
|
2498
|
+
return this._notarizationPlugin;
|
|
2495
2499
|
}
|
|
2496
2500
|
get cache() {
|
|
2497
2501
|
return this._cache;
|
|
2498
2502
|
}
|
|
2499
2503
|
async open() {
|
|
2500
|
-
await this.
|
|
2501
|
-
|
|
2504
|
+
await this._open();
|
|
2505
|
+
}
|
|
2506
|
+
async _open() {
|
|
2507
|
+
await this._notarizationPlugin.open();
|
|
2508
|
+
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
2502
2509
|
await this._inner.open();
|
|
2503
|
-
this._state = import_services6.SpaceState.
|
|
2510
|
+
this._state = import_services6.SpaceState.CONTROL_ONLY;
|
|
2511
|
+
this.stateUpdate.emit();
|
|
2512
|
+
this.metrics = {};
|
|
2504
2513
|
this.metrics.open = new Date();
|
|
2505
2514
|
}
|
|
2506
2515
|
async close() {
|
|
2516
|
+
await this._close();
|
|
2517
|
+
}
|
|
2518
|
+
async _close() {
|
|
2519
|
+
var _a, _b;
|
|
2520
|
+
await ((_b = (_a = this._callbacks).beforeClose) == null ? void 0 : _b.call(_a));
|
|
2507
2521
|
this._state = import_services6.SpaceState.CLOSED;
|
|
2508
2522
|
await this._ctx.dispose();
|
|
2523
|
+
this._ctx = new import_context6.Context();
|
|
2509
2524
|
await this.authVerifier.close();
|
|
2510
2525
|
await this._inner.close();
|
|
2511
|
-
await this.
|
|
2512
|
-
await this.
|
|
2526
|
+
await this._inner.spaceState.removeCredentialProcessor(this._notarizationPlugin);
|
|
2527
|
+
await this._notarizationPlugin.close();
|
|
2513
2528
|
await this._presence.destroy();
|
|
2514
2529
|
}
|
|
2515
2530
|
async postMessage(channel, message) {
|
|
@@ -2530,7 +2545,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2530
2545
|
if (err instanceof import_errors3.CancelledError) {
|
|
2531
2546
|
(0, import_log9.log)("Data pipeline initialization cancelled", err, {
|
|
2532
2547
|
F: __dxlog_file9,
|
|
2533
|
-
L:
|
|
2548
|
+
L: 193,
|
|
2534
2549
|
S: this,
|
|
2535
2550
|
C: (f, a) => f(...a)
|
|
2536
2551
|
});
|
|
@@ -2538,7 +2553,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2538
2553
|
}
|
|
2539
2554
|
import_log9.log.error("Error initializing data pipeline", err, {
|
|
2540
2555
|
F: __dxlog_file9,
|
|
2541
|
-
L:
|
|
2556
|
+
L: 197,
|
|
2542
2557
|
S: this,
|
|
2543
2558
|
C: (f, a) => f(...a)
|
|
2544
2559
|
});
|
|
@@ -2552,7 +2567,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2552
2567
|
}
|
|
2553
2568
|
async initializeDataPipeline() {
|
|
2554
2569
|
var _a, _b, _c, _d;
|
|
2555
|
-
if (this._state !== import_services6.SpaceState.
|
|
2570
|
+
if (this._state !== import_services6.SpaceState.CONTROL_ONLY) {
|
|
2556
2571
|
throw new import_errors3.SystemError("Invalid operation");
|
|
2557
2572
|
}
|
|
2558
2573
|
this._state = import_services6.SpaceState.INITIALIZING;
|
|
@@ -2564,22 +2579,24 @@ var DataSpace = class DataSpace2 {
|
|
|
2564
2579
|
await this._createWritableFeeds();
|
|
2565
2580
|
(0, import_log9.log)("Writable feeds created", void 0, {
|
|
2566
2581
|
F: __dxlog_file9,
|
|
2567
|
-
L:
|
|
2582
|
+
L: 221,
|
|
2568
2583
|
S: this,
|
|
2569
2584
|
C: (f, a) => f(...a)
|
|
2570
2585
|
});
|
|
2571
2586
|
this.stateUpdate.emit();
|
|
2572
|
-
this.notarizationPlugin.
|
|
2573
|
-
credential
|
|
2574
|
-
credential
|
|
2575
|
-
|
|
2576
|
-
|
|
2587
|
+
if (!this.notarizationPlugin.hasWriter) {
|
|
2588
|
+
this.notarizationPlugin.setWriter((0, import_echo_pipeline.createMappedFeedWriter)((credential) => ({
|
|
2589
|
+
credential: {
|
|
2590
|
+
credential
|
|
2591
|
+
}
|
|
2592
|
+
}), this._inner.controlPipeline.writer));
|
|
2593
|
+
}
|
|
2577
2594
|
await this._inner.initializeDataPipeline();
|
|
2578
2595
|
this.metrics.dataPipelineOpen = new Date();
|
|
2579
2596
|
await (0, import_context6.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
2580
2597
|
(0, import_log9.log)("waiting for data pipeline to reach target timeframe", void 0, {
|
|
2581
2598
|
F: __dxlog_file9,
|
|
2582
|
-
L:
|
|
2599
|
+
L: 242,
|
|
2583
2600
|
S: this,
|
|
2584
2601
|
C: (f, a) => f(...a)
|
|
2585
2602
|
});
|
|
@@ -2590,7 +2607,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2590
2607
|
this.metrics.dataPipelineReady = new Date();
|
|
2591
2608
|
(0, import_log9.log)("data pipeline ready", void 0, {
|
|
2592
2609
|
F: __dxlog_file9,
|
|
2593
|
-
L:
|
|
2610
|
+
L: 251,
|
|
2594
2611
|
S: this,
|
|
2595
2612
|
C: (f, a) => f(...a)
|
|
2596
2613
|
});
|
|
@@ -2670,10 +2687,39 @@ var DataSpace = class DataSpace2 {
|
|
|
2670
2687
|
}
|
|
2671
2688
|
}
|
|
2672
2689
|
}
|
|
2690
|
+
async activate() {
|
|
2691
|
+
if (this._state !== import_services6.SpaceState.INACTIVE) {
|
|
2692
|
+
throw new import_errors3.SystemError("Invalid operation");
|
|
2693
|
+
}
|
|
2694
|
+
await this._metadataStore.setSpaceState(this.key, import_services6.SpaceState.ACTIVE);
|
|
2695
|
+
await this._open();
|
|
2696
|
+
this.initializeDataPipelineAsync();
|
|
2697
|
+
}
|
|
2698
|
+
async deactivate() {
|
|
2699
|
+
if (this._state === import_services6.SpaceState.INACTIVE) {
|
|
2700
|
+
throw new import_errors3.SystemError("Invalid operation");
|
|
2701
|
+
}
|
|
2702
|
+
await this._metadataStore.setSpaceState(this.key, import_services6.SpaceState.INACTIVE);
|
|
2703
|
+
await this._close();
|
|
2704
|
+
this._state = import_services6.SpaceState.INACTIVE;
|
|
2705
|
+
this.stateUpdate.emit();
|
|
2706
|
+
}
|
|
2673
2707
|
};
|
|
2708
|
+
_ts_decorate([
|
|
2709
|
+
import_async11.synchronized
|
|
2710
|
+
], DataSpace.prototype, "open", null);
|
|
2711
|
+
_ts_decorate([
|
|
2712
|
+
import_async11.synchronized
|
|
2713
|
+
], DataSpace.prototype, "close", null);
|
|
2674
2714
|
_ts_decorate([
|
|
2675
2715
|
(0, import_debug3.timed)(1e4)
|
|
2676
2716
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
2717
|
+
_ts_decorate([
|
|
2718
|
+
import_async11.synchronized
|
|
2719
|
+
], DataSpace.prototype, "activate", null);
|
|
2720
|
+
_ts_decorate([
|
|
2721
|
+
import_async11.synchronized
|
|
2722
|
+
], DataSpace.prototype, "deactivate", null);
|
|
2677
2723
|
DataSpace = _ts_decorate([
|
|
2678
2724
|
(0, import_async11.trackLeaks)("open", "close")
|
|
2679
2725
|
], DataSpace);
|
|
@@ -2813,14 +2859,16 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2813
2859
|
C: (f, a) => f(...a)
|
|
2814
2860
|
});
|
|
2815
2861
|
const space = await this._constructSpace(spaceMetadata);
|
|
2816
|
-
|
|
2862
|
+
if (spaceMetadata.state !== import_services7.SpaceState.INACTIVE) {
|
|
2863
|
+
space.initializeDataPipelineAsync();
|
|
2864
|
+
}
|
|
2817
2865
|
} catch (err) {
|
|
2818
2866
|
import_log10.log.error("Error loading space", {
|
|
2819
2867
|
spaceMetadata,
|
|
2820
2868
|
err
|
|
2821
2869
|
}, {
|
|
2822
2870
|
F: __dxlog_file10,
|
|
2823
|
-
L:
|
|
2871
|
+
L: 93,
|
|
2824
2872
|
S: this,
|
|
2825
2873
|
C: (f, a) => f(...a)
|
|
2826
2874
|
});
|
|
@@ -2832,7 +2880,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2832
2880
|
id: this._instanceId
|
|
2833
2881
|
}), {
|
|
2834
2882
|
F: __dxlog_file10,
|
|
2835
|
-
L:
|
|
2883
|
+
L: 99,
|
|
2836
2884
|
S: this,
|
|
2837
2885
|
C: (f, a) => f(...a)
|
|
2838
2886
|
});
|
|
@@ -2840,7 +2888,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2840
2888
|
async close() {
|
|
2841
2889
|
(0, import_log10.log)("close", void 0, {
|
|
2842
2890
|
F: __dxlog_file10,
|
|
2843
|
-
L:
|
|
2891
|
+
L: 104,
|
|
2844
2892
|
S: this,
|
|
2845
2893
|
C: (f, a) => f(...a)
|
|
2846
2894
|
});
|
|
@@ -2862,13 +2910,14 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2862
2910
|
key: spaceKey,
|
|
2863
2911
|
genesisFeedKey: controlFeedKey,
|
|
2864
2912
|
controlFeedKey,
|
|
2865
|
-
dataFeedKey
|
|
2913
|
+
dataFeedKey,
|
|
2914
|
+
state: import_services7.SpaceState.ACTIVE
|
|
2866
2915
|
};
|
|
2867
2916
|
(0, import_log10.log)("creating space...", {
|
|
2868
2917
|
spaceKey
|
|
2869
2918
|
}, {
|
|
2870
2919
|
F: __dxlog_file10,
|
|
2871
|
-
L:
|
|
2920
|
+
L: 129,
|
|
2872
2921
|
S: this,
|
|
2873
2922
|
C: (f, a) => f(...a)
|
|
2874
2923
|
});
|
|
@@ -2888,7 +2937,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2888
2937
|
opts
|
|
2889
2938
|
}, {
|
|
2890
2939
|
F: __dxlog_file10,
|
|
2891
|
-
L:
|
|
2940
|
+
L: 148,
|
|
2892
2941
|
S: this,
|
|
2893
2942
|
C: (f, a) => f(...a)
|
|
2894
2943
|
});
|
|
@@ -2922,7 +2971,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2922
2971
|
metadata
|
|
2923
2972
|
}, {
|
|
2924
2973
|
F: __dxlog_file10,
|
|
2925
|
-
L:
|
|
2974
|
+
L: 183,
|
|
2926
2975
|
S: this,
|
|
2927
2976
|
C: (f, a) => f(...a)
|
|
2928
2977
|
});
|
|
@@ -2958,7 +3007,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2958
3007
|
onAuthFailure: () => {
|
|
2959
3008
|
import_log10.log.warn("auth failure", void 0, {
|
|
2960
3009
|
F: __dxlog_file10,
|
|
2961
|
-
L:
|
|
3010
|
+
L: 214,
|
|
2962
3011
|
S: this,
|
|
2963
3012
|
C: (f, a) => f(...a)
|
|
2964
3013
|
});
|
|
@@ -2969,6 +3018,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2969
3018
|
dataFeed && space.setDataFeed(dataFeed);
|
|
2970
3019
|
const dataSpace = new DataSpace({
|
|
2971
3020
|
inner: space,
|
|
3021
|
+
initialState: metadata.state === import_services7.SpaceState.INACTIVE ? import_services7.SpaceState.INACTIVE : import_services7.SpaceState.CLOSED,
|
|
2972
3022
|
metadataStore: this._metadataStore,
|
|
2973
3023
|
gossip,
|
|
2974
3024
|
presence,
|
|
@@ -2981,11 +3031,11 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2981
3031
|
space: space.key
|
|
2982
3032
|
}, {
|
|
2983
3033
|
F: __dxlog_file10,
|
|
2984
|
-
L:
|
|
3034
|
+
L: 232,
|
|
2985
3035
|
S: this,
|
|
2986
3036
|
C: (f, a) => f(...a)
|
|
2987
3037
|
});
|
|
2988
|
-
this._dataServiceSubscriptions.registerSpace(space.key, dataSpace.dataPipeline.databaseHost.createDataServiceHost());
|
|
3038
|
+
await this._dataServiceSubscriptions.registerSpace(space.key, dataSpace.dataPipeline.databaseHost.createDataServiceHost());
|
|
2989
3039
|
},
|
|
2990
3040
|
afterReady: async () => {
|
|
2991
3041
|
(0, import_log10.log)("after space ready", {
|
|
@@ -2993,18 +3043,31 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2993
3043
|
open: this._isOpen
|
|
2994
3044
|
}, {
|
|
2995
3045
|
F: __dxlog_file10,
|
|
2996
|
-
L:
|
|
3046
|
+
L: 239,
|
|
2997
3047
|
S: this,
|
|
2998
3048
|
C: (f, a) => f(...a)
|
|
2999
3049
|
});
|
|
3000
3050
|
if (this._isOpen) {
|
|
3001
3051
|
this.updated.emit();
|
|
3002
3052
|
}
|
|
3053
|
+
},
|
|
3054
|
+
beforeClose: async () => {
|
|
3055
|
+
(0, import_log10.log)("before space close", {
|
|
3056
|
+
space: space.key
|
|
3057
|
+
}, {
|
|
3058
|
+
F: __dxlog_file10,
|
|
3059
|
+
L: 245,
|
|
3060
|
+
S: this,
|
|
3061
|
+
C: (f, a) => f(...a)
|
|
3062
|
+
});
|
|
3063
|
+
await this._dataServiceSubscriptions.unregisterSpace(space.key);
|
|
3003
3064
|
}
|
|
3004
3065
|
},
|
|
3005
3066
|
cache: metadata.cache
|
|
3006
3067
|
});
|
|
3007
|
-
|
|
3068
|
+
if (metadata.state !== import_services7.SpaceState.INACTIVE) {
|
|
3069
|
+
await dataSpace.open();
|
|
3070
|
+
}
|
|
3008
3071
|
if (metadata.controlTimeframe) {
|
|
3009
3072
|
dataSpace.inner.controlPipeline.state.setTargetTimeframe(metadata.controlTimeframe);
|
|
3010
3073
|
}
|
|
@@ -3036,6 +3099,7 @@ var import_async13 = require("@dxos/async");
|
|
|
3036
3099
|
var import_codec_protobuf9 = require("@dxos/codec-protobuf");
|
|
3037
3100
|
var import_debug5 = require("@dxos/debug");
|
|
3038
3101
|
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
3102
|
+
var import_errors4 = require("@dxos/errors");
|
|
3039
3103
|
var import_log11 = require("@dxos/log");
|
|
3040
3104
|
var import_protocols7 = require("@dxos/protocols");
|
|
3041
3105
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
@@ -3056,8 +3120,22 @@ var SpacesServiceImpl = class {
|
|
|
3056
3120
|
const space = await dataSpaceManager.createSpace();
|
|
3057
3121
|
return this._serializeSpace(space);
|
|
3058
3122
|
}
|
|
3059
|
-
async updateSpace(
|
|
3060
|
-
|
|
3123
|
+
async updateSpace({ spaceKey, state }) {
|
|
3124
|
+
var _a;
|
|
3125
|
+
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3126
|
+
const space = (_a = dataSpaceManager.spaces.get(spaceKey)) != null ? _a : (0, import_debug5.raise)(new import_echo_pipeline2.SpaceNotFoundError(spaceKey));
|
|
3127
|
+
if (state) {
|
|
3128
|
+
switch (state) {
|
|
3129
|
+
case import_services8.SpaceState.ACTIVE:
|
|
3130
|
+
await space.activate();
|
|
3131
|
+
break;
|
|
3132
|
+
case import_services8.SpaceState.INACTIVE:
|
|
3133
|
+
await space.deactivate();
|
|
3134
|
+
break;
|
|
3135
|
+
default:
|
|
3136
|
+
throw new import_errors4.ApiError("Invalid space state");
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3061
3139
|
}
|
|
3062
3140
|
querySpaces() {
|
|
3063
3141
|
return new import_codec_protobuf9.Stream(({ next, ctx }) => {
|
|
@@ -3068,7 +3146,7 @@ var SpacesServiceImpl = class {
|
|
|
3068
3146
|
spaces
|
|
3069
3147
|
}, {
|
|
3070
3148
|
F: __dxlog_file11,
|
|
3071
|
-
L:
|
|
3149
|
+
L: 78,
|
|
3072
3150
|
S: this,
|
|
3073
3151
|
C: (f, a) => f(...a)
|
|
3074
3152
|
});
|
|
@@ -3131,13 +3209,13 @@ var SpacesServiceImpl = class {
|
|
|
3131
3209
|
return new import_codec_protobuf9.Stream(({ ctx, next }) => {
|
|
3132
3210
|
var _a;
|
|
3133
3211
|
const space = (_a = this._spaceManager.spaces.get(spaceKey)) != null ? _a : (0, import_debug5.raise)(new import_echo_pipeline2.SpaceNotFoundError(spaceKey));
|
|
3134
|
-
const processor =
|
|
3135
|
-
|
|
3212
|
+
const processor = {
|
|
3213
|
+
processCredential: async (credential) => {
|
|
3136
3214
|
next(credential);
|
|
3137
3215
|
}
|
|
3138
|
-
}
|
|
3139
|
-
ctx.onDispose(() =>
|
|
3140
|
-
(0, import_async13.scheduleTask)(ctx, () =>
|
|
3216
|
+
};
|
|
3217
|
+
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3218
|
+
(0, import_async13.scheduleTask)(ctx, () => space.spaceState.addCredentialProcessor(processor));
|
|
3141
3219
|
});
|
|
3142
3220
|
}
|
|
3143
3221
|
async writeCredentials({ spaceKey, credentials }) {
|
|
@@ -3276,15 +3354,17 @@ var ServiceContext = class {
|
|
|
3276
3354
|
});
|
|
3277
3355
|
}
|
|
3278
3356
|
async close() {
|
|
3279
|
-
var _a
|
|
3357
|
+
var _a;
|
|
3280
3358
|
(0, import_log12.log)("closing...", void 0, {
|
|
3281
3359
|
F: __dxlog_file12,
|
|
3282
3360
|
L: 143,
|
|
3283
3361
|
S: this,
|
|
3284
3362
|
C: (f, a) => f(...a)
|
|
3285
3363
|
});
|
|
3286
|
-
|
|
3287
|
-
|
|
3364
|
+
if (this._deviceSpaceSync && this.identityManager.identity) {
|
|
3365
|
+
await this.identityManager.identity.space.spaceState.removeCredentialProcessor(this._deviceSpaceSync);
|
|
3366
|
+
}
|
|
3367
|
+
await ((_a = this.dataSpaceManager) == null ? void 0 : _a.close());
|
|
3288
3368
|
await this.identityManager.close();
|
|
3289
3369
|
await this.spaceManager.close();
|
|
3290
3370
|
await this.feedStore.close();
|
|
@@ -3293,7 +3373,7 @@ var ServiceContext = class {
|
|
|
3293
3373
|
this.dataServiceSubscriptions.clear();
|
|
3294
3374
|
(0, import_log12.log)("closed", void 0, {
|
|
3295
3375
|
F: __dxlog_file12,
|
|
3296
|
-
L:
|
|
3376
|
+
L: 154,
|
|
3297
3377
|
S: this,
|
|
3298
3378
|
C: (f, a) => f(...a)
|
|
3299
3379
|
});
|
|
@@ -3324,7 +3404,7 @@ var ServiceContext = class {
|
|
|
3324
3404
|
var _a;
|
|
3325
3405
|
(0, import_log12.log)("initializing spaces...", void 0, {
|
|
3326
3406
|
F: __dxlog_file12,
|
|
3327
|
-
L:
|
|
3407
|
+
L: 187,
|
|
3328
3408
|
S: this,
|
|
3329
3409
|
C: (f, a) => f(...a)
|
|
3330
3410
|
});
|
|
@@ -3349,8 +3429,8 @@ var ServiceContext = class {
|
|
|
3349
3429
|
return new SpaceInvitationProtocol(this.dataSpaceManager, signingContext, this.keyring, invitation.spaceKey);
|
|
3350
3430
|
});
|
|
3351
3431
|
this.initialized.wake();
|
|
3352
|
-
this._deviceSpaceSync =
|
|
3353
|
-
|
|
3432
|
+
this._deviceSpaceSync = {
|
|
3433
|
+
processCredential: async (credential) => {
|
|
3354
3434
|
const assertion = (0, import_credentials13.getCredentialAssertion)(credential);
|
|
3355
3435
|
if (assertion["@type"] !== "dxos.halo.credentials.SpaceMember") {
|
|
3356
3436
|
return;
|
|
@@ -3363,7 +3443,7 @@ var ServiceContext = class {
|
|
|
3363
3443
|
details: assertion
|
|
3364
3444
|
}, {
|
|
3365
3445
|
F: __dxlog_file12,
|
|
3366
|
-
L:
|
|
3446
|
+
L: 226,
|
|
3367
3447
|
S: this,
|
|
3368
3448
|
C: (f, a) => f(...a)
|
|
3369
3449
|
});
|
|
@@ -3374,7 +3454,7 @@ var ServiceContext = class {
|
|
|
3374
3454
|
details: assertion
|
|
3375
3455
|
}, {
|
|
3376
3456
|
F: __dxlog_file12,
|
|
3377
|
-
L:
|
|
3457
|
+
L: 230,
|
|
3378
3458
|
S: this,
|
|
3379
3459
|
C: (f, a) => f(...a)
|
|
3380
3460
|
});
|
|
@@ -3385,7 +3465,7 @@ var ServiceContext = class {
|
|
|
3385
3465
|
details: assertion
|
|
3386
3466
|
}, {
|
|
3387
3467
|
F: __dxlog_file12,
|
|
3388
|
-
L:
|
|
3468
|
+
L: 235,
|
|
3389
3469
|
S: this,
|
|
3390
3470
|
C: (f, a) => f(...a)
|
|
3391
3471
|
});
|
|
@@ -3396,14 +3476,14 @@ var ServiceContext = class {
|
|
|
3396
3476
|
} catch (err) {
|
|
3397
3477
|
import_log12.log.catch(err, void 0, {
|
|
3398
3478
|
F: __dxlog_file12,
|
|
3399
|
-
L:
|
|
3479
|
+
L: 241,
|
|
3400
3480
|
S: this,
|
|
3401
3481
|
C: (f, a) => f(...a)
|
|
3402
3482
|
});
|
|
3403
3483
|
}
|
|
3404
3484
|
}
|
|
3405
|
-
}
|
|
3406
|
-
await this._deviceSpaceSync
|
|
3485
|
+
};
|
|
3486
|
+
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
3407
3487
|
}
|
|
3408
3488
|
};
|
|
3409
3489
|
|
|
@@ -3632,7 +3712,7 @@ var NetworkServiceImpl = class {
|
|
|
3632
3712
|
|
|
3633
3713
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
3634
3714
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
3635
|
-
var
|
|
3715
|
+
var import_errors5 = require("@dxos/errors");
|
|
3636
3716
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
3637
3717
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
3638
3718
|
var import_util8 = require("@dxos/util");
|
|
@@ -3640,16 +3720,16 @@ var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
|
3640
3720
|
var createStorageObjects = (config) => {
|
|
3641
3721
|
const { path = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage", storageType, keyStorage, persistent = false } = config != null ? config : {};
|
|
3642
3722
|
if (persistent && storageType === StorageDriver.RAM) {
|
|
3643
|
-
throw new
|
|
3723
|
+
throw new import_errors5.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
3644
3724
|
}
|
|
3645
3725
|
if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
|
|
3646
|
-
throw new
|
|
3726
|
+
throw new import_errors5.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
3647
3727
|
}
|
|
3648
3728
|
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
3649
|
-
throw new
|
|
3729
|
+
throw new import_errors5.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
3650
3730
|
}
|
|
3651
3731
|
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
|
|
3652
|
-
throw new
|
|
3732
|
+
throw new import_errors5.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
3653
3733
|
}
|
|
3654
3734
|
return {
|
|
3655
3735
|
storage: (0, import_random_access_storage.createStorage)({
|
|
@@ -3766,13 +3846,15 @@ var ClientServicesHost = class {
|
|
|
3766
3846
|
connectionLog,
|
|
3767
3847
|
storage,
|
|
3768
3848
|
// TODO(wittjosiah): Turn this on by default.
|
|
3769
|
-
lockKey
|
|
3849
|
+
lockKey,
|
|
3850
|
+
callbacks
|
|
3770
3851
|
} = {}) {
|
|
3771
3852
|
this._statusUpdate = new import_async17.Event();
|
|
3772
3853
|
this._opening = false;
|
|
3773
3854
|
this._open = false;
|
|
3774
3855
|
this._storage = storage;
|
|
3775
3856
|
this._modelFactory = modelFactory;
|
|
3857
|
+
this._callbacks = callbacks;
|
|
3776
3858
|
if (config) {
|
|
3777
3859
|
this.initialize({
|
|
3778
3860
|
config,
|
|
@@ -3860,7 +3942,7 @@ var ClientServicesHost = class {
|
|
|
3860
3942
|
id: traceId
|
|
3861
3943
|
}), {
|
|
3862
3944
|
F: __dxlog_file14,
|
|
3863
|
-
L:
|
|
3945
|
+
L: 203,
|
|
3864
3946
|
S: this,
|
|
3865
3947
|
C: (f, a) => f(...a)
|
|
3866
3948
|
});
|
|
@@ -3873,7 +3955,7 @@ var ClientServicesHost = class {
|
|
|
3873
3955
|
lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
|
|
3874
3956
|
}, {
|
|
3875
3957
|
F: __dxlog_file14,
|
|
3876
|
-
L:
|
|
3958
|
+
L: 211,
|
|
3877
3959
|
S: this,
|
|
3878
3960
|
C: (f, a) => f(...a)
|
|
3879
3961
|
});
|
|
@@ -3908,7 +3990,7 @@ var ClientServicesHost = class {
|
|
|
3908
3990
|
deviceKey
|
|
3909
3991
|
}, {
|
|
3910
3992
|
F: __dxlog_file14,
|
|
3911
|
-
L:
|
|
3993
|
+
L: 266,
|
|
3912
3994
|
S: this,
|
|
3913
3995
|
C: (f, a) => f(...a)
|
|
3914
3996
|
});
|
|
@@ -3916,7 +3998,7 @@ var ClientServicesHost = class {
|
|
|
3916
3998
|
id: traceId
|
|
3917
3999
|
}), {
|
|
3918
4000
|
F: __dxlog_file14,
|
|
3919
|
-
L:
|
|
4001
|
+
L: 267,
|
|
3920
4002
|
S: this,
|
|
3921
4003
|
C: (f, a) => f(...a)
|
|
3922
4004
|
});
|
|
@@ -3931,7 +4013,7 @@ var ClientServicesHost = class {
|
|
|
3931
4013
|
deviceKey
|
|
3932
4014
|
}, {
|
|
3933
4015
|
F: __dxlog_file14,
|
|
3934
|
-
L:
|
|
4016
|
+
L: 277,
|
|
3935
4017
|
S: this,
|
|
3936
4018
|
C: (f, a) => f(...a)
|
|
3937
4019
|
});
|
|
@@ -3946,25 +4028,25 @@ var ClientServicesHost = class {
|
|
|
3946
4028
|
deviceKey
|
|
3947
4029
|
}, {
|
|
3948
4030
|
F: __dxlog_file14,
|
|
3949
|
-
L:
|
|
4031
|
+
L: 283,
|
|
3950
4032
|
S: this,
|
|
3951
4033
|
C: (f, a) => f(...a)
|
|
3952
4034
|
});
|
|
3953
4035
|
}
|
|
3954
4036
|
async reset() {
|
|
3955
|
-
var _a;
|
|
4037
|
+
var _a, _b, _c;
|
|
3956
4038
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
3957
4039
|
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols9.trace.begin({
|
|
3958
4040
|
id: traceId
|
|
3959
4041
|
}), {
|
|
3960
4042
|
F: __dxlog_file14,
|
|
3961
|
-
L:
|
|
4043
|
+
L: 288,
|
|
3962
4044
|
S: this,
|
|
3963
4045
|
C: (f, a) => f(...a)
|
|
3964
4046
|
});
|
|
3965
4047
|
(0, import_log15.log)("resetting...", void 0, {
|
|
3966
4048
|
F: __dxlog_file14,
|
|
3967
|
-
L:
|
|
4049
|
+
L: 290,
|
|
3968
4050
|
S: this,
|
|
3969
4051
|
C: (f, a) => f(...a)
|
|
3970
4052
|
});
|
|
@@ -3972,7 +4054,7 @@ var ClientServicesHost = class {
|
|
|
3972
4054
|
await this._storage.reset();
|
|
3973
4055
|
(0, import_log15.log)("reset", void 0, {
|
|
3974
4056
|
F: __dxlog_file14,
|
|
3975
|
-
L:
|
|
4057
|
+
L: 293,
|
|
3976
4058
|
S: this,
|
|
3977
4059
|
C: (f, a) => f(...a)
|
|
3978
4060
|
});
|
|
@@ -3980,10 +4062,11 @@ var ClientServicesHost = class {
|
|
|
3980
4062
|
id: traceId
|
|
3981
4063
|
}), {
|
|
3982
4064
|
F: __dxlog_file14,
|
|
3983
|
-
L:
|
|
4065
|
+
L: 294,
|
|
3984
4066
|
S: this,
|
|
3985
4067
|
C: (f, a) => f(...a)
|
|
3986
4068
|
});
|
|
4069
|
+
await ((_c = (_b = this._callbacks) == null ? void 0 : _b.onReset) == null ? void 0 : _c.call(_b));
|
|
3987
4070
|
}
|
|
3988
4071
|
};
|
|
3989
4072
|
_ts_decorate4([
|
|
@@ -4236,7 +4319,7 @@ _ts_decorate5([
|
|
|
4236
4319
|
// packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
|
|
4237
4320
|
var import_async20 = require("@dxos/async");
|
|
4238
4321
|
var import_client_protocol8 = require("@dxos/client-protocol");
|
|
4239
|
-
var
|
|
4322
|
+
var import_errors6 = require("@dxos/errors");
|
|
4240
4323
|
var import_log17 = require("@dxos/log");
|
|
4241
4324
|
var import_network_manager4 = require("@dxos/network-manager");
|
|
4242
4325
|
var import_rpc3 = require("@dxos/rpc");
|
|
@@ -4295,7 +4378,7 @@ var IFrameProxyRuntime = class {
|
|
|
4295
4378
|
S: this,
|
|
4296
4379
|
C: (f, a) => f(...a)
|
|
4297
4380
|
});
|
|
4298
|
-
throw new
|
|
4381
|
+
throw new import_errors6.RemoteServiceConnectionError("Failed to connect to worker");
|
|
4299
4382
|
}
|
|
4300
4383
|
await ((_a = this._shellRuntime) == null ? void 0 : _a.open());
|
|
4301
4384
|
}
|
|
@@ -4476,7 +4559,13 @@ var WorkerRuntime = class {
|
|
|
4476
4559
|
this._transportFactory = new import_network_manager5.WebRTCTransportProxyFactory();
|
|
4477
4560
|
this._ready = new import_async22.Trigger();
|
|
4478
4561
|
this.sessions = /* @__PURE__ */ new Set();
|
|
4479
|
-
this._clientServices = new ClientServicesHost(
|
|
4562
|
+
this._clientServices = new ClientServicesHost({
|
|
4563
|
+
callbacks: {
|
|
4564
|
+
onReset: async () => {
|
|
4565
|
+
self.close();
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
});
|
|
4480
4569
|
}
|
|
4481
4570
|
get host() {
|
|
4482
4571
|
return this._clientServices;
|