@dxos/client-services 0.1.49-next.fdd6c88 → 0.1.49

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.
Files changed (28) hide show
  1. package/dist/lib/browser/{chunk-KMQOZOUZ.mjs → chunk-YLH4UYUT.mjs} +73 -63
  2. package/dist/lib/browser/chunk-YLH4UYUT.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/packlets/testing/index.mjs +1 -1
  6. package/dist/lib/node/index.cjs +79 -69
  7. package/dist/lib/node/index.cjs.map +4 -4
  8. package/dist/lib/node/meta.json +1 -1
  9. package/dist/lib/node/packlets/testing/index.cjs +76 -66
  10. package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
  11. package/dist/types/src/packlets/devtools/devtools.d.ts +2 -1
  12. package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
  13. package/dist/types/src/packlets/devtools/metadata.d.ts +7 -0
  14. package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -0
  15. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  16. package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
  17. package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
  18. package/dist/types/src/packlets/spaces/spaces-service.d.ts +0 -3
  19. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  20. package/dist/types/src/packlets/vault/vault-resource-lock.d.ts.map +1 -1
  21. package/package.json +30 -30
  22. package/src/packlets/devtools/devtools.ts +6 -0
  23. package/src/packlets/devtools/metadata.ts +14 -0
  24. package/src/packlets/services/service-context.ts +1 -2
  25. package/src/packlets/spaces/notarization-plugin.ts +7 -3
  26. package/src/packlets/spaces/spaces-service.ts +0 -3
  27. package/src/packlets/vault/vault-resource-lock.ts +1 -0
  28. package/dist/lib/browser/chunk-KMQOZOUZ.mjs.map +0 -7
@@ -69,7 +69,7 @@ module.exports = __toCommonJS(src_exports);
69
69
 
70
70
  // packages/sdk/client-services/src/packlets/devtools/devtools.ts
71
71
  var import_async3 = require("@dxos/async");
72
- var import_codec_protobuf5 = require("@dxos/codec-protobuf");
72
+ var import_codec_protobuf6 = require("@dxos/codec-protobuf");
73
73
 
74
74
  // packages/sdk/client-services/src/packlets/devtools/feeds.ts
75
75
  var import_async = require("@dxos/async");
@@ -157,11 +157,22 @@ var subscribeToKeyringKeys = ({ keyring }) => new import_codec_protobuf2.Stream(
157
157
  (0, import_async2.scheduleTask)(ctx, update);
158
158
  });
159
159
 
160
- // packages/sdk/client-services/src/packlets/devtools/network.ts
160
+ // packages/sdk/client-services/src/packlets/devtools/metadata.ts
161
161
  var import_codec_protobuf3 = require("@dxos/codec-protobuf");
162
+ var subscribeToMetadata = ({ context }) => new import_codec_protobuf3.Stream(({ next, ctx }) => {
163
+ context.metadataStore.update.on(ctx, (data) => next({
164
+ metadata: data
165
+ }));
166
+ next({
167
+ metadata: context.metadataStore.metadata
168
+ });
169
+ });
170
+
171
+ // packages/sdk/client-services/src/packlets/devtools/network.ts
172
+ var import_codec_protobuf4 = require("@dxos/codec-protobuf");
162
173
  var import_context = require("@dxos/context");
163
174
  var import_keys2 = require("@dxos/keys");
164
- var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf3.Stream(({ next, close }) => {
175
+ var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf4.Stream(({ next, close }) => {
165
176
  const update = () => {
166
177
  try {
167
178
  const status = signalManager.getStatus();
@@ -175,7 +186,7 @@ var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf3
175
186
  signalManager.statusChanged.on(() => update());
176
187
  update();
177
188
  });
178
- var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf3.Stream(({ next }) => {
189
+ var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf4.Stream(({ next }) => {
179
190
  const ctx = new import_context.Context();
180
191
  signalManager.onMessage.on(ctx, (message) => {
181
192
  next({
@@ -197,7 +208,7 @@ var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf3.Stream
197
208
  return ctx.dispose();
198
209
  };
199
210
  });
200
- var subscribeToNetworkTopics = ({ networkManager }) => new import_codec_protobuf3.Stream(({ next, close }) => {
211
+ var subscribeToNetworkTopics = ({ networkManager }) => new import_codec_protobuf4.Stream(({ next, close }) => {
201
212
  const update = () => {
202
213
  try {
203
214
  const topics = networkManager.topics;
@@ -218,7 +229,7 @@ var subscribeToNetworkTopics = ({ networkManager }) => new import_codec_protobuf
218
229
  networkManager.topicsUpdated.on(update);
219
230
  update();
220
231
  });
221
- var subscribeToSwarmInfo = ({ networkManager }) => new import_codec_protobuf3.Stream(({ next }) => {
232
+ var subscribeToSwarmInfo = ({ networkManager }) => new import_codec_protobuf4.Stream(({ next }) => {
222
233
  var _a;
223
234
  const update = () => {
224
235
  var _a2;
@@ -246,9 +257,9 @@ var getNetworkPeers = ({ networkManager }, request) => {
246
257
  };
247
258
 
248
259
  // packages/sdk/client-services/src/packlets/devtools/spaces.ts
249
- var import_codec_protobuf4 = require("@dxos/codec-protobuf");
260
+ var import_codec_protobuf5 = require("@dxos/codec-protobuf");
250
261
  var subscribeToSpaces = (context, { spaceKeys = [] }) => {
251
- return new import_codec_protobuf4.Stream(({ next }) => {
262
+ return new import_codec_protobuf5.Stream(({ next }) => {
252
263
  let unsubscribe;
253
264
  const update = async () => {
254
265
  const spaces = [
@@ -292,7 +303,7 @@ var DevtoolsServiceImpl = class {
292
303
  this.params = params;
293
304
  }
294
305
  events(request) {
295
- return new import_codec_protobuf5.Stream(({ next }) => {
306
+ return new import_codec_protobuf6.Stream(({ next }) => {
296
307
  this.params.events.ready.on(() => {
297
308
  next({
298
309
  ready: {}
@@ -384,6 +395,11 @@ var DevtoolsServiceImpl = class {
384
395
  networkManager: this.params.context.networkManager
385
396
  });
386
397
  }
398
+ subscribeToMetadata() {
399
+ return subscribeToMetadata({
400
+ context: this.params.context
401
+ });
402
+ }
387
403
  };
388
404
 
389
405
  // packages/sdk/client-services/src/packlets/identity/authenticator.ts
@@ -907,7 +923,7 @@ var IdentityManager = class {
907
923
 
908
924
  // packages/sdk/client-services/src/packlets/identity/identity-service.ts
909
925
  var import_node_assert3 = __toESM(require("node:assert"));
910
- var import_codec_protobuf6 = require("@dxos/codec-protobuf");
926
+ var import_codec_protobuf7 = require("@dxos/codec-protobuf");
911
927
  var import_credentials6 = require("@dxos/credentials");
912
928
  var import_debug2 = require("@dxos/debug");
913
929
  var IdentityServiceImpl = class {
@@ -923,7 +939,7 @@ var IdentityServiceImpl = class {
923
939
  return (0, import_debug2.todo)();
924
940
  }
925
941
  queryIdentity() {
926
- return new import_codec_protobuf6.Stream(({ next }) => {
942
+ return new import_codec_protobuf7.Stream(({ next }) => {
927
943
  const emitNext = () => next({
928
944
  identity: this._getIdentity()
929
945
  });
@@ -1855,7 +1871,7 @@ var InvitationsHandler = class {
1855
1871
  // packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
1856
1872
  var import_node_assert7 = __toESM(require("node:assert"));
1857
1873
  var import_async9 = require("@dxos/async");
1858
- var import_codec_protobuf7 = require("@dxos/codec-protobuf");
1874
+ var import_codec_protobuf8 = require("@dxos/codec-protobuf");
1859
1875
  var import_log6 = require("@dxos/log");
1860
1876
  var import_services4 = require("@dxos/protocols/proto/dxos/client/services");
1861
1877
  var InvitationsServiceImpl = class {
@@ -1884,7 +1900,7 @@ var InvitationsServiceImpl = class {
1884
1900
  this._createInvitations.set(invitation.get().invitationId, invitation);
1885
1901
  this._invitationCreated.emit(invitation.get());
1886
1902
  }
1887
- return new import_codec_protobuf7.Stream(({ next, close }) => {
1903
+ return new import_codec_protobuf8.Stream(({ next, close }) => {
1888
1904
  invitation.subscribe((invitation2) => {
1889
1905
  next(invitation2);
1890
1906
  }, (err) => {
@@ -1906,7 +1922,7 @@ var InvitationsServiceImpl = class {
1906
1922
  this._acceptInvitations.set(invitation.get().invitationId, invitation);
1907
1923
  this._invitationAccepted.emit(invitation.get());
1908
1924
  }
1909
- return new import_codec_protobuf7.Stream(({ next, close }) => {
1925
+ return new import_codec_protobuf8.Stream(({ next, close }) => {
1910
1926
  invitation.subscribe((invitation2) => {
1911
1927
  next(invitation2);
1912
1928
  }, (err) => {
@@ -1969,7 +1985,7 @@ var InvitationsServiceImpl = class {
1969
1985
  }
1970
1986
  }
1971
1987
  queryInvitations() {
1972
- return new import_codec_protobuf7.Stream(({ next, ctx }) => {
1988
+ return new import_codec_protobuf8.Stream(({ next, ctx }) => {
1973
1989
  this._invitationCreated.on(ctx, (invitation) => {
1974
1990
  next({
1975
1991
  action: import_services4.QueryInvitationsResponse.Action.ADDED,
@@ -2124,7 +2140,7 @@ var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
2124
2140
 
2125
2141
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
2126
2142
  var import_async10 = require("@dxos/async");
2127
- var import_codec_protobuf8 = require("@dxos/codec-protobuf");
2143
+ var import_codec_protobuf9 = require("@dxos/codec-protobuf");
2128
2144
  var import_services6 = require("@dxos/protocols/proto/dxos/client/services");
2129
2145
  var DevicesServiceImpl = class {
2130
2146
  constructor(_identityManager) {
@@ -2134,7 +2150,7 @@ var DevicesServiceImpl = class {
2134
2150
  throw new Error("Method not implemented.");
2135
2151
  }
2136
2152
  queryDevices() {
2137
- return new import_codec_protobuf8.Stream(({ next }) => {
2153
+ return new import_codec_protobuf9.Stream(({ next }) => {
2138
2154
  const update = () => {
2139
2155
  var _a;
2140
2156
  const deviceKeys = (_a = this._identityManager.identity) == null ? void 0 : _a.authorizedDeviceKeys;
@@ -2171,7 +2187,7 @@ var DevicesServiceImpl = class {
2171
2187
 
2172
2188
  // packages/sdk/client-services/src/packlets/logging/logging-service.ts
2173
2189
  var import_async11 = require("@dxos/async");
2174
- var import_codec_protobuf9 = require("@dxos/codec-protobuf");
2190
+ var import_codec_protobuf10 = require("@dxos/codec-protobuf");
2175
2191
  var import_log8 = require("@dxos/log");
2176
2192
  var import_util3 = require("@dxos/util");
2177
2193
  var LoggingServiceImpl = class {
@@ -2191,7 +2207,7 @@ var LoggingServiceImpl = class {
2191
2207
  queryLogs(request) {
2192
2208
  var _a;
2193
2209
  const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
2194
- return new import_codec_protobuf9.Stream(({ ctx, next }) => {
2210
+ return new import_codec_protobuf10.Stream(({ ctx, next }) => {
2195
2211
  const handler = (entry2) => {
2196
2212
  var _a2, _b, _c;
2197
2213
  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"))) {
@@ -2216,14 +2232,14 @@ var LoggingServiceImpl = class {
2216
2232
  };
2217
2233
 
2218
2234
  // packages/sdk/client-services/src/packlets/network/network-service.ts
2219
- var import_codec_protobuf10 = require("@dxos/codec-protobuf");
2235
+ var import_codec_protobuf11 = require("@dxos/codec-protobuf");
2220
2236
  var NetworkServiceImpl = class {
2221
2237
  constructor(networkManager, signalManager) {
2222
2238
  this.networkManager = networkManager;
2223
2239
  this.signalManager = signalManager;
2224
2240
  }
2225
2241
  queryStatus() {
2226
- return new import_codec_protobuf10.Stream(({ next }) => {
2242
+ return new import_codec_protobuf11.Stream(({ next }) => {
2227
2243
  const update = () => {
2228
2244
  next({
2229
2245
  swarm: this.networkManager.connectionState,
@@ -2284,6 +2300,7 @@ var import_util4 = require("@dxos/util");
2284
2300
  var DEFAULT_RETRY_TIMEOUT = 1e3;
2285
2301
  var DEFAULT_SUCCESS_DELAY = 1e3;
2286
2302
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
2303
+ var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
2287
2304
  var NotarizationPlugin = class {
2288
2305
  constructor() {
2289
2306
  this._ctx = new import_context5.Context();
@@ -2305,7 +2322,7 @@ var NotarizationPlugin = class {
2305
2322
  credentials
2306
2323
  }, {
2307
2324
  file: "notarization-plugin.ts",
2308
- line: 85,
2325
+ line: 87,
2309
2326
  scope: this,
2310
2327
  callSite: (f, a) => f(...a)
2311
2328
  });
@@ -2317,7 +2334,7 @@ var NotarizationPlugin = class {
2317
2334
  err
2318
2335
  }, {
2319
2336
  file: "notarization-plugin.ts",
2320
- line: 94,
2337
+ line: 96,
2321
2338
  scope: this,
2322
2339
  callSite: (f, a) => f(...a)
2323
2340
  });
@@ -2333,7 +2350,7 @@ var NotarizationPlugin = class {
2333
2350
  peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
2334
2351
  }, {
2335
2352
  file: "notarization-plugin.ts",
2336
- line: 106,
2353
+ line: 108,
2337
2354
  scope: this,
2338
2355
  callSite: (f, a) => f(...a)
2339
2356
  });
@@ -2356,7 +2373,7 @@ var NotarizationPlugin = class {
2356
2373
  retryIn: retryTimeout
2357
2374
  }, {
2358
2375
  file: "notarization-plugin.ts",
2359
- line: 131,
2376
+ line: 133,
2360
2377
  scope: this,
2361
2378
  callSite: (f, a) => f(...a)
2362
2379
  });
@@ -2370,7 +2387,7 @@ var NotarizationPlugin = class {
2370
2387
  credentialId: credentials.map((credential) => credential.id)
2371
2388
  }, {
2372
2389
  file: "notarization-plugin.ts",
2373
- line: 138,
2390
+ line: 140,
2374
2391
  scope: this,
2375
2392
  callSite: (f, a) => f(...a)
2376
2393
  });
@@ -2379,18 +2396,20 @@ var NotarizationPlugin = class {
2379
2396
  });
2380
2397
  (0, import_log9.log)("success", {}, {
2381
2398
  file: "notarization-plugin.ts",
2382
- line: 142,
2399
+ line: 144,
2383
2400
  scope: this,
2384
2401
  callSite: (f, a) => f(...a)
2385
2402
  });
2386
2403
  await (0, import_async12.sleep)(successDelay);
2387
2404
  } catch (err) {
2388
- import_log9.log.warn("error notarizing (recoverable)", err, {
2389
- file: "notarization-plugin.ts",
2390
- line: 145,
2391
- scope: this,
2392
- callSite: (f, a) => f(...a)
2393
- });
2405
+ if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
2406
+ import_log9.log.warn("error notarizing (recoverable)", err, {
2407
+ file: "notarization-plugin.ts",
2408
+ line: 148,
2409
+ scope: this,
2410
+ callSite: (f, a) => f(...a)
2411
+ });
2412
+ }
2394
2413
  notarizeTask.schedule();
2395
2414
  }
2396
2415
  });
@@ -2404,7 +2423,7 @@ var NotarizationPlugin = class {
2404
2423
  ]);
2405
2424
  (0, import_log9.log)("done", {}, {
2406
2425
  file: "notarization-plugin.ts",
2407
- line: 155,
2426
+ line: 159,
2408
2427
  scope: this,
2409
2428
  callSite: (f, a) => f(...a)
2410
2429
  });
@@ -2440,7 +2459,7 @@ var NotarizationPlugin = class {
2440
2459
  async _onNotarize(request) {
2441
2460
  var _a;
2442
2461
  if (!this._writer) {
2443
- throw new Error("Writer not set");
2462
+ throw new Error(WRITER_NOT_SET_ERROR_CODE);
2444
2463
  }
2445
2464
  for (const credential of (_a = request.credentials) != null ? _a : []) {
2446
2465
  (0, import_node_assert9.default)(credential.id, "Credential must have an id");
@@ -2457,7 +2476,7 @@ var NotarizationPlugin = class {
2457
2476
  peer: extension.localPeerId
2458
2477
  }, {
2459
2478
  file: "notarization-plugin.ts",
2460
- line: 204,
2479
+ line: 208,
2461
2480
  scope: this,
2462
2481
  callSite: (f, a) => f(...a)
2463
2482
  });
@@ -2469,7 +2488,7 @@ var NotarizationPlugin = class {
2469
2488
  peer: extension.localPeerId
2470
2489
  }, {
2471
2490
  file: "notarization-plugin.ts",
2472
- line: 209,
2491
+ line: 213,
2473
2492
  scope: this,
2474
2493
  callSite: (f, a) => f(...a)
2475
2494
  });
@@ -3104,7 +3123,7 @@ DataSpaceManager = __decorate2([
3104
3123
 
3105
3124
  // packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
3106
3125
  var import_async15 = require("@dxos/async");
3107
- var import_codec_protobuf11 = require("@dxos/codec-protobuf");
3126
+ var import_codec_protobuf12 = require("@dxos/codec-protobuf");
3108
3127
  var import_debug5 = require("@dxos/debug");
3109
3128
  var import_echo_pipeline2 = require("@dxos/echo-pipeline");
3110
3129
  var import_log12 = require("@dxos/log");
@@ -3131,7 +3150,7 @@ var SpacesServiceImpl = class {
3131
3150
  (0, import_debug5.todo)();
3132
3151
  }
3133
3152
  querySpaces() {
3134
- return new import_codec_protobuf11.Stream(({ next, ctx }) => {
3153
+ return new import_codec_protobuf12.Stream(({ next, ctx }) => {
3135
3154
  const onUpdate = async () => {
3136
3155
  const dataSpaceManager = await this._getDataSpaceManager();
3137
3156
  const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._transformSpace(space));
@@ -3139,7 +3158,7 @@ var SpacesServiceImpl = class {
3139
3158
  spaces
3140
3159
  }, {
3141
3160
  file: "spaces-service.ts",
3142
- line: 62,
3161
+ line: 59,
3143
3162
  scope: this,
3144
3163
  callSite: (f, a) => f(...a)
3145
3164
  });
@@ -3183,7 +3202,7 @@ var SpacesServiceImpl = class {
3183
3202
  await space.postMessage(getChannelId(channel), message);
3184
3203
  }
3185
3204
  subscribeMessages({ spaceKey, channel }) {
3186
- return new import_codec_protobuf11.Stream(({ ctx, next }) => {
3205
+ return new import_codec_protobuf12.Stream(({ ctx, next }) => {
3187
3206
  (0, import_async15.scheduleTask)(ctx, async () => {
3188
3207
  var _a;
3189
3208
  const dataSpaceManager = await this._getDataSpaceManager();
@@ -3196,7 +3215,7 @@ var SpacesServiceImpl = class {
3196
3215
  });
3197
3216
  }
3198
3217
  queryCredentials({ spaceKey }) {
3199
- return new import_codec_protobuf11.Stream(({ ctx, next }) => {
3218
+ return new import_codec_protobuf12.Stream(({ ctx, next }) => {
3200
3219
  var _a;
3201
3220
  const space = (_a = this._spaceManager.spaces.get(spaceKey)) != null ? _a : (0, import_debug5.raise)(new import_echo_pipeline2.SpaceNotFoundError(spaceKey));
3202
3221
  const processor = space.spaceState.registerProcessor({
@@ -3308,7 +3327,7 @@ var toStorageType = (type) => {
3308
3327
  };
3309
3328
 
3310
3329
  // packages/sdk/client-services/src/packlets/system/system-service.ts
3311
- var import_codec_protobuf12 = require("@dxos/codec-protobuf");
3330
+ var import_codec_protobuf13 = require("@dxos/codec-protobuf");
3312
3331
  var SystemServiceImpl = class {
3313
3332
  constructor({ config, statusUpdate, onUpdateStatus, getCurrentStatus, onReset }) {
3314
3333
  this._config = config;
@@ -3325,7 +3344,7 @@ var SystemServiceImpl = class {
3325
3344
  await this._onUpdateStatus(status);
3326
3345
  }
3327
3346
  queryStatus() {
3328
- return new import_codec_protobuf12.Stream(({ next }) => {
3347
+ return new import_codec_protobuf13.Stream(({ next }) => {
3329
3348
  const update = () => {
3330
3349
  next({
3331
3350
  status: this._getCurrentStatus()
@@ -3354,7 +3373,7 @@ var import_network_manager2 = require("@dxos/network-manager");
3354
3373
  var import_util8 = require("@dxos/util");
3355
3374
 
3356
3375
  // packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
3357
- var import_codec_protobuf13 = require("@dxos/codec-protobuf");
3376
+ var import_codec_protobuf14 = require("@dxos/codec-protobuf");
3358
3377
  var import_debug6 = require("@dxos/debug");
3359
3378
  var import_rpc = require("@dxos/rpc");
3360
3379
  var ClientRpcServer = class {
@@ -3379,7 +3398,7 @@ var ClientRpcServer = class {
3379
3398
  const [serviceName, methodName] = (0, import_rpc.parseMethodName)(method);
3380
3399
  const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
3381
3400
  if (this._handleStream) {
3382
- return import_codec_protobuf13.Stream.unwrapPromise(this._handleStream(methodName, params2, handler));
3401
+ return import_codec_protobuf14.Stream.unwrapPromise(this._handleStream(methodName, params2, handler));
3383
3402
  } else {
3384
3403
  return handler(methodName, params2);
3385
3404
  }
@@ -3728,28 +3747,28 @@ var VaultResourceLock = class {
3728
3747
  try {
3729
3748
  (0, import_log15.log)("aquiring lock...", {}, {
3730
3749
  file: "vault-resource-lock.ts",
3731
- line: 45,
3750
+ line: 46,
3732
3751
  scope: this,
3733
3752
  callSite: (f, a) => f(...a)
3734
3753
  });
3735
3754
  await (0, import_async19.asyncTimeout)(this._requestLock(), import_client_protocol7.RESOURCE_LOCK_TIMEOUT);
3736
3755
  (0, import_log15.log)("acquired lock", {}, {
3737
3756
  file: "vault-resource-lock.ts",
3738
- line: 47,
3757
+ line: 48,
3739
3758
  scope: this,
3740
3759
  callSite: (f, a) => f(...a)
3741
3760
  });
3742
3761
  } catch (e) {
3743
3762
  (0, import_log15.log)("stealing lock...", {}, {
3744
3763
  file: "vault-resource-lock.ts",
3745
- line: 49,
3764
+ line: 50,
3746
3765
  scope: this,
3747
3766
  callSite: (f, a) => f(...a)
3748
3767
  });
3749
3768
  await this._requestLock(true);
3750
3769
  (0, import_log15.log)("stolen lock", {}, {
3751
3770
  file: "vault-resource-lock.ts",
3752
- line: 51,
3771
+ line: 52,
3753
3772
  scope: this,
3754
3773
  callSite: (f, a) => f(...a)
3755
3774
  });
@@ -3768,7 +3787,7 @@ var VaultResourceLock = class {
3768
3787
  steal
3769
3788
  }, {
3770
3789
  file: "vault-resource-lock.ts",
3771
- line: 66,
3790
+ line: 67,
3772
3791
  scope: this,
3773
3792
  callSite: (f, a) => f(...a)
3774
3793
  });
@@ -3783,14 +3802,14 @@ var VaultResourceLock = class {
3783
3802
  await this._releaseTrigger.wait();
3784
3803
  (0, import_log15.log)("releasing lock...", {}, {
3785
3804
  file: "vault-resource-lock.ts",
3786
- line: 75,
3805
+ line: 76,
3787
3806
  scope: this,
3788
3807
  callSite: (f, a) => f(...a)
3789
3808
  });
3790
3809
  await ((_b = this._onRelease) == null ? void 0 : _b.call(this));
3791
3810
  (0, import_log15.log)("released lock", {}, {
3792
3811
  file: "vault-resource-lock.ts",
3793
- line: 77,
3812
+ line: 78,
3794
3813
  scope: this,
3795
3814
  callSite: (f, a) => f(...a)
3796
3815
  });
@@ -3803,7 +3822,7 @@ var VaultResourceLock = class {
3803
3822
  steal
3804
3823
  }, {
3805
3824
  file: "vault-resource-lock.ts",
3806
- line: 84,
3825
+ line: 85,
3807
3826
  scope: this,
3808
3827
  callSite: (f, a) => f(...a)
3809
3828
  });
@@ -4191,16 +4210,7 @@ var ServiceContext = class {
4191
4210
  async _checkStorageVersion() {
4192
4211
  await this.metadataStore.load();
4193
4212
  if (this.metadataStore.version !== import_protocols8.STORAGE_VERSION) {
4194
- import_log18.log.error("Invalid storage version", {
4195
- current: this.metadataStore.version,
4196
- expected: import_protocols8.STORAGE_VERSION
4197
- }, {
4198
- file: "service-context.ts",
4199
- line: 171,
4200
- scope: this,
4201
- callSite: (f, a) => f(...a)
4202
- });
4203
- await this.metadataStore.clear();
4213
+ throw new Error(`Invalid storage version: current=${this.metadataStore.version}, expected=${import_protocols8.STORAGE_VERSION}`);
4204
4214
  }
4205
4215
  }
4206
4216
  // Called when identity is created.
@@ -4208,7 +4218,7 @@ var ServiceContext = class {
4208
4218
  var _a;
4209
4219
  (0, import_log18.log)("initializing spaces...", {}, {
4210
4220
  file: "service-context.ts",
4211
- line: 179,
4221
+ line: 178,
4212
4222
  scope: this,
4213
4223
  callSite: (f, a) => f(...a)
4214
4224
  });
@@ -4247,7 +4257,7 @@ var ServiceContext = class {
4247
4257
  details: assertion
4248
4258
  }, {
4249
4259
  file: "service-context.ts",
4250
- line: 218,
4260
+ line: 217,
4251
4261
  scope: this,
4252
4262
  callSite: (f, a) => f(...a)
4253
4263
  });
@@ -4258,7 +4268,7 @@ var ServiceContext = class {
4258
4268
  details: assertion
4259
4269
  }, {
4260
4270
  file: "service-context.ts",
4261
- line: 222,
4271
+ line: 221,
4262
4272
  scope: this,
4263
4273
  callSite: (f, a) => f(...a)
4264
4274
  });
@@ -4269,7 +4279,7 @@ var ServiceContext = class {
4269
4279
  details: assertion
4270
4280
  }, {
4271
4281
  file: "service-context.ts",
4272
- line: 227,
4282
+ line: 226,
4273
4283
  scope: this,
4274
4284
  callSite: (f, a) => f(...a)
4275
4285
  });
@@ -4280,7 +4290,7 @@ var ServiceContext = class {
4280
4290
  } catch (err) {
4281
4291
  import_log18.log.catch(err, {}, {
4282
4292
  file: "service-context.ts",
4283
- line: 233,
4293
+ line: 232,
4284
4294
  scope: this,
4285
4295
  callSite: (f, a) => f(...a)
4286
4296
  });