@econ-v1/ports 6.5.0 → 6.6.0
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/identity.d.ts +2 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/install-environment.d.ts +42 -0
- package/dist/install-environment.d.ts.map +1 -0
- package/dist/install-environment.js +26 -0
- package/dist/install-environment.js.map +1 -0
- package/dist/network/client-node-origin.d.ts +18 -0
- package/dist/network/client-node-origin.d.ts.map +1 -0
- package/dist/network/client-node-origin.js +18 -0
- package/dist/network/client-node-origin.js.map +1 -0
- package/dist/network/home-node-candidate-store.d.ts +38 -0
- package/dist/network/home-node-candidate-store.d.ts.map +1 -0
- package/dist/network/home-node-candidate-store.js +2 -0
- package/dist/network/home-node-candidate-store.js.map +1 -0
- package/dist/network/l402-payment.d.ts +38 -0
- package/dist/network/l402-payment.d.ts.map +1 -0
- package/dist/network/l402-payment.js +2 -0
- package/dist/network/l402-payment.js.map +1 -0
- package/dist/network/node-discovery.d.ts +29 -0
- package/dist/network/node-discovery.d.ts.map +1 -0
- package/dist/network/node-discovery.js +13 -0
- package/dist/network/node-discovery.js.map +1 -0
- package/dist/network/webrtc-signaling.d.ts +101 -0
- package/dist/network/webrtc-signaling.d.ts.map +1 -0
- package/dist/network/webrtc-signaling.js +30 -0
- package/dist/network/webrtc-signaling.js.map +1 -0
- package/dist/network.d.ts +35 -2
- package/dist/network.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/identity.d.ts
CHANGED
|
@@ -17,8 +17,10 @@ export interface DeviceDelegation {
|
|
|
17
17
|
}
|
|
18
18
|
export interface DeviceConnectionMetadata {
|
|
19
19
|
readonly directAddresses: readonly string[];
|
|
20
|
+
readonly homeNodeId?: string;
|
|
20
21
|
readonly lastConnectedAt?: string;
|
|
21
22
|
readonly relayUrl?: string;
|
|
23
|
+
readonly wanOrigin?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface DeviceIdentity extends DevicePublicIdentity {
|
|
24
26
|
readonly keyHandle: DeviceKeyHandle;
|
package/dist/identity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,SA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,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAC5D,cAAc,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;IACxD,eAAe,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,sBAAsB,IAAI,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;IACxE,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,sBAAsB,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAClD,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,16 @@ export type { ClockPort, ClockWake, DelayPort } from "./clock.js";
|
|
|
2
2
|
export type { CryptoPort } from "./crypto.js";
|
|
3
3
|
export type { IdPort } from "./id.js";
|
|
4
4
|
export type { DeviceConnectionMetadata, DeviceDelegation, DeviceIdentity, DeviceKeyHandle, DevicePublicIdentity, IdentityDiagnostics, IdentityPort, KeyCustodyMode, } from "./identity.js";
|
|
5
|
-
export
|
|
5
|
+
export { createNullInstallEnvironment, } from "./install-environment.js";
|
|
6
|
+
export type { InstallEnvironmentPort, InstallInstructionMode, } from "./install-environment.js";
|
|
7
|
+
export type { DeltaRequest, CancellationSignal, DirectHomeNodeCandidate, DirectTransportPath, HomeNodeClient, HttpHomeNodeCandidate, HttpTransportPath, HomeNodeRequest, PeerTransportPort, TransportPath, TransportState, WebTransportCertificateHashes, WebTransportHomeNodeCandidate, } from "./network.js";
|
|
6
8
|
export type { HomeNodeCandidate, HomeNodeDialer } from "./network/home-node-candidate.js";
|
|
9
|
+
export { DEFAULT_CLIENT_NODE_ORIGIN } from "./network/client-node-origin.js";
|
|
10
|
+
export type { HomeNodeCandidateStorePort, StoredHomeNodeCandidate, } from "./network/home-node-candidate-store.js";
|
|
11
|
+
export type { L402PaymentChallenge, L402PaymentHandler, L402PaymentResult } from "./network/l402-payment.js";
|
|
12
|
+
export type { NodeAddressDiscoverer, NodeDiscoveryCandidate, NodeDiscoveryResult, } from "./network/node-discovery.js";
|
|
13
|
+
export { MAX_CLOSE_REASON_BYTES, MAX_DTLS_FINGERPRINT_BYTES, MAX_ICE_CANDIDATE_BYTES, MAX_ICE_CANDIDATES_PER_OFFER, MAX_OFFER_NONCE_BYTES, MAX_SDP_BYTES, MAX_SDP_MID_BYTES, MAX_WEBRTC_SIGNAL_MESSAGE_BYTES, MIN_OFFER_NONCE_BYTES, WEBRTC_SIGNAL_VERSION, } from "./network/webrtc-signaling.js";
|
|
14
|
+
export type { WebRtcAnswer, WebRtcClose, WebRtcIceCandidate, WebRtcOffer, WebRtcRestart, WebRtcSignalMessage, WebRtcSignalSetup, WebRtcSignalingPort, } from "./network/webrtc-signaling.js";
|
|
7
15
|
export type { PreparedStageAsset, StageAssetPort, StageCatalogEntry, StageManifest, StageUiKind, StageUiMetadata, StageUiNav, StageRegistryPort, StageRegistrySnapshot, } from "./repositories.js";
|
|
8
16
|
export { CONVERSATION_MESSAGE_STATES } from "./repositories/conversation-repository.js";
|
|
9
17
|
export type { Conversation, ConversationListParams, ConversationLogDelta, ConversationMessage, ConversationMessageState, ConversationRepository, ConversationRepositoryEvent, MessageListParams, Notification, NotificationListParams, NotificationRepository, NotificationRepositoryEvent, RepositoryEvent, } from "./repositories/conversation-repository.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,Y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,CAAC;AAC/C,YAAY,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,6BAA6B,GAC9B,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC3F,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { createNullInstallEnvironment, } from "./install-environment.js";
|
|
2
|
+
export { DEFAULT_CLIENT_NODE_ORIGIN } from "./network/client-node-origin.js";
|
|
3
|
+
export { MAX_CLOSE_REASON_BYTES, MAX_DTLS_FINGERPRINT_BYTES, MAX_ICE_CANDIDATE_BYTES, MAX_ICE_CANDIDATES_PER_OFFER, MAX_OFFER_NONCE_BYTES, MAX_SDP_BYTES, MAX_SDP_MID_BYTES, MAX_WEBRTC_SIGNAL_MESSAGE_BYTES, MIN_OFFER_NONCE_BYTES, WEBRTC_SIGNAL_VERSION, } from "./network/webrtc-signaling.js";
|
|
1
4
|
export { CONVERSATION_MESSAGE_STATES } from "./repositories/conversation-repository.js";
|
|
2
5
|
export { OutboxIdempotencyConflictError } from "./repositories/outbox.js";
|
|
3
6
|
export { REVISIONED_REPOSITORY_DOMAINS, } from "./repositories/revisioned-repository.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAqBlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAW7E,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAsBvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAsBxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AA+B1E,OAAO,EACL,6BAA6B,GAC9B,MAAM,yCAAyC,CAAC;AAYjD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4CAA4C,CAAC;AAYpD,OAAO,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Which install affordance the shell should render for the current environment. */
|
|
2
|
+
export type InstallInstructionMode = "installable" | "ios" | "safari-desktop" | "unsupported";
|
|
3
|
+
/**
|
|
4
|
+
* Boundary port for PWA install detection (`client/ui`'s install-prompt UI, a later task).
|
|
5
|
+
*
|
|
6
|
+
* `client/ui` may never touch `window.beforeinstallprompt` / `navigator.standalone` /
|
|
7
|
+
* `navigator.getInstalledRelatedApps` directly (boundary rules B2/B3,
|
|
8
|
+
* `client/scripts/check-boundaries.mjs`) — this is the narrow surface
|
|
9
|
+
* `client/adapters-web`'s `createBrowserInstallEnvironment()` implements against the real
|
|
10
|
+
* globals, and the composition root (`system/pwa/src/main.ts`) registers it before the shell
|
|
11
|
+
* needs to decide whether/how to offer installation. The captured `beforeinstallprompt` event
|
|
12
|
+
* fires once, early in the page lifecycle, and is only usable once (`promptInstall`) — this
|
|
13
|
+
* port's job is to hold onto it so callers don't have to race the event themselves.
|
|
14
|
+
*/
|
|
15
|
+
export interface InstallEnvironmentPort {
|
|
16
|
+
/** True if the app is already running in an installed/standalone display mode. */
|
|
17
|
+
isStandalone(): boolean;
|
|
18
|
+
/** Which install affordance to show: a native prompt is available, iOS's manual-add-to-
|
|
19
|
+
* home-screen instructions apply, macOS Safari's manual-add-to-Dock instructions apply
|
|
20
|
+
* (Safari 17+ supports installing via Share → Add to Dock but never fires
|
|
21
|
+
* `beforeinstallprompt`), or neither (desktop browser with no install support, already
|
|
22
|
+
* standalone, etc). */
|
|
23
|
+
instructionMode(): InstallInstructionMode;
|
|
24
|
+
/** Subscribes to native install-prompt availability. Fires immediately if a prompt was
|
|
25
|
+
* already captured before this call; otherwise fires once the `beforeinstallprompt` event
|
|
26
|
+
* arrives. Returns an unsubscribe function. */
|
|
27
|
+
onInstallAvailable(listener: () => void): () => void;
|
|
28
|
+
/** Shows the captured native install prompt, if any. Resolves `"unavailable"` when no
|
|
29
|
+
* prompt has been captured. Clears the captured prompt on use — it can only be shown
|
|
30
|
+
* once per capture. */
|
|
31
|
+
promptInstall(): Promise<"accepted" | "dismissed" | "unavailable">;
|
|
32
|
+
/** Subscribes to the `appinstalled` event. Returns an unsubscribe function. */
|
|
33
|
+
onAppInstalled(listener: () => void): () => void;
|
|
34
|
+
/** Checks whether this app is already installed via the User-Agent-mediated related-apps
|
|
35
|
+
* API. Resolves `false` if the API is absent or the check fails. */
|
|
36
|
+
checkAlreadyInstalled(): Promise<boolean>;
|
|
37
|
+
}
|
|
38
|
+
/** A no-op `InstallEnvironmentPort` for environments with no install affordance (SSR, tests,
|
|
39
|
+
* platforms without a real browser behind them). Never standalone, never installable, no
|
|
40
|
+
* prompts ever fire. */
|
|
41
|
+
export declare function createNullInstallEnvironment(): InstallEnvironmentPort;
|
|
42
|
+
//# sourceMappingURL=install-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-environment.d.ts","sourceRoot":"","sources":["../src/install-environment.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,KAAK,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE9F;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,YAAY,IAAI,OAAO,CAAC;IACxB;;;;2BAIuB;IACvB,eAAe,IAAI,sBAAsB,CAAC;IAC1C;;mDAE+C;IAC/C,kBAAkB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IACrD;;2BAEuB;IACvB,aAAa,IAAI,OAAO,CAAC,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC,CAAC;IACnE,+EAA+E;IAC/E,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IACjD;wEACoE;IACpE,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C;AAED;;wBAEwB;AACxB,wBAAgB,4BAA4B,IAAI,sBAAsB,CAqBrE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A no-op `InstallEnvironmentPort` for environments with no install affordance (SSR, tests,
|
|
2
|
+
* platforms without a real browser behind them). Never standalone, never installable, no
|
|
3
|
+
* prompts ever fire. */
|
|
4
|
+
export function createNullInstallEnvironment() {
|
|
5
|
+
return {
|
|
6
|
+
isStandalone() {
|
|
7
|
+
return false;
|
|
8
|
+
},
|
|
9
|
+
instructionMode() {
|
|
10
|
+
return "unsupported";
|
|
11
|
+
},
|
|
12
|
+
onInstallAvailable() {
|
|
13
|
+
return () => undefined;
|
|
14
|
+
},
|
|
15
|
+
async promptInstall() {
|
|
16
|
+
return "unavailable";
|
|
17
|
+
},
|
|
18
|
+
onAppInstalled() {
|
|
19
|
+
return () => undefined;
|
|
20
|
+
},
|
|
21
|
+
async checkAlreadyInstalled() {
|
|
22
|
+
return false;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=install-environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-environment.js","sourceRoot":"","sources":["../src/install-environment.ts"],"names":[],"mappings":"AAuCA;;wBAEwB;AACxB,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,YAAY;YACV,OAAO,KAAK,CAAC;QACf,CAAC;QACD,eAAe;YACb,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,kBAAkB;YAChB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;QACzB,CAAC;QACD,KAAK,CAAC,aAAa;YACjB,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,cAAc;YACZ,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;QACzB,CAAC;QACD,KAAK,CAAC,qBAAqB;YACzB,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Client Node PWA's cloud distribution origin — the static site an installed-from-cloud
|
|
3
|
+
* PWA is served from at first launch (e.g. `client-node.economy1.cloud`), as opposed to a
|
|
4
|
+
* `system/pwa/dist` build served directly by a running node (dev, or an on-node install).
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the Rust constant of the same value, `DEFAULT_CLIENT_NODE_ORIGIN` in
|
|
7
|
+
* `core/adapters-network/src/http/server/runtime.rs` (introduced by ticket N1's CORS/PNA
|
|
8
|
+
* work) — kept in sync by hand; update both together if this value ever changes.
|
|
9
|
+
*
|
|
10
|
+
* This origin is NEVER itself a home node — it is a static site with no node behind it.
|
|
11
|
+
* `resolveInitialHomeNode` (`system/pwa/src/kernel-runtime.ts`) uses this constant to
|
|
12
|
+
* recognize "installed-from-cloud, no LAN candidate discovered yet" and refuses to seed it
|
|
13
|
+
* as a dialable bootstrap candidate. Before this constant's introduction (lan-direct-pairing
|
|
14
|
+
* plan, C3), the distribution origin was unconditionally seeded as the `wan-direct`
|
|
15
|
+
* home-node candidate on every boot, so pairing dialed the static site and got a 404.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_CLIENT_NODE_ORIGIN = "https://client-node.economy1.cloud";
|
|
18
|
+
//# sourceMappingURL=client-node-origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-node-origin.d.ts","sourceRoot":"","sources":["../../src/network/client-node-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Client Node PWA's cloud distribution origin — the static site an installed-from-cloud
|
|
3
|
+
* PWA is served from at first launch (e.g. `client-node.economy1.cloud`), as opposed to a
|
|
4
|
+
* `system/pwa/dist` build served directly by a running node (dev, or an on-node install).
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the Rust constant of the same value, `DEFAULT_CLIENT_NODE_ORIGIN` in
|
|
7
|
+
* `core/adapters-network/src/http/server/runtime.rs` (introduced by ticket N1's CORS/PNA
|
|
8
|
+
* work) — kept in sync by hand; update both together if this value ever changes.
|
|
9
|
+
*
|
|
10
|
+
* This origin is NEVER itself a home node — it is a static site with no node behind it.
|
|
11
|
+
* `resolveInitialHomeNode` (`system/pwa/src/kernel-runtime.ts`) uses this constant to
|
|
12
|
+
* recognize "installed-from-cloud, no LAN candidate discovered yet" and refuses to seed it
|
|
13
|
+
* as a dialable bootstrap candidate. Before this constant's introduction (lan-direct-pairing
|
|
14
|
+
* plan, C3), the distribution origin was unconditionally seeded as the `wan-direct`
|
|
15
|
+
* home-node candidate on every boot, so pairing dialed the static site and got a 404.
|
|
16
|
+
*/
|
|
17
|
+
export const DEFAULT_CLIENT_NODE_ORIGIN = "https://client-node.economy1.cloud";
|
|
18
|
+
//# sourceMappingURL=client-node-origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-node-origin.js","sourceRoot":"","sources":["../../src/network/client-node-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The minimal, JSON-safe shape of a verified LAN-direct home-node candidate the device
|
|
3
|
+
* remembers across reloads (lan-direct-pairing plan, C3). Always becomes `path: "lan-direct"`
|
|
4
|
+
* once turned into a `HomeNodeCandidate` — this type omits `path` because that is the only
|
|
5
|
+
* value ever stored here; it deliberately does not reuse `NodeDiscoveryCandidate`
|
|
6
|
+
* (`network/node-discovery.js`) so this port stays free of that module's discovery-flow
|
|
7
|
+
* framing (`path` there exists to type-narrow a discovery *result*, not a stored value).
|
|
8
|
+
*/
|
|
9
|
+
export interface StoredHomeNodeCandidate {
|
|
10
|
+
readonly address: string;
|
|
11
|
+
readonly id: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Boundary port for persisting the discovered-LAN home-node candidate.
|
|
15
|
+
*
|
|
16
|
+
* `client/ui`'s onboarding discovery screen (`shell/onboarding/screens/connect-discovery.ts`)
|
|
17
|
+
* emits a `node-discovered` DOM event carrying a verified candidate but never persists it
|
|
18
|
+
* itself — the composition root (`system/pwa/src/main.ts`) listens for that event, writes
|
|
19
|
+
* the candidate here, and reloads so `createP0KernelRuntime`
|
|
20
|
+
* (`system/pwa/src/kernel-runtime.ts`) seeds it as the boot-time home node on the next load
|
|
21
|
+
* via `resolveInitialHomeNode`. `client/ui` may never touch `localStorage` directly
|
|
22
|
+
* (boundary rules B2/B3, `client/scripts/check-boundaries.mjs`) — this is the narrow surface
|
|
23
|
+
* `client/adapters-web`'s `createBrowserHomeNodeCandidateStore()` implements against the real
|
|
24
|
+
* global, mirroring `ThemeEnvironmentPort`'s `BrowserThemeEnvironment` adapter pattern.
|
|
25
|
+
*
|
|
26
|
+
* Implementations MUST swallow storage failures (private browsing, quota) rather than
|
|
27
|
+
* throwing — a lost persist just means LAN discovery runs again on the next launch, never a
|
|
28
|
+
* hard failure.
|
|
29
|
+
*/
|
|
30
|
+
export interface HomeNodeCandidateStorePort {
|
|
31
|
+
/** Reads the persisted candidate, or `undefined` if unset or storage is unavailable. */
|
|
32
|
+
read(): StoredHomeNodeCandidate | undefined;
|
|
33
|
+
/** Persists a verified candidate as the device's remembered home node. */
|
|
34
|
+
write(candidate: StoredHomeNodeCandidate): void;
|
|
35
|
+
/** Clears any persisted candidate. */
|
|
36
|
+
clear(): void;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=home-node-candidate-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-node-candidate-store.d.ts","sourceRoot":"","sources":["../../src/network/home-node-candidate-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,0BAA0B;IACzC,wFAAwF;IACxF,IAAI,IAAI,uBAAuB,GAAG,SAAS,CAAC;IAC5C,0EAA0E;IAC1E,KAAK,CAAC,SAAS,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAChD,sCAAsC;IACtC,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-node-candidate-store.js","sourceRoot":"","sources":["../../src/network/home-node-candidate-store.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The domain-level shape of an L402 payment challenge — mirrors
|
|
3
|
+
* `L402PaymentChallengeDetails` in
|
|
4
|
+
* `client/adapters-web/src/network/client-rpc/response-error.ts` (the
|
|
5
|
+
* carrier-side representation of a `402 PaymentRequired` `node/client-rpc/1`
|
|
6
|
+
* response) without this port depending on that adapter package. Never log
|
|
7
|
+
* `macaroon`/`invoice` (Constitution Principle VIII) — both are
|
|
8
|
+
* credential/payment-secret material, not diagnostic detail.
|
|
9
|
+
*/
|
|
10
|
+
export interface L402PaymentChallenge {
|
|
11
|
+
readonly amountSats: number;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly invoice: string;
|
|
14
|
+
readonly macaroon: string;
|
|
15
|
+
}
|
|
16
|
+
/** The Lightning preimage produced once `invoice` is paid — combined with `macaroon` to form the `LSAT <macaroon>:<preimage>` token the retried request carries. */
|
|
17
|
+
export interface L402PaymentResult {
|
|
18
|
+
readonly preimage: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Pluggable port the kernel/composition root supplies to pay an L402
|
|
22
|
+
* challenge surfaced by a `node/client-rpc/1` carrier (ticket #1866:
|
|
23
|
+
* WebTransport/WebRTC — the same challenge the HTTP carrier's
|
|
24
|
+
* `WWW-Authenticate` 402 flow already exposes to callers).
|
|
25
|
+
*
|
|
26
|
+
* Paying an invoice is a domain/UI concern — it may require prompting the
|
|
27
|
+
* operator, routing through an external Lightning wallet, or invoking a
|
|
28
|
+
* not-yet-wired authoritative-wallet capability — never something a
|
|
29
|
+
* transport-layer carrier should decide on its own. The carrier and the
|
|
30
|
+
* managed-client retry orchestration only need to know whether payment
|
|
31
|
+
* succeeded and, if so, the resulting preimage; they never see how it was
|
|
32
|
+
* obtained. When no handler is supplied, the challenge is surfaced to the
|
|
33
|
+
* caller unchanged (never a silent no-op, never a fabricated payment).
|
|
34
|
+
*/
|
|
35
|
+
export interface L402PaymentHandler {
|
|
36
|
+
pay(challenge: L402PaymentChallenge): Promise<L402PaymentResult>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=l402-payment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"l402-payment.d.ts","sourceRoot":"","sources":["../../src/network/l402-payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,oKAAoK;AACpK,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,SAAS,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAClE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"l402-payment.js","sourceRoot":"","sources":["../../src/network/l402-payment.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pre-pairing "verify a user-entered address is really a node" port
|
|
3
|
+
* (ticket #1893-follow-on / `docs/superpowers/plans/2026-07-27-lan-direct-pairing.md`).
|
|
4
|
+
*
|
|
5
|
+
* This is deliberately lighter-weight than `HomeNodeDialer`: no session, no auth headers,
|
|
6
|
+
* no expected node id to prove against — the caller doesn't know which node (if any) is at
|
|
7
|
+
* the address yet. It only proves the responder's PUBLIC origin proof
|
|
8
|
+
* (`GET /.well-known/client-node-origin`) is well-formed and matches the address dialed.
|
|
9
|
+
* Contrast with `DiscoveryProbeService`/`HomeNodeDialer`, which re-prove a candidate against
|
|
10
|
+
* an *already-known* home-node id (post-pairing "did my node move on the LAN" re-discovery).
|
|
11
|
+
*/
|
|
12
|
+
export interface NodeDiscoveryCandidate {
|
|
13
|
+
readonly address: string;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly path: "lan-direct";
|
|
16
|
+
}
|
|
17
|
+
export type NodeDiscoveryResult = {
|
|
18
|
+
readonly status: "verified";
|
|
19
|
+
readonly candidate: NodeDiscoveryCandidate;
|
|
20
|
+
} | {
|
|
21
|
+
readonly status: "reached-but-invalid";
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly status: "unreachable-or-untrusted";
|
|
25
|
+
};
|
|
26
|
+
export interface NodeAddressDiscoverer {
|
|
27
|
+
discover(rawAddress: string): Promise<NodeDiscoveryResult>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=node-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-discovery.d.ts","sourceRoot":"","sources":["../../src/network/node-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAA;CAAE,GAC3E;IAAE,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAA;CAAE,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pre-pairing "verify a user-entered address is really a node" port
|
|
3
|
+
* (ticket #1893-follow-on / `docs/superpowers/plans/2026-07-27-lan-direct-pairing.md`).
|
|
4
|
+
*
|
|
5
|
+
* This is deliberately lighter-weight than `HomeNodeDialer`: no session, no auth headers,
|
|
6
|
+
* no expected node id to prove against — the caller doesn't know which node (if any) is at
|
|
7
|
+
* the address yet. It only proves the responder's PUBLIC origin proof
|
|
8
|
+
* (`GET /.well-known/client-node-origin`) is well-formed and matches the address dialed.
|
|
9
|
+
* Contrast with `DiscoveryProbeService`/`HomeNodeDialer`, which re-prove a candidate against
|
|
10
|
+
* an *already-known* home-node id (post-pairing "did my node move on the LAN" re-discovery).
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=node-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-discovery.js","sourceRoot":"","sources":["../../src/network/node-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { CancellationSignal } from "../network.js";
|
|
2
|
+
/**
|
|
3
|
+
* Authenticated WebRTC signaling over HTTPS/WSS (ticket #1824, "N3").
|
|
4
|
+
*
|
|
5
|
+
* iroh-router signaling is explicitly deferred; this is the browser-side
|
|
6
|
+
* contract for the HTTPS/WSS signaling adapter instead. It carries only
|
|
7
|
+
* setup, offer, answer, candidate, restart, and close — never a peer
|
|
8
|
+
* connection or DataChannel. Field names mirror the Rust wire types in
|
|
9
|
+
* `core/adapters-network/src/webrtc_signal/messages.rs` exactly (including
|
|
10
|
+
* snake_case) since both sides serialize the same JSON envelope.
|
|
11
|
+
*
|
|
12
|
+
* `WebRtcHomeNodeClient` (the WebRTC carrier, ticket "N4") depends on this
|
|
13
|
+
* narrow port rather than on any concrete transport, so the signaling
|
|
14
|
+
* transport can change without touching WebRTC connection logic.
|
|
15
|
+
*/
|
|
16
|
+
export declare const WEBRTC_SIGNAL_VERSION = 1;
|
|
17
|
+
/** Maximum serialized size of one signaling WebSocket text frame. */
|
|
18
|
+
export declare const MAX_WEBRTC_SIGNAL_MESSAGE_BYTES: number;
|
|
19
|
+
/** Maximum SDP body size (offer, answer, or restart). */
|
|
20
|
+
export declare const MAX_SDP_BYTES: number;
|
|
21
|
+
export declare const MIN_OFFER_NONCE_BYTES = 16;
|
|
22
|
+
export declare const MAX_OFFER_NONCE_BYTES = 128;
|
|
23
|
+
/** Maximum DTLS fingerprint size: `<algorithm> <hex-pairs>`. */
|
|
24
|
+
export declare const MAX_DTLS_FINGERPRINT_BYTES = 200;
|
|
25
|
+
/** Maximum size of one trickle-ICE candidate line. */
|
|
26
|
+
export declare const MAX_ICE_CANDIDATE_BYTES = 1024;
|
|
27
|
+
export declare const MAX_SDP_MID_BYTES = 64;
|
|
28
|
+
/** Maximum number of trickle-ICE candidates accepted for one bound offer. */
|
|
29
|
+
export declare const MAX_ICE_CANDIDATES_PER_OFFER = 32;
|
|
30
|
+
export declare const MAX_CLOSE_REASON_BYTES = 256;
|
|
31
|
+
export interface WebRtcSignalSetup {
|
|
32
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
33
|
+
readonly type: "setup";
|
|
34
|
+
readonly version: number;
|
|
35
|
+
}
|
|
36
|
+
export interface WebRtcOffer {
|
|
37
|
+
readonly dtls_fingerprint: string;
|
|
38
|
+
readonly offer_nonce: string;
|
|
39
|
+
readonly sdp: string;
|
|
40
|
+
readonly type: "offer";
|
|
41
|
+
readonly version: number;
|
|
42
|
+
}
|
|
43
|
+
export interface WebRtcAnswer {
|
|
44
|
+
readonly dtls_fingerprint: string;
|
|
45
|
+
readonly offer_nonce: string;
|
|
46
|
+
readonly sdp: string;
|
|
47
|
+
readonly type: "answer";
|
|
48
|
+
}
|
|
49
|
+
export interface WebRtcIceCandidate {
|
|
50
|
+
readonly candidate: string;
|
|
51
|
+
readonly offer_nonce: string;
|
|
52
|
+
readonly sdp_mid?: string;
|
|
53
|
+
readonly sdp_mline_index?: number;
|
|
54
|
+
readonly type: "candidate";
|
|
55
|
+
}
|
|
56
|
+
export interface WebRtcRestart {
|
|
57
|
+
readonly dtls_fingerprint: string;
|
|
58
|
+
readonly offer_nonce: string;
|
|
59
|
+
readonly previous_offer_nonce: string;
|
|
60
|
+
readonly sdp: string;
|
|
61
|
+
readonly type: "restart";
|
|
62
|
+
readonly version: number;
|
|
63
|
+
}
|
|
64
|
+
export interface WebRtcClose {
|
|
65
|
+
readonly offer_nonce?: string;
|
|
66
|
+
readonly reason?: string;
|
|
67
|
+
readonly type: "close";
|
|
68
|
+
}
|
|
69
|
+
export type WebRtcSignalMessage = WebRtcAnswer | WebRtcClose | WebRtcIceCandidate | WebRtcOffer | WebRtcRestart | WebRtcSignalSetup;
|
|
70
|
+
/**
|
|
71
|
+
* Browser-side signaling contract. A production implementation opens one
|
|
72
|
+
* authenticated WSS connection, sends the setup frame with the caller's
|
|
73
|
+
* bearer + delegation headers, and maps offer/restart replies to their
|
|
74
|
+
* answers. This is signaling transport only — no peer connection or
|
|
75
|
+
* DataChannel is created here.
|
|
76
|
+
*/
|
|
77
|
+
export interface WebRtcSignalingPort {
|
|
78
|
+
close(close?: {
|
|
79
|
+
readonly offer_nonce?: string;
|
|
80
|
+
readonly reason?: string;
|
|
81
|
+
}): Promise<void>;
|
|
82
|
+
connect(setupHeaders: Readonly<Record<string, string>>, signal?: CancellationSignal): Promise<void>;
|
|
83
|
+
sendCandidate(candidate: {
|
|
84
|
+
readonly candidate: string;
|
|
85
|
+
readonly offer_nonce: string;
|
|
86
|
+
readonly sdp_mid?: string;
|
|
87
|
+
readonly sdp_mline_index?: number;
|
|
88
|
+
}): Promise<void>;
|
|
89
|
+
sendOffer(offer: {
|
|
90
|
+
readonly dtls_fingerprint: string;
|
|
91
|
+
readonly offer_nonce: string;
|
|
92
|
+
readonly sdp: string;
|
|
93
|
+
}): Promise<WebRtcAnswer>;
|
|
94
|
+
sendRestart(restart: {
|
|
95
|
+
readonly dtls_fingerprint: string;
|
|
96
|
+
readonly offer_nonce: string;
|
|
97
|
+
readonly previous_offer_nonce: string;
|
|
98
|
+
readonly sdp: string;
|
|
99
|
+
}): Promise<WebRtcAnswer>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=webrtc-signaling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webrtc-signaling.d.ts","sourceRoot":"","sources":["../../src/network/webrtc-signaling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,qEAAqE;AACrE,eAAO,MAAM,+BAA+B,QAAY,CAAC;AACzD,yDAAyD;AACzD,eAAO,MAAM,aAAa,QAAY,CAAC;AACvC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B,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gB,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;QACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authenticated WebRTC signaling over HTTPS/WSS (ticket #1824, "N3").
|
|
3
|
+
*
|
|
4
|
+
* iroh-router signaling is explicitly deferred; this is the browser-side
|
|
5
|
+
* contract for the HTTPS/WSS signaling adapter instead. It carries only
|
|
6
|
+
* setup, offer, answer, candidate, restart, and close — never a peer
|
|
7
|
+
* connection or DataChannel. Field names mirror the Rust wire types in
|
|
8
|
+
* `core/adapters-network/src/webrtc_signal/messages.rs` exactly (including
|
|
9
|
+
* snake_case) since both sides serialize the same JSON envelope.
|
|
10
|
+
*
|
|
11
|
+
* `WebRtcHomeNodeClient` (the WebRTC carrier, ticket "N4") depends on this
|
|
12
|
+
* narrow port rather than on any concrete transport, so the signaling
|
|
13
|
+
* transport can change without touching WebRTC connection logic.
|
|
14
|
+
*/
|
|
15
|
+
export const WEBRTC_SIGNAL_VERSION = 1;
|
|
16
|
+
/** Maximum serialized size of one signaling WebSocket text frame. */
|
|
17
|
+
export const MAX_WEBRTC_SIGNAL_MESSAGE_BYTES = 32 * 1024;
|
|
18
|
+
/** Maximum SDP body size (offer, answer, or restart). */
|
|
19
|
+
export const MAX_SDP_BYTES = 16 * 1024;
|
|
20
|
+
export const MIN_OFFER_NONCE_BYTES = 16;
|
|
21
|
+
export const MAX_OFFER_NONCE_BYTES = 128;
|
|
22
|
+
/** Maximum DTLS fingerprint size: `<algorithm> <hex-pairs>`. */
|
|
23
|
+
export const MAX_DTLS_FINGERPRINT_BYTES = 200;
|
|
24
|
+
/** Maximum size of one trickle-ICE candidate line. */
|
|
25
|
+
export const MAX_ICE_CANDIDATE_BYTES = 1024;
|
|
26
|
+
export const MAX_SDP_MID_BYTES = 64;
|
|
27
|
+
/** Maximum number of trickle-ICE candidates accepted for one bound offer. */
|
|
28
|
+
export const MAX_ICE_CANDIDATES_PER_OFFER = 32;
|
|
29
|
+
export const MAX_CLOSE_REASON_BYTES = 256;
|
|
30
|
+
//# sourceMappingURL=webrtc-signaling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webrtc-signaling.js","sourceRoot":"","sources":["../../src/network/webrtc-signaling.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,qEAAqE;AACrE,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,GAAG,IAAI,CAAC;AACzD,yDAAyD;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,sDAAsD;AACtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC"}
|
package/dist/network.d.ts
CHANGED
|
@@ -1,7 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import type { HomeNodeCandidate } from "./network/home-node-candidate.js";
|
|
2
|
+
export type TransportPath = "iroh-relay" | "lan-direct" | "lan-webtransport" | "offline" | "wan-direct" | "webrtc-direct";
|
|
3
|
+
export type HttpTransportPath = "lan-direct" | "wan-direct";
|
|
4
|
+
/**
|
|
5
|
+
* The three tiers `TransportManager` (client/domain) selects and dials
|
|
6
|
+
* directly, in priority order: browser-trusted LAN HTTPS, then hash-pinned
|
|
7
|
+
* LAN WebTransport, then WAN HTTPS/WSS (ticket #1823). Distinct from
|
|
8
|
+
* `HttpTransportPath` because a WebTransport candidate is not an HTTP
|
|
9
|
+
* candidate — it carries certificate hashes, not a bearer-auth HTTPS origin.
|
|
10
|
+
*/
|
|
11
|
+
export type DirectTransportPath = "lan-direct" | "lan-webtransport" | "wan-direct";
|
|
12
|
+
export interface HttpHomeNodeCandidate extends HomeNodeCandidate {
|
|
13
|
+
/** Marks the authenticated installation origin used before a home-node trust anchor is known. */
|
|
14
|
+
readonly identityBinding?: "bootstrap";
|
|
15
|
+
readonly path: HttpTransportPath;
|
|
16
|
+
}
|
|
17
|
+
/** SHA-256 certificate hashes bound to one hash-pinned WebTransport candidate. */
|
|
18
|
+
export interface WebTransportCertificateHashes {
|
|
19
|
+
readonly algorithm: "sha-256";
|
|
20
|
+
readonly current: string;
|
|
21
|
+
readonly next: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One hash-pinned LAN WebTransport candidate (ticket #1823). `address` is
|
|
25
|
+
* the bare HTTPS origin (e.g. `https://192.0.2.10:4433`); the client-RPC path
|
|
26
|
+
* is appended internally when dialing, matching how the Rust WebTransport
|
|
27
|
+
* adapter is deployed (`core/adapters-network::webtransport`).
|
|
28
|
+
*/
|
|
29
|
+
export interface WebTransportHomeNodeCandidate extends HomeNodeCandidate {
|
|
30
|
+
readonly certificateHashes: WebTransportCertificateHashes;
|
|
31
|
+
readonly path: "lan-webtransport";
|
|
32
|
+
}
|
|
33
|
+
/** The union `TransportManager` dials — every candidate on the direct ladder. */
|
|
34
|
+
export type DirectHomeNodeCandidate = HttpHomeNodeCandidate | WebTransportHomeNodeCandidate;
|
|
2
35
|
export type TransportState = {
|
|
3
36
|
readonly changedAt: string;
|
|
4
|
-
readonly path: "lan-direct" | "wan-direct" | "iroh-relay";
|
|
37
|
+
readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct";
|
|
5
38
|
readonly status: "connected";
|
|
6
39
|
} | {
|
|
7
40
|
readonly changedAt: string;
|
package/dist/network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,CAAC;AAEnF,MAAM,MAAM,cAAc,GACtB;
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,YAAY,GAAG,kBAAkB,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,CAAC;AAE1H,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,YAAY,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,kBAAkB,GAAG,YAAY,CAAC;AAEnF,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,iGAAiG;IACjG,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC;AAED,kFAAkF;AAClF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACtE,QAAQ,CAAC,iBAAiB,EAAE,6BAA6B,CAAC;IAC1D,QAAQ,CAAC,IAAI,EAAE,kB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