@dxos/echo-pipeline 0.3.11-main.e19f39d → 0.3.11-main.e28df4f
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-PB5T4DLC.mjs → chunk-D7UMNYLJ.mjs} +115 -62
- package/dist/lib/browser/{chunk-PB5T4DLC.mjs.map → chunk-D7UMNYLJ.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +4 -4
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node/{chunk-WGNVVL2H.cjs → chunk-GQW6RLGD.cjs} +113 -60
- package/dist/lib/node/chunk-GQW6RLGD.cjs.map +7 -0
- package/dist/lib/node/index.cjs +26 -26
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +19 -19
- package/dist/lib/node/testing/index.cjs.map +2 -2
- package/dist/types/src/automerge/automerge-host.d.ts +2 -0
- package/dist/types/src/automerge/automerge-host.d.ts.map +1 -1
- package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
- package/dist/types/src/space/space-protocol.d.ts.map +1 -1
- package/dist/types/src/space/space.d.ts +1 -1
- package/dist/types/src/space/space.d.ts.map +1 -1
- package/dist/types/src/testing/database-test-rig.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/automerge/automerge-host.ts +21 -4
- package/src/pipeline/pipeline-stress.test.ts +9 -2
- package/src/space/data-pipeline.ts +4 -3
- package/src/space/space-protocol.ts +4 -0
- package/src/space/space.ts +8 -3
- package/src/testing/database-test-rig.ts +4 -1
- package/dist/lib/node/chunk-WGNVVL2H.cjs.map +0 -7
|
@@ -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_GQW6RLGD_exports = {};
|
|
30
|
+
__export(chunk_GQW6RLGD_exports, {
|
|
31
31
|
AuthExtension: () => AuthExtension,
|
|
32
32
|
AuthStatus: () => AuthStatus,
|
|
33
33
|
AutomergeHost: () => AutomergeHost,
|
|
@@ -54,7 +54,7 @@ __export(chunk_WGNVVL2H_exports, {
|
|
|
54
54
|
startAfter: () => startAfter,
|
|
55
55
|
valueEncoding: () => valueEncoding
|
|
56
56
|
});
|
|
57
|
-
module.exports = __toCommonJS(
|
|
57
|
+
module.exports = __toCommonJS(chunk_GQW6RLGD_exports);
|
|
58
58
|
var import_hypercore = require("@dxos/hypercore");
|
|
59
59
|
var import_protocols = require("@dxos/protocols");
|
|
60
60
|
var import_invariant = require("@dxos/invariant");
|
|
@@ -140,6 +140,7 @@ var import_network_manager = require("@dxos/network-manager");
|
|
|
140
140
|
var import_teleport2 = require("@dxos/teleport");
|
|
141
141
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
142
142
|
var import_teleport_extension_replicator = require("@dxos/teleport-extension-replicator");
|
|
143
|
+
var import_tracing4 = require("@dxos/tracing");
|
|
143
144
|
var import_util8 = require("@dxos/util");
|
|
144
145
|
var import_async9 = require("@dxos/async");
|
|
145
146
|
var import_debug4 = require("@dxos/debug");
|
|
@@ -148,6 +149,7 @@ var import_log12 = require("@dxos/log");
|
|
|
148
149
|
var import_protocols7 = require("@dxos/protocols");
|
|
149
150
|
var import_util9 = require("@dxos/util");
|
|
150
151
|
var import_async10 = require("@dxos/async");
|
|
152
|
+
var import_automerge = require("@dxos/automerge/automerge");
|
|
151
153
|
var import_automerge_repo = require("@dxos/automerge/automerge-repo");
|
|
152
154
|
var import_automerge_repo_storage_indexeddb = require("@dxos/automerge/automerge-repo-storage-indexeddb");
|
|
153
155
|
var import_codec_protobuf2 = require("@dxos/codec-protobuf");
|
|
@@ -156,6 +158,7 @@ var import_keys8 = require("@dxos/keys");
|
|
|
156
158
|
var import_log13 = require("@dxos/log");
|
|
157
159
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
158
160
|
var import_teleport_extension_automerge_replicator = require("@dxos/teleport-extension-automerge-replicator");
|
|
161
|
+
var import_tracing5 = require("@dxos/tracing");
|
|
159
162
|
var import_util10 = require("@dxos/util");
|
|
160
163
|
var codec = import_protocols.schema.getCodecForType("dxos.echo.feed.FeedMessage");
|
|
161
164
|
var valueEncoding = (0, import_hypercore.createCodecEncoding)(codec);
|
|
@@ -1659,22 +1662,23 @@ var DataPipeline = class {
|
|
|
1659
1662
|
this._epochCtx = void 0;
|
|
1660
1663
|
}
|
|
1661
1664
|
async _consumePipeline() {
|
|
1665
|
+
const pipeline = this._pipeline;
|
|
1662
1666
|
if (this.currentEpoch) {
|
|
1663
1667
|
const waitForOneEpoch = this.onNewEpoch.waitForCount(1);
|
|
1664
1668
|
await this._processEpochInSeparateTask(this.currentEpoch);
|
|
1665
1669
|
await waitForOneEpoch;
|
|
1666
1670
|
}
|
|
1667
1671
|
let messageCounter = 0;
|
|
1668
|
-
(0, import_invariant8.invariant)(
|
|
1672
|
+
(0, import_invariant8.invariant)(pipeline, "Pipeline is not initialized.", {
|
|
1669
1673
|
F: __dxlog_file9,
|
|
1670
|
-
L:
|
|
1674
|
+
L: 229,
|
|
1671
1675
|
S: this,
|
|
1672
1676
|
A: [
|
|
1673
|
-
"
|
|
1677
|
+
"pipeline",
|
|
1674
1678
|
"'Pipeline is not initialized.'"
|
|
1675
1679
|
]
|
|
1676
1680
|
});
|
|
1677
|
-
for await (const msg of
|
|
1681
|
+
for await (const msg of pipeline.consume()) {
|
|
1678
1682
|
const span = this._usage.beginRecording();
|
|
1679
1683
|
this._mutations.inc();
|
|
1680
1684
|
const { feedKey, seq, data } = msg;
|
|
@@ -1683,7 +1687,7 @@ var DataPipeline = class {
|
|
|
1683
1687
|
seq
|
|
1684
1688
|
}, {
|
|
1685
1689
|
F: __dxlog_file9,
|
|
1686
|
-
L:
|
|
1690
|
+
L: 235,
|
|
1687
1691
|
S: this,
|
|
1688
1692
|
C: (f, a) => f(...a)
|
|
1689
1693
|
});
|
|
@@ -1695,7 +1699,7 @@ var DataPipeline = class {
|
|
|
1695
1699
|
feedKey
|
|
1696
1700
|
}, {
|
|
1697
1701
|
F: __dxlog_file9,
|
|
1698
|
-
L:
|
|
1702
|
+
L: 241,
|
|
1699
1703
|
S: this,
|
|
1700
1704
|
C: (f, a) => f(...a)
|
|
1701
1705
|
});
|
|
@@ -1718,16 +1722,16 @@ var DataPipeline = class {
|
|
|
1718
1722
|
spaceKey: this._params.spaceKey.toHex()
|
|
1719
1723
|
}, {
|
|
1720
1724
|
F: __dxlog_file9,
|
|
1721
|
-
L:
|
|
1725
|
+
L: 258,
|
|
1722
1726
|
S: this,
|
|
1723
1727
|
C: (f, a) => f(...a)
|
|
1724
1728
|
});
|
|
1725
|
-
await this._noteTargetStateIfNeeded(
|
|
1729
|
+
await this._noteTargetStateIfNeeded(pipeline.state.pendingTimeframe);
|
|
1726
1730
|
}
|
|
1727
1731
|
} catch (err) {
|
|
1728
1732
|
import_log8.log.catch(err, void 0, {
|
|
1729
1733
|
F: __dxlog_file9,
|
|
1730
|
-
L:
|
|
1734
|
+
L: 268,
|
|
1731
1735
|
S: this,
|
|
1732
1736
|
C: (f, a) => f(...a)
|
|
1733
1737
|
});
|
|
@@ -1742,7 +1746,7 @@ var DataPipeline = class {
|
|
|
1742
1746
|
_createSnapshot() {
|
|
1743
1747
|
(0, import_invariant8.invariant)(this.databaseHost, "Database backend is not initialized.", {
|
|
1744
1748
|
F: __dxlog_file9,
|
|
1745
|
-
L:
|
|
1749
|
+
L: 282,
|
|
1746
1750
|
S: this,
|
|
1747
1751
|
A: [
|
|
1748
1752
|
"this.databaseHost",
|
|
@@ -1771,7 +1775,7 @@ var DataPipeline = class {
|
|
|
1771
1775
|
} catch (err) {
|
|
1772
1776
|
import_log8.log.warn("Failed to cache properties", err, {
|
|
1773
1777
|
F: __dxlog_file9,
|
|
1774
|
-
L:
|
|
1778
|
+
L: 311,
|
|
1775
1779
|
S: this,
|
|
1776
1780
|
C: (f, a) => f(...a)
|
|
1777
1781
|
});
|
|
@@ -1800,14 +1804,14 @@ var DataPipeline = class {
|
|
|
1800
1804
|
if (err instanceof import_protocols6.CancelledError) {
|
|
1801
1805
|
(0, import_log8.log)("Epoch processing cancelled.", void 0, {
|
|
1802
1806
|
F: __dxlog_file9,
|
|
1803
|
-
L:
|
|
1807
|
+
L: 347,
|
|
1804
1808
|
S: this,
|
|
1805
1809
|
C: (f, a) => f(...a)
|
|
1806
1810
|
});
|
|
1807
1811
|
} else {
|
|
1808
1812
|
import_log8.log.catch(err, void 0, {
|
|
1809
1813
|
F: __dxlog_file9,
|
|
1810
|
-
L:
|
|
1814
|
+
L: 349,
|
|
1811
1815
|
S: this,
|
|
1812
1816
|
C: (f, a) => f(...a)
|
|
1813
1817
|
});
|
|
@@ -1830,7 +1834,7 @@ var DataPipeline = class {
|
|
|
1830
1834
|
async _processEpoch(ctx, epoch) {
|
|
1831
1835
|
(0, import_invariant8.invariant)(this._isOpen, "Space is closed.", {
|
|
1832
1836
|
F: __dxlog_file9,
|
|
1833
|
-
L:
|
|
1837
|
+
L: 373,
|
|
1834
1838
|
S: this,
|
|
1835
1839
|
A: [
|
|
1836
1840
|
"this._isOpen",
|
|
@@ -1839,7 +1843,7 @@ var DataPipeline = class {
|
|
|
1839
1843
|
});
|
|
1840
1844
|
(0, import_invariant8.invariant)(this._pipeline, void 0, {
|
|
1841
1845
|
F: __dxlog_file9,
|
|
1842
|
-
L:
|
|
1846
|
+
L: 374,
|
|
1843
1847
|
S: this,
|
|
1844
1848
|
A: [
|
|
1845
1849
|
"this._pipeline",
|
|
@@ -1851,7 +1855,7 @@ var DataPipeline = class {
|
|
|
1851
1855
|
epoch: (0, import_log8.omit)(epoch, "proof")
|
|
1852
1856
|
}, {
|
|
1853
1857
|
F: __dxlog_file9,
|
|
1854
|
-
L:
|
|
1858
|
+
L: 377,
|
|
1855
1859
|
S: this,
|
|
1856
1860
|
C: (f, a) => f(...a)
|
|
1857
1861
|
});
|
|
@@ -1861,7 +1865,7 @@ var DataPipeline = class {
|
|
|
1861
1865
|
}
|
|
1862
1866
|
(0, import_log8.log)("restarting pipeline from epoch", void 0, {
|
|
1863
1867
|
F: __dxlog_file9,
|
|
1864
|
-
L:
|
|
1868
|
+
L: 383,
|
|
1865
1869
|
S: this,
|
|
1866
1870
|
C: (f, a) => f(...a)
|
|
1867
1871
|
});
|
|
@@ -1872,7 +1876,7 @@ var DataPipeline = class {
|
|
|
1872
1876
|
async waitUntilTimeframe(timeframe) {
|
|
1873
1877
|
(0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
|
|
1874
1878
|
F: __dxlog_file9,
|
|
1875
|
-
L:
|
|
1879
|
+
L: 390,
|
|
1876
1880
|
S: this,
|
|
1877
1881
|
A: [
|
|
1878
1882
|
"this._pipeline",
|
|
@@ -1884,7 +1888,7 @@ var DataPipeline = class {
|
|
|
1884
1888
|
async createEpoch() {
|
|
1885
1889
|
(0, import_invariant8.invariant)(this._pipeline, void 0, {
|
|
1886
1890
|
F: __dxlog_file9,
|
|
1887
|
-
L:
|
|
1891
|
+
L: 396,
|
|
1888
1892
|
S: this,
|
|
1889
1893
|
A: [
|
|
1890
1894
|
"this._pipeline",
|
|
@@ -1893,7 +1897,7 @@ var DataPipeline = class {
|
|
|
1893
1897
|
});
|
|
1894
1898
|
(0, import_invariant8.invariant)(this.currentEpoch, void 0, {
|
|
1895
1899
|
F: __dxlog_file9,
|
|
1896
|
-
L:
|
|
1900
|
+
L: 397,
|
|
1897
1901
|
S: this,
|
|
1898
1902
|
A: [
|
|
1899
1903
|
"this.currentEpoch",
|
|
@@ -1924,7 +1928,7 @@ var DataPipeline = class {
|
|
|
1924
1928
|
} catch (err) {
|
|
1925
1929
|
import_log8.log.catch(err, void 0, {
|
|
1926
1930
|
F: __dxlog_file9,
|
|
1927
|
-
L:
|
|
1931
|
+
L: 427,
|
|
1928
1932
|
S: this,
|
|
1929
1933
|
C: (f, a) => f(...a)
|
|
1930
1934
|
});
|
|
@@ -2239,13 +2243,13 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
2239
2243
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
|
|
2240
2244
|
var Space = class {
|
|
2241
2245
|
constructor(params) {
|
|
2242
|
-
this.
|
|
2246
|
+
this._addFeedMutex = new import_async7.Mutex();
|
|
2243
2247
|
this.onCredentialProcessed = new import_util6.Callback();
|
|
2244
2248
|
this.stateUpdate = new import_async7.Event();
|
|
2245
2249
|
this._isOpen = false;
|
|
2246
2250
|
(0, import_invariant9.invariant)(params.spaceKey && params.feedProvider, void 0, {
|
|
2247
2251
|
F: __dxlog_file11,
|
|
2248
|
-
L:
|
|
2252
|
+
L: 78,
|
|
2249
2253
|
S: this,
|
|
2250
2254
|
A: [
|
|
2251
2255
|
"params.spaceKey && params.feedProvider",
|
|
@@ -2289,7 +2293,7 @@ var Space = class {
|
|
|
2289
2293
|
credential
|
|
2290
2294
|
}, {
|
|
2291
2295
|
F: __dxlog_file11,
|
|
2292
|
-
L:
|
|
2296
|
+
L: 116,
|
|
2293
2297
|
S: this,
|
|
2294
2298
|
C: (f, a) => f(...a)
|
|
2295
2299
|
});
|
|
@@ -2309,7 +2313,7 @@ var Space = class {
|
|
|
2309
2313
|
if (this._dataFeed) {
|
|
2310
2314
|
pipeline.setWriteFeed(this._dataFeed);
|
|
2311
2315
|
}
|
|
2312
|
-
await this.
|
|
2316
|
+
await this._addFeedMutex.executeSynchronized(async () => {
|
|
2313
2317
|
for (const feed of this._controlPipeline.spaceState.feeds.values()) {
|
|
2314
2318
|
if (feed.assertion.designation === import_credentials2.AdmittedFeed.Designation.DATA && !pipeline.hasFeed(feed.key)) {
|
|
2315
2319
|
await pipeline.addFeed(await this._feedProvider(feed.key, {
|
|
@@ -2354,7 +2358,7 @@ var Space = class {
|
|
|
2354
2358
|
setControlFeed(feed) {
|
|
2355
2359
|
(0, import_invariant9.invariant)(!this._controlFeed, "Control feed already set.", {
|
|
2356
2360
|
F: __dxlog_file11,
|
|
2357
|
-
L:
|
|
2361
|
+
L: 191,
|
|
2358
2362
|
S: this,
|
|
2359
2363
|
A: [
|
|
2360
2364
|
"!this._controlFeed",
|
|
@@ -2368,7 +2372,7 @@ var Space = class {
|
|
|
2368
2372
|
setDataFeed(feed) {
|
|
2369
2373
|
(0, import_invariant9.invariant)(!this._dataFeed, "Data feed already set.", {
|
|
2370
2374
|
F: __dxlog_file11,
|
|
2371
|
-
L:
|
|
2375
|
+
L: 198,
|
|
2372
2376
|
S: this,
|
|
2373
2377
|
A: [
|
|
2374
2378
|
"!this._dataFeed",
|
|
@@ -2394,7 +2398,7 @@ var Space = class {
|
|
|
2394
2398
|
async open(ctx) {
|
|
2395
2399
|
(0, import_log9.log)("opening...", void 0, {
|
|
2396
2400
|
F: __dxlog_file11,
|
|
2397
|
-
L:
|
|
2401
|
+
L: 220,
|
|
2398
2402
|
S: this,
|
|
2399
2403
|
C: (f, a) => f(...a)
|
|
2400
2404
|
});
|
|
@@ -2407,7 +2411,7 @@ var Space = class {
|
|
|
2407
2411
|
this._isOpen = true;
|
|
2408
2412
|
(0, import_log9.log)("opened", void 0, {
|
|
2409
2413
|
F: __dxlog_file11,
|
|
2410
|
-
L:
|
|
2414
|
+
L: 231,
|
|
2411
2415
|
S: this,
|
|
2412
2416
|
C: (f, a) => f(...a)
|
|
2413
2417
|
});
|
|
@@ -2417,7 +2421,7 @@ var Space = class {
|
|
|
2417
2421
|
key: this._key
|
|
2418
2422
|
}, {
|
|
2419
2423
|
F: __dxlog_file11,
|
|
2420
|
-
L:
|
|
2424
|
+
L: 236,
|
|
2421
2425
|
S: this,
|
|
2422
2426
|
C: (f, a) => f(...a)
|
|
2423
2427
|
});
|
|
@@ -2431,7 +2435,7 @@ var Space = class {
|
|
|
2431
2435
|
this._isOpen = false;
|
|
2432
2436
|
(0, import_log9.log)("closed", void 0, {
|
|
2433
2437
|
F: __dxlog_file11,
|
|
2434
|
-
L:
|
|
2438
|
+
L: 249,
|
|
2435
2439
|
S: this,
|
|
2436
2440
|
C: (f, a) => f(...a)
|
|
2437
2441
|
});
|
|
@@ -2439,13 +2443,13 @@ var Space = class {
|
|
|
2439
2443
|
async initializeDataPipeline() {
|
|
2440
2444
|
(0, import_log9.log)("initializeDataPipeline", void 0, {
|
|
2441
2445
|
F: __dxlog_file11,
|
|
2442
|
-
L:
|
|
2446
|
+
L: 254,
|
|
2443
2447
|
S: this,
|
|
2444
2448
|
C: (f, a) => f(...a)
|
|
2445
2449
|
});
|
|
2446
2450
|
(0, import_invariant9.invariant)(this._isOpen, "Space must be open to initialize data pipeline.", {
|
|
2447
2451
|
F: __dxlog_file11,
|
|
2448
|
-
L:
|
|
2452
|
+
L: 255,
|
|
2449
2453
|
S: this,
|
|
2450
2454
|
A: [
|
|
2451
2455
|
"this._isOpen",
|
|
@@ -2455,6 +2459,15 @@ var Space = class {
|
|
|
2455
2459
|
await this._dataPipeline.open();
|
|
2456
2460
|
}
|
|
2457
2461
|
};
|
|
2462
|
+
_ts_decorate6([
|
|
2463
|
+
import_tracing2.trace.info()
|
|
2464
|
+
], Space.prototype, "protocol", void 0);
|
|
2465
|
+
_ts_decorate6([
|
|
2466
|
+
import_tracing2.trace.info()
|
|
2467
|
+
], Space.prototype, "_controlPipeline", void 0);
|
|
2468
|
+
_ts_decorate6([
|
|
2469
|
+
import_tracing2.trace.info()
|
|
2470
|
+
], Space.prototype, "_dataPipeline", void 0);
|
|
2458
2471
|
_ts_decorate6([
|
|
2459
2472
|
import_log9.logInfo,
|
|
2460
2473
|
import_tracing2.trace.info()
|
|
@@ -2515,7 +2528,7 @@ var SpaceProtocol = class {
|
|
|
2515
2528
|
key: feed.key
|
|
2516
2529
|
}, {
|
|
2517
2530
|
F: __dxlog_file12,
|
|
2518
|
-
L:
|
|
2531
|
+
L: 103,
|
|
2519
2532
|
S: this,
|
|
2520
2533
|
C: (f, a) => f(...a)
|
|
2521
2534
|
});
|
|
@@ -2538,7 +2551,7 @@ var SpaceProtocol = class {
|
|
|
2538
2551
|
await this.blobSync.open();
|
|
2539
2552
|
(0, import_log11.log)("starting...", void 0, {
|
|
2540
2553
|
F: __dxlog_file12,
|
|
2541
|
-
L:
|
|
2554
|
+
L: 129,
|
|
2542
2555
|
S: this,
|
|
2543
2556
|
C: (f, a) => f(...a)
|
|
2544
2557
|
});
|
|
@@ -2552,7 +2565,7 @@ var SpaceProtocol = class {
|
|
|
2552
2565
|
});
|
|
2553
2566
|
(0, import_log11.log)("started", void 0, {
|
|
2554
2567
|
F: __dxlog_file12,
|
|
2555
|
-
L:
|
|
2568
|
+
L: 139,
|
|
2556
2569
|
S: this,
|
|
2557
2570
|
C: (f, a) => f(...a)
|
|
2558
2571
|
});
|
|
@@ -2562,14 +2575,14 @@ var SpaceProtocol = class {
|
|
|
2562
2575
|
if (this._connection) {
|
|
2563
2576
|
(0, import_log11.log)("stopping...", void 0, {
|
|
2564
2577
|
F: __dxlog_file12,
|
|
2565
|
-
L:
|
|
2578
|
+
L: 146,
|
|
2566
2579
|
S: this,
|
|
2567
2580
|
C: (f, a) => f(...a)
|
|
2568
2581
|
});
|
|
2569
2582
|
await this._connection.close();
|
|
2570
2583
|
(0, import_log11.log)("stopped", void 0, {
|
|
2571
2584
|
F: __dxlog_file12,
|
|
2572
|
-
L:
|
|
2585
|
+
L: 148,
|
|
2573
2586
|
S: this,
|
|
2574
2587
|
C: (f, a) => f(...a)
|
|
2575
2588
|
});
|
|
@@ -2593,11 +2606,18 @@ var SpaceProtocol = class {
|
|
|
2593
2606
|
}
|
|
2594
2607
|
};
|
|
2595
2608
|
_ts_decorate7([
|
|
2596
|
-
import_log11.logInfo
|
|
2609
|
+
import_log11.logInfo,
|
|
2610
|
+
import_tracing4.trace.info()
|
|
2597
2611
|
], SpaceProtocol.prototype, "_topic", void 0);
|
|
2612
|
+
_ts_decorate7([
|
|
2613
|
+
import_tracing4.trace.info()
|
|
2614
|
+
], SpaceProtocol.prototype, "_spaceKey", void 0);
|
|
2598
2615
|
_ts_decorate7([
|
|
2599
2616
|
import_log11.logInfo
|
|
2600
2617
|
], SpaceProtocol.prototype, "_ownPeerKey", null);
|
|
2618
|
+
SpaceProtocol = _ts_decorate7([
|
|
2619
|
+
import_tracing4.trace.resource()
|
|
2620
|
+
], SpaceProtocol);
|
|
2601
2621
|
var AuthStatus;
|
|
2602
2622
|
(function(AuthStatus2) {
|
|
2603
2623
|
AuthStatus2["INITIAL"] = "INITIAL";
|
|
@@ -2635,7 +2655,7 @@ var SpaceProtocolSession = class {
|
|
|
2635
2655
|
onAuthSuccess: () => {
|
|
2636
2656
|
(0, import_log11.log)("Peer authenticated", void 0, {
|
|
2637
2657
|
F: __dxlog_file12,
|
|
2638
|
-
L:
|
|
2658
|
+
L: 245,
|
|
2639
2659
|
S: this,
|
|
2640
2660
|
C: (f, a) => f(...a)
|
|
2641
2661
|
});
|
|
@@ -2653,7 +2673,7 @@ var SpaceProtocolSession = class {
|
|
|
2653
2673
|
async close() {
|
|
2654
2674
|
(0, import_log11.log)("close", void 0, {
|
|
2655
2675
|
F: __dxlog_file12,
|
|
2656
|
-
L:
|
|
2676
|
+
L: 261,
|
|
2657
2677
|
S: this,
|
|
2658
2678
|
C: (f, a) => f(...a)
|
|
2659
2679
|
});
|
|
@@ -2761,6 +2781,16 @@ _ts_decorate8([
|
|
|
2761
2781
|
SpaceManager = _ts_decorate8([
|
|
2762
2782
|
(0, import_async9.trackLeaks)("open", "close")
|
|
2763
2783
|
], SpaceManager);
|
|
2784
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
2785
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2786
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2787
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2788
|
+
else
|
|
2789
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2790
|
+
if (d = decorators[i])
|
|
2791
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2792
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2793
|
+
}
|
|
2764
2794
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts";
|
|
2765
2795
|
var AutomergeHost = class {
|
|
2766
2796
|
constructor(storageDirectory) {
|
|
@@ -2791,7 +2821,7 @@ var AutomergeHost = class {
|
|
|
2791
2821
|
documentId
|
|
2792
2822
|
}, {
|
|
2793
2823
|
F: __dxlog_file14,
|
|
2794
|
-
L:
|
|
2824
|
+
L: 68,
|
|
2795
2825
|
S: this,
|
|
2796
2826
|
C: (f, a) => f(...a)
|
|
2797
2827
|
});
|
|
@@ -2799,12 +2829,12 @@ var AutomergeHost = class {
|
|
|
2799
2829
|
}
|
|
2800
2830
|
try {
|
|
2801
2831
|
if (!doc.experimental_spaceKey) {
|
|
2802
|
-
import_log13.log
|
|
2832
|
+
(0, import_log13.log)("space key not found for share policy check", {
|
|
2803
2833
|
peerId,
|
|
2804
2834
|
documentId
|
|
2805
2835
|
}, {
|
|
2806
2836
|
F: __dxlog_file14,
|
|
2807
|
-
L:
|
|
2837
|
+
L: 74,
|
|
2808
2838
|
S: this,
|
|
2809
2839
|
C: (f, a) => f(...a)
|
|
2810
2840
|
});
|
|
@@ -2814,12 +2844,12 @@ var AutomergeHost = class {
|
|
|
2814
2844
|
const authorizedDevices = this._authorizedDevices.get(spaceKey);
|
|
2815
2845
|
const deviceKeyHex = this.repo.peerMetadataByPeerId[peerId]?.dxos_deviceKey;
|
|
2816
2846
|
if (!deviceKeyHex) {
|
|
2817
|
-
import_log13.log
|
|
2847
|
+
(0, import_log13.log)("device key not found for share policy check", {
|
|
2818
2848
|
peerId,
|
|
2819
2849
|
documentId
|
|
2820
2850
|
}, {
|
|
2821
2851
|
F: __dxlog_file14,
|
|
2822
|
-
L:
|
|
2852
|
+
L: 84,
|
|
2823
2853
|
S: this,
|
|
2824
2854
|
C: (f, a) => f(...a)
|
|
2825
2855
|
});
|
|
@@ -2827,7 +2857,7 @@ var AutomergeHost = class {
|
|
|
2827
2857
|
}
|
|
2828
2858
|
const deviceKey = import_keys8.PublicKey.from(deviceKeyHex);
|
|
2829
2859
|
const isAuthorized = authorizedDevices?.has(deviceKey) ?? false;
|
|
2830
|
-
import_log13.log
|
|
2860
|
+
(0, import_log13.log)("share policy check", {
|
|
2831
2861
|
peerId,
|
|
2832
2862
|
documentId,
|
|
2833
2863
|
deviceKey,
|
|
@@ -2835,7 +2865,7 @@ var AutomergeHost = class {
|
|
|
2835
2865
|
isAuthorized
|
|
2836
2866
|
}, {
|
|
2837
2867
|
F: __dxlog_file14,
|
|
2838
|
-
L:
|
|
2868
|
+
L: 90,
|
|
2839
2869
|
S: this,
|
|
2840
2870
|
C: (f, a) => f(...a)
|
|
2841
2871
|
});
|
|
@@ -2843,7 +2873,7 @@ var AutomergeHost = class {
|
|
|
2843
2873
|
} catch (err) {
|
|
2844
2874
|
import_log13.log.catch(err, void 0, {
|
|
2845
2875
|
F: __dxlog_file14,
|
|
2846
|
-
L:
|
|
2876
|
+
L: 93,
|
|
2847
2877
|
S: this,
|
|
2848
2878
|
C: (f, a) => f(...a)
|
|
2849
2879
|
});
|
|
@@ -2857,6 +2887,16 @@ var AutomergeHost = class {
|
|
|
2857
2887
|
get repo() {
|
|
2858
2888
|
return this._repo;
|
|
2859
2889
|
}
|
|
2890
|
+
_automergeDocs() {
|
|
2891
|
+
return (0, import_util10.mapValues)(this._repo.handles, (handle) => ({
|
|
2892
|
+
state: handle.state,
|
|
2893
|
+
hasDoc: !!handle.docSync(),
|
|
2894
|
+
heads: handle.docSync() ? import_automerge.next.getHeads(handle.docSync()) : null
|
|
2895
|
+
}));
|
|
2896
|
+
}
|
|
2897
|
+
_automergePeers() {
|
|
2898
|
+
return this._repo.peers;
|
|
2899
|
+
}
|
|
2860
2900
|
async close() {
|
|
2861
2901
|
this._storage instanceof AutomergeStorageAdapter && await this._storage.close();
|
|
2862
2902
|
await this._clientNetwork.close();
|
|
@@ -2883,6 +2923,19 @@ var AutomergeHost = class {
|
|
|
2883
2923
|
(0, import_util10.defaultMap)(this._authorizedDevices, spaceKey, () => new import_util10.ComplexSet(import_keys8.PublicKey.hash)).add(deviceKey);
|
|
2884
2924
|
}
|
|
2885
2925
|
};
|
|
2926
|
+
_ts_decorate9([
|
|
2927
|
+
import_tracing5.trace.info({
|
|
2928
|
+
depth: null
|
|
2929
|
+
})
|
|
2930
|
+
], AutomergeHost.prototype, "_automergeDocs", null);
|
|
2931
|
+
_ts_decorate9([
|
|
2932
|
+
import_tracing5.trace.info({
|
|
2933
|
+
depth: null
|
|
2934
|
+
})
|
|
2935
|
+
], AutomergeHost.prototype, "_automergePeers", null);
|
|
2936
|
+
AutomergeHost = _ts_decorate9([
|
|
2937
|
+
import_tracing5.trace.resource()
|
|
2938
|
+
], AutomergeHost);
|
|
2886
2939
|
var LocalHostNetworkAdapter = class extends import_automerge_repo.NetworkAdapter {
|
|
2887
2940
|
constructor() {
|
|
2888
2941
|
super(...arguments);
|
|
@@ -2905,7 +2958,7 @@ var LocalHostNetworkAdapter = class extends import_automerge_repo.NetworkAdapter
|
|
|
2905
2958
|
const peer = this._peers.get(message.targetId);
|
|
2906
2959
|
(0, import_invariant10.invariant)(peer, "Peer not found.", {
|
|
2907
2960
|
F: __dxlog_file14,
|
|
2908
|
-
L:
|
|
2961
|
+
L: 187,
|
|
2909
2962
|
S: this,
|
|
2910
2963
|
A: [
|
|
2911
2964
|
"peer",
|
|
@@ -2925,7 +2978,7 @@ var LocalHostNetworkAdapter = class extends import_automerge_repo.NetworkAdapter
|
|
|
2925
2978
|
return new import_codec_protobuf2.Stream(({ next, close }) => {
|
|
2926
2979
|
(0, import_invariant10.invariant)(!this._peers.has(peerId), "Peer already connected.", {
|
|
2927
2980
|
F: __dxlog_file14,
|
|
2928
|
-
L:
|
|
2981
|
+
L: 205,
|
|
2929
2982
|
S: this,
|
|
2930
2983
|
A: [
|
|
2931
2984
|
"!this._peers.has(peerId)",
|
|
@@ -2956,7 +3009,7 @@ var LocalHostNetworkAdapter = class extends import_automerge_repo.NetworkAdapter
|
|
|
2956
3009
|
});
|
|
2957
3010
|
}).catch((err) => import_log13.log.catch(err, void 0, {
|
|
2958
3011
|
F: __dxlog_file14,
|
|
2959
|
-
L:
|
|
3012
|
+
L: 230,
|
|
2960
3013
|
S: this,
|
|
2961
3014
|
C: (f, a) => f(...a)
|
|
2962
3015
|
}));
|
|
@@ -2975,7 +3028,7 @@ var LocalHostNetworkAdapter = class extends import_automerge_repo.NetworkAdapter
|
|
|
2975
3028
|
});
|
|
2976
3029
|
(0, import_invariant10.invariant)(this.peerId, "Peer id not set.", {
|
|
2977
3030
|
F: __dxlog_file14,
|
|
2978
|
-
L:
|
|
3031
|
+
L: 242,
|
|
2979
3032
|
S: this,
|
|
2980
3033
|
A: [
|
|
2981
3034
|
"this.peerId",
|
|
@@ -3011,7 +3064,7 @@ var MeshNetworkAdapter = class extends import_automerge_repo.NetworkAdapter {
|
|
|
3011
3064
|
const extension = this._extensions.get(receiverId);
|
|
3012
3065
|
(0, import_invariant10.invariant)(extension, "Extension not found.", {
|
|
3013
3066
|
F: __dxlog_file14,
|
|
3014
|
-
L:
|
|
3067
|
+
L: 277,
|
|
3015
3068
|
S: this,
|
|
3016
3069
|
A: [
|
|
3017
3070
|
"extension",
|
|
@@ -3022,7 +3075,7 @@ var MeshNetworkAdapter = class extends import_automerge_repo.NetworkAdapter {
|
|
|
3022
3075
|
payload: import_automerge_repo.cbor.encode(message)
|
|
3023
3076
|
}).catch((err) => import_log13.log.catch(err, void 0, {
|
|
3024
3077
|
F: __dxlog_file14,
|
|
3025
|
-
L:
|
|
3078
|
+
L: 278,
|
|
3026
3079
|
S: this,
|
|
3027
3080
|
C: (f, a) => f(...a)
|
|
3028
3081
|
}));
|
|
@@ -3032,7 +3085,7 @@ var MeshNetworkAdapter = class extends import_automerge_repo.NetworkAdapter {
|
|
|
3032
3085
|
createExtension() {
|
|
3033
3086
|
(0, import_invariant10.invariant)(this.peerId, "Peer id not set.", {
|
|
3034
3087
|
F: __dxlog_file14,
|
|
3035
|
-
L:
|
|
3088
|
+
L: 286,
|
|
3036
3089
|
S: this,
|
|
3037
3090
|
A: [
|
|
3038
3091
|
"this.peerId",
|
|
@@ -3176,4 +3229,4 @@ var AutomergeStorageAdapter = class extends import_automerge_repo.StorageAdapter
|
|
|
3176
3229
|
startAfter,
|
|
3177
3230
|
valueEncoding
|
|
3178
3231
|
});
|
|
3179
|
-
//# sourceMappingURL=chunk-
|
|
3232
|
+
//# sourceMappingURL=chunk-GQW6RLGD.cjs.map
|