@dxos/shell 0.4.10-main.3c620fb → 0.4.10-main.3e35a2f
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/bundle/{index-CYUuwZ7g.mjs → index-CDxW6lWP.mjs} +2 -2
- package/dist/bundle/{index-CYUuwZ7g.mjs.map → index-CDxW6lWP.mjs.map} +1 -1
- package/dist/bundle/{index-BbUp2HYV.mjs → index-q9i9jZSi.mjs} +359 -321
- package/dist/bundle/{index-BbUp2HYV.mjs.map → index-q9i9jZSi.mjs.map} +1 -1
- package/dist/bundle/shell.mjs +1 -1
- package/dist/bundle/shell.umd.js +20 -20
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +33 -31
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/types/src/components/InvitationList/InvitationListItem.js +5 -5
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +5 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +3 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +3 -4
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/package.json +20 -20
- package/src/components/InvitationList/InvitationListItem.tsx +5 -5
- package/src/panels/IdentityPanel/useAgentHandlers.ts +5 -1
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +3 -1
- package/src/steps/InvitationManager.tsx +4 -4
|
@@ -69558,7 +69558,7 @@ var Invitation;
|
|
|
69558
69558
|
})($.Type || ($.Type = {})), function(I) {
|
|
69559
69559
|
I[I.DEVICE = 0] = "DEVICE", I[I.SPACE = 1] = "SPACE";
|
|
69560
69560
|
}($.Kind || ($.Kind = {})), function(I) {
|
|
69561
|
-
I[I.NONE = 0] = "NONE", I[I.SHARED_SECRET = 1] = "SHARED_SECRET";
|
|
69561
|
+
I[I.NONE = 0] = "NONE", I[I.SHARED_SECRET = 1] = "SHARED_SECRET", I[I.KNOWN_PUBLIC_KEY = 2] = "KNOWN_PUBLIC_KEY";
|
|
69562
69562
|
}($.AuthMethod || ($.AuthMethod = {})), function(I) {
|
|
69563
69563
|
I[I.INIT = 0] = "INIT", I[I.CONNECTING = 1] = "CONNECTING", I[I.CONNECTED = 2] = "CONNECTED", I[I.READY_FOR_AUTHENTICATION = 3] = "READY_FOR_AUTHENTICATION", I[I.AUTHENTICATING = 4] = "AUTHENTICATING", I[I.SUCCESS = 5] = "SUCCESS", I[I.CANCELLED = 6] = "CANCELLED", I[I.TIMEOUT = 7] = "TIMEOUT", I[I.ERROR = 8] = "ERROR", I[I.EXPIRED = 9] = "EXPIRED";
|
|
69564
69564
|
}($.State || ($.State = {}));
|
|
@@ -73344,7 +73344,7 @@ var DeferredTask = class {
|
|
|
73344
73344
|
action: J
|
|
73345
73345
|
}, {
|
|
73346
73346
|
F: __dxlog_file$6,
|
|
73347
|
-
L:
|
|
73347
|
+
L: 81,
|
|
73348
73348
|
S: void 0,
|
|
73349
73349
|
C: (Z, Q) => Z(...Q)
|
|
73350
73350
|
}), {
|
|
@@ -73426,7 +73426,7 @@ var DeferredTask = class {
|
|
|
73426
73426
|
authCode: Y
|
|
73427
73427
|
}, {
|
|
73428
73428
|
F: __dxlog_file$6,
|
|
73429
|
-
L:
|
|
73429
|
+
L: 165,
|
|
73430
73430
|
S: void 0,
|
|
73431
73431
|
C: (J, Z) => J(...Z)
|
|
73432
73432
|
}), I.observable.authenticate(Y)), [
|
|
@@ -73449,6 +73449,7 @@ var DeferredTask = class {
|
|
|
73449
73449
|
connect: q,
|
|
73450
73450
|
authenticate: G,
|
|
73451
73451
|
id: Y == null ? void 0 : Y.invitationId,
|
|
73452
|
+
multiUse: Y == null ? void 0 : Y.multiUse,
|
|
73452
73453
|
invitationCode: Y ? InvitationEncoder.encode(Y) : void 0,
|
|
73453
73454
|
authCode: Y == null ? void 0 : Y.authCode,
|
|
73454
73455
|
authMethod: Y == null ? void 0 : Y.authMethod,
|
|
@@ -73533,7 +73534,7 @@ const AuthCode = ($) => {
|
|
|
73533
73534
|
reverseEffects: K,
|
|
73534
73535
|
...Y
|
|
73535
73536
|
}) => {
|
|
73536
|
-
const { t: J } = useTranslation("os"), { cancel: Z, status: Q, invitationCode: ee, authCode: te,
|
|
73537
|
+
const { t: J } = useTranslation("os"), { cancel: Z, status: Q, invitationCode: ee, authCode: te, multiUse: ne } = I, re = !([Invitation.State.ERROR, Invitation.State.TIMEOUT, Invitation.State.CANCELLED].indexOf(Q) >= 0), ae = ne || [Invitation.State.INIT, Invitation.State.CONNECTING, Invitation.State.CONNECTED].indexOf(Q) >= 0, se = Q === Invitation.State.READY_FOR_AUTHENTICATION, fe = useCallback(() => q == null ? void 0 : q($), [$, q]), le = ee && G(ee), ce = $ == null ? void 0 : $.get().invitationId, ue = $ == null ? void 0 : $.get().lifetime, he = $ != null && $.expiry ? formatDistanceToNow($ == null ? void 0 : $.expiry, { addSuffix: !0 }) : void 0, ve = [
|
|
73537
73538
|
Invitation.State.INIT,
|
|
73538
73539
|
Invitation.State.CONNECTING,
|
|
73539
73540
|
Invitation.State.CONNECTED,
|
|
@@ -73554,9 +73555,9 @@ const AuthCode = ($) => {
|
|
|
73554
73555
|
...Y,
|
|
73555
73556
|
classNames: ["flex gap-2 pis-3 pie-1 items-center relative", Y.classNames]
|
|
73556
73557
|
},
|
|
73557
|
-
/* @__PURE__ */ React__default.createElement(ListItem.Heading, { classNames: "sr-only" }, J(ne
|
|
73558
|
-
ne
|
|
73559
|
-
/* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(Avatar.Root, { ...avatarProps, animation: ve, status: _e }, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { asChild: !0 }, /* @__PURE__ */ React__default.createElement(Avatar.Frame, { tabIndex: 0, classNames: [focusRing, "relative rounded-full place-self-center"] }, /* @__PURE__ */ React__default.createElement(Avatar.Fallback, { text: hexToEmoji(ce) })))), /* @__PURE__ */ React__default.createElement(Tooltip.Portal, null, /* @__PURE__ */ React__default.createElement(Tooltip.Content, { side: "left", classNames: "z-[70]" }, J(ne
|
|
73558
|
+
/* @__PURE__ */ React__default.createElement(ListItem.Heading, { classNames: "sr-only" }, J(ne ? "invite many list item label" : "invite one list item label")),
|
|
73559
|
+
ne && /* @__PURE__ */ React__default.createElement(AvatarStackEffect, { status: _e, animation: ve, reverseEffects: K }),
|
|
73560
|
+
/* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(Avatar.Root, { ...avatarProps, animation: ve, status: _e }, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { asChild: !0 }, /* @__PURE__ */ React__default.createElement(Avatar.Frame, { tabIndex: 0, classNames: [focusRing, "relative rounded-full place-self-center"] }, /* @__PURE__ */ React__default.createElement(Avatar.Fallback, { text: hexToEmoji(ce) })))), /* @__PURE__ */ React__default.createElement(Tooltip.Portal, null, /* @__PURE__ */ React__default.createElement(Tooltip.Content, { side: "left", classNames: "z-[70]" }, J(ne ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React__default.createElement(Tooltip.Arrow, null)))),
|
|
73560
73561
|
ae && le ? /* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { asChild: !0 }, /* @__PURE__ */ React__default.createElement(
|
|
73561
73562
|
Button,
|
|
73562
73563
|
{
|
|
@@ -83109,7 +83110,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83109
83110
|
async sendMessage($) {
|
|
83110
83111
|
this._performance.sentMessages++, await this._clientReady.wait(), invariant(this._state === SignalState.CONNECTED, "Not connected to Signal Server", {
|
|
83111
83112
|
F: __dxlog_file3$3,
|
|
83112
|
-
L:
|
|
83113
|
+
L: 224,
|
|
83113
83114
|
S: this,
|
|
83114
83115
|
A: [
|
|
83115
83116
|
"this._state === SignalState.CONNECTED",
|
|
@@ -83122,7 +83123,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83122
83123
|
peerId: $
|
|
83123
83124
|
}, {
|
|
83124
83125
|
F: __dxlog_file3$3,
|
|
83125
|
-
L:
|
|
83126
|
+
L: 229,
|
|
83126
83127
|
S: this,
|
|
83127
83128
|
C: (I, U) => I(...U)
|
|
83128
83129
|
}), this._subscribedMessages.add({
|
|
@@ -83135,7 +83136,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83135
83136
|
peerId: $
|
|
83136
83137
|
}, {
|
|
83137
83138
|
F: __dxlog_file3$3,
|
|
83138
|
-
L:
|
|
83139
|
+
L: 235,
|
|
83139
83140
|
S: this,
|
|
83140
83141
|
C: (U, q) => U(...q)
|
|
83141
83142
|
}), this._subscribedMessages.delete({
|
|
@@ -83152,7 +83153,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83152
83153
|
status: this.getStatus()
|
|
83153
83154
|
}, {
|
|
83154
83155
|
F: __dxlog_file3$3,
|
|
83155
|
-
L:
|
|
83156
|
+
L: 254,
|
|
83156
83157
|
S: this,
|
|
83157
83158
|
C: (I, U) => I(...U)
|
|
83158
83159
|
}), this.statusChanged.emit(this.getStatus());
|
|
@@ -83163,12 +83164,12 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83163
83164
|
state: this._state
|
|
83164
83165
|
}, {
|
|
83165
83166
|
F: __dxlog_file3$3,
|
|
83166
|
-
L:
|
|
83167
|
+
L: 259,
|
|
83167
83168
|
S: this,
|
|
83168
83169
|
C: ($, I) => $(...I)
|
|
83169
83170
|
}), invariant(!this._client, "Client already created", {
|
|
83170
83171
|
F: __dxlog_file3$3,
|
|
83171
|
-
L:
|
|
83172
|
+
L: 260,
|
|
83172
83173
|
S: this,
|
|
83173
83174
|
A: [
|
|
83174
83175
|
"!this._client",
|
|
@@ -83177,7 +83178,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83177
83178
|
}), this._connectionStarted = /* @__PURE__ */ new Date(), this._connectionCtx = this._ctx.derive(), this._connectionCtx.onDispose(async () => {
|
|
83178
83179
|
log$2("connection context disposed", void 0, {
|
|
83179
83180
|
F: __dxlog_file3$3,
|
|
83180
|
-
L:
|
|
83181
|
+
L: 267,
|
|
83181
83182
|
S: this,
|
|
83182
83183
|
C: ($, I) => $(...I)
|
|
83183
83184
|
}), await Promise.all(Array.from(this._swarmStreams.values()).map(($) => $.close())), await Promise.all(Array.from(this._messageStreams.values()).map(($) => $.close())), this._swarmStreams.clear(), this._messageStreams.clear();
|
|
@@ -83189,7 +83190,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83189
83190
|
onConnected: () => {
|
|
83190
83191
|
log$2("socket connected", void 0, {
|
|
83191
83192
|
F: __dxlog_file3$3,
|
|
83192
|
-
L:
|
|
83193
|
+
L: 279,
|
|
83193
83194
|
S: this,
|
|
83194
83195
|
C: ($, I) => $(...I)
|
|
83195
83196
|
}), this._lastError = void 0, this._reconnectAfter = DEFAULT_RECONNECT_TIMEOUT, this._setState(SignalState.CONNECTED), this._clientReady.wake(), this._reconcileTask.schedule();
|
|
@@ -83199,7 +83200,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83199
83200
|
state: this._state
|
|
83200
83201
|
}, {
|
|
83201
83202
|
F: __dxlog_file3$3,
|
|
83202
|
-
L:
|
|
83203
|
+
L: 288,
|
|
83203
83204
|
S: this,
|
|
83204
83205
|
C: ($, I) => $(...I)
|
|
83205
83206
|
}), this._state === SignalState.ERROR) {
|
|
@@ -83214,7 +83215,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83214
83215
|
state: this._state
|
|
83215
83216
|
}, {
|
|
83216
83217
|
F: __dxlog_file3$3,
|
|
83217
|
-
L:
|
|
83218
|
+
L: 303,
|
|
83218
83219
|
S: this,
|
|
83219
83220
|
C: (I, U) => I(...U)
|
|
83220
83221
|
}), this._lastError = $, this._state !== SignalState.CONNECTED && this._state !== SignalState.CONNECTING && this._incrementReconnectTimeout(), this._setState(SignalState.ERROR), this._reconnectTask.schedule();
|
|
@@ -83235,13 +83236,13 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83235
83236
|
state: this._state
|
|
83236
83237
|
}, {
|
|
83237
83238
|
F: __dxlog_file3$3,
|
|
83238
|
-
L:
|
|
83239
|
+
L: 331,
|
|
83239
83240
|
S: this,
|
|
83240
83241
|
C: (U, q) => U(...q)
|
|
83241
83242
|
}), this._performance.reconnectCounter++, this._state === SignalState.RECONNECTING) {
|
|
83242
83243
|
log$2.warn("Signal api already reconnecting.", void 0, {
|
|
83243
83244
|
F: __dxlog_file3$3,
|
|
83244
|
-
L:
|
|
83245
|
+
L: 335,
|
|
83245
83246
|
S: this,
|
|
83246
83247
|
C: (U, q) => U(...q)
|
|
83247
83248
|
});
|
|
@@ -83256,7 +83257,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83256
83257
|
const $ = this._client;
|
|
83257
83258
|
invariant(this._state === SignalState.CONNECTED, "Not connected to Signal Server", {
|
|
83258
83259
|
F: __dxlog_file3$3,
|
|
83259
|
-
L:
|
|
83260
|
+
L: 360,
|
|
83260
83261
|
S: this,
|
|
83261
83262
|
A: [
|
|
83262
83263
|
"this._state === SignalState.CONNECTED",
|
|
@@ -83289,7 +83290,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83289
83290
|
swarmEvent: K
|
|
83290
83291
|
}, {
|
|
83291
83292
|
F: __dxlog_file3$3,
|
|
83292
|
-
L:
|
|
83293
|
+
L: 387,
|
|
83293
83294
|
S: this,
|
|
83294
83295
|
C: (Y, J) => Y(...J)
|
|
83295
83296
|
}), await this._onSwarmEvent({
|
|
@@ -83308,7 +83309,7 @@ var __dxlog_file2$3 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/
|
|
|
83308
83309
|
const $ = this._client;
|
|
83309
83310
|
invariant(this._state === SignalState.CONNECTED, "Not connected to Signal Server", {
|
|
83310
83311
|
F: __dxlog_file3$3,
|
|
83311
|
-
L:
|
|
83312
|
+
L: 400,
|
|
83312
83313
|
S: this,
|
|
83313
83314
|
A: [
|
|
83314
83315
|
"this._state === SignalState.CONNECTED",
|
|
@@ -85715,13 +85716,13 @@ var Connection = class {
|
|
|
85715
85716
|
stream: this._protocol.stream,
|
|
85716
85717
|
sendSignal: async ($) => this._sendSignal($),
|
|
85717
85718
|
sessionId: this.sessionId
|
|
85718
|
-
}), this._transport.connected.once(async () => {
|
|
85719
|
+
}), await this._transport.open(), this._transport.connected.once(async () => {
|
|
85719
85720
|
var $, I;
|
|
85720
85721
|
this._changeState("CONNECTED"), await this.connectedTimeoutContext.dispose(), (I = ($ = this._callbacks) == null ? void 0 : $.onConnected) == null || I.call($), scheduleTaskInterval(this._ctx, async () => this._emitTransportStats(), TRANSPORT_STATS_INTERVAL);
|
|
85721
85722
|
}), this._transport.closed.once(() => {
|
|
85722
85723
|
this._transport = void 0, log$2("abort triggered by transport close", void 0, {
|
|
85723
85724
|
F: __dxlog_file$2,
|
|
85724
|
-
L:
|
|
85725
|
+
L: 218,
|
|
85725
85726
|
S: this,
|
|
85726
85727
|
C: ($, I) => $(...I)
|
|
85727
85728
|
}), this.abort().catch(($) => this.errors.raise($));
|
|
@@ -85730,35 +85731,35 @@ var Connection = class {
|
|
|
85730
85731
|
err: $
|
|
85731
85732
|
}, {
|
|
85732
85733
|
F: __dxlog_file$2,
|
|
85733
|
-
L:
|
|
85734
|
+
L: 223,
|
|
85734
85735
|
S: this,
|
|
85735
85736
|
C: (I, U) => I(...U)
|
|
85736
85737
|
}), this.closeReason || (this.closeReason = $ == null ? void 0 : $.message), $ instanceof ConnectionResetError ? (log$2.info("aborting due to transport ConnectionResetError", void 0, {
|
|
85737
85738
|
F: __dxlog_file$2,
|
|
85738
|
-
L:
|
|
85739
|
+
L: 230,
|
|
85739
85740
|
S: this,
|
|
85740
85741
|
C: (I, U) => I(...U)
|
|
85741
85742
|
}), this.abort().catch((I) => this.errors.raise(I))) : $ instanceof ConnectivityError ? (log$2.info("aborting due to transport ConnectivityError", void 0, {
|
|
85742
85743
|
F: __dxlog_file$2,
|
|
85743
|
-
L:
|
|
85744
|
+
L: 233,
|
|
85744
85745
|
S: this,
|
|
85745
85746
|
C: (I, U) => I(...U)
|
|
85746
85747
|
}), this.abort().catch((I) => this.errors.raise(I))) : $ instanceof UnknownProtocolError && log$2.warn("unsure what to do with UnknownProtocolError, will keep on truckin", {
|
|
85747
85748
|
err: $
|
|
85748
85749
|
}, {
|
|
85749
85750
|
F: __dxlog_file$2,
|
|
85750
|
-
L:
|
|
85751
|
+
L: 236,
|
|
85751
85752
|
S: this,
|
|
85752
85753
|
C: (I, U) => I(...U)
|
|
85753
85754
|
}), this._state !== "CLOSED" && this._state !== "CLOSING" && (await this.connectedTimeoutContext.dispose(), this.errors.raise($));
|
|
85754
85755
|
});
|
|
85755
85756
|
for (const $ of this._incomingSignalBuffer)
|
|
85756
|
-
this._transport.
|
|
85757
|
+
this._transport.onSignal($);
|
|
85757
85758
|
this._incomingSignalBuffer = [], log$2.trace("dxos.mesh.connection.open-connection", trace$1.end({
|
|
85758
85759
|
id: this._instanceId
|
|
85759
85760
|
}), {
|
|
85760
85761
|
F: __dxlog_file$2,
|
|
85761
|
-
L:
|
|
85762
|
+
L: 252,
|
|
85762
85763
|
S: this,
|
|
85763
85764
|
C: ($, I) => $(...I)
|
|
85764
85765
|
});
|
|
@@ -85769,13 +85770,13 @@ var Connection = class {
|
|
|
85769
85770
|
err: $
|
|
85770
85771
|
}, {
|
|
85771
85772
|
F: __dxlog_file$2,
|
|
85772
|
-
L:
|
|
85773
|
+
L: 259,
|
|
85773
85774
|
S: this,
|
|
85774
85775
|
C: (G, K) => G(...K)
|
|
85775
85776
|
}), this._state === "CLOSED" || this._state === "ABORTED") {
|
|
85776
85777
|
log$2(`abort ignored: already ${this._state}`, this.closeReason, {
|
|
85777
85778
|
F: __dxlog_file$2,
|
|
85778
|
-
L:
|
|
85779
|
+
L: 261,
|
|
85779
85780
|
S: this,
|
|
85780
85781
|
C: (G, K) => G(...K)
|
|
85781
85782
|
});
|
|
@@ -85785,24 +85786,24 @@ var Connection = class {
|
|
|
85785
85786
|
try {
|
|
85786
85787
|
log$2("aborting protocol... ", void 0, {
|
|
85787
85788
|
F: __dxlog_file$2,
|
|
85788
|
-
L:
|
|
85789
|
+
L: 275,
|
|
85789
85790
|
S: this,
|
|
85790
85791
|
C: (G, K) => G(...K)
|
|
85791
85792
|
}), await this._protocol.abort();
|
|
85792
85793
|
} catch (G) {
|
|
85793
85794
|
log$2.catch(G, void 0, {
|
|
85794
85795
|
F: __dxlog_file$2,
|
|
85795
|
-
L:
|
|
85796
|
+
L: 278,
|
|
85796
85797
|
S: this,
|
|
85797
85798
|
C: (K, Y) => K(...Y)
|
|
85798
85799
|
});
|
|
85799
85800
|
}
|
|
85800
85801
|
try {
|
|
85801
|
-
await ((I = this._transport) == null ? void 0 : I.
|
|
85802
|
+
await ((I = this._transport) == null ? void 0 : I.close());
|
|
85802
85803
|
} catch (G) {
|
|
85803
85804
|
log$2.catch(G, void 0, {
|
|
85804
85805
|
F: __dxlog_file$2,
|
|
85805
|
-
L:
|
|
85806
|
+
L: 285,
|
|
85806
85807
|
S: this,
|
|
85807
85808
|
C: (K, Y) => K(...Y)
|
|
85808
85809
|
});
|
|
@@ -85812,7 +85813,7 @@ var Connection = class {
|
|
|
85812
85813
|
} catch (G) {
|
|
85813
85814
|
log$2.catch(G, void 0, {
|
|
85814
85815
|
F: __dxlog_file$2,
|
|
85815
|
-
L:
|
|
85816
|
+
L: 291,
|
|
85816
85817
|
S: this,
|
|
85817
85818
|
C: (K, Y) => K(...Y)
|
|
85818
85819
|
});
|
|
@@ -85828,7 +85829,7 @@ var Connection = class {
|
|
|
85828
85829
|
peerId: this.ownId
|
|
85829
85830
|
}, {
|
|
85830
85831
|
F: __dxlog_file$2,
|
|
85831
|
-
L:
|
|
85832
|
+
L: 316,
|
|
85832
85833
|
S: this,
|
|
85833
85834
|
C: (Y, J) => Y(...J)
|
|
85834
85835
|
}), I === "CONNECTED") {
|
|
@@ -85837,17 +85838,17 @@ var Connection = class {
|
|
|
85837
85838
|
} catch (Y) {
|
|
85838
85839
|
log$2.catch(Y, void 0, {
|
|
85839
85840
|
F: __dxlog_file$2,
|
|
85840
|
-
L:
|
|
85841
|
+
L: 323,
|
|
85841
85842
|
S: this,
|
|
85842
85843
|
C: (J, Z) => J(...Z)
|
|
85843
85844
|
});
|
|
85844
85845
|
}
|
|
85845
85846
|
try {
|
|
85846
|
-
await ((U = this._transport) == null ? void 0 : U.
|
|
85847
|
+
await ((U = this._transport) == null ? void 0 : U.close());
|
|
85847
85848
|
} catch (Y) {
|
|
85848
85849
|
log$2.catch(Y, void 0, {
|
|
85849
85850
|
F: __dxlog_file$2,
|
|
85850
|
-
L:
|
|
85851
|
+
L: 330,
|
|
85851
85852
|
S: this,
|
|
85852
85853
|
C: (J, Z) => J(...Z)
|
|
85853
85854
|
});
|
|
@@ -85855,7 +85856,7 @@ var Connection = class {
|
|
|
85855
85856
|
} else {
|
|
85856
85857
|
log$2.info(`graceful close requested when we were in ${I} state? aborting`, void 0, {
|
|
85857
85858
|
F: __dxlog_file$2,
|
|
85858
|
-
L:
|
|
85859
|
+
L: 333,
|
|
85859
85860
|
S: this,
|
|
85860
85861
|
C: (Y, J) => Y(...J)
|
|
85861
85862
|
});
|
|
@@ -85864,17 +85865,17 @@ var Connection = class {
|
|
|
85864
85865
|
} catch (Y) {
|
|
85865
85866
|
log$2.catch(Y, void 0, {
|
|
85866
85867
|
F: __dxlog_file$2,
|
|
85867
|
-
L:
|
|
85868
|
+
L: 337,
|
|
85868
85869
|
S: this,
|
|
85869
85870
|
C: (J, Z) => J(...Z)
|
|
85870
85871
|
});
|
|
85871
85872
|
}
|
|
85872
85873
|
try {
|
|
85873
|
-
await ((q = this._transport) == null ? void 0 : q.
|
|
85874
|
+
await ((q = this._transport) == null ? void 0 : q.close());
|
|
85874
85875
|
} catch (Y) {
|
|
85875
85876
|
log$2.catch(Y, void 0, {
|
|
85876
85877
|
F: __dxlog_file$2,
|
|
85877
|
-
L:
|
|
85878
|
+
L: 342,
|
|
85878
85879
|
S: this,
|
|
85879
85880
|
C: (J, Z) => J(...Z)
|
|
85880
85881
|
});
|
|
@@ -85884,7 +85885,7 @@ var Connection = class {
|
|
|
85884
85885
|
peerId: this.ownId
|
|
85885
85886
|
}, {
|
|
85886
85887
|
F: __dxlog_file$2,
|
|
85887
|
-
L:
|
|
85888
|
+
L: 346,
|
|
85888
85889
|
S: this,
|
|
85889
85890
|
C: (Y, J) => Y(...J)
|
|
85890
85891
|
}), this._changeState("CLOSED"), (K = (G = this._callbacks) == null ? void 0 : G.onClosed) == null || K.call(G, $);
|
|
@@ -85918,7 +85919,7 @@ var Connection = class {
|
|
|
85918
85919
|
err: I
|
|
85919
85920
|
}, {
|
|
85920
85921
|
F: __dxlog_file$2,
|
|
85921
|
-
L:
|
|
85922
|
+
L: 384,
|
|
85922
85923
|
S: this,
|
|
85923
85924
|
C: (U, q) => U(...q)
|
|
85924
85925
|
}), await this.close(new ConnectivityError("signal message failed to deliver", I));
|
|
@@ -85931,7 +85932,7 @@ var Connection = class {
|
|
|
85931
85932
|
var U, q;
|
|
85932
85933
|
if (invariant($.sessionId, void 0, {
|
|
85933
85934
|
F: __dxlog_file$2,
|
|
85934
|
-
L:
|
|
85935
|
+
L: 393,
|
|
85935
85936
|
S: this,
|
|
85936
85937
|
A: [
|
|
85937
85938
|
"msg.sessionId",
|
|
@@ -85940,7 +85941,7 @@ var Connection = class {
|
|
|
85940
85941
|
}), !$.sessionId.equals(this.sessionId)) {
|
|
85941
85942
|
log$2("dropping signal for incorrect session id", void 0, {
|
|
85942
85943
|
F: __dxlog_file$2,
|
|
85943
|
-
L:
|
|
85944
|
+
L: 395,
|
|
85944
85945
|
S: this,
|
|
85945
85946
|
C: (G, K) => G(...K)
|
|
85946
85947
|
});
|
|
@@ -85948,7 +85949,7 @@ var Connection = class {
|
|
|
85948
85949
|
}
|
|
85949
85950
|
invariant($.data.signal || $.data.signalBatch, void 0, {
|
|
85950
85951
|
F: __dxlog_file$2,
|
|
85951
|
-
L:
|
|
85952
|
+
L: 398,
|
|
85952
85953
|
S: this,
|
|
85953
85954
|
A: [
|
|
85954
85955
|
"msg.data.signal || msg.data.signalBatch",
|
|
@@ -85956,7 +85957,7 @@ var Connection = class {
|
|
|
85956
85957
|
]
|
|
85957
85958
|
}), invariant((U = $.author) == null ? void 0 : U.equals(this.remoteId), void 0, {
|
|
85958
85959
|
F: __dxlog_file$2,
|
|
85959
|
-
L:
|
|
85960
|
+
L: 399,
|
|
85960
85961
|
S: this,
|
|
85961
85962
|
A: [
|
|
85962
85963
|
"msg.author?.equals(this.remoteId)",
|
|
@@ -85964,7 +85965,7 @@ var Connection = class {
|
|
|
85964
85965
|
]
|
|
85965
85966
|
}), invariant((q = $.recipient) == null ? void 0 : q.equals(this.ownId), void 0, {
|
|
85966
85967
|
F: __dxlog_file$2,
|
|
85967
|
-
L:
|
|
85968
|
+
L: 400,
|
|
85968
85969
|
S: this,
|
|
85969
85970
|
A: [
|
|
85970
85971
|
"msg.recipient?.equals(this.ownId)",
|
|
@@ -85984,12 +85985,12 @@ var Connection = class {
|
|
|
85984
85985
|
msg: $.data
|
|
85985
85986
|
}, {
|
|
85986
85987
|
F: __dxlog_file$2,
|
|
85987
|
-
L:
|
|
85988
|
+
L: 409,
|
|
85988
85989
|
S: this,
|
|
85989
85990
|
C: (K, Y) => K(...Y)
|
|
85990
85991
|
}), this._incomingSignalBuffer.push(G)) : (invariant(this._transport, "Connection not ready to accept signals.", {
|
|
85991
85992
|
F: __dxlog_file$2,
|
|
85992
|
-
L:
|
|
85993
|
+
L: 412,
|
|
85993
85994
|
S: this,
|
|
85994
85995
|
A: [
|
|
85995
85996
|
"this._transport",
|
|
@@ -86001,10 +86002,10 @@ var Connection = class {
|
|
|
86001
86002
|
msg: $.data
|
|
86002
86003
|
}, {
|
|
86003
86004
|
F: __dxlog_file$2,
|
|
86004
|
-
L:
|
|
86005
|
+
L: 413,
|
|
86005
86006
|
S: this,
|
|
86006
86007
|
C: (K, Y) => K(...Y)
|
|
86007
|
-
}), await this._transport.
|
|
86008
|
+
}), await this._transport.onSignal(G)));
|
|
86008
86009
|
}
|
|
86009
86010
|
initiate() {
|
|
86010
86011
|
this._changeState("INITIAL");
|
|
@@ -86016,12 +86017,12 @@ var Connection = class {
|
|
|
86016
86017
|
peerId: this.ownId
|
|
86017
86018
|
}, {
|
|
86018
86019
|
F: __dxlog_file$2,
|
|
86019
|
-
L:
|
|
86020
|
+
L: 424,
|
|
86020
86021
|
S: this,
|
|
86021
86022
|
C: (I, U) => I(...U)
|
|
86022
86023
|
}), invariant($ !== this._state, "Already in this state.", {
|
|
86023
86024
|
F: __dxlog_file$2,
|
|
86024
|
-
L:
|
|
86025
|
+
L: 425,
|
|
86025
86026
|
S: this,
|
|
86026
86027
|
A: [
|
|
86027
86028
|
"state !== this._state",
|
|
@@ -86260,7 +86261,6 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86260
86261
|
super("Connection displaced by remote initiator.");
|
|
86261
86262
|
}
|
|
86262
86263
|
}, CONNECTION_COUNTS_STABLE_AFTER = 5e3, Peer = class {
|
|
86263
|
-
// TODO(burdon): Convert to map?
|
|
86264
86264
|
constructor($, I, U, q, G, K, Y, J) {
|
|
86265
86265
|
this.id = $, this.topic = I, this.localPeerId = U, this._signalMessaging = q, this._protocolProvider = G, this._transportFactory = K, this._connectionLimiter = Y, this._callbacks = J, this._availableAfter = 0, this.availableToConnect = !0, this._ctx = new Context(), this.advertizing = !1, this.initiating = !1, this.connectionDisplaced = new Event$1();
|
|
86266
86266
|
}
|
|
@@ -86277,7 +86277,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86277
86277
|
].includes(this.connection.state))
|
|
86278
86278
|
return log$2.info(`received offer when connection already in ${this.connection.state} state`, void 0, {
|
|
86279
86279
|
F: __dxlog_file3$1,
|
|
86280
|
-
L:
|
|
86280
|
+
L: 114,
|
|
86281
86281
|
S: this,
|
|
86282
86282
|
C: (q, G) => q(...G)
|
|
86283
86283
|
}), {
|
|
@@ -86292,7 +86292,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86292
86292
|
sessionId: (U = this.connection) == null ? void 0 : U.sessionId
|
|
86293
86293
|
}, {
|
|
86294
86294
|
F: __dxlog_file3$1,
|
|
86295
|
-
L:
|
|
86295
|
+
L: 123,
|
|
86296
86296
|
S: this,
|
|
86297
86297
|
C: (q, G) => q(...G)
|
|
86298
86298
|
}), this.connection && await this.closeConnection(new ConnectionDisplacedError());
|
|
@@ -86303,7 +86303,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86303
86303
|
if (await this._callbacks.onOffer(I) && !this.connection) {
|
|
86304
86304
|
invariant($.sessionId, void 0, {
|
|
86305
86305
|
F: __dxlog_file3$1,
|
|
86306
|
-
L:
|
|
86306
|
+
L: 143,
|
|
86307
86307
|
S: this,
|
|
86308
86308
|
A: [
|
|
86309
86309
|
"message.sessionId",
|
|
@@ -86321,7 +86321,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86321
86321
|
err: G
|
|
86322
86322
|
}, {
|
|
86323
86323
|
F: __dxlog_file3$1,
|
|
86324
|
-
L:
|
|
86324
|
+
L: 153,
|
|
86325
86325
|
S: this,
|
|
86326
86326
|
C: (K, Y) => K(...Y)
|
|
86327
86327
|
}), await this.closeConnection(G);
|
|
@@ -86340,7 +86340,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86340
86340
|
async initiateConnection() {
|
|
86341
86341
|
invariant(!this.initiating, "Initiation in progress.", {
|
|
86342
86342
|
F: __dxlog_file3$1,
|
|
86343
|
-
L:
|
|
86343
|
+
L: 170,
|
|
86344
86344
|
S: this,
|
|
86345
86345
|
A: [
|
|
86346
86346
|
"!this.initiating",
|
|
@@ -86348,7 +86348,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86348
86348
|
]
|
|
86349
86349
|
}), invariant(!this.connection, "Already connected.", {
|
|
86350
86350
|
F: __dxlog_file3$1,
|
|
86351
|
-
L:
|
|
86351
|
+
L: 171,
|
|
86352
86352
|
S: this,
|
|
86353
86353
|
A: [
|
|
86354
86354
|
"!this.connection",
|
|
@@ -86363,7 +86363,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86363
86363
|
sessionId: $
|
|
86364
86364
|
}, {
|
|
86365
86365
|
F: __dxlog_file3$1,
|
|
86366
|
-
L:
|
|
86366
|
+
L: 173,
|
|
86367
86367
|
S: this,
|
|
86368
86368
|
C: (q, G) => q(...G)
|
|
86369
86369
|
});
|
|
@@ -86386,13 +86386,13 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86386
86386
|
remoteId: this.id
|
|
86387
86387
|
}, {
|
|
86388
86388
|
F: __dxlog_file3$1,
|
|
86389
|
-
L:
|
|
86389
|
+
L: 190,
|
|
86390
86390
|
S: this,
|
|
86391
86391
|
C: (q, G) => q(...G)
|
|
86392
86392
|
}), I.state !== ConnectionState.INITIAL) {
|
|
86393
86393
|
log$2("ignoring response", void 0, {
|
|
86394
86394
|
F: __dxlog_file3$1,
|
|
86395
|
-
L:
|
|
86395
|
+
L: 192,
|
|
86396
86396
|
S: this,
|
|
86397
86397
|
C: (q, G) => q(...G)
|
|
86398
86398
|
});
|
|
@@ -86406,7 +86406,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86406
86406
|
remoteId: this.id
|
|
86407
86407
|
}, {
|
|
86408
86408
|
F: __dxlog_file3$1,
|
|
86409
|
-
L:
|
|
86409
|
+
L: 196,
|
|
86410
86410
|
S: this,
|
|
86411
86411
|
C: (G, K) => G(...K)
|
|
86412
86412
|
}), await I.abort(q), q;
|
|
@@ -86426,7 +86426,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86426
86426
|
remoteId: this.id
|
|
86427
86427
|
}, {
|
|
86428
86428
|
F: __dxlog_file3$1,
|
|
86429
|
-
L:
|
|
86429
|
+
L: 209,
|
|
86430
86430
|
S: this,
|
|
86431
86431
|
C: (G, K) => G(...K)
|
|
86432
86432
|
}), await I.abort(q), q;
|
|
@@ -86436,7 +86436,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86436
86436
|
try {
|
|
86437
86437
|
log$2("opening connection as initiator", void 0, {
|
|
86438
86438
|
F: __dxlog_file3$1,
|
|
86439
|
-
L:
|
|
86439
|
+
L: 222,
|
|
86440
86440
|
S: this,
|
|
86441
86441
|
C: (q, G) => q(...G)
|
|
86442
86442
|
}), await I.openConnection(), this._callbacks.onAccepted();
|
|
@@ -86448,14 +86448,14 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86448
86448
|
remoteId: this.id
|
|
86449
86449
|
}, {
|
|
86450
86450
|
F: __dxlog_file3$1,
|
|
86451
|
-
L:
|
|
86451
|
+
L: 226,
|
|
86452
86452
|
S: this,
|
|
86453
86453
|
C: (G, K) => G(...K)
|
|
86454
86454
|
}), log$2.warn("closing connection due to unhandled error on openConnection", {
|
|
86455
86455
|
err: q
|
|
86456
86456
|
}, {
|
|
86457
86457
|
F: __dxlog_file3$1,
|
|
86458
|
-
L:
|
|
86458
|
+
L: 233,
|
|
86459
86459
|
S: this,
|
|
86460
86460
|
C: (G, K) => G(...K)
|
|
86461
86461
|
}), await this.closeConnection(q), q;
|
|
@@ -86477,12 +86477,12 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86477
86477
|
sessionId: I
|
|
86478
86478
|
}, {
|
|
86479
86479
|
F: __dxlog_file3$1,
|
|
86480
|
-
L:
|
|
86480
|
+
L: 247,
|
|
86481
86481
|
S: this,
|
|
86482
86482
|
C: (G, K) => G(...K)
|
|
86483
86483
|
}), invariant(!this.connection, "Already connected.", {
|
|
86484
86484
|
F: __dxlog_file3$1,
|
|
86485
|
-
L:
|
|
86485
|
+
L: 254,
|
|
86486
86486
|
S: this,
|
|
86487
86487
|
A: [
|
|
86488
86488
|
"!this.connection",
|
|
@@ -86514,7 +86514,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86514
86514
|
initiator: $
|
|
86515
86515
|
}, {
|
|
86516
86516
|
F: __dxlog_file3$1,
|
|
86517
|
-
L:
|
|
86517
|
+
L: 273,
|
|
86518
86518
|
S: this,
|
|
86519
86519
|
C: (G, K) => G(...K)
|
|
86520
86520
|
});
|
|
@@ -86527,12 +86527,12 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86527
86527
|
initiator: $
|
|
86528
86528
|
}, {
|
|
86529
86529
|
F: __dxlog_file3$1,
|
|
86530
|
-
L:
|
|
86530
|
+
L: 282,
|
|
86531
86531
|
S: this,
|
|
86532
86532
|
C: (K, Y) => K(...Y)
|
|
86533
86533
|
}), this._connectionLimiter.doneConnecting(I), invariant(this.connection === U, "Connection mismatch (race condition).", {
|
|
86534
86534
|
F: __dxlog_file3$1,
|
|
86535
|
-
L:
|
|
86535
|
+
L: 287,
|
|
86536
86536
|
S: this,
|
|
86537
86537
|
A: [
|
|
86538
86538
|
"this.connection === connection",
|
|
@@ -86546,7 +86546,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86546
86546
|
initiator: $
|
|
86547
86547
|
}, {
|
|
86548
86548
|
F: __dxlog_file3$1,
|
|
86549
|
-
L:
|
|
86549
|
+
L: 289,
|
|
86550
86550
|
S: this,
|
|
86551
86551
|
C: (K, Y) => K(...Y)
|
|
86552
86552
|
}), G instanceof ConnectionDisplacedError ? this.connectionDisplaced.emit(this.connection) : (this._lastConnectionTime && this._lastConnectionTime + CONNECTION_COUNTS_STABLE_AFTER < Date.now() ? this._availableAfter = 0 : (this.availableToConnect = !1, this._availableAfter = increaseInterval(this._availableAfter)), this._callbacks.onDisconnected(), scheduleTask(this._connectionCtx, () => {
|
|
@@ -86564,7 +86564,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86564
86564
|
err: G
|
|
86565
86565
|
}, {
|
|
86566
86566
|
F: __dxlog_file3$1,
|
|
86567
|
-
L:
|
|
86567
|
+
L: 329,
|
|
86568
86568
|
S: this,
|
|
86569
86569
|
C: (K, Y) => K(...Y)
|
|
86570
86570
|
}), log$2.trace("dxos.mesh.connection.error", {
|
|
@@ -86576,7 +86576,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86576
86576
|
err: G
|
|
86577
86577
|
}, {
|
|
86578
86578
|
F: __dxlog_file3$1,
|
|
86579
|
-
L:
|
|
86579
|
+
L: 336,
|
|
86580
86580
|
S: this,
|
|
86581
86581
|
C: (K, Y) => K(...Y)
|
|
86582
86582
|
}), this.closeConnection(G);
|
|
@@ -86591,7 +86591,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86591
86591
|
sessionId: I.sessionId
|
|
86592
86592
|
}, {
|
|
86593
86593
|
F: __dxlog_file3$1,
|
|
86594
|
-
L:
|
|
86594
|
+
L: 361,
|
|
86595
86595
|
S: this,
|
|
86596
86596
|
C: (U, q) => U(...q)
|
|
86597
86597
|
}), await I.close($), log$2("closed", {
|
|
@@ -86599,7 +86599,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86599
86599
|
sessionId: I.sessionId
|
|
86600
86600
|
}, {
|
|
86601
86601
|
F: __dxlog_file3$1,
|
|
86602
|
-
L:
|
|
86602
|
+
L: 367,
|
|
86603
86603
|
S: this,
|
|
86604
86604
|
C: (U, q) => U(...q)
|
|
86605
86605
|
});
|
|
@@ -86610,7 +86610,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86610
86610
|
message: $
|
|
86611
86611
|
}, {
|
|
86612
86612
|
F: __dxlog_file3$1,
|
|
86613
|
-
L:
|
|
86613
|
+
L: 372,
|
|
86614
86614
|
S: this,
|
|
86615
86615
|
C: (I, U) => I(...U)
|
|
86616
86616
|
});
|
|
@@ -86625,7 +86625,7 @@ var __dxlog_file3$1 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-ma
|
|
|
86625
86625
|
topic: this.topic
|
|
86626
86626
|
}, {
|
|
86627
86627
|
F: __dxlog_file3$1,
|
|
86628
|
-
L:
|
|
86628
|
+
L: 382,
|
|
86629
86629
|
S: this,
|
|
86630
86630
|
C: (U, q) => U(...q)
|
|
86631
86631
|
}), await ((I = this == null ? void 0 : this.connection) == null ? void 0 : I.close($));
|
|
@@ -87053,88 +87053,88 @@ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-man
|
|
|
87053
87053
|
}
|
|
87054
87054
|
}), Qn, MemoryTransport = (Qn = class {
|
|
87055
87055
|
constructor(I) {
|
|
87056
|
-
this.
|
|
87056
|
+
this._options = I, this._instanceId = PublicKey.random(), this._remote = new Trigger(), this._outgoingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY), this._incomingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY), this._closed = !1, this.closed = new Event$1(), this.connected = new Event$1(), this.errors = new ErrorStream(), invariant(!Qn._connections.has(this._instanceId), "Duplicate memory connection", {
|
|
87057
87057
|
F: __dxlog_file11,
|
|
87058
87058
|
L: 64,
|
|
87059
87059
|
S: this,
|
|
87060
|
-
C: (U, q) => U(...q)
|
|
87061
|
-
}), invariant(!Qn._connections.has(this._instanceId), "Duplicate memory connection", {
|
|
87062
|
-
F: __dxlog_file11,
|
|
87063
|
-
L: 66,
|
|
87064
|
-
S: this,
|
|
87065
87060
|
A: [
|
|
87066
87061
|
"!MemoryTransport._connections.has(this._instanceId)",
|
|
87067
87062
|
"'Duplicate memory connection'"
|
|
87068
87063
|
]
|
|
87069
|
-
}), Qn._connections.set(this._instanceId, this)
|
|
87064
|
+
}), Qn._connections.set(this._instanceId, this);
|
|
87065
|
+
}
|
|
87066
|
+
get isOpen() {
|
|
87067
|
+
return !this._closed;
|
|
87068
|
+
}
|
|
87069
|
+
async open() {
|
|
87070
|
+
if (log$2("opening...", void 0, {
|
|
87071
|
+
F: __dxlog_file11,
|
|
87072
|
+
L: 74,
|
|
87073
|
+
S: this,
|
|
87074
|
+
C: (I, U) => I(...U)
|
|
87075
|
+
}), this._options.initiator) {
|
|
87070
87076
|
log$2("sending signal", void 0, {
|
|
87071
87077
|
F: __dxlog_file11,
|
|
87072
|
-
L:
|
|
87078
|
+
L: 78,
|
|
87073
87079
|
S: this,
|
|
87074
|
-
C: (
|
|
87075
|
-
}), this.options.sendSignal({
|
|
87076
|
-
payload: {
|
|
87077
|
-
transportId: this._instanceId.toHex()
|
|
87078
|
-
}
|
|
87079
|
-
}).catch((U) => {
|
|
87080
|
-
this._destroyed || this.errors.raise(U);
|
|
87080
|
+
C: (I, U) => I(...U)
|
|
87081
87081
|
});
|
|
87082
|
-
|
|
87083
|
-
|
|
87084
|
-
|
|
87085
|
-
|
|
87086
|
-
|
|
87087
|
-
|
|
87088
|
-
|
|
87089
|
-
|
|
87090
|
-
invariant(!this._remoteConnection._remoteConnection, `Remote already connected: ${this._remoteInstanceId}`, {
|
|
87091
|
-
F: __dxlog_file11,
|
|
87092
|
-
L: 99,
|
|
87093
|
-
S: this,
|
|
87094
|
-
A: [
|
|
87095
|
-
"!this._remoteConnection._remoteConnection",
|
|
87096
|
-
"`Remote already connected: ${this._remoteInstanceId}`"
|
|
87097
|
-
]
|
|
87098
|
-
}), this._remoteConnection._remoteConnection = this, this._remoteConnection._remoteInstanceId = this._instanceId, log$2("connected", void 0, {
|
|
87099
|
-
F: __dxlog_file11,
|
|
87100
|
-
L: 103,
|
|
87101
|
-
S: this,
|
|
87102
|
-
C: (q, G) => q(...G)
|
|
87103
|
-
}), this.options.stream.pipe(this._outgoingDelay).pipe(this._remoteConnection.options.stream).pipe(this._incomingDelay).pipe(this.options.stream), this.connected.emit(), this._remoteConnection.connected.emit();
|
|
87082
|
+
try {
|
|
87083
|
+
await this._options.sendSignal({
|
|
87084
|
+
payload: {
|
|
87085
|
+
transportId: this._instanceId.toHex()
|
|
87086
|
+
}
|
|
87087
|
+
});
|
|
87088
|
+
} catch (I) {
|
|
87089
|
+
this._closed || this.errors.raise(toError(I));
|
|
87104
87090
|
}
|
|
87105
|
-
}
|
|
87106
|
-
this.
|
|
87107
|
-
|
|
87091
|
+
} else
|
|
87092
|
+
this._remote.wait({
|
|
87093
|
+
timeout: this._options.timeout ?? 1e3
|
|
87094
|
+
}).then((I) => {
|
|
87095
|
+
if (!this._closed) {
|
|
87096
|
+
if (this._remoteInstanceId = I, this._remoteConnection = Qn._connections.get(this._remoteInstanceId), !this._remoteConnection) {
|
|
87097
|
+
this._closed = !0, this.closed.emit();
|
|
87098
|
+
return;
|
|
87099
|
+
}
|
|
87100
|
+
invariant(!this._remoteConnection._remoteConnection, `Remote already connected: ${this._remoteInstanceId}`, {
|
|
87101
|
+
F: __dxlog_file11,
|
|
87102
|
+
L: 104,
|
|
87103
|
+
S: this,
|
|
87104
|
+
A: [
|
|
87105
|
+
"!this._remoteConnection._remoteConnection",
|
|
87106
|
+
"`Remote already connected: ${this._remoteInstanceId}`"
|
|
87107
|
+
]
|
|
87108
|
+
}), this._remoteConnection._remoteConnection = this, this._remoteConnection._remoteInstanceId = this._instanceId, log$2("connected", void 0, {
|
|
87109
|
+
F: __dxlog_file11,
|
|
87110
|
+
L: 108,
|
|
87111
|
+
S: this,
|
|
87112
|
+
C: (U, q) => U(...q)
|
|
87113
|
+
}), this._options.stream.pipe(this._outgoingDelay).pipe(this._remoteConnection._options.stream).pipe(this._incomingDelay).pipe(this._options.stream), this.connected.emit(), this._remoteConnection.connected.emit();
|
|
87114
|
+
}
|
|
87115
|
+
}).catch((I) => {
|
|
87116
|
+
this._closed || this.errors.raise(I);
|
|
87117
|
+
});
|
|
87108
87118
|
}
|
|
87109
|
-
async
|
|
87110
|
-
log$2("closing", void 0, {
|
|
87111
|
-
F: __dxlog_file11,
|
|
87112
|
-
L: 124,
|
|
87113
|
-
S: this,
|
|
87114
|
-
C: (I, U) => I(...U)
|
|
87115
|
-
}), this._destroyed = !0, Qn._connections.delete(this._instanceId), this._remoteConnection && (log$2("closing", void 0, {
|
|
87119
|
+
async close() {
|
|
87120
|
+
log$2("closing...", void 0, {
|
|
87116
87121
|
F: __dxlog_file11,
|
|
87117
87122
|
L: 129,
|
|
87118
87123
|
S: this,
|
|
87119
87124
|
C: (I, U) => I(...U)
|
|
87120
|
-
}), this._remoteConnection.
|
|
87125
|
+
}), this._closed = !0, Qn._connections.delete(this._instanceId), this._remoteConnection && (this._remoteConnection._closed = !0, Qn._connections.delete(this._remoteInstanceId), this._options.stream.unpipe(this._incomingDelay), this._incomingDelay.unpipe(this._remoteConnection._options.stream), this._remoteConnection._options.stream.unpipe(this._outgoingDelay), this._outgoingDelay.unpipe(this._options.stream), this._options.stream.unpipe(this._outgoingDelay), this._remoteConnection.closed.emit(), this._remoteConnection._remoteConnection = void 0, this._remoteConnection = void 0), this.closed.emit(), log$2("closed", void 0, {
|
|
87121
87126
|
F: __dxlog_file11,
|
|
87122
|
-
L:
|
|
87123
|
-
S: this,
|
|
87124
|
-
C: (I, U) => I(...U)
|
|
87125
|
-
})), this.closed.emit(), log$2("closed", void 0, {
|
|
87126
|
-
F: __dxlog_file11,
|
|
87127
|
-
L: 154,
|
|
87127
|
+
L: 157,
|
|
87128
87128
|
S: this,
|
|
87129
87129
|
C: (I, U) => I(...U)
|
|
87130
87130
|
});
|
|
87131
87131
|
}
|
|
87132
|
-
|
|
87132
|
+
async onSignal({ payload: I }) {
|
|
87133
87133
|
if (log$2("received signal", {
|
|
87134
87134
|
payload: I
|
|
87135
87135
|
}, {
|
|
87136
87136
|
F: __dxlog_file11,
|
|
87137
|
-
L:
|
|
87137
|
+
L: 161,
|
|
87138
87138
|
S: this,
|
|
87139
87139
|
C: (q, G) => q(...G)
|
|
87140
87140
|
}), !(I != null && I.transportId))
|
|
@@ -87163,9 +87163,9 @@ _ts_decorate4$1([
|
|
|
87163
87163
|
_ts_decorate4$1([
|
|
87164
87164
|
logInfo
|
|
87165
87165
|
], MemoryTransport.prototype, "_remoteInstanceId", void 0);
|
|
87166
|
-
var TransportKind;
|
|
87166
|
+
var toError = ($) => $ instanceof Error ? $ : new Error(String($)), TransportKind;
|
|
87167
87167
|
(function($) {
|
|
87168
|
-
$.SIMPLE_PEER = "SIMPLE_PEER", $.
|
|
87168
|
+
$.SIMPLE_PEER = "SIMPLE_PEER", $.SIMPLE_PEER_PROXY = "SIMPLE_PEER_PROXY", $.LIBDATACHANNEL = "LIBDATACHANNEL", $.MEMORY = "MEMORY", $.TCP = "TCP";
|
|
87169
87169
|
})(TransportKind || (TransportKind = {}));
|
|
87170
87170
|
var wrtc = null;
|
|
87171
87171
|
try {
|
|
@@ -87183,115 +87183,146 @@ function _ts_decorate5$1($, I, U, q) {
|
|
|
87183
87183
|
}
|
|
87184
87184
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/libdatachannel-transport.ts", DATACHANNEL_LABEL = "dxos.mesh.transport", MAX_BUFFERED_AMOUNT = 64 * 1024, MAX_MESSAGE_SIZE = 64 * 1024, or, LibDataChannelTransport = (or = class {
|
|
87185
87185
|
constructor(I) {
|
|
87186
|
-
this.
|
|
87187
|
-
|
|
87188
|
-
|
|
87189
|
-
|
|
87190
|
-
|
|
87191
|
-
|
|
87192
|
-
|
|
87193
|
-
|
|
87194
|
-
|
|
87195
|
-
|
|
87196
|
-
|
|
87197
|
-
|
|
87198
|
-
|
|
87199
|
-
|
|
87200
|
-
|
|
87201
|
-
|
|
87202
|
-
|
|
87203
|
-
|
|
87204
|
-
|
|
87205
|
-
|
|
87206
|
-
|
|
87207
|
-
|
|
87208
|
-
|
|
87209
|
-
|
|
87210
|
-
|
|
87211
|
-
|
|
87212
|
-
|
|
87213
|
-
|
|
87214
|
-
|
|
87215
|
-
|
|
87216
|
-
|
|
87217
|
-
|
|
87218
|
-
|
|
87219
|
-
|
|
87220
|
-
|
|
87221
|
-
|
|
87222
|
-
|
|
87223
|
-
|
|
87224
|
-
|
|
87225
|
-
|
|
87226
|
-
|
|
87227
|
-
|
|
87228
|
-
|
|
87229
|
-
|
|
87230
|
-
|
|
87231
|
-
|
|
87186
|
+
this._options = I, this._closed = !1, this._connected = !1, this._writeCallback = null, this._readyForCandidates = new Trigger(), this.closed = new Event$1(), this.connected = new Event$1(), this.errors = new ErrorStream();
|
|
87187
|
+
}
|
|
87188
|
+
get isOpen() {
|
|
87189
|
+
return !!this._peer && !this._closed;
|
|
87190
|
+
}
|
|
87191
|
+
async open() {
|
|
87192
|
+
this._closed && this.errors.raise(new Error("connection already closed"));
|
|
87193
|
+
const { RTCPeerConnection: I } = (await importESM("node-datachannel/polyfill")).default;
|
|
87194
|
+
this._options.webrtcConfig ? this._options.webrtcConfig.iceServers = this._options.webrtcConfig.iceServers ?? [] : this._options.webrtcConfig = {
|
|
87195
|
+
iceServers: []
|
|
87196
|
+
}, this._peer = new I(this._options.webrtcConfig), this._peer.onicecandidateerror = (U) => {
|
|
87197
|
+
log$2.error("peer.onicecandidateerror", {
|
|
87198
|
+
event: U
|
|
87199
|
+
}, {
|
|
87200
|
+
F: __dxlog_file15,
|
|
87201
|
+
L: 77,
|
|
87202
|
+
S: this,
|
|
87203
|
+
C: (q, G) => q(...G)
|
|
87204
|
+
});
|
|
87205
|
+
}, this._peer.onconnectionstatechange = (U) => {
|
|
87206
|
+
var q;
|
|
87207
|
+
log$2.debug("peer.onconnectionstatechange", {
|
|
87208
|
+
event: U,
|
|
87209
|
+
peerConnectionState: (q = this._peer) == null ? void 0 : q.connectionState,
|
|
87210
|
+
transportConnectionState: this._connected
|
|
87211
|
+
}, {
|
|
87212
|
+
F: __dxlog_file15,
|
|
87213
|
+
L: 81,
|
|
87214
|
+
S: this,
|
|
87215
|
+
C: (G, K) => G(...K)
|
|
87216
|
+
});
|
|
87217
|
+
}, this._peer.onicecandidate = async (U) => {
|
|
87218
|
+
if (log$2.debug("peer.onicecandidate", {
|
|
87219
|
+
event: U
|
|
87220
|
+
}, {
|
|
87221
|
+
F: __dxlog_file15,
|
|
87222
|
+
L: 91,
|
|
87223
|
+
S: this,
|
|
87224
|
+
C: (q, G) => q(...G)
|
|
87225
|
+
}), U.candidate)
|
|
87226
|
+
try {
|
|
87227
|
+
await this._options.sendSignal({
|
|
87228
|
+
payload: {
|
|
87229
|
+
data: {
|
|
87230
|
+
type: "candidate",
|
|
87231
|
+
candidate: {
|
|
87232
|
+
candidate: U.candidate.candidate,
|
|
87233
|
+
// These fields never seem to be not null, but connecting to Chrome doesn't work if they are.
|
|
87234
|
+
sdpMLineIndex: U.candidate.sdpMLineIndex ?? 0,
|
|
87235
|
+
sdpMid: U.candidate.sdpMid ?? 0
|
|
87232
87236
|
}
|
|
87233
87237
|
}
|
|
87234
|
-
}
|
|
87235
|
-
}
|
|
87236
|
-
|
|
87237
|
-
|
|
87238
|
-
|
|
87239
|
-
F: __dxlog_file15,
|
|
87240
|
-
L: 93,
|
|
87241
|
-
S: this,
|
|
87242
|
-
C: (Y, J) => Y(...J)
|
|
87243
|
-
});
|
|
87244
|
-
}
|
|
87245
|
-
}, I.initiator ? (q.createOffer().then(async (G) => {
|
|
87246
|
-
if (!this._closed)
|
|
87247
|
-
return q.connectionState !== "connecting" && (log$2.error("i am initiator but peer not in state connecting", {
|
|
87248
|
-
peer: q
|
|
87249
|
-
}, {
|
|
87250
|
-
F: __dxlog_file15,
|
|
87251
|
-
L: 106,
|
|
87252
|
-
S: this,
|
|
87253
|
-
C: (K, Y) => K(...Y)
|
|
87254
|
-
}), this.errors.raise(new Error("invalid state: peer is initiator, but other peer not in state connecting"))), log$2.debug(`im the initiator, creating offer, peer is in state ${q.connectionState}`, {
|
|
87255
|
-
offer: G
|
|
87238
|
+
}
|
|
87239
|
+
});
|
|
87240
|
+
} catch (q) {
|
|
87241
|
+
log$2.info("signaling error", {
|
|
87242
|
+
err: q
|
|
87256
87243
|
}, {
|
|
87257
87244
|
F: __dxlog_file15,
|
|
87258
|
-
L:
|
|
87245
|
+
L: 108,
|
|
87259
87246
|
S: this,
|
|
87260
|
-
C: (
|
|
87261
|
-
})
|
|
87262
|
-
|
|
87263
|
-
|
|
87264
|
-
|
|
87265
|
-
|
|
87266
|
-
|
|
87267
|
-
|
|
87268
|
-
|
|
87269
|
-
|
|
87270
|
-
|
|
87271
|
-
|
|
87247
|
+
C: (G, K) => G(...K)
|
|
87248
|
+
});
|
|
87249
|
+
}
|
|
87250
|
+
}, this._options.initiator ? (invariant(this._peer, "not open", {
|
|
87251
|
+
F: __dxlog_file15,
|
|
87252
|
+
L: 114,
|
|
87253
|
+
S: this,
|
|
87254
|
+
A: [
|
|
87255
|
+
"this._peer",
|
|
87256
|
+
"'not open'"
|
|
87257
|
+
]
|
|
87258
|
+
}), this._peer.createOffer().then(async (U) => {
|
|
87259
|
+
var q;
|
|
87260
|
+
this._closed || (((q = this._peer) == null ? void 0 : q.connectionState) !== "connecting" && (log$2.error("peer not connecting", {
|
|
87261
|
+
peer: this._peer
|
|
87262
|
+
}, {
|
|
87272
87263
|
F: __dxlog_file15,
|
|
87273
|
-
L:
|
|
87264
|
+
L: 125,
|
|
87274
87265
|
S: this,
|
|
87275
87266
|
C: (G, K) => G(...K)
|
|
87276
|
-
}),
|
|
87277
|
-
this.
|
|
87278
|
-
|
|
87279
|
-
|
|
87280
|
-
|
|
87281
|
-
|
|
87282
|
-
|
|
87283
|
-
|
|
87284
|
-
|
|
87285
|
-
|
|
87286
|
-
|
|
87287
|
-
|
|
87288
|
-
|
|
87267
|
+
}), this.errors.raise(new Error("invalid state: peer is initiator, but other peer not in state connecting"))), log$2.debug("creating offer", {
|
|
87268
|
+
peer: this._peer,
|
|
87269
|
+
offer: U
|
|
87270
|
+
}, {
|
|
87271
|
+
F: __dxlog_file15,
|
|
87272
|
+
L: 129,
|
|
87273
|
+
S: this,
|
|
87274
|
+
C: (G, K) => G(...K)
|
|
87275
|
+
}), await this._peer.setLocalDescription(U), await this._options.sendSignal({
|
|
87276
|
+
payload: {
|
|
87277
|
+
data: {
|
|
87278
|
+
type: U.type,
|
|
87279
|
+
sdp: U.sdp
|
|
87280
|
+
}
|
|
87281
|
+
}
|
|
87282
|
+
}));
|
|
87283
|
+
}).catch((U) => {
|
|
87284
|
+
this.errors.raise(U);
|
|
87285
|
+
}), this._handleChannel(this._peer.createDataChannel(DATACHANNEL_LABEL)), log$2.debug("created data channel", void 0, {
|
|
87286
|
+
F: __dxlog_file15,
|
|
87287
|
+
L: 139,
|
|
87288
|
+
S: this,
|
|
87289
|
+
C: (U, q) => U(...q)
|
|
87290
|
+
}), this._peer.ondatachannel = () => {
|
|
87291
|
+
this.errors.raise(new Error("unexpected ondatachannel event for initiator"));
|
|
87292
|
+
}) : this._peer.ondatachannel = (U) => {
|
|
87293
|
+
log$2.debug("peer.ondatachannel (non-initiator)", {
|
|
87294
|
+
event: U
|
|
87295
|
+
}, {
|
|
87296
|
+
F: __dxlog_file15,
|
|
87297
|
+
L: 145,
|
|
87298
|
+
S: this,
|
|
87299
|
+
C: (q, G) => q(...G)
|
|
87300
|
+
}), U.channel.label !== DATACHANNEL_LABEL && this.errors.raise(new Error(`unexpected channel label ${U.channel.label}`)), this._handleChannel(U.channel);
|
|
87301
|
+
}, or._instanceCount++;
|
|
87302
|
+
}
|
|
87303
|
+
async close() {
|
|
87304
|
+
await this._close(), --or._instanceCount === 0 && (await importESM("node-datachannel")).cleanup();
|
|
87305
|
+
}
|
|
87306
|
+
async _close() {
|
|
87307
|
+
var I;
|
|
87308
|
+
if (!this._closed) {
|
|
87309
|
+
await this._disconnectStreams();
|
|
87310
|
+
try {
|
|
87311
|
+
(I = this._peer) == null || I.close();
|
|
87312
|
+
} catch (U) {
|
|
87313
|
+
this.errors.raise(U);
|
|
87314
|
+
}
|
|
87315
|
+
this._peer = void 0, this._closed = !0, this.closed.emit();
|
|
87316
|
+
}
|
|
87289
87317
|
}
|
|
87290
|
-
|
|
87318
|
+
/**
|
|
87319
|
+
* Handle data channel events.
|
|
87320
|
+
*/
|
|
87321
|
+
_handleChannel(I) {
|
|
87291
87322
|
this._channel = I, this._channel.onopen = () => {
|
|
87292
|
-
log$2.debug("
|
|
87323
|
+
log$2.debug("channel.onopen", void 0, {
|
|
87293
87324
|
F: __dxlog_file15,
|
|
87294
|
-
L:
|
|
87325
|
+
L: 190,
|
|
87295
87326
|
S: this,
|
|
87296
87327
|
C: (q, G) => q(...G)
|
|
87297
87328
|
});
|
|
@@ -87305,146 +87336,131 @@ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-man
|
|
|
87305
87336
|
} catch (Y) {
|
|
87306
87337
|
this.errors.raise(Y), await this._close();
|
|
87307
87338
|
}
|
|
87308
|
-
this._channel.bufferedAmount > MAX_BUFFERED_AMOUNT ? (this._writeCallback !== null && log$2.error("consumer trying to write before we
|
|
87339
|
+
this._channel.bufferedAmount > MAX_BUFFERED_AMOUNT ? (this._writeCallback !== null && log$2.error("consumer trying to write before we are ready for more data", void 0, {
|
|
87309
87340
|
F: __dxlog_file15,
|
|
87310
|
-
L:
|
|
87341
|
+
L: 207,
|
|
87311
87342
|
S: this,
|
|
87312
87343
|
C: (Y, J) => Y(...J)
|
|
87313
87344
|
}), this._writeCallback = K) : K();
|
|
87314
87345
|
}
|
|
87315
87346
|
});
|
|
87316
|
-
U.pipe(this.
|
|
87317
|
-
}, this._channel.onerror = async (U) => {
|
|
87318
|
-
this.errors.raise(new Error("channel error: " + U.toString())), await this._close();
|
|
87347
|
+
U.pipe(this._options.stream).pipe(U), this._stream = U, this._connected = !0, this.connected.emit();
|
|
87319
87348
|
}, this._channel.onclose = async (U) => {
|
|
87320
|
-
log$2.info("channel
|
|
87349
|
+
log$2.info("channel.onclose", {
|
|
87321
87350
|
err: U
|
|
87322
87351
|
}, {
|
|
87323
87352
|
F: __dxlog_file15,
|
|
87324
|
-
L:
|
|
87353
|
+
L: 223,
|
|
87325
87354
|
S: this,
|
|
87326
87355
|
C: (q, G) => q(...G)
|
|
87327
87356
|
}), await this._close();
|
|
87328
|
-
}, this._channel.
|
|
87329
|
-
|
|
87330
|
-
q instanceof ArrayBuffer && (q = export_Buffer.from(q)), this._stream.push(q);
|
|
87357
|
+
}, this._channel.onerror = async (U) => {
|
|
87358
|
+
this.errors.raise(new Error("channel error: " + U.toString())), await this._close();
|
|
87331
87359
|
}, this._channel.onbufferedamountlow = () => {
|
|
87332
87360
|
const U = this._writeCallback;
|
|
87333
87361
|
this._writeCallback = null, U == null || U();
|
|
87362
|
+
}, this._channel.onmessage = (U) => {
|
|
87363
|
+
let q = U.data;
|
|
87364
|
+
q instanceof ArrayBuffer && (q = export_Buffer.from(q)), this._stream.push(q);
|
|
87334
87365
|
};
|
|
87335
87366
|
}
|
|
87336
|
-
async
|
|
87337
|
-
|
|
87338
|
-
|
|
87339
|
-
|
|
87340
|
-
|
|
87367
|
+
async onSignal(I) {
|
|
87368
|
+
invariant(this._peer, "not open", {
|
|
87369
|
+
F: __dxlog_file15,
|
|
87370
|
+
L: 249,
|
|
87371
|
+
S: this,
|
|
87372
|
+
A: [
|
|
87373
|
+
"this._peer",
|
|
87374
|
+
"'not open'"
|
|
87375
|
+
]
|
|
87376
|
+
});
|
|
87341
87377
|
try {
|
|
87342
|
-
I.
|
|
87343
|
-
|
|
87344
|
-
this.errors.raise(U);
|
|
87345
|
-
}
|
|
87346
|
-
this._closed = !0, this.closed.emit();
|
|
87347
|
-
}
|
|
87348
|
-
signal(I) {
|
|
87349
|
-
this._peer.then(async (U) => {
|
|
87350
|
-
const q = I.payload.data;
|
|
87351
|
-
switch (q.type) {
|
|
87378
|
+
const U = I.payload.data;
|
|
87379
|
+
switch (U.type) {
|
|
87352
87380
|
case "offer": {
|
|
87353
|
-
if (
|
|
87381
|
+
if (this._peer.connectionState !== "new") {
|
|
87354
87382
|
log$2.error("received offer but peer not in state new", {
|
|
87355
|
-
peer:
|
|
87383
|
+
peer: this._peer
|
|
87356
87384
|
}, {
|
|
87357
87385
|
F: __dxlog_file15,
|
|
87358
|
-
L:
|
|
87386
|
+
L: 256,
|
|
87359
87387
|
S: this,
|
|
87360
|
-
C: (
|
|
87388
|
+
C: (q, G) => q(...G)
|
|
87361
87389
|
}), this.errors.raise(new Error("invalid signalling state: received offer when peer is not in state new"));
|
|
87362
87390
|
break;
|
|
87363
87391
|
}
|
|
87364
87392
|
try {
|
|
87365
|
-
await
|
|
87366
|
-
type:
|
|
87367
|
-
sdp:
|
|
87393
|
+
await this._peer.setRemoteDescription({
|
|
87394
|
+
type: U.type,
|
|
87395
|
+
sdp: U.sdp
|
|
87368
87396
|
});
|
|
87369
|
-
const
|
|
87370
|
-
await
|
|
87397
|
+
const q = await this._peer.createAnswer();
|
|
87398
|
+
await this._peer.setLocalDescription(q), await this._options.sendSignal({
|
|
87371
87399
|
payload: {
|
|
87372
87400
|
data: {
|
|
87373
|
-
type:
|
|
87374
|
-
sdp:
|
|
87401
|
+
type: q.type,
|
|
87402
|
+
sdp: q.sdp
|
|
87375
87403
|
}
|
|
87376
87404
|
}
|
|
87377
87405
|
}), this._readyForCandidates.wake();
|
|
87378
|
-
} catch (
|
|
87379
|
-
log$2.error("
|
|
87380
|
-
err:
|
|
87406
|
+
} catch (q) {
|
|
87407
|
+
log$2.error("cannot handle offer from signalling server", {
|
|
87408
|
+
err: q
|
|
87381
87409
|
}, {
|
|
87382
87410
|
F: __dxlog_file15,
|
|
87383
|
-
L:
|
|
87411
|
+
L: 268,
|
|
87384
87412
|
S: this,
|
|
87385
|
-
C: (
|
|
87413
|
+
C: (G, K) => G(...K)
|
|
87386
87414
|
}), this.errors.raise(new Error("error handling offer"));
|
|
87387
87415
|
}
|
|
87388
87416
|
break;
|
|
87389
87417
|
}
|
|
87390
87418
|
case "answer":
|
|
87391
87419
|
try {
|
|
87392
|
-
await
|
|
87393
|
-
type:
|
|
87394
|
-
sdp:
|
|
87420
|
+
await this._peer.setRemoteDescription({
|
|
87421
|
+
type: U.type,
|
|
87422
|
+
sdp: U.sdp
|
|
87395
87423
|
}), this._readyForCandidates.wake();
|
|
87396
|
-
} catch (
|
|
87397
|
-
log$2.error("
|
|
87398
|
-
err:
|
|
87424
|
+
} catch (q) {
|
|
87425
|
+
log$2.error("cannot handle answer from signalling server", {
|
|
87426
|
+
err: q
|
|
87399
87427
|
}, {
|
|
87400
87428
|
F: __dxlog_file15,
|
|
87401
|
-
L:
|
|
87429
|
+
L: 279,
|
|
87402
87430
|
S: this,
|
|
87403
|
-
C: (
|
|
87431
|
+
C: (G, K) => G(...K)
|
|
87404
87432
|
}), this.errors.raise(new Error("error handling answer"));
|
|
87405
87433
|
}
|
|
87406
87434
|
break;
|
|
87407
87435
|
case "candidate":
|
|
87408
|
-
await this._readyForCandidates.wait(), await
|
|
87409
|
-
candidate:
|
|
87436
|
+
await this._readyForCandidates.wait(), await this._peer.addIceCandidate({
|
|
87437
|
+
candidate: U.candidate.candidate
|
|
87410
87438
|
});
|
|
87411
87439
|
break;
|
|
87412
87440
|
default:
|
|
87413
87441
|
log$2.error("unhandled signal type", {
|
|
87414
|
-
type:
|
|
87442
|
+
type: U.type,
|
|
87415
87443
|
signal: I
|
|
87416
87444
|
}, {
|
|
87417
87445
|
F: __dxlog_file15,
|
|
87418
|
-
L:
|
|
87446
|
+
L: 290,
|
|
87419
87447
|
S: this,
|
|
87420
|
-
C: (
|
|
87421
|
-
}), this.errors.raise(new Error(`unhandled signal type ${
|
|
87448
|
+
C: (q, G) => q(...G)
|
|
87449
|
+
}), this.errors.raise(new Error(`unhandled signal type ${U.type}`));
|
|
87422
87450
|
}
|
|
87423
|
-
}
|
|
87451
|
+
} catch (U) {
|
|
87424
87452
|
log$2.catch(U, void 0, {
|
|
87425
87453
|
F: __dxlog_file15,
|
|
87426
|
-
L:
|
|
87454
|
+
L: 294,
|
|
87427
87455
|
S: this,
|
|
87428
87456
|
C: (q, G) => q(...G)
|
|
87429
87457
|
});
|
|
87430
|
-
}
|
|
87458
|
+
}
|
|
87431
87459
|
}
|
|
87432
87460
|
async getDetails() {
|
|
87433
87461
|
const I = await this._getStats(), U = I == null ? void 0 : I.remoteCandidate;
|
|
87434
87462
|
return U ? U.candidateType === "relay" ? `${U.ip}:${U.port} relay for ${U.relatedAddress}:${U.relatedPort}` : `${U.ip}:${U.port} ${U.candidateType}` : "unavailable";
|
|
87435
87463
|
}
|
|
87436
|
-
async _getStats() {
|
|
87437
|
-
return this._peer.then(async (I) => {
|
|
87438
|
-
const U = await I.getStats(), q = Array.from(U.entries()), G = q.filter((Z) => Z[1].type === "transport")[0][1], K = q.filter((Z) => Z[0] === G.selectedCandidatePairId);
|
|
87439
|
-
let Y, J;
|
|
87440
|
-
return K.length > 0 && (Y = K[0][1], J = q.filter((Z) => Z[0] === Y.remoteCandidateId)[0][1]), {
|
|
87441
|
-
transport: G,
|
|
87442
|
-
selectedCandidatePair: Y,
|
|
87443
|
-
remoteCandidate: J,
|
|
87444
|
-
raw: Object.fromEntries(U)
|
|
87445
|
-
};
|
|
87446
|
-
});
|
|
87447
|
-
}
|
|
87448
87464
|
async getStats() {
|
|
87449
87465
|
const I = await this._getStats();
|
|
87450
87466
|
return I ? {
|
|
@@ -87461,12 +87477,28 @@ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-man
|
|
|
87461
87477
|
rawStats: {}
|
|
87462
87478
|
};
|
|
87463
87479
|
}
|
|
87464
|
-
async
|
|
87465
|
-
|
|
87480
|
+
async _getStats() {
|
|
87481
|
+
invariant(this._peer, "not open", {
|
|
87482
|
+
F: __dxlog_file15,
|
|
87483
|
+
L: 334,
|
|
87484
|
+
S: this,
|
|
87485
|
+
A: [
|
|
87486
|
+
"this._peer",
|
|
87487
|
+
"'not open'"
|
|
87488
|
+
]
|
|
87489
|
+
});
|
|
87490
|
+
const I = await this._peer.getStats(), U = Array.from(I.entries()), q = U.filter((J) => J[1].type === "transport")[0][1], G = U.filter((J) => J[0] === q.selectedCandidatePairId);
|
|
87491
|
+
let K, Y;
|
|
87492
|
+
return G.length > 0 && (K = G[0][1], Y = U.filter((J) => J[0] === K.remoteCandidateId)[0][1]), {
|
|
87493
|
+
transport: q,
|
|
87494
|
+
selectedCandidatePair: K,
|
|
87495
|
+
remoteCandidate: Y,
|
|
87496
|
+
raw: Object.fromEntries(I)
|
|
87497
|
+
};
|
|
87466
87498
|
}
|
|
87467
87499
|
async _disconnectStreams() {
|
|
87468
87500
|
var I, U, q, G;
|
|
87469
|
-
(G = (q = (U = (I = this.
|
|
87501
|
+
(G = (q = (U = (I = this._options.stream).unpipe) == null ? void 0 : U.call(I, this._stream)) == null ? void 0 : q.unpipe) == null || G.call(q, this._options.stream);
|
|
87470
87502
|
}
|
|
87471
87503
|
}, or._instanceCount = 0, or);
|
|
87472
87504
|
_ts_decorate5$1([
|
|
@@ -88723,7 +88755,7 @@ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client/src/services
|
|
|
88723
88755
|
return this._client.rpc;
|
|
88724
88756
|
}
|
|
88725
88757
|
async open() {
|
|
88726
|
-
const { WebsocketRpcClient: $ } = await import("./index-
|
|
88758
|
+
const { WebsocketRpcClient: $ } = await import("./index-CDxW6lWP.mjs");
|
|
88727
88759
|
this._client = new $({
|
|
88728
88760
|
url: getUnixSocket(this._profile, "ws+unix"),
|
|
88729
88761
|
requested: clientServiceBundle,
|
|
@@ -93644,7 +93676,11 @@ const identityMachine = createMachine(
|
|
|
93644
93676
|
}
|
|
93645
93677
|
}, []);
|
|
93646
93678
|
return { onAgentCreate: async () => {
|
|
93647
|
-
I.forEach((ae) => ae.cancel()), $.halo.share({
|
|
93679
|
+
I.forEach((ae) => ae.cancel()), $.halo.share({
|
|
93680
|
+
type: Invitation.Type.INTERACTIVE,
|
|
93681
|
+
authMethod: Invitation.AuthMethod.NONE,
|
|
93682
|
+
multiUse: !0
|
|
93683
|
+
}).subscribe(ee);
|
|
93648
93684
|
}, onAgentDestroy: async () => {
|
|
93649
93685
|
const re = $.halo.identity.get();
|
|
93650
93686
|
invariant(re, "Identity not found");
|
|
@@ -94834,11 +94870,11 @@ const invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
94834
94870
|
active: I,
|
|
94835
94871
|
send: U,
|
|
94836
94872
|
status: q,
|
|
94837
|
-
|
|
94873
|
+
multiUse: G,
|
|
94838
94874
|
authCode: K,
|
|
94839
94875
|
id: Y = "0"
|
|
94840
94876
|
}) => {
|
|
94841
|
-
const { t: J } = useTranslation("os"), Z = useId("invitation-manager__qr-code"), Q = G
|
|
94877
|
+
const { t: J } = useTranslation("os"), Z = useId("invitation-manager__qr-code"), Q = G ? 0 : invitationStatusValue.get(q) ?? 0, ee = Q === 3, te = hexToEmoji(Y), ne = useMemo(() => {
|
|
94842
94878
|
switch (!0) {
|
|
94843
94879
|
case Q === 5:
|
|
94844
94880
|
case Q < 0:
|
|
@@ -94849,7 +94885,7 @@ const invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
94849
94885
|
return "showing qr";
|
|
94850
94886
|
}
|
|
94851
94887
|
}, [Q]);
|
|
94852
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Viewport.Root, { activeView: ne, classNames: "grow plb-1" }, /* @__PURE__ */ React__default.createElement(Viewport.Views, null, /* @__PURE__ */ React__default.createElement(InvitationManagerView, { id: "showing qr", emoji: te }, /* @__PURE__ */ React__default.createElement("p", { className: "text-sm mlb-1 font-normal text-center" }, J(G
|
|
94888
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Viewport.Root, { activeView: ne, classNames: "grow plb-1" }, /* @__PURE__ */ React__default.createElement(Viewport.Views, null, /* @__PURE__ */ React__default.createElement(InvitationManagerView, { id: "showing qr", emoji: te }, /* @__PURE__ */ React__default.createElement("p", { className: "text-sm mlb-1 font-normal text-center" }, J(G ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React__default.createElement("div", { role: "none", className: mx(descriptionText, "is-full max-is-[14rem] relative") }, /* @__PURE__ */ React__default.createElement(
|
|
94853
94889
|
QR,
|
|
94854
94890
|
{
|
|
94855
94891
|
rounding: 100,
|
|
@@ -96109,6 +96145,7 @@ const invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
96109
96145
|
const Z = (Q = I.share) == null ? void 0 : Q.call(I, {
|
|
96110
96146
|
type: Invitation.Type.INTERACTIVE,
|
|
96111
96147
|
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
96148
|
+
multiUse: !1,
|
|
96112
96149
|
target: U
|
|
96113
96150
|
});
|
|
96114
96151
|
Z && ((ne = (te = (ee = G.values.runtime) == null ? void 0 : ee.app) == null ? void 0 : te.env) == null ? void 0 : ne.DX_ENVIRONMENT) !== "production" && Z.subscribe(Y);
|
|
@@ -96121,8 +96158,9 @@ const invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
96121
96158
|
onClick: useCallback(() => {
|
|
96122
96159
|
var Q, ee, te, ne;
|
|
96123
96160
|
const Z = (Q = I.share) == null ? void 0 : Q.call(I, {
|
|
96124
|
-
type: Invitation.Type.
|
|
96161
|
+
type: Invitation.Type.INTERACTIVE,
|
|
96125
96162
|
authMethod: Invitation.AuthMethod.NONE,
|
|
96163
|
+
multiUse: !0,
|
|
96126
96164
|
target: U
|
|
96127
96165
|
});
|
|
96128
96166
|
Z && ((ne = (te = (ee = G.values.runtime) == null ? void 0 : ee.app) == null ? void 0 : te.env) == null ? void 0 : ne.DX_ENVIRONMENT) !== "production" && Z.subscribe(Y);
|
|
@@ -96563,4 +96601,4 @@ export {
|
|
|
96563
96601
|
log$2 as l,
|
|
96564
96602
|
runShell as r
|
|
96565
96603
|
};
|
|
96566
|
-
//# sourceMappingURL=index-
|
|
96604
|
+
//# sourceMappingURL=index-q9i9jZSi.mjs.map
|