@dxos/client-services 0.1.37-next.a4acfcd → 0.1.37-next.f87f7ef

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.
@@ -1037,7 +1037,7 @@ var InvitationsHandler = class {
1037
1037
  ...protocol.toJSON()
1038
1038
  }, {
1039
1039
  file: "invitations-handler.ts",
1040
- line: 102,
1040
+ line: 106,
1041
1041
  scope: this,
1042
1042
  callSite: (f, a) => f(...a)
1043
1043
  });
@@ -1055,7 +1055,7 @@ var InvitationsHandler = class {
1055
1055
  ...protocol.toJSON()
1056
1056
  }, {
1057
1057
  file: "invitations-handler.ts",
1058
- line: 115,
1058
+ line: 119,
1059
1059
  scope: this,
1060
1060
  callSite: (f, a) => f(...a)
1061
1061
  });
@@ -1074,7 +1074,7 @@ var InvitationsHandler = class {
1074
1074
  authCode: code
1075
1075
  }, {
1076
1076
  file: "invitations-handler.ts",
1077
- line: 134,
1077
+ line: 138,
1078
1078
  scope: this,
1079
1079
  callSite: (f, a) => f(...a)
1080
1080
  });
@@ -1083,7 +1083,7 @@ var InvitationsHandler = class {
1083
1083
  case import_services2.Invitation.AuthMethod.NONE: {
1084
1084
  (0, import_log4.log)("authentication not required", {}, {
1085
1085
  file: "invitations-handler.ts",
1086
- line: 139,
1086
+ line: 143,
1087
1087
  scope: this,
1088
1088
  callSite: (f, a) => f(...a)
1089
1089
  });
@@ -1108,7 +1108,7 @@ var InvitationsHandler = class {
1108
1108
  authMethod: invitation.authMethod
1109
1109
  }, {
1110
1110
  file: "invitations-handler.ts",
1111
- line: 157,
1111
+ line: 161,
1112
1112
  scope: this,
1113
1113
  callSite: (f, a) => f(...a)
1114
1114
  });
@@ -1138,12 +1138,22 @@ var InvitationsHandler = class {
1138
1138
  },
1139
1139
  onOpen: () => {
1140
1140
  (0, import_async6.scheduleTask)(ctx, async () => {
1141
+ const traceId = import_keys5.PublicKey.random().toHex();
1141
1142
  try {
1143
+ import_log4.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols3.trace.begin({
1144
+ id: traceId,
1145
+ parentId: this._traceParent
1146
+ }), {
1147
+ file: "invitations-handler.ts",
1148
+ line: 196,
1149
+ scope: this,
1150
+ callSite: (f, a) => f(...a)
1151
+ });
1142
1152
  (0, import_log4.log)("connected", {
1143
1153
  ...protocol.toJSON()
1144
1154
  }, {
1145
1155
  file: "invitations-handler.ts",
1146
- line: 191,
1156
+ line: 200,
1147
1157
  scope: this,
1148
1158
  callSite: (f, a) => f(...a)
1149
1159
  });
@@ -1159,7 +1169,7 @@ var InvitationsHandler = class {
1159
1169
  ...protocol.toJSON()
1160
1170
  }, {
1161
1171
  file: "invitations-handler.ts",
1162
- line: 194,
1172
+ line: 203,
1163
1173
  scope: this,
1164
1174
  callSite: (f, a) => f(...a)
1165
1175
  });
@@ -1167,13 +1177,21 @@ var InvitationsHandler = class {
1167
1177
  ...invitation,
1168
1178
  state: import_services2.Invitation.State.SUCCESS
1169
1179
  });
1180
+ import_log4.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols3.trace.end({
1181
+ id: traceId
1182
+ }), {
1183
+ file: "invitations-handler.ts",
1184
+ line: 205,
1185
+ scope: this,
1186
+ callSite: (f, a) => f(...a)
1187
+ });
1170
1188
  } catch (err) {
1171
1189
  if (err instanceof import_async6.TimeoutError) {
1172
1190
  (0, import_log4.log)("timeout", {
1173
1191
  ...protocol.toJSON()
1174
1192
  }, {
1175
1193
  file: "invitations-handler.ts",
1176
- line: 198,
1194
+ line: 208,
1177
1195
  scope: this,
1178
1196
  callSite: (f, a) => f(...a)
1179
1197
  });
@@ -1184,12 +1202,21 @@ var InvitationsHandler = class {
1184
1202
  } else {
1185
1203
  import_log4.log.error("failed", err, {
1186
1204
  file: "invitations-handler.ts",
1187
- line: 201,
1205
+ line: 211,
1188
1206
  scope: this,
1189
1207
  callSite: (f, a) => f(...a)
1190
1208
  });
1191
1209
  stream.error(err);
1192
1210
  }
1211
+ import_log4.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols3.trace.error({
1212
+ id: traceId,
1213
+ error: err
1214
+ }), {
1215
+ file: "invitations-handler.ts",
1216
+ line: 214,
1217
+ scope: this,
1218
+ callSite: (f, a) => f(...a)
1219
+ });
1193
1220
  } finally {
1194
1221
  if (type !== import_services2.Invitation.Type.MULTIUSE) {
1195
1222
  await (0, import_async6.sleep)(import_client.ON_CLOSE_DELAY);
@@ -1199,6 +1226,7 @@ var InvitationsHandler = class {
1199
1226
  });
1200
1227
  }
1201
1228
  });
1229
+ extension._traceParent = this._traceParent;
1202
1230
  return extension;
1203
1231
  };
1204
1232
  (0, import_async6.scheduleTask)(ctx, async () => {
@@ -1242,7 +1270,7 @@ var InvitationsHandler = class {
1242
1270
  ...protocol.toJSON()
1243
1271
  }, {
1244
1272
  file: "invitations-handler.ts",
1245
- line: 255,
1273
+ line: 267,
1246
1274
  scope: this,
1247
1275
  callSite: (f, a) => f(...a)
1248
1276
  });
@@ -1253,7 +1281,7 @@ var InvitationsHandler = class {
1253
1281
  } else {
1254
1282
  import_log4.log.warn("auth failed", err, {
1255
1283
  file: "invitations-handler.ts",
1256
- line: 258,
1284
+ line: 270,
1257
1285
  scope: this,
1258
1286
  callSite: (f, a) => f(...a)
1259
1287
  });
@@ -1267,7 +1295,7 @@ var InvitationsHandler = class {
1267
1295
  ...protocol.toJSON()
1268
1296
  }, {
1269
1297
  file: "invitations-handler.ts",
1270
- line: 266,
1298
+ line: 278,
1271
1299
  scope: this,
1272
1300
  callSite: (f, a) => f(...a)
1273
1301
  });
@@ -1278,7 +1306,17 @@ var InvitationsHandler = class {
1278
1306
  const extension = new InvitationGuestExtension({
1279
1307
  onOpen: () => {
1280
1308
  (0, import_async6.scheduleTask)(ctx, async () => {
1309
+ const traceId = import_keys5.PublicKey.random().toHex();
1281
1310
  try {
1311
+ import_log4.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols3.trace.begin({
1312
+ id: traceId,
1313
+ parentId: this._traceParent
1314
+ }), {
1315
+ file: "invitations-handler.ts",
1316
+ line: 290,
1317
+ scope: this,
1318
+ callSite: (f, a) => f(...a)
1319
+ });
1282
1320
  if (++connectionCount > 1) {
1283
1321
  throw new Error(`multiple connections detected: ${connectionCount}`);
1284
1322
  }
@@ -1287,7 +1325,7 @@ var InvitationsHandler = class {
1287
1325
  ...protocol.toJSON()
1288
1326
  }, {
1289
1327
  file: "invitations-handler.ts",
1290
- line: 284,
1328
+ line: 301,
1291
1329
  scope: this,
1292
1330
  callSite: (f, a) => f(...a)
1293
1331
  });
@@ -1299,7 +1337,7 @@ var InvitationsHandler = class {
1299
1337
  ...protocol.toJSON()
1300
1338
  }, {
1301
1339
  file: "invitations-handler.ts",
1302
- line: 288,
1340
+ line: 305,
1303
1341
  scope: this,
1304
1342
  callSite: (f, a) => f(...a)
1305
1343
  });
@@ -1309,7 +1347,7 @@ var InvitationsHandler = class {
1309
1347
  response: introductionResponse
1310
1348
  }, {
1311
1349
  file: "invitations-handler.ts",
1312
- line: 292,
1350
+ line: 309,
1313
1351
  scope: this,
1314
1352
  callSite: (f, a) => f(...a)
1315
1353
  });
@@ -1321,7 +1359,7 @@ var InvitationsHandler = class {
1321
1359
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
1322
1360
  (0, import_log4.log)("guest waiting for authentication code...", {}, {
1323
1361
  file: "invitations-handler.ts",
1324
- line: 301,
1362
+ line: 318,
1325
1363
  scope: this,
1326
1364
  callSite: (f, a) => f(...a)
1327
1365
  });
@@ -1334,7 +1372,7 @@ var InvitationsHandler = class {
1334
1372
  });
1335
1373
  (0, import_log4.log)("sending authentication request", {}, {
1336
1374
  file: "invitations-handler.ts",
1337
- line: 305,
1375
+ line: 322,
1338
1376
  scope: this,
1339
1377
  callSite: (f, a) => f(...a)
1340
1378
  });
@@ -1356,7 +1394,7 @@ var InvitationsHandler = class {
1356
1394
  attempt
1357
1395
  }, {
1358
1396
  file: "invitations-handler.ts",
1359
- line: 316,
1397
+ line: 333,
1360
1398
  scope: this,
1361
1399
  callSite: (f, a) => f(...a)
1362
1400
  });
@@ -1374,7 +1412,7 @@ var InvitationsHandler = class {
1374
1412
  ...protocol.toJSON()
1375
1413
  }, {
1376
1414
  file: "invitations-handler.ts",
1377
- line: 327,
1415
+ line: 344,
1378
1416
  scope: this,
1379
1417
  callSite: (f, a) => f(...a)
1380
1418
  });
@@ -1385,7 +1423,7 @@ var InvitationsHandler = class {
1385
1423
  ...protocol.toJSON()
1386
1424
  }, {
1387
1425
  file: "invitations-handler.ts",
1388
- line: 335,
1426
+ line: 352,
1389
1427
  scope: this,
1390
1428
  callSite: (f, a) => f(...a)
1391
1429
  });
@@ -1394,13 +1432,21 @@ var InvitationsHandler = class {
1394
1432
  ...result,
1395
1433
  state: import_services2.Invitation.State.SUCCESS
1396
1434
  });
1435
+ import_log4.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols3.trace.end({
1436
+ id: traceId
1437
+ }), {
1438
+ file: "invitations-handler.ts",
1439
+ line: 354,
1440
+ scope: this,
1441
+ callSite: (f, a) => f(...a)
1442
+ });
1397
1443
  } catch (err) {
1398
1444
  if (err instanceof import_async6.TimeoutError) {
1399
1445
  (0, import_log4.log)("timeout", {
1400
1446
  ...protocol.toJSON()
1401
1447
  }, {
1402
1448
  file: "invitations-handler.ts",
1403
- line: 339,
1449
+ line: 357,
1404
1450
  scope: this,
1405
1451
  callSite: (f, a) => f(...a)
1406
1452
  });
@@ -1409,14 +1455,23 @@ var InvitationsHandler = class {
1409
1455
  state: import_services2.Invitation.State.TIMEOUT
1410
1456
  });
1411
1457
  } else {
1412
- import_log4.log.warn("auth failed", err, {
1458
+ (0, import_log4.log)("auth failed", err, {
1413
1459
  file: "invitations-handler.ts",
1414
- line: 342,
1460
+ line: 360,
1415
1461
  scope: this,
1416
1462
  callSite: (f, a) => f(...a)
1417
1463
  });
1418
1464
  stream.error(err);
1419
1465
  }
1466
+ import_log4.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols3.trace.error({
1467
+ id: traceId,
1468
+ error: err
1469
+ }), {
1470
+ file: "invitations-handler.ts",
1471
+ line: 363,
1472
+ scope: this,
1473
+ callSite: (f, a) => f(...a)
1474
+ });
1420
1475
  } finally {
1421
1476
  await ctx.dispose();
1422
1477
  }
@@ -1475,13 +1530,73 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1475
1530
  // Perhaps in the future we will have more complex logic here.
1476
1531
  InvitationHostService: {
1477
1532
  introduce: async (request) => {
1478
- return this._callbacks.introduce(request);
1533
+ const traceId = import_keys5.PublicKey.random().toHex();
1534
+ import_log4.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols3.trace.begin({
1535
+ id: traceId,
1536
+ parentId: this._traceParent
1537
+ }), {
1538
+ file: "invitations-handler.ts",
1539
+ line: 442,
1540
+ scope: this,
1541
+ callSite: (f, a) => f(...a)
1542
+ });
1543
+ const response = await this._callbacks.introduce(request);
1544
+ import_log4.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols3.trace.end({
1545
+ id: traceId
1546
+ }), {
1547
+ file: "invitations-handler.ts",
1548
+ line: 447,
1549
+ scope: this,
1550
+ callSite: (f, a) => f(...a)
1551
+ });
1552
+ return response;
1479
1553
  },
1480
1554
  authenticate: async (request) => {
1481
- return this._callbacks.authenticate(request);
1555
+ const traceId = import_keys5.PublicKey.random().toHex();
1556
+ import_log4.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols3.trace.begin({
1557
+ id: traceId,
1558
+ parentId: this._traceParent
1559
+ }), {
1560
+ file: "invitations-handler.ts",
1561
+ line: 453,
1562
+ scope: this,
1563
+ callSite: (f, a) => f(...a)
1564
+ });
1565
+ const response = await this._callbacks.authenticate(request);
1566
+ import_log4.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols3.trace.end({
1567
+ id: traceId,
1568
+ data: {
1569
+ ...response
1570
+ }
1571
+ }), {
1572
+ file: "invitations-handler.ts",
1573
+ line: 458,
1574
+ scope: this,
1575
+ callSite: (f, a) => f(...a)
1576
+ });
1577
+ return response;
1482
1578
  },
1483
1579
  admit: async (request) => {
1484
- return this._callbacks.admit(request);
1580
+ const traceId = import_keys5.PublicKey.random().toHex();
1581
+ import_log4.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols3.trace.begin({
1582
+ id: traceId,
1583
+ parentId: this._traceParent
1584
+ }), {
1585
+ file: "invitations-handler.ts",
1586
+ line: 464,
1587
+ scope: this,
1588
+ callSite: (f, a) => f(...a)
1589
+ });
1590
+ const response = await this._callbacks.admit(request);
1591
+ import_log4.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols3.trace.end({
1592
+ id: traceId
1593
+ }), {
1594
+ file: "invitations-handler.ts",
1595
+ line: 469,
1596
+ scope: this,
1597
+ callSite: (f, a) => f(...a)
1598
+ });
1599
+ return response;
1485
1600
  }
1486
1601
  }
1487
1602
  };
@@ -3665,6 +3780,7 @@ var ServiceContext = class {
3665
3780
  this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
3666
3781
  this.identityManager._traceParent = this._instanceId;
3667
3782
  this.invitations = new InvitationsHandler(this.networkManager);
3783
+ this.invitations._traceParent = this._instanceId;
3668
3784
  this._handlerFactories.set(import_client7.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => {
3669
3785
  var _a;
3670
3786
  return (_a = this.identityManager.identity) != null ? _a : (0, import_debug6.failUndefined)();
@@ -3675,13 +3791,13 @@ var ServiceContext = class {
3675
3791
  id: this._instanceId
3676
3792
  }), {
3677
3793
  file: "service-context.ts",
3678
- line: 114,
3794
+ line: 115,
3679
3795
  scope: this,
3680
3796
  callSite: (f, a) => f(...a)
3681
3797
  });
3682
3798
  (0, import_log15.log)("opening...", {}, {
3683
3799
  file: "service-context.ts",
3684
- line: 116,
3800
+ line: 117,
3685
3801
  scope: this,
3686
3802
  callSite: (f, a) => f(...a)
3687
3803
  });
@@ -3693,7 +3809,7 @@ var ServiceContext = class {
3693
3809
  }
3694
3810
  (0, import_log15.log)("opened", {}, {
3695
3811
  file: "service-context.ts",
3696
- line: 123,
3812
+ line: 124,
3697
3813
  scope: this,
3698
3814
  callSite: (f, a) => f(...a)
3699
3815
  });
@@ -3702,7 +3818,7 @@ var ServiceContext = class {
3702
3818
  var _a, _b;
3703
3819
  (0, import_log15.log)("closing...", {}, {
3704
3820
  file: "service-context.ts",
3705
- line: 127,
3821
+ line: 128,
3706
3822
  scope: this,
3707
3823
  callSite: (f, a) => f(...a)
3708
3824
  });
@@ -3715,7 +3831,7 @@ var ServiceContext = class {
3715
3831
  this.dataServiceSubscriptions.clear();
3716
3832
  (0, import_log15.log)("closed", {}, {
3717
3833
  file: "service-context.ts",
3718
- line: 135,
3834
+ line: 136,
3719
3835
  scope: this,
3720
3836
  callSite: (f, a) => f(...a)
3721
3837
  });
@@ -3723,7 +3839,7 @@ var ServiceContext = class {
3723
3839
  id: this._instanceId
3724
3840
  }), {
3725
3841
  file: "service-context.ts",
3726
- line: 137,
3842
+ line: 138,
3727
3843
  scope: this,
3728
3844
  callSite: (f, a) => f(...a)
3729
3845
  });
@@ -3731,7 +3847,7 @@ var ServiceContext = class {
3731
3847
  async reset() {
3732
3848
  (0, import_log15.log)("resetting...", {}, {
3733
3849
  file: "service-context.ts",
3734
- line: 141,
3850
+ line: 142,
3735
3851
  scope: this,
3736
3852
  callSite: (f, a) => f(...a)
3737
3853
  });
@@ -3739,7 +3855,7 @@ var ServiceContext = class {
3739
3855
  await this.storage.reset();
3740
3856
  (0, import_log15.log)("reset", {}, {
3741
3857
  file: "service-context.ts",
3742
- line: 144,
3858
+ line: 145,
3743
3859
  scope: this,
3744
3860
  callSite: (f, a) => f(...a)
3745
3861
  });
@@ -3764,7 +3880,7 @@ var ServiceContext = class {
3764
3880
  var _a;
3765
3881
  (0, import_log15.log)("initializing spaces...", {}, {
3766
3882
  file: "service-context.ts",
3767
- line: 169,
3883
+ line: 170,
3768
3884
  scope: this,
3769
3885
  callSite: (f, a) => f(...a)
3770
3886
  });
@@ -3804,7 +3920,7 @@ var ServiceContext = class {
3804
3920
  details: assertion
3805
3921
  }, {
3806
3922
  file: "service-context.ts",
3807
- line: 211,
3923
+ line: 212,
3808
3924
  scope: this,
3809
3925
  callSite: (f, a) => f(...a)
3810
3926
  });
@@ -3815,7 +3931,7 @@ var ServiceContext = class {
3815
3931
  details: assertion
3816
3932
  }, {
3817
3933
  file: "service-context.ts",
3818
- line: 215,
3934
+ line: 216,
3819
3935
  scope: this,
3820
3936
  callSite: (f, a) => f(...a)
3821
3937
  });
@@ -3826,7 +3942,7 @@ var ServiceContext = class {
3826
3942
  details: assertion
3827
3943
  }, {
3828
3944
  file: "service-context.ts",
3829
- line: 220,
3945
+ line: 221,
3830
3946
  scope: this,
3831
3947
  callSite: (f, a) => f(...a)
3832
3948
  });
@@ -3837,7 +3953,7 @@ var ServiceContext = class {
3837
3953
  } catch (err) {
3838
3954
  import_log15.log.catch(err, {}, {
3839
3955
  file: "service-context.ts",
3840
- line: 226,
3956
+ line: 227,
3841
3957
  scope: this,
3842
3958
  callSite: (f, a) => f(...a)
3843
3959
  });