@dxos/client-services 0.1.25-next.3c6b542 → 0.1.26

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 (70) hide show
  1. package/dist/lib/browser/{chunk-WF53R6F7.mjs → chunk-R2FEBB66.mjs} +95 -325
  2. package/dist/lib/browser/chunk-R2FEBB66.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -11
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/packlets/testing/index.mjs +3 -3
  6. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  7. package/dist/lib/node/index.cjs +111 -350
  8. package/dist/lib/node/index.cjs.map +4 -4
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/packlets/testing/index.cjs +110 -228
  11. package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
  12. package/dist/types/src/packlets/identity/authenticator.d.ts +1 -1
  13. package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
  14. package/dist/types/src/packlets/identity/identity-manager.d.ts +1 -1
  15. package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
  16. package/dist/types/src/packlets/identity/identity.d.ts +2 -2
  17. package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
  18. package/dist/types/src/packlets/invitations/space-invitations-handler.d.ts +1 -1
  19. package/dist/types/src/packlets/invitations/space-invitations-handler.d.ts.map +1 -1
  20. package/dist/types/src/packlets/services/service-context.d.ts +1 -1
  21. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  22. package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -1
  23. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  24. package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
  25. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  26. package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
  27. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  28. package/dist/types/src/packlets/testing/test-builder.d.ts +1 -1
  29. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  30. package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +4 -11
  31. package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
  32. package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts +1 -6
  33. package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts.map +1 -1
  34. package/dist/types/src/packlets/vault/index.d.ts +0 -2
  35. package/dist/types/src/packlets/vault/index.d.ts.map +1 -1
  36. package/dist/types/src/packlets/vault/services.d.ts +1 -9
  37. package/dist/types/src/packlets/vault/services.d.ts.map +1 -1
  38. package/dist/types/src/packlets/vault/worker-runtime.d.ts +1 -2
  39. package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
  40. package/dist/types/src/packlets/vault/worker-session.d.ts +1 -4
  41. package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
  42. package/package.json +28 -29
  43. package/src/packlets/devtools/spaces.ts +1 -1
  44. package/src/packlets/identity/authenticator.ts +1 -1
  45. package/src/packlets/identity/identity-manager.test.ts +1 -1
  46. package/src/packlets/identity/identity-manager.ts +1 -1
  47. package/src/packlets/identity/identity.test.ts +1 -1
  48. package/src/packlets/identity/identity.ts +1 -1
  49. package/src/packlets/invitations/space-invitations-handler.test.ts +1 -1
  50. package/src/packlets/invitations/space-invitations-handler.ts +1 -1
  51. package/src/packlets/services/service-context.ts +2 -2
  52. package/src/packlets/services/service-host.ts +1 -1
  53. package/src/packlets/spaces/data-space-manager.test.ts +1 -1
  54. package/src/packlets/spaces/data-space-manager.ts +4 -4
  55. package/src/packlets/spaces/data-space.ts +3 -3
  56. package/src/packlets/spaces/spaces-service.ts +1 -1
  57. package/src/packlets/testing/test-builder.ts +3 -3
  58. package/src/packlets/vault/iframe-host-runtime.ts +7 -26
  59. package/src/packlets/vault/iframe-proxy-runtime.ts +1 -16
  60. package/src/packlets/vault/index.ts +0 -2
  61. package/src/packlets/vault/services.ts +1 -17
  62. package/src/packlets/vault/worker-runtime.ts +1 -3
  63. package/src/packlets/vault/worker-session.ts +19 -29
  64. package/dist/lib/browser/chunk-WF53R6F7.mjs.map +0 -7
  65. package/dist/types/src/packlets/vault/shell-controller.d.ts +0 -24
  66. package/dist/types/src/packlets/vault/shell-controller.d.ts.map +0 -1
  67. package/dist/types/src/packlets/vault/shell-runtime.d.ts +0 -45
  68. package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +0 -1
  69. package/src/packlets/vault/shell-controller.ts +0 -78
  70. package/src/packlets/vault/shell-runtime.ts +0 -133
@@ -2184,7 +2184,7 @@ var SpaceInvitationsServiceImpl = class extends AbstractInvitationsService {
2184
2184
  import { Trigger as Trigger5 } from "@dxos/async";
2185
2185
  import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
2186
2186
  import { failUndefined as failUndefined2 } from "@dxos/debug";
2187
- import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore } from "@dxos/echo-pipeline";
2187
+ import { valueEncoding, DataServiceSubscriptions, MetadataStore, SpaceManager, SnapshotStore } from "@dxos/echo-db";
2188
2188
  import { FeedFactory, FeedStore } from "@dxos/feed-store";
2189
2189
  import { Keyring } from "@dxos/keyring";
2190
2190
  import { log as log11 } from "@dxos/log";
@@ -2194,7 +2194,7 @@ import assert12 from "@dxos/node-std/assert";
2194
2194
  import { Event as Event4, synchronized, trackLeaks as trackLeaks2 } from "@dxos/async";
2195
2195
  import { Context as Context7 } from "@dxos/context";
2196
2196
  import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
2197
- import { spaceGenesis, SnapshotManager } from "@dxos/echo-pipeline";
2197
+ import { spaceGenesis, SnapshotManager } from "@dxos/echo-db";
2198
2198
  import { PublicKey as PublicKey7 } from "@dxos/keys";
2199
2199
  import { log as log10 } from "@dxos/log";
2200
2200
  import { Presence } from "@dxos/teleport-extension-presence";
@@ -2204,7 +2204,7 @@ import { ComplexMap as ComplexMap3, deferFunction as deferFunction2 } from "@dxo
2204
2204
  import { trackLeaks } from "@dxos/async";
2205
2205
  import { Context as Context6 } from "@dxos/context";
2206
2206
  import { timed } from "@dxos/debug";
2207
- import { DataPipelineControllerImpl, createMappedFeedWriter } from "@dxos/echo-pipeline";
2207
+ import { DataPipelineControllerImpl, createMappedFeedWriter } from "@dxos/echo-db";
2208
2208
  import { PublicKey as PublicKey6 } from "@dxos/keys";
2209
2209
  import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
2210
2210
  import { ComplexSet as ComplexSet2 } from "@dxos/util";
@@ -3013,133 +3013,18 @@ var toStorageType = (type) => {
3013
3013
  }
3014
3014
  };
3015
3015
 
3016
- // packages/sdk/client-services/src/packlets/vault/services.ts
3017
- import { schema as schema7 } from "@dxos/protocols";
3018
- var iframeServiceBundle = {
3019
- IframeService: schema7.getService("dxos.iframe.IframeService"),
3020
- BridgeService: schema7.getService("dxos.mesh.bridge.BridgeService")
3021
- };
3022
- var workerServiceBundle = {
3023
- WorkerService: schema7.getService("dxos.iframe.WorkerService")
3024
- };
3025
- var appServiceBundle = {
3026
- AppService: schema7.getService("dxos.iframe.AppService")
3027
- };
3028
- var shellServiceBundle = {
3029
- ShellService: schema7.getService("dxos.iframe.ShellService")
3030
- };
3031
-
3032
- // packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
3033
- import assert13 from "@dxos/node-std/assert";
3034
- import { Event as Event5 } from "@dxos/async";
3035
- import { ShellLayout } from "@dxos/protocols/proto/dxos/iframe";
3036
- import { createProtoRpcPeer } from "@dxos/rpc";
3037
- var ShellRuntimeImpl = class {
3038
- constructor(_port) {
3039
- this._port = _port;
3040
- this.layoutUpdate = new Event5();
3041
- this._layout = ShellLayout.DEFAULT;
3042
- }
3043
- get layout() {
3044
- return this._layout;
3045
- }
3046
- get invitationCode() {
3047
- return this._invitationCode;
3048
- }
3049
- get spaceKey() {
3050
- return this._spaceKey;
3051
- }
3052
- setLayout(layout, options = {}) {
3053
- this._layout = layout;
3054
- this._invitationCode = options.invitationCode;
3055
- this._spaceKey = options.spaceKey;
3056
- this.layoutUpdate.emit({
3057
- layout,
3058
- ...options
3059
- });
3060
- }
3061
- async setAppContext(context) {
3062
- assert13(this._appRpc, "runtime not open");
3063
- if (context.spaceKey) {
3064
- this._spaceKey = context.spaceKey;
3065
- }
3066
- if (context.invitationCode) {
3067
- this._invitationCode = context.invitationCode;
3068
- }
3069
- await this._appRpc.rpc.AppService.setContext({
3070
- ...context,
3071
- spaceKey: this._spaceKey,
3072
- invitationCode: this._invitationCode
3073
- });
3074
- }
3075
- async open() {
3076
- this._appRpc = createProtoRpcPeer({
3077
- requested: appServiceBundle,
3078
- exposed: shellServiceBundle,
3079
- handlers: {
3080
- ShellService: {
3081
- setLayout: async (request) => {
3082
- this._layout = request.layout;
3083
- this._invitationCode = request.invitationCode;
3084
- this._spaceKey = request.spaceKey;
3085
- this.layoutUpdate.emit(request);
3086
- }
3087
- }
3088
- },
3089
- port: this._port
3090
- });
3091
- await this._appRpc.open();
3092
- }
3093
- async close() {
3094
- var _a;
3095
- await ((_a = this._appRpc) == null ? void 0 : _a.close());
3096
- this._appRpc = void 0;
3097
- }
3098
- };
3099
- var MemoryShellRuntime = class {
3100
- constructor({ layout, invitationCode, spaceKey } = {}) {
3101
- this.layoutUpdate = new Event5();
3102
- this.contextUpdate = new Event5();
3103
- this._layout = layout != null ? layout : ShellLayout.DEFAULT;
3104
- this._invitationCode = invitationCode;
3105
- this._spaceKey = spaceKey;
3106
- }
3107
- get layout() {
3108
- return this._layout;
3109
- }
3110
- get invitationCode() {
3111
- return this._invitationCode;
3112
- }
3113
- get spaceKey() {
3114
- return this._spaceKey;
3115
- }
3116
- setLayout(layout, options = {}) {
3117
- this._layout = layout;
3118
- this._invitationCode = options.invitationCode;
3119
- this._spaceKey = options.spaceKey;
3120
- this.layoutUpdate.emit({
3121
- layout,
3122
- ...options
3123
- });
3124
- }
3125
- async setAppContext(context) {
3126
- this.contextUpdate.emit(context);
3127
- }
3128
- };
3129
-
3130
3016
  // packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
3131
3017
  import { Trigger as Trigger9 } from "@dxos/async";
3132
- import { log as log17, logInfo as logInfo2 } from "@dxos/log";
3018
+ import { log as log16, logInfo as logInfo2 } from "@dxos/log";
3133
3019
  import { MemorySignalManager as MemorySignalManager2, MemorySignalManagerContext as MemorySignalManagerContext2, WebsocketSignalManager as WebsocketSignalManager2 } from "@dxos/messaging";
3134
3020
  import { createWebRTCTransportFactory, NetworkManager as NetworkManager2 } from "@dxos/network-manager";
3135
- import { createProtoRpcPeer as createProtoRpcPeer6 } from "@dxos/rpc";
3136
- import { getAsyncValue } from "@dxos/util";
3021
+ import { createProtoRpcPeer as createProtoRpcPeer4 } from "@dxos/rpc";
3137
3022
 
3138
3023
  // packages/sdk/client-services/src/packlets/services/service-host.ts
3139
3024
  import { raise as raise2 } from "@dxos/debug";
3140
3025
  import { DocumentModel } from "@dxos/document-model";
3141
- import { DataServiceImpl } from "@dxos/echo-pipeline";
3142
- import { log as log16 } from "@dxos/log";
3026
+ import { DataServiceImpl } from "@dxos/echo-db";
3027
+ import { log as log15 } from "@dxos/log";
3143
3028
  import { ModelFactory } from "@dxos/model-factory";
3144
3029
  import { Status } from "@dxos/protocols/proto/dxos/client";
3145
3030
  import { TextModel } from "@dxos/text-model";
@@ -3212,7 +3097,7 @@ var NetworkServiceImpl = class {
3212
3097
  import { scheduleTask as scheduleTask4 } from "@dxos/async";
3213
3098
  import { Stream as Stream11 } from "@dxos/codec-protobuf";
3214
3099
  import { raise } from "@dxos/debug";
3215
- import { SpaceNotFoundError } from "@dxos/echo-pipeline";
3100
+ import { SpaceNotFoundError } from "@dxos/echo-db";
3216
3101
  var SpacesServiceImpl = class {
3217
3102
  constructor(_spaceManager) {
3218
3103
  this._spaceManager = _spaceManager;
@@ -3254,15 +3139,26 @@ var SpacesServiceImpl = class {
3254
3139
 
3255
3140
  // packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
3256
3141
  import { WebRTCTransportService } from "@dxos/network-manager";
3257
- import { createProtoRpcPeer as createProtoRpcPeer2 } from "@dxos/rpc";
3142
+ import { createProtoRpcPeer } from "@dxos/rpc";
3143
+
3144
+ // packages/sdk/client-services/src/packlets/vault/services.ts
3145
+ import { schema as schema7 } from "@dxos/protocols";
3146
+ var iframeServiceBundle = {
3147
+ IframeService: schema7.getService("dxos.iframe.IframeService"),
3148
+ BridgeService: schema7.getService("dxos.mesh.bridge.BridgeService")
3149
+ };
3150
+ var workerServiceBundle = {
3151
+ WorkerService: schema7.getService("dxos.iframe.WorkerService")
3152
+ };
3153
+
3154
+ // packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
3258
3155
  var IFrameProxyRuntime = class {
3259
- constructor({ systemPort, workerAppPort, windowAppPort, shellPort }) {
3156
+ constructor({ systemPort, workerAppPort, windowAppPort }) {
3260
3157
  this._transportService = new WebRTCTransportService();
3261
3158
  this._systemPort = systemPort;
3262
3159
  this._windowAppPort = windowAppPort;
3263
3160
  this._workerAppPort = workerAppPort;
3264
- this._shellPort = shellPort;
3265
- this._systemRpc = createProtoRpcPeer2({
3161
+ this._systemRpc = createProtoRpcPeer({
3266
3162
  requested: workerServiceBundle,
3267
3163
  exposed: iframeServiceBundle,
3268
3164
  handlers: {
@@ -3277,109 +3173,22 @@ var IFrameProxyRuntime = class {
3277
3173
  });
3278
3174
  this._workerAppPort.subscribe((msg) => this._windowAppPort.send(msg));
3279
3175
  this._windowAppPort.subscribe((msg) => this._workerAppPort.send(msg));
3280
- if (this._shellPort) {
3281
- this._shellRuntime = new ShellRuntimeImpl(this._shellPort);
3282
- }
3283
- }
3284
- get shell() {
3285
- return this._shellRuntime;
3286
3176
  }
3287
3177
  async open(origin) {
3288
- var _a;
3289
3178
  await this._systemRpc.open();
3290
3179
  await this._systemRpc.rpc.WorkerService.start({
3291
3180
  origin
3292
3181
  });
3293
- await ((_a = this._shellRuntime) == null ? void 0 : _a.open());
3294
3182
  }
3295
3183
  async close() {
3296
- var _a;
3297
- await ((_a = this._shellRuntime) == null ? void 0 : _a.close());
3298
3184
  await this._systemRpc.rpc.WorkerService.stop();
3299
3185
  await this._systemRpc.close();
3300
3186
  }
3301
3187
  };
3302
3188
 
3303
- // packages/sdk/client-services/src/packlets/vault/shell-controller.ts
3304
- import { Event as Event6 } from "@dxos/async";
3305
- import { log as log12 } from "@dxos/log";
3306
- import { ShellDisplay } from "@dxos/protocols/proto/dxos/iframe";
3307
- import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
3308
- var ShellController = class {
3309
- constructor(_port) {
3310
- this._port = _port;
3311
- this.contextUpdate = new Event6();
3312
- this._display = ShellDisplay.NONE;
3313
- }
3314
- get display() {
3315
- return this._display;
3316
- }
3317
- get spaceKey() {
3318
- return this._spaceKey;
3319
- }
3320
- setSpace(key) {
3321
- this._spaceKey = key;
3322
- this._emitUpdate();
3323
- }
3324
- async setLayout(layout, options = {}) {
3325
- var _a;
3326
- log12("set layout", {
3327
- layout,
3328
- ...options
3329
- }, {
3330
- file: "shell-controller.ts",
3331
- line: 39,
3332
- scope: this,
3333
- callSite: (f, a) => f(...a)
3334
- });
3335
- this._display = ShellDisplay.FULLSCREEN;
3336
- this._emitUpdate();
3337
- await ((_a = this._shellRpc) == null ? void 0 : _a.rpc.ShellService.setLayout({
3338
- layout,
3339
- ...options
3340
- }));
3341
- }
3342
- async open() {
3343
- this._shellRpc = createProtoRpcPeer3({
3344
- requested: shellServiceBundle,
3345
- exposed: appServiceBundle,
3346
- handlers: {
3347
- AppService: {
3348
- setContext: async (request) => {
3349
- log12("set context", request, {
3350
- file: "shell-controller.ts",
3351
- line: 52,
3352
- scope: this,
3353
- callSite: (f, a) => f(...a)
3354
- });
3355
- this._display = request.display;
3356
- this._spaceKey = request.spaceKey;
3357
- this._invitationCode = request.invitationCode;
3358
- this.contextUpdate.emit(request);
3359
- }
3360
- }
3361
- },
3362
- port: this._port
3363
- });
3364
- await this._shellRpc.open();
3365
- }
3366
- async close() {
3367
- var _a;
3368
- await ((_a = this._shellRpc) == null ? void 0 : _a.close());
3369
- this._shellRpc = void 0;
3370
- }
3371
- _emitUpdate() {
3372
- this.contextUpdate.emit({
3373
- display: this._display,
3374
- spaceKey: this._spaceKey,
3375
- invitationCode: this._invitationCode
3376
- });
3377
- }
3378
- };
3379
-
3380
3189
  // packages/sdk/client-services/src/packlets/vault/vault-resource-lock.ts
3381
3190
  import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
3382
- import { log as log13 } from "@dxos/log";
3191
+ import { log as log12 } from "@dxos/log";
3383
3192
  var Message;
3384
3193
  (function(Message2) {
3385
3194
  Message2["ACQUIRING"] = "acquiring";
@@ -3412,7 +3221,7 @@ var VaultResourceLock = class {
3412
3221
  }
3413
3222
  }
3414
3223
  async _requestLock(steal = false) {
3415
- log13("requesting lock...", {
3224
+ log12("requesting lock...", {
3416
3225
  steal
3417
3226
  }, {
3418
3227
  file: "vault-resource-lock.ts",
@@ -3429,14 +3238,14 @@ var VaultResourceLock = class {
3429
3238
  acquired.wake();
3430
3239
  this._releaseTrigger = new Trigger6();
3431
3240
  await this._releaseTrigger.wait();
3432
- log13("releasing lock...", {}, {
3241
+ log12("releasing lock...", {}, {
3433
3242
  file: "vault-resource-lock.ts",
3434
3243
  line: 65,
3435
3244
  scope: this,
3436
3245
  callSite: (f, a) => f(...a)
3437
3246
  });
3438
3247
  await ((_b = this._onRelease) == null ? void 0 : _b.call(this));
3439
- log13("released lock", {}, {
3248
+ log12("released lock", {}, {
3440
3249
  file: "vault-resource-lock.ts",
3441
3250
  line: 67,
3442
3251
  scope: this,
@@ -3447,7 +3256,7 @@ var VaultResourceLock = class {
3447
3256
  await ((_a = this._onRelease) == null ? void 0 : _a.call(this));
3448
3257
  });
3449
3258
  await acquired.wait();
3450
- log13("recieved lock", {
3259
+ log12("recieved lock", {
3451
3260
  steal
3452
3261
  }, {
3453
3262
  file: "vault-resource-lock.ts",
@@ -3460,15 +3269,15 @@ var VaultResourceLock = class {
3460
3269
 
3461
3270
  // packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
3462
3271
  import { Trigger as Trigger8 } from "@dxos/async";
3463
- import { log as log15 } from "@dxos/log";
3272
+ import { log as log14 } from "@dxos/log";
3464
3273
  import { MemorySignalManager, MemorySignalManagerContext, WebsocketSignalManager } from "@dxos/messaging";
3465
3274
  import { NetworkManager, WebRTCTransportProxyFactory } from "@dxos/network-manager";
3466
3275
 
3467
3276
  // packages/sdk/client-services/src/packlets/vault/worker-session.ts
3468
- import assert14 from "@dxos/node-std/assert";
3469
- import { asyncTimeout as asyncTimeout2, Trigger as Trigger7 } from "@dxos/async";
3470
- import { log as log14, logInfo } from "@dxos/log";
3471
- import { createProtoRpcPeer as createProtoRpcPeer4 } from "@dxos/rpc";
3277
+ import assert13 from "@dxos/node-std/assert";
3278
+ import { Trigger as Trigger7 } from "@dxos/async";
3279
+ import { log as log13, logInfo } from "@dxos/log";
3280
+ import { createProtoRpcPeer as createProtoRpcPeer2 } from "@dxos/rpc";
3472
3281
  import { Callback } from "@dxos/util";
3473
3282
  var __decorate3 = function(decorators, target, key, desc) {
3474
3283
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -3481,39 +3290,33 @@ var __decorate3 = function(decorators, target, key, desc) {
3481
3290
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3482
3291
  };
3483
3292
  var WorkerSession = class {
3484
- constructor({ getService, systemPort, appPort, shellPort, options = {
3293
+ constructor({ getService, systemPort, appPort, options = {
3485
3294
  heartbeatInterval: 1e3
3486
3295
  } }) {
3487
3296
  this._startTrigger = new Trigger7();
3488
3297
  this.onClose = new Callback();
3489
- assert14(options);
3490
- assert14(getService);
3298
+ assert13(options);
3299
+ assert13(getService);
3491
3300
  this._options = options;
3492
3301
  this._getService = getService;
3493
- const handlers = {
3494
- DataService: async () => await this._getService((services) => services.DataService),
3495
- DevicesService: async () => await this._getService((services) => services.DevicesService),
3496
- DevtoolsHost: async () => await this._getService((services) => services.DevtoolsHost),
3497
- HaloInvitationsService: async () => await this._getService((services) => services.HaloInvitationsService),
3498
- NetworkService: async () => await this._getService((services) => services.NetworkService),
3499
- ProfileService: async () => await this._getService((services) => services.ProfileService),
3500
- SpaceInvitationsService: async () => await this._getService((services) => services.SpaceInvitationsService),
3501
- SpaceService: async () => await this._getService((services) => services.SpaceService),
3502
- SpacesService: async () => await this._getService((services) => services.SpacesService),
3503
- SystemService: async () => await this._getService((services) => services.SystemService),
3504
- TracingService: async () => await this._getService((services) => services.TracingService)
3505
- };
3506
- this._clientRpc = createProtoRpcPeer4({
3302
+ this._clientRpc = createProtoRpcPeer2({
3507
3303
  exposed: clientServiceBundle,
3508
- handlers,
3304
+ handlers: {
3305
+ DataService: async () => await this._getService((services) => services.DataService),
3306
+ DevicesService: async () => await this._getService((services) => services.DevicesService),
3307
+ DevtoolsHost: async () => await this._getService((services) => services.DevtoolsHost),
3308
+ HaloInvitationsService: async () => await this._getService((services) => services.HaloInvitationsService),
3309
+ NetworkService: async () => await this._getService((services) => services.NetworkService),
3310
+ ProfileService: async () => await this._getService((services) => services.ProfileService),
3311
+ SpaceInvitationsService: async () => await this._getService((services) => services.SpaceInvitationsService),
3312
+ SpaceService: async () => await this._getService((services) => services.SpaceService),
3313
+ SpacesService: async () => await this._getService((services) => services.SpacesService),
3314
+ SystemService: async () => await this._getService((services) => services.SystemService),
3315
+ TracingService: async () => await this._getService((services) => services.TracingService)
3316
+ },
3509
3317
  port: appPort
3510
3318
  });
3511
- this._shellClientRpc = createProtoRpcPeer4({
3512
- exposed: clientServiceBundle,
3513
- handlers,
3514
- port: shellPort
3515
- });
3516
- this._iframeRpc = createProtoRpcPeer4({
3319
+ this._iframeRpc = createProtoRpcPeer2({
3517
3320
  requested: iframeServiceBundle,
3518
3321
  exposed: workerServiceBundle,
3519
3322
  handlers: {
@@ -3527,9 +3330,9 @@ var WorkerSession = class {
3527
3330
  try {
3528
3331
  await this.close();
3529
3332
  } catch (err) {
3530
- log14.catch(err, {}, {
3333
+ log13.catch(err, {}, {
3531
3334
  file: "worker-session.ts",
3532
- line: 92,
3335
+ line: 90,
3533
3336
  scope: this,
3534
3337
  callSite: (f, a) => f(...a)
3535
3338
  });
@@ -3545,16 +3348,15 @@ var WorkerSession = class {
3545
3348
  this.bridgeService = this._iframeRpc.rpc.BridgeService;
3546
3349
  }
3547
3350
  async open() {
3548
- log14.info("opening..", {}, {
3351
+ log13.info("opening..", {}, {
3549
3352
  file: "worker-session.ts",
3550
- line: 106,
3353
+ line: 104,
3551
3354
  scope: this,
3552
3355
  callSite: (f, a) => f(...a)
3553
3356
  });
3554
3357
  await Promise.all([
3555
3358
  this._clientRpc.open(),
3556
- this._iframeRpc.open(),
3557
- this._maybeOpenShell()
3359
+ this._iframeRpc.open()
3558
3360
  ]);
3559
3361
  await this._startTrigger.wait({
3560
3362
  timeout: 3e3
@@ -3563,20 +3365,20 @@ var WorkerSession = class {
3563
3365
  try {
3564
3366
  await this._iframeRpc.rpc.IframeService.heartbeat();
3565
3367
  } catch (err1) {
3566
- log14.warn("Heartbeat failed", {
3368
+ log13.warn("Heartbeat failed", {
3567
3369
  err: err1
3568
3370
  }, {
3569
3371
  file: "worker-session.ts",
3570
- line: 118,
3372
+ line: 116,
3571
3373
  scope: this,
3572
3374
  callSite: (f, a) => f(...a)
3573
3375
  });
3574
3376
  try {
3575
3377
  await this.close();
3576
3378
  } catch (err) {
3577
- log14.catch(err, {}, {
3379
+ log13.catch(err, {}, {
3578
3380
  file: "worker-session.ts",
3579
- line: 122,
3381
+ line: 120,
3580
3382
  scope: this,
3581
3383
  callSite: (f, a) => f(...a)
3582
3384
  });
@@ -3585,18 +3387,18 @@ var WorkerSession = class {
3585
3387
  }, this._options.heartbeatInterval);
3586
3388
  }
3587
3389
  async close() {
3588
- log14.info("closing..", {}, {
3390
+ log13.info("closing..", {}, {
3589
3391
  file: "worker-session.ts",
3590
- line: 129,
3392
+ line: 127,
3591
3393
  scope: this,
3592
3394
  callSite: (f, a) => f(...a)
3593
3395
  });
3594
3396
  try {
3595
3397
  await this.onClose.callIfSet();
3596
3398
  } catch (err) {
3597
- log14.catch(err, {}, {
3399
+ log13.catch(err, {}, {
3598
3400
  file: "worker-session.ts",
3599
- line: 133,
3401
+ line: 131,
3600
3402
  scope: this,
3601
3403
  callSite: (f, a) => f(...a)
3602
3404
  });
@@ -3609,18 +3411,6 @@ var WorkerSession = class {
3609
3411
  this._iframeRpc.close()
3610
3412
  ]);
3611
3413
  }
3612
- async _maybeOpenShell() {
3613
- try {
3614
- await asyncTimeout2(this._shellClientRpc.open(), 1e3);
3615
- } catch (e) {
3616
- log14.info("No shell connected.", {}, {
3617
- file: "worker-session.ts",
3618
- line: 147,
3619
- scope: this,
3620
- callSite: (f, a) => f(...a)
3621
- });
3622
- }
3623
- }
3624
3414
  };
3625
3415
  __decorate3([
3626
3416
  logInfo
@@ -3636,9 +3426,9 @@ var WorkerRuntime = class {
3636
3426
  this.sessions = /* @__PURE__ */ new Set();
3637
3427
  }
3638
3428
  async start() {
3639
- log15("starting...", {}, {
3429
+ log14("starting...", {}, {
3640
3430
  file: "worker-runtime.ts",
3641
- line: 42,
3431
+ line: 41,
3642
3432
  scope: this,
3643
3433
  callSite: (f, a) => f(...a)
3644
3434
  });
@@ -3657,17 +3447,17 @@ var WorkerRuntime = class {
3657
3447
  });
3658
3448
  await this._clientServices.open();
3659
3449
  this._ready.wake(void 0);
3660
- log15("started", {}, {
3450
+ log14("started", {}, {
3661
3451
  file: "worker-runtime.ts",
3662
- line: 59,
3452
+ line: 58,
3663
3453
  scope: this,
3664
3454
  callSite: (f, a) => f(...a)
3665
3455
  });
3666
3456
  } catch (err) {
3667
3457
  this._ready.wake(err);
3668
- log15.catch(err, {}, {
3458
+ log14.catch(err, {}, {
3669
3459
  file: "worker-runtime.ts",
3670
- line: 62,
3460
+ line: 61,
3671
3461
  scope: this,
3672
3462
  callSite: (f, a) => f(...a)
3673
3463
  });
@@ -3679,7 +3469,7 @@ var WorkerRuntime = class {
3679
3469
  /**
3680
3470
  * Create a new session.
3681
3471
  */
3682
- async createSession({ appPort, systemPort, shellPort }) {
3472
+ async createSession({ appPort, systemPort }) {
3683
3473
  const session = new WorkerSession({
3684
3474
  getService: async (find) => {
3685
3475
  const error = await this._ready.wait();
@@ -3694,7 +3484,6 @@ var WorkerRuntime = class {
3694
3484
  },
3695
3485
  appPort,
3696
3486
  systemPort,
3697
- shellPort,
3698
3487
  readySignal: this._ready
3699
3488
  });
3700
3489
  session.onClose.set(async () => {
@@ -3806,7 +3595,7 @@ var ClientServicesHost = class {
3806
3595
  if (this._open) {
3807
3596
  return;
3808
3597
  }
3809
- log16("opening...", {}, {
3598
+ log15("opening...", {}, {
3810
3599
  file: "service-host.ts",
3811
3600
  line: 125,
3812
3601
  scope: this,
@@ -3842,7 +3631,7 @@ var ClientServicesHost = class {
3842
3631
  await this._serviceContext.open();
3843
3632
  this._open = true;
3844
3633
  const deviceKey = (_a = this._serviceContext.identityManager.identity) == null ? void 0 : _a.deviceKey;
3845
- log16("opened", {
3634
+ log15("opened", {
3846
3635
  deviceKey
3847
3636
  }, {
3848
3637
  file: "service-host.ts",
@@ -3857,7 +3646,7 @@ var ClientServicesHost = class {
3857
3646
  return;
3858
3647
  }
3859
3648
  const deviceKey = (_a = this._serviceContext.identityManager.identity) == null ? void 0 : _a.deviceKey;
3860
- log16("closing...", {
3649
+ log15("closing...", {
3861
3650
  deviceKey
3862
3651
  }, {
3863
3652
  file: "service-host.ts",
@@ -3870,7 +3659,7 @@ var ClientServicesHost = class {
3870
3659
  });
3871
3660
  await this._serviceContext.close();
3872
3661
  this._open = false;
3873
- log16("closed", {
3662
+ log15("closed", {
3874
3663
  deviceKey
3875
3664
  }, {
3876
3665
  file: "service-host.ts",
@@ -3882,14 +3671,14 @@ var ClientServicesHost = class {
3882
3671
  };
3883
3672
 
3884
3673
  // packages/sdk/client-services/src/packlets/services/service-proxy.ts
3885
- import { asyncTimeout as asyncTimeout3 } from "@dxos/async";
3674
+ import { asyncTimeout as asyncTimeout2 } from "@dxos/async";
3886
3675
  import { RemoteServiceConnectionTimeout } from "@dxos/errors";
3887
- import { createProtoRpcPeer as createProtoRpcPeer5 } from "@dxos/rpc";
3676
+ import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
3888
3677
  var ClientServicesProxy = class {
3889
3678
  // prettier-ignore
3890
3679
  constructor(port, _timeout = 3e4) {
3891
3680
  this._timeout = _timeout;
3892
- this._proxy = createProtoRpcPeer5({
3681
+ this._proxy = createProtoRpcPeer3({
3893
3682
  requested: clientServiceBundle,
3894
3683
  exposed: {},
3895
3684
  handlers: {},
@@ -3906,7 +3695,7 @@ var ClientServicesProxy = class {
3906
3695
  return this._proxy.rpc;
3907
3696
  }
3908
3697
  async open() {
3909
- await asyncTimeout3(this._proxy.open(), this._timeout, new RemoteServiceConnectionTimeout());
3698
+ await asyncTimeout2(this._proxy.open(), this._timeout, new RemoteServiceConnectionTimeout());
3910
3699
  }
3911
3700
  async close() {
3912
3701
  await this._proxy.close();
@@ -3926,12 +3715,11 @@ var __decorate4 = function(decorators, target, key, desc) {
3926
3715
  };
3927
3716
  var LOCK_KEY = "DXOS_RESOURCE_LOCK";
3928
3717
  var IFrameHostRuntime = class {
3929
- constructor({ configProvider, appPort, shellPort }) {
3718
+ constructor({ configProvider, appPort }) {
3930
3719
  this._transportFactory = createWebRTCTransportFactory();
3931
3720
  this._ready = new Trigger9();
3932
3721
  this._configProvider = configProvider;
3933
3722
  this._appPort = appPort;
3934
- this._shellPort = shellPort;
3935
3723
  this._getService = async (find) => {
3936
3724
  const error = await this._ready.wait();
3937
3725
  if (error) {
@@ -3943,26 +3731,16 @@ var IFrameHostRuntime = class {
3943
3731
  }
3944
3732
  return service;
3945
3733
  };
3946
- if (this._shellPort) {
3947
- this._shellRuntime = new ShellRuntimeImpl(this._shellPort);
3948
- }
3949
- }
3950
- get services() {
3951
- return this._clientServices;
3952
- }
3953
- get shell() {
3954
- return this._shellRuntime;
3955
3734
  }
3956
3735
  async start() {
3957
- var _a;
3958
- log17("starting...", {}, {
3736
+ log16("starting...", {}, {
3959
3737
  file: "iframe-host-runtime.ts",
3960
- line: 81,
3738
+ line: 63,
3961
3739
  scope: this,
3962
3740
  callSite: (f, a) => f(...a)
3963
3741
  });
3964
3742
  try {
3965
- this._config = await getAsyncValue(this._configProvider);
3743
+ this._config = await this._configProvider();
3966
3744
  const signalServer = this._config.get("runtime.services.signal.server");
3967
3745
  this._clientServices = new ClientServicesHost({
3968
3746
  lockKey: LOCK_KEY,
@@ -3975,7 +3753,7 @@ var IFrameHostRuntime = class {
3975
3753
  transportFactory: this._transportFactory
3976
3754
  })
3977
3755
  });
3978
- this._clientRpc = createProtoRpcPeer6({
3756
+ this._clientRpc = createProtoRpcPeer4({
3979
3757
  exposed: clientServiceBundle,
3980
3758
  handlers: {
3981
3759
  DataService: async () => await this._getService((services) => services.DataService),
@@ -3994,40 +3772,37 @@ var IFrameHostRuntime = class {
3994
3772
  });
3995
3773
  await Promise.all([
3996
3774
  this._clientServices.open(),
3997
- this._clientRpc.open(),
3998
- (_a = this._shellRuntime) == null ? void 0 : _a.open()
3775
+ this._clientRpc.open()
3999
3776
  ]);
4000
3777
  this._ready.wake(void 0);
4001
- log17("started", {}, {
3778
+ log16("started", {}, {
4002
3779
  file: "iframe-host-runtime.ts",
4003
- line: 117,
3780
+ line: 99,
4004
3781
  scope: this,
4005
3782
  callSite: (f, a) => f(...a)
4006
3783
  });
4007
3784
  } catch (err) {
4008
3785
  this._ready.wake(err);
4009
- log17.catch(err, {}, {
3786
+ log16.catch(err, {}, {
4010
3787
  file: "iframe-host-runtime.ts",
4011
- line: 120,
3788
+ line: 102,
4012
3789
  scope: this,
4013
3790
  callSite: (f, a) => f(...a)
4014
3791
  });
4015
3792
  }
4016
3793
  }
4017
3794
  async stop() {
4018
- var _a;
4019
- log17("stopping...", {}, {
3795
+ log16("stopping...", {}, {
4020
3796
  file: "iframe-host-runtime.ts",
4021
- line: 125,
3797
+ line: 107,
4022
3798
  scope: this,
4023
3799
  callSite: (f, a) => f(...a)
4024
3800
  });
4025
3801
  await this._clientRpc.close();
4026
3802
  await this._clientServices.close();
4027
- await ((_a = this._shellRuntime) == null ? void 0 : _a.close());
4028
- log17("stopped", {}, {
3803
+ log16("stopped", {}, {
4029
3804
  file: "iframe-host-runtime.ts",
4030
- line: 129,
3805
+ line: 110,
4031
3806
  scope: this,
4032
3807
  callSite: (f, a) => f(...a)
4033
3808
  });
@@ -4075,15 +3850,10 @@ export {
4075
3850
  ServiceContext,
4076
3851
  clientServiceBundle,
4077
3852
  createStorageObjects,
3853
+ IFrameHostRuntime,
4078
3854
  iframeServiceBundle,
4079
3855
  workerServiceBundle,
4080
- appServiceBundle,
4081
- shellServiceBundle,
4082
- ShellRuntimeImpl,
4083
- MemoryShellRuntime,
4084
- IFrameHostRuntime,
4085
3856
  IFrameProxyRuntime,
4086
- ShellController,
4087
3857
  VaultResourceLock,
4088
3858
  WorkerSession,
4089
3859
  WorkerRuntime,
@@ -4092,4 +3862,4 @@ export {
4092
3862
  ClientServicesHost,
4093
3863
  ClientServicesProxy
4094
3864
  };
4095
- //# sourceMappingURL=chunk-WF53R6F7.mjs.map
3865
+ //# sourceMappingURL=chunk-R2FEBB66.mjs.map