@dxos/client-services 0.8.3 → 0.8.4-main.84f28bd
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-LBG3C332.mjs → chunk-OCFDRCSN.mjs} +103 -103
- package/dist/lib/browser/chunk-OCFDRCSN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +6 -6
- package/dist/lib/node-esm/{chunk-SKGQLRKS.mjs → chunk-D7F3FYZS.mjs} +102 -102
- package/dist/lib/node-esm/chunk-D7F3FYZS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +6 -6
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +6 -6
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -39
- package/src/packlets/services/service-host.ts +4 -4
- package/src/version.ts +1 -5
- package/README.yml +0 -5
- package/dist/lib/browser/chunk-LBG3C332.mjs.map +0 -7
- package/dist/lib/node/chunk-LMGLGOUU.cjs +0 -9311
- package/dist/lib/node/chunk-LMGLGOUU.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -437
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/testing/index.cjs +0 -452
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-SKGQLRKS.mjs.map +0 -7
package/dist/lib/node/index.cjs
DELETED
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var node_exports = {};
|
|
20
|
-
__export(node_exports, {
|
|
21
|
-
ClientRpcServer: () => import_chunk_LMGLGOUU.ClientRpcServer,
|
|
22
|
-
ClientServicesHost: () => import_chunk_LMGLGOUU.ClientServicesHost,
|
|
23
|
-
DataSpace: () => import_chunk_LMGLGOUU.DataSpace,
|
|
24
|
-
DataSpaceManager: () => import_chunk_LMGLGOUU.DataSpaceManager,
|
|
25
|
-
DeviceInvitationProtocol: () => import_chunk_LMGLGOUU.DeviceInvitationProtocol,
|
|
26
|
-
DevtoolsHostEvents: () => import_chunk_LMGLGOUU.DevtoolsHostEvents,
|
|
27
|
-
DevtoolsServiceImpl: () => import_chunk_LMGLGOUU.DevtoolsServiceImpl,
|
|
28
|
-
DiagnosticsCollector: () => import_chunk_LMGLGOUU.DiagnosticsCollector,
|
|
29
|
-
EdgeAgentManager: () => import_chunk_LMGLGOUU.EdgeAgentManager,
|
|
30
|
-
EdgeAgentServiceImpl: () => import_chunk_LMGLGOUU.EdgeAgentServiceImpl,
|
|
31
|
-
EdgeFeedReplicator: () => import_chunk_LMGLGOUU.EdgeFeedReplicator,
|
|
32
|
-
Identity: () => import_chunk_LMGLGOUU.Identity,
|
|
33
|
-
IdentityManager: () => import_chunk_LMGLGOUU.IdentityManager,
|
|
34
|
-
IdentityServiceImpl: () => import_chunk_LMGLGOUU.IdentityServiceImpl,
|
|
35
|
-
InvitationsHandler: () => import_chunk_LMGLGOUU.InvitationsHandler,
|
|
36
|
-
InvitationsManager: () => import_chunk_LMGLGOUU.InvitationsManager,
|
|
37
|
-
InvitationsServiceImpl: () => import_chunk_LMGLGOUU.InvitationsServiceImpl,
|
|
38
|
-
Lock: () => import_chunk_LMGLGOUU.Lock,
|
|
39
|
-
ServiceContext: () => import_chunk_LMGLGOUU.ServiceContext,
|
|
40
|
-
ServiceRegistry: () => import_chunk_LMGLGOUU.ServiceRegistry,
|
|
41
|
-
SpaceInvitationProtocol: () => import_chunk_LMGLGOUU.SpaceInvitationProtocol,
|
|
42
|
-
SpacesServiceImpl: () => import_chunk_LMGLGOUU.SpacesServiceImpl,
|
|
43
|
-
TrustedKeySetAuthVerifier: () => import_chunk_LMGLGOUU.TrustedKeySetAuthVerifier,
|
|
44
|
-
WorkerRuntime: () => WorkerRuntime,
|
|
45
|
-
WorkerSession: () => WorkerSession,
|
|
46
|
-
createAdmissionKeypair: () => import_chunk_LMGLGOUU.createAdmissionKeypair,
|
|
47
|
-
createAuthProvider: () => import_chunk_LMGLGOUU.createAuthProvider,
|
|
48
|
-
createCollectDiagnosticsBroadcastHandler: () => import_chunk_LMGLGOUU.createCollectDiagnosticsBroadcastHandler,
|
|
49
|
-
createCollectDiagnosticsBroadcastSender: () => import_chunk_LMGLGOUU.createCollectDiagnosticsBroadcastSender,
|
|
50
|
-
createDiagnostics: () => import_chunk_LMGLGOUU.createDiagnostics,
|
|
51
|
-
createLevel: () => import_chunk_LMGLGOUU.createLevel,
|
|
52
|
-
createStorageObjects: () => import_chunk_LMGLGOUU.createStorageObjects,
|
|
53
|
-
decodeProfileArchive: () => import_chunk_LMGLGOUU.decodeProfileArchive,
|
|
54
|
-
encodeProfileArchive: () => import_chunk_LMGLGOUU.encodeProfileArchive,
|
|
55
|
-
exportProfileData: () => import_chunk_LMGLGOUU.exportProfileData,
|
|
56
|
-
getNetworkPeers: () => import_chunk_LMGLGOUU.getNetworkPeers,
|
|
57
|
-
importProfileData: () => import_chunk_LMGLGOUU.importProfileData,
|
|
58
|
-
isLocked: () => import_chunk_LMGLGOUU.isLocked,
|
|
59
|
-
subscribeToFeedBlocks: () => import_chunk_LMGLGOUU.subscribeToFeedBlocks,
|
|
60
|
-
subscribeToFeeds: () => import_chunk_LMGLGOUU.subscribeToFeeds,
|
|
61
|
-
subscribeToNetworkStatus: () => import_chunk_LMGLGOUU.subscribeToNetworkStatus,
|
|
62
|
-
subscribeToNetworkTopics: () => import_chunk_LMGLGOUU.subscribeToNetworkTopics,
|
|
63
|
-
subscribeToSignal: () => import_chunk_LMGLGOUU.subscribeToSignal,
|
|
64
|
-
subscribeToSpaces: () => import_chunk_LMGLGOUU.subscribeToSpaces,
|
|
65
|
-
subscribeToSwarmInfo: () => import_chunk_LMGLGOUU.subscribeToSwarmInfo
|
|
66
|
-
});
|
|
67
|
-
module.exports = __toCommonJS(node_exports);
|
|
68
|
-
var import_chunk_LMGLGOUU = require("./chunk-LMGLGOUU.cjs");
|
|
69
|
-
var import_async = require("@dxos/async");
|
|
70
|
-
var import_client_protocol = require("@dxos/client-protocol");
|
|
71
|
-
var import_context = require("@dxos/context");
|
|
72
|
-
var import_invariant = require("@dxos/invariant");
|
|
73
|
-
var import_log = require("@dxos/log");
|
|
74
|
-
var import_messaging = require("@dxos/messaging");
|
|
75
|
-
var import_network_manager = require("@dxos/network-manager");
|
|
76
|
-
var import_async2 = require("@dxos/async");
|
|
77
|
-
var import_client_protocol2 = require("@dxos/client-protocol");
|
|
78
|
-
var import_invariant2 = require("@dxos/invariant");
|
|
79
|
-
var import_log2 = require("@dxos/log");
|
|
80
|
-
var import_rpc = require("@dxos/rpc");
|
|
81
|
-
var import_util = require("@dxos/util");
|
|
82
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
83
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
84
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
85
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
86
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
87
|
-
}
|
|
88
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/worker/worker-session.ts";
|
|
89
|
-
var WorkerSession = class {
|
|
90
|
-
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
91
|
-
this._startTrigger = new import_async2.Trigger();
|
|
92
|
-
this.onClose = new import_util.Callback();
|
|
93
|
-
(0, import_invariant2.invariant)(serviceHost, void 0, {
|
|
94
|
-
F: __dxlog_file,
|
|
95
|
-
L: 54,
|
|
96
|
-
S: this,
|
|
97
|
-
A: [
|
|
98
|
-
"serviceHost",
|
|
99
|
-
""
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
this._serviceHost = serviceHost;
|
|
103
|
-
const middleware = {
|
|
104
|
-
handleCall: async (method, params, handler) => {
|
|
105
|
-
const error = await readySignal.wait({
|
|
106
|
-
timeout: import_client_protocol2.PROXY_CONNECTION_TIMEOUT
|
|
107
|
-
});
|
|
108
|
-
if (error) {
|
|
109
|
-
throw error;
|
|
110
|
-
}
|
|
111
|
-
return handler(method, params);
|
|
112
|
-
},
|
|
113
|
-
handleStream: async (method, params, handler) => {
|
|
114
|
-
const error = await readySignal.wait({
|
|
115
|
-
timeout: import_client_protocol2.PROXY_CONNECTION_TIMEOUT
|
|
116
|
-
});
|
|
117
|
-
if (error) {
|
|
118
|
-
throw error;
|
|
119
|
-
}
|
|
120
|
-
return handler(method, params);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
this._clientRpc = new import_chunk_LMGLGOUU.ClientRpcServer({
|
|
124
|
-
serviceRegistry: this._serviceHost.serviceRegistry,
|
|
125
|
-
port: appPort,
|
|
126
|
-
...middleware
|
|
127
|
-
});
|
|
128
|
-
this._shellClientRpc = shellPort ? new import_chunk_LMGLGOUU.ClientRpcServer({
|
|
129
|
-
serviceRegistry: this._serviceHost.serviceRegistry,
|
|
130
|
-
port: shellPort,
|
|
131
|
-
...middleware
|
|
132
|
-
}) : void 0;
|
|
133
|
-
this._iframeRpc = (0, import_rpc.createProtoRpcPeer)({
|
|
134
|
-
requested: import_client_protocol2.iframeServiceBundle,
|
|
135
|
-
exposed: import_client_protocol2.workerServiceBundle,
|
|
136
|
-
handlers: {
|
|
137
|
-
WorkerService: {
|
|
138
|
-
start: async (request) => {
|
|
139
|
-
this.origin = request.origin;
|
|
140
|
-
this.lockKey = request.lockKey;
|
|
141
|
-
this.observabilityGroup = request.observabilityGroup;
|
|
142
|
-
this.signalTelemetryEnabled = request.signalTelemetryEnabled;
|
|
143
|
-
this._startTrigger.wake();
|
|
144
|
-
},
|
|
145
|
-
stop: async () => {
|
|
146
|
-
setTimeout(async () => {
|
|
147
|
-
try {
|
|
148
|
-
await this.close();
|
|
149
|
-
} catch (err) {
|
|
150
|
-
import_log2.log.catch(err, void 0, {
|
|
151
|
-
F: __dxlog_file,
|
|
152
|
-
L: 108,
|
|
153
|
-
S: this,
|
|
154
|
-
C: (f, a) => f(...a)
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
port: systemPort,
|
|
162
|
-
timeout: 1e3
|
|
163
|
-
});
|
|
164
|
-
this.bridgeService = this._iframeRpc.rpc.BridgeService;
|
|
165
|
-
}
|
|
166
|
-
async open() {
|
|
167
|
-
import_log2.log.info("opening...", void 0, {
|
|
168
|
-
F: __dxlog_file,
|
|
169
|
-
L: 122,
|
|
170
|
-
S: this,
|
|
171
|
-
C: (f, a) => f(...a)
|
|
172
|
-
});
|
|
173
|
-
await Promise.all([
|
|
174
|
-
this._clientRpc.open(),
|
|
175
|
-
this._iframeRpc.open(),
|
|
176
|
-
this._maybeOpenShell()
|
|
177
|
-
]);
|
|
178
|
-
await this._startTrigger.wait({
|
|
179
|
-
timeout: import_client_protocol2.PROXY_CONNECTION_TIMEOUT
|
|
180
|
-
});
|
|
181
|
-
if (this.lockKey) {
|
|
182
|
-
void this._afterLockReleases(this.lockKey, () => this.close());
|
|
183
|
-
}
|
|
184
|
-
import_log2.log.info("opened", void 0, {
|
|
185
|
-
F: __dxlog_file,
|
|
186
|
-
L: 133,
|
|
187
|
-
S: this,
|
|
188
|
-
C: (f, a) => f(...a)
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
async close() {
|
|
192
|
-
import_log2.log.info("closing...", void 0, {
|
|
193
|
-
F: __dxlog_file,
|
|
194
|
-
L: 137,
|
|
195
|
-
S: this,
|
|
196
|
-
C: (f, a) => f(...a)
|
|
197
|
-
});
|
|
198
|
-
try {
|
|
199
|
-
await this.onClose.callIfSet();
|
|
200
|
-
} catch (err) {
|
|
201
|
-
import_log2.log.catch(err, void 0, {
|
|
202
|
-
F: __dxlog_file,
|
|
203
|
-
L: 141,
|
|
204
|
-
S: this,
|
|
205
|
-
C: (f, a) => f(...a)
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
await Promise.all([
|
|
209
|
-
this._clientRpc.close(),
|
|
210
|
-
this._iframeRpc.close()
|
|
211
|
-
]);
|
|
212
|
-
import_log2.log.info("closed", void 0, {
|
|
213
|
-
F: __dxlog_file,
|
|
214
|
-
L: 145,
|
|
215
|
-
S: this,
|
|
216
|
-
C: (f, a) => f(...a)
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
async _maybeOpenShell() {
|
|
220
|
-
try {
|
|
221
|
-
this._shellClientRpc && await (0, import_async2.asyncTimeout)(this._shellClientRpc.open(), 1e3);
|
|
222
|
-
} catch {
|
|
223
|
-
import_log2.log.info("No shell connected.", void 0, {
|
|
224
|
-
F: __dxlog_file,
|
|
225
|
-
L: 152,
|
|
226
|
-
S: this,
|
|
227
|
-
C: (f, a) => f(...a)
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
_afterLockReleases(lockKey, callback) {
|
|
232
|
-
return navigator.locks.request(lockKey, () => {
|
|
233
|
-
}).then(callback);
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
_ts_decorate([
|
|
237
|
-
import_log2.logInfo
|
|
238
|
-
], WorkerSession.prototype, "origin", void 0);
|
|
239
|
-
_ts_decorate([
|
|
240
|
-
import_log2.logInfo
|
|
241
|
-
], WorkerSession.prototype, "lockKey", void 0);
|
|
242
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/worker/worker-runtime.ts";
|
|
243
|
-
var WorkerRuntime = class {
|
|
244
|
-
constructor({ channel = import_client_protocol.DEFAULT_WORKER_BROADCAST_CHANNEL, configProvider, acquireLock, releaseLock, onStop }) {
|
|
245
|
-
this._transportFactory = new import_network_manager.RtcTransportProxyFactory();
|
|
246
|
-
this._ready = new import_async.Trigger();
|
|
247
|
-
this._sessions = /* @__PURE__ */ new Set();
|
|
248
|
-
this._signalMetadataTags = {
|
|
249
|
-
runtime: "worker-runtime"
|
|
250
|
-
};
|
|
251
|
-
this._signalTelemetryEnabled = false;
|
|
252
|
-
this._configProvider = configProvider;
|
|
253
|
-
this._acquireLock = acquireLock;
|
|
254
|
-
this._releaseLock = releaseLock;
|
|
255
|
-
this._onStop = onStop;
|
|
256
|
-
this._channel = channel;
|
|
257
|
-
this._clientServices = new import_chunk_LMGLGOUU.ClientServicesHost({
|
|
258
|
-
callbacks: {
|
|
259
|
-
onReset: async () => this.stop()
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
get host() {
|
|
264
|
-
return this._clientServices;
|
|
265
|
-
}
|
|
266
|
-
async start() {
|
|
267
|
-
(0, import_log.log)("starting...", void 0, {
|
|
268
|
-
F: __dxlog_file2,
|
|
269
|
-
L: 84,
|
|
270
|
-
S: this,
|
|
271
|
-
C: (f, a) => f(...a)
|
|
272
|
-
});
|
|
273
|
-
try {
|
|
274
|
-
this._broadcastChannel = new BroadcastChannel(this._channel);
|
|
275
|
-
this._broadcastChannel.postMessage({
|
|
276
|
-
action: "stop"
|
|
277
|
-
});
|
|
278
|
-
this._broadcastChannel.onmessage = async (event) => {
|
|
279
|
-
if (event.data?.action === "stop") {
|
|
280
|
-
await this.stop();
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
await this._acquireLock();
|
|
284
|
-
this._config = await this._configProvider();
|
|
285
|
-
const signals = this._config.get("runtime.services.signaling");
|
|
286
|
-
this._clientServices.initialize({
|
|
287
|
-
config: this._config,
|
|
288
|
-
signalManager: this._config.get("runtime.client.edgeFeatures")?.signaling ? void 0 : signals ? new import_messaging.WebsocketSignalManager(signals, () => this._signalTelemetryEnabled ? this._signalMetadataTags : {}) : new import_messaging.MemorySignalManager(new import_messaging.MemorySignalManagerContext()),
|
|
289
|
-
transportFactory: this._transportFactory
|
|
290
|
-
});
|
|
291
|
-
await this._clientServices.open(new import_context.Context(void 0, {
|
|
292
|
-
F: __dxlog_file2,
|
|
293
|
-
L: 107
|
|
294
|
-
}));
|
|
295
|
-
this._ready.wake(void 0);
|
|
296
|
-
(0, import_log.log)("started", void 0, {
|
|
297
|
-
F: __dxlog_file2,
|
|
298
|
-
L: 109,
|
|
299
|
-
S: this,
|
|
300
|
-
C: (f, a) => f(...a)
|
|
301
|
-
});
|
|
302
|
-
(0, import_messaging.setIdentityTags)({
|
|
303
|
-
identityService: this._clientServices.services.IdentityService,
|
|
304
|
-
devicesService: this._clientServices.services.DevicesService,
|
|
305
|
-
setTag: (k, v) => {
|
|
306
|
-
this._signalMetadataTags[k] = v;
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
} catch (err) {
|
|
310
|
-
this._ready.wake(err);
|
|
311
|
-
import_log.log.error("starting", err, {
|
|
312
|
-
F: __dxlog_file2,
|
|
313
|
-
L: 119,
|
|
314
|
-
S: this,
|
|
315
|
-
C: (f, a) => f(...a)
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
async stop() {
|
|
320
|
-
this._releaseLock();
|
|
321
|
-
this._broadcastChannel?.close();
|
|
322
|
-
this._broadcastChannel = void 0;
|
|
323
|
-
await this._clientServices.close();
|
|
324
|
-
await this._onStop?.();
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Create a new session.
|
|
328
|
-
*/
|
|
329
|
-
async createSession({ appPort, systemPort, shellPort }) {
|
|
330
|
-
const session = new WorkerSession({
|
|
331
|
-
serviceHost: this._clientServices,
|
|
332
|
-
appPort,
|
|
333
|
-
systemPort,
|
|
334
|
-
shellPort,
|
|
335
|
-
readySignal: this._ready
|
|
336
|
-
});
|
|
337
|
-
session.onClose.set(async () => {
|
|
338
|
-
this._sessions.delete(session);
|
|
339
|
-
if (this._sessions.size === 0) {
|
|
340
|
-
await this.stop();
|
|
341
|
-
} else {
|
|
342
|
-
this._reconnectWebrtc();
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
await session.open();
|
|
346
|
-
(0, import_invariant.invariant)(!this._signalMetadataTags.origin || this._signalMetadataTags.origin === session.origin, `worker origin changed from ${this._signalMetadataTags.origin} to ${session.origin}?`, {
|
|
347
|
-
F: __dxlog_file2,
|
|
348
|
-
L: 157,
|
|
349
|
-
S: this,
|
|
350
|
-
A: [
|
|
351
|
-
"!this._signalMetadataTags.origin || this._signalMetadataTags.origin === session.origin",
|
|
352
|
-
"`worker origin changed from ${this._signalMetadataTags.origin} to ${session.origin}?`"
|
|
353
|
-
]
|
|
354
|
-
});
|
|
355
|
-
if (session.observabilityGroup) {
|
|
356
|
-
this._signalMetadataTags.group = session.observabilityGroup;
|
|
357
|
-
}
|
|
358
|
-
this._signalTelemetryEnabled = session.signalTelemetryEnabled ?? false;
|
|
359
|
-
this._signalMetadataTags.origin = session.origin;
|
|
360
|
-
this._sessions.add(session);
|
|
361
|
-
this._reconnectWebrtc();
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Selects one of the existing session for WebRTC networking.
|
|
365
|
-
*/
|
|
366
|
-
_reconnectWebrtc() {
|
|
367
|
-
(0, import_log.log)("reconnecting webrtc...", void 0, {
|
|
368
|
-
F: __dxlog_file2,
|
|
369
|
-
L: 175,
|
|
370
|
-
S: this,
|
|
371
|
-
C: (f, a) => f(...a)
|
|
372
|
-
});
|
|
373
|
-
if (this._sessionForNetworking) {
|
|
374
|
-
if (!this._sessions.has(this._sessionForNetworking)) {
|
|
375
|
-
this._sessionForNetworking = void 0;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if (!this._sessionForNetworking) {
|
|
379
|
-
const selected = Array.from(this._sessions).find((session) => session.bridgeService);
|
|
380
|
-
if (selected) {
|
|
381
|
-
this._sessionForNetworking = selected;
|
|
382
|
-
this._transportFactory.setBridgeService(selected.bridgeService);
|
|
383
|
-
} else {
|
|
384
|
-
this._transportFactory.setBridgeService(void 0);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
390
|
-
0 && (module.exports = {
|
|
391
|
-
ClientRpcServer,
|
|
392
|
-
ClientServicesHost,
|
|
393
|
-
DataSpace,
|
|
394
|
-
DataSpaceManager,
|
|
395
|
-
DeviceInvitationProtocol,
|
|
396
|
-
DevtoolsHostEvents,
|
|
397
|
-
DevtoolsServiceImpl,
|
|
398
|
-
DiagnosticsCollector,
|
|
399
|
-
EdgeAgentManager,
|
|
400
|
-
EdgeAgentServiceImpl,
|
|
401
|
-
EdgeFeedReplicator,
|
|
402
|
-
Identity,
|
|
403
|
-
IdentityManager,
|
|
404
|
-
IdentityServiceImpl,
|
|
405
|
-
InvitationsHandler,
|
|
406
|
-
InvitationsManager,
|
|
407
|
-
InvitationsServiceImpl,
|
|
408
|
-
Lock,
|
|
409
|
-
ServiceContext,
|
|
410
|
-
ServiceRegistry,
|
|
411
|
-
SpaceInvitationProtocol,
|
|
412
|
-
SpacesServiceImpl,
|
|
413
|
-
TrustedKeySetAuthVerifier,
|
|
414
|
-
WorkerRuntime,
|
|
415
|
-
WorkerSession,
|
|
416
|
-
createAdmissionKeypair,
|
|
417
|
-
createAuthProvider,
|
|
418
|
-
createCollectDiagnosticsBroadcastHandler,
|
|
419
|
-
createCollectDiagnosticsBroadcastSender,
|
|
420
|
-
createDiagnostics,
|
|
421
|
-
createLevel,
|
|
422
|
-
createStorageObjects,
|
|
423
|
-
decodeProfileArchive,
|
|
424
|
-
encodeProfileArchive,
|
|
425
|
-
exportProfileData,
|
|
426
|
-
getNetworkPeers,
|
|
427
|
-
importProfileData,
|
|
428
|
-
isLocked,
|
|
429
|
-
subscribeToFeedBlocks,
|
|
430
|
-
subscribeToFeeds,
|
|
431
|
-
subscribeToNetworkStatus,
|
|
432
|
-
subscribeToNetworkTopics,
|
|
433
|
-
subscribeToSignal,
|
|
434
|
-
subscribeToSpaces,
|
|
435
|
-
subscribeToSwarmInfo
|
|
436
|
-
});
|
|
437
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/packlets/worker/worker-runtime.ts", "../../../src/packlets/worker/worker-session.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { DEFAULT_WORKER_BROADCAST_CHANNEL } from '@dxos/client-protocol';\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport {\n MemorySignalManager,\n MemorySignalManagerContext,\n WebsocketSignalManager,\n setIdentityTags,\n} from '@dxos/messaging';\nimport { RtcTransportProxyFactory } from '@dxos/network-manager';\nimport { type RpcPort } from '@dxos/rpc';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { WorkerSession } from './worker-session';\nimport { ClientServicesHost } from '../services';\n\n// NOTE: Keep as RpcPorts to avoid dependency on @dxos/rpc-tunnel so we don't depend on browser-specific apis.\nexport type CreateSessionParams = {\n appPort: RpcPort;\n systemPort: RpcPort;\n shellPort?: RpcPort;\n};\n\nexport type WorkerRuntimeOptions = {\n channel?: string;\n configProvider: () => MaybePromise<Config>;\n acquireLock: () => Promise<void>;\n releaseLock: () => void;\n onStop?: () => Promise<void>;\n};\n\n/**\n * Runtime for the shared worker.\n * Manages connections from proxies (in tabs).\n * Tabs make requests to the `ClientServicesHost`, and provide a WebRTC gateway.\n */\nexport class WorkerRuntime {\n private readonly _configProvider: () => MaybePromise<Config>;\n private readonly _acquireLock: () => Promise<void>;\n private readonly _releaseLock: () => void;\n private readonly _onStop?: () => Promise<void>;\n private readonly _transportFactory = new RtcTransportProxyFactory();\n private readonly _ready = new Trigger<Error | undefined>();\n private readonly _sessions = new Set<WorkerSession>();\n private readonly _clientServices!: ClientServicesHost;\n private readonly _channel: string;\n private _broadcastChannel?: BroadcastChannel;\n private _sessionForNetworking?: WorkerSession; // TODO(burdon): Expose to client QueryStatusResponse.\n private _config!: Config;\n private _signalMetadataTags: any = { runtime: 'worker-runtime' };\n private _signalTelemetryEnabled: boolean = false;\n\n constructor({\n channel = DEFAULT_WORKER_BROADCAST_CHANNEL,\n configProvider,\n acquireLock,\n releaseLock,\n onStop,\n }: WorkerRuntimeOptions) {\n this._configProvider = configProvider;\n this._acquireLock = acquireLock;\n this._releaseLock = releaseLock;\n this._onStop = onStop;\n this._channel = channel;\n this._clientServices = new ClientServicesHost({\n callbacks: {\n onReset: async () => this.stop(),\n },\n });\n }\n\n get host() {\n return this._clientServices;\n }\n\n async start(): Promise<void> {\n log('starting...');\n try {\n this._broadcastChannel = new BroadcastChannel(this._channel);\n this._broadcastChannel.postMessage({ action: 'stop' });\n this._broadcastChannel.onmessage = async (event) => {\n if (event.data?.action === 'stop') {\n await this.stop();\n }\n };\n\n await this._acquireLock();\n this._config = await this._configProvider();\n const signals = this._config.get('runtime.services.signaling');\n this._clientServices.initialize({\n config: this._config,\n signalManager: this._config.get('runtime.client.edgeFeatures')?.signaling\n ? undefined\n : signals\n ? new WebsocketSignalManager(signals, () => (this._signalTelemetryEnabled ? this._signalMetadataTags : {}))\n : new MemorySignalManager(new MemorySignalManagerContext()), // TODO(dmaretskyi): Inject this context.\n transportFactory: this._transportFactory,\n });\n\n await this._clientServices.open(new Context());\n this._ready.wake(undefined);\n log('started');\n setIdentityTags({\n identityService: this._clientServices.services.IdentityService!,\n devicesService: this._clientServices.services.DevicesService!,\n setTag: (k: string, v: string) => {\n this._signalMetadataTags[k] = v;\n },\n });\n } catch (err: any) {\n this._ready.wake(err);\n log.error('starting', err);\n }\n }\n\n async stop(): Promise<void> {\n // Release the lock to notify remote clients that the worker is terminating.\n this._releaseLock();\n this._broadcastChannel?.close();\n this._broadcastChannel = undefined;\n await this._clientServices.close();\n await this._onStop?.();\n }\n\n /**\n * Create a new session.\n */\n async createSession({ appPort, systemPort, shellPort }: CreateSessionParams): Promise<void> {\n const session = new WorkerSession({\n serviceHost: this._clientServices,\n appPort,\n systemPort,\n shellPort,\n readySignal: this._ready,\n });\n\n // When tab is closed or client is destroyed.\n session.onClose.set(async () => {\n this._sessions.delete(session);\n if (this._sessions.size === 0) {\n // Terminate the worker when all sessions are closed.\n await this.stop();\n } else {\n this._reconnectWebrtc();\n }\n });\n\n await session.open();\n // A worker can only service one origin currently\n invariant(\n !this._signalMetadataTags.origin || this._signalMetadataTags.origin === session.origin,\n `worker origin changed from ${this._signalMetadataTags.origin} to ${session.origin}?`,\n );\n if (session.observabilityGroup) {\n this._signalMetadataTags.group = session.observabilityGroup;\n }\n this._signalTelemetryEnabled = session.signalTelemetryEnabled ?? false;\n this._signalMetadataTags.origin = session.origin;\n this._sessions.add(session);\n\n this._reconnectWebrtc();\n }\n\n /**\n * Selects one of the existing session for WebRTC networking.\n */\n private _reconnectWebrtc(): void {\n log('reconnecting webrtc...');\n // Check if current session is already closed.\n if (this._sessionForNetworking) {\n if (!this._sessions.has(this._sessionForNetworking)) {\n this._sessionForNetworking = undefined;\n }\n }\n\n // Select existing session.\n if (!this._sessionForNetworking) {\n const selected = Array.from(this._sessions).find((session) => session.bridgeService);\n if (selected) {\n this._sessionForNetworking = selected;\n this._transportFactory.setBridgeService(selected.bridgeService);\n } else {\n this._transportFactory.setBridgeService(undefined);\n }\n }\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { asyncTimeout, Trigger } from '@dxos/async';\nimport {\n iframeServiceBundle,\n type IframeServiceBundle,\n PROXY_CONNECTION_TIMEOUT,\n workerServiceBundle,\n} from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { log, logInfo } from '@dxos/log';\nimport { type BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { createProtoRpcPeer, type ProtoRpcPeer, type RpcPort } from '@dxos/rpc';\nimport { Callback, type MaybePromise } from '@dxos/util';\n\nimport { type ClientServicesHost, ClientRpcServer, type ClientRpcServerParams } from '../services';\n\nexport type WorkerSessionParams = {\n serviceHost: ClientServicesHost;\n systemPort: RpcPort;\n appPort: RpcPort;\n // TODO(wittjosiah): Remove shellPort.\n shellPort?: RpcPort;\n readySignal: Trigger<Error | undefined>;\n};\n\n/**\n * Represents a tab connection within the worker.\n */\nexport class WorkerSession {\n private readonly _clientRpc: ClientRpcServer;\n private readonly _shellClientRpc?: ClientRpcServer;\n private readonly _iframeRpc: ProtoRpcPeer<IframeServiceBundle>;\n private readonly _startTrigger = new Trigger();\n private readonly _serviceHost: ClientServicesHost;\n\n public readonly onClose = new Callback<() => Promise<void>>();\n\n @logInfo\n public origin?: string;\n\n // TODO(nf): factor out?\n public observabilityGroup?: string;\n public signalTelemetryEnabled?: boolean;\n\n @logInfo\n public lockKey?: string;\n\n public bridgeService?: BridgeService;\n\n constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }: WorkerSessionParams) {\n invariant(serviceHost);\n this._serviceHost = serviceHost;\n\n const middleware: Pick<ClientRpcServerParams, 'handleCall' | 'handleStream'> = {\n handleCall: async (method, params, handler) => {\n const error = await readySignal.wait({ timeout: PROXY_CONNECTION_TIMEOUT });\n if (error) {\n throw error;\n }\n\n return handler(method, params);\n },\n handleStream: async (method, params, handler) => {\n const error = await readySignal.wait({ timeout: PROXY_CONNECTION_TIMEOUT });\n if (error) {\n throw error;\n }\n\n return handler(method, params);\n },\n };\n\n this._clientRpc = new ClientRpcServer({\n serviceRegistry: this._serviceHost.serviceRegistry,\n port: appPort,\n ...middleware,\n });\n\n this._shellClientRpc = shellPort\n ? new ClientRpcServer({\n serviceRegistry: this._serviceHost.serviceRegistry,\n port: shellPort,\n ...middleware,\n })\n : undefined;\n\n this._iframeRpc = createProtoRpcPeer({\n requested: iframeServiceBundle,\n exposed: workerServiceBundle,\n handlers: {\n WorkerService: {\n start: async (request) => {\n this.origin = request.origin;\n this.lockKey = request.lockKey;\n this.observabilityGroup = request.observabilityGroup;\n this.signalTelemetryEnabled = request.signalTelemetryEnabled;\n this._startTrigger.wake();\n },\n\n stop: async () => {\n setTimeout(async () => {\n try {\n await this.close();\n } catch (err: any) {\n log.catch(err);\n }\n });\n },\n },\n },\n port: systemPort,\n timeout: 1_000, // With low timeout heartbeat may fail if the tab's thread is saturated.\n });\n\n this.bridgeService = this._iframeRpc.rpc.BridgeService;\n }\n\n async open(): Promise<void> {\n log.info('opening...');\n await Promise.all([this._clientRpc.open(), this._iframeRpc.open(), this._maybeOpenShell()]);\n\n // Wait until the worker's RPC service has started.\n await this._startTrigger.wait({ timeout: PROXY_CONNECTION_TIMEOUT });\n\n // TODO(burdon): Comment required.\n if (this.lockKey) {\n void this._afterLockReleases(this.lockKey, () => this.close());\n }\n\n log.info('opened');\n }\n\n async close(): Promise<void> {\n log.info('closing...');\n try {\n await this.onClose.callIfSet();\n } catch (err: any) {\n log.catch(err);\n }\n\n await Promise.all([this._clientRpc.close(), this._iframeRpc.close()]);\n log.info('closed');\n }\n\n private async _maybeOpenShell(): Promise<void> {\n try {\n this._shellClientRpc && (await asyncTimeout(this._shellClientRpc.open(), 1_000));\n } catch {\n log.info('No shell connected.');\n }\n }\n\n private _afterLockReleases(lockKey: string, callback: () => MaybePromise<void>): Promise<void> {\n return navigator.locks\n .request(lockKey, () => {\n // No-op.\n })\n .then(callback);\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAwB;AACxB,6BAAiD;AAEjD,qBAAwB;AACxB,uBAA0B;AAC1B,iBAAoB;AACpB,uBAKO;AACP,6BAAyC;ACZzC,IAAAA,gBAAsC;AACtC,IAAAC,0BAKO;AACP,IAAAC,oBAA0B;AAC1B,IAAAC,cAA6B;AAE7B,iBAAoE;AACpE,kBAA4C;;;;;;;;AAgBrC,IAAMC,gBAAN,MAAMA;EAqBX,YAAY,EAAEC,aAAaC,YAAYC,SAASC,WAAWC,YAAW,GAAyB;AAjB9EC,SAAAA,gBAAgB,IAAIC,sBAAAA;AAGrBC,SAAAA,UAAU,IAAIC,qBAAAA;AAe5BC,qCAAUT,aAAAA,QAAAA;;;;;;;;;AACV,SAAKU,eAAeV;AAEpB,UAAMW,aAAyE;MAC7EC,YAAY,OAAOC,QAAQC,QAAQC,YAAAA;AACjC,cAAMC,QAAQ,MAAMZ,YAAYa,KAAK;UAAEC,SAASC;QAAyB,CAAA;AACzE,YAAIH,OAAO;AACT,gBAAMA;QACR;AAEA,eAAOD,QAAQF,QAAQC,MAAAA;MACzB;MACAM,cAAc,OAAOP,QAAQC,QAAQC,YAAAA;AACnC,cAAMC,QAAQ,MAAMZ,YAAYa,KAAK;UAAEC,SAASC;QAAyB,CAAA;AACzE,YAAIH,OAAO;AACT,gBAAMA;QACR;AAEA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EACF;AACF;",
|
|
6
|
-
"names": ["import_async", "import_client_protocol", "import_invariant", "import_log", "WorkerSession", "serviceHost", "systemPort", "appPort", "shellPort", "readySignal", "_startTrigger", "Trigger", "onClose", "Callback", "invariant", "_serviceHost", "middleware", "handleCall", "method", "params", "handler", "error", "wait", "timeout", "PROXY_CONNECTION_TIMEOUT", "handleStream", "_clientRpc", "ClientRpcServer", "serviceRegistry", "port", "_shellClientRpc", "undefined", "_iframeRpc", "createProtoRpcPeer", "requested", "iframeServiceBundle", "exposed", "workerServiceBundle", "handlers", "WorkerService", "start", "request", "origin", "lockKey", "observabilityGroup", "signalTelemetryEnabled", "wake", "stop", "setTimeout", "close", "err", "log", "catch", "bridgeService", "rpc", "BridgeService", "open", "info", "Promise", "all", "_maybeOpenShell", "_afterLockReleases", "callIfSet", "asyncTimeout", "callback", "navigator", "locks", "then", "WorkerRuntime", "channel", "DEFAULT_WORKER_BROADCAST_CHANNEL", "configProvider", "acquireLock", "releaseLock", "onStop", "_transportFactory", "RtcTransportProxyFactory", "_ready", "_sessions", "Set", "_signalMetadataTags", "runtime", "_signalTelemetryEnabled", "_configProvider", "_acquireLock", "_releaseLock", "_onStop", "_channel", "_clientServices", "ClientServicesHost", "callbacks", "onReset", "host", "_broadcastChannel", "BroadcastChannel", "postMessage", "action", "onmessage", "event", "data", "_config", "signals", "get", "initialize", "config", "signalManager", "signaling", "WebsocketSignalManager", "MemorySignalManager", "MemorySignalManagerContext", "transportFactory", "Context", "setIdentityTags", "identityService", "services", "IdentityService", "devicesService", "DevicesService", "setTag", "k", "v", "createSession", "session", "set", "delete", "size", "_reconnectWebrtc", "group", "add", "_sessionForNetworking", "has", "selected", "Array", "from", "find", "setBridgeService"]
|
|
7
|
-
}
|