@econ-v1/rpc 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/client-device-pending-contract.d.ts +14 -0
- package/dist/client-device-pending-contract.d.ts.map +1 -0
- package/dist/client.d.ts +15 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/device-boot-contract.d.ts +7 -0
- package/dist/device-boot-contract.d.ts.map +1 -0
- package/dist/device-cleanup-contract.d.ts +17 -0
- package/dist/device-cleanup-contract.d.ts.map +1 -0
- package/dist/dialog-contract.d.ts +26 -0
- package/dist/dialog-contract.d.ts.map +1 -0
- package/dist/errors.d.ts +33 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +144 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/message-port-client.d.ts +134 -16
- package/dist/message-port-client.d.ts.map +1 -1
- package/dist/node-app-memory-contract.d.ts +10 -0
- package/dist/node-app-memory-contract.d.ts.map +1 -0
- package/dist/onboarding/discovery-contract.d.ts +61 -34
- package/dist/onboarding/discovery-contract.d.ts.map +1 -1
- package/dist/onboarding/onboarding-contract.d.ts +119 -27
- package/dist/onboarding/onboarding-contract.d.ts.map +1 -1
- package/dist/onboarding/owner-claim-contract.d.ts +50 -0
- package/dist/onboarding/owner-claim-contract.d.ts.map +1 -0
- package/dist/pairing-status-contract.d.ts +40 -0
- package/dist/pairing-status-contract.d.ts.map +1 -0
- package/dist/protocol.d.ts +50 -12
- package/dist/protocol.d.ts.map +1 -1
- package/dist/stage-context.d.ts +31 -16
- package/dist/stage-context.d.ts.map +1 -1
- package/dist/sync-cursors-contract.d.ts +6 -0
- package/dist/sync-cursors-contract.d.ts.map +1 -0
- package/dist/system-notice-contract.d.ts +70 -0
- package/dist/system-notice-contract.d.ts.map +1 -0
- package/dist/transport-contract.d.ts +11 -0
- package/dist/transport-contract.d.ts.map +1 -0
- package/dist/transport.d.ts +2 -2
- package/dist/transport.d.ts.map +1 -1
- package/dist/trust-contract.d.ts +23 -0
- package/dist/trust-contract.d.ts.map +1 -0
- package/package.json +16 -12
- package/src/client-device-pending-contract.js +6 -0
- package/src/client.js +26 -0
- package/src/device-boot-contract.js +4 -0
- package/src/device-cleanup-contract.js +9 -0
- package/src/dialog-contract.js +6 -0
- package/src/errors.js +111 -0
- package/src/index.js +194 -0
- package/src/message-port-client.js +628 -0
- package/src/node-app-memory-contract.js +10 -0
- package/src/onboarding/discovery-contract.js +83 -0
- package/src/onboarding/onboarding-contract.js +106 -0
- package/src/onboarding/owner-claim-contract.js +59 -0
- package/src/pairing-status-contract.js +36 -0
- package/src/protocol.js +758 -0
- package/src/stage-context.js +27 -0
- package/src/sync-cursors-contract.js +3 -0
- package/src/system-notice-contract.js +64 -0
- package/src/transport-contract.js +11 -0
- package/src/transport.js +6 -0
- package/src/trust-contract.js +36 -0
- package/dist/client.js +0 -2
- package/dist/client.js.map +0 -1
- package/dist/errors.js +0 -57
- package/dist/errors.js.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/message-port-client.js +0 -365
- package/dist/message-port-client.js.map +0 -1
- package/dist/onboarding/discovery-contract.js +0 -42
- package/dist/onboarding/discovery-contract.js.map +0 -1
- package/dist/onboarding/onboarding-contract.js +0 -37
- package/dist/onboarding/onboarding-contract.js.map +0 -1
- package/dist/protocol.js +0 -295
- package/dist/protocol.js.map +0 -1
- package/dist/stage-context.js +0 -2
- package/dist/stage-context.js.map +0 -1
- package/dist/transport.js +0 -2
- package/dist/transport.js.map +0 -1
|
@@ -1,61 +1,91 @@
|
|
|
1
|
+
/** @typedef {"probing" | "reachable" | "verified" | "unreachable"} DiscoveryCandidateStatus */
|
|
2
|
+
/**
|
|
3
|
+
* The verified node's non-secret projection: nothing here is (or derives) a routable
|
|
4
|
+
* address, macaroon, or key — only what the found-node card renders.
|
|
5
|
+
*
|
|
6
|
+
* @typedef {{
|
|
7
|
+
* readonly displayName: string,
|
|
8
|
+
* readonly maskedNodeId: string
|
|
9
|
+
* }} DiscoveryFoundNode
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {{
|
|
13
|
+
* readonly address: string,
|
|
14
|
+
* readonly node?: DiscoveryFoundNode,
|
|
15
|
+
* readonly status: DiscoveryCandidateStatus
|
|
16
|
+
* }} DiscoveryCandidateView
|
|
17
|
+
*/
|
|
18
|
+
/** @typedef {{ readonly addresses: readonly string[] }} ProbeCandidatesPayload */
|
|
19
|
+
/** @typedef {{ readonly address: string }} PromoteCandidatePayload */
|
|
20
|
+
/** @typedef {{ readonly address: string }} DiscoverNodePayload */
|
|
21
|
+
/** @typedef {{ readonly address: string, readonly id: string, readonly path: "lan-direct" }} NodeDiscoveryCandidate */
|
|
22
|
+
/**
|
|
23
|
+
* @typedef {
|
|
24
|
+
* | { readonly status: "verified", readonly candidate: NodeDiscoveryCandidate }
|
|
25
|
+
* | { readonly status: "reached-but-invalid", readonly reason: string }
|
|
26
|
+
* | { readonly status: "unreachable-or-untrusted" }
|
|
27
|
+
* } NodeDiscoveryResult
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* @param {unknown} value
|
|
31
|
+
* @returns {value is ProbeCandidatesPayload}
|
|
32
|
+
*/
|
|
33
|
+
export function isProbeCandidatesPayload(value: unknown): value is ProbeCandidatesPayload;
|
|
34
|
+
/**
|
|
35
|
+
* @param {unknown} value
|
|
36
|
+
* @returns {value is PromoteCandidatePayload}
|
|
37
|
+
*/
|
|
38
|
+
export function isPromoteCandidatePayload(value: unknown): value is PromoteCandidatePayload;
|
|
39
|
+
/**
|
|
40
|
+
* @param {unknown} value
|
|
41
|
+
* @returns {value is DiscoverNodePayload}
|
|
42
|
+
*/
|
|
43
|
+
export function isDiscoverNodePayload(value: unknown): value is DiscoverNodePayload;
|
|
1
44
|
/**
|
|
2
45
|
* The #1815 interim "search the node on the LAN" seam. Client-only vertical slice: the
|
|
3
46
|
* discovery screen probes explicit candidate addresses (manually entered today, a signed
|
|
4
47
|
* bootstrap descriptor's `lan_candidates` in the Phase-2 follow-on — see
|
|
5
48
|
* `docs/superpowers/plans/2026-07-25-client-node-lan-discovery.md`) and the kernel reports
|
|
6
|
-
* live per-candidate progress. Mirrors `./onboarding-contract.
|
|
49
|
+
* live per-candidate progress. Mirrors `./onboarding-contract.js`'s idiom: locked wire-name
|
|
7
50
|
* constants + JSON-safe view/payload types + a runtime validator per command payload.
|
|
8
51
|
*
|
|
9
52
|
* `DISCOVERY_QUERY` is both a one-shot `query()` and a `liveQuery()` name (the kernel's
|
|
10
53
|
* `LiveQueryDefinition` row type is `DiscoveryCandidateView`, keyed by `address`) — the same
|
|
11
54
|
* dual usage every other query in `@econ-v1/kernel`'s `LiveQueryEngine` supports.
|
|
12
55
|
*/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
* The pre-pairing "is this address really a node" check (lan-direct-pairing plan). Unlike
|
|
18
|
-
* `DISCOVERY_PROBE_COMMAND` (which re-proves a candidate against an *already-known* home-node
|
|
19
|
-
* id), this takes one address the person just typed in and asks it to prove itself via its
|
|
20
|
-
* public origin proof alone — no session, no expected node id, no auth headers.
|
|
21
|
-
*/
|
|
22
|
-
export declare const DISCOVER_NODE_COMMAND: "onboarding.discovery.discover-node.v1";
|
|
56
|
+
export const DISCOVERY_QUERY: "onboarding.discovery.v1";
|
|
57
|
+
export const DISCOVERY_PROBE_COMMAND: "onboarding.discovery.probe.v1";
|
|
58
|
+
export const DISCOVERY_PROMOTE_COMMAND: "onboarding.discovery.promote.v1";
|
|
59
|
+
export const DISCOVER_NODE_COMMAND: "onboarding.discovery.discover-node.v1";
|
|
23
60
|
export type DiscoveryCandidateStatus = "probing" | "reachable" | "verified" | "unreachable";
|
|
24
61
|
/**
|
|
25
62
|
* The verified node's non-secret projection: nothing here is (or derives) a routable
|
|
26
63
|
* address, macaroon, or key — only what the found-node card renders.
|
|
27
64
|
*/
|
|
28
|
-
export
|
|
65
|
+
export type DiscoveryFoundNode = {
|
|
29
66
|
readonly displayName: string;
|
|
30
67
|
readonly maskedNodeId: string;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
68
|
+
};
|
|
69
|
+
export type DiscoveryCandidateView = {
|
|
33
70
|
readonly address: string;
|
|
34
71
|
readonly node?: DiscoveryFoundNode;
|
|
35
72
|
readonly status: DiscoveryCandidateStatus;
|
|
36
|
-
}
|
|
37
|
-
export
|
|
73
|
+
};
|
|
74
|
+
export type ProbeCandidatesPayload = {
|
|
38
75
|
readonly addresses: readonly string[];
|
|
39
|
-
}
|
|
40
|
-
export
|
|
76
|
+
};
|
|
77
|
+
export type PromoteCandidatePayload = {
|
|
41
78
|
readonly address: string;
|
|
42
|
-
}
|
|
43
|
-
export
|
|
79
|
+
};
|
|
80
|
+
export type DiscoverNodePayload = {
|
|
44
81
|
readonly address: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface NodeDiscoveryCandidate {
|
|
82
|
+
};
|
|
83
|
+
export type NodeDiscoveryCandidate = {
|
|
48
84
|
readonly address: string;
|
|
49
85
|
readonly id: string;
|
|
50
86
|
readonly path: "lan-direct";
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
* The JSON-safe wire result of `DISCOVER_NODE_COMMAND`. Deliberately opaque about *why* an
|
|
54
|
-
* address is unreachable — a self-signed-certificate rejection and a plain network failure
|
|
55
|
-
* are indistinguishable to browser `fetch`, so both collapse into `"unreachable-or-untrusted"`
|
|
56
|
-
* rather than the UI guessing which one happened.
|
|
57
|
-
*/
|
|
58
|
-
export type NodeDiscoveryResult = {
|
|
87
|
+
};
|
|
88
|
+
export type NodeDiscoveryResult = any | {
|
|
59
89
|
readonly status: "verified";
|
|
60
90
|
readonly candidate: NodeDiscoveryCandidate;
|
|
61
91
|
} | {
|
|
@@ -64,7 +94,4 @@ export type NodeDiscoveryResult = {
|
|
|
64
94
|
} | {
|
|
65
95
|
readonly status: "unreachable-or-untrusted";
|
|
66
96
|
};
|
|
67
|
-
export declare function isProbeCandidatesPayload(value: unknown): value is ProbeCandidatesPayload;
|
|
68
|
-
export declare function isPromoteCandidatePayload(value: unknown): value is PromoteCandidatePayload;
|
|
69
|
-
export declare function isDiscoverNodePayload(value: unknown): value is DiscoverNodePayload;
|
|
70
97
|
//# sourceMappingURL=discovery-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-contract.d.ts","sourceRoot":"","sources":["../../src/onboarding/discovery-contract.
|
|
1
|
+
{"version":3,"file":"discovery-contract.d.ts","sourceRoot":"","sources":["../../src/onboarding/discovery-contract.js"],"names":[],"mappings":"AAsBA,+FAA+F;AAE/F;;;;;;;;GAQG;AAEH;;;;;;GAMG;AAEH,kFAAkF;AAClF,sEAAsE;AACtE,kEAAkE;AAClE,uHAAuH;AACvH;;;;;;GAMG;AAEH;;;GAGG;AACH,gDAHW,OAAO,GACL,KAAK,IAAI,sBAAsB,CAQ3C;AAED;;;GAGG;AACH,iDAHW,OAAO,GACL,KAAK,IAAI,uBAAuB,CAK5C;AAED;;;GAGG;AACH,6CAHW,OAAO,GACL,KAAK,IAAI,mBAAmB,CAKxC;AA9ED;;;;;;;;;;;GAWG;AAEH,8BAA+B,yBAAyB,CAAC;AACzD,sCAAuC,+BAA+B,CAAC;AACvE,wCAAyC,iCAAiC,CAAC;AAC3E,oCAAqC,uCAAuC,CAAC;uCAE/D,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa;;;;;iCAMrD;IACZ,QAAY,CAAC,WAAW,EAAE,MAAM,CAAC;IACjC,QAAY,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;qCAIS;IACZ,QAAY,CAAC,OAAO,EAAE,MAAM,CAAC;IAC7B,QAAY,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAY,CAAC,MAAM,EAAE,wBAAwB,CAAA;CAC1C;qCAGU;IAAE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;sCACzC;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE;kCAC5B;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE;qCAC5B;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE;kCAG3F,GAAC,GAAK;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"}
|
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
/** @param {unknown} value @returns {value is OnboardingCommand} */
|
|
2
|
+
export function isOnboardingCommand(value: unknown): value is OnboardingCommand;
|
|
3
|
+
export const ONBOARDING_STATUS_QUERY: "onboarding.status.v1";
|
|
4
|
+
export const ONBOARDING_COMMAND: "onboarding.command.v1";
|
|
5
|
+
export const ONBOARDING_EVENTS: "onboarding.events.v1";
|
|
6
|
+
export const ONBOARDING_FLOW_QUERY: "onboarding.flow.v1";
|
|
7
|
+
export const ONBOARDING_LCD_SCREEN_QUERY: "onboarding.lcd-screen.v1";
|
|
7
8
|
/**
|
|
8
|
-
* The
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* (
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* The pager's declarative order. `stepIndex`/`totalSteps` are DERIVED from this list with
|
|
10
|
+
* gated rows removed (`invitation` today), so invitations-off yields ten steps and shifts
|
|
11
|
+
* every later index with no second table and no hole — the total can never be a constant.
|
|
12
|
+
*
|
|
13
|
+
* `begin-setup` ("Connect") is absent by design: its discovery scan ran only after the shell
|
|
14
|
+
* had ALREADY reached the node over HTTP, so on the shipped path it discovered nothing and was
|
|
15
|
+
* auto-advanced. Its screen still exists off-rail for the unreachable-node bootstrap case —
|
|
16
|
+
* see `OnboardingFlowService`'s `STEP_TABLE` comment.
|
|
15
17
|
*/
|
|
18
|
+
export const ONBOARDING_STEP_IDS: readonly ["join-qr", "open-browser", "choose-network", "network-password", "handoff", "way-back", "install", "match-code", "invitation", "identity", "trusted"];
|
|
19
|
+
export type OnboardingScenario = "new" | "pair" | "wifi" | "expired" | "lost";
|
|
20
|
+
export type OnboardingScreen = "scan" | "invite" | "identity" | "matchcode" | "handoff" | "done";
|
|
21
|
+
export type OnboardingPhase = "connect" | "install" | "secure" | "identify" | "ready";
|
|
16
22
|
export type OnboardingLifecycleState = "bootstrap-required" | "needs-onboarding" | "needs-pairing" | "ready";
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
* should start on (always `"new"` today; first-owner setup). */
|
|
23
|
+
export type OnboardingLifecycleStatus = {
|
|
24
|
+
readonly invitationsEnabled?: boolean;
|
|
20
25
|
readonly scenario?: OnboardingScenario;
|
|
21
26
|
readonly state: OnboardingLifecycleState;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
27
|
+
};
|
|
28
|
+
export type OnboardingDiscoveryCandidate = {
|
|
24
29
|
readonly id: string;
|
|
25
30
|
readonly maskedNodeId: string;
|
|
26
31
|
readonly name: string;
|
|
27
32
|
readonly ownership: "checking" | "owned" | "unowned";
|
|
28
|
-
}
|
|
33
|
+
};
|
|
29
34
|
export type OnboardingApprovalState = "waiting" | "approved" | "rejected" | "expired" | "cancelled";
|
|
30
|
-
export
|
|
35
|
+
export type OnboardingView = {
|
|
31
36
|
readonly approvalExpiresAt?: string;
|
|
32
37
|
readonly approvalState?: OnboardingApprovalState;
|
|
33
38
|
readonly candidates?: readonly OnboardingDiscoveryCandidate[];
|
|
@@ -36,22 +41,110 @@ export interface OnboardingView {
|
|
|
36
41
|
readonly reasonCode?: string;
|
|
37
42
|
readonly scenario: OnboardingScenario;
|
|
38
43
|
readonly screen: OnboardingScreen;
|
|
39
|
-
}
|
|
44
|
+
};
|
|
40
45
|
export type OnboardingEvent = OnboardingView;
|
|
46
|
+
export type OnboardingStepId = (typeof ONBOARDING_STEP_IDS)[number];
|
|
47
|
+
export type OnboardingLcdScreenId = "onboard_qr" | "onboard_open_browser" | "onboard_wifi_setup" | "wifi_setup_connecting" | "onboard_home_qr" | "onboard_wifi_joined" | "onboard_working" | "onboard_code" | "onboard_trusted" | "onboard_rejected";
|
|
48
|
+
export type OnboardingWifiSecurity = "open" | "wep" | "wpa2" | "wpa3";
|
|
49
|
+
/**
|
|
50
|
+
* Onboarding access-code rail (2026-08-10 design): a code-active node refused this device's
|
|
51
|
+
* claim outright — either the code is already bound to a different device
|
|
52
|
+
* (`code-already-bound`) or the supplied/missing code did not match (`access-code-invalid`,
|
|
53
|
+
* covering both `ACCESS_CODE_INVALID` and `ACCESS_CODE_REQUIRED`).
|
|
54
|
+
*/
|
|
55
|
+
export type OnboardingReasonCode = "approval-expired" | "approval-rejected" | "wifi-credentials-rejected" | "wifi-scan-failed" | "wifi-unreachable" | "invitation-invalid" | "claim-failed" | "code-already-bound" | "access-code-invalid";
|
|
56
|
+
export type OnboardingNetwork = {
|
|
57
|
+
readonly security: OnboardingWifiSecurity;
|
|
58
|
+
readonly signal: number;
|
|
59
|
+
readonly ssid: string;
|
|
60
|
+
};
|
|
61
|
+
export type OnboardingFlowBase = {
|
|
62
|
+
readonly lcdScreenId: OnboardingLcdScreenId;
|
|
63
|
+
readonly phase: OnboardingPhase;
|
|
64
|
+
readonly reasonCode?: OnboardingReasonCode;
|
|
65
|
+
readonly stepIndex: number;
|
|
66
|
+
readonly totalSteps: number;
|
|
67
|
+
};
|
|
68
|
+
export type OnboardingFlowView = (OnboardingFlowBase & {
|
|
69
|
+
readonly networks: readonly OnboardingNetwork[];
|
|
70
|
+
readonly scanning: boolean;
|
|
71
|
+
readonly stepId: "choose-network";
|
|
72
|
+
}) | (OnboardingFlowBase & {
|
|
73
|
+
readonly security: OnboardingWifiSecurity;
|
|
74
|
+
readonly ssid: string;
|
|
75
|
+
readonly stepId: "network-password";
|
|
76
|
+
}) | (OnboardingFlowBase & {
|
|
77
|
+
readonly approvalState: OnboardingApprovalState;
|
|
78
|
+
readonly digits: readonly string[];
|
|
79
|
+
readonly remainingSeconds: number;
|
|
80
|
+
readonly stepId: "match-code";
|
|
81
|
+
}) | (OnboardingFlowBase & {
|
|
82
|
+
readonly stepId: "invitation";
|
|
83
|
+
}) | (OnboardingFlowBase & {
|
|
84
|
+
readonly displayName: string;
|
|
85
|
+
readonly displayNameLocked: boolean;
|
|
86
|
+
readonly stepId: "identity";
|
|
87
|
+
readonly submitting: boolean;
|
|
88
|
+
}) | (OnboardingFlowBase & {
|
|
89
|
+
readonly sessionEstablished: boolean;
|
|
90
|
+
readonly stepId: "trusted";
|
|
91
|
+
}) | (OnboardingFlowBase & {
|
|
92
|
+
readonly ssid: string;
|
|
93
|
+
readonly stepId: "handoff";
|
|
94
|
+
}) | (OnboardingFlowBase & {
|
|
95
|
+
readonly stepId: Exclude<OnboardingStepId, "choose-network" | "handoff" | "identity" | "invitation" | "match-code" | "network-password" | "trusted">;
|
|
96
|
+
});
|
|
97
|
+
export type OnboardingLcdScreenTree = {
|
|
98
|
+
readonly children?: readonly OnboardingLcdScreenTree[];
|
|
99
|
+
readonly id: string;
|
|
100
|
+
readonly type: string;
|
|
101
|
+
readonly [extra: string]: unknown;
|
|
102
|
+
};
|
|
103
|
+
export type OnboardingLcdScreenState = Readonly<Record<string, number | string>>;
|
|
104
|
+
export type OnboardingLcdUnavailableReason = "not-registered" | "unreachable";
|
|
105
|
+
export type OnboardingLcdScreenBase = {
|
|
106
|
+
readonly awaitingNode: boolean;
|
|
107
|
+
readonly physicalTapOnly: boolean;
|
|
108
|
+
readonly screenId: OnboardingLcdScreenId;
|
|
109
|
+
readonly state: OnboardingLcdScreenState;
|
|
110
|
+
};
|
|
111
|
+
export type OnboardingLcdScreenView = (OnboardingLcdScreenBase & {
|
|
112
|
+
readonly kind: "authored";
|
|
113
|
+
}) | (OnboardingLcdScreenBase & {
|
|
114
|
+
readonly kind: "tree";
|
|
115
|
+
readonly tree: OnboardingLcdScreenTree;
|
|
116
|
+
}) | (OnboardingLcdScreenBase & {
|
|
117
|
+
readonly kind: "unavailable";
|
|
118
|
+
readonly reason: OnboardingLcdUnavailableReason;
|
|
119
|
+
});
|
|
41
120
|
export type OnboardingCommand = {
|
|
121
|
+
readonly kind: "advance";
|
|
122
|
+
} | {
|
|
123
|
+
readonly kind: "select-network";
|
|
124
|
+
readonly security: OnboardingWifiSecurity;
|
|
125
|
+
readonly ssid: string;
|
|
126
|
+
} | {
|
|
127
|
+
readonly kind: "rescan-networks";
|
|
128
|
+
} | {
|
|
129
|
+
readonly kind: "reselect-network";
|
|
130
|
+
} | {
|
|
131
|
+
readonly kind: "submit-network-password";
|
|
132
|
+
readonly secret: string;
|
|
133
|
+
} | {
|
|
134
|
+
readonly decision: "continue-in-browser" | "installed";
|
|
135
|
+
readonly kind: "install-decision";
|
|
136
|
+
} | {
|
|
137
|
+
readonly componentId: string;
|
|
138
|
+
readonly kind: "lcd-tap";
|
|
139
|
+
} | {
|
|
42
140
|
readonly kind: "advance-discovery";
|
|
43
141
|
} | {
|
|
44
142
|
readonly code: string;
|
|
45
143
|
readonly kind: "redeem-invitation";
|
|
46
|
-
} | {
|
|
47
|
-
readonly kind: "skip-invitation";
|
|
48
144
|
} | {
|
|
49
145
|
readonly displayName: string;
|
|
50
146
|
readonly kind: "submit-identity";
|
|
51
|
-
readonly nodeName: string;
|
|
52
147
|
readonly username: string;
|
|
53
|
-
} | {
|
|
54
|
-
readonly kind: "confirm-matchcode";
|
|
55
148
|
} | {
|
|
56
149
|
readonly kind: "submit-wifi";
|
|
57
150
|
readonly secret: string;
|
|
@@ -66,5 +159,4 @@ export type OnboardingCommand = {
|
|
|
66
159
|
} | {
|
|
67
160
|
readonly kind: "cancel";
|
|
68
161
|
};
|
|
69
|
-
export declare function isOnboardingCommand(value: unknown): value is OnboardingCommand;
|
|
70
162
|
//# sourceMappingURL=onboarding-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-contract.d.ts","sourceRoot":"","sources":["../../src/onboarding/onboarding-contract.
|
|
1
|
+
{"version":3,"file":"onboarding-contract.d.ts","sourceRoot":"","sources":["../../src/onboarding/onboarding-contract.js"],"names":[],"mappings":"AA0DA,mEAAmE;AACnE,2CADY,OAAO,GAAkB,KAAK,IAAI,iBAAiB,CAmC9D;AA/DD,sCAA6D,sBAAsB,CAAE;AACrF,iCAAwD,uBAAuB,CAAE;AACjF,gCAAuD,sBAAsB,CAAE;AAC/E,oCAA2D,oBAAoB,CAAE;AACjF,0CAAiE,0BAA0B,CAAE;AAC7F;;;;;;;;;GASG;AACH,kMAYG;iCAxDY,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM;+BAC5C,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM;8BACjE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO;uCACrD,oBAAoB,GAAG,kBAAkB,GAAG,eAAe,GAAG,OAAO;wCACvE;IAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;CAAE;2CAC5H;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,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
2
|
+
* @param {unknown} value
|
|
3
|
+
* @returns {value is OwnerClaimCompletePayload}
|
|
4
|
+
*/
|
|
5
|
+
export function isOwnerClaimCompletePayload(value: unknown): value is OwnerClaimCompletePayload;
|
|
6
|
+
/**
|
|
7
|
+
* First-owner "claim this unclaimed node" seam (#1815 DID-blocker fix,
|
|
8
|
+
* `.superpowers/sdd/did-blocker-report.md`). Deliberately separate from the generic
|
|
9
|
+
* (unwired) `ONBOARDING_COMMAND` in `./onboarding-contract.ts` — the same precedent as
|
|
10
|
+
* `DISCOVER_NODE_COMMAND` in `./discovery-contract.ts`, which is also "wired separately"
|
|
11
|
+
* rather than folded into a bigger, not-yet-built generic seam. `prepare` and `complete`
|
|
12
|
+
* are two commands (not one) because a person may spend anywhere from seconds to
|
|
13
|
+
* minutes physically walking to the node between them; `client/domain`'s
|
|
14
|
+
* `OwnerClaimService` holds the pending claim between the two calls and only unlocks it
|
|
15
|
+
* once the node itself has reported the physical confirmation.
|
|
16
|
+
* @type {"onboarding.owner-claim.prepare.v1"}
|
|
17
|
+
*/
|
|
18
|
+
export const OWNER_CLAIM_PREPARE_COMMAND: "onboarding.owner-claim.prepare.v1";
|
|
19
|
+
export const OWNER_CLAIM_COMPLETE_COMMAND: "onboarding.owner-claim.complete.v1";
|
|
20
|
+
/**
|
|
21
|
+
* `claimed-unpaired` is a SUCCESS: the owner + DID exist on the node, but the completion
|
|
22
|
+
* response carried no usable session tokens (or adopting them did not produce a session), so
|
|
23
|
+
* the shell must fall back to its ordinary device-pairing flow. Collapsing it into `claimed`
|
|
24
|
+
* would make the UI assert a trust relationship the browser does not actually hold.
|
|
25
|
+
*/
|
|
26
|
+
export type OwnerClaimCompleteOutcome = "claimed" | "claimed-unpaired" | "not-prepared" | "rejected" | "timed-out";
|
|
27
|
+
/**
|
|
28
|
+
* `prepare` carries NO payload (design §6.1): the node's `onboarding-prepare` route only ever
|
|
29
|
+
* received `{ public_key_multibase }`, and the identity that used to ride along was stashed
|
|
30
|
+
* purely client-side. Moving it to `complete` is what lets the match code appear at step 10
|
|
31
|
+
* while identity is not collected until step 12 — nothing is written until physical access
|
|
32
|
+
* has been proven.
|
|
33
|
+
*/
|
|
34
|
+
export type OwnerClaimPrepareResult = {
|
|
35
|
+
lcdHardware: boolean;
|
|
36
|
+
matchCode: string;
|
|
37
|
+
/**
|
|
38
|
+
* Empty string when the node's confirmation gate is disabled.
|
|
39
|
+
*/
|
|
40
|
+
operationHash: string;
|
|
41
|
+
requiresConfirmation: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type OwnerClaimCompletePayload = {
|
|
44
|
+
displayName: string;
|
|
45
|
+
username: string;
|
|
46
|
+
};
|
|
47
|
+
export type OwnerClaimCompleteResult = {
|
|
48
|
+
outcome: OwnerClaimCompleteOutcome;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=owner-claim-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-claim-contract.d.ts","sourceRoot":"","sources":["../../src/onboarding/owner-claim-contract.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,mDAHW,OAAO,GACL,KAAK,IAAI,yBAAyB,CAO9C;AAvBD;;;;;;;;;;;GAWG;AACH,0CAFU,mCAAmC,CAEkC;AAC/E,2CAA4C,oCAAoC,CAAC;;;;;;;wCAgBlE,SAAS,GACjB,kBAAkB,GAClB,cAAc,GACd,UAAU,GACV,WAAW;;;;;;;;;iBASJ,OAAO;eACP,MAAM;;;;mBACN,MAAM;0BACN,OAAO;;;iBAIP,MAAM;cACN,MAAM;;;aAIN,yBAAyB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const CLIENT_DEVICE_PAIRING_STATUS_QUERY: "client-device.pairing-status.v1";
|
|
2
|
+
/**
|
|
3
|
+
* Device-pairing wire-error codes shared verbatim across the Rust host and this TS client
|
|
4
|
+
* boundary (review recommendation, PR #2274). Canonical contract table:
|
|
5
|
+
* `docs/development/CAPABILITY_REGISTRY.md` § "Device-pairing wire-error contract" (mirrored
|
|
6
|
+
* on the Rust side by `core/domain/src/services/client_device_pairing_service.rs`'s
|
|
7
|
+
* `CLIENT_DEVICE_WIRE_ERROR_*` constants). These are the exact strings that travel over the
|
|
8
|
+
* wire — changing any value here is a cross-repo wire-contract change, not a local rename;
|
|
9
|
+
* every producer/consumer in that table must move together.
|
|
10
|
+
*/
|
|
11
|
+
export const CLIENT_DEVICE_WIRE_ERROR_NAME_TAKEN: "name_taken";
|
|
12
|
+
/** @see CLIENT_DEVICE_WIRE_ERROR_NAME_TAKEN */
|
|
13
|
+
export const CLIENT_DEVICE_WIRE_ERROR_LAST_DEVICE: "last_device";
|
|
14
|
+
/** @see CLIENT_DEVICE_WIRE_ERROR_NAME_TAKEN */
|
|
15
|
+
export const CLIENT_DEVICE_WIRE_ERROR_LAST_DEVICE_PROTECTED: "last_device_protected";
|
|
16
|
+
/** @see CLIENT_DEVICE_WIRE_ERROR_NAME_TAKEN */
|
|
17
|
+
export const CLIENT_DEVICE_WIRE_ERROR_DEVICE_NOT_REGISTERED: "device_not_registered";
|
|
18
|
+
/**
|
|
19
|
+
* Kernel-owned view of the CURRENT pairing attempt this browser has in flight (design M4,
|
|
20
|
+
* `docs/superpowers/plans/2026-08-11-pwa-trusted-devices.md`). Single-slot — there is never
|
|
21
|
+
* more than one attempt live at a time — so the row's `id` is always the literal
|
|
22
|
+
* `"pairing-status"`, mirroring `client-device.cleanup.v1`'s single fixed-id row
|
|
23
|
+
* (`client/kernel/src/queries/device-cleanup.js`).
|
|
24
|
+
*
|
|
25
|
+
* `status` is a superset of what `<node-pairing-gate>` renders directly: `"idle"` (no attempt
|
|
26
|
+
* has begun, or the last one was reset), `"pairing"` (an attempt is in flight, matches the
|
|
27
|
+
* gate's own `"pairing"` display status), `"ready"` (the owner approved — or session
|
|
28
|
+
* establishment simply succeeded on its own), `"declined"`, `"revoked"`, `"expired"`, and
|
|
29
|
+
* `"name_conflict"` (the requested device name collided with another active/pending device —
|
|
30
|
+
* `pairing-status-service.js`'s `isNameTaken`). `"error"` is reserved for a future
|
|
31
|
+
* non-transient failure this service does not yet classify — `PairingStatusService` never
|
|
32
|
+
* emits it today; every unclassified failure keeps the row at `"pairing"` and lets the next
|
|
33
|
+
* poll attempt retry (see that file's doc comment).
|
|
34
|
+
*/
|
|
35
|
+
export type ClientDevicePairingStatusRow = {
|
|
36
|
+
readonly id: "pairing-status";
|
|
37
|
+
readonly status: "idle" | "pairing" | "ready" | "declined" | "revoked" | "expired" | "name_conflict" | "error";
|
|
38
|
+
readonly message?: string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=pairing-status-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairing-status-contract.d.ts","sourceRoot":"","sources":["../src/pairing-status-contract.js"],"names":[],"mappings":"AACA,iDAAkD,iCAAiC,CAAC;AACpF;;;;;;;;GAQG;AACH,kDAAmD,YAAY,CAAC;AAChE,+CAA+C;AAC/C,mDAAoD,aAAa,CAAC;AAClE,+CAA+C;AAC/C,6DAA8D,uBAAuB,CAAC;AACtF,+CAA+C;AAC/C,6DAA8D,uBAAuB,CAAC;;;;;;;;;;;;;;;;;;2CAiBzE;IAAE,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAC,SAAS,GAAC,OAAO,GAAC,UAAU,GAAC,SAAS,GAAC,SAAS,GAAC,eAAe,GAAC,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @param {RpcRequest} request
|
|
3
|
+
* @returns {string}
|
|
4
|
+
*/
|
|
5
|
+
export function serializeRpcRequest(request: RpcRequest): string;
|
|
6
|
+
/**
|
|
7
|
+
* @param {string} serialized
|
|
8
|
+
* @returns {RpcRequest}
|
|
9
|
+
*/
|
|
10
|
+
export function deserializeRpcRequest(serialized: string): RpcRequest;
|
|
11
|
+
/**
|
|
12
|
+
* @param {RpcResponse} response
|
|
13
|
+
* @returns {string}
|
|
14
|
+
*/
|
|
15
|
+
export function serializeRpcResponse(response: RpcResponse): string;
|
|
16
|
+
/**
|
|
17
|
+
* @param {string} serialized
|
|
18
|
+
* @returns {RpcResponse}
|
|
19
|
+
*/
|
|
20
|
+
export function deserializeRpcResponse(serialized: string): RpcResponse;
|
|
21
|
+
/**
|
|
22
|
+
* @param {RpcEvent} event
|
|
23
|
+
* @returns {string}
|
|
24
|
+
*/
|
|
25
|
+
export function serializeRpcEvent(event: RpcEvent): string;
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} serialized
|
|
28
|
+
* @returns {RpcEvent}
|
|
29
|
+
*/
|
|
30
|
+
export function deserializeRpcEvent(serialized: string): RpcEvent;
|
|
31
|
+
export type DeviceCleanupDomainEvent = {
|
|
32
|
+
readonly occurredAt: string;
|
|
33
|
+
readonly payload: {
|
|
34
|
+
readonly state?: string;
|
|
35
|
+
};
|
|
36
|
+
readonly type: "device-cleanup.changed";
|
|
37
|
+
};
|
|
38
|
+
export type ProtocolDomainEvent = DomainEvent | DeviceCleanupDomainEvent;
|
|
39
|
+
export type ProtocolCoreKernelEventType = CoreKernelEventType | "device-cleanup.changed";
|
|
2
40
|
export type RpcRequest = {
|
|
3
41
|
readonly id: string;
|
|
4
42
|
readonly name: string;
|
|
@@ -20,7 +58,7 @@ export type RpcRequest = {
|
|
|
20
58
|
readonly subscriptionId: string;
|
|
21
59
|
readonly type: "live-query.unsubscribe";
|
|
22
60
|
} | {
|
|
23
|
-
readonly eventType:
|
|
61
|
+
readonly eventType: ProtocolDomainEvent["type"];
|
|
24
62
|
readonly id: string;
|
|
25
63
|
readonly subscriptionId: string;
|
|
26
64
|
readonly type: "event.subscribe";
|
|
@@ -29,7 +67,7 @@ export type RpcRequest = {
|
|
|
29
67
|
readonly subscriptionId: string;
|
|
30
68
|
readonly type: "event.unsubscribe";
|
|
31
69
|
} | {
|
|
32
|
-
readonly event:
|
|
70
|
+
readonly event: ProtocolDomainEvent;
|
|
33
71
|
readonly id: string;
|
|
34
72
|
readonly type: "event.publish";
|
|
35
73
|
} | {
|
|
@@ -60,7 +98,7 @@ export type RpcRequest = {
|
|
|
60
98
|
readonly subscriptionId: string;
|
|
61
99
|
readonly type: "stage.live-query.unsubscribe";
|
|
62
100
|
} | {
|
|
63
|
-
readonly eventType:
|
|
101
|
+
readonly eventType: ProtocolDomainEvent["type"];
|
|
64
102
|
readonly id: string;
|
|
65
103
|
readonly sessionId: string;
|
|
66
104
|
readonly subscriptionId: string;
|
|
@@ -71,7 +109,7 @@ export type RpcRequest = {
|
|
|
71
109
|
readonly subscriptionId: string;
|
|
72
110
|
readonly type: "stage.event.unsubscribe";
|
|
73
111
|
} | {
|
|
74
|
-
readonly event:
|
|
112
|
+
readonly event: ProtocolDomainEvent;
|
|
75
113
|
readonly id: string;
|
|
76
114
|
readonly sessionId: string;
|
|
77
115
|
readonly type: "stage.event.publish";
|
|
@@ -100,14 +138,14 @@ export type RpcEvent = {
|
|
|
100
138
|
readonly subscriptionId: string;
|
|
101
139
|
readonly type: "live-query.changed";
|
|
102
140
|
} | {
|
|
103
|
-
readonly event:
|
|
141
|
+
readonly event: ProtocolDomainEvent;
|
|
104
142
|
readonly subscriptionId: string;
|
|
105
143
|
readonly type: "kernel.event";
|
|
106
144
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
145
|
+
import type { DomainEvent } from '@econ-v1/domain';
|
|
146
|
+
import type { CoreKernelEventType } from '@econ-v1/domain';
|
|
147
|
+
import type { JsonValue } from '@econ-v1/domain';
|
|
148
|
+
import type { QueryName } from '@econ-v1/domain';
|
|
149
|
+
import type { ClientError } from '@econ-v1/domain';
|
|
150
|
+
import type { QueryDiff } from '@econ-v1/domain';
|
|
113
151
|
//# sourceMappingURL=protocol.d.ts.map
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,6CAHW,UAAU,GACR,MAAM,CAqClB;AACD;;;GAGG;AACH,kDAHW,MAAM,GACJ,UAAU,CA0BtB;AAYD;;;GAGG;AACH,+CAHW,WAAW,GACT,MAAM,CAMlB;AACD;;;GAGG;AACH,mDAHW,MAAM,GACJ,WAAW,CAUvB;AACD;;;GAGG;AACH,yCAHW,QAAQ,GACN,MAAM,CAMlB;AACD;;;GAGG;AACH,gDAHW,MAAM,GACJ,QAAQ,CAUpB;uCAhIa;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAA;CAAE;kCACvH,WAAW,GAAG,wBAAwB;0CACtC,mBAAmB,GAAG,wBAAwB;yBAutB7C;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC7G;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GACrG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,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ueryName;
|
|
3
|
+
export type Unsubscribe = import("./client.js").Unsubscribe;
|
|
4
|
+
export type DialogCenter = import("./dialog-contract.js").DialogCenter;
|
|
5
|
+
export type SystemNoticeCenter = import("./system-notice-contract.js").SystemNoticeCenter;
|
|
6
|
+
export type MountedStage = {
|
|
4
7
|
unmount(): Promise<void>;
|
|
5
|
-
}
|
|
8
|
+
};
|
|
6
9
|
export type StageLoadHandler = (appName: string, slot: Element) => Promise<MountedStage>;
|
|
7
|
-
export
|
|
10
|
+
export type StageContextShared = {
|
|
8
11
|
readonly app: {
|
|
9
12
|
readonly name: string;
|
|
10
13
|
readonly version: string;
|
|
11
14
|
};
|
|
12
15
|
readonly events: {
|
|
13
|
-
publish<T extends KernelEventType>(type: T, payload: KernelEventPayload<T>): Promise<void>;
|
|
14
|
-
subscribe<T extends KernelEventType>(type: T, listener: (event: KernelEventByType<T>) => void): Unsubscribe;
|
|
15
|
-
};
|
|
16
|
-
readonly host: {
|
|
17
|
-
navigate(path: string): void;
|
|
18
|
-
readonly root: Element;
|
|
19
|
-
readonly uiApi: 1;
|
|
16
|
+
publish<T extends KernelEventType>(type: T, payload: import("@econ-v1/domain").KernelEventPayload<T>): Promise<void>;
|
|
17
|
+
subscribe<T extends KernelEventType>(type: T, listener: (event: import("@econ-v1/domain").KernelEventByType<T>) => void): Unsubscribe;
|
|
20
18
|
};
|
|
21
19
|
invokeCapability<T>(capability: string, payload: unknown): Promise<T>;
|
|
22
|
-
liveQuery<T>(name: QueryName, params: unknown, listener: (diff: QueryDiff<T>) => void): Unsubscribe;
|
|
20
|
+
liveQuery<T>(name: QueryName, params: unknown, listener: (diff: import("@econ-v1/domain").QueryDiff<T>) => void): Unsubscribe;
|
|
23
21
|
query<T>(name: QueryName, params: unknown): Promise<T>;
|
|
24
22
|
readonly stage: {
|
|
25
23
|
load: StageLoadHandler;
|
|
26
24
|
};
|
|
27
|
-
}
|
|
28
|
-
export
|
|
25
|
+
};
|
|
26
|
+
export type StageHostShared = {
|
|
27
|
+
navigate(path: string): void;
|
|
28
|
+
readonly root: Element;
|
|
29
|
+
};
|
|
30
|
+
export type StageContextV1 = StageContextShared & {
|
|
31
|
+
readonly host: StageHostShared & {
|
|
32
|
+
readonly uiApi: 1;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type StageContextV2 = StageContextShared & {
|
|
36
|
+
readonly host: StageHostShared & {
|
|
37
|
+
readonly dialogs: DialogCenter;
|
|
38
|
+
readonly systemNotices: SystemNoticeCenter;
|
|
39
|
+
readonly uiApi: 2;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type StageContext = StageContextV1 | StageContextV2;
|
|
43
|
+
export type StageModule = {
|
|
29
44
|
mount(ctx: StageContext): void | Promise<void>;
|
|
30
45
|
unmount(): void | Promise<void>;
|
|
31
|
-
}
|
|
46
|
+
};
|
|
32
47
|
//# sourceMappingURL=stage-context.d.ts.map
|