@econ-v1/ports 6.7.0 → 6.11.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/app-data.d.ts +39 -0
- package/dist/app-data.d.ts.map +1 -0
- package/dist/client-ui-preference.d.ts +23 -0
- package/dist/client-ui-preference.d.ts.map +1 -0
- package/dist/clipboard.d.ts +41 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clock.d.ts +8 -8
- package/dist/clock.d.ts.map +1 -1
- package/dist/credential-handoff.d.ts +57 -0
- package/dist/credential-handoff.d.ts.map +1 -0
- package/dist/crypto.d.ts +4 -4
- package/dist/crypto.d.ts.map +1 -1
- package/dist/id.d.ts +2 -2
- package/dist/id.d.ts.map +1 -1
- package/dist/identity.d.ts +31 -25
- package/dist/identity.d.ts.map +1 -1
- package/dist/index.d.ts +226 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/install-environment.d.ts +22 -32
- package/dist/install-environment.d.ts.map +1 -1
- package/dist/lcd-tree-source.d.ts +54 -0
- package/dist/lcd-tree-source.d.ts.map +1 -0
- package/dist/legacy-credential.d.ts +30 -0
- package/dist/legacy-credential.d.ts.map +1 -0
- package/dist/media-preferences.d.ts +2 -44
- package/dist/media-preferences.d.ts.map +1 -1
- package/dist/network/certificate-trust.d.ts +31 -0
- package/dist/network/certificate-trust.d.ts.map +1 -0
- package/dist/network/client-node-origin.d.ts +3 -15
- package/dist/network/client-node-origin.d.ts.map +1 -1
- package/dist/network/home-node-candidate-store.d.ts +4 -32
- package/dist/network/home-node-candidate-store.d.ts.map +1 -1
- package/dist/network/home-node-candidate.d.ts +9 -7
- package/dist/network/home-node-candidate.d.ts.map +1 -1
- package/dist/network/l402-payment.d.ts +11 -28
- package/dist/network/l402-payment.d.ts.map +1 -1
- package/dist/network/node-discovery.d.ts +5 -16
- package/dist/network/node-discovery.d.ts.map +1 -1
- package/dist/network/webrtc-signaling.d.ts +36 -52
- package/dist/network/webrtc-signaling.d.ts.map +1 -1
- package/dist/network.d.ts +65 -40
- package/dist/network.d.ts.map +1 -1
- package/dist/offline-readiness.d.ts +122 -0
- package/dist/offline-readiness.d.ts.map +1 -0
- package/dist/onboarding-access-code.d.ts +30 -0
- package/dist/onboarding-access-code.d.ts.map +1 -0
- package/dist/onboarding-checkpoint.d.ts +26 -0
- package/dist/onboarding-checkpoint.d.ts.map +1 -0
- package/dist/onboarding-presence.d.ts +12 -0
- package/dist/onboarding-presence.d.ts.map +1 -0
- package/dist/owner-claim-session.d.ts +60 -0
- package/dist/owner-claim-session.d.ts.map +1 -0
- package/dist/owner-claim.d.ts +22 -0
- package/dist/owner-claim.d.ts.map +1 -0
- package/dist/repositories/conversation-repository.d.ts +21 -20
- package/dist/repositories/conversation-repository.d.ts.map +1 -1
- package/dist/repositories/durable-event.d.ts +8 -8
- package/dist/repositories/durable-event.d.ts.map +1 -1
- package/dist/repositories/node-app-memory-repository.d.ts +168 -0
- package/dist/repositories/node-app-memory-repository.d.ts.map +1 -0
- package/dist/repositories/outbox.d.ts +33 -20
- package/dist/repositories/outbox.d.ts.map +1 -1
- package/dist/repositories/repository-mutation.d.ts +3 -1
- package/dist/repositories/repository-mutation.d.ts.map +1 -1
- package/dist/repositories/revisioned-repository.d.ts +14 -12
- package/dist/repositories/revisioned-repository.d.ts.map +1 -1
- package/dist/repositories/settings.d.ts +10 -10
- package/dist/repositories/settings.d.ts.map +1 -1
- package/dist/repositories/sync-ledger.d.ts +11 -11
- package/dist/repositories/sync-ledger.d.ts.map +1 -1
- package/dist/repositories/wallet-mirror-repository.d.ts +22 -13
- package/dist/repositories/wallet-mirror-repository.d.ts.map +1 -1
- package/dist/repositories.d.ts +52 -17
- package/dist/repositories.d.ts.map +1 -1
- package/dist/scheduler.d.ts +4 -4
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/session-flag.d.ts +48 -0
- package/dist/session-flag.d.ts.map +1 -0
- package/dist/shell-cache-reset.d.ts +4 -0
- package/dist/shell-cache-reset.d.ts.map +1 -0
- package/dist/shell-version.d.ts +8 -0
- package/dist/shell-version.d.ts.map +1 -0
- package/dist/storage.d.ts +76 -34
- package/dist/storage.d.ts.map +1 -1
- package/dist/theme.d.ts +2 -24
- package/dist/theme.d.ts.map +1 -1
- package/package.json +14 -10
- package/src/app-data.js +42 -0
- package/src/client-ui-preference.js +23 -0
- package/src/clipboard.js +41 -0
- package/src/clock.js +13 -0
- package/src/credential-handoff.js +68 -0
- package/src/crypto.js +9 -0
- package/src/id.js +5 -0
- package/src/identity.js +33 -0
- package/src/index.js +250 -0
- package/src/install-environment.js +44 -0
- package/src/lcd-tree-source.js +56 -0
- package/src/legacy-credential.js +30 -0
- package/src/media-preferences.js +40 -0
- package/src/network/certificate-trust.js +25 -0
- package/src/network/client-node-origin.js +7 -0
- package/src/network/home-node-candidate-store.js +6 -0
- package/src/network/home-node-candidate.js +9 -0
- package/src/network/l402-payment.js +20 -0
- package/src/network/node-discovery.js +13 -0
- package/src/network/webrtc-signaling.js +40 -0
- package/src/network.js +33 -0
- package/src/offline-readiness.js +65 -0
- package/src/onboarding-access-code.js +21 -0
- package/src/onboarding-checkpoint.js +26 -0
- package/src/onboarding-presence.js +15 -0
- package/src/owner-claim-session.js +55 -0
- package/src/owner-claim.js +22 -0
- package/src/repositories/conversation-repository.js +20 -0
- package/src/repositories/durable-event.js +8 -0
- package/src/repositories/node-app-memory-repository.js +221 -0
- package/src/repositories/outbox.js +27 -0
- package/src/repositories/repository-mutation.js +8 -0
- package/src/repositories/revisioned-repository.js +17 -0
- package/src/repositories/settings.js +10 -0
- package/src/repositories/sync-ledger.js +11 -0
- package/src/repositories/wallet-mirror-repository.js +73 -0
- package/src/repositories.js +22 -0
- package/src/scheduler.js +6 -0
- package/src/session-flag.js +48 -0
- package/src/shell-cache-reset.js +3 -0
- package/src/shell-version.js +4 -0
- package/src/storage.js +60 -0
- package/src/theme.js +21 -0
- package/dist/clock.js +0 -2
- package/dist/clock.js.map +0 -1
- package/dist/crypto.js +0 -2
- package/dist/crypto.js.map +0 -1
- package/dist/id.js +0 -2
- package/dist/id.js.map +0 -1
- package/dist/identity.js +0 -2
- package/dist/identity.js.map +0 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +0 -1
- package/dist/install-environment.js +0 -26
- package/dist/install-environment.js.map +0 -1
- package/dist/media-preferences.js +0 -2
- package/dist/media-preferences.js.map +0 -1
- package/dist/network/client-node-origin.js +0 -18
- package/dist/network/client-node-origin.js.map +0 -1
- package/dist/network/home-node-candidate-store.js +0 -2
- package/dist/network/home-node-candidate-store.js.map +0 -1
- package/dist/network/home-node-candidate.js +0 -2
- package/dist/network/home-node-candidate.js.map +0 -1
- package/dist/network/l402-payment.js +0 -2
- package/dist/network/l402-payment.js.map +0 -1
- package/dist/network/node-discovery.js +0 -13
- package/dist/network/node-discovery.js.map +0 -1
- package/dist/network/webrtc-signaling.js +0 -30
- package/dist/network/webrtc-signaling.js.map +0 -1
- package/dist/network.js +0 -2
- package/dist/network.js.map +0 -1
- package/dist/repositories/conversation-repository.js +0 -2
- package/dist/repositories/conversation-repository.js.map +0 -1
- package/dist/repositories/durable-event.js +0 -2
- package/dist/repositories/durable-event.js.map +0 -1
- package/dist/repositories/outbox.js +0 -9
- package/dist/repositories/outbox.js.map +0 -1
- package/dist/repositories/repository-mutation.js +0 -2
- package/dist/repositories/repository-mutation.js.map +0 -1
- package/dist/repositories/revisioned-repository.js +0 -2
- package/dist/repositories/revisioned-repository.js.map +0 -1
- package/dist/repositories/settings.js +0 -2
- package/dist/repositories/settings.js.map +0 -1
- package/dist/repositories/sync-ledger.js +0 -2
- package/dist/repositories/sync-ledger.js.map +0 -1
- package/dist/repositories/wallet-mirror-repository.js +0 -53
- package/dist/repositories/wallet-mirror-repository.js.map +0 -1
- package/dist/repositories.js +0 -2
- package/dist/repositories.js.map +0 -1
- package/dist/scheduler.js +0 -2
- package/dist/scheduler.js.map +0 -1
- package/dist/storage.js +0 -14
- package/dist/storage.js.map +0 -1
- package/dist/theme.js +0 -2
- package/dist/theme.js.map +0 -1
|
@@ -1,101 +1,85 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
/** @typedef {import("../network.js").CancellationSignal} CancellationSignal */
|
|
2
|
+
export const WEBRTC_SIGNAL_VERSION: 1;
|
|
17
3
|
/** Maximum serialized size of one signaling WebSocket text frame. */
|
|
18
|
-
export
|
|
4
|
+
export const MAX_WEBRTC_SIGNAL_MESSAGE_BYTES: number;
|
|
19
5
|
/** Maximum SDP body size (offer, answer, or restart). */
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
6
|
+
export const MAX_SDP_BYTES: number;
|
|
7
|
+
export const MIN_OFFER_NONCE_BYTES: 16;
|
|
8
|
+
export const MAX_OFFER_NONCE_BYTES: 128;
|
|
23
9
|
/** Maximum DTLS fingerprint size: `<algorithm> <hex-pairs>`. */
|
|
24
|
-
export
|
|
10
|
+
export const MAX_DTLS_FINGERPRINT_BYTES: 200;
|
|
25
11
|
/** Maximum size of one trickle-ICE candidate line. */
|
|
26
|
-
export
|
|
27
|
-
export
|
|
12
|
+
export const MAX_ICE_CANDIDATE_BYTES: 1024;
|
|
13
|
+
export const MAX_SDP_MID_BYTES: 64;
|
|
28
14
|
/** Maximum number of trickle-ICE candidates accepted for one bound offer. */
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
15
|
+
export const MAX_ICE_CANDIDATES_PER_OFFER: 32;
|
|
16
|
+
export const MAX_CLOSE_REASON_BYTES: 256;
|
|
17
|
+
export type CancellationSignal = import("../network.js").CancellationSignal;
|
|
18
|
+
export type WebRtcSignalSetup = {
|
|
32
19
|
readonly headers: Readonly<Record<string, string>>;
|
|
33
20
|
readonly type: "setup";
|
|
34
21
|
readonly version: number;
|
|
35
|
-
}
|
|
36
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type WebRtcOffer = {
|
|
37
24
|
readonly dtls_fingerprint: string;
|
|
38
25
|
readonly offer_nonce: string;
|
|
39
26
|
readonly sdp: string;
|
|
40
27
|
readonly type: "offer";
|
|
41
28
|
readonly version: number;
|
|
42
|
-
}
|
|
43
|
-
export
|
|
29
|
+
};
|
|
30
|
+
export type WebRtcAnswer = {
|
|
44
31
|
readonly dtls_fingerprint: string;
|
|
45
32
|
readonly offer_nonce: string;
|
|
46
33
|
readonly sdp: string;
|
|
47
34
|
readonly type: "answer";
|
|
48
|
-
}
|
|
49
|
-
export
|
|
35
|
+
};
|
|
36
|
+
export type WebRtcIceCandidate = {
|
|
50
37
|
readonly candidate: string;
|
|
51
38
|
readonly offer_nonce: string;
|
|
52
39
|
readonly sdp_mid?: string;
|
|
53
40
|
readonly sdp_mline_index?: number;
|
|
54
41
|
readonly type: "candidate";
|
|
55
|
-
}
|
|
56
|
-
export
|
|
42
|
+
};
|
|
43
|
+
export type WebRtcRestart = {
|
|
57
44
|
readonly dtls_fingerprint: string;
|
|
58
45
|
readonly offer_nonce: string;
|
|
59
46
|
readonly previous_offer_nonce: string;
|
|
60
47
|
readonly sdp: string;
|
|
61
48
|
readonly type: "restart";
|
|
62
49
|
readonly version: number;
|
|
63
|
-
}
|
|
64
|
-
export
|
|
50
|
+
};
|
|
51
|
+
export type WebRtcClose = {
|
|
65
52
|
readonly offer_nonce?: string;
|
|
66
53
|
readonly reason?: string;
|
|
67
54
|
readonly type: "close";
|
|
68
|
-
}
|
|
55
|
+
};
|
|
69
56
|
export type WebRtcSignalMessage = WebRtcAnswer | WebRtcClose | WebRtcIceCandidate | WebRtcOffer | WebRtcRestart | WebRtcSignalSetup;
|
|
70
57
|
/**
|
|
71
|
-
* Browser-side signaling contract.
|
|
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
|
|
58
|
+
* Browser-side signaling transport contract. No peer connection or
|
|
75
59
|
* DataChannel is created here.
|
|
76
60
|
*/
|
|
77
|
-
export
|
|
78
|
-
close(close?: {
|
|
61
|
+
export type WebRtcSignalingPort = {
|
|
62
|
+
close: (close?: {
|
|
79
63
|
readonly offer_nonce?: string;
|
|
80
64
|
readonly reason?: string;
|
|
81
|
-
})
|
|
82
|
-
connect(setupHeaders: Readonly<Record<string, string>>, signal?: CancellationSignal)
|
|
83
|
-
sendCandidate(candidate: {
|
|
65
|
+
}) => Promise<void>;
|
|
66
|
+
connect: (setupHeaders: Readonly<Record<string, string>>, signal?: CancellationSignal) => Promise<void>;
|
|
67
|
+
sendCandidate: (candidate: {
|
|
84
68
|
readonly candidate: string;
|
|
85
69
|
readonly offer_nonce: string;
|
|
86
70
|
readonly sdp_mid?: string;
|
|
87
71
|
readonly sdp_mline_index?: number;
|
|
88
|
-
})
|
|
89
|
-
sendOffer(offer: {
|
|
72
|
+
}) => Promise<void>;
|
|
73
|
+
sendOffer: (offer: {
|
|
90
74
|
readonly dtls_fingerprint: string;
|
|
91
75
|
readonly offer_nonce: string;
|
|
92
76
|
readonly sdp: string;
|
|
93
|
-
})
|
|
94
|
-
sendRestart(restart: {
|
|
77
|
+
}) => Promise<WebRtcAnswer>;
|
|
78
|
+
sendRestart: (restart: {
|
|
95
79
|
readonly dtls_fingerprint: string;
|
|
96
80
|
readonly offer_nonce: string;
|
|
97
81
|
readonly previous_offer_nonce: string;
|
|
98
82
|
readonly sdp: string;
|
|
99
|
-
})
|
|
100
|
-
}
|
|
83
|
+
}) => Promise<WebRtcAnswer>;
|
|
84
|
+
};
|
|
101
85
|
//# sourceMappingURL=webrtc-signaling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webrtc-signaling.d.ts","sourceRoot":"","sources":["../../src/network/webrtc-signaling.
|
|
1
|
+
{"version":3,"file":"webrtc-signaling.d.ts","sourceRoot":"","sources":["../../src/network/webrtc-signaling.js"],"names":[],"mappings":"AAEA,+EAA+E;AAE/E,oCAAqC,CAAC,CAAC;AAEvC,qEAAqE;AACrE,qDAAyD;AACzD,yDAAyD;AACzD,mCAAuC;AACvC,oCAAqC,EAAE,CAAC;AACxC,oCAAqC,GAAG,CAAC;AACzC,gEAAgE;AAChE,yCAA0C,GAAG,CAAC;AAC9C,sDAAsD;AACtD,sCAAuC,IAAI,CAAC;AAC5C,gCAAiC,EAAE,CAAC;AACpC,6EAA6E;AAC7E,2CAA4C,EAAE,CAAC;AAC/C,qCAAsC,GAAG,CAAC;iCAjB5B,OAAO,eAAe,EAAE,kBAAkB;gCAmB1C;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE;0BACxG;IAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE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C,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC;mBAC9F,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC;eACxJ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,YAAY,CAAC;iBAC3H,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,YAAY,CAAC"}
|
package/dist/network.d.ts
CHANGED
|
@@ -1,66 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
/** @typedef {import("./network/home-node-candidate.js").HomeNodeCandidate} HomeNodeCandidate */
|
|
2
|
+
/** @typedef {import("./repositories/repository-mutation.js").RepositoryJsonValue} RepositoryJsonValue */
|
|
3
|
+
/** @typedef {"iroh-relay" | "lan-direct" | "lan-webtransport" | "offline" | "wan-direct" | "webrtc-direct"} TransportPath */
|
|
4
|
+
/** @typedef {"lan-direct" | "wan-direct"} HttpTransportPath */
|
|
5
|
+
/** @typedef {"lan-direct" | "lan-webtransport" | "wan-direct"} DirectTransportPath */
|
|
6
|
+
/** @typedef {HomeNodeCandidate & { readonly identityBinding?: "bootstrap", readonly path: HttpTransportPath }} HttpHomeNodeCandidate */
|
|
7
|
+
/** @typedef {{ readonly algorithm: "sha-256", readonly current: string, readonly next: string }} WebTransportCertificateHashes */
|
|
8
|
+
/** @typedef {HomeNodeCandidate & { readonly certificateHashes?: WebTransportCertificateHashes, readonly path: "lan-webtransport" }} WebTransportHomeNodeCandidate */
|
|
9
|
+
/** @typedef {HttpHomeNodeCandidate | WebTransportHomeNodeCandidate} DirectHomeNodeCandidate */
|
|
10
|
+
/** @typedef {"no-network" | "node-unreachable" | "session-required"} TransportOfflineReason */
|
|
11
|
+
/** @typedef {{ readonly changedAt: string, readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct", readonly status: "connected" } | { readonly attempt: number, readonly changedAt: string, readonly path: "offline", readonly status: "connecting" } | { readonly attempt: number, readonly changedAt: string, readonly nextRetryAt: string, readonly path: "offline", readonly status: "reconnecting" } | { readonly changedAt: string, readonly path: "offline", readonly reason?: TransportOfflineReason, readonly status: "offline" }} TransportState */
|
|
12
|
+
/** @typedef {{ readonly headers?: Readonly<Record<string, string>>, readonly operation: string, readonly payload: unknown, readonly responseType?: "blob" | "json" }} HomeNodeRequest */
|
|
13
|
+
/** @typedef {{ readonly cursor?: string, readonly domain: string }} DeltaRequest */
|
|
14
|
+
/** @typedef {{ readonly aborted: boolean }} CancellationSignal */
|
|
15
|
+
export const CAPABILITY_INVOKE_OPERATION: "POST /api/v2/system/capabilities/invoke";
|
|
16
|
+
export type HomeNodeCandidate = import("./network/home-node-candidate.js").HomeNodeCandidate;
|
|
17
|
+
export type RepositoryJsonValue = import("./repositories/repository-mutation.js").RepositoryJsonValue;
|
|
2
18
|
export type TransportPath = "iroh-relay" | "lan-direct" | "lan-webtransport" | "offline" | "wan-direct" | "webrtc-direct";
|
|
3
19
|
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
20
|
export type DirectTransportPath = "lan-direct" | "lan-webtransport" | "wan-direct";
|
|
12
|
-
export
|
|
13
|
-
/** Marks the authenticated installation origin used before a home-node trust anchor is known. */
|
|
21
|
+
export type HttpHomeNodeCandidate = HomeNodeCandidate & {
|
|
14
22
|
readonly identityBinding?: "bootstrap";
|
|
15
23
|
readonly path: HttpTransportPath;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface WebTransportCertificateHashes {
|
|
24
|
+
};
|
|
25
|
+
export type WebTransportCertificateHashes = {
|
|
19
26
|
readonly algorithm: "sha-256";
|
|
20
27
|
readonly current: string;
|
|
21
28
|
readonly next: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
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;
|
|
29
|
+
};
|
|
30
|
+
export type WebTransportHomeNodeCandidate = HomeNodeCandidate & {
|
|
31
|
+
readonly certificateHashes?: WebTransportCertificateHashes;
|
|
31
32
|
readonly path: "lan-webtransport";
|
|
32
|
-
}
|
|
33
|
-
/** The union `TransportManager` dials — every candidate on the direct ladder. */
|
|
33
|
+
};
|
|
34
34
|
export type DirectHomeNodeCandidate = HttpHomeNodeCandidate | WebTransportHomeNodeCandidate;
|
|
35
|
+
export type TransportOfflineReason = "no-network" | "node-unreachable" | "session-required";
|
|
35
36
|
export type TransportState = {
|
|
36
37
|
readonly changedAt: string;
|
|
37
38
|
readonly path: "lan-direct" | "lan-webtransport" | "wan-direct" | "iroh-relay" | "webrtc-direct";
|
|
38
39
|
readonly status: "connected";
|
|
40
|
+
} | {
|
|
41
|
+
readonly attempt: number;
|
|
42
|
+
readonly changedAt: string;
|
|
43
|
+
readonly path: "offline";
|
|
44
|
+
readonly status: "connecting";
|
|
45
|
+
} | {
|
|
46
|
+
readonly attempt: number;
|
|
47
|
+
readonly changedAt: string;
|
|
48
|
+
readonly nextRetryAt: string;
|
|
49
|
+
readonly path: "offline";
|
|
50
|
+
readonly status: "reconnecting";
|
|
39
51
|
} | {
|
|
40
52
|
readonly changedAt: string;
|
|
41
53
|
readonly path: "offline";
|
|
54
|
+
readonly reason?: TransportOfflineReason;
|
|
42
55
|
readonly status: "offline";
|
|
43
56
|
};
|
|
44
|
-
export
|
|
57
|
+
export type HomeNodeRequest = {
|
|
45
58
|
readonly headers?: Readonly<Record<string, string>>;
|
|
46
59
|
readonly operation: string;
|
|
47
60
|
readonly payload: unknown;
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
readonly responseType?: "blob" | "json";
|
|
62
|
+
};
|
|
63
|
+
export type DeltaRequest = {
|
|
50
64
|
readonly cursor?: string;
|
|
51
65
|
readonly domain: string;
|
|
52
|
-
}
|
|
53
|
-
export
|
|
54
|
-
deltas<T>(request: DeltaRequest): AsyncIterable<T>;
|
|
55
|
-
invoke<T>(request: HomeNodeRequest): Promise<T>;
|
|
56
|
-
readonly state: TransportState;
|
|
57
|
-
}
|
|
58
|
-
export interface CancellationSignal {
|
|
66
|
+
};
|
|
67
|
+
export type CancellationSignal = {
|
|
59
68
|
readonly aborted: boolean;
|
|
60
|
-
}
|
|
61
|
-
export
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
};
|
|
70
|
+
export type AppEventEnvelope = {
|
|
71
|
+
readonly data: Readonly<Record<string, RepositoryJsonValue>>;
|
|
72
|
+
readonly instance?: string;
|
|
73
|
+
readonly resource: string;
|
|
74
|
+
readonly type: string;
|
|
75
|
+
};
|
|
76
|
+
export type AppEventSubscribeOptions = {
|
|
77
|
+
readonly resourceId?: string;
|
|
78
|
+
};
|
|
79
|
+
export type AppEventSubscription = () => void;
|
|
80
|
+
export type HomeNodeClient = {
|
|
81
|
+
deltas: <T>(request: DeltaRequest) => AsyncIterable<T>;
|
|
82
|
+
invoke: <T>(request: HomeNodeRequest) => Promise<T>;
|
|
83
|
+
subscribeAppEvents?: (resource: string, listener: (event: AppEventEnvelope) => void, options?: AppEventSubscribeOptions) => AppEventSubscription;
|
|
84
|
+
readonly state: TransportState;
|
|
85
|
+
};
|
|
86
|
+
export type PeerTransportPort = {
|
|
87
|
+
send: (peer: string, payload: Uint8Array, signal?: CancellationSignal) => Promise<void>;
|
|
88
|
+
publish: (topic: string, payload: Uint8Array) => Promise<void>;
|
|
89
|
+
subscribe: (topic: string, signal?: CancellationSignal) => AsyncIterable<Uint8Array>;
|
|
90
|
+
};
|
|
66
91
|
//# sourceMappingURL=network.d.ts.map
|
package/dist/network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.
|
|
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,+FAA+F;AAC/F,wkBAAwkB;AACxkB,yLAAyL;AACzL,oFAAoF;AACpF,kEAAkE;AAElE,0CAA2C,yCAAyC,CAAC;gCAhBvE,OAAO,kCAAkC,EAAE,iBAAiB;kCAC5D,OAAO,uCAAuC,EAAE,mBAAmB;4BAEnE,YAAY,GAAG,YAAY,GAAG,kBAAkB,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe;gCAC7F,YAAY,GAAG,Y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;;UAIjS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC;aACjF,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC;eACrD,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,KAAK,aAAa,CAAC,UAAU,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export type StageCatalogEntry = import("./repositories.js").StageCatalogEntry;
|
|
2
|
+
export type StageManifest = import("./repositories.js").StageManifest;
|
|
3
|
+
export type StageRegistrySnapshot = import("./repositories.js").StageRegistrySnapshot;
|
|
4
|
+
export type RepositoryJsonValue = import("./repositories/repository-mutation.js").RepositoryJsonValue;
|
|
5
|
+
export type OfflineIdentityScope = {
|
|
6
|
+
readonly deviceDid: string;
|
|
7
|
+
readonly homeNodeId: string;
|
|
8
|
+
};
|
|
9
|
+
export type OfflineStageState = "caching-assets" | "needs-first-sync" | "offline-ready" | "update-available" | "failed" | "removing";
|
|
10
|
+
export type OfflineReadinessFailureCode = "asset-fetch-failed" | "asset-integrity-failed" | "projection-seed-failed" | "schema-incompatible" | "quota-exceeded" | "identity-mismatch" | "active-resource-corrupt";
|
|
11
|
+
export type OfflineStageReadiness = {
|
|
12
|
+
readonly appName: string;
|
|
13
|
+
readonly activeManifestSha256?: string;
|
|
14
|
+
readonly candidateManifestSha256?: string;
|
|
15
|
+
readonly failureCode?: OfflineReadinessFailureCode;
|
|
16
|
+
readonly state: OfflineStageState;
|
|
17
|
+
readonly updatedAt: string;
|
|
18
|
+
};
|
|
19
|
+
export type StageAssetCandidate = {
|
|
20
|
+
readonly assetRevision: string;
|
|
21
|
+
readonly appName: string;
|
|
22
|
+
readonly entryUrl: string;
|
|
23
|
+
readonly manifestSha256: string;
|
|
24
|
+
readonly version: string;
|
|
25
|
+
};
|
|
26
|
+
export type VerifiedStageAssetPort = {
|
|
27
|
+
prepareCandidate(entry: StageCatalogEntry, catalogRevision: string): Promise<StageAssetCandidate>;
|
|
28
|
+
validateCandidate(candidate: StageAssetCandidate, manifest: StageManifest): Promise<void>;
|
|
29
|
+
discardCandidate(candidate: StageAssetCandidate): Promise<void>;
|
|
30
|
+
deleteUnreferenced(keepAssetRevisions: readonly string[]): Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
export type OfflineStorageEstimatePort = {
|
|
33
|
+
estimate(): Promise<{
|
|
34
|
+
readonly quota?: number;
|
|
35
|
+
readonly usage?: number;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
export type OfflineStagePreparationRecord = {
|
|
39
|
+
readonly appName: string;
|
|
40
|
+
readonly candidateManifestSha256: string;
|
|
41
|
+
readonly sourceRevision: string;
|
|
42
|
+
readonly state: "caching-assets" | "update-available";
|
|
43
|
+
readonly updatedAt: string;
|
|
44
|
+
};
|
|
45
|
+
export type OfflineStageCommit = {
|
|
46
|
+
readonly assetRevision: string;
|
|
47
|
+
readonly entry: StageCatalogEntry;
|
|
48
|
+
readonly projectionRevision?: string;
|
|
49
|
+
readonly sourceRevision: string;
|
|
50
|
+
};
|
|
51
|
+
export type OfflineStageCommitRecord = {
|
|
52
|
+
readonly active: OfflineStageCommit;
|
|
53
|
+
readonly rollback?: OfflineStageCommit;
|
|
54
|
+
};
|
|
55
|
+
export type OfflineStageBundleCommitInput = {
|
|
56
|
+
readonly candidate: StageAssetCandidate;
|
|
57
|
+
readonly entry: StageCatalogEntry;
|
|
58
|
+
readonly sourceRevision: string;
|
|
59
|
+
};
|
|
60
|
+
export type OfflineStagePromotionInput = {
|
|
61
|
+
readonly candidate: StageAssetCandidate;
|
|
62
|
+
readonly entry: StageCatalogEntry;
|
|
63
|
+
readonly projectionRevision: string;
|
|
64
|
+
readonly requiredProjectionKeys: readonly string[];
|
|
65
|
+
readonly sourceRevision: string;
|
|
66
|
+
};
|
|
67
|
+
export type OfflineStageFailureInput = {
|
|
68
|
+
readonly appName: string;
|
|
69
|
+
readonly candidateManifestSha256?: string;
|
|
70
|
+
readonly failureCode: OfflineReadinessFailureCode;
|
|
71
|
+
readonly updatedAt: string;
|
|
72
|
+
};
|
|
73
|
+
export type OfflineProjectionRecord = {
|
|
74
|
+
readonly cursor?: string;
|
|
75
|
+
readonly updatedAt: string;
|
|
76
|
+
readonly value: RepositoryJsonValue;
|
|
77
|
+
};
|
|
78
|
+
export type OfflineProjectionBatchRecord = {
|
|
79
|
+
readonly key: string;
|
|
80
|
+
readonly record: OfflineProjectionRecord;
|
|
81
|
+
};
|
|
82
|
+
export type OfflineProjectionBatchCommit = {
|
|
83
|
+
readonly cursor?: string;
|
|
84
|
+
readonly records: readonly OfflineProjectionBatchRecord[];
|
|
85
|
+
readonly updatedAt: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Durable installed-stage entries, preparation journals, active/rollback
|
|
89
|
+
* references, and readiness state. Every operation requires an explicit
|
|
90
|
+
* identity scope.
|
|
91
|
+
*
|
|
92
|
+
* Catalog mutations are confined to bundle commit/promotion, rollback
|
|
93
|
+
* activation, and removal state-machine operations.
|
|
94
|
+
*/
|
|
95
|
+
export type OfflineStageRepository = {
|
|
96
|
+
readCatalog(scope: OfflineIdentityScope): Promise<StageRegistrySnapshot | undefined>;
|
|
97
|
+
readCommit(scope: OfflineIdentityScope, appName: string): Promise<OfflineStageCommitRecord | undefined>;
|
|
98
|
+
listReadiness(scope: OfflineIdentityScope): Promise<readonly OfflineStageReadiness[]>;
|
|
99
|
+
recordPreparation(scope: OfflineIdentityScope, record: OfflineStagePreparationRecord): Promise<void>;
|
|
100
|
+
commitNewBundle(scope: OfflineIdentityScope, input: OfflineStageBundleCommitInput): Promise<void>;
|
|
101
|
+
confirmBootHealth(scope: OfflineIdentityScope, appName: string, manifestSha256: string): Promise<OfflineStageCommit | undefined>;
|
|
102
|
+
activateRollback(scope: OfflineIdentityScope, appName: string, activeManifestSha256: string, rollbackManifestSha256: string): Promise<OfflineStageCommit | undefined>;
|
|
103
|
+
promoteOfflineReady(scope: OfflineIdentityScope, input: OfflineStagePromotionInput): Promise<void>;
|
|
104
|
+
markFailed(scope: OfflineIdentityScope, input: OfflineStageFailureInput): Promise<void>;
|
|
105
|
+
removeStage(scope: OfflineIdentityScope, appName: string, sourceRevision: string): Promise<void>;
|
|
106
|
+
finalizeRemoval(scope: OfflineIdentityScope, appName: string): Promise<void>;
|
|
107
|
+
invalidateScope(scope: OfflineIdentityScope): Promise<void>;
|
|
108
|
+
clearScope(scope: OfflineIdentityScope): Promise<void>;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Identity-scoped versioned projection records and revision heads. Every
|
|
112
|
+
* operation requires an explicit identity scope.
|
|
113
|
+
*/
|
|
114
|
+
export type OfflineProjectionRepository = {
|
|
115
|
+
read(scope: OfflineIdentityScope, namespace: string, projectionRevision: string, key: string): Promise<OfflineProjectionRecord | undefined>;
|
|
116
|
+
write(scope: OfflineIdentityScope, namespace: string, projectionRevision: string, key: string, record: OfflineProjectionRecord): Promise<void>;
|
|
117
|
+
writeBatch(scope: OfflineIdentityScope, namespace: string, projectionRevision: string, commit: OfflineProjectionBatchCommit): Promise<void>;
|
|
118
|
+
hasKeys(scope: OfflineIdentityScope, namespace: string, projectionRevision: string, keys: readonly string[]): Promise<boolean>;
|
|
119
|
+
deleteRevision(scope: OfflineIdentityScope, namespace: string, projectionRevision: string): Promise<void>;
|
|
120
|
+
clearScope(scope: OfflineIdentityScope): Promise<void>;
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=offline-readiness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-readiness.d.ts","sourceRoot":"","sources":["../src/offline-readiness.js"],"names":[],"mappings":"gCAEc,OAAO,mBAAmB,EAAE,iBAAiB;4BAC7C,OAAO,mBAAmB,EAAE,aAAa;oCACzC,OAAO,mBAAmB,EAAE,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AE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/H,cAAc,CAAC,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1G,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The access code a person types (or scans via the step-9 QR) to claim this node — the
|
|
3
|
+
* shared secret `OwnerClaimService.prepareClaim(accessCode)` sends as `access_code` on
|
|
4
|
+
* `POST /api/v2/node/onboarding-prepare`.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately `localStorage`-shaped, exactly like `OnboardingCheckpointStoragePort`: step 7
|
|
7
|
+
* destroys the tab the owner was working in, and a code re-typed by hand before that
|
|
8
|
+
* navigation must still be there afterwards rather than forcing a second entry. Not
|
|
9
|
+
* `sessionStorage` for the same reason — the owner may land in a brand-new tab.
|
|
10
|
+
*
|
|
11
|
+
* Every method degrades silently. Reading or writing `localStorage` — and even *touching*
|
|
12
|
+
* the property — can throw in locked-down embedders, and losing this code must never abort
|
|
13
|
+
* onboarding; the person simply gets asked to type it again.
|
|
14
|
+
*/
|
|
15
|
+
export type OnboardingAccessCodeStore = {
|
|
16
|
+
/**
|
|
17
|
+
* Returns the stored code, or `null` for "never saved" AND for "the read itself failed"
|
|
18
|
+
* alike — the caller must not (and cannot) tell those two cases apart.
|
|
19
|
+
*/
|
|
20
|
+
read: () => string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Stores `code`. A failed write is swallowed; the flow continues without persistence.
|
|
23
|
+
*/
|
|
24
|
+
save: (code: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Empties the slot. Never throws.
|
|
27
|
+
*/
|
|
28
|
+
clear: () => void;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=onboarding-access-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-access-code.d.ts","sourceRoot":"","sources":["../src/onboarding-access-code.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;UAgBc,MAAM,MAAM,GAAG,IAAI;;;;UAEnB,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;;;;WACtB,MAAM,IAAI"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one string slot the onboarding flow needs to survive a full navigation.
|
|
3
|
+
*
|
|
4
|
+
* Step 7 deliberately destroys the tab the owner was working in (the node's AP closes and the
|
|
5
|
+
* browser must be pointed at the home-LAN address), and the kernel is an elected leader tab —
|
|
6
|
+
* not a SharedWorker — so its in-memory service state dies with that tab. Without a slot that
|
|
7
|
+
* outlives the navigation the flow restarts at step 3.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately `localStorage`-shaped rather than OPFS-backed: OPFS is gated pre-claim
|
|
10
|
+
* (`requiresDurableStorage`), which is exactly the window this must work in. Deliberately
|
|
11
|
+
* NOT `sessionStorage` (`SessionFlagPort`): the owner may be handed a brand-new tab.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately synchronous and string-typed: `OnboardingCheckpointStore` owns the schema, the
|
|
14
|
+
* allow-list and the staleness rule, so this port cannot be handed a structured object that
|
|
15
|
+
* happens to carry a Wi-Fi password.
|
|
16
|
+
*
|
|
17
|
+
* Every method degrades silently, exactly like `SessionFlagPort`: reading or writing
|
|
18
|
+
* `localStorage` — and even *touching* the property — can throw in locked-down embedders, and
|
|
19
|
+
* losing a resume point must never abort onboarding.
|
|
20
|
+
*/
|
|
21
|
+
export type OnboardingCheckpointStoragePort = {
|
|
22
|
+
clear: () => void;
|
|
23
|
+
read: () => string | undefined;
|
|
24
|
+
write: (value: string) => void;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=onboarding-checkpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-checkpoint.d.ts","sourceRoot":"","sources":["../src/onboarding-checkpoint.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;WAsBc,MAAM,IAAI;UACV,MAAM,MAAM,GAAG,SAAS;WACxB,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @returns {OnboardingPresencePort}
|
|
3
|
+
*/
|
|
4
|
+
export function createNullOnboardingPresence(): OnboardingPresencePort;
|
|
5
|
+
/**
|
|
6
|
+
* Phases the node's onboarding FSM understands. Fire-and-forget hints (spec §3.2).
|
|
7
|
+
*/
|
|
8
|
+
export type OnboardingPresencePhase = "portal" | "wifi_setup" | "register" | "install";
|
|
9
|
+
export type OnboardingPresencePort = {
|
|
10
|
+
announce: (phase: OnboardingPresencePhase) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=onboarding-presence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-presence.d.ts","sourceRoot":"","sources":["../src/onboarding-presence.js"],"names":[],"mappings":"AACA;;GAEG;AACH,gDAFa,sBAAsB,CAIlC;;;;sCAGY,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS;;cAI/C,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** For compositions with no browser session client (tests, headless kernels): every claim is
|
|
2
|
+
* reported as unpaired, which is the safe direction — the shell runs its pairing flow.
|
|
3
|
+
* @returns {OwnerClaimSessionPort}
|
|
4
|
+
*/
|
|
5
|
+
export function createNullOwnerClaimSession(): OwnerClaimSessionPort;
|
|
6
|
+
/**
|
|
7
|
+
* The seam through which a successful first-owner claim becomes a REAL browser session
|
|
8
|
+
* (design §7.1).
|
|
9
|
+
*
|
|
10
|
+
* `POST /api/auth/complete-onboarding` answers with `token` / `refresh_token` /
|
|
11
|
+
* `token_expires_at` (`core/adapters-network/src/transport/auth/handlers.rs`), but
|
|
12
|
+
* `client/domain` cannot do anything with them: turning an owner JWT into a client-device
|
|
13
|
+
* session means talking to `/api/v2/client-devices/*` with browser-held key material, which is
|
|
14
|
+
* `client/adapters-web`'s job. Hence a port.
|
|
15
|
+
*
|
|
16
|
+
* `adopt` returns a BOOLEAN rather than throwing or returning void, and that is the whole
|
|
17
|
+
* design: a `false` means "the claim succeeded but this browser is not paired", and the flow
|
|
18
|
+
* then falls back to the shell's ordinary pairing screen. Nothing here may assert a trust
|
|
19
|
+
* relationship the browser does not hold — whether the node auto-approves the owner's first
|
|
20
|
+
* device is the node's decision, not this client's assumption.
|
|
21
|
+
*
|
|
22
|
+
* SECURITY: only the access token and its expiry cross this boundary. The refresh token is
|
|
23
|
+
* deliberately NOT part of `OwnerClaimSessionTokens` — no client code today can spend it, and a
|
|
24
|
+
* long-lived credential held with no consumer is pure downside.
|
|
25
|
+
*/
|
|
26
|
+
export type OwnerClaimSessionTokens = {
|
|
27
|
+
accessToken: string;
|
|
28
|
+
/**
|
|
29
|
+
* ISO instant. An already-expired value must be refused rather than adopted.
|
|
30
|
+
*/
|
|
31
|
+
expiresAt: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Wire-shaped, snake_case: `genesis_device` crosses to the node verbatim as a field of
|
|
35
|
+
* `POST /api/auth/complete-onboarding`'s payload (`core/domain/src/services/
|
|
36
|
+
* onboarding_completion_service.rs`'s `GenesisDeviceDescriptor`), so this typedef mirrors the
|
|
37
|
+
* Rust struct field-for-field rather than the camelCase this package otherwise prefers — the
|
|
38
|
+
* same precedent as `OwnerClaimSessionTokens` staying JS-shaped for values that stay client-side
|
|
39
|
+
* while wire payloads built for direct forwarding stay wire-shaped.
|
|
40
|
+
*/
|
|
41
|
+
export type OwnerClaimGenesisDevice = {
|
|
42
|
+
public_key_multibase: string;
|
|
43
|
+
device_name: string;
|
|
44
|
+
device_type: string;
|
|
45
|
+
signature: string;
|
|
46
|
+
};
|
|
47
|
+
export type OwnerClaimSessionPort = {
|
|
48
|
+
adopt: (tokens: OwnerClaimSessionTokens) => Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* OPTIONAL: builds the signed
|
|
51
|
+
* `genesis_device` proof-of-possession descriptor for the given onboarding-challenge string, so
|
|
52
|
+
* the node can mint the genesis DID device with this browser's real pairing identity instead of
|
|
53
|
+
* a synthetic fallback. `undefined` — from an implementation that omits the member entirely, or
|
|
54
|
+
* from any failure to build the descriptor — means the claim proceeds without one; `adopt` must
|
|
55
|
+
* never depend on this having been called. `createNullOwnerClaimSession()` deliberately leaves
|
|
56
|
+
* this unimplemented (adopt-only) since it is optional.
|
|
57
|
+
*/
|
|
58
|
+
describeGenesisDevice?: (challenge: string) => Promise<OwnerClaimGenesisDevice | undefined>;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=owner-claim-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-claim-session.d.ts","sourceRoot":"","sources":["../src/owner-claim-session.js"],"names":[],"mappings":"AACA;;;GAGG;AACH,+CAFa,qBAAqB,CAIjC;;;;;;;;;;;;;;;;;;;;;;iBAqBa,MAAM;;;;eACN,MAAM;;;;;;;;;;;0BAUN,MAAM;iBACN,MAAM;iBACN,MAAM;eACN,MAAM;;;WAIN,CAAC,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC;;;;;;;;;;4BACrD,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ephemeral secp256k1 identity used ONLY for the legacy BIP39-shaped first-owner
|
|
3
|
+
* onboarding contract (`POST /api/v2/node/onboarding-prepare` /
|
|
4
|
+
* `POST /api/auth/{onboarding-challenge,complete-onboarding}` —
|
|
5
|
+
* verified server-side by `core/auth/src/crypto.rs`'s `CryptoService`).
|
|
6
|
+
*
|
|
7
|
+
* Deliberately separate from `IdentityPort` (Ed25519, used for client-device
|
|
8
|
+
* pairing/session, `./identity.ts`): the host's owner-onboarding endpoints verify
|
|
9
|
+
* secp256k1 ECDSA signatures over a hex-encoded uncompressed public key — a different
|
|
10
|
+
* scheme from the device identity this browser establishes afterwards to pair as a
|
|
11
|
+
* client device. One browser session generates and holds exactly one such key per
|
|
12
|
+
* onboarding attempt (mirrors the legacy `system/ui` flow's "ONE device keypair for
|
|
13
|
+
* the whole onboarding attempt" invariant — the node's physical-confirmation gate binds
|
|
14
|
+
* approval to the exact public key sent to `onboarding-prepare`).
|
|
15
|
+
*/
|
|
16
|
+
export type OwnerClaimCryptoPort = {
|
|
17
|
+
publicKey: () => Promise<string>;
|
|
18
|
+
sign: (challenge: string) => Promise<string>;
|
|
19
|
+
deviceInfo: () => string;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=owner-claim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-claim.d.ts","sourceRoot":"","sources":["../src/owner-claim.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;eAiBc,MAAM,OAAO,CAAC,MAAM,CAAC;UACrB,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC;gBACtC,MAAM,MAAM;WACZ,MAAM,IAAI"}
|