@dxos/client-services 0.1.48-next.83f55fd → 0.1.48

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.
@@ -2173,6 +2173,7 @@ var DevicesServiceImpl = class {
2173
2173
  var import_async11 = require("@dxos/async");
2174
2174
  var import_codec_protobuf9 = require("@dxos/codec-protobuf");
2175
2175
  var import_log8 = require("@dxos/log");
2176
+ var import_util3 = require("@dxos/util");
2176
2177
  var LoggingServiceImpl = class {
2177
2178
  constructor() {
2178
2179
  this._logs = new import_async11.Event();
@@ -2192,12 +2193,18 @@ var LoggingServiceImpl = class {
2192
2193
  const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
2193
2194
  return new import_codec_protobuf9.Stream(({ ctx, next }) => {
2194
2195
  const handler = (entry2) => {
2195
- var _a2;
2196
+ var _a2, _b, _c;
2196
2197
  if (((_a2 = entry2.meta) == null ? void 0 : _a2.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
2197
2198
  return;
2198
2199
  }
2199
2200
  if ((0, import_log8.shouldLog)(entry2, filters)) {
2200
- next(jsonify(entry2));
2201
+ const record = {
2202
+ ...entry2,
2203
+ context: (0, import_util3.jsonify)((0, import_log8.getContextFromEntry)(entry2))
2204
+ };
2205
+ (_b = record.meta) == null ? true : delete _b.bugcheck;
2206
+ (_c = record.meta) == null ? true : delete _c.scope;
2207
+ next(record);
2201
2208
  }
2202
2209
  };
2203
2210
  ctx.onDispose(() => {
@@ -2207,30 +2214,6 @@ var LoggingServiceImpl = class {
2207
2214
  });
2208
2215
  }
2209
2216
  };
2210
- var jsonify = (value, handles = /* @__PURE__ */ new WeakSet()) => {
2211
- if (typeof value === "function") {
2212
- return null;
2213
- } else if (typeof value === "object" && value !== null) {
2214
- if (handles.has(value)) {
2215
- return null;
2216
- }
2217
- handles.add(value);
2218
- if (Array.isArray(value)) {
2219
- return value.map((x) => jsonify(x, handles));
2220
- } else {
2221
- if (typeof value.toJSON === "function") {
2222
- return value.toJSON();
2223
- }
2224
- const res = {};
2225
- for (const key of Object.keys(value)) {
2226
- res[key] = jsonify(value[key], handles);
2227
- }
2228
- return res;
2229
- }
2230
- } else {
2231
- return value;
2232
- }
2233
- };
2234
2217
 
2235
2218
  // packages/sdk/client-services/src/packlets/network/network-service.ts
2236
2219
  var import_codec_protobuf10 = require("@dxos/codec-protobuf");
@@ -2274,7 +2257,7 @@ var import_log11 = require("@dxos/log");
2274
2257
  var import_protocols6 = require("@dxos/protocols");
2275
2258
  var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
2276
2259
  var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
2277
- var import_util5 = require("@dxos/util");
2260
+ var import_util6 = require("@dxos/util");
2278
2261
 
2279
2262
  // packages/sdk/client-services/src/packlets/spaces/data-space.ts
2280
2263
  var import_async13 = require("@dxos/async");
@@ -2287,7 +2270,7 @@ var import_keys8 = require("@dxos/keys");
2287
2270
  var import_log10 = require("@dxos/log");
2288
2271
  var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2289
2272
  var import_credentials9 = require("@dxos/protocols/proto/dxos/halo/credentials");
2290
- var import_util4 = require("@dxos/util");
2273
+ var import_util5 = require("@dxos/util");
2291
2274
 
2292
2275
  // packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
2293
2276
  var import_node_assert9 = __toESM(require("node:assert"));
@@ -2297,7 +2280,7 @@ var import_keys7 = require("@dxos/keys");
2297
2280
  var import_log9 = require("@dxos/log");
2298
2281
  var import_protocols5 = require("@dxos/protocols");
2299
2282
  var import_teleport2 = require("@dxos/teleport");
2300
- var import_util3 = require("@dxos/util");
2283
+ var import_util4 = require("@dxos/util");
2301
2284
  var DEFAULT_RETRY_TIMEOUT = 1e3;
2302
2285
  var DEFAULT_SUCCESS_DELAY = 1e3;
2303
2286
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
@@ -2306,8 +2289,8 @@ var NotarizationPlugin = class {
2306
2289
  this._ctx = new import_context5.Context();
2307
2290
  this._extensionOpened = new import_async12.Event();
2308
2291
  this._extensions = /* @__PURE__ */ new Set();
2309
- this._processedCredentials = new import_util3.ComplexSet(import_keys7.PublicKey.hash);
2310
- this._processCredentialsTriggers = new import_util3.ComplexMap(import_keys7.PublicKey.hash);
2292
+ this._processedCredentials = new import_util4.ComplexSet(import_keys7.PublicKey.hash);
2293
+ this._processCredentialsTriggers = new import_util4.ComplexMap(import_keys7.PublicKey.hash);
2311
2294
  }
2312
2295
  async open() {
2313
2296
  }
@@ -2449,7 +2432,7 @@ var NotarizationPlugin = class {
2449
2432
  if (this._processedCredentials.has(id)) {
2450
2433
  return;
2451
2434
  }
2452
- await (0, import_util3.entry)(this._processCredentialsTriggers, id).orInsert(new import_async12.Trigger()).value.wait();
2435
+ await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new import_async12.Trigger()).value.wait();
2453
2436
  }
2454
2437
  /**
2455
2438
  * Requests from other peers to notarize credentials.
@@ -2560,7 +2543,7 @@ var DataSpace = class DataSpace2 {
2560
2543
  this._signingContext = params.signingContext;
2561
2544
  this._callbacks = (_a = params.callbacks) != null ? _a : {};
2562
2545
  this.authVerifier = new TrustedKeySetAuthVerifier({
2563
- trustedKeysProvider: () => new import_util4.ComplexSet(import_keys8.PublicKey.hash, Array.from(this._inner.spaceState.members.keys())),
2546
+ trustedKeysProvider: () => new import_util5.ComplexSet(import_keys8.PublicKey.hash, Array.from(this._inner.spaceState.members.keys())),
2564
2547
  update: this._inner.stateUpdate,
2565
2548
  authTimeout: import_client_protocol3.AUTH_TIMEOUT
2566
2549
  });
@@ -2858,7 +2841,7 @@ var DataSpaceManager = class DataSpaceManager2 {
2858
2841
  this._feedStore = _feedStore;
2859
2842
  this._ctx = new import_context7.Context();
2860
2843
  this.updated = new import_async14.Event();
2861
- this._spaces = new import_util5.ComplexMap(import_keys9.PublicKey.hash);
2844
+ this._spaces = new import_util6.ComplexMap(import_keys9.PublicKey.hash);
2862
2845
  this._isOpen = false;
2863
2846
  this._instanceId = import_keys9.PublicKey.random().toHex();
2864
2847
  }
@@ -3034,7 +3017,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3034
3017
  swarmIdentity: {
3035
3018
  peerKey: this._signingContext.deviceKey,
3036
3019
  credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
3037
- credentialAuthenticator: (0, import_util5.deferFunction)(() => dataSpace.authVerifier.verifier)
3020
+ credentialAuthenticator: (0, import_util6.deferFunction)(() => dataSpace.authVerifier.verifier)
3038
3021
  },
3039
3022
  onNetworkConnection: (session) => {
3040
3023
  session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
@@ -3127,7 +3110,7 @@ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
3127
3110
  var import_log12 = require("@dxos/log");
3128
3111
  var import_protocols7 = require("@dxos/protocols");
3129
3112
  var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
3130
- var import_util6 = require("@dxos/util");
3113
+ var import_util7 = require("@dxos/util");
3131
3114
  var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
3132
3115
  var SpacesServiceImpl = class {
3133
3116
  constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
@@ -3264,7 +3247,7 @@ var SpacesServiceImpl = class {
3264
3247
  identity: {
3265
3248
  identityKey: member.key,
3266
3249
  profile: {
3267
- displayName: (_b2 = (_a2 = member.assertion.profile) == null ? void 0 : _a2.displayName) != null ? _b2 : (0, import_util6.humanize)(member.key)
3250
+ displayName: (_b2 = (_a2 = member.assertion.profile) == null ? void 0 : _a2.displayName) != null ? _b2 : (0, import_util7.humanize)(member.key)
3268
3251
  }
3269
3252
  },
3270
3253
  presence: ((_c2 = this._identityManager.identity) == null ? void 0 : _c2.identityKey.equals(member.key)) || space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE
@@ -3368,7 +3351,7 @@ var import_client_protocol5 = require("@dxos/client-protocol");
3368
3351
  var import_log13 = require("@dxos/log");
3369
3352
  var import_messaging = require("@dxos/messaging");
3370
3353
  var import_network_manager2 = require("@dxos/network-manager");
3371
- var import_util7 = require("@dxos/util");
3354
+ var import_util8 = require("@dxos/util");
3372
3355
 
3373
3356
  // packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
3374
3357
  var import_codec_protobuf13 = require("@dxos/codec-protobuf");
@@ -3550,7 +3533,7 @@ var IFrameHostRuntime = class {
3550
3533
  callSite: (f, a) => f(...a)
3551
3534
  });
3552
3535
  try {
3553
- this._config = await (0, import_util7.getAsyncValue)(this._configProvider);
3536
+ this._config = await (0, import_util8.getAsyncValue)(this._configProvider);
3554
3537
  this._transportFactory = (0, import_network_manager2.createWebRTCTransportFactory)({
3555
3538
  iceServers: this._config.get("runtime.services.ice")
3556
3539
  });
@@ -3638,7 +3621,7 @@ var import_errors5 = require("@dxos/errors");
3638
3621
  var import_log14 = require("@dxos/log");
3639
3622
  var import_network_manager3 = require("@dxos/network-manager");
3640
3623
  var import_rpc3 = require("@dxos/rpc");
3641
- var import_util8 = require("@dxos/util");
3624
+ var import_util9 = require("@dxos/util");
3642
3625
  var IFrameProxyRuntime = class {
3643
3626
  constructor({ config, systemPort, shellPort }) {
3644
3627
  this._id = String(Math.floor(Math.random() * 1e6));
@@ -3655,7 +3638,7 @@ var IFrameProxyRuntime = class {
3655
3638
  }
3656
3639
  async open(origin) {
3657
3640
  var _a;
3658
- this._config = await (0, import_util8.getAsyncValue)(this._configProvider);
3641
+ this._config = await (0, import_util9.getAsyncValue)(this._configProvider);
3659
3642
  this._transportService = new import_network_manager3.WebRTCTransportService({
3660
3643
  iceServers: this._config.get("runtime.services.ice")
3661
3644
  });
@@ -3842,7 +3825,7 @@ var import_async20 = require("@dxos/async");
3842
3825
  var import_client_protocol8 = require("@dxos/client-protocol");
3843
3826
  var import_log16 = require("@dxos/log");
3844
3827
  var import_rpc4 = require("@dxos/rpc");
3845
- var import_util9 = require("@dxos/util");
3828
+ var import_util10 = require("@dxos/util");
3846
3829
  var __decorate5 = function(decorators, target, key, desc) {
3847
3830
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3848
3831
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -3856,7 +3839,7 @@ var __decorate5 = function(decorators, target, key, desc) {
3856
3839
  var WorkerSession = class {
3857
3840
  constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
3858
3841
  this._startTrigger = new import_async20.Trigger();
3859
- this.onClose = new import_util9.Callback();
3842
+ this.onClose = new import_util10.Callback();
3860
3843
  (0, import_node_assert12.default)(serviceHost);
3861
3844
  this._serviceHost = serviceHost;
3862
3845
  const middleware = {