@dxos/client-services 0.3.2 → 0.3.3-main.1b7ca63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,7 @@ var createMockCredential = async ({ signer, issuer }) => (0, import_credentials.
61
61
  });
62
62
 
63
63
  // packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
64
- var import_async18 = require("@dxos/async");
64
+ var import_async19 = require("@dxos/async");
65
65
  var import_invariant16 = require("@dxos/invariant");
66
66
  var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
67
67
 
@@ -69,8 +69,85 @@ var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
69
69
  var import_codec_protobuf = require("@dxos/codec-protobuf");
70
70
  var import_debug = require("@dxos/debug");
71
71
  var import_rpc = require("@dxos/rpc");
72
+ var import_tracing = require("@dxos/tracing");
73
+ function _ts_decorate(decorators, target, key, desc) {
74
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
75
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
76
+ r = Reflect.decorate(decorators, target, key, desc);
77
+ else
78
+ for (var i = decorators.length - 1; i >= 0; i--)
79
+ if (d = decorators[i])
80
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
81
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
82
+ }
83
+ var ClientRpcServer = class ClientRpcServer2 {
84
+ constructor(params) {
85
+ this._handlerCache = /* @__PURE__ */ new Map();
86
+ this._callMetrics = new import_tracing.MapCounter();
87
+ const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
88
+ this._handleCall = handleCall;
89
+ this._handleStream = handleStream;
90
+ this._serviceRegistry = serviceRegistry;
91
+ this._rpcPeer = new import_rpc.RpcPeer({
92
+ ...rpcOptions,
93
+ callHandler: (method, params2) => {
94
+ const [serviceName, methodName] = (0, import_rpc.parseMethodName)(method);
95
+ const handler = (method2, params3) => this._getServiceHandler(serviceName).call(method2, params3);
96
+ this._callMetrics.inc(`${serviceName}.${methodName} request`);
97
+ if (this._handleCall) {
98
+ return this._handleCall(methodName, params2, handler);
99
+ } else {
100
+ return handler(methodName, params2);
101
+ }
102
+ },
103
+ streamHandler: (method, params2) => {
104
+ const [serviceName, methodName] = (0, import_rpc.parseMethodName)(method);
105
+ const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
106
+ this._callMetrics.inc(`${serviceName}.${methodName} request stream`);
107
+ if (this._handleStream) {
108
+ return import_codec_protobuf.Stream.map(import_codec_protobuf.Stream.unwrapPromise(this._handleStream(methodName, params2, handler)), (data) => {
109
+ this._callMetrics.inc(`${serviceName}.${methodName} response stream`);
110
+ return data;
111
+ });
112
+ } else {
113
+ return handler(methodName, params2);
114
+ }
115
+ }
116
+ });
117
+ }
118
+ get _services() {
119
+ return Object.keys(this._serviceRegistry.services);
120
+ }
121
+ async open() {
122
+ await this._rpcPeer.open();
123
+ }
124
+ async close() {
125
+ await this._rpcPeer.close();
126
+ }
127
+ _getServiceHandler(serviceName) {
128
+ if (!this._handlerCache.has(serviceName)) {
129
+ const [key, descriptor] = Object.entries(this._serviceRegistry.descriptors).find(([key2, descriptor2]) => descriptor2.name === serviceName) ?? (0, import_debug.raise)(new Error(`Service not available: ${serviceName}`));
130
+ const service = this._serviceRegistry.services[key];
131
+ if (!service) {
132
+ throw new Error(`Service not available: ${serviceName}`);
133
+ }
134
+ this._handlerCache.set(serviceName, descriptor.createServer(service));
135
+ }
136
+ return this._handlerCache.get(serviceName);
137
+ }
138
+ };
139
+ _ts_decorate([
140
+ import_tracing.trace.metricsCounter()
141
+ ], ClientRpcServer.prototype, "_callMetrics", void 0);
142
+ _ts_decorate([
143
+ import_tracing.trace.info()
144
+ ], ClientRpcServer.prototype, "_services", null);
145
+ ClientRpcServer = _ts_decorate([
146
+ import_tracing.trace.resource()
147
+ ], ClientRpcServer);
72
148
 
73
149
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
150
+ var import_async = require("@dxos/async");
74
151
  var import_codec_protobuf2 = require("@dxos/codec-protobuf");
75
152
  var import_credentials2 = require("@dxos/credentials");
76
153
  var import_document_model = require("@dxos/document-model");
@@ -109,10 +186,10 @@ var getPlatform = () => {
109
186
  };
110
187
 
111
188
  // packages/sdk/client-services/src/version.ts
112
- var DXOS_VERSION = "0.3.2";
189
+ var DXOS_VERSION = "0.3.3-main.1b7ca63";
113
190
 
114
191
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
115
- var __dxlog_file = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
192
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
116
193
  var DEFAULT_TIMEOUT = 1e3;
117
194
  var createDiagnostics = async (clientServices, serviceContext, config) => {
118
195
  const diagnostics = {
@@ -128,7 +205,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
128
205
  {
129
206
  (0, import_invariant.invariant)(clientServices.LoggingService, "SystemService is not available.", {
130
207
  F: __dxlog_file,
131
- L: 88,
208
+ L: 93,
132
209
  S: void 0,
133
210
  A: [
134
211
  "clientServices.LoggingService",
@@ -161,6 +238,19 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
161
238
  bytes,
162
239
  length
163
240
  }));
241
+ const status = await (0, import_codec_protobuf2.getFirstStreamValue)(clientServices.NetworkService.queryStatus(), {
242
+ timeout: DEFAULT_TIMEOUT
243
+ }).catch(() => void 0);
244
+ diagnostics.networkStatus = status;
245
+ const swarmInfoDone = new import_async.Trigger();
246
+ serviceContext.networkManager.connectionLog?.update.on(async () => {
247
+ const swarms = serviceContext.networkManager.connectionLog?.swarms;
248
+ diagnostics.swarms = swarms;
249
+ await swarmInfoDone.wake();
250
+ });
251
+ await swarmInfoDone.wait({
252
+ timeout: DEFAULT_TIMEOUT
253
+ });
164
254
  }
165
255
  diagnostics.config = config.values;
166
256
  return diagnostics;
@@ -174,7 +264,7 @@ var getProperties = (space) => {
174
264
  } catch (err) {
175
265
  import_log.log.warn(err.message, void 0, {
176
266
  F: __dxlog_file,
177
- L: 145,
267
+ L: 168,
178
268
  S: void 0,
179
269
  C: (f, a) => f(...a)
180
270
  });
@@ -230,7 +320,7 @@ var getSpaceStats = async (space) => {
230
320
  };
231
321
 
232
322
  // packages/sdk/client-services/src/packlets/services/service-context.ts
233
- var import_async11 = require("@dxos/async");
323
+ var import_async12 = require("@dxos/async");
234
324
  var import_context8 = require("@dxos/context");
235
325
  var import_credentials15 = require("@dxos/credentials");
236
326
  var import_debug7 = require("@dxos/debug");
@@ -243,16 +333,16 @@ var import_log13 = require("@dxos/log");
243
333
  var import_protocols10 = require("@dxos/protocols");
244
334
  var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
245
335
  var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
246
- var import_tracing4 = require("@dxos/tracing");
336
+ var import_tracing5 = require("@dxos/tracing");
247
337
  var import_util6 = require("@dxos/util");
248
338
 
249
339
  // packages/sdk/client-services/src/packlets/identity/authenticator.ts
250
- var import_async = require("@dxos/async");
340
+ var import_async2 = require("@dxos/async");
251
341
  var import_context = require("@dxos/context");
252
342
  var import_credentials3 = require("@dxos/credentials");
253
343
  var import_log2 = require("@dxos/log");
254
344
  var import_protocols2 = require("@dxos/protocols");
255
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
345
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
256
346
  var Credential = import_protocols2.schema.getCodecForType("dxos.halo.credentials.Credential");
257
347
  var createAuthProvider = (signer) => async (nonce) => {
258
348
  const credential = await signer.createCredential({
@@ -318,7 +408,7 @@ var TrustedKeySetAuthVerifier = class {
318
408
  });
319
409
  return true;
320
410
  }
321
- const trigger = new import_async.Trigger();
411
+ const trigger = new import_async2.Trigger();
322
412
  this._ctx.onDispose(() => {
323
413
  trigger.wake(false);
324
414
  });
@@ -362,7 +452,7 @@ var TrustedKeySetAuthVerifier = class {
362
452
  };
363
453
 
364
454
  // packages/sdk/client-services/src/packlets/identity/identity.ts
365
- var import_async2 = require("@dxos/async");
455
+ var import_async3 = require("@dxos/async");
366
456
  var import_client_protocol = require("@dxos/client-protocol");
367
457
  var import_credentials4 = require("@dxos/credentials");
368
458
  var import_debug2 = require("@dxos/debug");
@@ -371,9 +461,9 @@ var import_invariant2 = require("@dxos/invariant");
371
461
  var import_keys2 = require("@dxos/keys");
372
462
  var import_log3 = require("@dxos/log");
373
463
  var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
374
- var import_tracing = require("@dxos/tracing");
464
+ var import_tracing2 = require("@dxos/tracing");
375
465
  var import_util = require("@dxos/util");
376
- function _ts_decorate(decorators, target, key, desc) {
466
+ function _ts_decorate2(decorators, target, key, desc) {
377
467
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
378
468
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
379
469
  r = Reflect.decorate(decorators, target, key, desc);
@@ -383,10 +473,10 @@ function _ts_decorate(decorators, target, key, desc) {
383
473
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
384
474
  return c > 3 && r && Object.defineProperty(target, key, r), r;
385
475
  }
386
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity.ts";
476
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
387
477
  var Identity = class Identity2 {
388
478
  constructor({ space, signer, identityKey, deviceKey }) {
389
- this.stateUpdate = new import_async2.Event();
479
+ this.stateUpdate = new import_async3.Event();
390
480
  this.space = space;
391
481
  this._signer = signer;
392
482
  this.identityKey = identityKey;
@@ -532,19 +622,19 @@ var Identity = class Identity2 {
532
622
  })));
533
623
  }
534
624
  };
535
- _ts_decorate([
536
- import_tracing.trace.span()
625
+ _ts_decorate2([
626
+ import_tracing2.trace.span()
537
627
  ], Identity.prototype, "open", null);
538
- _ts_decorate([
539
- import_tracing.trace.span()
628
+ _ts_decorate2([
629
+ import_tracing2.trace.span()
540
630
  ], Identity.prototype, "close", null);
541
- Identity = _ts_decorate([
542
- import_tracing.trace.resource()
631
+ Identity = _ts_decorate2([
632
+ import_tracing2.trace.resource()
543
633
  ], Identity);
544
634
 
545
635
  // packages/sdk/client-services/src/packlets/identity/identity-manager.ts
546
636
  var import_platform2 = __toESM(require("platform"));
547
- var import_async3 = require("@dxos/async");
637
+ var import_async4 = require("@dxos/async");
548
638
  var import_context2 = require("@dxos/context");
549
639
  var import_credentials6 = require("@dxos/credentials");
550
640
  var import_invariant3 = require("@dxos/invariant");
@@ -553,9 +643,9 @@ var import_log4 = require("@dxos/log");
553
643
  var import_protocols3 = require("@dxos/protocols");
554
644
  var import_credentials7 = require("@dxos/protocols/proto/dxos/halo/credentials");
555
645
  var import_timeframe = require("@dxos/timeframe");
556
- var import_tracing2 = require("@dxos/tracing");
646
+ var import_tracing3 = require("@dxos/tracing");
557
647
  var import_util2 = require("@dxos/util");
558
- function _ts_decorate2(decorators, target, key, desc) {
648
+ function _ts_decorate3(decorators, target, key, desc) {
559
649
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
560
650
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
561
651
  r = Reflect.decorate(decorators, target, key, desc);
@@ -565,7 +655,7 @@ function _ts_decorate2(decorators, target, key, desc) {
565
655
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
566
656
  return c > 3 && r && Object.defineProperty(target, key, r), r;
567
657
  }
568
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
658
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
569
659
  var IdentityManager = class IdentityManager2 {
570
660
  // TODO(burdon): IdentityManagerParams.
571
661
  // TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
@@ -574,7 +664,7 @@ var IdentityManager = class IdentityManager2 {
574
664
  this._keyring = _keyring;
575
665
  this._feedStore = _feedStore;
576
666
  this._spaceManager = _spaceManager;
577
- this.stateUpdate = new import_async3.Event();
667
+ this.stateUpdate = new import_async4.Event();
578
668
  }
579
669
  get identity() {
580
670
  return this._identity;
@@ -911,13 +1001,13 @@ var IdentityManager = class IdentityManager2 {
911
1001
  });
912
1002
  }
913
1003
  };
914
- _ts_decorate2([
915
- import_tracing2.trace.span({
1004
+ _ts_decorate3([
1005
+ import_tracing3.trace.span({
916
1006
  showInBrowserTimeline: true
917
1007
  })
918
1008
  ], IdentityManager.prototype, "open", null);
919
- IdentityManager = _ts_decorate2([
920
- import_tracing2.trace.resource()
1009
+ IdentityManager = _ts_decorate3([
1010
+ import_tracing3.trace.resource()
921
1011
  ], IdentityManager);
922
1012
 
923
1013
  // packages/sdk/client-services/src/packlets/identity/identity-service.ts
@@ -925,7 +1015,7 @@ var import_codec_protobuf3 = require("@dxos/codec-protobuf");
925
1015
  var import_credentials8 = require("@dxos/credentials");
926
1016
  var import_debug3 = require("@dxos/debug");
927
1017
  var import_invariant4 = require("@dxos/invariant");
928
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1018
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
929
1019
  var IdentityServiceImpl = class {
930
1020
  constructor(_createIdentity, _identityManager, _keyring) {
931
1021
  this._createIdentity = _createIdentity;
@@ -994,7 +1084,7 @@ var IdentityServiceImpl = class {
994
1084
  // packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
995
1085
  var import_invariant5 = require("@dxos/invariant");
996
1086
  var import_services2 = require("@dxos/protocols/proto/dxos/client/services");
997
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1087
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
998
1088
  var DeviceInvitationProtocol = class {
999
1089
  constructor(_keyring, _getIdentity, _acceptIdentity) {
1000
1090
  this._keyring = _keyring;
@@ -1082,7 +1172,7 @@ var DeviceInvitationProtocol = class {
1082
1172
  };
1083
1173
 
1084
1174
  // packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
1085
- var import_async5 = require("@dxos/async");
1175
+ var import_async6 = require("@dxos/async");
1086
1176
  var import_client_protocol2 = require("@dxos/client-protocol");
1087
1177
  var import_context4 = require("@dxos/context");
1088
1178
  var import_credentials9 = require("@dxos/credentials");
@@ -1095,7 +1185,7 @@ var import_services4 = require("@dxos/protocols/proto/dxos/client/services");
1095
1185
  var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations");
1096
1186
 
1097
1187
  // packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
1098
- var import_async4 = require("@dxos/async");
1188
+ var import_async5 = require("@dxos/async");
1099
1189
  var import_context3 = require("@dxos/context");
1100
1190
  var import_invariant6 = require("@dxos/invariant");
1101
1191
  var import_keys4 = require("@dxos/keys");
@@ -1104,7 +1194,7 @@ var import_protocols4 = require("@dxos/protocols");
1104
1194
  var import_services3 = require("@dxos/protocols/proto/dxos/client/services");
1105
1195
  var import_invitations = require("@dxos/protocols/proto/dxos/halo/invitations");
1106
1196
  var import_teleport = require("@dxos/teleport");
1107
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
1197
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
1108
1198
  var OPTIONS_TIMEOUT = 1e4;
1109
1199
  var MAX_OTP_ATTEMPTS = 3;
1110
1200
  var InvitationHostExtension = class extends import_teleport.RpcExtension {
@@ -1119,12 +1209,12 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1119
1209
  });
1120
1210
  this._callbacks = _callbacks;
1121
1211
  this._ctx = new import_context3.Context();
1122
- this._remoteOptionsTrigger = new import_async4.Trigger();
1212
+ this._remoteOptionsTrigger = new import_async5.Trigger();
1123
1213
  this.invitation = void 0;
1124
1214
  this.guestProfile = void 0;
1125
1215
  this.authenticationPassed = false;
1126
1216
  this.authenticationRetry = 0;
1127
- this.completedTrigger = new import_async4.Trigger();
1217
+ this.completedTrigger = new import_async5.Trigger();
1128
1218
  }
1129
1219
  async getHandlers() {
1130
1220
  return {
@@ -1354,7 +1444,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1354
1444
  });
1355
1445
  this._callbacks = _callbacks;
1356
1446
  this._ctx = new import_context3.Context();
1357
- this._remoteOptionsTrigger = new import_async4.Trigger();
1447
+ this._remoteOptionsTrigger = new import_async5.Trigger();
1358
1448
  }
1359
1449
  async getHandlers() {
1360
1450
  return {
@@ -1435,7 +1525,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1435
1525
  var isAuthenticationRequired = (invitation) => invitation.authMethod !== import_services3.Invitation.AuthMethod.NONE;
1436
1526
 
1437
1527
  // packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
1438
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
1528
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
1439
1529
  var InvitationsHandler = class {
1440
1530
  /**
1441
1531
  * @internal
@@ -1465,7 +1555,7 @@ var InvitationsHandler = class {
1465
1555
  timeout,
1466
1556
  ...protocol.getInvitationContext()
1467
1557
  };
1468
- const stream = new import_async5.PushStream();
1558
+ const stream = new import_async6.PushStream();
1469
1559
  const ctx = new import_context4.Context({
1470
1560
  onError: (err) => {
1471
1561
  void ctx.dispose();
@@ -1518,7 +1608,7 @@ var InvitationsHandler = class {
1518
1608
  }
1519
1609
  },
1520
1610
  onOpen: () => {
1521
- (0, import_async5.scheduleTask)(ctx, async () => {
1611
+ (0, import_async6.scheduleTask)(ctx, async () => {
1522
1612
  const traceId = import_keys5.PublicKey.random().toHex();
1523
1613
  try {
1524
1614
  import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.begin({
@@ -1566,7 +1656,7 @@ var InvitationsHandler = class {
1566
1656
  C: (f, a) => f(...a)
1567
1657
  });
1568
1658
  } catch (err) {
1569
- if (err instanceof import_async5.TimeoutError) {
1659
+ if (err instanceof import_async6.TimeoutError) {
1570
1660
  (0, import_log6.log)("timeout", {
1571
1661
  ...protocol.toJSON()
1572
1662
  }, {
@@ -1609,7 +1699,7 @@ var InvitationsHandler = class {
1609
1699
  if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
1610
1700
  return;
1611
1701
  }
1612
- if (err instanceof import_async5.TimeoutError) {
1702
+ if (err instanceof import_async6.TimeoutError) {
1613
1703
  (0, import_log6.log)("timeout", {
1614
1704
  ...protocol.toJSON()
1615
1705
  }, {
@@ -1636,7 +1726,7 @@ var InvitationsHandler = class {
1636
1726
  return extension;
1637
1727
  };
1638
1728
  let swarmConnection;
1639
- (0, import_async5.scheduleTask)(ctx, async () => {
1729
+ (0, import_async6.scheduleTask)(ctx, async () => {
1640
1730
  const topic = invitation.swarmKey;
1641
1731
  swarmConnection = await this._networkManager.joinSwarm({
1642
1732
  topic,
@@ -1677,10 +1767,10 @@ var InvitationsHandler = class {
1677
1767
  ""
1678
1768
  ]
1679
1769
  });
1680
- const authenticated = new import_async5.Trigger();
1770
+ const authenticated = new import_async6.Trigger();
1681
1771
  let admitted = false;
1682
1772
  let currentState;
1683
- const stream = new import_async5.PushStream();
1773
+ const stream = new import_async6.PushStream();
1684
1774
  const setState = (newData) => {
1685
1775
  (0, import_invariant7.invariant)(newData.state !== void 0, void 0, {
1686
1776
  F: __dxlog_file8,
@@ -1699,7 +1789,7 @@ var InvitationsHandler = class {
1699
1789
  };
1700
1790
  const ctx = new import_context4.Context({
1701
1791
  onError: (err) => {
1702
- if (err instanceof import_async5.TimeoutError) {
1792
+ if (err instanceof import_async6.TimeoutError) {
1703
1793
  (0, import_log6.log)("timeout", {
1704
1794
  ...protocol.toJSON()
1705
1795
  }, {
@@ -1751,7 +1841,7 @@ var InvitationsHandler = class {
1751
1841
  stream.error(new Error("Remote peer disconnected."));
1752
1842
  }
1753
1843
  });
1754
- (0, import_async5.scheduleTask)(ctx, async () => {
1844
+ (0, import_async6.scheduleTask)(ctx, async () => {
1755
1845
  const traceId = import_keys5.PublicKey.random().toHex();
1756
1846
  try {
1757
1847
  import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.begin({
@@ -1765,7 +1855,7 @@ var InvitationsHandler = class {
1765
1855
  if (++connectionCount > 1) {
1766
1856
  throw new Error(`multiple connections detected: ${connectionCount}`);
1767
1857
  }
1768
- (0, import_async5.scheduleTask)(ctx, () => ctx.raise(new import_async5.TimeoutError(timeout)), timeout);
1858
+ (0, import_async6.scheduleTask)(ctx, () => ctx.raise(new import_async6.TimeoutError(timeout)), timeout);
1769
1859
  (0, import_log6.log)("connected", {
1770
1860
  ...protocol.toJSON()
1771
1861
  }, {
@@ -1882,7 +1972,7 @@ var InvitationsHandler = class {
1882
1972
  C: (f, a) => f(...a)
1883
1973
  });
1884
1974
  } catch (err) {
1885
- if (err instanceof import_async5.TimeoutError) {
1975
+ if (err instanceof import_async6.TimeoutError) {
1886
1976
  (0, import_log6.log)("timeout", {
1887
1977
  ...protocol.toJSON()
1888
1978
  }, {
@@ -1921,7 +2011,7 @@ var InvitationsHandler = class {
1921
2011
  if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
1922
2012
  return;
1923
2013
  }
1924
- if (err instanceof import_async5.TimeoutError) {
2014
+ if (err instanceof import_async6.TimeoutError) {
1925
2015
  (0, import_log6.log)("timeout", {
1926
2016
  ...protocol.toJSON()
1927
2017
  }, {
@@ -1946,7 +2036,7 @@ var InvitationsHandler = class {
1946
2036
  });
1947
2037
  return extension;
1948
2038
  };
1949
- (0, import_async5.scheduleTask)(ctx, async () => {
2039
+ (0, import_async6.scheduleTask)(ctx, async () => {
1950
2040
  (0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
1951
2041
  F: __dxlog_file8,
1952
2042
  L: 361,
@@ -1989,22 +2079,22 @@ var InvitationsHandler = class {
1989
2079
  };
1990
2080
 
1991
2081
  // packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
1992
- var import_async6 = require("@dxos/async");
2082
+ var import_async7 = require("@dxos/async");
1993
2083
  var import_codec_protobuf4 = require("@dxos/codec-protobuf");
1994
2084
  var import_invariant8 = require("@dxos/invariant");
1995
2085
  var import_log7 = require("@dxos/log");
1996
2086
  var import_services5 = require("@dxos/protocols/proto/dxos/client/services");
1997
- var __dxlog_file9 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
2087
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
1998
2088
  var InvitationsServiceImpl = class {
1999
2089
  constructor(_invitationsHandler, _getHandler) {
2000
2090
  this._invitationsHandler = _invitationsHandler;
2001
2091
  this._getHandler = _getHandler;
2002
2092
  this._createInvitations = /* @__PURE__ */ new Map();
2003
2093
  this._acceptInvitations = /* @__PURE__ */ new Map();
2004
- this._invitationCreated = new import_async6.Event();
2005
- this._invitationAccepted = new import_async6.Event();
2006
- this._removedCreated = new import_async6.Event();
2007
- this._removedAccepted = new import_async6.Event();
2094
+ this._invitationCreated = new import_async7.Event();
2095
+ this._invitationAccepted = new import_async7.Event();
2096
+ this._removedCreated = new import_async7.Event();
2097
+ this._removedAccepted = new import_async7.Event();
2008
2098
  }
2009
2099
  // TODO(burdon): Guest/host label.
2010
2100
  getLoggingContext() {
@@ -2176,7 +2266,7 @@ var import_feed_store2 = require("@dxos/feed-store");
2176
2266
  var import_invariant9 = require("@dxos/invariant");
2177
2267
  var import_log8 = require("@dxos/log");
2178
2268
  var import_services6 = require("@dxos/protocols/proto/dxos/client/services");
2179
- var __dxlog_file10 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
2269
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
2180
2270
  var SpaceInvitationProtocol = class {
2181
2271
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
2182
2272
  this._spaceManager = _spaceManager;
@@ -2325,7 +2415,7 @@ var SpaceInvitationProtocol = class {
2325
2415
  };
2326
2416
 
2327
2417
  // packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
2328
- var import_async9 = require("@dxos/async");
2418
+ var import_async10 = require("@dxos/async");
2329
2419
  var import_context7 = require("@dxos/context");
2330
2420
  var import_credentials14 = require("@dxos/credentials");
2331
2421
  var import_invariant11 = require("@dxos/invariant");
@@ -2337,7 +2427,7 @@ var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip"
2337
2427
  var import_util5 = require("@dxos/util");
2338
2428
 
2339
2429
  // packages/sdk/client-services/src/packlets/spaces/data-space.ts
2340
- var import_async8 = require("@dxos/async");
2430
+ var import_async9 = require("@dxos/async");
2341
2431
  var import_client_protocol3 = require("@dxos/client-protocol");
2342
2432
  var import_context6 = require("@dxos/context");
2343
2433
  var import_debug4 = require("@dxos/debug");
@@ -2348,11 +2438,11 @@ var import_protocols7 = require("@dxos/protocols");
2348
2438
  var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2349
2439
  var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
2350
2440
  var import_timeframe2 = require("@dxos/timeframe");
2351
- var import_tracing3 = require("@dxos/tracing");
2441
+ var import_tracing4 = require("@dxos/tracing");
2352
2442
  var import_util4 = require("@dxos/util");
2353
2443
 
2354
2444
  // packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
2355
- var import_async7 = require("@dxos/async");
2445
+ var import_async8 = require("@dxos/async");
2356
2446
  var import_context5 = require("@dxos/context");
2357
2447
  var import_invariant10 = require("@dxos/invariant");
2358
2448
  var import_keys6 = require("@dxos/keys");
@@ -2360,7 +2450,7 @@ var import_log9 = require("@dxos/log");
2360
2450
  var import_protocols6 = require("@dxos/protocols");
2361
2451
  var import_teleport2 = require("@dxos/teleport");
2362
2452
  var import_util3 = require("@dxos/util");
2363
- var __dxlog_file11 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2453
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2364
2454
  var DEFAULT_RETRY_TIMEOUT = 1e3;
2365
2455
  var DEFAULT_SUCCESS_DELAY = 1e3;
2366
2456
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
@@ -2368,7 +2458,7 @@ var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
2368
2458
  var NotarizationPlugin = class {
2369
2459
  constructor() {
2370
2460
  this._ctx = new import_context5.Context();
2371
- this._extensionOpened = new import_async7.Event();
2461
+ this._extensionOpened = new import_async8.Event();
2372
2462
  this._extensions = /* @__PURE__ */ new Set();
2373
2463
  this._processedCredentials = new import_util3.ComplexSet(import_keys6.PublicKey.hash);
2374
2464
  this._processCredentialsTriggers = new import_util3.ComplexMap(import_keys6.PublicKey.hash);
@@ -2402,7 +2492,7 @@ var NotarizationPlugin = class {
2402
2492
  "'Credentials must have an id'"
2403
2493
  ]
2404
2494
  });
2405
- const errors = new import_async7.Trigger();
2495
+ const errors = new import_async8.Trigger();
2406
2496
  const ctx = this._ctx.derive({
2407
2497
  onError: (err) => {
2408
2498
  import_log9.log.warn("Notarization error", {
@@ -2419,7 +2509,7 @@ var NotarizationPlugin = class {
2419
2509
  });
2420
2510
  opCtx?.onDispose(() => ctx.dispose());
2421
2511
  if (timeout !== 0) {
2422
- (0, import_async7.scheduleTask)(ctx, () => {
2512
+ (0, import_async8.scheduleTask)(ctx, () => {
2423
2513
  import_log9.log.warn("Notarization timeout", {
2424
2514
  timeout,
2425
2515
  peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
@@ -2430,12 +2520,12 @@ var NotarizationPlugin = class {
2430
2520
  C: (f, a) => f(...a)
2431
2521
  });
2432
2522
  void ctx.dispose();
2433
- errors.throw(new import_async7.TimeoutError(timeout, "Notarization timed out"));
2523
+ errors.throw(new import_async8.TimeoutError(timeout, "Notarization timed out"));
2434
2524
  }, timeout);
2435
2525
  }
2436
2526
  const allNotarized = Promise.all(credentials.map((credential) => this._waitUntilProcessed(credential.id)));
2437
2527
  const peersTried = /* @__PURE__ */ new Set();
2438
- const notarizeTask = new import_async7.DeferredTask(ctx, async () => {
2528
+ const notarizeTask = new import_async8.DeferredTask(ctx, async () => {
2439
2529
  try {
2440
2530
  if (this._extensions.size === 0) {
2441
2531
  return;
@@ -2453,7 +2543,7 @@ var NotarizationPlugin = class {
2453
2543
  C: (f, a) => f(...a)
2454
2544
  });
2455
2545
  peersTried.clear();
2456
- (0, import_async7.scheduleTask)(ctx, () => notarizeTask.schedule(), retryTimeout);
2546
+ (0, import_async8.scheduleTask)(ctx, () => notarizeTask.schedule(), retryTimeout);
2457
2547
  return;
2458
2548
  }
2459
2549
  peersTried.add(peer);
@@ -2475,7 +2565,7 @@ var NotarizationPlugin = class {
2475
2565
  S: this,
2476
2566
  C: (f, a) => f(...a)
2477
2567
  });
2478
- await (0, import_async7.sleep)(successDelay);
2568
+ await (0, import_async8.sleep)(successDelay);
2479
2569
  } catch (err) {
2480
2570
  if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
2481
2571
  import_log9.log.warn("error notarizing (recoverable)", err, {
@@ -2533,7 +2623,7 @@ var NotarizationPlugin = class {
2533
2623
  if (this._processedCredentials.has(id)) {
2534
2624
  return;
2535
2625
  }
2536
- await (0, import_util3.entry)(this._processCredentialsTriggers, id).orInsert(new import_async7.Trigger()).value.wait();
2626
+ await (0, import_util3.entry)(this._processCredentialsTriggers, id).orInsert(new import_async8.Trigger()).value.wait();
2537
2627
  }
2538
2628
  /**
2539
2629
  * Requests from other peers to notarize credentials.
@@ -2620,7 +2710,7 @@ var NotarizationTeleportExtension = class extends import_teleport2.RpcExtension
2620
2710
  };
2621
2711
 
2622
2712
  // packages/sdk/client-services/src/packlets/spaces/data-space.ts
2623
- function _ts_decorate3(decorators, target, key, desc) {
2713
+ function _ts_decorate4(decorators, target, key, desc) {
2624
2714
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2625
2715
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2626
2716
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2630,7 +2720,7 @@ function _ts_decorate3(decorators, target, key, desc) {
2630
2720
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2631
2721
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2632
2722
  }
2633
- var __dxlog_file12 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
2723
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
2634
2724
  var ENABLE_FEED_PURGE = false;
2635
2725
  var DataSpace = class DataSpace2 {
2636
2726
  constructor(params) {
@@ -2641,7 +2731,7 @@ var DataSpace = class DataSpace2 {
2641
2731
  * Error for _state === SpaceState.ERROR.
2642
2732
  */
2643
2733
  this.error = void 0;
2644
- this.stateUpdate = new import_async8.Event();
2734
+ this.stateUpdate = new import_async9.Event();
2645
2735
  this.metrics = {};
2646
2736
  this._inner = params.inner;
2647
2737
  this._inner.stateUpdate.on(this._ctx, () => this.stateUpdate.emit());
@@ -2747,7 +2837,7 @@ var DataSpace = class DataSpace2 {
2747
2837
  * Initialize the data pipeline in a separate task.
2748
2838
  */
2749
2839
  initializeDataPipelineAsync() {
2750
- (0, import_async8.scheduleTask)(this._ctx, async () => {
2840
+ (0, import_async9.scheduleTask)(this._ctx, async () => {
2751
2841
  try {
2752
2842
  this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
2753
2843
  await this.initializeDataPipeline();
@@ -2797,7 +2887,7 @@ var DataSpace = class DataSpace2 {
2797
2887
  C: (f, a) => f(...a)
2798
2888
  });
2799
2889
  await this._initializeAndReadControlPipeline();
2800
- await (0, import_async8.sleep)(1);
2890
+ await (0, import_async9.sleep)(1);
2801
2891
  await this._inner.initializeDataPipeline();
2802
2892
  this.metrics.dataPipelineOpen = /* @__PURE__ */ new Date();
2803
2893
  await (0, import_context6.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
@@ -2952,33 +3042,33 @@ var DataSpace = class DataSpace2 {
2952
3042
  this.stateUpdate.emit();
2953
3043
  }
2954
3044
  };
2955
- _ts_decorate3([
2956
- import_async8.synchronized
3045
+ _ts_decorate4([
3046
+ import_async9.synchronized
2957
3047
  ], DataSpace.prototype, "open", null);
2958
- _ts_decorate3([
2959
- import_async8.synchronized
3048
+ _ts_decorate4([
3049
+ import_async9.synchronized
2960
3050
  ], DataSpace.prototype, "close", null);
2961
- _ts_decorate3([
2962
- import_tracing3.trace.span({
3051
+ _ts_decorate4([
3052
+ import_tracing4.trace.span({
2963
3053
  showInBrowserTimeline: true
2964
3054
  })
2965
3055
  ], DataSpace.prototype, "initializeDataPipeline", null);
2966
- _ts_decorate3([
2967
- import_tracing3.trace.span({
3056
+ _ts_decorate4([
3057
+ import_tracing4.trace.span({
2968
3058
  showInBrowserTimeline: true
2969
3059
  })
2970
3060
  ], DataSpace.prototype, "_initializeAndReadControlPipeline", null);
2971
- _ts_decorate3([
3061
+ _ts_decorate4([
2972
3062
  (0, import_debug4.timed)(1e4)
2973
3063
  ], DataSpace.prototype, "_createWritableFeeds", null);
2974
- _ts_decorate3([
2975
- import_async8.synchronized
3064
+ _ts_decorate4([
3065
+ import_async9.synchronized
2976
3066
  ], DataSpace.prototype, "activate", null);
2977
- _ts_decorate3([
2978
- import_async8.synchronized
3067
+ _ts_decorate4([
3068
+ import_async9.synchronized
2979
3069
  ], DataSpace.prototype, "deactivate", null);
2980
- DataSpace = _ts_decorate3([
2981
- (0, import_async8.trackLeaks)("open", "close")
3070
+ DataSpace = _ts_decorate4([
3071
+ (0, import_async9.trackLeaks)("open", "close")
2982
3072
  ], DataSpace);
2983
3073
 
2984
3074
  // packages/sdk/client-services/src/packlets/spaces/genesis.ts
@@ -3051,7 +3141,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
3051
3141
  };
3052
3142
 
3053
3143
  // packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
3054
- function _ts_decorate4(decorators, target, key, desc) {
3144
+ function _ts_decorate5(decorators, target, key, desc) {
3055
3145
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3056
3146
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3057
3147
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3061,7 +3151,7 @@ function _ts_decorate4(decorators, target, key, desc) {
3061
3151
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3062
3152
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3063
3153
  }
3064
- var __dxlog_file13 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
3154
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
3065
3155
  var DataSpaceManager = class DataSpaceManager2 {
3066
3156
  constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
3067
3157
  this._spaceManager = _spaceManager;
@@ -3071,7 +3161,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3071
3161
  this._signingContext = _signingContext;
3072
3162
  this._feedStore = _feedStore;
3073
3163
  this._ctx = new import_context7.Context();
3074
- this.updated = new import_async9.Event();
3164
+ this.updated = new import_async10.Event();
3075
3165
  this._spaces = new import_util5.ComplexMap(import_keys8.PublicKey.hash);
3076
3166
  this._isOpen = false;
3077
3167
  this._instanceId = import_keys8.PublicKey.random().toHex();
@@ -3367,31 +3457,31 @@ var DataSpaceManager = class DataSpaceManager2 {
3367
3457
  return dataSpace;
3368
3458
  }
3369
3459
  };
3370
- _ts_decorate4([
3371
- import_async9.synchronized
3460
+ _ts_decorate5([
3461
+ import_async10.synchronized
3372
3462
  ], DataSpaceManager.prototype, "open", null);
3373
- _ts_decorate4([
3374
- import_async9.synchronized
3463
+ _ts_decorate5([
3464
+ import_async10.synchronized
3375
3465
  ], DataSpaceManager.prototype, "close", null);
3376
- _ts_decorate4([
3377
- import_async9.synchronized
3466
+ _ts_decorate5([
3467
+ import_async10.synchronized
3378
3468
  ], DataSpaceManager.prototype, "createSpace", null);
3379
- _ts_decorate4([
3380
- import_async9.synchronized
3469
+ _ts_decorate5([
3470
+ import_async10.synchronized
3381
3471
  ], DataSpaceManager.prototype, "acceptSpace", null);
3382
- DataSpaceManager = _ts_decorate4([
3383
- (0, import_async9.trackLeaks)("open", "close")
3472
+ DataSpaceManager = _ts_decorate5([
3473
+ (0, import_async10.trackLeaks)("open", "close")
3384
3474
  ], DataSpaceManager);
3385
3475
 
3386
3476
  // packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
3387
- var import_async10 = require("@dxos/async");
3477
+ var import_async11 = require("@dxos/async");
3388
3478
  var import_codec_protobuf5 = require("@dxos/codec-protobuf");
3389
3479
  var import_debug6 = require("@dxos/debug");
3390
3480
  var import_invariant12 = require("@dxos/invariant");
3391
3481
  var import_log12 = require("@dxos/log");
3392
3482
  var import_protocols9 = require("@dxos/protocols");
3393
3483
  var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
3394
- var __dxlog_file14 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3484
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3395
3485
  var SpacesServiceImpl = class {
3396
3486
  constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
3397
3487
  this._identityManager = _identityManager;
@@ -3425,7 +3515,7 @@ var SpacesServiceImpl = class {
3425
3515
  }
3426
3516
  querySpaces() {
3427
3517
  return new import_codec_protobuf5.Stream(({ next, ctx }) => {
3428
- const scheduler = new import_async10.UpdateScheduler(ctx, async () => {
3518
+ const scheduler = new import_async11.UpdateScheduler(ctx, async () => {
3429
3519
  const dataSpaceManager = await this._getDataSpaceManager();
3430
3520
  const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
3431
3521
  (0, import_log12.log)("update", {
@@ -3442,9 +3532,9 @@ var SpacesServiceImpl = class {
3442
3532
  }, {
3443
3533
  maxFrequency: process.env.NODE_ENV === "test" ? void 0 : 2
3444
3534
  });
3445
- (0, import_async10.scheduleTask)(ctx, async () => {
3535
+ (0, import_async11.scheduleTask)(ctx, async () => {
3446
3536
  const dataSpaceManager = await this._getDataSpaceManager();
3447
- const subscriptions = new import_async10.EventSubscriptions();
3537
+ const subscriptions = new import_async11.EventSubscriptions();
3448
3538
  ctx.onDispose(() => subscriptions.clear());
3449
3539
  const subscribeSpaces = () => {
3450
3540
  subscriptions.clear();
@@ -3479,7 +3569,7 @@ var SpacesServiceImpl = class {
3479
3569
  }
3480
3570
  subscribeMessages({ spaceKey, channel }) {
3481
3571
  return new import_codec_protobuf5.Stream(({ ctx, next }) => {
3482
- (0, import_async10.scheduleTask)(ctx, async () => {
3572
+ (0, import_async11.scheduleTask)(ctx, async () => {
3483
3573
  const dataSpaceManager = await this._getDataSpaceManager();
3484
3574
  const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
3485
3575
  const handle = space.listen(getChannelId(channel), (message) => {
@@ -3498,7 +3588,7 @@ var SpacesServiceImpl = class {
3498
3588
  }
3499
3589
  };
3500
3590
  ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
3501
- (0, import_async10.scheduleTask)(ctx, async () => {
3591
+ (0, import_async11.scheduleTask)(ctx, async () => {
3502
3592
  await space.spaceState.addCredentialProcessor(processor);
3503
3593
  if (noTail) {
3504
3594
  close();
@@ -3605,7 +3695,7 @@ var SpacesServiceImpl = class {
3605
3695
  var getChannelId = (channel) => `user-channel/${channel}`;
3606
3696
 
3607
3697
  // packages/sdk/client-services/src/packlets/services/service-context.ts
3608
- function _ts_decorate5(decorators, target, key, desc) {
3698
+ function _ts_decorate6(decorators, target, key, desc) {
3609
3699
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3610
3700
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3611
3701
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3615,14 +3705,14 @@ function _ts_decorate5(decorators, target, key, desc) {
3615
3705
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3616
3706
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3617
3707
  }
3618
- var __dxlog_file15 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-context.ts";
3708
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
3619
3709
  var ServiceContext = class ServiceContext2 {
3620
3710
  constructor(storage, networkManager, signalManager, modelFactory) {
3621
3711
  this.storage = storage;
3622
3712
  this.networkManager = networkManager;
3623
3713
  this.signalManager = signalManager;
3624
3714
  this.modelFactory = modelFactory;
3625
- this.initialized = new import_async11.Trigger();
3715
+ this.initialized = new import_async12.Trigger();
3626
3716
  this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
3627
3717
  this._handlerFactories = /* @__PURE__ */ new Map();
3628
3718
  this._instanceId = import_keys9.PublicKey.random().toHex();
@@ -3839,19 +3929,19 @@ var ServiceContext = class ServiceContext2 {
3839
3929
  await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
3840
3930
  }
3841
3931
  };
3842
- _ts_decorate5([
3843
- import_tracing4.trace.span()
3932
+ _ts_decorate6([
3933
+ import_tracing5.trace.span()
3844
3934
  ], ServiceContext.prototype, "open", null);
3845
- _ts_decorate5([
3846
- import_tracing4.trace.span()
3935
+ _ts_decorate6([
3936
+ import_tracing5.trace.span()
3847
3937
  ], ServiceContext.prototype, "_initialize", null);
3848
- ServiceContext = _ts_decorate5([
3938
+ ServiceContext = _ts_decorate6([
3849
3939
  (0, import_util6.safeInstanceof)("dxos.client-services.ServiceContext"),
3850
- import_tracing4.trace.resource()
3940
+ import_tracing5.trace.resource()
3851
3941
  ], ServiceContext);
3852
3942
 
3853
3943
  // packages/sdk/client-services/src/packlets/services/service-host.ts
3854
- var import_async17 = require("@dxos/async");
3944
+ var import_async18 = require("@dxos/async");
3855
3945
  var import_client_protocol5 = require("@dxos/client-protocol");
3856
3946
  var import_context10 = require("@dxos/context");
3857
3947
  var import_document_model2 = require("@dxos/document-model");
@@ -3866,7 +3956,7 @@ var import_network_manager2 = require("@dxos/network-manager");
3866
3956
  var import_protocols12 = require("@dxos/protocols");
3867
3957
  var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
3868
3958
  var import_text_model = require("@dxos/text-model");
3869
- var import_tracing5 = require("@dxos/tracing");
3959
+ var import_tracing6 = require("@dxos/tracing");
3870
3960
  var import_websocket_rpc = require("@dxos/websocket-rpc");
3871
3961
 
3872
3962
  // packages/sdk/client-services/src/packlets/services/service-registry.ts
@@ -3894,7 +3984,7 @@ var ServiceRegistry = class {
3894
3984
  };
3895
3985
 
3896
3986
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
3897
- var import_async12 = require("@dxos/async");
3987
+ var import_async13 = require("@dxos/async");
3898
3988
  var import_codec_protobuf6 = require("@dxos/codec-protobuf");
3899
3989
  var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
3900
3990
  var DevicesServiceImpl = class {
@@ -3922,7 +4012,7 @@ var DevicesServiceImpl = class {
3922
4012
  });
3923
4013
  }
3924
4014
  };
3925
- const subscriptions = new import_async12.EventSubscriptions();
4015
+ const subscriptions = new import_async13.EventSubscriptions();
3926
4016
  subscriptions.add(this._identityManager.stateUpdate.on(() => {
3927
4017
  update();
3928
4018
  if (this._identityManager.identity) {
@@ -3938,18 +4028,18 @@ var DevicesServiceImpl = class {
3938
4028
  };
3939
4029
 
3940
4030
  // packages/sdk/client-services/src/packlets/devtools/devtools.ts
3941
- var import_async15 = require("@dxos/async");
4031
+ var import_async16 = require("@dxos/async");
3942
4032
  var import_codec_protobuf12 = require("@dxos/codec-protobuf");
3943
4033
 
3944
4034
  // packages/sdk/client-services/src/packlets/devtools/feeds.ts
3945
- var import_async13 = require("@dxos/async");
4035
+ var import_async14 = require("@dxos/async");
3946
4036
  var import_codec_protobuf7 = require("@dxos/codec-protobuf");
3947
4037
  var import_feed_store4 = require("@dxos/feed-store");
3948
4038
  var import_keys10 = require("@dxos/keys");
3949
4039
  var import_util7 = require("@dxos/util");
3950
4040
  var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
3951
4041
  return new import_codec_protobuf7.Stream(({ next }) => {
3952
- const subscriptions = new import_async13.EventSubscriptions();
4042
+ const subscriptions = new import_async14.EventSubscriptions();
3953
4043
  const feedMap = new import_util7.ComplexMap(import_keys10.PublicKey.hash);
3954
4044
  const update = () => {
3955
4045
  const { feeds } = feedStore;
@@ -3981,7 +4071,7 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
3981
4071
  if (!feedKey) {
3982
4072
  return;
3983
4073
  }
3984
- const subscriptions = new import_async13.EventSubscriptions();
4074
+ const subscriptions = new import_async14.EventSubscriptions();
3985
4075
  const timeout = setTimeout(async () => {
3986
4076
  const feed = feedStore.getFeed(feedKey);
3987
4077
  if (!feed) {
@@ -4016,7 +4106,7 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
4016
4106
  };
4017
4107
 
4018
4108
  // packages/sdk/client-services/src/packlets/devtools/keys.ts
4019
- var import_async14 = require("@dxos/async");
4109
+ var import_async15 = require("@dxos/async");
4020
4110
  var import_codec_protobuf8 = require("@dxos/codec-protobuf");
4021
4111
  var subscribeToKeyringKeys = ({ keyring }) => new import_codec_protobuf8.Stream(({ next, ctx }) => {
4022
4112
  const update = async () => {
@@ -4025,7 +4115,7 @@ var subscribeToKeyringKeys = ({ keyring }) => new import_codec_protobuf8.Stream(
4025
4115
  });
4026
4116
  };
4027
4117
  keyring.keysUpdate.on(ctx, update);
4028
- (0, import_async14.scheduleTask)(ctx, update);
4118
+ (0, import_async15.scheduleTask)(ctx, update);
4029
4119
  });
4030
4120
 
4031
4121
  // packages/sdk/client-services/src/packlets/devtools/metadata.ts
@@ -4132,7 +4222,7 @@ var subscribeToSpaces = (context, { spaceKeys = [] }) => {
4132
4222
  // packages/sdk/client-services/src/packlets/devtools/devtools.ts
4133
4223
  var DevtoolsHostEvents = class {
4134
4224
  constructor() {
4135
- this.ready = new import_async15.Event();
4225
+ this.ready = new import_async16.Event();
4136
4226
  }
4137
4227
  };
4138
4228
  var DevtoolsServiceImpl = class {
@@ -4249,7 +4339,7 @@ var DevtoolsServiceImpl = class {
4249
4339
  var import_invariant14 = require("@dxos/invariant");
4250
4340
  var import_lock_file = require("@dxos/lock-file");
4251
4341
  var import_log14 = require("@dxos/log");
4252
- function _ts_decorate6(decorators, target, key, desc) {
4342
+ function _ts_decorate7(decorators, target, key, desc) {
4253
4343
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4254
4344
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4255
4345
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4259,7 +4349,7 @@ function _ts_decorate6(decorators, target, key, desc) {
4259
4349
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4260
4350
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4261
4351
  }
4262
- var __dxlog_file16 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/locks/node.ts";
4352
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
4263
4353
  var Lock = class {
4264
4354
  constructor({ lockKey: lockPath, onAcquire, onRelease }) {
4265
4355
  this._lockPath = lockPath;
@@ -4299,19 +4389,19 @@ var Lock = class {
4299
4389
  await import_lock_file.LockFile.release(this._fileHandle);
4300
4390
  }
4301
4391
  };
4302
- _ts_decorate6([
4392
+ _ts_decorate7([
4303
4393
  import_log14.logInfo
4304
4394
  ], Lock.prototype, "lockKey", null);
4305
4395
 
4306
4396
  // packages/sdk/client-services/src/packlets/logging/logging-service.ts
4307
- var import_async16 = require("@dxos/async");
4397
+ var import_async17 = require("@dxos/async");
4308
4398
  var import_codec_protobuf13 = require("@dxos/codec-protobuf");
4309
4399
  var import_log15 = require("@dxos/log");
4310
4400
  var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
4311
4401
  var import_util8 = require("@dxos/util");
4312
4402
  var LoggingServiceImpl = class {
4313
4403
  constructor() {
4314
- this._logs = new import_async16.Event();
4404
+ this._logs = new import_async17.Event();
4315
4405
  this._started = /* @__PURE__ */ new Date();
4316
4406
  this._logProcessor = (_config, entry2) => {
4317
4407
  this._logs.emit(entry2);
@@ -4556,7 +4646,7 @@ var SystemServiceImpl = class {
4556
4646
  };
4557
4647
 
4558
4648
  // packages/sdk/client-services/src/packlets/services/service-host.ts
4559
- function _ts_decorate7(decorators, target, key, desc) {
4649
+ function _ts_decorate8(decorators, target, key, desc) {
4560
4650
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4561
4651
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4562
4652
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4566,7 +4656,7 @@ function _ts_decorate7(decorators, target, key, desc) {
4566
4656
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4567
4657
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4568
4658
  }
4569
- var __dxlog_file17 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-host.ts";
4659
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
4570
4660
  var createDefaultModelFactory = () => {
4571
4661
  return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
4572
4662
  };
@@ -4593,8 +4683,8 @@ var ClientServicesHost = class ClientServicesHost2 {
4593
4683
  lockKey,
4594
4684
  callbacks
4595
4685
  } = {}) {
4596
- this._tracingService = import_tracing5.TRACE_PROCESSOR.createTraceSender();
4597
- this._statusUpdate = new import_async17.Event();
4686
+ this._tracingService = import_tracing6.TRACE_PROCESSOR.createTraceSender();
4687
+ this._statusUpdate = new import_async18.Event();
4598
4688
  this._opening = false;
4599
4689
  this._open = false;
4600
4690
  this._storage = storage;
@@ -4918,26 +5008,26 @@ var ClientServicesHost = class ClientServicesHost2 {
4918
5008
  return identity;
4919
5009
  }
4920
5010
  };
4921
- _ts_decorate7([
4922
- import_tracing5.trace.info()
5011
+ _ts_decorate8([
5012
+ import_tracing6.trace.info()
4923
5013
  ], ClientServicesHost.prototype, "_opening", void 0);
4924
- _ts_decorate7([
4925
- import_tracing5.trace.info()
5014
+ _ts_decorate8([
5015
+ import_tracing6.trace.info()
4926
5016
  ], ClientServicesHost.prototype, "_open", void 0);
4927
- _ts_decorate7([
4928
- import_async17.synchronized,
4929
- import_tracing5.trace.span()
5017
+ _ts_decorate8([
5018
+ import_async18.synchronized,
5019
+ import_tracing6.trace.span()
4930
5020
  ], ClientServicesHost.prototype, "open", null);
4931
- _ts_decorate7([
4932
- import_async17.synchronized,
4933
- import_tracing5.trace.span()
5021
+ _ts_decorate8([
5022
+ import_async18.synchronized,
5023
+ import_tracing6.trace.span()
4934
5024
  ], ClientServicesHost.prototype, "close", null);
4935
- ClientServicesHost = _ts_decorate7([
4936
- import_tracing5.trace.resource()
5025
+ ClientServicesHost = _ts_decorate8([
5026
+ import_tracing6.trace.resource()
4937
5027
  ], ClientServicesHost);
4938
5028
 
4939
5029
  // packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
4940
- var __dxlog_file18 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
5030
+ var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
4941
5031
  var sanitizeInvitation = (invitation) => {
4942
5032
  return {
4943
5033
  invitationId: invitation.invitationId,
@@ -4950,9 +5040,9 @@ var sanitizeInvitation = (invitation) => {
4950
5040
  };
4951
5041
  };
4952
5042
  var performInvitation = ({ host, guest, options, hooks }) => {
4953
- const hostComplete = new import_async18.Trigger();
4954
- const guestComplete = new import_async18.Trigger();
4955
- const authCode = new import_async18.Trigger();
5043
+ const hostComplete = new import_async19.Trigger();
5044
+ const guestComplete = new import_async19.Trigger();
5045
+ const authCode = new import_async19.Trigger();
4956
5046
  const hostObservable = createInvitation(host, options);
4957
5047
  hostObservable.subscribe(async (hostInvitation) => {
4958
5048
  switch (hostInvitation.state) {