@dxos/client-services 0.4.8-main.ac78619 → 0.4.8-main.beadd4b
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-5DNT7O4B.mjs → chunk-C75D5PB3.mjs} +136 -41
- package/dist/lib/browser/{chunk-5DNT7O4B.mjs.map → chunk-C75D5PB3.mjs.map} +4 -4
- 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/{chunk-IIMBD24E.cjs → chunk-IR2Q2Y2D.cjs} +148 -57
- package/dist/lib/node/{chunk-IIMBD24E.cjs.map → chunk-IR2Q2Y2D.cjs.map} +4 -4
- package/dist/lib/node/index.cjs +38 -38
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/indexing/index.d.ts +2 -0
- package/dist/types/src/packlets/indexing/index.d.ts.map +1 -0
- package/dist/types/src/packlets/indexing/util.d.ts +15 -0
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts +2 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +37 -35
- package/src/packlets/indexing/index.ts +5 -0
- package/src/packlets/indexing/util.ts +89 -0
- package/src/packlets/services/service-context.ts +13 -2
- package/src/packlets/services/service-host.ts +6 -0
- package/src/version.ts +1 -1
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_IR2Q2Y2D_exports = {};
|
|
30
|
+
__export(chunk_IR2Q2Y2D_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -61,7 +61,7 @@ __export(chunk_IIMBD24E_exports, {
|
|
|
61
61
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
62
62
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
63
63
|
});
|
|
64
|
-
module.exports = __toCommonJS(
|
|
64
|
+
module.exports = __toCommonJS(chunk_IR2Q2Y2D_exports);
|
|
65
65
|
var import_async = require("@dxos/async");
|
|
66
66
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
67
67
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -207,8 +207,8 @@ var import_context10 = require("@dxos/context");
|
|
|
207
207
|
var import_credentials15 = require("@dxos/credentials");
|
|
208
208
|
var import_debug6 = require("@dxos/debug");
|
|
209
209
|
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
210
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
211
210
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
211
|
+
var import_indexing = require("@dxos/indexing");
|
|
212
212
|
var import_invariant14 = require("@dxos/invariant");
|
|
213
213
|
var import_keyring = require("@dxos/keyring");
|
|
214
214
|
var import_keys10 = require("@dxos/keys");
|
|
@@ -218,11 +218,14 @@ var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
|
218
218
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
219
219
|
var import_tracing6 = require("@dxos/tracing");
|
|
220
220
|
var import_util7 = require("@dxos/util");
|
|
221
|
+
var import_automerge = require("@dxos/automerge/automerge");
|
|
222
|
+
var import_debug7 = require("@dxos/debug");
|
|
223
|
+
var import_protocols13 = require("@dxos/protocols");
|
|
221
224
|
var import_invariant15 = require("@dxos/invariant");
|
|
222
225
|
var import_lock_file = require("@dxos/lock-file");
|
|
223
226
|
var import_log14 = require("@dxos/log");
|
|
224
227
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
225
|
-
var
|
|
228
|
+
var import_protocols14 = require("@dxos/protocols");
|
|
226
229
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
227
230
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
228
231
|
var import_util8 = require("@dxos/util");
|
|
@@ -231,14 +234,15 @@ var import_client_protocol5 = require("@dxos/client-protocol");
|
|
|
231
234
|
var import_context11 = require("@dxos/context");
|
|
232
235
|
var import_document_model2 = require("@dxos/document-model");
|
|
233
236
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
234
|
-
var
|
|
237
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
238
|
+
var import_indexing2 = require("@dxos/indexing");
|
|
235
239
|
var import_invariant16 = require("@dxos/invariant");
|
|
236
240
|
var import_keys11 = require("@dxos/keys");
|
|
237
241
|
var import_log15 = require("@dxos/log");
|
|
238
242
|
var import_messaging = require("@dxos/messaging");
|
|
239
243
|
var import_model_factory = require("@dxos/model-factory");
|
|
240
244
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
241
|
-
var
|
|
245
|
+
var import_protocols15 = require("@dxos/protocols");
|
|
242
246
|
var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
243
247
|
var import_text_model = require("@dxos/text-model");
|
|
244
248
|
var import_tracing7 = require("@dxos/tracing");
|
|
@@ -2886,7 +2890,7 @@ var getPlatform = () => {
|
|
|
2886
2890
|
};
|
|
2887
2891
|
}
|
|
2888
2892
|
};
|
|
2889
|
-
var DXOS_VERSION = "0.4.8-main.
|
|
2893
|
+
var DXOS_VERSION = "0.4.8-main.beadd4b";
|
|
2890
2894
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2891
2895
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2892
2896
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
@@ -4427,6 +4431,80 @@ var SpacesServiceImpl = class {
|
|
|
4427
4431
|
}
|
|
4428
4432
|
};
|
|
4429
4433
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
4434
|
+
var createLoadDocuments = (automergeHost) => (
|
|
4435
|
+
/**
|
|
4436
|
+
* Get object data blobs from Automerge Repo by ids.
|
|
4437
|
+
* @param ids
|
|
4438
|
+
*/
|
|
4439
|
+
// TODO(mykola): Unload automerge handles after usage.
|
|
4440
|
+
async function* loadDocuments(ids) {
|
|
4441
|
+
for (const id of ids) {
|
|
4442
|
+
const { documentId, objectId } = import_protocols13.idCodec.decode(id);
|
|
4443
|
+
const handle = automergeHost.repo.find(documentId);
|
|
4444
|
+
await (0, import_debug7.warnAfterTimeout)(5e3, "to long to load doc", () => handle.whenReady());
|
|
4445
|
+
const doc = handle.docSync();
|
|
4446
|
+
const heads = (0, import_automerge.getHeads)(doc);
|
|
4447
|
+
yield [
|
|
4448
|
+
{
|
|
4449
|
+
id,
|
|
4450
|
+
object: doc.objects[objectId],
|
|
4451
|
+
currentHash: heads.at(-1)
|
|
4452
|
+
}
|
|
4453
|
+
];
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
);
|
|
4457
|
+
var createGetAllDocuments = (automergeHost) => (
|
|
4458
|
+
/**
|
|
4459
|
+
* Recursively get all object data blobs from Automerge Repo.
|
|
4460
|
+
* @param ids
|
|
4461
|
+
*/
|
|
4462
|
+
// TODO(mykola): Unload automerge handles after usage.
|
|
4463
|
+
async function* getAllDocuments() {
|
|
4464
|
+
const visited = /* @__PURE__ */ new Set();
|
|
4465
|
+
async function* getObjectsFromHandle(handle) {
|
|
4466
|
+
if (visited.has(handle.documentId)) {
|
|
4467
|
+
return;
|
|
4468
|
+
}
|
|
4469
|
+
await (0, import_debug7.warnAfterTimeout)(5e3, "to long to load doc", () => handle.whenReady());
|
|
4470
|
+
const doc = handle.docSync();
|
|
4471
|
+
const heads = (0, import_automerge.getHeads)(doc);
|
|
4472
|
+
if (doc.objects) {
|
|
4473
|
+
yield Object.entries(doc.objects).map(([objectId, object]) => {
|
|
4474
|
+
return {
|
|
4475
|
+
id: import_protocols13.idCodec.encode({
|
|
4476
|
+
documentId: handle.documentId,
|
|
4477
|
+
objectId
|
|
4478
|
+
}),
|
|
4479
|
+
object,
|
|
4480
|
+
currentHash: heads.at(-1)
|
|
4481
|
+
};
|
|
4482
|
+
});
|
|
4483
|
+
}
|
|
4484
|
+
if (doc.links) {
|
|
4485
|
+
for (const id of Object.values(doc.links)) {
|
|
4486
|
+
if (visited.has(id)) {
|
|
4487
|
+
continue;
|
|
4488
|
+
}
|
|
4489
|
+
const linkHandle = automergeHost.repo.find(id);
|
|
4490
|
+
for await (const result of getObjectsFromHandle(linkHandle)) {
|
|
4491
|
+
yield result;
|
|
4492
|
+
}
|
|
4493
|
+
}
|
|
4494
|
+
}
|
|
4495
|
+
visited.add(handle.documentId);
|
|
4496
|
+
}
|
|
4497
|
+
for (const handle of Object.values(automergeHost.repo.handles)) {
|
|
4498
|
+
if (visited.has(handle.documentId)) {
|
|
4499
|
+
continue;
|
|
4500
|
+
}
|
|
4501
|
+
for await (const result of getObjectsFromHandle(handle)) {
|
|
4502
|
+
yield result;
|
|
4503
|
+
}
|
|
4504
|
+
visited.add(handle.documentId);
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
);
|
|
4430
4508
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
4431
4509
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4432
4510
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -4450,9 +4528,6 @@ var ServiceContext = class {
|
|
|
4450
4528
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
4451
4529
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
4452
4530
|
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
4453
|
-
this.indexMetadata = new import_echo_schema.IndexMetadataStore({
|
|
4454
|
-
directory: storage.createDirectory("index-metadata")
|
|
4455
|
-
});
|
|
4456
4531
|
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
4457
4532
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
4458
4533
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
@@ -4475,10 +4550,21 @@ var ServiceContext = class {
|
|
|
4475
4550
|
snapshotStore: this.snapshotStore
|
|
4476
4551
|
});
|
|
4477
4552
|
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
|
|
4553
|
+
this.indexMetadata = new import_indexing.IndexMetadataStore({
|
|
4554
|
+
directory: storage.createDirectory("index-metadata")
|
|
4555
|
+
});
|
|
4478
4556
|
this.automergeHost = new import_echo_pipeline2.AutomergeHost({
|
|
4479
4557
|
directory: storage.createDirectory("automerge"),
|
|
4480
4558
|
metadata: this.indexMetadata
|
|
4481
4559
|
});
|
|
4560
|
+
this.indexer = new import_indexing.Indexer({
|
|
4561
|
+
indexStore: new import_indexing.IndexStore({
|
|
4562
|
+
directory: storage.createDirectory("index-store")
|
|
4563
|
+
}),
|
|
4564
|
+
metadataStore: this.indexMetadata,
|
|
4565
|
+
loadDocuments: createLoadDocuments(this.automergeHost),
|
|
4566
|
+
getAllDocuments: createGetAllDocuments(this.automergeHost)
|
|
4567
|
+
});
|
|
4482
4568
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
4483
4569
|
this._handlerFactories.set(import_services12.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? (0, import_debug6.failUndefined)(), this._acceptIdentity.bind(this)));
|
|
4484
4570
|
}
|
|
@@ -4486,7 +4572,7 @@ var ServiceContext = class {
|
|
|
4486
4572
|
await this._checkStorageVersion();
|
|
4487
4573
|
(0, import_log13.log)("opening...", void 0, {
|
|
4488
4574
|
F: __dxlog_file15,
|
|
4489
|
-
L:
|
|
4575
|
+
L: 162,
|
|
4490
4576
|
S: this,
|
|
4491
4577
|
C: (f, a) => f(...a)
|
|
4492
4578
|
});
|
|
@@ -4494,7 +4580,7 @@ var ServiceContext = class {
|
|
|
4494
4580
|
id: this._instanceId
|
|
4495
4581
|
}), {
|
|
4496
4582
|
F: __dxlog_file15,
|
|
4497
|
-
L:
|
|
4583
|
+
L: 163,
|
|
4498
4584
|
S: this,
|
|
4499
4585
|
C: (f, a) => f(...a)
|
|
4500
4586
|
});
|
|
@@ -4510,13 +4596,13 @@ var ServiceContext = class {
|
|
|
4510
4596
|
id: this._instanceId
|
|
4511
4597
|
}), {
|
|
4512
4598
|
F: __dxlog_file15,
|
|
4513
|
-
L:
|
|
4599
|
+
L: 173,
|
|
4514
4600
|
S: this,
|
|
4515
4601
|
C: (f, a) => f(...a)
|
|
4516
4602
|
});
|
|
4517
4603
|
(0, import_log13.log)("opened", void 0, {
|
|
4518
4604
|
F: __dxlog_file15,
|
|
4519
|
-
L:
|
|
4605
|
+
L: 174,
|
|
4520
4606
|
S: this,
|
|
4521
4607
|
C: (f, a) => f(...a)
|
|
4522
4608
|
});
|
|
@@ -4524,7 +4610,7 @@ var ServiceContext = class {
|
|
|
4524
4610
|
async close() {
|
|
4525
4611
|
(0, import_log13.log)("closing...", void 0, {
|
|
4526
4612
|
F: __dxlog_file15,
|
|
4527
|
-
L:
|
|
4613
|
+
L: 178,
|
|
4528
4614
|
S: this,
|
|
4529
4615
|
C: (f, a) => f(...a)
|
|
4530
4616
|
});
|
|
@@ -4540,9 +4626,10 @@ var ServiceContext = class {
|
|
|
4540
4626
|
await this.signalManager.close();
|
|
4541
4627
|
this.dataServiceSubscriptions.clear();
|
|
4542
4628
|
await this.metadataStore.close();
|
|
4629
|
+
await this.indexer.destroy();
|
|
4543
4630
|
(0, import_log13.log)("closed", void 0, {
|
|
4544
4631
|
F: __dxlog_file15,
|
|
4545
|
-
L:
|
|
4632
|
+
L: 192,
|
|
4546
4633
|
S: this,
|
|
4547
4634
|
C: (f, a) => f(...a)
|
|
4548
4635
|
});
|
|
@@ -4556,7 +4643,7 @@ var ServiceContext = class {
|
|
|
4556
4643
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4557
4644
|
(0, import_invariant14.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4558
4645
|
F: __dxlog_file15,
|
|
4559
|
-
L:
|
|
4646
|
+
L: 203,
|
|
4560
4647
|
S: this,
|
|
4561
4648
|
A: [
|
|
4562
4649
|
"factory",
|
|
@@ -4588,7 +4675,7 @@ var ServiceContext = class {
|
|
|
4588
4675
|
async _initialize(ctx) {
|
|
4589
4676
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
4590
4677
|
F: __dxlog_file15,
|
|
4591
|
-
L:
|
|
4678
|
+
L: 234,
|
|
4592
4679
|
S: this,
|
|
4593
4680
|
C: (f, a) => f(...a)
|
|
4594
4681
|
});
|
|
@@ -4611,7 +4698,7 @@ var ServiceContext = class {
|
|
|
4611
4698
|
this._handlerFactories.set(import_services12.Invitation.Kind.SPACE, (invitation) => {
|
|
4612
4699
|
(0, import_invariant14.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4613
4700
|
F: __dxlog_file15,
|
|
4614
|
-
L:
|
|
4701
|
+
L: 259,
|
|
4615
4702
|
S: this,
|
|
4616
4703
|
A: [
|
|
4617
4704
|
"this.dataSpaceManager",
|
|
@@ -4635,7 +4722,7 @@ var ServiceContext = class {
|
|
|
4635
4722
|
details: assertion
|
|
4636
4723
|
}, {
|
|
4637
4724
|
F: __dxlog_file15,
|
|
4638
|
-
L:
|
|
4725
|
+
L: 275,
|
|
4639
4726
|
S: this,
|
|
4640
4727
|
C: (f, a) => f(...a)
|
|
4641
4728
|
});
|
|
@@ -4646,7 +4733,7 @@ var ServiceContext = class {
|
|
|
4646
4733
|
details: assertion
|
|
4647
4734
|
}, {
|
|
4648
4735
|
F: __dxlog_file15,
|
|
4649
|
-
L:
|
|
4736
|
+
L: 279,
|
|
4650
4737
|
S: this,
|
|
4651
4738
|
C: (f, a) => f(...a)
|
|
4652
4739
|
});
|
|
@@ -4657,7 +4744,7 @@ var ServiceContext = class {
|
|
|
4657
4744
|
details: assertion
|
|
4658
4745
|
}, {
|
|
4659
4746
|
F: __dxlog_file15,
|
|
4660
|
-
L:
|
|
4747
|
+
L: 284,
|
|
4661
4748
|
S: this,
|
|
4662
4749
|
C: (f, a) => f(...a)
|
|
4663
4750
|
});
|
|
@@ -4668,7 +4755,7 @@ var ServiceContext = class {
|
|
|
4668
4755
|
} catch (err) {
|
|
4669
4756
|
import_log13.log.catch(err, void 0, {
|
|
4670
4757
|
F: __dxlog_file15,
|
|
4671
|
-
L:
|
|
4758
|
+
L: 290,
|
|
4672
4759
|
S: this,
|
|
4673
4760
|
C: (f, a) => f(...a)
|
|
4674
4761
|
});
|
|
@@ -4768,16 +4855,16 @@ var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
|
4768
4855
|
var createStorageObjects = (config) => {
|
|
4769
4856
|
const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
|
|
4770
4857
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4771
|
-
throw new
|
|
4858
|
+
throw new import_protocols14.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4772
4859
|
}
|
|
4773
4860
|
if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
|
|
4774
|
-
throw new
|
|
4861
|
+
throw new import_protocols14.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
4775
4862
|
}
|
|
4776
4863
|
if (persistent && keyStore === StorageDriver.RAM) {
|
|
4777
|
-
throw new
|
|
4864
|
+
throw new import_protocols14.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
4778
4865
|
}
|
|
4779
4866
|
if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
|
|
4780
|
-
throw new
|
|
4867
|
+
throw new import_protocols14.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
4781
4868
|
}
|
|
4782
4869
|
return {
|
|
4783
4870
|
storage: (0, import_random_access_storage.createStorage)({
|
|
@@ -5182,7 +5269,7 @@ var ClientServicesHost = class {
|
|
|
5182
5269
|
initialize({ config, ...options }) {
|
|
5183
5270
|
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
5184
5271
|
F: __dxlog_file18,
|
|
5185
|
-
L:
|
|
5272
|
+
L: 191,
|
|
5186
5273
|
S: this,
|
|
5187
5274
|
A: [
|
|
5188
5275
|
"!this._open",
|
|
@@ -5191,14 +5278,14 @@ var ClientServicesHost = class {
|
|
|
5191
5278
|
});
|
|
5192
5279
|
(0, import_log15.log)("initializing...", void 0, {
|
|
5193
5280
|
F: __dxlog_file18,
|
|
5194
|
-
L:
|
|
5281
|
+
L: 192,
|
|
5195
5282
|
S: this,
|
|
5196
5283
|
C: (f, a) => f(...a)
|
|
5197
5284
|
});
|
|
5198
5285
|
if (config) {
|
|
5199
5286
|
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
5200
5287
|
F: __dxlog_file18,
|
|
5201
|
-
L:
|
|
5288
|
+
L: 195,
|
|
5202
5289
|
S: this,
|
|
5203
5290
|
A: [
|
|
5204
5291
|
"!this._config",
|
|
@@ -5216,7 +5303,7 @@ var ClientServicesHost = class {
|
|
|
5216
5303
|
this._signalManager = signalManager;
|
|
5217
5304
|
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
5218
5305
|
F: __dxlog_file18,
|
|
5219
|
-
L:
|
|
5306
|
+
L: 211,
|
|
5220
5307
|
S: this,
|
|
5221
5308
|
A: [
|
|
5222
5309
|
"!this._networkManager",
|
|
@@ -5230,7 +5317,7 @@ var ClientServicesHost = class {
|
|
|
5230
5317
|
});
|
|
5231
5318
|
(0, import_log15.log)("initialized", void 0, {
|
|
5232
5319
|
F: __dxlog_file18,
|
|
5233
|
-
L:
|
|
5320
|
+
L: 218,
|
|
5234
5321
|
S: this,
|
|
5235
5322
|
C: (f, a) => f(...a)
|
|
5236
5323
|
});
|
|
@@ -5240,17 +5327,17 @@ var ClientServicesHost = class {
|
|
|
5240
5327
|
return;
|
|
5241
5328
|
}
|
|
5242
5329
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
5243
|
-
import_log15.log.trace("dxos.client-services.host.open",
|
|
5330
|
+
import_log15.log.trace("dxos.client-services.host.open", import_protocols15.trace.begin({
|
|
5244
5331
|
id: traceId
|
|
5245
5332
|
}), {
|
|
5246
5333
|
F: __dxlog_file18,
|
|
5247
|
-
L:
|
|
5334
|
+
L: 229,
|
|
5248
5335
|
S: this,
|
|
5249
5336
|
C: (f, a) => f(...a)
|
|
5250
5337
|
});
|
|
5251
5338
|
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
5252
5339
|
F: __dxlog_file18,
|
|
5253
|
-
L:
|
|
5340
|
+
L: 231,
|
|
5254
5341
|
S: this,
|
|
5255
5342
|
A: [
|
|
5256
5343
|
"this._config",
|
|
@@ -5259,7 +5346,7 @@ var ClientServicesHost = class {
|
|
|
5259
5346
|
});
|
|
5260
5347
|
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
5261
5348
|
F: __dxlog_file18,
|
|
5262
|
-
L:
|
|
5349
|
+
L: 232,
|
|
5263
5350
|
S: this,
|
|
5264
5351
|
A: [
|
|
5265
5352
|
"this._storage",
|
|
@@ -5268,7 +5355,7 @@ var ClientServicesHost = class {
|
|
|
5268
5355
|
});
|
|
5269
5356
|
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
5270
5357
|
F: __dxlog_file18,
|
|
5271
|
-
L:
|
|
5358
|
+
L: 233,
|
|
5272
5359
|
S: this,
|
|
5273
5360
|
A: [
|
|
5274
5361
|
"this._signalManager",
|
|
@@ -5277,7 +5364,7 @@ var ClientServicesHost = class {
|
|
|
5277
5364
|
});
|
|
5278
5365
|
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
5279
5366
|
F: __dxlog_file18,
|
|
5280
|
-
L:
|
|
5367
|
+
L: 234,
|
|
5281
5368
|
S: this,
|
|
5282
5369
|
A: [
|
|
5283
5370
|
"this._networkManager",
|
|
@@ -5289,7 +5376,7 @@ var ClientServicesHost = class {
|
|
|
5289
5376
|
lockKey: this._resourceLock?.lockKey
|
|
5290
5377
|
}, {
|
|
5291
5378
|
F: __dxlog_file18,
|
|
5292
|
-
L:
|
|
5379
|
+
L: 237,
|
|
5293
5380
|
S: this,
|
|
5294
5381
|
C: (f, a) => f(...a)
|
|
5295
5382
|
});
|
|
@@ -5306,6 +5393,10 @@ var ClientServicesHost = class {
|
|
|
5306
5393
|
return this._serviceContext.dataSpaceManager;
|
|
5307
5394
|
}),
|
|
5308
5395
|
DataService: new import_echo_pipeline3.DataServiceImpl(this._serviceContext.dataServiceSubscriptions, this._serviceContext.automergeHost),
|
|
5396
|
+
IndexService: new import_indexing2.IndexServiceImpl({
|
|
5397
|
+
indexer: this._serviceContext.indexer,
|
|
5398
|
+
automergeHost: this._serviceContext.automergeHost
|
|
5399
|
+
}),
|
|
5309
5400
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
5310
5401
|
LoggingService: this._loggingService,
|
|
5311
5402
|
TracingService: this._tracingService,
|
|
@@ -5319,7 +5410,7 @@ var ClientServicesHost = class {
|
|
|
5319
5410
|
await this._serviceContext.open(ctx);
|
|
5320
5411
|
(0, import_invariant16.invariant)(this.serviceRegistry.services.InvitationsService, void 0, {
|
|
5321
5412
|
F: __dxlog_file18,
|
|
5322
|
-
L:
|
|
5413
|
+
L: 303,
|
|
5323
5414
|
S: this,
|
|
5324
5415
|
A: [
|
|
5325
5416
|
"this.serviceRegistry.services.InvitationsService",
|
|
@@ -5331,7 +5422,7 @@ var ClientServicesHost = class {
|
|
|
5331
5422
|
count: loadedInvitations.invitations?.length
|
|
5332
5423
|
}, {
|
|
5333
5424
|
F: __dxlog_file18,
|
|
5334
|
-
L:
|
|
5425
|
+
L: 306,
|
|
5335
5426
|
S: this,
|
|
5336
5427
|
C: (f, a) => f(...a)
|
|
5337
5428
|
});
|
|
@@ -5353,15 +5444,15 @@ var ClientServicesHost = class {
|
|
|
5353
5444
|
deviceKey
|
|
5354
5445
|
}, {
|
|
5355
5446
|
F: __dxlog_file18,
|
|
5356
|
-
L:
|
|
5447
|
+
L: 323,
|
|
5357
5448
|
S: this,
|
|
5358
5449
|
C: (f, a) => f(...a)
|
|
5359
5450
|
});
|
|
5360
|
-
import_log15.log.trace("dxos.client-services.host.open",
|
|
5451
|
+
import_log15.log.trace("dxos.client-services.host.open", import_protocols15.trace.end({
|
|
5361
5452
|
id: traceId
|
|
5362
5453
|
}), {
|
|
5363
5454
|
F: __dxlog_file18,
|
|
5364
|
-
L:
|
|
5455
|
+
L: 324,
|
|
5365
5456
|
S: this,
|
|
5366
5457
|
C: (f, a) => f(...a)
|
|
5367
5458
|
});
|
|
@@ -5375,7 +5466,7 @@ var ClientServicesHost = class {
|
|
|
5375
5466
|
deviceKey
|
|
5376
5467
|
}, {
|
|
5377
5468
|
F: __dxlog_file18,
|
|
5378
|
-
L:
|
|
5469
|
+
L: 335,
|
|
5379
5470
|
S: this,
|
|
5380
5471
|
C: (f, a) => f(...a)
|
|
5381
5472
|
});
|
|
@@ -5391,24 +5482,24 @@ var ClientServicesHost = class {
|
|
|
5391
5482
|
deviceKey
|
|
5392
5483
|
}, {
|
|
5393
5484
|
F: __dxlog_file18,
|
|
5394
|
-
L:
|
|
5485
|
+
L: 342,
|
|
5395
5486
|
S: this,
|
|
5396
5487
|
C: (f, a) => f(...a)
|
|
5397
5488
|
});
|
|
5398
5489
|
}
|
|
5399
5490
|
async reset() {
|
|
5400
5491
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
5401
|
-
import_log15.log.trace("dxos.sdk.client-services-host.reset",
|
|
5492
|
+
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols15.trace.begin({
|
|
5402
5493
|
id: traceId
|
|
5403
5494
|
}), {
|
|
5404
5495
|
F: __dxlog_file18,
|
|
5405
|
-
L:
|
|
5496
|
+
L: 347,
|
|
5406
5497
|
S: this,
|
|
5407
5498
|
C: (f, a) => f(...a)
|
|
5408
5499
|
});
|
|
5409
5500
|
(0, import_log15.log)("resetting...", void 0, {
|
|
5410
5501
|
F: __dxlog_file18,
|
|
5411
|
-
L:
|
|
5502
|
+
L: 349,
|
|
5412
5503
|
S: this,
|
|
5413
5504
|
C: (f, a) => f(...a)
|
|
5414
5505
|
});
|
|
@@ -5416,15 +5507,15 @@ var ClientServicesHost = class {
|
|
|
5416
5507
|
await this._storage.reset();
|
|
5417
5508
|
(0, import_log15.log)("reset", void 0, {
|
|
5418
5509
|
F: __dxlog_file18,
|
|
5419
|
-
L:
|
|
5510
|
+
L: 352,
|
|
5420
5511
|
S: this,
|
|
5421
5512
|
C: (f, a) => f(...a)
|
|
5422
5513
|
});
|
|
5423
|
-
import_log15.log.trace("dxos.sdk.client-services-host.reset",
|
|
5514
|
+
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols15.trace.end({
|
|
5424
5515
|
id: traceId
|
|
5425
5516
|
}), {
|
|
5426
5517
|
F: __dxlog_file18,
|
|
5427
|
-
L:
|
|
5518
|
+
L: 353,
|
|
5428
5519
|
S: this,
|
|
5429
5520
|
C: (f, a) => f(...a)
|
|
5430
5521
|
});
|
|
@@ -5439,7 +5530,7 @@ var ClientServicesHost = class {
|
|
|
5439
5530
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5440
5531
|
(0, import_invariant16.invariant)(automergeIndex, void 0, {
|
|
5441
5532
|
F: __dxlog_file18,
|
|
5442
|
-
L:
|
|
5533
|
+
L: 368,
|
|
5443
5534
|
S: this,
|
|
5444
5535
|
A: [
|
|
5445
5536
|
"automergeIndex",
|
|
@@ -5451,8 +5542,8 @@ var ClientServicesHost = class {
|
|
|
5451
5542
|
document.change((doc) => {
|
|
5452
5543
|
(0, import_util9.assignDeep)(doc, [
|
|
5453
5544
|
"objects",
|
|
5454
|
-
(0,
|
|
5455
|
-
], (0,
|
|
5545
|
+
(0, import_echo_schema.getAutomergeObjectCore)(obj).id
|
|
5546
|
+
], (0, import_echo_schema.getRawDoc)(obj).handle.docSync());
|
|
5456
5547
|
});
|
|
5457
5548
|
return identity;
|
|
5458
5549
|
}
|
|
@@ -5509,4 +5600,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5509
5600
|
subscribeToSpaces,
|
|
5510
5601
|
subscribeToSwarmInfo
|
|
5511
5602
|
});
|
|
5512
|
-
//# sourceMappingURL=chunk-
|
|
5603
|
+
//# sourceMappingURL=chunk-IR2Q2Y2D.cjs.map
|