@dxos/client-services 0.1.53 → 0.1.54-main.270ec56
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.
- package/dist/lib/browser/{chunk-6ITWCQIT.mjs → chunk-F4BHRFH4.mjs} +861 -702
- package/dist/lib/browser/chunk-F4BHRFH4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +115 -173
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +24 -7
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +951 -853
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +832 -708
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/index.d.ts +1 -0
- package/dist/types/src/packlets/services/index.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +7 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +11 -2
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +2 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +7 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts +1 -1
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +1 -21
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/package.json +33 -32
- package/src/packlets/identity/authenticator.ts +4 -2
- package/src/packlets/identity/identity-manager.test.ts +1 -1
- package/src/packlets/identity/identity-manager.ts +8 -8
- package/src/packlets/identity/identity-service.ts +2 -2
- package/src/packlets/identity/identity.test.ts +1 -1
- package/src/packlets/identity/identity.ts +22 -27
- package/src/packlets/invitations/device-invitation-protocol.ts +4 -4
- package/src/packlets/invitations/invitation-extension.ts +5 -5
- package/src/packlets/invitations/invitations-handler.ts +6 -6
- package/src/packlets/invitations/invitations-service.ts +3 -3
- package/src/packlets/invitations/space-invitation-protocol.ts +9 -9
- package/src/packlets/locks/node.ts +2 -2
- package/src/packlets/logging/logging-service.ts +4 -4
- package/src/packlets/services/index.ts +1 -0
- package/src/packlets/services/service-context.test.ts +1 -1
- package/src/packlets/services/service-context.ts +12 -10
- package/src/packlets/services/service-host.test.ts +50 -2
- package/src/packlets/services/service-host.ts +25 -9
- package/src/packlets/spaces/data-space-manager.test.ts +75 -119
- package/src/packlets/spaces/data-space-manager.ts +18 -9
- package/src/packlets/spaces/data-space.ts +66 -20
- package/src/packlets/spaces/notarization-plugin.test.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.ts +9 -5
- package/src/packlets/spaces/spaces-service.test.ts +5 -3
- package/src/packlets/spaces/spaces-service.ts +26 -8
- package/src/packlets/testing/invitation-utils.ts +2 -2
- package/src/packlets/testing/test-builder.ts +36 -4
- package/src/packlets/vault/iframe-host-runtime.ts +2 -2
- package/src/packlets/vault/iframe-proxy-runtime.ts +2 -2
- package/src/packlets/vault/shell-runtime.ts +3 -49
- package/src/packlets/vault/worker-runtime.ts +1 -1
- package/src/packlets/vault/worker-session.ts +7 -6
- package/dist/lib/browser/chunk-6ITWCQIT.mjs.map +0 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "@dxos/node-std/globals"
|
|
1
|
+
import "@dxos/node-std/globals";
|
|
2
2
|
import {
|
|
3
|
+
ClientRpcServer,
|
|
3
4
|
ClientServicesHost,
|
|
4
5
|
DataSpace,
|
|
5
6
|
DataSpaceManager,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
SpacesServiceImpl,
|
|
19
20
|
TrustedKeySetAuthVerifier,
|
|
20
21
|
createAuthProvider,
|
|
22
|
+
createDefaultModelFactory,
|
|
21
23
|
createStorageObjects,
|
|
22
24
|
getNetworkPeers,
|
|
23
25
|
isLocked,
|
|
@@ -28,7 +30,7 @@ import {
|
|
|
28
30
|
subscribeToSignal,
|
|
29
31
|
subscribeToSpaces,
|
|
30
32
|
subscribeToSwarmInfo
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-F4BHRFH4.mjs";
|
|
32
34
|
|
|
33
35
|
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
34
36
|
import { Trigger } from "@dxos/async";
|
|
@@ -38,61 +40,8 @@ import { MemorySignalManager, MemorySignalManagerContext, WebsocketSignalManager
|
|
|
38
40
|
import { createWebRTCTransportFactory } from "@dxos/network-manager";
|
|
39
41
|
import { getAsyncValue } from "@dxos/util";
|
|
40
42
|
|
|
41
|
-
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
42
|
-
import { Stream } from "@dxos/codec-protobuf";
|
|
43
|
-
import { raise } from "@dxos/debug";
|
|
44
|
-
import { parseMethodName, RpcPeer } from "@dxos/rpc";
|
|
45
|
-
var ClientRpcServer = class {
|
|
46
|
-
constructor(params) {
|
|
47
|
-
this._handlerCache = /* @__PURE__ */ new Map();
|
|
48
|
-
const { serviceRegistry, handleCall, handleStream, ...rpcOptions } = params;
|
|
49
|
-
this._handleCall = handleCall;
|
|
50
|
-
this._handleStream = handleStream;
|
|
51
|
-
this._serviceRegistry = serviceRegistry;
|
|
52
|
-
this._rpcPeer = new RpcPeer({
|
|
53
|
-
...rpcOptions,
|
|
54
|
-
callHandler: (method, params2) => {
|
|
55
|
-
const [serviceName, methodName] = parseMethodName(method);
|
|
56
|
-
const handler = (method2, params3) => this._getServiceHandler(serviceName).call(method2, params3);
|
|
57
|
-
if (this._handleCall) {
|
|
58
|
-
return this._handleCall(methodName, params2, handler);
|
|
59
|
-
} else {
|
|
60
|
-
return handler(methodName, params2);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
streamHandler: (method, params2) => {
|
|
64
|
-
const [serviceName, methodName] = parseMethodName(method);
|
|
65
|
-
const handler = (method2, params3) => this._getServiceHandler(serviceName).callStream(method2, params3);
|
|
66
|
-
if (this._handleStream) {
|
|
67
|
-
return Stream.unwrapPromise(this._handleStream(methodName, params2, handler));
|
|
68
|
-
} else {
|
|
69
|
-
return handler(methodName, params2);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
async open() {
|
|
75
|
-
await this._rpcPeer.open();
|
|
76
|
-
}
|
|
77
|
-
async close() {
|
|
78
|
-
await this._rpcPeer.close();
|
|
79
|
-
}
|
|
80
|
-
_getServiceHandler(serviceName) {
|
|
81
|
-
var _a;
|
|
82
|
-
if (!this._handlerCache.has(serviceName)) {
|
|
83
|
-
const [key, descriptor] = (_a = Object.entries(this._serviceRegistry.descriptors).find(([key2, descriptor2]) => descriptor2.name === serviceName)) != null ? _a : raise(new Error(`Service not available: ${serviceName}`));
|
|
84
|
-
const service = this._serviceRegistry.services[key];
|
|
85
|
-
if (!service) {
|
|
86
|
-
throw new Error(`Service not available: ${serviceName}`);
|
|
87
|
-
}
|
|
88
|
-
this._handlerCache.set(serviceName, descriptor.createServer(service));
|
|
89
|
-
}
|
|
90
|
-
return this._handlerCache.get(serviceName);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
43
|
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
95
|
-
import
|
|
44
|
+
import invariant from "tiny-invariant";
|
|
96
45
|
import { Event } from "@dxos/async";
|
|
97
46
|
import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
|
|
98
47
|
import { ShellLayout } from "@dxos/protocols/proto/dxos/iframe";
|
|
@@ -122,7 +71,7 @@ var ShellRuntimeImpl = class {
|
|
|
122
71
|
});
|
|
123
72
|
}
|
|
124
73
|
async setAppContext(context) {
|
|
125
|
-
|
|
74
|
+
invariant(this._appRpc, "runtime not open");
|
|
126
75
|
await this._appRpc.rpc.AppService.setContext(context);
|
|
127
76
|
}
|
|
128
77
|
async open() {
|
|
@@ -149,39 +98,9 @@ var ShellRuntimeImpl = class {
|
|
|
149
98
|
this._appRpc = void 0;
|
|
150
99
|
}
|
|
151
100
|
};
|
|
152
|
-
var MemoryShellRuntime = class {
|
|
153
|
-
constructor({ layout, invitationCode, spaceKey } = {}) {
|
|
154
|
-
this.layoutUpdate = new Event();
|
|
155
|
-
this.contextUpdate = new Event();
|
|
156
|
-
this._layout = layout != null ? layout : ShellLayout.DEFAULT;
|
|
157
|
-
this._invitationCode = invitationCode;
|
|
158
|
-
this._spaceKey = spaceKey;
|
|
159
|
-
}
|
|
160
|
-
get layout() {
|
|
161
|
-
return this._layout;
|
|
162
|
-
}
|
|
163
|
-
get invitationCode() {
|
|
164
|
-
return this._invitationCode;
|
|
165
|
-
}
|
|
166
|
-
get spaceKey() {
|
|
167
|
-
return this._spaceKey;
|
|
168
|
-
}
|
|
169
|
-
setLayout(layout, options = {}) {
|
|
170
|
-
this._layout = layout;
|
|
171
|
-
this._invitationCode = options.invitationCode;
|
|
172
|
-
this._spaceKey = options.spaceKey;
|
|
173
|
-
this.layoutUpdate.emit({
|
|
174
|
-
layout,
|
|
175
|
-
...options
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
async setAppContext(context) {
|
|
179
|
-
this.contextUpdate.emit(context);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
101
|
|
|
183
102
|
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
184
|
-
|
|
103
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
185
104
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
186
105
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
187
106
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -190,7 +109,8 @@ var __decorate = function(decorators, target, key, desc) {
|
|
|
190
109
|
if (d = decorators[i])
|
|
191
110
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
192
111
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
193
|
-
}
|
|
112
|
+
}
|
|
113
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts";
|
|
194
114
|
var LOCK_KEY = "DXOS_RESOURCE_LOCK";
|
|
195
115
|
var IFrameHostRuntime = class {
|
|
196
116
|
constructor({ config, origin, appPort, shellPort }) {
|
|
@@ -211,11 +131,11 @@ var IFrameHostRuntime = class {
|
|
|
211
131
|
}
|
|
212
132
|
async start() {
|
|
213
133
|
var _a;
|
|
214
|
-
log("starting...",
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
134
|
+
log("starting...", void 0, {
|
|
135
|
+
F: __dxlog_file,
|
|
136
|
+
L: 70,
|
|
137
|
+
S: this,
|
|
138
|
+
C: (f, a) => f(...a)
|
|
219
139
|
});
|
|
220
140
|
try {
|
|
221
141
|
this._config = await getAsyncValue(this._configProvider);
|
|
@@ -260,42 +180,42 @@ var IFrameHostRuntime = class {
|
|
|
260
180
|
(_a = this._shellRuntime) == null ? void 0 : _a.open()
|
|
261
181
|
]);
|
|
262
182
|
this._ready.wake(void 0);
|
|
263
|
-
log("started",
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
183
|
+
log("started", void 0, {
|
|
184
|
+
F: __dxlog_file,
|
|
185
|
+
L: 113,
|
|
186
|
+
S: this,
|
|
187
|
+
C: (f, a) => f(...a)
|
|
268
188
|
});
|
|
269
189
|
} catch (err) {
|
|
270
190
|
this._ready.wake(err);
|
|
271
|
-
log.catch(err,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
191
|
+
log.catch(err, void 0, {
|
|
192
|
+
F: __dxlog_file,
|
|
193
|
+
L: 116,
|
|
194
|
+
S: this,
|
|
195
|
+
C: (f, a) => f(...a)
|
|
276
196
|
});
|
|
277
197
|
}
|
|
278
198
|
}
|
|
279
199
|
async stop() {
|
|
280
200
|
var _a;
|
|
281
|
-
log("stopping...",
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
201
|
+
log("stopping...", void 0, {
|
|
202
|
+
F: __dxlog_file,
|
|
203
|
+
L: 121,
|
|
204
|
+
S: this,
|
|
205
|
+
C: (f, a) => f(...a)
|
|
286
206
|
});
|
|
287
207
|
await this._clientRpc.close();
|
|
288
208
|
await this._clientServices.close();
|
|
289
209
|
await ((_a = this._shellRuntime) == null ? void 0 : _a.close());
|
|
290
|
-
log("stopped",
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
210
|
+
log("stopped", void 0, {
|
|
211
|
+
F: __dxlog_file,
|
|
212
|
+
L: 125,
|
|
213
|
+
S: this,
|
|
214
|
+
C: (f, a) => f(...a)
|
|
295
215
|
});
|
|
296
216
|
}
|
|
297
217
|
};
|
|
298
|
-
|
|
218
|
+
_ts_decorate([
|
|
299
219
|
logInfo
|
|
300
220
|
], IFrameHostRuntime.prototype, "origin", void 0);
|
|
301
221
|
|
|
@@ -307,6 +227,7 @@ import { log as log2 } from "@dxos/log";
|
|
|
307
227
|
import { WebRTCTransportService } from "@dxos/network-manager";
|
|
308
228
|
import { createProtoRpcPeer as createProtoRpcPeer2 } from "@dxos/rpc";
|
|
309
229
|
import { getAsyncValue as getAsyncValue2 } from "@dxos/util";
|
|
230
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts";
|
|
310
231
|
var IFrameProxyRuntime = class {
|
|
311
232
|
constructor({ config, systemPort, shellPort }) {
|
|
312
233
|
this._id = String(Math.floor(Math.random() * 1e6));
|
|
@@ -354,11 +275,11 @@ var IFrameProxyRuntime = class {
|
|
|
354
275
|
lockKey
|
|
355
276
|
});
|
|
356
277
|
} catch (err) {
|
|
357
|
-
log2.catch(err,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
278
|
+
log2.catch(err, void 0, {
|
|
279
|
+
F: __dxlog_file2,
|
|
280
|
+
L: 85,
|
|
281
|
+
S: this,
|
|
282
|
+
C: (f, a) => f(...a)
|
|
362
283
|
});
|
|
363
284
|
throw new RemoteServiceConnectionError("Failed to connect to worker");
|
|
364
285
|
}
|
|
@@ -383,13 +304,13 @@ import { MemorySignalManager as MemorySignalManager2, MemorySignalManagerContext
|
|
|
383
304
|
import { WebRTCTransportProxyFactory } from "@dxos/network-manager";
|
|
384
305
|
|
|
385
306
|
// packages/sdk/client-services/src/packlets/vault/worker-session.ts
|
|
386
|
-
import
|
|
307
|
+
import invariant2 from "tiny-invariant";
|
|
387
308
|
import { asyncTimeout, Trigger as Trigger3 } from "@dxos/async";
|
|
388
309
|
import { iframeServiceBundle as iframeServiceBundle2, PROXY_CONNECTION_TIMEOUT as PROXY_CONNECTION_TIMEOUT2, workerServiceBundle as workerServiceBundle2 } from "@dxos/client-protocol";
|
|
389
310
|
import { log as log3, logInfo as logInfo2 } from "@dxos/log";
|
|
390
311
|
import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
|
|
391
312
|
import { Callback } from "@dxos/util";
|
|
392
|
-
|
|
313
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
393
314
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
394
315
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
395
316
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -398,12 +319,13 @@ var __decorate2 = function(decorators, target, key, desc) {
|
|
|
398
319
|
if (d = decorators[i])
|
|
399
320
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
400
321
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
401
|
-
}
|
|
322
|
+
}
|
|
323
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-session.ts";
|
|
402
324
|
var WorkerSession = class {
|
|
403
325
|
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
404
326
|
this._startTrigger = new Trigger3();
|
|
405
327
|
this.onClose = new Callback();
|
|
406
|
-
|
|
328
|
+
invariant2(serviceHost);
|
|
407
329
|
this._serviceHost = serviceHost;
|
|
408
330
|
const middleware = {
|
|
409
331
|
handleCall: async (method, params, handler) => {
|
|
@@ -450,11 +372,11 @@ var WorkerSession = class {
|
|
|
450
372
|
try {
|
|
451
373
|
await this.close();
|
|
452
374
|
} catch (err) {
|
|
453
|
-
log3.catch(err,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
375
|
+
log3.catch(err, void 0, {
|
|
376
|
+
F: __dxlog_file3,
|
|
377
|
+
L: 99,
|
|
378
|
+
S: this,
|
|
379
|
+
C: (f, a) => f(...a)
|
|
458
380
|
});
|
|
459
381
|
}
|
|
460
382
|
});
|
|
@@ -467,11 +389,11 @@ var WorkerSession = class {
|
|
|
467
389
|
this.bridgeService = this._iframeRpc.rpc.BridgeService;
|
|
468
390
|
}
|
|
469
391
|
async open() {
|
|
470
|
-
log3.info("opening
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
392
|
+
log3.info("opening...", void 0, {
|
|
393
|
+
F: __dxlog_file3,
|
|
394
|
+
L: 113,
|
|
395
|
+
S: this,
|
|
396
|
+
C: (f, a) => f(...a)
|
|
475
397
|
});
|
|
476
398
|
await Promise.all([
|
|
477
399
|
this._clientRpc.open(),
|
|
@@ -484,38 +406,50 @@ var WorkerSession = class {
|
|
|
484
406
|
if (this.lockKey) {
|
|
485
407
|
void this._afterLockReleases(this.lockKey, () => this.close());
|
|
486
408
|
}
|
|
409
|
+
log3.info("opened", void 0, {
|
|
410
|
+
F: __dxlog_file3,
|
|
411
|
+
L: 120,
|
|
412
|
+
S: this,
|
|
413
|
+
C: (f, a) => f(...a)
|
|
414
|
+
});
|
|
487
415
|
}
|
|
488
416
|
async close() {
|
|
489
|
-
log3.info("closing
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
417
|
+
log3.info("closing...", void 0, {
|
|
418
|
+
F: __dxlog_file3,
|
|
419
|
+
L: 124,
|
|
420
|
+
S: this,
|
|
421
|
+
C: (f, a) => f(...a)
|
|
494
422
|
});
|
|
495
423
|
try {
|
|
496
424
|
await this.onClose.callIfSet();
|
|
497
425
|
} catch (err) {
|
|
498
|
-
log3.catch(err,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
426
|
+
log3.catch(err, void 0, {
|
|
427
|
+
F: __dxlog_file3,
|
|
428
|
+
L: 128,
|
|
429
|
+
S: this,
|
|
430
|
+
C: (f, a) => f(...a)
|
|
503
431
|
});
|
|
504
432
|
}
|
|
505
433
|
await Promise.all([
|
|
506
434
|
this._clientRpc.close(),
|
|
507
435
|
this._iframeRpc.close()
|
|
508
436
|
]);
|
|
437
|
+
log3.info("closed", void 0, {
|
|
438
|
+
F: __dxlog_file3,
|
|
439
|
+
L: 132,
|
|
440
|
+
S: this,
|
|
441
|
+
C: (f, a) => f(...a)
|
|
442
|
+
});
|
|
509
443
|
}
|
|
510
444
|
async _maybeOpenShell() {
|
|
511
445
|
try {
|
|
512
446
|
await asyncTimeout(this._shellClientRpc.open(), 1e3);
|
|
513
447
|
} catch (e) {
|
|
514
|
-
log3.info("No shell connected.",
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
448
|
+
log3.info("No shell connected.", void 0, {
|
|
449
|
+
F: __dxlog_file3,
|
|
450
|
+
L: 139,
|
|
451
|
+
S: this,
|
|
452
|
+
C: (f, a) => f(...a)
|
|
519
453
|
});
|
|
520
454
|
}
|
|
521
455
|
}
|
|
@@ -524,14 +458,15 @@ var WorkerSession = class {
|
|
|
524
458
|
}).then(callback);
|
|
525
459
|
}
|
|
526
460
|
};
|
|
527
|
-
|
|
461
|
+
_ts_decorate2([
|
|
528
462
|
logInfo2
|
|
529
463
|
], WorkerSession.prototype, "origin", void 0);
|
|
530
|
-
|
|
464
|
+
_ts_decorate2([
|
|
531
465
|
logInfo2
|
|
532
466
|
], WorkerSession.prototype, "lockKey", void 0);
|
|
533
467
|
|
|
534
468
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
469
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/worker-runtime.ts";
|
|
535
470
|
var WorkerRuntime = class {
|
|
536
471
|
// prettier-ignore
|
|
537
472
|
constructor(_configProvider) {
|
|
@@ -539,17 +474,23 @@ var WorkerRuntime = class {
|
|
|
539
474
|
this._transportFactory = new WebRTCTransportProxyFactory();
|
|
540
475
|
this._ready = new Trigger4();
|
|
541
476
|
this.sessions = /* @__PURE__ */ new Set();
|
|
542
|
-
this._clientServices = new ClientServicesHost(
|
|
477
|
+
this._clientServices = new ClientServicesHost({
|
|
478
|
+
callbacks: {
|
|
479
|
+
onReset: async () => {
|
|
480
|
+
self.close();
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
});
|
|
543
484
|
}
|
|
544
485
|
get host() {
|
|
545
486
|
return this._clientServices;
|
|
546
487
|
}
|
|
547
488
|
async start() {
|
|
548
|
-
log4("starting...",
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
489
|
+
log4("starting...", void 0, {
|
|
490
|
+
F: __dxlog_file4,
|
|
491
|
+
L: 48,
|
|
492
|
+
S: this,
|
|
493
|
+
C: (f, a) => f(...a)
|
|
553
494
|
});
|
|
554
495
|
try {
|
|
555
496
|
this._config = await this._configProvider();
|
|
@@ -561,19 +502,19 @@ var WorkerRuntime = class {
|
|
|
561
502
|
});
|
|
562
503
|
await this._clientServices.open();
|
|
563
504
|
this._ready.wake(void 0);
|
|
564
|
-
log4("started",
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
505
|
+
log4("started", void 0, {
|
|
506
|
+
F: __dxlog_file4,
|
|
507
|
+
L: 62,
|
|
508
|
+
S: this,
|
|
509
|
+
C: (f, a) => f(...a)
|
|
569
510
|
});
|
|
570
511
|
} catch (err) {
|
|
571
512
|
this._ready.wake(err);
|
|
572
|
-
log4.catch(err,
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
513
|
+
log4.catch(err, void 0, {
|
|
514
|
+
F: __dxlog_file4,
|
|
515
|
+
L: 65,
|
|
516
|
+
S: this,
|
|
517
|
+
C: (f, a) => f(...a)
|
|
577
518
|
});
|
|
578
519
|
}
|
|
579
520
|
}
|
|
@@ -603,11 +544,11 @@ var WorkerRuntime = class {
|
|
|
603
544
|
* Selects one of the existing session fro WebRTC networking.
|
|
604
545
|
*/
|
|
605
546
|
_reconnectWebrtc() {
|
|
606
|
-
log4("reconnecting webrtc...",
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
547
|
+
log4("reconnecting webrtc...", void 0, {
|
|
548
|
+
F: __dxlog_file4,
|
|
549
|
+
L: 102,
|
|
550
|
+
S: this,
|
|
551
|
+
C: (f, a) => f(...a)
|
|
611
552
|
});
|
|
612
553
|
if (this._sessionForNetworking) {
|
|
613
554
|
if (!this.sessions.has(this._sessionForNetworking)) {
|
|
@@ -626,6 +567,7 @@ var WorkerRuntime = class {
|
|
|
626
567
|
}
|
|
627
568
|
};
|
|
628
569
|
export {
|
|
570
|
+
ClientRpcServer,
|
|
629
571
|
ClientServicesHost,
|
|
630
572
|
DataSpace,
|
|
631
573
|
DataSpaceManager,
|
|
@@ -640,7 +582,6 @@ export {
|
|
|
640
582
|
InvitationsHandler,
|
|
641
583
|
InvitationsServiceImpl,
|
|
642
584
|
Lock,
|
|
643
|
-
MemoryShellRuntime,
|
|
644
585
|
ServiceContext,
|
|
645
586
|
ServiceRegistry,
|
|
646
587
|
ShellRuntimeImpl,
|
|
@@ -650,6 +591,7 @@ export {
|
|
|
650
591
|
WorkerRuntime,
|
|
651
592
|
WorkerSession,
|
|
652
593
|
createAuthProvider,
|
|
594
|
+
createDefaultModelFactory,
|
|
653
595
|
createStorageObjects,
|
|
654
596
|
getNetworkPeers,
|
|
655
597
|
isLocked,
|