@econ-v1/ports 7.6.114 → 7.6.116
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/network.d.ts +10 -4
- package/dist/network.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/network.js +3 -3
package/dist/network.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/** @typedef {HomeNodeCandidate & { readonly certificateHashes?: WebTransportCertificateHashes, readonly path: "lan-webtransport" }} WebTransportHomeNodeCandidate */
|
|
9
9
|
/** @typedef {HttpHomeNodeCandidate | WebTransportHomeNodeCandidate} DirectHomeNodeCandidate */
|
|
10
10
|
/** @typedef {"no-network" | "node-unreachable" | "session-required" | "transport-key-required"} TransportOfflineReason */
|
|
11
|
-
/** @typedef {{ readonly nodeId: string, readonly name: string }} TransportRelayMember */
|
|
11
|
+
/** @typedef {{ readonly nodeId: string, readonly name: string, readonly trace?: true }} TransportRelayMember */
|
|
12
12
|
/** @typedef {{ readonly url: string, readonly source: "route" | "home" | "member", readonly outcome: "connected" | "failed" | "timeout", readonly error: string, readonly durationMs: number }} TransportRelayAttempt */
|
|
13
13
|
/** Relay diagnostics use ISO 8601 timestamps and sanitized text/URLs. Times are omitted until known.
|
|
14
14
|
* @typedef {{ readonly lastAttemptAt?: string, readonly attempts: TransportRelayAttempt[], readonly lastError?: string, readonly nextRetryAt?: string, readonly inFlight: boolean }} TransportRelayDetail */
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/** @typedef {{local: IceCandidateCounts, remote: IceCandidateCounts}} PunchCandidates */
|
|
17
17
|
/** @typedef {{readonly candidates?: PunchCandidates, readonly iceConnectionState?: string, readonly connectionState?: string, readonly elapsedMs?: number, readonly detail?: string}} PunchDiagnostics */
|
|
18
18
|
/** @typedef {"setup_failed" | "signaling_failed" | "stun_unreachable" | "ice_failed" | "connection_failed" | "timeout" | "unstable" | "replace_rejected"} PunchFailureReason */
|
|
19
|
-
/** @typedef {PunchDiagnostics & ({ok: true} | {ok: false, reason: PunchFailureReason | "superseded"})} PromotionResult */
|
|
19
|
+
/** @typedef {PunchDiagnostics & {readonly rttMs?: number} & ({ok: true} | {ok: false, reason: PunchFailureReason | "superseded"})} PromotionResult */
|
|
20
20
|
/** @typedef {PunchDiagnostics & { readonly status: "idle" | "trying" | "failed" | "direct", readonly reason?: string, readonly retryAt?: number }} TransportPunch */
|
|
21
21
|
/** Route order rung names, in priority order for origin-aware checking.
|
|
22
22
|
* @typedef {"lan" | "wan" | "punch" | "relay"} TransportRungName */
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
* - check: in-progress check state when a "run check" is active
|
|
52
52
|
* - choice: explicit owner route choice, if set
|
|
53
53
|
* - choiceLost: record of a recently lost explicit choice, if any
|
|
54
|
-
* @typedef {{ readonly changedAt: string, readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct", readonly status: "connected", readonly checking?: boolean, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relayMember?: TransportRelayMember, readonly punch?: TransportPunch, readonly rttMs?: number, readonly segments?: TransportSegments, readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly path: "offline", readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "connecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly nextRetryAt: string, readonly path: "offline", readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "reconnecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly changedAt: string, readonly path: "offline", readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly reason?: TransportOfflineReason, readonly relay?: TransportRelayDetail, readonly status: "offline", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost }} TransportState */
|
|
54
|
+
* @typedef {{ readonly changedAt: string, readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct", readonly status: "connected", readonly checking?: boolean, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relayMember?: TransportRelayMember, readonly punch?: TransportPunch, readonly rttMs?: number, readonly segments?: TransportSegments, readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly path: "offline", readonly segments?: TransportSegments, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "connecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly nextRetryAt: string, readonly path: "offline", readonly segments?: TransportSegments, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "reconnecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly changedAt: string, readonly path: "offline", readonly segments?: TransportSegments, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly reason?: TransportOfflineReason, readonly relay?: TransportRelayDetail, readonly status: "offline", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost }} TransportState */
|
|
55
55
|
/** `onProgress` (ADR-215), when given, is called each time reply bytes arrive (headers, then
|
|
56
56
|
* every body chunk), so a caller can tell a slow-but-streaming reply from a silent node.
|
|
57
57
|
* It is report-only and must not throw. An implementation that cannot observe progress
|
|
@@ -101,6 +101,7 @@ export type TransportOfflineReason = "no-network" | "node-unreachable" | "sessio
|
|
|
101
101
|
export type TransportRelayMember = {
|
|
102
102
|
readonly nodeId: string;
|
|
103
103
|
readonly name: string;
|
|
104
|
+
readonly trace?: true;
|
|
104
105
|
};
|
|
105
106
|
export type TransportRelayAttempt = {
|
|
106
107
|
readonly url: string;
|
|
@@ -137,7 +138,9 @@ export type PunchDiagnostics = {
|
|
|
137
138
|
readonly detail?: string;
|
|
138
139
|
};
|
|
139
140
|
export type PunchFailureReason = "setup_failed" | "signaling_failed" | "stun_unreachable" | "ice_failed" | "connection_failed" | "timeout" | "unstable" | "replace_rejected";
|
|
140
|
-
export type PromotionResult = PunchDiagnostics &
|
|
141
|
+
export type PromotionResult = PunchDiagnostics & {
|
|
142
|
+
readonly rttMs?: number;
|
|
143
|
+
} & ({
|
|
141
144
|
ok: true;
|
|
142
145
|
} | {
|
|
143
146
|
ok: false;
|
|
@@ -269,6 +272,7 @@ export type TransportState = {
|
|
|
269
272
|
readonly attempt: number;
|
|
270
273
|
readonly changedAt: string;
|
|
271
274
|
readonly path: "offline";
|
|
275
|
+
readonly segments?: TransportSegments;
|
|
272
276
|
readonly ladder?: TransportLadder;
|
|
273
277
|
readonly reliability?: TransportReliability;
|
|
274
278
|
readonly relay?: TransportRelayDetail;
|
|
@@ -282,6 +286,7 @@ export type TransportState = {
|
|
|
282
286
|
readonly changedAt: string;
|
|
283
287
|
readonly nextRetryAt: string;
|
|
284
288
|
readonly path: "offline";
|
|
289
|
+
readonly segments?: TransportSegments;
|
|
285
290
|
readonly ladder?: TransportLadder;
|
|
286
291
|
readonly reliability?: TransportReliability;
|
|
287
292
|
readonly relay?: TransportRelayDetail;
|
|
@@ -293,6 +298,7 @@ export type TransportState = {
|
|
|
293
298
|
} | {
|
|
294
299
|
readonly changedAt: string;
|
|
295
300
|
readonly path: "offline";
|
|
301
|
+
readonly segments?: TransportSegments;
|
|
296
302
|
readonly ladder?: TransportLadder;
|
|
297
303
|
readonly reliability?: TransportReliability;
|
|
298
304
|
readonly reason?: TransportOfflineReason;
|
package/dist/network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.js"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,yGAAyG;AAEzG,6HAA6H;AAC7H,+DAA+D;AAC/D,sFAAsF;AACtF,wIAAwI;AACxI,kIAAkI;AAClI,qKAAqK;AACrK,+FAA+F;AAC/F,0HAA0H;AAC1H,
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.js"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,yGAAyG;AAEzG,6HAA6H;AAC7H,+DAA+D;AAC/D,sFAAsF;AACtF,wIAAwI;AACxI,kIAAkI;AAClI,qKAAqK;AACrK,+FAA+F;AAC/F,0HAA0H;AAC1H,gHAAgH;AAChH,yNAAyN;AACzN;6MAC6M;AAC7M,gGAAgG;AAChG,yFAAyF;AACzF,0MAA0M;AAC1M,gLAAgL;AAChL,sJAAsJ;AACtJ,qKAAqK;AACrK;oEACoE;AACpE;iDACiD;AACjD;wIACwI;AACxI;;qKAEqK;AACrK;6FAC6F;AAC7F;uHACuH;AACvH;;;;;;;;ySAQyS;AACzS,4JAA4J;AAC5J,2JAA2J;AAC3J;;0UAE0U;AAC1U;;;;;;o2DAMo2D;AACp2D;;;;0NAI0N;AAC1N,oFAAoF;AACpF,kEAAkE;AAClE;8SAC8S;AAC9S;;;;;;;;;;;;;;;4BAe4B;AAE5B,0CAA2C,yCAAyC,CAAC;gCAjFvE,OAAO,kCAAkC,EAAE,iBAAiB;kCAC5D,OAAO,uCAAuC,EAAE,mBAAmB;4BAEnE,YAAY,GAAG,YAAY,GAAG,kBAAkB,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe;gCAC7F,YAAY,GAAG,YAAY;kCAC3B,YAAY,GAAG,kBAAkB,GAAG,YAAY;oCAChD,iBAAiB,GAAG;IAAE,QAAQ,CAAC,eAAe,CAAC,E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omeNodeCandidate & { readonly certificateHashes?: WebTransportCertificateHashes, readonly path: "lan-webtransport" }} WebTransportHomeNodeCandidate */
|
|
12
12
|
/** @typedef {HttpHomeNodeCandidate | WebTransportHomeNodeCandidate} DirectHomeNodeCandidate */
|
|
13
13
|
/** @typedef {"no-network" | "node-unreachable" | "session-required" | "transport-key-required"} TransportOfflineReason */
|
|
14
|
-
/** @typedef {{ readonly nodeId: string, readonly name: string }} TransportRelayMember */
|
|
14
|
+
/** @typedef {{ readonly nodeId: string, readonly name: string, readonly trace?: true }} TransportRelayMember */
|
|
15
15
|
/** @typedef {{ readonly url: string, readonly source: "route" | "home" | "member", readonly outcome: "connected" | "failed" | "timeout", readonly error: string, readonly durationMs: number }} TransportRelayAttempt */
|
|
16
16
|
/** Relay diagnostics use ISO 8601 timestamps and sanitized text/URLs. Times are omitted until known.
|
|
17
17
|
* @typedef {{ readonly lastAttemptAt?: string, readonly attempts: TransportRelayAttempt[], readonly lastError?: string, readonly nextRetryAt?: string, readonly inFlight: boolean }} TransportRelayDetail */
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/** @typedef {{local: IceCandidateCounts, remote: IceCandidateCounts}} PunchCandidates */
|
|
20
20
|
/** @typedef {{readonly candidates?: PunchCandidates, readonly iceConnectionState?: string, readonly connectionState?: string, readonly elapsedMs?: number, readonly detail?: string}} PunchDiagnostics */
|
|
21
21
|
/** @typedef {"setup_failed" | "signaling_failed" | "stun_unreachable" | "ice_failed" | "connection_failed" | "timeout" | "unstable" | "replace_rejected"} PunchFailureReason */
|
|
22
|
-
/** @typedef {PunchDiagnostics & ({ok: true} | {ok: false, reason: PunchFailureReason | "superseded"})} PromotionResult */
|
|
22
|
+
/** @typedef {PunchDiagnostics & {readonly rttMs?: number} & ({ok: true} | {ok: false, reason: PunchFailureReason | "superseded"})} PromotionResult */
|
|
23
23
|
/** @typedef {PunchDiagnostics & { readonly status: "idle" | "trying" | "failed" | "direct", readonly reason?: string, readonly retryAt?: number }} TransportPunch */
|
|
24
24
|
/** Route order rung names, in priority order for origin-aware checking.
|
|
25
25
|
* @typedef {"lan" | "wan" | "punch" | "relay"} TransportRungName */
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
* - check: in-progress check state when a "run check" is active
|
|
55
55
|
* - choice: explicit owner route choice, if set
|
|
56
56
|
* - choiceLost: record of a recently lost explicit choice, if any
|
|
57
|
-
* @typedef {{ readonly changedAt: string, readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct", readonly status: "connected", readonly checking?: boolean, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relayMember?: TransportRelayMember, readonly punch?: TransportPunch, readonly rttMs?: number, readonly segments?: TransportSegments, readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly path: "offline", readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "connecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly nextRetryAt: string, readonly path: "offline", readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "reconnecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly changedAt: string, readonly path: "offline", readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly reason?: TransportOfflineReason, readonly relay?: TransportRelayDetail, readonly status: "offline", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost }} TransportState */
|
|
57
|
+
* @typedef {{ readonly changedAt: string, readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct", readonly status: "connected", readonly checking?: boolean, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relayMember?: TransportRelayMember, readonly punch?: TransportPunch, readonly rttMs?: number, readonly segments?: TransportSegments, readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly path: "offline", readonly segments?: TransportSegments, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "connecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly attempt: number, readonly changedAt: string, readonly nextRetryAt: string, readonly path: "offline", readonly segments?: TransportSegments, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly relay?: TransportRelayDetail, readonly status: "reconnecting", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost } | { readonly changedAt: string, readonly path: "offline", readonly segments?: TransportSegments, readonly ladder?: TransportLadder, readonly reliability?: TransportReliability, readonly reason?: TransportOfflineReason, readonly relay?: TransportRelayDetail, readonly status: "offline", readonly origin?: TransportOrigin, readonly check?: TransportCheck, readonly choice?: TransportChoice, readonly choiceLost?: TransportChoiceLost }} TransportState */
|
|
58
58
|
/** `onProgress` (ADR-215), when given, is called each time reply bytes arrive (headers, then
|
|
59
59
|
* every body chunk), so a caller can tell a slow-but-streaming reply from a silent node.
|
|
60
60
|
* It is report-only and must not throw. An implementation that cannot observe progress
|